@swr-data-lab/components 1.13.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Autocomplete/Autocomplete.stories.svelte.d.ts +27 -0
- package/dist/Autocomplete/Autocomplete.svelte +237 -0
- package/dist/Autocomplete/Autocomplete.svelte.d.ts +34 -0
- package/dist/Autocomplete/index.d.ts +2 -0
- package/dist/Button/Button.stories.svelte +19 -0
- package/dist/Button/Button.stories.svelte.d.ts +19 -0
- package/dist/Button/Button.svelte +38 -0
- package/dist/Button/Button.svelte.d.ts +10 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Caption/Caption.stories.svelte.d.ts +27 -0
- package/dist/Caption/Caption.svelte +21 -0
- package/dist/Caption/Caption.svelte.d.ts +8 -0
- package/dist/Caption/index.js +2 -0
- package/dist/Card/Card.stories.svelte +17 -0
- package/dist/Card/Card.stories.svelte.d.ts +19 -0
- package/dist/Card/Card.svelte +25 -0
- package/dist/Card/Card.svelte.d.ts +7 -0
- package/dist/Card/index.d.ts +2 -0
- package/dist/ChartFooter/ChartFooter.stories.svelte.d.ts +27 -0
- package/dist/ChartFooter/ChartFooter.svelte +38 -0
- package/dist/ChartFooter/ChartFooter.svelte.d.ts +8 -0
- package/dist/ChartFooter/index.d.ts +2 -0
- package/dist/ChartHeader/ChartHeader.stories.svelte.d.ts +27 -0
- package/{src → dist}/ChartHeader/ChartHeader.svelte +4 -12
- package/dist/ChartHeader/ChartHeader.svelte.d.ts +9 -0
- package/dist/ChartHeader/index.d.ts +2 -0
- package/dist/ChartList/ChartList.stories.svelte.d.ts +27 -0
- package/{src → dist}/ChartList/ChartList.svelte +2 -16
- package/dist/ChartList/ChartList.svelte.d.ts +14 -0
- package/dist/ChartList/index.js +2 -0
- package/dist/Copy/Copy.stories.svelte.d.ts +27 -0
- package/dist/Copy/Copy.svelte +21 -0
- package/dist/Copy/Copy.svelte.d.ts +8 -0
- package/dist/Copy/index.js +2 -0
- package/dist/DesignTokens/DesignTokens.svelte +58 -0
- package/dist/DesignTokens/DesignTokens.svelte.d.ts +7 -0
- package/dist/DesignTokens/Tokens.d.ts +26 -0
- package/dist/DesignTokens/Tokens.js +171 -0
- package/dist/DesignTokens/index.d.ts +8 -0
- package/dist/FormLabel/FormLabel.stories.svelte.d.ts +27 -0
- package/{src → dist}/FormLabel/FormLabel.svelte +2 -9
- package/dist/FormLabel/FormLabel.svelte.d.ts +9 -0
- package/dist/FormLabel/index.js +2 -0
- package/dist/Headline/Headline.stories.svelte.d.ts +27 -0
- package/{src → dist}/Headline/Headline.svelte +2 -7
- package/dist/Headline/Headline.svelte.d.ts +7 -0
- package/dist/Headline/index.js +2 -0
- package/{src → dist}/HighlightCard/HighlightCard.stories.svelte +7 -9
- package/dist/HighlightCard/HighlightCard.stories.svelte.d.ts +19 -0
- package/dist/HighlightCard/HighlightCard.svelte +54 -0
- package/dist/HighlightCard/HighlightCard.svelte.d.ts +9 -0
- package/dist/HighlightCard/index.d.ts +2 -0
- package/dist/Input/Input.svelte +32 -0
- package/dist/Input/Input.svelte.d.ts +23 -0
- package/dist/Input/index.d.ts +2 -0
- package/dist/Logotype/Logotype.stories.svelte +14 -0
- package/dist/Logotype/Logotype.stories.svelte.d.ts +19 -0
- package/dist/Logotype/Logotype.svelte.d.ts +26 -0
- package/dist/Middot/Middot.stories.svelte +14 -0
- package/dist/Middot/Middot.stories.svelte.d.ts +19 -0
- package/dist/Middot/Middot.svelte.d.ts +26 -0
- package/dist/Middot/index.d.ts +2 -0
- package/dist/Note/Note.stories.svelte.d.ts +27 -0
- package/dist/Note/Note.svelte +28 -0
- package/dist/Note/Note.svelte.d.ts +7 -0
- package/dist/Note/index.js +2 -0
- package/{src → dist}/Select/Select.stories.svelte +12 -15
- package/dist/Select/Select.stories.svelte.d.ts +19 -0
- package/dist/Select/Select.svelte +39 -0
- package/dist/Select/Select.svelte.d.ts +4 -0
- package/{src/Select/Select.types.ts → dist/Select/Select.types.d.ts} +1 -2
- package/dist/Select/Select.types.js +1 -0
- package/dist/Select/SelectStoriesTemplate.svelte.d.ts +15 -0
- package/dist/Select/index.d.ts +2 -0
- package/dist/Switcher/Switcher.stories.svelte.d.ts +27 -0
- package/dist/Switcher/Switcher.svelte +111 -0
- package/dist/Switcher/Switcher.svelte.d.ts +21 -0
- package/dist/Switcher/index.d.ts +2 -0
- package/dist/assets/close-circle.svg.svelte.d.ts +26 -0
- package/dist/assets/grow.svg.svelte.d.ts +26 -0
- package/dist/assets/hand-pointer.svg.svelte.d.ts +26 -0
- package/dist/assets/shrink.svg.svelte.d.ts +26 -0
- package/dist/assets/tap.svg.svelte.d.ts +26 -0
- package/dist/assets/times-circle-solid.svg.svelte.d.ts +26 -0
- package/dist/index.d.ts +29 -0
- package/dist/maplibre/AttributionControl/AttributionControl.stories.svelte +27 -0
- package/dist/maplibre/AttributionControl/AttributionControl.stories.svelte.d.ts +19 -0
- package/dist/maplibre/AttributionControl/AttributionControl.svelte +15 -0
- package/dist/maplibre/AttributionControl/AttributionControl.svelte.d.ts +8 -0
- package/dist/maplibre/AttributionControl/index.d.ts +2 -0
- package/dist/maplibre/GeocoderControl/GeocoderAPIs.d.ts +6 -0
- package/dist/maplibre/GeocoderControl/GeocoderAPIs.js +40 -0
- package/{src → dist}/maplibre/GeocoderControl/GeocoderControl.stories.svelte +10 -14
- package/dist/maplibre/GeocoderControl/GeocoderControl.stories.svelte.d.ts +19 -0
- package/dist/maplibre/GeocoderControl/GeocoderControl.svelte +25 -0
- package/dist/maplibre/GeocoderControl/GeocoderControl.svelte.d.ts +27 -0
- package/dist/maplibre/GeocoderControl/index.d.ts +2 -0
- package/dist/maplibre/Map/FallbackStyle.d.ts +3 -0
- package/dist/maplibre/Map/FallbackStyle.js +15 -0
- package/{src → dist}/maplibre/Map/Map.stories.svelte +19 -24
- package/dist/maplibre/Map/Map.stories.svelte.d.ts +19 -0
- package/dist/maplibre/Map/Map.svelte +91 -0
- package/dist/maplibre/Map/Map.svelte.d.ts +23 -0
- package/dist/maplibre/Map/index.d.ts +2 -0
- package/dist/maplibre/MapControl/MapControl.stories.svelte +46 -0
- package/dist/maplibre/MapControl/MapControl.stories.svelte.d.ts +19 -0
- package/dist/maplibre/MapControl/MapControl.svelte +29 -0
- package/dist/maplibre/MapControl/MapControl.svelte.d.ts +11 -0
- package/dist/maplibre/MapControl/index.d.ts +2 -0
- package/dist/maplibre/MapStyle/SWRDataLabLight.d.ts +3 -0
- package/dist/maplibre/MapStyle/SWRDataLabLight.js +60 -0
- package/{src → dist}/maplibre/MapStyle/SWRDataLabLight.stories.svelte +10 -12
- package/dist/maplibre/MapStyle/SWRDataLabLight.stories.svelte.d.ts +18 -0
- package/dist/maplibre/MapStyle/components/Admin.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Admin.js +170 -0
- package/dist/maplibre/MapStyle/components/Buildings.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Buildings.js +21 -0
- package/dist/maplibre/MapStyle/components/Landuse.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Landuse.js +497 -0
- package/dist/maplibre/MapStyle/components/Natural.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Natural.js +1 -0
- package/dist/maplibre/MapStyle/components/PlaceLabels.d.ts +4 -0
- package/dist/maplibre/MapStyle/components/PlaceLabels.js +194 -0
- package/dist/maplibre/MapStyle/components/Roads.d.ts +8 -0
- package/dist/maplibre/MapStyle/components/Roads.js +2327 -0
- package/dist/maplibre/MapStyle/components/Transit.d.ts +7 -0
- package/dist/maplibre/MapStyle/components/Transit.js +499 -0
- package/dist/maplibre/MapStyle/components/Walking.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Walking.js +1530 -0
- package/dist/maplibre/MapStyle/index.d.ts +2 -0
- package/dist/maplibre/MapStyle/tokens.d.ts +20 -0
- package/dist/maplibre/MapStyle/tokens.js +20 -0
- package/{src → dist}/maplibre/NavigationControl/NavigationControl.stories.svelte +9 -11
- package/dist/maplibre/NavigationControl/NavigationControl.stories.svelte.d.ts +19 -0
- package/dist/maplibre/NavigationControl/NavigationControl.svelte +9 -0
- package/dist/maplibre/NavigationControl/NavigationControl.svelte.d.ts +12 -0
- package/dist/maplibre/NavigationControl/index.d.ts +2 -0
- package/{src → dist}/maplibre/ScaleControl/ScaleControl.stories.svelte +10 -13
- package/dist/maplibre/ScaleControl/ScaleControl.stories.svelte.d.ts +19 -0
- package/dist/maplibre/ScaleControl/ScaleControl.svelte +9 -0
- package/dist/maplibre/ScaleControl/ScaleControl.svelte.d.ts +9 -0
- package/dist/maplibre/ScaleControl/index.d.ts +2 -0
- package/dist/maplibre/Source/MapSource.stories.svelte +7 -0
- package/dist/maplibre/Source/MapSource.stories.svelte.d.ts +19 -0
- package/dist/maplibre/Source/MapSource.svelte +43 -0
- package/dist/maplibre/Source/MapSource.svelte.d.ts +13 -0
- package/dist/maplibre/Source/index.d.ts +2 -0
- package/dist/maplibre/Source/source.d.ts +28 -0
- package/dist/maplibre/Source/source.js +76 -0
- package/{src → dist}/maplibre/Tooltip/Tooltip.stories.svelte +17 -23
- package/dist/maplibre/Tooltip/Tooltip.stories.svelte.d.ts +19 -0
- package/dist/maplibre/Tooltip/Tooltip.svelte +46 -0
- package/dist/maplibre/Tooltip/Tooltip.svelte.d.ts +25 -0
- package/dist/maplibre/Tooltip/index.d.ts +2 -0
- package/{src → dist}/maplibre/VectorLayer/VectorLayer.stories.svelte +11 -14
- package/dist/maplibre/VectorLayer/VectorLayer.stories.svelte.d.ts +19 -0
- package/dist/maplibre/VectorLayer/VectorLayer.svelte +73 -0
- package/dist/maplibre/VectorLayer/VectorLayer.svelte.d.ts +21 -0
- package/dist/maplibre/VectorLayer/index.d.ts +2 -0
- package/{src → dist}/maplibre/VectorTileSource/VectorTileSource.stories.svelte +11 -13
- package/dist/maplibre/VectorTileSource/VectorTileSource.stories.svelte.d.ts +19 -0
- package/dist/maplibre/VectorTileSource/VectorTileSource.svelte +13 -0
- package/dist/maplibre/VectorTileSource/VectorTileSource.svelte.d.ts +11 -0
- package/dist/maplibre/VectorTileSource/index.d.ts +2 -0
- package/dist/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte +27 -0
- package/dist/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte.d.ts +19 -0
- package/dist/maplibre/WithLinkLocation/WithLinkLocation.svelte +44 -0
- package/dist/maplibre/WithLinkLocation/WithLinkLocation.svelte.d.ts +19 -0
- package/dist/maplibre/WithLinkLocation/index.d.ts +2 -0
- package/dist/maplibre/context.svelte.d.ts +33 -0
- package/dist/maplibre/context.svelte.js +73 -0
- package/{src/maplibre/types.ts → dist/maplibre/types.d.ts} +3 -5
- package/dist/maplibre/types.js +1 -0
- package/dist/maplibre/utils.d.ts +4 -0
- package/dist/maplibre/utils.js +34 -0
- package/dist/utils/formatDate.d.ts +5 -0
- package/dist/utils/formatNumber.d.ts +18 -0
- package/dist/utils/getColorsBetween.d.ts +9 -0
- package/dist/utils/getComparisonDiffs.d.ts +6 -0
- package/dist/utils/getEmbedContext.d.ts +7 -0
- package/dist/utils/getEmbedContext.js +27 -0
- package/dist/utils/getLaenderFromTopo.d.ts +10 -0
- package/dist/utils/getLaenderNicenameFromAgs.d.ts +7 -0
- package/dist/utils/isSvelteComponent.d.ts +7 -0
- package/dist/utils/prepareSophoraModel.d.ts +2 -0
- package/dist/utils/scrollIntoViewWithOffset.d.ts +7 -0
- package/dist/utils/slugify.d.ts +1 -0
- package/dist/utils/slugify.js +11 -0
- package/dist/utils/topoToGeo.d.ts +7 -0
- package/package.json +30 -7
- package/.storybook/blocks/Mermaid.jsx +0 -9
- package/.storybook/main.ts +0 -34
- package/.storybook/preview-head.html +0 -13
- package/.storybook/preview.ts +0 -47
- package/.storybook/vitest.setup.ts +0 -9
- package/src/Autocomplete/Autocomplete.svelte +0 -237
- package/src/Button/Button.stories.svelte +0 -21
- package/src/Button/Button.svelte +0 -52
- package/src/Caption/Caption.svelte +0 -29
- package/src/Card/Card.stories.svelte +0 -19
- package/src/Card/Card.svelte +0 -34
- package/src/ChartFooter/ChartFooter.svelte +0 -46
- package/src/Copy/Copy.svelte +0 -29
- package/src/DesignTokens/DesignTokens.svelte +0 -71
- package/src/DesignTokens/Tokens.ts +0 -186
- package/src/HighlightCard/HighlightCard.svelte +0 -65
- package/src/Input/Input.svelte +0 -21
- package/src/Logotype/Logotype.stories.svelte +0 -16
- package/src/Middot/Middot.stories.svelte +0 -16
- package/src/Note/Note.svelte +0 -38
- package/src/Select/Select.svelte +0 -76
- package/src/Switcher/Switcher.svelte +0 -130
- package/src/maplibre/AttributionControl/AttributionControl.stories.svelte +0 -29
- package/src/maplibre/AttributionControl/AttributionControl.svelte +0 -45
- package/src/maplibre/GeocoderControl/GeocoderAPIs.ts +0 -49
- package/src/maplibre/GeocoderControl/GeocoderControl.svelte +0 -211
- package/src/maplibre/Map/FallbackStyle.ts +0 -18
- package/src/maplibre/Map/Map.svelte +0 -287
- package/src/maplibre/MapControl/MapControl.stories.svelte +0 -56
- package/src/maplibre/MapControl/MapControl.svelte +0 -41
- package/src/maplibre/MapStyle/SWRDataLabLight.ts +0 -72
- package/src/maplibre/MapStyle/components/Admin.ts +0 -173
- package/src/maplibre/MapStyle/components/Buildings.ts +0 -23
- package/src/maplibre/MapStyle/components/Landuse.ts +0 -499
- package/src/maplibre/MapStyle/components/Natural.ts +0 -1
- package/src/maplibre/MapStyle/components/PlaceLabels.ts +0 -199
- package/src/maplibre/MapStyle/components/Roads.ts +0 -2345
- package/src/maplibre/MapStyle/components/Transit.ts +0 -507
- package/src/maplibre/MapStyle/components/Walking.ts +0 -1538
- package/src/maplibre/MapStyle/tokens.ts +0 -21
- package/src/maplibre/NavigationControl/NavigationControl.svelte +0 -36
- package/src/maplibre/ScaleControl/ScaleControl.svelte +0 -25
- package/src/maplibre/Source/MapSource.stories.svelte +0 -9
- package/src/maplibre/Source/MapSource.svelte +0 -61
- package/src/maplibre/Source/source.ts +0 -89
- package/src/maplibre/Tooltip/Tooltip.svelte +0 -183
- package/src/maplibre/VectorLayer/VectorLayer.svelte +0 -146
- package/src/maplibre/VectorTileSource/VectorTileSource.svelte +0 -24
- package/src/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte +0 -29
- package/src/maplibre/WithLinkLocation/WithLinkLocation.svelte +0 -83
- package/src/maplibre/context.svelte.ts +0 -89
- package/src/maplibre/utils.ts +0 -52
- package/src/utils/getEmbedContext.js +0 -28
- package/src/utils/slugify.ts +0 -12
- package/static/favicon.png +0 -0
- package/svelte.config.js +0 -18
- package/tsconfig.json +0 -19
- package/vite.config.ts +0 -6
- package/vitest.workspace.ts +0 -32
- /package/{src → dist}/Autocomplete/Autocomplete.stories.svelte +0 -0
- /package/{src → dist}/Autocomplete/index.js +0 -0
- /package/{src → dist}/Button/index.js +0 -0
- /package/{src → dist}/Caption/Caption.stories.svelte +0 -0
- /package/{src/Caption/index.ts → dist/Caption/index.d.ts} +0 -0
- /package/{src → dist}/Card/index.js +0 -0
- /package/{src → dist}/ChartFooter/ChartFooter.mdx +0 -0
- /package/{src → dist}/ChartFooter/ChartFooter.stories.svelte +0 -0
- /package/{src → dist}/ChartFooter/index.js +0 -0
- /package/{src → dist}/ChartHeader/ChartHeader.mdx +0 -0
- /package/{src → dist}/ChartHeader/ChartHeader.stories.svelte +0 -0
- /package/{src → dist}/ChartHeader/index.js +0 -0
- /package/{src → dist}/ChartList/ChartList.mdx +0 -0
- /package/{src → dist}/ChartList/ChartList.stories.svelte +0 -0
- /package/{src/ChartList/index.ts → dist/ChartList/index.d.ts} +0 -0
- /package/{src → dist}/Copy/Copy.stories.svelte +0 -0
- /package/{src/Copy/index.ts → dist/Copy/index.d.ts} +0 -0
- /package/{src → dist}/DesignTokens/DesignTokens.mdx +0 -0
- /package/{src → dist}/DesignTokens/index.js +0 -0
- /package/{src → dist}/FormLabel/FormLabel.mdx +0 -0
- /package/{src → dist}/FormLabel/FormLabel.stories.svelte +0 -0
- /package/{src/FormLabel/index.ts → dist/FormLabel/index.d.ts} +0 -0
- /package/{src → dist}/Headline/Headline.stories.svelte +0 -0
- /package/{src/Headline/index.ts → dist/Headline/index.d.ts} +0 -0
- /package/{src → dist}/HighlightCard/index.js +0 -0
- /package/{src → dist}/Input/index.js +0 -0
- /package/{src → dist}/Intro.mdx +0 -0
- /package/{src → dist}/Logotype/Logotype.svelte +0 -0
- /package/{src → dist}/Middot/Middot.svelte +0 -0
- /package/{src → dist}/Middot/index.js +0 -0
- /package/{src → dist}/Note/Note.stories.svelte +0 -0
- /package/{src/Note/index.ts → dist/Note/index.d.ts} +0 -0
- /package/{src → dist}/Select/Select.mdx +0 -0
- /package/{src → dist}/Select/SelectStoriesTemplate.svelte +0 -0
- /package/{src → dist}/Select/index.js +0 -0
- /package/{src → dist}/Select/mock_data/jobs.json +0 -0
- /package/{src → dist}/Switcher/Switcher.mdx +0 -0
- /package/{src → dist}/Switcher/Switcher.stories.svelte +0 -0
- /package/{src → dist}/Switcher/index.js +0 -0
- /package/{src → dist}/app.d.ts +0 -0
- /package/{src → dist}/app.html +0 -0
- /package/{src → dist}/assets/close-circle.svg.svelte +0 -0
- /package/{src → dist}/assets/grow.svg.svelte +0 -0
- /package/{src → dist}/assets/hand-pointer.svg.svelte +0 -0
- /package/{src → dist}/assets/shrink.svg.svelte +0 -0
- /package/{src → dist}/assets/tap.svg.svelte +0 -0
- /package/{src → dist}/assets/times-circle-solid.svg.svelte +0 -0
- /package/{src → dist}/index.js +0 -0
- /package/{src → dist}/maplibre/AttributionControl/index.js +0 -0
- /package/{src → dist}/maplibre/GeocoderControl/index.js +0 -0
- /package/{src → dist}/maplibre/Map/index.js +0 -0
- /package/{src → dist}/maplibre/MapControl/MapControl.mdx +0 -0
- /package/{src → dist}/maplibre/MapControl/index.js +0 -0
- /package/{src → dist}/maplibre/MapStyle/SWRDataLabLight.mdx +0 -0
- /package/{src → dist}/maplibre/MapStyle/index.js +0 -0
- /package/{src → dist}/maplibre/Maplibre.mdx +0 -0
- /package/{src → dist}/maplibre/NavigationControl/index.js +0 -0
- /package/{src → dist}/maplibre/ScaleControl/index.js +0 -0
- /package/{src → dist}/maplibre/Source/index.js +0 -0
- /package/{src → dist}/maplibre/Tooltip/index.js +0 -0
- /package/{src → dist}/maplibre/VectorLayer/index.js +0 -0
- /package/{src → dist}/maplibre/VectorTileSource/VectorTileSource.mdx +0 -0
- /package/{src → dist}/maplibre/VectorTileSource/index.js +0 -0
- /package/{src → dist}/maplibre/WithLinkLocation/WithLinkLocation.mdx +0 -0
- /package/{src → dist}/maplibre/WithLinkLocation/index.js +0 -0
- /package/{src → dist}/styles/base.scss +0 -0
- /package/{src → dist}/utils/formatDate.js +0 -0
- /package/{src → dist}/utils/formatNumber.js +0 -0
- /package/{src → dist}/utils/getColorsBetween.js +0 -0
- /package/{src → dist}/utils/getComparisonDiffs.js +0 -0
- /package/{src → dist}/utils/getLaenderFromTopo.js +0 -0
- /package/{src → dist}/utils/getLaenderNicenameFromAgs.js +0 -0
- /package/{src → dist}/utils/isSvelteComponent.js +0 -0
- /package/{src → dist}/utils/prepareSophoraModel.js +0 -0
- /package/{src → dist}/utils/scrollIntoViewWithOffset.js +0 -0
- /package/{src → dist}/utils/topoToGeo.js +0 -0
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { onMount, setContext, type Snippet } from 'svelte';
|
|
3
|
-
import { MaptilerGeocoderAPI } from '../GeocoderControl/GeocoderAPIs';
|
|
4
|
-
import {
|
|
5
|
-
type GeocodingCountry,
|
|
6
|
-
type GeocodingLanguage,
|
|
7
|
-
type GeocodingService,
|
|
8
|
-
type Location
|
|
9
|
-
} from '../types';
|
|
10
|
-
|
|
11
|
-
import type {
|
|
12
|
-
MaplibreGeocoderApi,
|
|
13
|
-
MaplibreGeocoderApiConfig
|
|
14
|
-
} from '@maplibre/maplibre-gl-geocoder';
|
|
15
|
-
|
|
16
|
-
interface WithLinkLocationProps {
|
|
17
|
-
service?: GeocodingService;
|
|
18
|
-
/**
|
|
19
|
-
* API key for selected geocoding `service`
|
|
20
|
-
*/
|
|
21
|
-
key: string;
|
|
22
|
-
/**
|
|
23
|
-
* Limit search to one or more countries
|
|
24
|
-
*/
|
|
25
|
-
countries?: GeocodingLanguage | GeocodingCountry[];
|
|
26
|
-
languages?: GeocodingLanguage | GeocodingLanguage[];
|
|
27
|
-
urlParameter?: string;
|
|
28
|
-
children: Snippet;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const {
|
|
32
|
-
key,
|
|
33
|
-
service = 'maptiler',
|
|
34
|
-
countries = 'de',
|
|
35
|
-
languages = 'de',
|
|
36
|
-
urlParameter = 'location',
|
|
37
|
-
children
|
|
38
|
-
}: WithLinkLocationProps = $props();
|
|
39
|
-
|
|
40
|
-
const countriesArr = Array.isArray(countries) ? countries : [countries];
|
|
41
|
-
const languagesArr = Array.isArray(languages) ? languages : [languages];
|
|
42
|
-
|
|
43
|
-
let geocoder: MaplibreGeocoderApi;
|
|
44
|
-
if (service === 'maptiler') {
|
|
45
|
-
geocoder = new MaptilerGeocoderAPI(key);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
let location: Location | boolean | undefined = $state();
|
|
49
|
-
|
|
50
|
-
function bboxToArea(bbox: [number, number, number, number]) {
|
|
51
|
-
return (bbox[2] - bbox[0]) * (bbox[3] - bbox[1]);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
onMount(async () => {
|
|
55
|
-
const params = new URLSearchParams(window.location.search);
|
|
56
|
-
if (params.has(urlParameter)) {
|
|
57
|
-
const config: MaplibreGeocoderApiConfig = {
|
|
58
|
-
countries: countriesArr.join(','),
|
|
59
|
-
language: languagesArr.join(','),
|
|
60
|
-
query: params.get(urlParameter)?.toString(),
|
|
61
|
-
limit: 1
|
|
62
|
-
};
|
|
63
|
-
const res = await geocoder.forwardGeocode(config);
|
|
64
|
-
if (res.features[0].bbox && res.features[0].geometry.type === 'Point') {
|
|
65
|
-
location = {
|
|
66
|
-
lat: res.features[0].geometry.coordinates[1],
|
|
67
|
-
lng: res.features[0].geometry.coordinates[0],
|
|
68
|
-
zoom: 11 - bboxToArea(res.features[0].bbox) * 5.5
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
} else {
|
|
72
|
-
location = false;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
$effect.pre(() => {
|
|
77
|
-
setContext('initialLocation', location);
|
|
78
|
-
});
|
|
79
|
-
</script>
|
|
80
|
-
|
|
81
|
-
{#if location !== undefined}
|
|
82
|
-
{@render children?.()}
|
|
83
|
-
{/if}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type { Map as MapLibre, Marker, LayerSpecification } from 'maplibre-gl';
|
|
2
|
-
import { getContext, setContext } from 'svelte';
|
|
3
|
-
|
|
4
|
-
const MAP_CONTEXT_KEY = Symbol.for('map-context');
|
|
5
|
-
const SOURCE_CONTEXT_KEY = Symbol.for('source-context');
|
|
6
|
-
const LAYER_CONTEXT_KEY = Symbol.for('layer-context');
|
|
7
|
-
const POPUP_TARGET_KEY = Symbol.for('popup-target');
|
|
8
|
-
|
|
9
|
-
export class Box<T> {
|
|
10
|
-
value = $state() as T;
|
|
11
|
-
|
|
12
|
-
constructor(initialValue: T) {
|
|
13
|
-
this.value = initialValue;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export class MapContext {
|
|
18
|
-
_map = $state(null) as MapLibre | null;
|
|
19
|
-
minzoom = $state(0);
|
|
20
|
-
maxzoom = $state(24);
|
|
21
|
-
styleLoaded = $state(false);
|
|
22
|
-
private _listener?: maplibregl.Listener = undefined;
|
|
23
|
-
|
|
24
|
-
get map() {
|
|
25
|
-
return this._map;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
set map(value: maplibregl.Map | null) {
|
|
29
|
-
// Unbind any old event listeners
|
|
30
|
-
if (this._listener) {
|
|
31
|
-
this._map?.off('styledata', this._listener);
|
|
32
|
-
this._listener = undefined;
|
|
33
|
-
}
|
|
34
|
-
// Set new map instance and bind new event listeners
|
|
35
|
-
this._map = value;
|
|
36
|
-
if (this._map) {
|
|
37
|
-
this._listener = this._onstyledata.bind(this);
|
|
38
|
-
this._map.on('styledata', this._listener);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
private _onstyledata(e: maplibregl.MapStyleDataEvent) {
|
|
43
|
-
this.styleLoaded = true;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export class SourceContext {
|
|
48
|
-
_source = $state();
|
|
49
|
-
loaded = $state(false);
|
|
50
|
-
minzoom = $state(0);
|
|
51
|
-
maxzoom = $state(24);
|
|
52
|
-
|
|
53
|
-
get source() {
|
|
54
|
-
return this._source;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
export class LayerContext {
|
|
58
|
-
layer = $state() as LayerSpecification;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function setPopupTarget(value: Box<Marker | string | undefined>) {
|
|
62
|
-
setContext(POPUP_TARGET_KEY, value);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function getPopupTarget(): Box<Marker | string> | undefined {
|
|
66
|
-
return getContext(POPUP_TARGET_KEY);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function createMapContext(): MapContext {
|
|
70
|
-
return setContext(MAP_CONTEXT_KEY, new MapContext());
|
|
71
|
-
}
|
|
72
|
-
export function getMapContext(): MapContext {
|
|
73
|
-
return getContext(MAP_CONTEXT_KEY);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function createSourceContext(): SourceContext {
|
|
77
|
-
return setContext(SOURCE_CONTEXT_KEY, new SourceContext());
|
|
78
|
-
}
|
|
79
|
-
export function getSourceContext(): SourceContext {
|
|
80
|
-
return getContext(SOURCE_CONTEXT_KEY);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function getLayerContext(): LayerContext {
|
|
84
|
-
return getContext(LAYER_CONTEXT_KEY);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function setLayerContext(value: string) {
|
|
88
|
-
setContext(LAYER_CONTEXT_KEY, value);
|
|
89
|
-
}
|
package/src/maplibre/utils.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// Source: https://github.com/MIERUNE/svelte-maplibre-gl/blob/main/src/lib/maplibre/utils.ts
|
|
2
|
-
|
|
3
|
-
import type { Evented, Listener, Map, MapLayerEventType, Popup } from 'maplibre-gl';
|
|
4
|
-
|
|
5
|
-
export function resetEventListener(
|
|
6
|
-
evented: Evented | null | undefined,
|
|
7
|
-
type: string,
|
|
8
|
-
listener: Listener | undefined
|
|
9
|
-
) {
|
|
10
|
-
if (listener) {
|
|
11
|
-
evented?.on(type, listener);
|
|
12
|
-
}
|
|
13
|
-
const prevListener = listener;
|
|
14
|
-
return () => {
|
|
15
|
-
if (prevListener) {
|
|
16
|
-
evented?.off(type, prevListener);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function resetLayerEventListener(
|
|
22
|
-
map: Map | null,
|
|
23
|
-
type: keyof MapLayerEventType,
|
|
24
|
-
layer: string,
|
|
25
|
-
listener: Listener | undefined
|
|
26
|
-
) {
|
|
27
|
-
if (listener) {
|
|
28
|
-
map?.on(type, layer, listener);
|
|
29
|
-
}
|
|
30
|
-
const prevListener = listener;
|
|
31
|
-
return () => {
|
|
32
|
-
if (prevListener) {
|
|
33
|
-
map?.off(type, layer, prevListener);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function resetPopupEventListener(
|
|
39
|
-
popup: Popup | null,
|
|
40
|
-
type: 'open' | 'close',
|
|
41
|
-
listener: Listener | undefined
|
|
42
|
-
) {
|
|
43
|
-
if (listener) {
|
|
44
|
-
popup?.on(type, listener);
|
|
45
|
-
}
|
|
46
|
-
const prevListener = listener;
|
|
47
|
-
return () => {
|
|
48
|
-
if (prevListener) {
|
|
49
|
-
popup?.off(type, prevListener);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get current url params or - if on production - params from embed url.
|
|
3
|
-
* @param {object} embed root dom element
|
|
4
|
-
* @returns {object} url params
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const getEmbedContext = (target) => {
|
|
8
|
-
let url;
|
|
9
|
-
if (
|
|
10
|
-
import.meta.env.DEV ||
|
|
11
|
-
window.location.origin === 'https://d.swr.de' ||
|
|
12
|
-
window.location.origin === 'https://static.datenhub.net' ||
|
|
13
|
-
window.location.href.includes('apidata.googleusercontent.com') ||
|
|
14
|
-
window.location.href.includes('storage.googleapis.com')
|
|
15
|
-
) {
|
|
16
|
-
url = window.location.href;
|
|
17
|
-
} else {
|
|
18
|
-
const parent = target.parentNode || target.parentNode.parentNode;
|
|
19
|
-
url = parent.dataset.url;
|
|
20
|
-
}
|
|
21
|
-
const data = {};
|
|
22
|
-
for (const [key, value] of new URL(url).searchParams) {
|
|
23
|
-
data[key] = value;
|
|
24
|
-
}
|
|
25
|
-
return data;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export default getEmbedContext;
|
package/src/utils/slugify.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Source: https://svelte.dev/playground/b130be5e485441a1842ae97e4ce4f244?version=5.20.0
|
|
2
|
-
|
|
3
|
-
export default function slugify(str: string): string {
|
|
4
|
-
return str
|
|
5
|
-
.replace(/\s+/g, '-')
|
|
6
|
-
.replace(/-+/g, '-')
|
|
7
|
-
.trim()
|
|
8
|
-
.normalize('NFKD')
|
|
9
|
-
.replace(/[\u0300-\u036f]/g, '')
|
|
10
|
-
.toLowerCase()
|
|
11
|
-
.replace(/[^a-z0-9 -]/g, '');
|
|
12
|
-
}
|
package/static/favicon.png
DELETED
|
Binary file
|
package/svelte.config.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import adapter from '@sveltejs/adapter-auto';
|
|
2
|
-
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
3
|
-
|
|
4
|
-
/** @type {import('@sveltejs/kit').Config} */
|
|
5
|
-
const config = {
|
|
6
|
-
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
|
7
|
-
// for more information about preprocessors
|
|
8
|
-
preprocess: vitePreprocess(),
|
|
9
|
-
|
|
10
|
-
kit: {
|
|
11
|
-
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
|
12
|
-
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
|
13
|
-
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
|
14
|
-
adapter: adapter()
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default config;
|
package/tsconfig.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./.svelte-kit/tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"allowJs": true,
|
|
5
|
-
"checkJs": true,
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"forceConsistentCasingInFileNames": true,
|
|
8
|
-
"resolveJsonModule": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"strict": true,
|
|
12
|
-
"moduleResolution": "bundler"
|
|
13
|
-
}
|
|
14
|
-
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
|
|
15
|
-
// except $lib which is handled by https://kit.svelte.dev/docs/configuration#files
|
|
16
|
-
//
|
|
17
|
-
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
|
18
|
-
// from the referenced tsconfig.json - TypeScript does not merge them in
|
|
19
|
-
}
|
package/vite.config.ts
DELETED
package/vitest.workspace.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { fileURLToPath } from 'node:url';
|
|
3
|
-
|
|
4
|
-
import { defineWorkspace } from 'vitest/config';
|
|
5
|
-
|
|
6
|
-
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
|
|
7
|
-
|
|
8
|
-
const dirname =
|
|
9
|
-
typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
-
|
|
11
|
-
// More info at: https://storybook.js.org/docs/writing-tests/test-addon
|
|
12
|
-
export default defineWorkspace([
|
|
13
|
-
'vite.config.ts',
|
|
14
|
-
{
|
|
15
|
-
extends: 'vite.config.ts',
|
|
16
|
-
plugins: [
|
|
17
|
-
// The plugin will run tests for the stories defined in your Storybook config
|
|
18
|
-
// See options at: https://storybook.js.org/docs/writing-tests/test-addon#storybooktest
|
|
19
|
-
storybookTest({ configDir: path.join(dirname, '.storybook') })
|
|
20
|
-
],
|
|
21
|
-
test: {
|
|
22
|
-
name: 'storybook',
|
|
23
|
-
browser: {
|
|
24
|
-
enabled: true,
|
|
25
|
-
headless: true,
|
|
26
|
-
name: 'chromium',
|
|
27
|
-
provider: 'playwright'
|
|
28
|
-
},
|
|
29
|
-
setupFiles: ['.storybook/vitest.setup.ts']
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{src → dist}/Intro.mdx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{src → dist}/app.d.ts
RENAMED
|
File without changes
|
/package/{src → dist}/app.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{src → dist}/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|