Merge develop

This commit is contained in:
Pieter Vander Vennet 2024-01-16 04:27:59 +01:00
commit c672fe7668
138 changed files with 14304 additions and 1299 deletions

View file

@ -6,6 +6,7 @@ import { Utils } from "../src/Utils"
import Validators from "../src/UI/InputElement/Validators"
import { AllKnownLayouts } from "../src/Customizations/AllKnownLayouts"
import { AllSharedLayers } from "../src/Customizations/AllSharedLayers"
import Constants from "../src/Models/Constants"
const metainfo = {
type: "One of the inputValidator types",
@ -199,11 +200,12 @@ function extractHintsFrom(
if (hints["suggestions"]) {
const suggestions = hints["suggestions"]
const f = new Function("{ layers, themes, validators }", suggestions)
const f = new Function("{ layers, themes, validators, Constants }", suggestions)
hints["suggestions"] = f({
layers: AllSharedLayers.sharedLayers,
themes: AllKnownLayouts.allKnownLayouts,
validators: Validators,
Constants: Constants
})
}
return hints

View file

@ -13,6 +13,11 @@ import { Utils } from "../src/Utils"
import Constants from "../src/Models/Constants"
export default class GenerateImageAnalysis extends Script {
/**
* Max N in `image:N`-keys and `imageN` keys
* @private
*/
private static readonly maxImageIndex = 31
constructor() {
super(
[
@ -57,8 +62,9 @@ export default class GenerateImageAnalysis extends Script {
}
await this.fetchImages("image", datapath, refresh)
await this.fetchImages("image:streetsign", datapath, refresh)
for (let i = 0; i < 5; i++) {
for (let i = 0; i < GenerateImageAnalysis.maxImageIndex; i++) {
await this.fetchImages("image:" + i, datapath, refresh)
await this.fetchImages("image" + i, datapath, refresh)
}
}
@ -120,11 +126,16 @@ export default class GenerateImageAnalysis extends Script {
imageSource[feature.properties["image:streetsign"]] =
feature.properties.id + " (streetsign)"
for (let i = 0; i < 10; i++) {
for (let i = 0; i < GenerateImageAnalysis.maxImageIndex; i++) {
allImages.add(feature.properties["image:" + i])
imageSource[
feature.properties["image:" + i]
] = `${feature.properties.id} (image:${i})`
allImages.add(feature.properties["image" + i])
imageSource[
feature.properties["image" + i]
] = `${feature.properties.id} (image${i})`
}
}
allImages.delete(undefined)
@ -442,7 +453,7 @@ export default class GenerateImageAnalysis extends Script {
const imageBackupPath = args[0]
await this.downloadData(datapath, cached)
await this.downloadViews(datapath)
// await this.downloadViews(datapath)
await this.downloadMetadata(datapath)
await this.downloadAllImages(datapath, imageBackupPath)
this.analyze(datapath)

View file

@ -6,68 +6,99 @@ function genImages(dryrun = false) {
const blacklist: string[] = [
"add",
"addSmall",
"back",
"blocked",
"brick_wall",
"brick_wall_raw",
"brick_wall_round",
"brick_wall_square",
"bug",
"center",
"checkmark",
"clock",
"close",
"community",
"compass",
"compass_arrow",
"confirm",
"copyright",
"cross",
"cross_bottom_right",
"crosshair",
"crosshair_locked",
"crosshair-locked",
"delete_not_allowed",
"direction_gradient",
"direction_stroke",
"duplicate",
"elevator",
"elevator_wheelchair",
"liberapay",
"length_crosshair",
"speech_bubble_black_outline",
"square",
"star_half",
"star_outline",
"star",
"osm_logo_us",
"triangle",
"teardrop_with_hole_green",
"SocialImageForeground",
"wikipedia",
"Upload",
"pin",
"mapillary_black",
"plantnet_logo",
"mastodon",
"move-arrows",
"mapcomplete_logo",
"logo",
"logout",
"hand",
"help",
"home",
"reload",
"min",
"plus",
"not_found",
"osm_logo_us",
"party",
"eye",
"filter",
"filter_disable",
"floppy",
"eye",
"gear",
"gender_bi",
"compass",
"blocked",
"brick_wall",
"brick_wall_raw",
"brick_wall_round",
"bug",
"back",
"gender_inter",
"gender_female",
"gender_male",
"gender_trans",
"gender_queer",
"generic_map",
"gps_arrow",
"hand",
"help",
"home",
"length_crosshair",
"length-crosshair",
"liberapay",
"location",
"location_empty",
"location_locked",
"location_refused",
"location-refused",
"location_unlocked",
"logo",
"logout",
"mapcomplete_logo",
"mapillary",
"mapillary_black",
"mastodon",
"min",
"move-arrows",
"move_confirm",
"move_not_allowed",
"not_found",
"osm_logo_us",
"osm-logo-us",
"party",
"person",
"pin",
"plantnet_logo",
"plus",
"reload",
"ring",
"robot",
"SocialImageForeground",
"speech_bubble_black_outline",
"square",
"star",
"star_half",
"star_outline",
"teardrop",
"teardrop_with_hole_green",
"translate",
"triangle",
"Upload",
"wikidata",
"wikimedia-commons-white",
"wikimedia_commons_white",
"wikipedia",
].map((s) => s.toLowerCase())
const dir = fs.readdirSync("./assets/svg")
let module =
'import Img from "./UI/Base/Img";\nimport {FixedUiElement} from "./UI/Base/FixedUiElement";\n\n/* @deprecated */\nexport default class Svg {\n\n\n'
'import Img from "./UI/Base/Img";\n\n/* @deprecated */\nexport default class Svg {\n\n\n'
for (const path of dir) {
if (path.endsWith("license_info.json")) {
continue

View file

@ -16,9 +16,9 @@ export NODE_OPTIONS="--max-old-space-size=16384"
npm run generate:editor-layer-index &&
npm run prep:layeroverview &&
npm run generate && # includes a single "refresh:layeroverview". Resetting the files is unnecessary as they are not in there in the first place
npm run generate:mapcomplete-changes-theme &&
npm run refresh:layeroverview && # run refresh:layeroverview a second time to propagate all calls
npm run refresh:layeroverview && # run refresh:layeroverview a third time to fix some issues with the favourite layer all calls
npm run generate:mapcomplete-changes-theme &&
npm run generate:layouts