Merge branch 'develop' into feature/android-capacitator
This commit is contained in:
commit
c62705c1dd
5 changed files with 26 additions and 31 deletions
assets/themes/pets
src
Logic
Models/ThemeConfig/Conversion
UI
|
@ -117,7 +117,6 @@
|
|||
"it": "Negozi che accettano i cani",
|
||||
"ko": "반려견 친화적 상점"
|
||||
},
|
||||
|
||||
"pointRendering": [
|
||||
{
|
||||
"iconBadges+": [
|
||||
|
|
|
@ -59,6 +59,21 @@ export default class DetermineTheme {
|
|||
return layoutConfig
|
||||
}
|
||||
|
||||
private static createConversionContext(): DesugaringContext {
|
||||
const knownLayersDict = new Map<string, LayerConfigJson>()
|
||||
for (const key in known_layers["layers"]) {
|
||||
const layer = known_layers["layers"][key]
|
||||
knownLayersDict.set(layer.id, <LayerConfigJson>layer)
|
||||
}
|
||||
const convertState: DesugaringContext = {
|
||||
tagRenderings: DetermineTheme.getSharedTagRenderings(),
|
||||
tagRenderingOrder: DetermineTheme.getSharedTagRenderingOrder(),
|
||||
sharedLayers: knownLayersDict,
|
||||
publicLayers: new Set<string>()
|
||||
}
|
||||
return convertState
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the correct layout for this website
|
||||
*/
|
||||
|
@ -107,7 +122,8 @@ export default class DetermineTheme {
|
|||
"./assets/generated/themes/" + id + ".json",
|
||||
1000 * 60 * 60 * 60
|
||||
)
|
||||
return new ThemeConfig(config, true)
|
||||
const withDefault = new PrepareTheme(this.createConversionContext()).convertStrict(config)
|
||||
return new ThemeConfig(withDefault, true)
|
||||
}
|
||||
|
||||
private static getSharedTagRenderings(): Map<string, QuestionableTagRenderingConfigJson> {
|
||||
|
@ -163,22 +179,12 @@ export default class DetermineTheme {
|
|||
}
|
||||
}
|
||||
|
||||
const knownLayersDict = new Map<string, LayerConfigJson>()
|
||||
for (const key in known_layers["layers"]) {
|
||||
const layer = known_layers["layers"][key]
|
||||
knownLayersDict.set(layer.id, <LayerConfigJson>layer)
|
||||
}
|
||||
const convertState: DesugaringContext = {
|
||||
tagRenderings: DetermineTheme.getSharedTagRenderings(),
|
||||
tagRenderingOrder: DetermineTheme.getSharedTagRenderingOrder(),
|
||||
sharedLayers: knownLayersDict,
|
||||
publicLayers: new Set<string>(),
|
||||
}
|
||||
json = new FixLegacyTheme().convertStrict(json)
|
||||
const raw = json
|
||||
|
||||
json = new FixImages(DetermineTheme._knownImages).convertStrict(json)
|
||||
json.enableNoteImports = json.enableNoteImports ?? false
|
||||
const convertState = this.createConversionContext()
|
||||
json = new PrepareTheme(convertState).convertStrict(json)
|
||||
console.log("The layoutconfig is ", json)
|
||||
|
||||
|
|
|
@ -317,6 +317,10 @@ export class OsmPreferences {
|
|||
return
|
||||
}
|
||||
|
||||
if (Utils.runningFromConsole) {
|
||||
return
|
||||
}
|
||||
|
||||
if (this._fakeUser) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -1,14 +1,4 @@
|
|||
import {
|
||||
Concat,
|
||||
Conversion,
|
||||
DesugaringContext,
|
||||
DesugaringStep,
|
||||
Each,
|
||||
Fuse,
|
||||
On,
|
||||
Pass,
|
||||
SetDefault,
|
||||
} from "./Conversion"
|
||||
import { Concat, Conversion, DesugaringContext, DesugaringStep, Each, Fuse, On, Pass, SetDefault } from "./Conversion"
|
||||
import { ThemeConfigJson } from "../Json/ThemeConfigJson"
|
||||
import { PrepareLayer } from "./PrepareLayer"
|
||||
import { LayerConfigJson } from "../Json/LayerConfigJson"
|
||||
|
@ -175,7 +165,7 @@ class SubstituteLayer extends Conversion<string | LayerConfigJson, LayerConfigJs
|
|||
}
|
||||
}
|
||||
|
||||
class AddDefaultLayers extends DesugaringStep<ThemeConfigJson> {
|
||||
export class AddDefaultLayers extends DesugaringStep<ThemeConfigJson> {
|
||||
private readonly _state: DesugaringContext
|
||||
|
||||
constructor(state: DesugaringContext) {
|
||||
|
|
|
@ -3,11 +3,7 @@ import { FixedUiElement } from "./Base/FixedUiElement"
|
|||
import BaseUIElement from "./BaseUIElement"
|
||||
import Title from "./Base/Title"
|
||||
import { default as FeatureTitle } from "./Popup/Title.svelte"
|
||||
import {
|
||||
RenderingSpecification,
|
||||
SpecialVisualization,
|
||||
SpecialVisualizationState,
|
||||
} from "./SpecialVisualization"
|
||||
import { RenderingSpecification, SpecialVisualization, SpecialVisualizationState } from "./SpecialVisualization"
|
||||
import { HistogramViz } from "./Popup/HistogramViz"
|
||||
import MinimapViz from "./Popup/MinimapViz.svelte"
|
||||
import { ShareLinkViz } from "./Popup/ShareLinkViz"
|
||||
|
@ -453,7 +449,7 @@ export default class SpecialVisualizations {
|
|||
assignTo: state.userRelatedState.language,
|
||||
availableLanguages: languages,
|
||||
preferredLanguages: state.osmConnection.userDetails.map(
|
||||
(ud) => ud.languages
|
||||
(ud) => ud?.languages ?? []
|
||||
),
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue