Merge branch 'cleanup' into dev
This commit is contained in:
@@ -1,15 +1,21 @@
|
|||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig, envField } from 'astro/config';
|
||||||
|
|
||||||
import { availableLangs, defaultLang } from './src/i18n/ui';
|
|
||||||
|
|
||||||
import vue from "@astrojs/vue";
|
import vue from "@astrojs/vue";
|
||||||
import sitemap from "@astrojs/sitemap";
|
import sitemap from "@astrojs/sitemap";
|
||||||
|
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
integrations: [vue(), sitemap()],
|
integrations: [vue(), sitemap()],
|
||||||
output: 'static',
|
output: 'static',
|
||||||
site: 'https://maps.alexcreates.fr',
|
site: 'https://maps.alexcreates.fr',
|
||||||
prefetch: true
|
prefetch: true,
|
||||||
|
env: {
|
||||||
|
schema: {
|
||||||
|
ENABLE_TOOLBAR: envField.boolean({ context: "server", access: "secret", default: true }),
|
||||||
|
ENABLE_TOOLBAR_TAGS: envField.boolean({ context: "server", access: "secret", default: true }),
|
||||||
|
ENABLE_CUSTOM_MARKERS: envField.boolean({ context: "server", access: "secret", default: true }),
|
||||||
|
ENABLE_BREADCRUMB: envField.boolean({ context: "server", access: "secret", default: true }),
|
||||||
|
ENABLE_I18N: envField.boolean({ context: "server", access: "secret", default: true }),
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
18
package.json
18
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "leim-maps",
|
"name": "leim-maps",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.4.7",
|
"version": "1.4.8",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
"start": "astro dev",
|
"start": "astro dev",
|
||||||
@@ -10,18 +10,18 @@
|
|||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/sitemap": "^3.3.0",
|
"@astrojs/sitemap": "^3.3.1",
|
||||||
"@astrojs/vue": "^5.0.9",
|
"@astrojs/vue": "^5.0.13",
|
||||||
"@nanostores/persistent": "^0.10.2",
|
"@nanostores/persistent": "1.0.0",
|
||||||
"@nanostores/vue": "^0.11.0",
|
"@nanostores/vue": "^1.0.0",
|
||||||
"@types/leaflet": "^1.9.17",
|
"@types/leaflet": "^1.9.17",
|
||||||
"@vueuse/core": "^13.0.0",
|
"@vueuse/core": "^13.1.0",
|
||||||
"astro": "^5.6.1",
|
"astro": "^5.7.10",
|
||||||
"nanostores": "^0.11.4",
|
"nanostores": "^1.0.1",
|
||||||
"radix-vue": "^1.9.17",
|
"radix-vue": "^1.9.17",
|
||||||
"vue": "^3.5.13"
|
"vue": "^3.5.13"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"sass": "^1.86.3"
|
"sass": "^1.87.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1462
pnpm-lock.yaml
generated
1462
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,6 @@
|
|||||||
---
|
---
|
||||||
|
import { ENABLE_CUSTOM_MARKERS } from "astro:env/server";
|
||||||
|
|
||||||
import type { MapMarker, PlayerMarker } from '@/types/Leaflet';
|
import type { MapMarker, PlayerMarker } from '@/types/Leaflet';
|
||||||
import type { MapProps } from '@/types/Map';
|
import type { MapProps } from '@/types/Map';
|
||||||
import MarkerCreator from './overlay/MarkerCreator.vue';
|
import MarkerCreator from './overlay/MarkerCreator.vue';
|
||||||
@@ -23,8 +25,10 @@ const {
|
|||||||
<div class="map-wrapper">
|
<div class="map-wrapper">
|
||||||
<main class="world-wrapper">
|
<main class="world-wrapper">
|
||||||
<div id="world"></div>
|
<div id="world"></div>
|
||||||
|
|
||||||
<MarkerCreator client:only="vue" mapKey={mapKey} />
|
{ENABLE_CUSTOM_MARKERS &&
|
||||||
|
<MarkerCreator client:only="vue" mapKey={mapKey} />
|
||||||
|
}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div style="height: 0; width: 0; overflow: hidden; display: none;">
|
<div style="height: 0; width: 0; overflow: hidden; display: none;">
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
---
|
---
|
||||||
|
import { ENABLE_BREADCRUMB, ENABLE_I18N, ENABLE_TOOLBAR, ENABLE_TOOLBAR_TAGS } from "astro:env/server";
|
||||||
|
|
||||||
import type { MapMarker, PlayerMarker } from "@/types/Leaflet";
|
import type { MapMarker, PlayerMarker } from "@/types/Leaflet";
|
||||||
import type { MapOverlayProps } from "@/types/Map";
|
import type { MapOverlayProps } from "@/types/Map";
|
||||||
|
|
||||||
@@ -25,14 +27,27 @@ const currentUrl = Astro.url
|
|||||||
|
|
||||||
<div class="world-overlay">
|
<div class="world-overlay">
|
||||||
<div class="top-bar">
|
<div class="top-bar">
|
||||||
<SearchMarkers client:only="vue" mapKey={mapKey} markers={markers} players={players} searchConfig={searchConfig} >
|
{ENABLE_TOOLBAR &&
|
||||||
<div slot="fallback" style="height: 45px;"></div>
|
<SearchMarkers
|
||||||
</SearchMarkers>
|
client:only="vue"
|
||||||
|
mapKey={mapKey}
|
||||||
|
markers={markers}
|
||||||
|
players={players}
|
||||||
|
searchConfig={searchConfig}
|
||||||
|
disableTags={!ENABLE_TOOLBAR_TAGS}
|
||||||
|
>
|
||||||
|
<div slot="fallback" style="height: 45px;"></div>
|
||||||
|
</SearchMarkers>
|
||||||
|
}
|
||||||
|
|
||||||
<LangSwitcher currentUrl={currentUrl} client:only="vue" />
|
{ENABLE_I18N &&
|
||||||
|
<LangSwitcher currentUrl={currentUrl} client:only="vue" />
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<MapOverlayBreadcrumbs breadcrumbs={breadcrumbs} />
|
{ENABLE_BREADCRUMB &&
|
||||||
|
<MapOverlayBreadcrumbs breadcrumbs={breadcrumbs} />
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const props = defineProps<{
|
|||||||
players: PlayerMarker,
|
players: PlayerMarker,
|
||||||
mapKey?: string,
|
mapKey?: string,
|
||||||
searchConfig?: SearchConfig
|
searchConfig?: SearchConfig
|
||||||
|
disableTags?: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const customMarkersKey = props.mapKey ? `custom-markers-${props.mapKey}` : 'custom-markers'
|
const customMarkersKey = props.mapKey ? `custom-markers-${props.mapKey}` : 'custom-markers'
|
||||||
@@ -286,6 +287,7 @@ function resetAllFields(actionAfter?: "focusAfter") {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SearchMarkersTags
|
<SearchMarkersTags
|
||||||
|
v-if="!props.disableTags"
|
||||||
:current-search-mode="currentSearchMode"
|
:current-search-mode="currentSearchMode"
|
||||||
:custom-markers="customMarkersData"
|
:custom-markers="customMarkersData"
|
||||||
:search-config="props.searchConfig"
|
:search-config="props.searchConfig"
|
||||||
|
|||||||
12
src/env.d.ts
vendored
12
src/env.d.ts
vendored
@@ -1,2 +1,14 @@
|
|||||||
/// <reference path="../.astro/types.d.ts" />
|
/// <reference path="../.astro/types.d.ts" />
|
||||||
/// <reference types="astro/client" />
|
/// <reference types="astro/client" />
|
||||||
|
|
||||||
|
interface ImportMetaEnv {
|
||||||
|
readonly ENABLE_TOOLBAR: boolean
|
||||||
|
readonly ENABLE_TOOLBAR_TAGS: boolean
|
||||||
|
readonly ENABLE_CUSTOM_MARKERS: boolean
|
||||||
|
readonly ENABLE_BREADCRUMB: boolean
|
||||||
|
readonly ENABLE_I18N: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ImportMeta {
|
||||||
|
readonly env: ImportMetaEnv;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user