@d3-maps/vue 0.1.1-next.0 → 0.3.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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  `@d3-maps/vue` provides Vue bindings for `@d3-maps/core` to build SVG maps with Vue, [d3](https://github.com/d3/d3) and [TopoJSON-client](https://github.com/TopoJSON/TopoJSON-client).
4
4
 
5
- [docs](https://d3-maps.netlify.app/guide/) | [examples](https://d3-maps.netlify.app/examples/) _(being updated for the new package name)_
5
+ [docs](https://souljorje.github.io/d3-maps)
6
6
 
7
7
  ## Installation
8
8
 
package/dist/index.d.ts CHANGED
@@ -1,16 +1,200 @@
1
1
  import "@d3-maps/core/index.css";
2
- import * as vue6 from "vue";
2
+ import * as vue4 from "vue";
3
3
  import { App, StyleValue } from "vue";
4
- import * as _d3_maps_core1 from "@d3-maps/core";
5
- import { MapConfig, MapContext, MapFeatureProps, MapMarkerProps, ZoomEvent, ZoomProps } from "@d3-maps/core";
4
+ import { ExtendedFeature, ExtendedFeatureCollection, GeoPath, GeoProjection } from "d3-geo";
5
+ import { Topology } from "topojson-specification";
6
+ import { mesh } from "topojson-client";
7
+ import { D3ZoomEvent, ZoomBehavior } from "d3-zoom";
6
8
 
9
+ //#region ../core/src/lib/mapObject.d.ts
10
+ /**
11
+ * Supported interaction states for map objects.
12
+ */
13
+ declare const mapObjectState: readonly ["default", "hover", "active"];
14
+ type MapObjectState = typeof mapObjectState[number];
15
+ type MapObjectStyles<TStyle> = Partial<Record<MapObjectState, TStyle>>;
16
+ //#endregion
17
+ //#region ../core/src/lib/feature.d.ts
18
+ /**
19
+ * A GeoJSON Feature used by d3-maps.
20
+ *
21
+ * This type allows extra top-level fields to be attached in `dataTransformer` (e.g. choropleth colors).
22
+ */
23
+ type MapFeature = (ExtendedFeature & Record<string, unknown>) | ExtendedFeature;
24
+ /**
25
+ * Shared props contract for a single rendered feature.
26
+ */
27
+ interface MapFeatureProps<TStyle = unknown> {
28
+ data: MapFeature;
29
+ styles?: MapObjectStyles<TStyle>;
30
+ fill?: string;
31
+ stroke?: string;
32
+ }
33
+ //#endregion
34
+ //#region ../core/src/lib/utils.d.ts
35
+ type AnyFn = (...args: any) => any;
36
+ /**
37
+ * Extracts a union of parameter tuples from a (possibly overloaded) function type.
38
+ *
39
+ * TypeScript's built-in `Parameters<F>` only captures the *last* overload, which breaks typing
40
+ * for overloaded getter/setter APIs (common in d3), where the setter overload might not be last.
41
+ *
42
+ * Notes:
43
+ * - This helper supports up to 5 overload signatures (adjust if needed).
44
+ * - Getter overloads like `(): T` are filtered out later via `Exclude<..., []>` when we build
45
+ * setter-only config types.
46
+ */
47
+ type OverloadedArgs<F> = F extends {
48
+ (...a: infer A1): any;
49
+ (...a: infer A2): any;
50
+ (...a: infer A3): any;
51
+ (...a: infer A4): any;
52
+ (...a: infer A5): any;
53
+ } ? A1 | A2 | A3 | A4 | A5 : F extends {
54
+ (...a: infer A1): any;
55
+ (...a: infer A2): any;
56
+ (...a: infer A3): any;
57
+ (...a: infer A4): any;
58
+ } ? A1 | A2 | A3 | A4 : F extends {
59
+ (...a: infer A1): any;
60
+ (...a: infer A2): any;
61
+ (...a: infer A3): any;
62
+ } ? A1 | A2 | A3 : F extends {
63
+ (...a: infer A1): any;
64
+ (...a: infer A2): any;
65
+ } ? A1 | A2 : F extends ((...a: infer A1) => any) ? A1 : never;
66
+ /**
67
+ * Removes 0-arg overloads (getters), leaving only setter-style overload argument tuples.
68
+ */
69
+ type SetterArgs<F> = Exclude<OverloadedArgs<F>, []>;
70
+ /**
71
+ * True if the function has at least one overload that accepts arguments (i.e. a setter overload).
72
+ */
73
+ type HasArgs<F> = [SetterArgs<F>] extends [never] ? false : true;
74
+ type OwnKeys<T> = T extends AnyFn ? Exclude<keyof T, keyof CallableFunction> : keyof T;
75
+ /**
76
+ * Converts method parameters to modifiers values
77
+ * - single non-array arg: `arg` | `[arg]`
78
+ * - multiple args/single array wrapped with array
79
+ */
80
+ type ModifierArgs<P extends unknown[]> = P extends [infer Only] ? Only extends readonly unknown[] ? [Only] : Only | [Only] : P;
81
+ /**
82
+ * Maps methods with args to modifiers
83
+ *
84
+ * @example
85
+ * type X = {
86
+ * a: string; // not a function - will be ignored
87
+ * b(): void; // has no arguments - will be ignored
88
+ * c(x: number): void;
89
+ * d(x: number, y: string): void;
90
+ * e(xs: string[]): void;
91
+ * }
92
+ *
93
+ * type R = MethodsToModifiers<X>
94
+ * {
95
+ * c: number | [number];
96
+ * d: [number, string];
97
+ * e: [string[]]; // forced wrapper (arg is array)
98
+ * }
99
+ */
100
+ type MethodsToModifiers<T extends object> = { [K in OwnKeys<T> as Extract<T[K], AnyFn> extends never ? never : HasArgs<Extract<T[K], AnyFn>> extends true ? K : never]?: ModifierArgs<Extract<SetterArgs<Extract<T[K], AnyFn>>, unknown[]>> };
101
+ //#endregion
102
+ //#region ../core/src/lib/map.d.ts
103
+ type MapMesh = ReturnType<typeof mesh>;
104
+ type MapData = ExtendedFeatureCollection | Topology;
105
+ type DataTransformer = (features: MapFeature[]) => MapFeature[];
106
+ /**
107
+ * Extra projection method calls to apply before rendering.
108
+ *
109
+ * Use projection method names as keys and method arguments as values.
110
+ * Example: `{ center: [[0, 20]], rotate: [[0, 0, 0]], scale: 160 }`
111
+ *
112
+ * @see https://d3js.org/d3-geo/projection
113
+ */
114
+ interface ProjectionConfig extends Omit<MethodsToModifiers<GeoProjection>, 'invert' | 'stream'> {}
115
+ /**
116
+ * Input configuration for creating a map context.
117
+ *
118
+ * In adapters, this is usually passed as component props.
119
+ */
120
+ interface MapConfig {
121
+ width?: number;
122
+ height?: number;
123
+ aspectRatio?: number;
124
+ /**
125
+ * Projection factory from d3-geo (or a compatible implementation).
126
+ *
127
+ * Example: `geoEqualEarth`.
128
+ */
129
+ projection?: () => GeoProjection;
130
+ /**
131
+ * Projection method arguments passed to the created projection
132
+ */
133
+ projectionConfig?: ProjectionConfig;
134
+ /**
135
+ * TopoJSON or GeoJSON input.
136
+ *
137
+ * TopoJSON is automatically converted to GeoJSON features.
138
+ */
139
+ data: MapData;
140
+ /**
141
+ * Optional feature transformer (filter/augment/normalize features).
142
+ */
143
+ dataTransformer?: DataTransformer;
144
+ }
145
+ /**
146
+ * Fully computed, framework-agnostic map context.
147
+ *
148
+ * Adapters provide this context to child layers (features, markers, custom SVG).
149
+ */
150
+ interface MapContext {
151
+ width: number;
152
+ height: number;
153
+ projection?: GeoProjection;
154
+ features: MapFeature[];
155
+ mesh?: MapMesh;
156
+ path: GeoPath;
157
+ renderPath: (feature: MapFeature) => ReturnType<GeoPath>;
158
+ renderMesh: () => ReturnType<GeoPath>;
159
+ }
160
+ //#endregion
161
+ //#region ../core/src/lib/marker.d.ts
162
+ type MapMarkerCoordinates = [number, number];
163
+ /**
164
+ * Shared props contract for marker layers.
165
+ */
166
+ interface MapMarkerProps<TStyle = unknown> {
167
+ coordinates?: MapMarkerCoordinates;
168
+ styles?: MapObjectStyles<TStyle>;
169
+ }
170
+ //#endregion
171
+ //#region ../core/src/lib/zoom.d.ts
172
+ interface DefaultZoomBehavior extends ZoomBehavior<SVGSVGElement, unknown> {}
173
+ /**
174
+ * Extra zoom method calls to apply before rendering.
175
+ *
176
+ * Use zoom method names as keys and method arguments as values.
177
+ * Example: `{ scaleExtent: [[2, 9]], translateExtent: [[[0, 0], [10, 10]]] }`
178
+ *
179
+ * @see https://d3js.org/d3-zoom
180
+ */
181
+ interface ZoomModifiers extends MethodsToModifiers<DefaultZoomBehavior> {}
182
+ interface ZoomProps {
183
+ center?: [number, number];
184
+ zoom?: number;
185
+ minZoom?: number;
186
+ maxZoom?: number;
187
+ config?: ZoomModifiers;
188
+ }
189
+ interface ZoomEvent extends D3ZoomEvent<SVGSVGElement, unknown> {}
190
+ //#endregion
7
191
  //#region src/components/Map.vue.d.ts
8
192
  type __VLS_Slots$3 = {
9
193
  default?: (props: MapContext) => unknown;
10
194
  };
11
- declare const __VLS_base$3: vue6.DefineComponent<MapConfig, {}, {}, {}, {}, vue6.ComponentOptionsMixin, vue6.ComponentOptionsMixin, {}, string, vue6.PublicProps, Readonly<MapConfig> & Readonly<{}>, {}, {}, {}, {}, string, vue6.ComponentProvideOptions, false, {}, any>;
12
- declare const __VLS_export$4: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
13
- declare const _default: typeof __VLS_export$4;
195
+ declare const __VLS_base$3: vue4.DefineComponent<MapConfig, {}, {}, {}, {}, vue4.ComponentOptionsMixin, vue4.ComponentOptionsMixin, {}, string, vue4.PublicProps, Readonly<MapConfig> & Readonly<{}>, {}, {}, {}, {}, string, vue4.ComponentProvideOptions, false, {}, any>;
196
+ declare const __VLS_export$5: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
197
+ declare const _default: typeof __VLS_export$5;
14
198
  type __VLS_WithSlots$3<T, S> = T & {
15
199
  new (): {
16
200
  $slots: S;
@@ -18,31 +202,32 @@ type __VLS_WithSlots$3<T, S> = T & {
18
202
  };
19
203
  //#endregion
20
204
  //#region src/components/MapFeature.vue.d.ts
21
- type __VLS_Props$2 = MapFeatureProps<StyleValue>;
22
- declare const __VLS_export$3: vue6.DefineComponent<__VLS_Props$2, {}, {}, {}, {}, vue6.ComponentOptionsMixin, vue6.ComponentOptionsMixin, {} & {
205
+ type __VLS_Props$1 = MapFeatureProps<StyleValue>;
206
+ declare const __VLS_export$4: vue4.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, vue4.ComponentOptionsMixin, vue4.ComponentOptionsMixin, {} & {
23
207
  [x: string]: any;
24
- }, string, vue6.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
208
+ }, string, vue4.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
25
209
  [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
26
- }>, {}, {}, {}, {}, string, vue6.ComponentProvideOptions, false, {}, any>;
27
- declare const _default$1: typeof __VLS_export$3;
210
+ }>, {}, {}, {}, {}, string, vue4.ComponentProvideOptions, false, {}, any>;
211
+ declare const _default$1: typeof __VLS_export$4;
28
212
  //#endregion
29
213
  //#region src/components/MapFeatures.vue.d.ts
30
- interface Props {
214
+ interface Props$1 {
31
215
  idKey?: string;
32
216
  fill?: string;
33
217
  stroke?: string;
218
+ styles?: MapObjectStyles<StyleValue>;
34
219
  }
35
220
  declare var __VLS_1$2: {
36
- features: _d3_maps_core1.MapFeature[];
221
+ features: MapFeature[];
37
222
  };
38
223
  type __VLS_Slots$2 = {} & {
39
224
  default?: (props: typeof __VLS_1$2) => any;
40
225
  };
41
- declare const __VLS_base$2: vue6.DefineComponent<Props, {}, {}, {}, {}, vue6.ComponentOptionsMixin, vue6.ComponentOptionsMixin, {}, string, vue6.PublicProps, Readonly<Props> & Readonly<{}>, {
226
+ declare const __VLS_base$2: vue4.DefineComponent<Props$1, {}, {}, {}, {}, vue4.ComponentOptionsMixin, vue4.ComponentOptionsMixin, {}, string, vue4.PublicProps, Readonly<Props$1> & Readonly<{}>, {
42
227
  idKey: string;
43
- }, {}, {}, {}, string, vue6.ComponentProvideOptions, false, {}, any>;
44
- declare const __VLS_export$2: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
45
- declare const _default$2: typeof __VLS_export$2;
228
+ }, {}, {}, {}, string, vue4.ComponentProvideOptions, false, {}, any>;
229
+ declare const __VLS_export$3: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
230
+ declare const _default$2: typeof __VLS_export$3;
46
231
  type __VLS_WithSlots$2<T, S> = T & {
47
232
  new (): {
48
233
  $slots: S;
@@ -50,40 +235,54 @@ type __VLS_WithSlots$2<T, S> = T & {
50
235
  };
51
236
  //#endregion
52
237
  //#region src/components/MapMarker.vue.d.ts
53
- type __VLS_Props$1 = MapMarkerProps<StyleValue>;
238
+ type __VLS_Props = MapMarkerProps<StyleValue>;
54
239
  declare var __VLS_1$1: {};
55
240
  type __VLS_Slots$1 = {} & {
56
241
  default?: (props: typeof __VLS_1$1) => any;
57
242
  };
58
- declare const __VLS_base$1: vue6.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, vue6.ComponentOptionsMixin, vue6.ComponentOptionsMixin, {} & {
243
+ declare const __VLS_base$1: vue4.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue4.ComponentOptionsMixin, vue4.ComponentOptionsMixin, {} & {
59
244
  [x: string]: any;
60
- }, string, vue6.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
245
+ }, string, vue4.PublicProps, Readonly<__VLS_Props> & Readonly<{
61
246
  [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
62
247
  }>, {
63
- coordinates: _d3_maps_core1.MapMarkerCoordinates;
64
- }, {}, {}, {}, string, vue6.ComponentProvideOptions, false, {}, any>;
65
- declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
66
- declare const _default$3: typeof __VLS_export$1;
248
+ coordinates: MapMarkerCoordinates;
249
+ }, {}, {}, {}, string, vue4.ComponentProvideOptions, false, {}, any>;
250
+ declare const __VLS_export$2: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
251
+ declare const _default$3: typeof __VLS_export$2;
67
252
  type __VLS_WithSlots$1<T, S> = T & {
68
253
  new (): {
69
254
  $slots: S;
70
255
  };
71
256
  };
72
257
  //#endregion
258
+ //#region src/components/MapMesh.vue.d.ts
259
+ interface Props {
260
+ fill?: string;
261
+ stroke?: string;
262
+ styles?: MapObjectStyles<StyleValue>;
263
+ }
264
+ declare const __VLS_export$1: vue4.DefineComponent<Props, {}, {}, {}, {}, vue4.ComponentOptionsMixin, vue4.ComponentOptionsMixin, {} & {
265
+ [x: string]: any;
266
+ }, string, vue4.PublicProps, Readonly<Props> & Readonly<{
267
+ [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
268
+ }>, {
269
+ fill: string;
270
+ }, {}, {}, {}, string, vue4.ComponentProvideOptions, false, {}, any>;
271
+ declare const _default$4: typeof __VLS_export$1;
272
+ //#endregion
73
273
  //#region src/components/MapZoom.vue.d.ts
74
- type __VLS_Props = ZoomProps;
75
274
  declare var __VLS_1: {};
76
275
  type __VLS_Slots = {} & {
77
276
  default?: (props: typeof __VLS_1) => any;
78
277
  };
79
- declare const __VLS_base: vue6.DefineComponent<__VLS_Props, {
80
- container: vue6.Ref<SVGGElement | null, SVGGElement | null>;
81
- zoomBehavior: vue6.ComputedRef<_d3_maps_core1.ZoomBehavior<SVGSVGElement, unknown>>;
82
- }, {}, {}, {}, vue6.ComponentOptionsMixin, vue6.ComponentOptionsMixin, {} & {
278
+ declare const __VLS_base: vue4.DefineComponent<ZoomProps, {
279
+ container: vue4.Ref<SVGGElement | null, SVGGElement | null>;
280
+ zoomBehavior: vue4.ComputedRef<DefaultZoomBehavior>;
281
+ }, {}, {}, {}, vue4.ComponentOptionsMixin, vue4.ComponentOptionsMixin, {} & {
83
282
  zoom: (payload: ZoomEvent) => any;
84
283
  zoomstart: (payload: ZoomEvent) => any;
85
284
  zoomend: (payload: ZoomEvent) => any;
86
- }, string, vue6.PublicProps, Readonly<__VLS_Props> & Readonly<{
285
+ }, string, vue4.PublicProps, Readonly<ZoomProps> & Readonly<{
87
286
  onZoom?: ((payload: ZoomEvent) => any) | undefined;
88
287
  onZoomstart?: ((payload: ZoomEvent) => any) | undefined;
89
288
  onZoomend?: ((payload: ZoomEvent) => any) | undefined;
@@ -92,9 +291,9 @@ declare const __VLS_base: vue6.DefineComponent<__VLS_Props, {
92
291
  zoom: number;
93
292
  minZoom: number;
94
293
  maxZoom: number;
95
- }, {}, {}, {}, string, vue6.ComponentProvideOptions, false, {}, any>;
294
+ }, {}, {}, {}, string, vue4.ComponentProvideOptions, false, {}, any>;
96
295
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
97
- declare const _default$4: typeof __VLS_export;
296
+ declare const _default$5: typeof __VLS_export;
98
297
  type __VLS_WithSlots<T, S> = T & {
99
298
  new (): {
100
299
  $slots: S;
@@ -109,4 +308,4 @@ declare const plugin: {
109
308
  install(app: App): void;
110
309
  };
111
310
  //#endregion
112
- export { _default as Map, _default$1 as MapFeature, _default$2 as MapFeatures, _default$3 as MapMarker, _default$4 as MapZoom, plugin };
311
+ export { _default as Map, _default$1 as MapFeature, _default$2 as MapFeatures, _default$3 as MapMarker, _default$4 as MapMesh, _default$5 as MapZoom, plugin };
@@ -1 +1 @@
1
- (function(e,t,n,r){var i=Object.defineProperty,a=(e,t)=>{let n={};for(var r in e)i(n,r,{get:e[r],enumerable:!0});return t&&i(n,Symbol.toStringTag,{value:`Module`}),n};let o=Symbol(`MapContext`),s=(0,n.defineComponent)((e,{slots:t})=>((0,n.provide)(o,e.context),()=>t.default?.()??null),{props:{context:{type:Object,required:!0}}});(0,n.defineComponent)({name:`MapConsumer`,setup(e,{slots:t}){let r=(0,n.inject)(o);return()=>t.default?t.default(r??{}):null}});function c(){return(0,n.inject)(o)}let l=[`viewBox`];var u=(0,n.defineComponent)({__name:`Map`,props:{width:{},height:{},aspectRatio:{},projection:{type:Function},projectionConfig:{},data:{},dataTransformer:{type:Function}},setup(e){let t=e,i=(0,n.computed)(()=>(0,r.makeMapContext)({width:t.width,height:t.height,aspectRatio:t.aspectRatio,projection:t.projection,projectionConfig:t.projectionConfig,data:t.data,dataTransformer:t.dataTransformer}));return(e,t)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(s),{context:i.value},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(),(0,n.createElementBlock)(`svg`,(0,n.mergeProps)({viewBox:`0 0 ${i.value.width} ${i.value.height}`},e.$attrs,{class:`d3-map`}),[(0,n.renderSlot)(e.$slots,`default`,(0,n.normalizeProps)((0,n.guardReactiveProps)(i.value)))],16,l))]),_:3},8,[`context`]))}});function d(e,t){let i=(0,n.ref)(`default`),a=t=>(n=>{i.value=(0,r.getObjectStateUpdate)(t),e(t,n)});return{computedStyle:(0,n.computed)(()=>(0,r.resolveObjectStyle)(i.value,(0,n.unref)(t))),onMouseEnter:a(`mouseenter`),onMouseLeave:a(`mouseleave`),onMouseDown:a(`mousedown`),onMouseUp:a(`mouseup`),onFocus:a(`focus`),onBlur:a(`blur`)}}let f=[`d`,`fill`,`stroke`];var p=(0,n.defineComponent)({__name:`MapFeature`,props:{data:{},styles:{},fill:{},stroke:{}},setup(e,{emit:t}){let r=e,i=t,a=c(),o=(0,n.computed)(()=>a?.renderPath(r.data)),{computedStyle:s,onMouseEnter:l,onMouseLeave:u,onMouseDown:p,onMouseUp:m,onFocus:h,onBlur:g}=d(i,(0,n.toRef)(r,`styles`));return(t,r)=>o.value?((0,n.openBlock)(),(0,n.createElementBlock)(`path`,(0,n.mergeProps)({key:0,d:o.value,style:(0,n.unref)(s),fill:e.fill,stroke:e.stroke,onMouseenter:r[0]||=(...e)=>(0,n.unref)(l)&&(0,n.unref)(l)(...e),onMouseleave:r[1]||=(...e)=>(0,n.unref)(u)&&(0,n.unref)(u)(...e),onMousedown:r[2]||=(...e)=>(0,n.unref)(p)&&(0,n.unref)(p)(...e),onMouseup:r[3]||=(...e)=>(0,n.unref)(m)&&(0,n.unref)(m)(...e),onClick:r[4]||=(...e)=>(0,n.unref)(m)&&(0,n.unref)(m)(...e),onFocus:r[5]||=(...e)=>(0,n.unref)(h)&&(0,n.unref)(h)(...e),onBlur:r[6]||=(...e)=>(0,n.unref)(g)&&(0,n.unref)(g)(...e)},t.$attrs),null,16,f)):(0,n.createCommentVNode)(`v-if`,!0)}}),m=(0,n.defineComponent)({__name:`MapFeatures`,props:{idKey:{default:`id`},fill:{},stroke:{}},setup(e){let t=c(),i=(0,n.computed)(()=>t?.features??[]);return(t,a)=>((0,n.openBlock)(),(0,n.createElementBlock)(`g`,null,[(0,n.renderSlot)(t.$slots,`default`,{features:i.value},()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(i.value,(i,a)=>((0,n.openBlock)(),(0,n.createBlock)(p,(0,n.mergeProps)({key:(0,n.unref)(r.getFeatureKey)(i,e.idKey,a),data:i,fill:e.fill,stroke:e.stroke},{ref_for:!0},t.$attrs),null,16,[`data`,`fill`,`stroke`]))),128))])]))}});let h=[`transform`];var g=(0,n.defineComponent)({__name:`MapMarker`,props:{coordinates:{default:()=>[0,0]},styles:{}},setup(e,{emit:t}){let i=e,a=t,o=c(),s=(0,n.computed)(()=>(0,r.getMarkerTransform)(o,i.coordinates)),{computedStyle:l,onMouseEnter:u,onMouseLeave:f,onMouseDown:p,onMouseUp:m,onFocus:g,onBlur:_}=d(a,(0,n.toRef)(i,`styles`));return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`g`,{transform:s.value,style:(0,n.normalizeStyle)((0,n.unref)(l)),onMouseenter:t[0]||=(...e)=>(0,n.unref)(u)&&(0,n.unref)(u)(...e),onMouseleave:t[1]||=(...e)=>(0,n.unref)(f)&&(0,n.unref)(f)(...e),onMousedown:t[2]||=(...e)=>(0,n.unref)(p)&&(0,n.unref)(p)(...e),onMouseup:t[3]||=(...e)=>(0,n.unref)(m)&&(0,n.unref)(m)(...e),onClick:t[4]||=(...e)=>(0,n.unref)(m)&&(0,n.unref)(m)(...e),onFocus:t[5]||=(...e)=>(0,n.unref)(g)&&(0,n.unref)(g)(...e),onBlur:t[6]||=(...e)=>(0,n.unref)(_)&&(0,n.unref)(_)(...e)},[(0,n.renderSlot)(e.$slots,`default`)],44,h))}}),_=(0,n.defineComponent)({__name:`MapZoom`,props:{center:{default:()=>[0,0]},zoom:{default:1},minZoom:{default:1},maxZoom:{default:8},translateExtent:{},modifiers:{}},emits:[`zoomstart`,`zoom`,`zoomend`],setup(e,{expose:t,emit:i}){let a=e,o=i,s=(0,n.ref)(null),l=c(),u=(0,n.computed)(()=>(0,r.createZoomBehavior)(l,{minZoom:a.minZoom,maxZoom:a.maxZoom,translateExtent:a.translateExtent,modifiers:a.modifiers,onZoomStart:e=>o(`zoomstart`,e),onZoom:e=>{s.value&&s.value.setAttribute(`transform`,e.transform.toString()),o(`zoom`,e)},onZoomEnd:e=>o(`zoomend`,e)}));return(0,n.onMounted)(()=>{(0,n.watch)(()=>[u],()=>(0,r.setupZoom)({element:s.value,behavior:u.value,center:a.center,zoom:a.zoom}),{immediate:!0}),(0,n.watch)(()=>[a.center[0],a.center[1],a.zoom],()=>(0,r.applyZoomTransform)({element:s.value,behavior:u.value,center:a.center,zoom:a.zoom}))}),t({container:s,zoomBehavior:u}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`g`,{ref_key:`container`,ref:s,class:`d3-map-zoom`},[(0,n.renderSlot)(e.$slots,`default`)],512))}}),v=a({Map:()=>u,MapFeature:()=>p,MapFeatures:()=>m,MapMarker:()=>g,MapZoom:()=>_});e.Map=u,e.MapFeature=p,e.MapFeatures=m,e.MapMarker=g,e.MapZoom=_,e.plugin={install(e){Object.entries(v).forEach(([t,n])=>{e.component(t,n)})}}})(this.D3Maps=this.D3Maps||{},_d3_maps_core_index_css,Vue,D3Maps);
1
+ (function(e,t,n,r){var i=Object.defineProperty,a=(e,t)=>{let n={};for(var r in e)i(n,r,{get:e[r],enumerable:!0});return t&&i(n,Symbol.toStringTag,{value:`Module`}),n};let o=Symbol(`MapContext`),s=(0,n.defineComponent)((e,{slots:t})=>((0,n.provide)(o,e.context),()=>t.default?.()??null),{props:{context:{type:Object,required:!0}}});(0,n.defineComponent)({name:`MapConsumer`,setup(e,{slots:t}){let r=(0,n.inject)(o);return()=>t.default?t.default(r??{}):null}});function c(){return(0,n.inject)(o)}let l=[`viewBox`];var u=(0,n.defineComponent)({__name:`Map`,props:{width:{},height:{},aspectRatio:{},projection:{type:Function},projectionConfig:{},data:{},dataTransformer:{type:Function}},setup(e){let t=e,i=(0,n.computed)(()=>(0,r.makeMapContext)({width:t.width,height:t.height,aspectRatio:t.aspectRatio,projection:t.projection,projectionConfig:t.projectionConfig,data:t.data,dataTransformer:t.dataTransformer}));return(e,t)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(s),{context:i.value},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(),(0,n.createElementBlock)(`svg`,(0,n.mergeProps)({viewBox:`0 0 ${i.value.width} ${i.value.height}`},e.$attrs,{class:`d3-map`}),[(0,n.renderSlot)(e.$slots,`default`,(0,n.normalizeProps)((0,n.guardReactiveProps)(i.value)))],16,l))]),_:3},8,[`context`]))}});function d(e,t){let i=(0,n.ref)(`default`),a=t=>n=>{i.value=(0,r.getObjectStateUpdate)(t),e(t,n)};return{computedStyle:(0,n.computed)(()=>(0,r.resolveObjectStyle)(i.value,(0,n.unref)(t))),onMouseEnter:a(`mouseenter`),onMouseLeave:a(`mouseleave`),onMouseDown:a(`mousedown`),onMouseUp:a(`mouseup`),onFocus:a(`focus`),onBlur:a(`blur`)}}let f=[`d`,`fill`,`stroke`];var p=(0,n.defineComponent)({__name:`MapFeature`,props:{data:{},styles:{},fill:{},stroke:{}},setup(e,{emit:t}){let r=e,i=t,a=c(),o=(0,n.computed)(()=>a?.renderPath(r.data)),{computedStyle:s,onMouseEnter:l,onMouseLeave:u,onMouseDown:p,onMouseUp:m,onFocus:h,onBlur:g}=d(i,(0,n.toRef)(r,`styles`));return(t,r)=>o.value?((0,n.openBlock)(),(0,n.createElementBlock)(`path`,(0,n.mergeProps)({key:0,d:o.value,style:(0,n.unref)(s),fill:e.fill,stroke:e.stroke},t.$attrs,{onMouseenter:r[0]||=(...e)=>(0,n.unref)(l)&&(0,n.unref)(l)(...e),onMouseleave:r[1]||=(...e)=>(0,n.unref)(u)&&(0,n.unref)(u)(...e),onMousedown:r[2]||=(...e)=>(0,n.unref)(p)&&(0,n.unref)(p)(...e),onMouseup:r[3]||=(...e)=>(0,n.unref)(m)&&(0,n.unref)(m)(...e),onClick:r[4]||=(...e)=>(0,n.unref)(m)&&(0,n.unref)(m)(...e),onFocus:r[5]||=(...e)=>(0,n.unref)(h)&&(0,n.unref)(h)(...e),onBlur:r[6]||=(...e)=>(0,n.unref)(g)&&(0,n.unref)(g)(...e)}),null,16,f)):(0,n.createCommentVNode)(`v-if`,!0)}}),m=(0,n.defineComponent)({__name:`MapFeatures`,props:{idKey:{default:`id`},fill:{},stroke:{},styles:{}},setup(e){let t=c(),i=(0,n.computed)(()=>t?.features??[]);return(t,a)=>((0,n.openBlock)(),(0,n.createElementBlock)(`g`,null,[(0,n.renderSlot)(t.$slots,`default`,{features:i.value},()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(i.value,(i,a)=>((0,n.openBlock)(),(0,n.createBlock)(p,(0,n.mergeProps)({key:(0,n.unref)(r.getFeatureKey)(i,e.idKey,a),data:i,fill:e.fill,stroke:e.stroke,styles:e.styles},{ref_for:!0},t.$attrs),null,16,[`data`,`fill`,`stroke`,`styles`]))),128))])]))}});let h=[`transform`];var g=(0,n.defineComponent)({__name:`MapMarker`,props:{coordinates:{default:()=>[0,0]},styles:{}},setup(e,{emit:t}){let i=e,a=t,o=c(),s=(0,n.computed)(()=>(0,r.getMarkerTransform)(o,i.coordinates)),{computedStyle:l,onMouseEnter:u,onMouseLeave:f,onMouseDown:p,onMouseUp:m,onFocus:g,onBlur:_}=d(a,(0,n.toRef)(i,`styles`));return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`g`,{transform:s.value,style:(0,n.normalizeStyle)((0,n.unref)(l)),onMouseenter:t[0]||=(...e)=>(0,n.unref)(u)&&(0,n.unref)(u)(...e),onMouseleave:t[1]||=(...e)=>(0,n.unref)(f)&&(0,n.unref)(f)(...e),onMousedown:t[2]||=(...e)=>(0,n.unref)(p)&&(0,n.unref)(p)(...e),onMouseup:t[3]||=(...e)=>(0,n.unref)(m)&&(0,n.unref)(m)(...e),onClick:t[4]||=(...e)=>(0,n.unref)(m)&&(0,n.unref)(m)(...e),onFocus:t[5]||=(...e)=>(0,n.unref)(g)&&(0,n.unref)(g)(...e),onBlur:t[6]||=(...e)=>(0,n.unref)(_)&&(0,n.unref)(_)(...e)},[(0,n.renderSlot)(e.$slots,`default`)],44,h))}});let _=[`d`,`fill`,`stroke`];var v=(0,n.defineComponent)({__name:`MapMesh`,props:{fill:{default:`none`},stroke:{},styles:{}},setup(e,{emit:t}){let r=e,i=t,a=c(),o=(0,n.computed)(()=>a?.renderMesh()),{computedStyle:s,onMouseEnter:l,onMouseLeave:u,onMouseDown:f,onMouseUp:p,onFocus:m,onBlur:h}=d(i,(0,n.toRef)(r,`styles`));return(t,r)=>o.value?((0,n.openBlock)(),(0,n.createElementBlock)(`path`,(0,n.mergeProps)({key:0,d:o.value,style:(0,n.unref)(s),fill:e.fill,stroke:e.stroke},t.$attrs,{onMouseenter:r[0]||=(...e)=>(0,n.unref)(l)&&(0,n.unref)(l)(...e),onMouseleave:r[1]||=(...e)=>(0,n.unref)(u)&&(0,n.unref)(u)(...e),onMousedown:r[2]||=(...e)=>(0,n.unref)(f)&&(0,n.unref)(f)(...e),onMouseup:r[3]||=(...e)=>(0,n.unref)(p)&&(0,n.unref)(p)(...e),onClick:r[4]||=(...e)=>(0,n.unref)(p)&&(0,n.unref)(p)(...e),onFocus:r[5]||=(...e)=>(0,n.unref)(m)&&(0,n.unref)(m)(...e),onBlur:r[6]||=(...e)=>(0,n.unref)(h)&&(0,n.unref)(h)(...e)}),null,16,_)):(0,n.createCommentVNode)(`v-if`,!0)}}),y=(0,n.defineComponent)({__name:`MapZoom`,props:{center:{default:()=>[0,0]},zoom:{default:1},minZoom:{default:1},maxZoom:{default:8},config:{}},emits:[`zoomstart`,`zoom`,`zoomend`],setup(e,{expose:t,emit:i}){let a=e,o=i,s=(0,n.ref)(null),l=c(),u=(0,n.computed)(()=>(0,r.createZoomBehavior)(l,{minZoom:a.minZoom,maxZoom:a.maxZoom,config:a.config,onZoomStart:e=>o(`zoomstart`,e),onZoom:e=>{s.value&&s.value.setAttribute(`transform`,e.transform.toString()),o(`zoom`,e)},onZoomEnd:e=>o(`zoomend`,e)}));return(0,n.onMounted)(()=>{(0,n.watch)(()=>[u],()=>(0,r.setupZoom)({element:s.value,behavior:u.value,center:a.center,zoom:a.zoom}),{immediate:!0}),(0,n.watch)(()=>[a.center[0],a.center[1],a.zoom],()=>(0,r.applyZoomTransform)({element:s.value,behavior:u.value,center:a.center,zoom:a.zoom}))}),t({container:s,zoomBehavior:u}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`g`,{ref_key:`container`,ref:s,class:`d3-map-zoom`},[(0,n.renderSlot)(e.$slots,`default`)],512))}}),b=a({Map:()=>u,MapFeature:()=>p,MapFeatures:()=>m,MapMarker:()=>g,MapMesh:()=>v,MapZoom:()=>y});e.Map=u,e.MapFeature=p,e.MapFeatures=m,e.MapMarker=g,e.MapMesh=v,e.MapZoom=y,e.plugin={install(e){Object.entries(b).forEach(([t,n])=>{e.component(t,n)})}}})(this.D3Maps=this.D3Maps||{},_d3_maps_core_index_css,Vue,D3Maps);
package/dist/index.js CHANGED
@@ -44,7 +44,7 @@ function useMapContext() {
44
44
 
45
45
  //#endregion
46
46
  //#region src/components/Map.vue?vue&type=script&setup=true&lang.ts
47
- const _hoisted_1$2 = ["viewBox"];
47
+ const _hoisted_1$3 = ["viewBox"];
48
48
  var Map_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
49
49
  __name: "Map",
50
50
  props: {
@@ -69,7 +69,7 @@ var Map_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComp
69
69
  }));
70
70
  return (_ctx, _cache) => {
71
71
  return openBlock(), createBlock(unref(MapProvider), { context: context.value }, {
72
- default: withCtx(() => [(openBlock(), createElementBlock("svg", mergeProps({ viewBox: `0 0 ${context.value.width} ${context.value.height}` }, _ctx.$attrs, { class: "d3-map" }), [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(context.value)))], 16, _hoisted_1$2))]),
72
+ default: withCtx(() => [(openBlock(), createElementBlock("svg", mergeProps({ viewBox: `0 0 ${context.value.width} ${context.value.height}` }, _ctx.$attrs, { class: "d3-map" }), [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(context.value)))], 16, _hoisted_1$3))]),
73
73
  _: 3
74
74
  }, 8, ["context"]);
75
75
  };
@@ -84,10 +84,10 @@ var Map_default = Map_vue_vue_type_script_setup_true_lang_default;
84
84
  //#region src/lib/useMapObject.ts
85
85
  function useMapObject(emit, styles) {
86
86
  const state = ref("default");
87
- const eventCallbackFactory = (eventName) => ((event) => {
87
+ const eventCallbackFactory = (eventName) => (event) => {
88
88
  state.value = getObjectStateUpdate(eventName);
89
89
  emit(eventName, event);
90
- });
90
+ };
91
91
  return {
92
92
  computedStyle: computed(() => resolveObjectStyle(state.value, unref(styles))),
93
93
  onMouseEnter: eventCallbackFactory("mouseenter"),
@@ -101,7 +101,7 @@ function useMapObject(emit, styles) {
101
101
 
102
102
  //#endregion
103
103
  //#region src/components/MapFeature.vue?vue&type=script&setup=true&lang.ts
104
- const _hoisted_1$1 = [
104
+ const _hoisted_1$2 = [
105
105
  "d",
106
106
  "fill",
107
107
  "stroke"
@@ -126,7 +126,8 @@ var MapFeature_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
126
126
  d: path.value,
127
127
  style: unref(computedStyle),
128
128
  fill: __props.fill,
129
- stroke: __props.stroke,
129
+ stroke: __props.stroke
130
+ }, _ctx.$attrs, {
130
131
  onMouseenter: _cache[0] || (_cache[0] = (...args) => unref(onMouseEnter) && unref(onMouseEnter)(...args)),
131
132
  onMouseleave: _cache[1] || (_cache[1] = (...args) => unref(onMouseLeave) && unref(onMouseLeave)(...args)),
132
133
  onMousedown: _cache[2] || (_cache[2] = (...args) => unref(onMouseDown) && unref(onMouseDown)(...args)),
@@ -134,7 +135,7 @@ var MapFeature_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
134
135
  onClick: _cache[4] || (_cache[4] = (...args) => unref(onMouseUp) && unref(onMouseUp)(...args)),
135
136
  onFocus: _cache[5] || (_cache[5] = (...args) => unref(onFocus) && unref(onFocus)(...args)),
136
137
  onBlur: _cache[6] || (_cache[6] = (...args) => unref(onBlur) && unref(onBlur)(...args))
137
- }, _ctx.$attrs), null, 16, _hoisted_1$1)) : createCommentVNode("v-if", true);
138
+ }), null, 16, _hoisted_1$2)) : createCommentVNode("v-if", true);
138
139
  };
139
140
  }
140
141
  });
@@ -150,7 +151,8 @@ var MapFeatures_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
150
151
  props: {
151
152
  idKey: { default: "id" },
152
153
  fill: {},
153
- stroke: {}
154
+ stroke: {},
155
+ styles: {}
154
156
  },
155
157
  setup(__props) {
156
158
  const context = useMapContext();
@@ -161,11 +163,13 @@ var MapFeatures_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
161
163
  key: unref(getFeatureKey)(feature, __props.idKey, index),
162
164
  data: feature,
163
165
  fill: __props.fill,
164
- stroke: __props.stroke
166
+ stroke: __props.stroke,
167
+ styles: __props.styles
165
168
  }, { ref_for: true }, _ctx.$attrs), null, 16, [
166
169
  "data",
167
170
  "fill",
168
- "stroke"
171
+ "stroke",
172
+ "styles"
169
173
  ]);
170
174
  }), 128))])]);
171
175
  };
@@ -178,7 +182,7 @@ var MapFeatures_default = MapFeatures_vue_vue_type_script_setup_true_lang_defaul
178
182
 
179
183
  //#endregion
180
184
  //#region src/components/MapMarker.vue?vue&type=script&setup=true&lang.ts
181
- const _hoisted_1 = ["transform"];
185
+ const _hoisted_1$1 = ["transform"];
182
186
  var MapMarker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
183
187
  __name: "MapMarker",
184
188
  props: {
@@ -204,7 +208,7 @@ var MapMarker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
204
208
  onClick: _cache[4] || (_cache[4] = (...args) => unref(onMouseUp) && unref(onMouseUp)(...args)),
205
209
  onFocus: _cache[5] || (_cache[5] = (...args) => unref(onFocus) && unref(onFocus)(...args)),
206
210
  onBlur: _cache[6] || (_cache[6] = (...args) => unref(onBlur) && unref(onBlur)(...args))
207
- }, [renderSlot(_ctx.$slots, "default")], 44, _hoisted_1);
211
+ }, [renderSlot(_ctx.$slots, "default")], 44, _hoisted_1$1);
208
212
  };
209
213
  }
210
214
  });
@@ -213,6 +217,50 @@ var MapMarker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
213
217
  //#region src/components/MapMarker.vue
214
218
  var MapMarker_default = MapMarker_vue_vue_type_script_setup_true_lang_default;
215
219
 
220
+ //#endregion
221
+ //#region src/components/MapMesh.vue?vue&type=script&setup=true&lang.ts
222
+ const _hoisted_1 = [
223
+ "d",
224
+ "fill",
225
+ "stroke"
226
+ ];
227
+ var MapMesh_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
228
+ __name: "MapMesh",
229
+ props: {
230
+ fill: { default: "none" },
231
+ stroke: {},
232
+ styles: {}
233
+ },
234
+ setup(__props, { emit: __emit }) {
235
+ const props = __props;
236
+ const emit = __emit;
237
+ const context = useMapContext();
238
+ const path = computed(() => context?.renderMesh());
239
+ const { computedStyle, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onFocus, onBlur } = useMapObject(emit, toRef(props, "styles"));
240
+ return (_ctx, _cache) => {
241
+ return path.value ? (openBlock(), createElementBlock("path", mergeProps({
242
+ key: 0,
243
+ d: path.value,
244
+ style: unref(computedStyle),
245
+ fill: __props.fill,
246
+ stroke: __props.stroke
247
+ }, _ctx.$attrs, {
248
+ onMouseenter: _cache[0] || (_cache[0] = (...args) => unref(onMouseEnter) && unref(onMouseEnter)(...args)),
249
+ onMouseleave: _cache[1] || (_cache[1] = (...args) => unref(onMouseLeave) && unref(onMouseLeave)(...args)),
250
+ onMousedown: _cache[2] || (_cache[2] = (...args) => unref(onMouseDown) && unref(onMouseDown)(...args)),
251
+ onMouseup: _cache[3] || (_cache[3] = (...args) => unref(onMouseUp) && unref(onMouseUp)(...args)),
252
+ onClick: _cache[4] || (_cache[4] = (...args) => unref(onMouseUp) && unref(onMouseUp)(...args)),
253
+ onFocus: _cache[5] || (_cache[5] = (...args) => unref(onFocus) && unref(onFocus)(...args)),
254
+ onBlur: _cache[6] || (_cache[6] = (...args) => unref(onBlur) && unref(onBlur)(...args))
255
+ }), null, 16, _hoisted_1)) : createCommentVNode("v-if", true);
256
+ };
257
+ }
258
+ });
259
+
260
+ //#endregion
261
+ //#region src/components/MapMesh.vue
262
+ var MapMesh_default = MapMesh_vue_vue_type_script_setup_true_lang_default;
263
+
216
264
  //#endregion
217
265
  //#region src/components/MapZoom.vue?vue&type=script&setup=true&lang.ts
218
266
  var MapZoom_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
@@ -222,8 +270,7 @@ var MapZoom_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
222
270
  zoom: { default: 1 },
223
271
  minZoom: { default: 1 },
224
272
  maxZoom: { default: 8 },
225
- translateExtent: {},
226
- modifiers: {}
273
+ config: {}
227
274
  },
228
275
  emits: [
229
276
  "zoomstart",
@@ -239,8 +286,7 @@ var MapZoom_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
239
286
  return createZoomBehavior(context, {
240
287
  minZoom: props.minZoom,
241
288
  maxZoom: props.maxZoom,
242
- translateExtent: props.translateExtent,
243
- modifiers: props.modifiers,
289
+ config: props.config,
244
290
  onZoomStart: (event) => emit("zoomstart", event),
245
291
  onZoom: (event) => {
246
292
  if (container.value) container.value.setAttribute("transform", event.transform.toString());
@@ -292,6 +338,7 @@ var components_exports = /* @__PURE__ */ __exportAll({
292
338
  MapFeature: () => MapFeature_default,
293
339
  MapFeatures: () => MapFeatures_default,
294
340
  MapMarker: () => MapMarker_default,
341
+ MapMesh: () => MapMesh_default,
295
342
  MapZoom: () => MapZoom_default
296
343
  });
297
344
 
@@ -307,4 +354,4 @@ const plugin = { install(app) {
307
354
  } };
308
355
 
309
356
  //#endregion
310
- export { Map_default as Map, MapFeature_default as MapFeature, MapFeatures_default as MapFeatures, MapMarker_default as MapMarker, MapZoom_default as MapZoom, plugin };
357
+ export { Map_default as Map, MapFeature_default as MapFeature, MapFeatures_default as MapFeatures, MapMarker_default as MapMarker, MapMesh_default as MapMesh, MapZoom_default as MapZoom, plugin };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@d3-maps/vue",
3
- "version": "0.1.1-next.0",
4
3
  "type": "module",
4
+ "version": "0.3.0",
5
5
  "private": false,
6
6
  "description": "Vue bindings for @d3-maps/core to build reactive D3 SVG maps",
7
7
  "author": "Georgii Bukharov <souljorje@gmail.com>",
@@ -9,7 +9,7 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
- "homepage": "https://d3-maps.netlify.app",
12
+ "homepage": "https://souljorje.github.io/d3-maps",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "https://github.com/souljorje/d3-maps.git",
@@ -44,7 +44,7 @@
44
44
  "vue": "3.5.25"
45
45
  },
46
46
  "dependencies": {
47
- "@d3-maps/core": "0.1.1-next.0"
47
+ "@d3-maps/core": "0.3.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/geojson": "^7946.0.16",
@@ -55,13 +55,15 @@
55
55
  "jsdom": "^27.3.0",
56
56
  "tsdown": "0.19.0",
57
57
  "typescript": "^5.9.3",
58
+ "unplugin-vue": "^6.0.1",
59
+ "vite-tsconfig-paths": "^6.1.1",
58
60
  "vitest": "^4.0.15",
59
61
  "vue": "3.5.25",
60
- "vue-tsc": "^3.2.0",
61
- "unplugin-vue": "^6.0.1"
62
+ "vue-tsc": "^3.2.0"
62
63
  },
63
64
  "scripts": {
64
65
  "typecheck": "vue-tsc --noEmit",
66
+ "typecheck:test": "vue-tsc -p tsconfig.test.json --noEmit",
65
67
  "build": "pnpm run typecheck && tsdown",
66
68
  "test": "vitest run",
67
69
  "test:watch": "vitest"