@cocoar/vue-map 2.12.0
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/CoarMap.vue.d.ts +42 -0
- package/dist/CoarMap.vue.d.ts.map +1 -0
- package/dist/CoarMapEditor.vue.d.ts +61 -0
- package/dist/CoarMapEditor.vue.d.ts.map +1 -0
- package/dist/CoarMapPointList.vue.d.ts +44 -0
- package/dist/CoarMapPointList.vue.d.ts.map +1 -0
- package/dist/context.d.ts +9 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +851 -0
- package/dist/internal/MapPointForm.vue.d.ts +21 -0
- package/dist/internal/MapPointForm.vue.d.ts.map +1 -0
- package/dist/internal/map-edit.d.ts +62 -0
- package/dist/internal/map-edit.d.ts.map +1 -0
- package/dist/internal/map-model.d.ts +38 -0
- package/dist/internal/map-model.d.ts.map +1 -0
- package/dist/internal/use-map-editor.d.ts +43 -0
- package/dist/internal/use-map-editor.d.ts.map +1 -0
- package/dist/types.d.ts +64 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MapConfig, MapPoint, MapType } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
point: MapPoint;
|
|
4
|
+
config: MapConfig | null;
|
|
5
|
+
type: MapType;
|
|
6
|
+
index: number;
|
|
7
|
+
count: number;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
remove: () => any;
|
|
11
|
+
update: (args_0: Partial<MapPoint>) => any;
|
|
12
|
+
"move-up": () => any;
|
|
13
|
+
"move-down": () => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
onRemove?: (() => any) | undefined;
|
|
16
|
+
onUpdate?: ((args_0: Partial<MapPoint>) => any) | undefined;
|
|
17
|
+
"onMove-up"?: (() => any) | undefined;
|
|
18
|
+
"onMove-down"?: (() => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=MapPointForm.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapPointForm.vue.d.ts","sourceRoot":"","sources":["../../src/internal/MapPointForm.vue"],"names":[],"mappings":"AAyJA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAE7D,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;;;;;;;;;;;;AAqTF,wBAQG"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { MapData, MapPoint, MapViewport } from '../types';
|
|
2
|
+
/** Partial initialiser for a new point — everything except its coordinates. */
|
|
3
|
+
export type NewPointInit = Partial<Omit<MapPoint, 'lat' | 'lng'>>;
|
|
4
|
+
/** Clamp latitude to its valid range and wrap longitude into `(-180, 180]`. */
|
|
5
|
+
export declare function normalizeLatLng(lat: number, lng: number): {
|
|
6
|
+
lat: number;
|
|
7
|
+
lng: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Add a point in a way that respects `data.type`:
|
|
11
|
+
* - `single` → there is at most one point; move the existing one (preserving its
|
|
12
|
+
* props), else create a fresh stop.
|
|
13
|
+
* - `multi` → append a stop.
|
|
14
|
+
* - `route` → append a point to the end of the path (`stop` unless `init.kind`).
|
|
15
|
+
*/
|
|
16
|
+
export declare function addPointForType(data: MapData, lat: number, lng: number, init?: NewPointInit): MapData;
|
|
17
|
+
/** Move one point to new coordinates (no-op if `index` is out of range). */
|
|
18
|
+
export declare function movePoint(data: MapData, index: number, lat: number, lng: number): MapData;
|
|
19
|
+
/**
|
|
20
|
+
* Shallow-merge a patch into one point (no-op if `index` is out of range).
|
|
21
|
+
* Coordinates in the patch are normalized; `undefined` values in the patch are
|
|
22
|
+
* dropped so they can't blow away existing fields.
|
|
23
|
+
*/
|
|
24
|
+
export declare function updatePoint(data: MapData, index: number, patch: Partial<MapPoint>): MapData;
|
|
25
|
+
/** Remove one point (no-op if `index` is out of range). */
|
|
26
|
+
export declare function removePoint(data: MapData, index: number): MapData;
|
|
27
|
+
/**
|
|
28
|
+
* Move the point at `from` to position `to`, shifting the rest — used to reorder
|
|
29
|
+
* route waypoints. No-op if either index is out of range or they are equal.
|
|
30
|
+
*/
|
|
31
|
+
export declare function reorderPoint(data: MapData, from: number, to: number): MapData;
|
|
32
|
+
/**
|
|
33
|
+
* Insert a new point into the segment between `segmentIndex` and the next point
|
|
34
|
+
* (i.e. it becomes the point at `segmentIndex + 1`). Used when the user clicks
|
|
35
|
+
* directly on a route line to add a waypoint there. No-op if `segmentIndex` is
|
|
36
|
+
* not a valid segment start (`0 .. length - 2`).
|
|
37
|
+
*/
|
|
38
|
+
export declare function insertOnSegment(data: MapData, segmentIndex: number, lat: number, lng: number, init?: NewPointInit): MapData;
|
|
39
|
+
/** Set (or clear, with `null`) the saved viewport. */
|
|
40
|
+
export declare function setViewport(data: MapData, viewport: MapViewport | null): MapData;
|
|
41
|
+
/**
|
|
42
|
+
* New selected index after `reorderPoint(_, from, to)`, so a selection keeps
|
|
43
|
+
* pointing at the same logical point through the move. `null` stays `null`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function selectionAfterReorder(selected: number | null, from: number, to: number): number | null;
|
|
46
|
+
/**
|
|
47
|
+
* New selected index after `removePoint(_, index)`: clears when the selected
|
|
48
|
+
* point was removed, shifts down when a point before it was removed.
|
|
49
|
+
*/
|
|
50
|
+
export declare function selectionAfterRemove(selected: number | null, index: number): number | null;
|
|
51
|
+
/**
|
|
52
|
+
* Find the polyline segment nearest to `(lat, lng)` and the point projected onto
|
|
53
|
+
* it, so a click near the line can insert a waypoint that sits exactly on it.
|
|
54
|
+
* `lat`/`lng` are treated as planar coordinates — accurate enough for picking a
|
|
55
|
+
* segment at editing scale. Returns `null` for fewer than two points.
|
|
56
|
+
*/
|
|
57
|
+
export declare function nearestSegment(points: readonly MapPoint[], lat: number, lng: number): {
|
|
58
|
+
segmentIndex: number;
|
|
59
|
+
lat: number;
|
|
60
|
+
lng: number;
|
|
61
|
+
} | null;
|
|
62
|
+
//# sourceMappingURL=map-edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-edit.d.ts","sourceRoot":"","sources":["../../src/internal/map-edit.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAgB,WAAW,EAAE,MAAM,UAAU,CAAC;AAE7E,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;AAElE,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAKtF;AAeD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,YAAiB,GAAG,OAAO,CAMzG;AAED,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAA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|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { MapBasemap, MapCategory, MapConfig, MapData, MapPoint } from '../types';
|
|
2
|
+
/** Build a quick lookup of category id → category. */
|
|
3
|
+
export declare function categoryMap(config: MapConfig): Map<string, MapCategory>;
|
|
4
|
+
/** Resolved color for a stop marker (its category color, else a neutral blue). */
|
|
5
|
+
export declare function stopColor(point: MapPoint, config: MapConfig): string;
|
|
6
|
+
/** Resolved emoji for a stop marker: explicit `icon` wins, else the category's. */
|
|
7
|
+
export declare function stopEmoji(point: MapPoint, config: MapConfig): string;
|
|
8
|
+
/** One row of the JS-free fallback / consumer list. */
|
|
9
|
+
export interface FallbackEntry {
|
|
10
|
+
/** Index into `data.points` — use it to drive `<CoarMap>`'s `focusPoint` etc. */
|
|
11
|
+
index: number;
|
|
12
|
+
emoji: string;
|
|
13
|
+
label: string;
|
|
14
|
+
lat: number;
|
|
15
|
+
lng: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Rows for the crawlable / no-JS fallback (and consumer-built list views): every
|
|
19
|
+
* **stop**, plus **named** shape points. Unnamed shape points (pure line
|
|
20
|
+
* geometry) are excluded. Stops use their category/custom emoji; named shape
|
|
21
|
+
* points use a `•`. Each row keeps its original `data.points` index so a list
|
|
22
|
+
* can address the matching marker.
|
|
23
|
+
*/
|
|
24
|
+
export declare function fallbackEntries(data: MapData, config: MapConfig): FallbackEntry[];
|
|
25
|
+
/**
|
|
26
|
+
* Distinct categories present among stops, in first-seen order, resolved against
|
|
27
|
+
* the registry. The component shows a legend only when this has ≥ 2 entries.
|
|
28
|
+
*/
|
|
29
|
+
export declare function legendCategories(data: MapData, config: MapConfig): MapCategory[];
|
|
30
|
+
/**
|
|
31
|
+
* Pick the basemap to render: the map's own `basemap`, else the config default,
|
|
32
|
+
* else the first non-Google basemap. Google basemaps are skipped (unsupported in
|
|
33
|
+
* this version). Returns `null` when no usable basemap exists.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveBasemap(data: MapData, config: MapConfig): MapBasemap | null;
|
|
36
|
+
/** Bounding box `[[minLat, minLng], [maxLat, maxLng]]` of all points, or `null`. */
|
|
37
|
+
export declare function boundsOf(points: readonly MapPoint[]): [[number, number], [number, number]] | null;
|
|
38
|
+
//# sourceMappingURL=map-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-model.d.ts","sourceRoot":"","sources":["../../src/internal/map-model.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEtF,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAIvE;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,CAGpE;AAED,mFAAmF;AACnF,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,CAIpE;AAED,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC5B,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,aAAa,EAAE,CAgBjF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,WAAW,EAAE,CAWhF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,IAAI,CAalF;AAED,oFAAoF;AACpF,wBAAgB,QAAQ,CACtB,MAAM,EAAE,SAAS,QAAQ,EAAE,GAC1B,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAgB7C"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { MapConfig, MapData, MapPoint } from '../types';
|
|
3
|
+
import { NewPointInit } from './map-edit';
|
|
4
|
+
export interface UseMapEditorOptions {
|
|
5
|
+
data: () => MapData;
|
|
6
|
+
config: () => MapConfig | null;
|
|
7
|
+
selected: () => number | null;
|
|
8
|
+
readonly: () => boolean;
|
|
9
|
+
emitData: (next: MapData) => void;
|
|
10
|
+
emitSelected: (index: number | null) => void;
|
|
11
|
+
emitPointClick: (payload: {
|
|
12
|
+
point: MapPoint;
|
|
13
|
+
index: number;
|
|
14
|
+
}) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function useMapEditor(mapEl: Ref<HTMLElement | null>, opts: UseMapEditorOptions): {
|
|
17
|
+
ready: Ref<boolean, boolean>;
|
|
18
|
+
editPos: Ref<{
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
} | null, {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
} | {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
} | null>;
|
|
28
|
+
editBelow: Ref<boolean, boolean>;
|
|
29
|
+
selectedPoint: import('vue').ComputedRef<MapPoint | null>;
|
|
30
|
+
editing: import('vue').ComputedRef<boolean>;
|
|
31
|
+
updateSelected: (patch: Partial<MapPoint>) => void;
|
|
32
|
+
removeSelected: () => void;
|
|
33
|
+
moveSelected: (direction: -1 | 1) => void;
|
|
34
|
+
deselect: () => void;
|
|
35
|
+
focusPoint: (index: number) => void;
|
|
36
|
+
highlightPoint: (index: number | null) => void;
|
|
37
|
+
addPoint: (lat: number, lng: number, init?: NewPointInit) => void;
|
|
38
|
+
updatePoint: (index: number, patch: Partial<MapPoint>) => void;
|
|
39
|
+
removePoint: (index: number) => void;
|
|
40
|
+
reorder: (from: number, to: number) => void;
|
|
41
|
+
captureViewport: () => void;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=use-map-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-map-editor.d.ts","sourceRoot":"","sources":["../../src/internal/use-map-editor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAgE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAE7F,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE7D,OAAO,EAWL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,cAAc,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,QAAQ,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACvE;AAaD,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,mBAAmB;;;WAW3D,MAAM;WAAK,MAAM;;WAAjB,MAAM;WAAK,MAAM;;WAAjB,MAAM;WAAK,MAAM;;;;;4BAmKX,OAAO,CAAC,QAAQ,CAAC,KAAG,IAAI;0BAO5B,IAAI;8BAKE,CAAC,CAAC,GAAG,CAAC,KAAG,IAAI;oBAMzB,IAAI;wBAmEE,MAAM,KAAG,IAAI;4BAOT,MAAM,GAAG,IAAI,KAAG,IAAI;oBAO5B,MAAM,OAAO,MAAM,SAAS,YAAY,KAAG,IAAI;yBAIxC,MAAM,SAAS,OAAO,CAAC,QAAQ,CAAC,KAAG,IAAI;yBAIvC,MAAM,KAAG,IAAI;oBAMpB,MAAM,MAAM,MAAM,KAAG,IAAI;2BAQpB,IAAI;EAkDjC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public data + config contract for `<CoarMap>`.
|
|
3
|
+
*
|
|
4
|
+
* The component is fed *resolved* data — it has no notion of ids, fetching, or
|
|
5
|
+
* any embedding/markdown layer. A consumer resolves whatever source it has
|
|
6
|
+
* (a store, an API, a `:::map{id}` directive — its choice) into a {@link MapData}.
|
|
7
|
+
*/
|
|
8
|
+
export type MapType = 'single' | 'multi' | 'route';
|
|
9
|
+
/** `stop` = a marker; `shape` = a vertex of the route/line geometry. */
|
|
10
|
+
export type MapPointKind = 'stop' | 'shape';
|
|
11
|
+
export interface MapPoint {
|
|
12
|
+
lat: number;
|
|
13
|
+
lng: number;
|
|
14
|
+
kind: MapPointKind;
|
|
15
|
+
label?: string;
|
|
16
|
+
note?: string;
|
|
17
|
+
/** `stop` only — category id (drives marker color + the legend). */
|
|
18
|
+
category?: string;
|
|
19
|
+
/** `stop` only — emoji override; falls back to the category's emoji. */
|
|
20
|
+
icon?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface MapViewport {
|
|
23
|
+
centerLat: number;
|
|
24
|
+
centerLng: number;
|
|
25
|
+
zoom: number;
|
|
26
|
+
}
|
|
27
|
+
export interface MapData {
|
|
28
|
+
type: MapType;
|
|
29
|
+
caption?: string;
|
|
30
|
+
/** Basemap id; falls back to {@link MapConfig.defaultBasemap}. */
|
|
31
|
+
basemap?: string;
|
|
32
|
+
/** Fixed viewport; when omitted the map auto-fits all points. */
|
|
33
|
+
viewport?: MapViewport;
|
|
34
|
+
points: MapPoint[];
|
|
35
|
+
}
|
|
36
|
+
export interface MapCategory {
|
|
37
|
+
id: string;
|
|
38
|
+
label: string;
|
|
39
|
+
emoji?: string;
|
|
40
|
+
color: string;
|
|
41
|
+
}
|
|
42
|
+
export interface MapBasemap {
|
|
43
|
+
id: string;
|
|
44
|
+
/** Leaflet tile URL template, e.g. `https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`. */
|
|
45
|
+
url: string;
|
|
46
|
+
subdomains?: string;
|
|
47
|
+
attribution?: string;
|
|
48
|
+
maxZoom?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Marks a Google basemap. **Not supported in this version** — a Google
|
|
51
|
+
* basemap is skipped and the default (non-Google) basemap is used instead.
|
|
52
|
+
* Kept on the contract so a registry can carry it for a future release.
|
|
53
|
+
*/
|
|
54
|
+
google?: boolean;
|
|
55
|
+
googleType?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface MapConfig {
|
|
58
|
+
/** Basemap id used when a map specifies none (or specifies a Google one). */
|
|
59
|
+
defaultBasemap: string;
|
|
60
|
+
basemaps: MapBasemap[];
|
|
61
|
+
/** Category registry — drives stop marker colors and the legend. */
|
|
62
|
+
categories?: MapCategory[];
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,wEAAwE;AACxE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5C,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM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
1
|
+
{
|
|
2
|
+
"name": "@cocoar/vue-map",
|
|
3
|
+
"version": "2.12.0",
|
|
4
|
+
"description": "Interactive Leaflet map component for Vue 3. Data-driven and standalone — it knows nothing about markdown or any embedding layer; a consumer feeds it resolved map data.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/cocoar-dev/cocoar-ui-vue.git",
|
|
9
|
+
"directory": "packages/map"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://docs.cocoar.dev/cocoar-ui-vue/",
|
|
12
|
+
"bugs": "https://github.com/cocoar-dev/cocoar-ui-vue/issues",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"vue",
|
|
15
|
+
"vue3",
|
|
16
|
+
"map",
|
|
17
|
+
"leaflet",
|
|
18
|
+
"geo"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"*.css",
|
|
23
|
+
"*.vue"
|
|
24
|
+
],
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"module": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"import": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "vite build",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"lint": "eslint src/",
|
|
41
|
+
"typecheck": "vue-tsc --noEmit"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"leaflet": "^1.9.4"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@cocoar/vue-ui": "2.12.0",
|
|
48
|
+
"vue": "^3.5.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {
|
|
51
|
+
"@cocoar/vue-ui": {
|
|
52
|
+
"optional": true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@cocoar/vue-ui": "workspace:*",
|
|
57
|
+
"@types/leaflet": "^1.9.12",
|
|
58
|
+
"vue": "^3.5.32"
|
|
59
|
+
}
|
|
60
|
+
}
|