2024-08-29 02:46:51 +02:00
|
|
|
<script lang="ts">
|
|
|
|
import Translations from "../i18n/Translations"
|
|
|
|
import Page from "../Base/Page.svelte"
|
|
|
|
import Tr from "../Base/Tr.svelte"
|
|
|
|
import If from "../Base/If.svelte"
|
|
|
|
import CommunityIndexView from "./CommunityIndexView.svelte"
|
|
|
|
import Community from "../../assets/svg/Community.svelte"
|
|
|
|
import { Utils } from "../../Utils"
|
|
|
|
import DocumentMagnifyingGlass from "@babeard/svelte-heroicons/outline/DocumentMagnifyingGlass"
|
|
|
|
import OpenIdEditor from "./OpenIdEditor.svelte"
|
|
|
|
import OpenJosm from "../Base/OpenJosm.svelte"
|
|
|
|
import MapillaryLink from "./MapillaryLink.svelte"
|
|
|
|
import UserRelatedState from "../../Logic/State/UserRelatedState"
|
|
|
|
import ArrowDownTray from "@babeard/svelte-heroicons/mini/ArrowDownTray"
|
|
|
|
import DownloadPanel from "../DownloadFlow/DownloadPanel.svelte"
|
|
|
|
import Share from "@babeard/svelte-heroicons/solid/Share"
|
|
|
|
import ShareScreen from "./ShareScreen.svelte"
|
|
|
|
import FilterPage from "./FilterPage.svelte"
|
|
|
|
import RasterLayerOverview from "../Map/RasterLayerOverview.svelte"
|
|
|
|
import ThemeIntroPanel from "./ThemeIntroPanel.svelte"
|
|
|
|
import Marker from "../Map/Marker.svelte"
|
2025-06-19 02:46:02 +02:00
|
|
|
import { ShareIcon } from "@babeard/svelte-heroicons/mini"
|
2024-09-03 01:14:08 +02:00
|
|
|
import SidebarUnit from "../Base/SidebarUnit.svelte"
|
2024-09-30 01:08:07 +02:00
|
|
|
import PanoramaxLink from "./PanoramaxLink.svelte"
|
2024-11-26 20:15:41 +01:00
|
|
|
import { UIEventSource } from "../../Logic/UIEventSource"
|
2025-02-10 02:47:57 +01:00
|
|
|
import ChartBar from "@babeard/svelte-heroicons/solid/ChartBar"
|
|
|
|
import QueueList from "@babeard/svelte-heroicons/solid/QueueList"
|
2025-02-25 02:16:00 +01:00
|
|
|
import { MenuState } from "../../Models/MenuState"
|
|
|
|
import { OsmConnection } from "../../Logic/Osm/OsmConnection"
|
|
|
|
import FeatureSwitchState from "../../Logic/State/FeatureSwitchState"
|
|
|
|
import ThemeConfig from "../../Models/ThemeConfig/ThemeConfig"
|
|
|
|
import type { MapProperties } from "../../Models/MapProperties"
|
|
|
|
import FavouritesFeatureSource from "../../Logic/FeatureSource/Sources/FavouritesFeatureSource"
|
|
|
|
import Hotkeys from "../Base/Hotkeys"
|
2025-06-19 02:46:02 +02:00
|
|
|
import MenuDrawerIndex from "./MenuDrawerIndex.svelte"
|
2025-02-25 02:16:00 +01:00
|
|
|
|
2025-06-19 02:46:02 +02:00
|
|
|
export let onlyLink: boolean
|
2025-02-25 02:16:00 +01:00
|
|
|
export let state: {
|
|
|
|
favourites: FavouritesFeatureSource
|
2025-03-06 16:21:55 +01:00
|
|
|
guistate: MenuState
|
|
|
|
osmConnection: OsmConnection
|
|
|
|
theme?: ThemeConfig
|
|
|
|
featureSwitches: Partial<FeatureSwitchState>
|
|
|
|
mapProperties?: MapProperties
|
2025-02-25 02:16:00 +01:00
|
|
|
userRelatedState?: UserRelatedState
|
|
|
|
}
|
|
|
|
let hotkeys = Hotkeys._docs
|
2024-08-29 02:46:51 +02:00
|
|
|
let userdetails = state.osmConnection.userDetails
|
|
|
|
|
2024-10-17 04:06:03 +02:00
|
|
|
let theme = state.theme
|
2024-08-29 02:46:51 +02:00
|
|
|
let featureSwitches = state.featureSwitches
|
|
|
|
let pg = state.guistate.pageStates
|
2025-02-25 02:16:00 +01:00
|
|
|
let location = state.mapProperties?.location
|
2024-08-29 23:11:59 +02:00
|
|
|
const t = Translations.t.general.menu
|
2024-11-27 01:25:33 +01:00
|
|
|
let shown = new UIEventSource(state.guistate.pageStates.menu.data || !onlyLink)
|
2024-11-28 12:00:23 +01:00
|
|
|
state.guistate.pageStates.menu.addCallback((isShown) => {
|
|
|
|
if (!onlyLink) {
|
2024-11-27 01:25:33 +01:00
|
|
|
return true
|
|
|
|
}
|
2024-11-28 12:00:23 +01:00
|
|
|
if (isShown) {
|
2024-11-26 20:15:41 +01:00
|
|
|
shown.setData(true)
|
2024-11-28 12:00:23 +01:00
|
|
|
} else {
|
2024-11-26 20:15:41 +01:00
|
|
|
Utils.waitFor(250).then(() => {
|
|
|
|
shown.setData(state.guistate.pageStates.menu.data)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
2024-08-29 02:46:51 +02:00
|
|
|
</script>
|
|
|
|
|
2025-06-19 02:46:02 +02:00
|
|
|
<MenuDrawerIndex {state} {onlyLink} >
|
2024-08-29 02:46:51 +02:00
|
|
|
|
2024-08-29 23:11:59 +02:00
|
|
|
<!-- Theme related: documentation links, download, ... -->
|
2025-06-19 02:46:02 +02:00
|
|
|
<svelte:fragment slot="theme-tools">
|
|
|
|
{#if state.theme}
|
2025-02-25 02:16:00 +01:00
|
|
|
<SidebarUnit>
|
|
|
|
<h3>
|
|
|
|
<Tr t={t.aboutCurrentThemeTitle} />
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
<Page {onlyLink} shown={pg.about_theme}>
|
|
|
|
<svelte:fragment slot="link">
|
|
|
|
<Marker size="h-7 w-7" icons={theme.icon} />
|
|
|
|
<Tr t={t.showIntroduction} />
|
|
|
|
</svelte:fragment>
|
|
|
|
<svelte:fragment slot="header">
|
|
|
|
<Marker size="h-8 w-8 mr-3" icons={theme.icon} />
|
|
|
|
<Tr t={theme.title} />
|
|
|
|
</svelte:fragment>
|
|
|
|
<ThemeIntroPanel {state} />
|
|
|
|
</Page>
|
2024-08-29 02:46:51 +02:00
|
|
|
|
2025-02-25 02:16:00 +01:00
|
|
|
<FilterPage {onlyLink} {state} />
|
2024-08-29 02:46:51 +02:00
|
|
|
|
2025-02-25 02:16:00 +01:00
|
|
|
<RasterLayerOverview {onlyLink} {state} />
|
2024-08-29 23:11:59 +02:00
|
|
|
|
2025-02-25 02:16:00 +01:00
|
|
|
<Page {onlyLink} shown={pg.share}>
|
2024-09-02 11:46:45 +02:00
|
|
|
<svelte:fragment slot="header">
|
2025-02-25 02:16:00 +01:00
|
|
|
<Share />
|
|
|
|
<Tr t={Translations.t.general.sharescreen.title} />
|
2024-09-02 11:46:45 +02:00
|
|
|
</svelte:fragment>
|
2025-02-25 02:16:00 +01:00
|
|
|
<ShareScreen {state} />
|
2024-08-29 16:19:08 +02:00
|
|
|
</Page>
|
2024-08-29 02:46:51 +02:00
|
|
|
|
2025-02-25 02:16:00 +01:00
|
|
|
{#if state.featureSwitches?.featureSwitchEnableExport}
|
|
|
|
<Page {onlyLink} shown={pg.download}>
|
|
|
|
<svelte:fragment slot="header">
|
|
|
|
<ArrowDownTray />
|
|
|
|
<Tr t={Translations.t.general.download.title} />
|
|
|
|
</svelte:fragment>
|
|
|
|
<DownloadPanel {state} />
|
|
|
|
</Page>
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
{#if theme.official}
|
|
|
|
<a
|
|
|
|
class="flex"
|
|
|
|
href={"https://source.mapcomplete.org/MapComplete/MapComplete/src/branch/develop/Docs/Themes/" +
|
2025-03-06 16:21:55 +01:00
|
|
|
theme.id +
|
|
|
|
".md"}
|
2025-02-25 02:16:00 +01:00
|
|
|
target="_blank"
|
|
|
|
>
|
|
|
|
<DocumentMagnifyingGlass class="h-6 w-6" />
|
|
|
|
<Tr
|
|
|
|
t={Translations.t.general.attribution.openThemeDocumentation.Subs({
|
2025-03-06 16:21:55 +01:00
|
|
|
name: theme.title,
|
|
|
|
})}
|
2025-02-25 02:16:00 +01:00
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<a class="flex" href={Utils.OsmChaLinkFor(31, theme.id)} target="_blank">
|
|
|
|
<QueueList class="h-6 w-6" />
|
|
|
|
<Tr t={Translations.t.general.attribution.openOsmcha.Subs({ theme: theme.title })} />
|
|
|
|
</a>
|
2025-03-06 16:21:55 +01:00
|
|
|
<a
|
|
|
|
class="flex"
|
|
|
|
href={`./statistics.html?filter-mapcomplete-changes-theme-search={"search"%3A"${theme.id}"}`}
|
|
|
|
target="_blank"
|
|
|
|
>
|
2025-02-25 02:16:00 +01:00
|
|
|
<ChartBar class="h-6 w-6" />
|
2025-03-06 16:21:55 +01:00
|
|
|
<Tr t={Translations.t.general.attribution.openStatistics.Subs({ theme: theme.title })} />
|
2025-02-25 02:16:00 +01:00
|
|
|
</a>
|
|
|
|
{/if}
|
|
|
|
</SidebarUnit>
|
|
|
|
{/if}
|
2025-06-19 02:46:02 +02:00
|
|
|
</svelte:fragment>
|
2024-08-29 02:46:51 +02:00
|
|
|
|
2025-02-10 03:08:22 +01:00
|
|
|
|
2025-06-19 02:46:02 +02:00
|
|
|
<!-- Other links and tools for the given location: open iD/JOSM; community index, ... -->
|
|
|
|
<svelte:fragment slot="location-tools">
|
|
|
|
{#if state.mapProperties?.location}
|
|
|
|
<SidebarUnit>
|
|
|
|
<h3>
|
|
|
|
<Tr t={t.moreUtilsTitle} />
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
<Page {onlyLink} shown={pg.community_index}>
|
|
|
|
<svelte:fragment slot="header">
|
|
|
|
<Community />
|
|
|
|
<Tr t={Translations.t.communityIndex.title} />
|
|
|
|
</svelte:fragment>
|
|
|
|
<CommunityIndexView location={state.mapProperties.location} />
|
|
|
|
</Page>
|
2025-02-25 02:16:00 +01:00
|
|
|
|
2025-06-19 02:46:02 +02:00
|
|
|
<If condition={featureSwitches?.featureSwitchEnableLogin}>
|
|
|
|
<OpenIdEditor mapProperties={state.mapProperties} />
|
|
|
|
<OpenJosm {state} />
|
|
|
|
<PanoramaxLink large={false} mapProperties={state.mapProperties} />
|
|
|
|
<MapillaryLink large={false} mapProperties={state.mapProperties} />
|
|
|
|
</If>
|
2025-02-25 02:16:00 +01:00
|
|
|
|
2025-06-19 02:46:02 +02:00
|
|
|
<a class="sidebar-button flex" href="geo:{$location.lat},{$location.lon}">
|
|
|
|
<ShareIcon />
|
|
|
|
<Tr t={t.openHereDifferentApp} />
|
|
|
|
</a>
|
|
|
|
</SidebarUnit>
|
2025-02-25 02:16:00 +01:00
|
|
|
{/if}
|
2025-06-19 02:46:02 +02:00
|
|
|
</svelte:fragment>
|
2024-08-29 02:46:51 +02:00
|
|
|
|
2025-02-10 03:08:22 +01:00
|
|
|
|
2025-06-19 02:46:02 +02:00
|
|
|
</MenuDrawerIndex>
|