@m3ui-vue/m3ui-vue 1.0.2 → 1.0.3

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.
Files changed (106) hide show
  1. package/dist/API.md +599 -9
  2. package/dist/MMenuItem-DFyXflk9.js +707 -0
  3. package/dist/MMenuItem-DFyXflk9.js.map +1 -0
  4. package/dist/MSlider-CdNIH7jc.js +1376 -0
  5. package/dist/MSlider-CdNIH7jc.js.map +1 -0
  6. package/dist/MTextField-B4X92vH_.js +671 -0
  7. package/dist/MTextField-B4X92vH_.js.map +1 -0
  8. package/dist/api.json +1 -1
  9. package/dist/code-editor.js +1 -1
  10. package/dist/components/MIconButton.vue.d.ts +1 -1
  11. package/dist/components/MMap.vue.d.ts +74 -0
  12. package/dist/components/MMapBaseLayers.vue.d.ts +15 -0
  13. package/dist/components/MMapControl.vue.d.ts +23 -0
  14. package/dist/components/MMapFeatureInfo.vue.d.ts +25 -0
  15. package/dist/components/MMapFilter.vue.d.ts +19 -0
  16. package/dist/components/MMapGeoJson.vue.d.ts +34 -0
  17. package/dist/components/MMapHover.vue.d.ts +17 -0
  18. package/dist/components/MMapIdentify.vue.d.ts +37 -0
  19. package/dist/components/MMapLayers.vue.d.ts +31 -0
  20. package/dist/components/MMapMarker.vue.d.ts +42 -0
  21. package/dist/components/MMapMeasure.vue.d.ts +43 -0
  22. package/dist/components/MMapPopup.vue.d.ts +43 -0
  23. package/dist/components/MMapSearch.vue.d.ts +28 -0
  24. package/dist/components/_MMapLayerItem.vue.d.ts +25 -0
  25. package/dist/composables/_mapGeometry.d.ts +13 -0
  26. package/dist/composables/_ssrState.d.ts +30 -0
  27. package/dist/composables/_storageKeys.d.ts +3 -0
  28. package/dist/composables/_useThemeTokens.d.ts +7 -0
  29. package/dist/composables/mapAdapters.d.ts +111 -0
  30. package/dist/composables/mapSearch.d.ts +31 -0
  31. package/dist/composables/themeInitScript.d.ts +4 -3
  32. package/dist/composables/useColorPalette.d.ts +173 -7
  33. package/dist/composables/useLocale.d.ts +30 -0
  34. package/dist/composables/useMap.d.ts +47 -0
  35. package/dist/composables/useMapFilter.d.ts +10 -0
  36. package/dist/composables/useMapLayers.d.ts +30 -0
  37. package/dist/composables/useTheme.d.ts +2 -1
  38. package/dist/index.d.ts +2 -1
  39. package/dist/locales/index.js +217 -7
  40. package/dist/locales/index.js.map +1 -1
  41. package/dist/m3ui-vue.css +1 -1
  42. package/dist/m3ui.js +6709 -7976
  43. package/dist/m3ui.js.map +1 -1
  44. package/dist/map.d.ts +24 -0
  45. package/dist/map.js +1931 -0
  46. package/dist/map.js.map +1 -0
  47. package/dist/plugin.d.ts +18 -2
  48. package/dist/rich-text-editor.js +27 -26
  49. package/dist/rich-text-editor.js.map +1 -1
  50. package/dist/styles.css +1 -1
  51. package/dist/{useLocale-CuvWRZ1h.js → useLocale-b5-hzsL3.js} +32 -2
  52. package/dist/useLocale-b5-hzsL3.js.map +1 -0
  53. package/package.json +11 -2
  54. package/src/__tests__/MFab.test.ts +52 -6
  55. package/src/__tests__/MMap.test.ts +292 -0
  56. package/src/__tests__/MMapLayers.test.ts +257 -0
  57. package/src/__tests__/MMapTools.test.ts +233 -0
  58. package/src/__tests__/_fakeMaplibre.ts +158 -0
  59. package/src/__tests__/hydration.test.ts +33 -0
  60. package/src/__tests__/ssr.test.ts +63 -1
  61. package/src/__tests__/ssrState.test.ts +155 -0
  62. package/src/__tests__/themeInitScript.test.ts +18 -0
  63. package/src/components/MFab.vue +29 -7
  64. package/src/components/MIconButton.vue +1 -1
  65. package/src/components/MLightbox.vue +6 -2
  66. package/src/components/MMap.vue +522 -0
  67. package/src/components/MMapBaseLayers.vue +67 -0
  68. package/src/components/MMapControl.vue +61 -0
  69. package/src/components/MMapFeatureInfo.vue +41 -0
  70. package/src/components/MMapFilter.vue +80 -0
  71. package/src/components/MMapGeoJson.vue +136 -0
  72. package/src/components/MMapHover.vue +131 -0
  73. package/src/components/MMapIdentify.vue +103 -0
  74. package/src/components/MMapLayers.vue +111 -0
  75. package/src/components/MMapMarker.vue +102 -0
  76. package/src/components/MMapMeasure.vue +452 -0
  77. package/src/components/MMapPopup.vue +99 -0
  78. package/src/components/MMapSearch.vue +162 -0
  79. package/src/components/_MMapLayerItem.vue +77 -0
  80. package/src/composables/_mapGeometry.ts +75 -0
  81. package/src/composables/_ssrState.ts +80 -0
  82. package/src/composables/_storageKeys.ts +6 -0
  83. package/src/composables/_useThemeTokens.ts +42 -0
  84. package/src/composables/mapAdapters.ts +208 -0
  85. package/src/composables/mapSearch.ts +56 -0
  86. package/src/composables/themeInitScript.ts +6 -4
  87. package/src/composables/useColorPalette.ts +23 -9
  88. package/src/composables/useLocale.ts +62 -0
  89. package/src/composables/useMap.ts +98 -0
  90. package/src/composables/useMapFilter.ts +45 -0
  91. package/src/composables/useMapLayers.ts +124 -0
  92. package/src/composables/useTheme.ts +8 -3
  93. package/src/composables/useWindowSizeClass.ts +14 -5
  94. package/src/index.ts +2 -1
  95. package/src/locales/de.ts +31 -1
  96. package/src/locales/es.ts +31 -1
  97. package/src/locales/fr.ts +31 -1
  98. package/src/locales/ja.ts +31 -1
  99. package/src/locales/ko.ts +31 -1
  100. package/src/locales/pt.ts +31 -1
  101. package/src/locales/zh.ts +31 -1
  102. package/src/map.ts +32 -0
  103. package/src/plugin.ts +54 -3
  104. package/dist/MTextField-BPbFeI9M.js +0 -1368
  105. package/dist/MTextField-BPbFeI9M.js.map +0 -1
  106. package/dist/useLocale-CuvWRZ1h.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { i as e } from "./useLocale-CuvWRZ1h.js";
1
+ import { i as e } from "./useLocale-b5-hzsL3.js";
2
2
  import { t } from "./MIcon-DLOkQduI.js";
3
3
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
4
  import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, watch as v, withCtx as y } from "vue";
@@ -1,7 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  /** Material Symbol icon name */
3
3
  icon: string;
4
- /** Accessible label (aria-label and title) */
4
+ /** Accessible label (its aria-label; no visible tooltip: wrap it in MTooltip for one) */
5
5
  label?: string;
6
6
  /** Visual style */
7
7
  variant?: 'standard' | 'filled' | 'tonal' | 'outlined';
@@ -0,0 +1,74 @@
1
+ import type * as Maplibre from 'maplibre-gl';
2
+ import type { MapAdapter } from '../composables/mapAdapters';
3
+ export type MapControlPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
4
+ type __VLS_Props = {
5
+ /** The map's style: a style JSON URL or a style object (MapLibre's `StyleSpecification`). Changing it reloads the style */
6
+ mapStyle: string | Maplibre.StyleSpecification;
7
+ /** `[lng, lat]` (v-model). When left out, the style's (or the remembered view's) */
8
+ center?: [number, number];
9
+ /** Zoom level (v-model) */
10
+ zoom?: number;
11
+ /** Rotation in degrees (v-model) */
12
+ bearing?: number;
13
+ /** Tilt in degrees (v-model) */
14
+ pitch?: number;
15
+ /**
16
+ * Remember the view (center, zoom, bearing, pitch) in localStorage and start from it on the next visit: `true`
17
+ * under `m3-map-view`, or your own key (one per map)
18
+ */
19
+ persist?: boolean | string;
20
+ /** Zoom and compass buttons: `false`, or a corner (`true` is top-right) */
21
+ navigation?: boolean | MapControlPosition;
22
+ /** A button that centers the map on the user's location and follows it: `false`, or a corner (`true` is top-right) */
23
+ geolocate?: boolean | MapControlPosition;
24
+ /** A fullscreen button: `false`, or a corner (`true` is top-right) */
25
+ fullscreen?: boolean | MapControlPosition;
26
+ /** A metric scale bar: `false`, or a corner (`true` is bottom-left) */
27
+ scale?: boolean | MapControlPosition;
28
+ /** The style's attribution, compact: `false`, or a corner (`true` is bottom-right). Most tile providers require it */
29
+ attribution?: boolean | MapControlPosition;
30
+ /** Anything else for MapLibre's `Map` constructor (`maxZoom`, `maxBounds`, `cooperativeGestures`…) */
31
+ options?: Partial<Omit<Maplibre.MapOptions, 'container' | 'style'>>;
32
+ /**
33
+ * Reads the style's conventions (layer names, groups, base layers, what to identify or show on hover) for
34
+ * `MMapLayers`, `MMapBaseLayers`, `MMapIdentify` and `MMapHover`: `genericAdapter`, `orvianAdapter()`, or your own
35
+ */
36
+ adapter?: MapAdapter;
37
+ };
38
+ declare var __VLS_1: {};
39
+ type __VLS_Slots = {} & {
40
+ default?: (props: typeof __VLS_1) => any;
41
+ };
42
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
43
+ /** The MapLibre map, once loaded */
44
+ map: import("vue").ShallowRef<Maplibre.Map | undefined, Maplibre.Map | undefined>;
45
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
46
+ ready: (map: Maplibre.Map) => any;
47
+ click: (event: Maplibre.MapMouseEvent) => any;
48
+ "update:center": (center: [number, number]) => any;
49
+ "update:zoom": (zoom: number) => any;
50
+ "update:bearing": (bearing: number) => any;
51
+ "update:pitch": (pitch: number) => any;
52
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
53
+ onReady?: ((map: Maplibre.Map) => any) | undefined;
54
+ onClick?: ((event: Maplibre.MapMouseEvent) => any) | undefined;
55
+ "onUpdate:center"?: ((center: [number, number]) => any) | undefined;
56
+ "onUpdate:zoom"?: ((zoom: number) => any) | undefined;
57
+ "onUpdate:bearing"?: ((bearing: number) => any) | undefined;
58
+ "onUpdate:pitch"?: ((pitch: number) => any) | undefined;
59
+ }>, {
60
+ fullscreen: boolean | MapControlPosition;
61
+ navigation: boolean | MapControlPosition;
62
+ scale: boolean | MapControlPosition;
63
+ persist: boolean | string;
64
+ geolocate: boolean | MapControlPosition;
65
+ attribution: boolean | MapControlPosition;
66
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
67
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
68
+ declare const _default: typeof __VLS_export;
69
+ export default _default;
70
+ type __VLS_WithSlots<T, S> = T & {
71
+ new (): {
72
+ $slots: S;
73
+ };
74
+ };
@@ -0,0 +1,15 @@
1
+ type __VLS_Props = {
2
+ /** Prefix for the thumbnails' paths (e.g. `/images/`); full URLs are used as they are */
3
+ imageBase?: string;
4
+ /** Offer "no base layer" */
5
+ none?: boolean;
6
+ /** Lay them out in a column */
7
+ vertical?: boolean;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
10
+ none: boolean;
11
+ vertical: boolean;
12
+ imageBase: string;
13
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import type { MapControlPosition } from './MMap.vue';
2
+ type __VLS_Props = {
3
+ /** The corner */
4
+ position?: MapControlPosition;
5
+ /** Draw it as a control group (a surface with dividers between buttons), like MapLibre's zoom buttons */
6
+ group?: boolean;
7
+ };
8
+ declare var __VLS_1: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_1) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
13
+ position: MapControlPosition;
14
+ group: boolean;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
19
+ type __VLS_WithSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,25 @@
1
+ import type { MapIdentifyResult } from '../composables/mapAdapters';
2
+ type __VLS_Props = {
3
+ /** What was found */
4
+ results: MapIdentifyResult[];
5
+ };
6
+ declare var __VLS_6: {
7
+ field: {
8
+ key: string;
9
+ label: string;
10
+ value: string;
11
+ };
12
+ result: MapIdentifyResult;
13
+ };
14
+ type __VLS_Slots = {} & {
15
+ value?: (props: typeof __VLS_6) => any;
16
+ };
17
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1,19 @@
1
+ type __VLS_Props = {
2
+ /** The layer's id */
3
+ layer: string;
4
+ /** The property to filter by */
5
+ property: string;
6
+ /** The values to offer (labels in `labels`); by default the ones found in the layer's loaded features */
7
+ values?: (string | number)[];
8
+ /** Labels for the values, by value */
9
+ labels?: Record<string, string>;
10
+ /** The selected values (v-model) */
11
+ modelValue?: (string | number)[];
12
+ };
13
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ "update:modelValue": (values: (string | number)[]) => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ "onUpdate:modelValue"?: ((values: (string | number)[]) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
@@ -0,0 +1,34 @@
1
+ import type * as Maplibre from 'maplibre-gl';
2
+ type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
3
+ /** A layer of `MMapGeoJson`: any MapLibre layer without its `source` (and `id`, made up when left out). */
4
+ export type MapGeoJsonLayer = DistributiveOmit<Exclude<Maplibre.LayerSpecification, Maplibre.BackgroundLayerSpecification>, 'id' | 'source'> & {
5
+ id?: string;
6
+ };
7
+ type __VLS_Props = {
8
+ /** A GeoJSON object, or the URL of one */
9
+ data: Maplibre.GeoJSONSourceSpecification['data'];
10
+ /** The source's id (and the prefix of its layers' made-up ids). Unique on the map; generated when left out */
11
+ id?: string;
12
+ /** How to draw it: MapLibre layers without `source`. Defaults to theme-colored fill, outline, line and circle layers */
13
+ layers?: MapGeoJsonLayer[];
14
+ /** Insert the layers below this layer id (e.g. under the style's labels) */
15
+ before?: string;
16
+ /** Show a pointer over its features (set it when you handle `click`) */
17
+ interactive?: boolean;
18
+ /** More options for the GeoJSON source (`cluster`, `promoteId`, `tolerance`…) */
19
+ sourceOptions?: Partial<Omit<Maplibre.GeoJSONSourceSpecification, 'type' | 'data'>>;
20
+ };
21
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
22
+ /** The source's id */
23
+ sourceId: string;
24
+ /** The ids of its layers on the map */
25
+ layerIds: () => string[];
26
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ click: (event: Maplibre.MapLayerMouseEvent) => any;
28
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
29
+ onClick?: ((event: Maplibre.MapLayerMouseEvent) => any) | undefined;
30
+ }>, {
31
+ interactive: boolean;
32
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
+ declare const _default: typeof __VLS_export;
34
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import type { MapControlPosition } from './MMap.vue';
2
+ type __VLS_Props = {
3
+ /** On (v-model) */
4
+ modelValue?: boolean;
5
+ /** Its on/off button: `false`, or a corner (`true` is top-right) */
6
+ control?: boolean | MapControlPosition;
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ "update:modelValue": (on: boolean) => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ "onUpdate:modelValue"?: ((on: boolean) => any) | undefined;
12
+ }>, {
13
+ modelValue: boolean;
14
+ control: boolean | MapControlPosition;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,37 @@
1
+ import { type MapIdentifyResult } from '../composables/mapAdapters';
2
+ type __VLS_Props = {
3
+ /** Listen to clicks. It also pauses by itself while another tool owns them (`MMapMeasure` measuring) */
4
+ enabled?: boolean;
5
+ /** Show the results in a popup at the click */
6
+ popup?: boolean;
7
+ /** Mark where the user clicked while there are results */
8
+ marker?: boolean;
9
+ };
10
+ declare function close(): void;
11
+ declare var __VLS_12: {
12
+ results: MapIdentifyResult[];
13
+ lngLat: [number, number];
14
+ close: typeof close;
15
+ };
16
+ type __VLS_Slots = {} & {
17
+ default?: (props: typeof __VLS_12) => any;
18
+ };
19
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
20
+ close: typeof close;
21
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
22
+ identify: (results: MapIdentifyResult[], lngLat: [number, number]) => any;
23
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
24
+ onIdentify?: ((results: MapIdentifyResult[], lngLat: [number, number]) => any) | undefined;
25
+ }>, {
26
+ marker: boolean;
27
+ popup: boolean;
28
+ enabled: boolean;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
+ declare const _default: typeof __VLS_export;
32
+ export default _default;
33
+ type __VLS_WithSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };
@@ -0,0 +1,31 @@
1
+ import type { MapLayerInfo } from '../composables/mapAdapters';
2
+ type __VLS_Props = {
3
+ /** Show the search field */
4
+ search?: boolean;
5
+ /** Groups start collapsed */
6
+ collapsed?: boolean;
7
+ };
8
+ declare var __VLS_25: {
9
+ layer: MapLayerInfo;
10
+ visible: boolean;
11
+ }, __VLS_36: {
12
+ layer: MapLayerInfo;
13
+ visible: boolean;
14
+ };
15
+ type __VLS_Slots = {} & {
16
+ actions?: (props: typeof __VLS_25) => any;
17
+ } & {
18
+ actions?: (props: typeof __VLS_36) => any;
19
+ };
20
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
21
+ search: boolean;
22
+ collapsed: boolean;
23
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
25
+ declare const _default: typeof __VLS_export;
26
+ export default _default;
27
+ type __VLS_WithSlots<T, S> = T & {
28
+ new (): {
29
+ $slots: S;
30
+ };
31
+ };
@@ -0,0 +1,42 @@
1
+ import type * as Maplibre from 'maplibre-gl';
2
+ type __VLS_Props = {
3
+ /** Position, `[lng, lat]` (v-model with `draggable`) */
4
+ lngLat: [number, number];
5
+ /** The pin's color (any CSS color). Defaults to the theme's primary; ignored with custom content */
6
+ color?: string;
7
+ /** Let the user drag it */
8
+ draggable?: boolean;
9
+ /** Which part of the marker sits on `lngLat`. Defaults to `bottom` for the pin, `center` for custom content */
10
+ anchor?: Maplibre.PositionAnchor;
11
+ /** Offset in pixels, `[x, y]` */
12
+ offset?: [number, number];
13
+ /** Rotation in degrees */
14
+ rotation?: number;
15
+ };
16
+ declare var __VLS_1: {}, __VLS_3: {};
17
+ type __VLS_Slots = {} & {
18
+ default?: (props: typeof __VLS_1) => any;
19
+ } & {
20
+ popup?: (props: typeof __VLS_3) => any;
21
+ };
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
23
+ /** The MapLibre marker */
24
+ marker: () => Maplibre.Marker | undefined;
25
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ click: (event: MouseEvent) => any;
27
+ "update:lngLat": (lngLat: [number, number]) => any;
28
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
29
+ onClick?: ((event: MouseEvent) => any) | undefined;
30
+ "onUpdate:lngLat"?: ((lngLat: [number, number]) => any) | undefined;
31
+ }>, {
32
+ rotation: number;
33
+ draggable: boolean;
34
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
36
+ declare const _default: typeof __VLS_export;
37
+ export default _default;
38
+ type __VLS_WithSlots<T, S> = T & {
39
+ new (): {
40
+ $slots: S;
41
+ };
42
+ };
@@ -0,0 +1,43 @@
1
+ import { type LngLat } from '../composables/_mapGeometry';
2
+ import type { MapControlPosition } from './MMap.vue';
3
+ type Mode = 'distance' | 'area';
4
+ type __VLS_Props = {
5
+ /** The measuring mode (v-model): `'distance'`, `'area'`, or null. Set it to start measuring from outside */
6
+ modelValue?: Mode | null;
7
+ /** Its buttons: `false` (drive it with v-model), or a corner (`true` is top-right) */
8
+ control?: boolean | MapControlPosition;
9
+ };
10
+ declare function start(next: Mode): void;
11
+ declare function finish(byEscape?: boolean): void;
12
+ /** Deletes one finished measurement. */
13
+ declare function remove(index: number): void;
14
+ declare function clear(): void;
15
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
16
+ start: typeof start;
17
+ finish: typeof finish;
18
+ clear: typeof clear;
19
+ remove: typeof remove;
20
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ "update:modelValue": (mode: Mode | null) => any;
22
+ change: (measurements: {
23
+ mode: Mode;
24
+ points: LngLat[];
25
+ closed: boolean;
26
+ length: number;
27
+ area?: number;
28
+ }[]) => any;
29
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
30
+ "onUpdate:modelValue"?: ((mode: Mode | null) => any) | undefined;
31
+ onChange?: ((measurements: {
32
+ mode: Mode;
33
+ points: LngLat[];
34
+ closed: boolean;
35
+ length: number;
36
+ area?: number;
37
+ }[]) => any) | undefined;
38
+ }>, {
39
+ modelValue: Mode | null;
40
+ control: boolean | MapControlPosition;
41
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
42
+ declare const _default: typeof __VLS_export;
43
+ export default _default;
@@ -0,0 +1,43 @@
1
+ import type * as Maplibre from 'maplibre-gl';
2
+ type __VLS_Props = {
3
+ /** Position, `[lng, lat]` */
4
+ lngLat: [number, number];
5
+ /** Shown (v-model) */
6
+ open?: boolean;
7
+ /** Show a close button */
8
+ closeButton?: boolean;
9
+ /** Close it when the map is clicked */
10
+ closeOnClick?: boolean;
11
+ /** Where the popup sits relative to `lngLat`. By default MapLibre picks the side with room */
12
+ anchor?: Maplibre.PositionAnchor;
13
+ /** Offset in pixels from `lngLat` */
14
+ offset?: number;
15
+ /** Maximum width (CSS) */
16
+ maxWidth?: string;
17
+ };
18
+ declare var __VLS_1: {};
19
+ type __VLS_Slots = {} & {
20
+ default?: (props: typeof __VLS_1) => any;
21
+ };
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
23
+ /** The MapLibre popup */
24
+ popup: () => Maplibre.Popup | undefined;
25
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ "update:open": (open: boolean) => any;
27
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
28
+ "onUpdate:open"?: ((open: boolean) => any) | undefined;
29
+ }>, {
30
+ offset: number;
31
+ open: boolean;
32
+ maxWidth: string;
33
+ closeButton: boolean;
34
+ closeOnClick: boolean;
35
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
37
+ declare const _default: typeof __VLS_export;
38
+ export default _default;
39
+ type __VLS_WithSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -0,0 +1,28 @@
1
+ import { type MapSearchProvider, type MapSearchResult } from '../composables/mapSearch';
2
+ import type { MapControlPosition } from './MMap.vue';
3
+ type __VLS_Props = {
4
+ /** Where to search: `nominatimProvider(options)` by default, or your own function */
5
+ provider?: MapSearchProvider;
6
+ /** The corner */
7
+ position?: MapControlPosition;
8
+ /** The field's placeholder (the locale's "Search places" by default) */
9
+ placeholder?: string;
10
+ /** The zoom to fly to for a result without an extent */
11
+ zoom?: number;
12
+ /** Mark the picked result */
13
+ marker?: boolean;
14
+ /** Search while typing (debounced), for providers that allow it; Nominatim's public server doesn't */
15
+ instant?: boolean;
16
+ };
17
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ select: (result: MapSearchResult) => any;
19
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
20
+ onSelect?: ((result: MapSearchResult) => any) | undefined;
21
+ }>, {
22
+ marker: boolean;
23
+ position: MapControlPosition;
24
+ instant: boolean;
25
+ zoom: number;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import type { MapLayerInfo } from '../composables/mapAdapters';
2
+ type __VLS_Props = {
3
+ layer: MapLayerInfo;
4
+ expanded: boolean;
5
+ };
6
+ declare var __VLS_28: {
7
+ layer: MapLayerInfo;
8
+ visible: boolean;
9
+ };
10
+ type __VLS_Slots = {} & {
11
+ actions?: (props: typeof __VLS_28) => any;
12
+ };
13
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ "toggle-expanded": () => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ "onToggle-expanded"?: (() => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1,13 @@
1
+ export type LngLat = [number, number];
2
+ /** Great-circle distance between two points, in meters (haversine). */
3
+ export declare function distance(a: LngLat, b: LngLat): number;
4
+ /** The length of a path, in meters. */
5
+ export declare function pathLength(points: LngLat[]): number;
6
+ /** The point halfway along the great circle between two points. */
7
+ export declare function midpoint(a: LngLat, b: LngLat): LngLat;
8
+ /** The area of a ring (closed or not), in square meters, on the sphere (@turf/area's formula). */
9
+ export declare function ringArea(points: LngLat[]): number;
10
+ /** The ring with its first point repeated at the end. */
11
+ export declare function closeRing(points: LngLat[]): LngLat[];
12
+ /** Where to label a polygon: its area centroid (in degrees, fine at a measuring scale), or the vertices' mean. */
13
+ export declare function centroid(points: LngLat[]): LngLat;
@@ -0,0 +1,30 @@
1
+ import { type InjectionKey, type Ref } from 'vue';
2
+ import type { Theme } from './useTheme';
3
+ import type { ContrastLevel } from './useColorPalette';
4
+ /** The user's theme choices as a server knows them (from cookies), for server-side rendering. */
5
+ export interface M3InitialState {
6
+ theme?: Theme;
7
+ palette?: string;
8
+ contrast?: ContrastLevel;
9
+ /** The browser window's size: the adaptive layouts and `useWindowSizeClass()` render for it instead of compact. */
10
+ viewport?: {
11
+ width: number;
12
+ height: number;
13
+ };
14
+ }
15
+ /** `initialState` with the plugin's defaults filled in (the viewport stays optional: there's no default for it). */
16
+ export type ResolvedInitialState = Required<Omit<M3InitialState, 'viewport'>> & Pick<M3InitialState, 'viewport'>;
17
+ export declare const M3_INITIAL_STATE_KEY: InjectionKey<ResolvedInitialState>;
18
+ export declare function initialState(): ResolvedInitialState | null;
19
+ /**
20
+ * What a composable reports for a stored choice. On the server: the initial state (the module-level refs are shared
21
+ * by every request and hold nothing there). On the client while hydrating: the initial state too, so the first
22
+ * render matches the server's HTML, then the live value once mounted. Otherwise the live ref itself.
23
+ */
24
+ export declare function ssrValue<T>(live: Ref<T>, initial: T | undefined): Ref<T>;
25
+ export declare function enableCookies(): void;
26
+ /** Keeps the window's size in a cookie, for the server to render the adaptive layouts at it. */
27
+ export declare function trackViewport(): void;
28
+ /** A cookie's value: the stored choice when localStorage has none (cleared storage, or a server that set it). */
29
+ export declare function readCookie(key: string): string | null;
30
+ export declare function writeCookie(key: string, value: string | null): void;
@@ -0,0 +1,3 @@
1
+ export declare const THEME_KEY = "m3-theme";
2
+ export declare const STYLE_ID = "m3-dynamic-palette";
3
+ export declare const VIEWPORT_KEY = "m3-viewport";
@@ -0,0 +1,7 @@
1
+ import { type Ref } from 'vue';
2
+ /**
3
+ * The current values of some color tokens (`['primary', 'surface']` → `--color-primary`…), kept up to date across
4
+ * theme, palette and contrast changes: for what can't use CSS variables (a MapLibre layer's paint, a canvas). Empty
5
+ * strings on the server.
6
+ */
7
+ export declare function useThemeTokens<T extends string>(names: readonly T[]): Ref<Record<T, string>>;