diff --git a/src/Logic/ContributorCount.ts b/src/Logic/ContributorCount.ts index a3095a2f34..c6c354445a 100644 --- a/src/Logic/ContributorCount.ts +++ b/src/Logic/ContributorCount.ts @@ -16,10 +16,9 @@ export default class ContributorCount { perLayer: ReadonlyMap }) { this.perLayer = state.perLayer - const self = this state.mapProperties.bounds.mapD( (bbox) => { - self.update(bbox) + this.update(bbox) }, [state.dataIsLoading] ) diff --git a/src/Models/MenuState.ts b/src/Models/MenuState.ts index 0795c7b76e..322fd01214 100644 --- a/src/Models/MenuState.ts +++ b/src/Models/MenuState.ts @@ -44,9 +44,9 @@ export class MenuState { undefined ) public highlightedUserSetting: UIEventSource = new UIEventSource(undefined) - private readonly _selectedElement: UIEventSource + private readonly _selectedElement: UIEventSource | undefined - constructor(selectedElement: UIEventSource) { + constructor(selectedElement: UIEventSource | undefined) { this._selectedElement = selectedElement // Note: this class is _not_ responsible to update the Hash, @see ThemeViewStateHashActor for this const states = {} @@ -118,7 +118,7 @@ export class MenuState { if (MenuState.previewedImage.data !== undefined) { return true } - if (this._selectedElement.data) { + if (this._selectedElement?.data) { return true } return Object.values(this.pageStates).some((t) => t.data) diff --git a/src/UI/AllThemesGui.svelte b/src/UI/AllThemesGui.svelte index aad6262cc5..2362993754 100644 --- a/src/UI/AllThemesGui.svelte +++ b/src/UI/AllThemesGui.svelte @@ -27,6 +27,11 @@ import { AndroidPolyfill } from "../Logic/Web/AndroidPolyfill" import Forgejo from "../assets/svg/Forgejo.svelte" import Locale from "./i18n/Locale" + import DrawerLeft from "./Base/DrawerLeft.svelte" + import MenuDrawer from "./BigComponents/MenuDrawer.svelte" + import { MenuState } from "../Models/MenuState" + import { MenuIcon } from "@rgossiaux/svelte-heroicons/solid" + import AccordionSingle from "./Flowbite/AccordionSingle.svelte" AndroidPolyfill.init().then(() => console.log("Android polyfill setup completed")) const featureSwitches = new OsmConnectionFeatureSwitches() @@ -39,6 +44,13 @@ ) }) const state = new UserRelatedState(osmConnection) + const guistate = new MenuState(undefined) + const menuDrawerState = { + guistate, osmConnection, + userRelatedState: state, + featureSwitches: { featureSwitchEnableLogin: new UIEventSource(true) } + } + const t = Translations.t.index const tu = Translations.t.general const tr = Translations.t.general.morescreen @@ -138,20 +150,36 @@
+
+ +
+ +
+ +
+
+
+
- +
+ + + +
- @@ -229,65 +259,15 @@ {/if} - - - - -

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
v{Constants.vNumber}
+ + +
diff --git a/src/UI/Base/Popup.svelte b/src/UI/Base/Popup.svelte index b644bcbae4..a5f54a560a 100644 --- a/src/UI/Base/Popup.svelte +++ b/src/UI/Base/Popup.svelte @@ -21,7 +21,7 @@ if (fullscreen) { defaultClass = shared } - let dialogClass = "fixed top-0 start-0 end-0 h-modal inset-0 w-full p-4 flex " + zIndex + let dialogClass = "fixed top-0 start-0 end-0 h-modal inset-0 w-full p-4 flex class-marker-dialog " + zIndex if (fullscreen) { dialogClass += " h-full-child" } diff --git a/src/UI/BigComponents/CopyrightPanel.svelte b/src/UI/BigComponents/CopyrightPanel.svelte index a54a0ebc6c..ae3d6c647f 100644 --- a/src/UI/BigComponents/CopyrightPanel.svelte +++ b/src/UI/BigComponents/CopyrightPanel.svelte @@ -1,5 +1,4 @@ +{#if changes} +
changes.flushChanges("Pending changes indicator clicked")} + > + {#if $isUploading} + + + + {:else if $pending.length === 1} + + {:else if $pending.length > 1} + + {/if} -
changes.flushChanges("Pending changes indicator clicked")} -> - {#if $isUploading} - - - - {:else if $pending.length === 1} - - {:else if $pending.length > 1} - - {/if} + {#each $errors as error} + + {/each} - {#each $errors as error} - - {/each} + {#if !compact && $pending.length > 0} + - {#if !compact && $pending.length > 0} - - -
    - {#each $pending as pending} -
  • - {#if pending.changes !== undefined} - Create {pending.type}/{pending.id} - {JSON.stringify(TagUtils.KVObjtoProperties(pending.tags))} - {:else} - Modify {pending.type}/{pending.id} {JSON.stringify(pending.tags)} - {/if} - {#if pending.type === "way" && pending.changes?.nodes} - {pending.changes.nodes.join(" ")} - {/if} -
  • - {/each} -
- {/if} -
+
    + {#each $pending as pending} +
  • + {#if pending.changes !== undefined} + Create {pending.type}/{pending.id} + {JSON.stringify(TagUtils.KVObjtoProperties(pending.tags))} + {:else} + Modify {pending.type}/{pending.id} {JSON.stringify(pending.tags)} + {/if} + {#if pending.type === "way" && pending.changes?.nodes} + {pending.changes.nodes.join(" ")} + {/if} +
  • + {/each} +
+ {/if} +
+{/if} diff --git a/src/UI/Popup/DisabledQuestions.svelte b/src/UI/Popup/DisabledQuestions.svelte index 1b36a76337..84d0ff8a47 100644 --- a/src/UI/Popup/DisabledQuestions.svelte +++ b/src/UI/Popup/DisabledQuestions.svelte @@ -3,29 +3,30 @@ import { Stores } from "../../Logic/UIEventSource" import Tr from "../Base/Tr.svelte" import Translations from "../i18n/Translations" - import type { SpecialVisualizationState } from "../SpecialVisualization" import ThemeViewState from "../../Models/ThemeViewState" /** * Shows _all_ disabled questions */ export let state: ThemeViewState - let layers = state.theme.layers.filter((l) => l.isNormal()) + let layers = state.theme?.layers?.filter((l) => l.isNormal()) let allDisabled = Stores.concat( - layers.map((l) => state.userRelatedState.getThemeDisabled(state.theme.id, l.id)) + layers?.map((l) => state.userRelatedState.getThemeDisabled(state.theme.id, l.id)) ?? [] ).map((l) => [].concat(...l)) const t = Translations.t.general.questions -

- -

-{#if $allDisabled.length === 0} - -{:else} - - {#each layers as layer (layer.id)} - - {/each} +{#if state.theme} +

+ +

+ {#if $allDisabled.length === 0} + + {:else} + + {#each layers as layer (layer.id)} + + {/each} + {/if} {/if} diff --git a/src/UI/SpecialVisualisations/SettingsVisualisations.ts b/src/UI/SpecialVisualisations/SettingsVisualisations.ts index a8c898a696..d80e6fe08f 100644 --- a/src/UI/SpecialVisualisations/SettingsVisualisations.ts +++ b/src/UI/SpecialVisualisations/SettingsVisualisations.ts @@ -24,7 +24,7 @@ export class SettingsVisualisations { docs: "A component to set the language of the user interface", constr(state: SpecialVisualizationState): SvelteUIElement { const availableLanguages = Locale.showLinkToWeblate.map((showTranslations) => - showTranslations ? LanguageUtils.usedLanguagesSorted : state.theme.language + showTranslations ? LanguageUtils.usedLanguagesSorted : (state?.theme?.language ?? LanguageUtils.usedLanguagesSorted) ) return new SvelteUIElement(LanguagePicker, { assignTo: state.userRelatedState.language,