@mint-ui/map 1.1.3 → 1.2.0-test.2
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/.vscode/settings.json +3 -3
- package/CLAUDE.md +100 -0
- package/dist/components/mint-map/core/MintMapController.d.ts +0 -1
- package/dist/components/mint-map/core/MintMapCore.js +5 -1
- package/dist/components/mint-map/core/advanced/canvas/CanvasMarkerClaude.d.ts +63 -0
- package/dist/components/mint-map/core/advanced/canvas/CanvasMarkerClaude.js +1084 -0
- package/dist/components/mint-map/core/advanced/canvas/CanvasMarkerHanquf.d.ts +22 -0
- package/dist/components/mint-map/core/advanced/canvas/CanvasMarkerHanquf.js +413 -0
- package/dist/components/mint-map/core/advanced/canvas/index.d.ts +2 -0
- package/dist/components/mint-map/core/advanced/index.d.ts +4 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/ClusterMarker.d.ts +11 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/WoongKonvaMarker.d.ts +48 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/WoongKonvaMarker.js +1032 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/index.d.ts +2 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/context.d.ts +31 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/context.js +164 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/index.d.ts +4 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/performance.d.ts +161 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/performance.js +343 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/types.d.ts +121 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/utils.d.ts +23 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/utils.js +115 -0
- package/dist/components/mint-map/core/util/geohash.d.ts +2 -0
- package/dist/components/mint-map/core/util/geohash.js +125 -0
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +1 -22
- package/dist/components/mint-map/google/GoogleMintMapController.d.ts +0 -1
- package/dist/components/mint-map/google/GoogleMintMapController.js +4 -4
- package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +0 -1
- package/dist/components/mint-map/kakao/KakaoMintMapController.js +4 -4
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +0 -3
- package/dist/components/mint-map/naver/NaverMintMapController.js +7 -32
- package/dist/index.es.js +5185 -2069
- package/dist/index.js +25 -13
- package/dist/index.umd.js +5193 -2070
- package/dist/mock.d.ts +133 -0
- package/package.json +17 -4
package/.vscode/settings.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"editor.formatOnSave": false,
|
|
3
3
|
"editor.codeActionsOnSave": {
|
|
4
|
-
"source.fixAll":
|
|
5
|
-
"source.fixAll.eslint":
|
|
6
|
-
"source.organizeImports":
|
|
4
|
+
"source.fixAll": "never",
|
|
5
|
+
"source.fixAll.eslint": "never",
|
|
6
|
+
"source.organizeImports": "never"
|
|
7
7
|
},
|
|
8
8
|
"eslint.enable": false,
|
|
9
9
|
"typescript.format.enable": false,
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
@mint-ui/map is a React-based map library that provides a unified interface for controlling multiple map providers (Google Maps, Naver Maps, and Kakao Maps) with TypeScript support and advanced Canvas marker capabilities.
|
|
8
|
+
|
|
9
|
+
## Development Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Development
|
|
13
|
+
npm run storybook # Start Storybook dev server on port 3000
|
|
14
|
+
|
|
15
|
+
# Building
|
|
16
|
+
npm run build # Build library for distribution (cleans dist/, runs rollup)
|
|
17
|
+
|
|
18
|
+
# NPM Publishing
|
|
19
|
+
npm run build # Always build before publishing
|
|
20
|
+
npm version patch # Increment version (patch/minor/major)
|
|
21
|
+
npm publish --access public # Publish to NPM (must use --access public for scoped package)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Architecture Overview
|
|
25
|
+
|
|
26
|
+
### Map Provider Abstraction
|
|
27
|
+
The library uses a controller pattern to abstract different map providers:
|
|
28
|
+
- `GoogleMintMapController` - Google Maps implementation
|
|
29
|
+
- `NaverMintMapController` - Naver Maps implementation
|
|
30
|
+
- `KakaoMintMapController` - Kakao Maps implementation
|
|
31
|
+
|
|
32
|
+
Each controller implements a common interface, allowing seamless switching between map providers.
|
|
33
|
+
|
|
34
|
+
### Core Directory Structure
|
|
35
|
+
```
|
|
36
|
+
src/components/mint-map/
|
|
37
|
+
├── MintMap.tsx # Main entry component
|
|
38
|
+
├── core/
|
|
39
|
+
│ ├── advanced/ # Canvas markers, shapes, drawing tools
|
|
40
|
+
│ ├── hooks/ # React hooks for map interactions
|
|
41
|
+
│ ├── provider/ # React Context for state management
|
|
42
|
+
│ └── wrapper/ # Component wrappers (markers, overlays)
|
|
43
|
+
├── google/ # Google Maps specific implementation
|
|
44
|
+
├── naver/ # Naver Maps specific implementation
|
|
45
|
+
├── kakao/ # Kakao Maps specific implementation
|
|
46
|
+
└── types/ # TypeScript type definitions
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Key Architectural Patterns
|
|
50
|
+
|
|
51
|
+
1. **Factory Pattern**: The `MintMap` component dynamically instantiates the appropriate controller based on the `mapType` prop.
|
|
52
|
+
|
|
53
|
+
2. **Provider Pattern**: Uses React Context (`MintMapProvider`) to share map state and controller instance across components.
|
|
54
|
+
|
|
55
|
+
3. **Wrapper Components**: Components like `MapMarkerWrapper` abstract the differences between map provider APIs.
|
|
56
|
+
|
|
57
|
+
4. **Canvas Rendering**: Advanced marker system using HTML5 Canvas for high-performance rendering of large datasets.
|
|
58
|
+
|
|
59
|
+
## TypeScript Configuration
|
|
60
|
+
|
|
61
|
+
- Target: ES5 with React JSX
|
|
62
|
+
- Strict mode enabled
|
|
63
|
+
- Declaration files generated for distribution
|
|
64
|
+
- Excludes `*.stories.tsx` and `*.test.tsx` from compilation
|
|
65
|
+
|
|
66
|
+
## Build System
|
|
67
|
+
|
|
68
|
+
Uses Rollup with multiple output formats:
|
|
69
|
+
- CommonJS: `dist/index.js`
|
|
70
|
+
- ES Module: `dist/index.es.js`
|
|
71
|
+
- UMD: `dist/index.umd.js`
|
|
72
|
+
- Type declarations: `dist/index.d.ts`
|
|
73
|
+
|
|
74
|
+
## Development with Storybook
|
|
75
|
+
|
|
76
|
+
The project uses Storybook for component development and documentation:
|
|
77
|
+
- Stories in `src/stories/` demonstrate usage patterns
|
|
78
|
+
- `basics/` - Basic map functionality examples
|
|
79
|
+
- `markerlab/` - Advanced marker experiments including canvas markers
|
|
80
|
+
- `sample/` - Complete implementation examples
|
|
81
|
+
|
|
82
|
+
## Code Style
|
|
83
|
+
|
|
84
|
+
- ESLint with Airbnb config + TypeScript rules
|
|
85
|
+
- Tab-based indentation (2-space equivalent)
|
|
86
|
+
- Alphabetical import ordering enforced
|
|
87
|
+
- SCSS modules for component styling
|
|
88
|
+
|
|
89
|
+
## Working with Canvas Markers
|
|
90
|
+
|
|
91
|
+
Canvas markers are a key feature for high-performance rendering:
|
|
92
|
+
- `CanvasMarker.tsx` - Main canvas marker component
|
|
93
|
+
- `CanvasMarkerHanquf.tsx` - Specialized canvas marker variant
|
|
94
|
+
- Renderer function pattern for custom drawing logic
|
|
95
|
+
- Supports geohash-based clustering
|
|
96
|
+
|
|
97
|
+
## External Resources
|
|
98
|
+
|
|
99
|
+
- Documentation site: https://dev-rsquare.github.io/mint-ui-map-guide
|
|
100
|
+
- NPM package: @mint-ui/map
|
|
@@ -24,7 +24,6 @@ export declare abstract class MintMapController {
|
|
|
24
24
|
abstract updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
25
25
|
abstract clearDrawable(drawable: Drawable): boolean;
|
|
26
26
|
abstract markerToTheTop(marker: Marker): void;
|
|
27
|
-
abstract restoreMarkerZIndex(marker: Marker): void;
|
|
28
27
|
abstract isMapDragged(): boolean;
|
|
29
28
|
abstract setMapDragged(value: boolean): void;
|
|
30
29
|
abstract setMarkerZIndex(marker: Marker, zIndex: number): void;
|
|
@@ -8,6 +8,10 @@ var React = require('react');
|
|
|
8
8
|
var MapTypes = require('../types/MapTypes.js');
|
|
9
9
|
var MintMapProvider = require('./provider/MintMapProvider.js');
|
|
10
10
|
var MintMapCore_module = require('./MintMapCore.module.scss.js');
|
|
11
|
+
require('../types/MapDrawables.js');
|
|
12
|
+
require('../types/MapEventTypes.js');
|
|
13
|
+
var context = require('./advanced/woongCanvas/shared/context.js');
|
|
14
|
+
require('./advanced/woongCanvas/shared/performance.js');
|
|
11
15
|
|
|
12
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
17
|
|
|
@@ -96,7 +100,7 @@ function MintMapCore(_a) {
|
|
|
96
100
|
}, [center]);
|
|
97
101
|
return React__default["default"].createElement("div", {
|
|
98
102
|
className: cn('mint-map-root')
|
|
99
|
-
}, mapInitialized && children, React__default["default"].createElement("div", {
|
|
103
|
+
}, mapInitialized && React__default["default"].createElement(context.KonvaMarkerProvider, null, children), React__default["default"].createElement("div", {
|
|
100
104
|
className: cn('mint-map-container'),
|
|
101
105
|
style: {
|
|
102
106
|
visibility: visible ? 'inherit' : 'hidden'
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarkerOptions, Offset, Position } from "../../../types";
|
|
3
|
+
export interface PolygonData {
|
|
4
|
+
id: string;
|
|
5
|
+
positions: Position[];
|
|
6
|
+
innerPositions?: Position[][];
|
|
7
|
+
background?: string;
|
|
8
|
+
strokeColor?: string;
|
|
9
|
+
strokeWidth?: number;
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
data?: any;
|
|
12
|
+
centerLat?: number;
|
|
13
|
+
centerLng?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface MarkerData {
|
|
16
|
+
id: string;
|
|
17
|
+
lat: number;
|
|
18
|
+
lng: number;
|
|
19
|
+
data?: any;
|
|
20
|
+
visible?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface MarkerRendererParams {
|
|
23
|
+
context: CanvasRenderingContext2D;
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
marker: MarkerData;
|
|
27
|
+
isHovered?: boolean;
|
|
28
|
+
isClicked?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface MarkerBounds {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
}
|
|
36
|
+
export interface PolygonRendererParams {
|
|
37
|
+
context: CanvasRenderingContext2D;
|
|
38
|
+
offsets: Offset[];
|
|
39
|
+
innerOffsets?: Offset[][];
|
|
40
|
+
polygon: PolygonData;
|
|
41
|
+
isHovered?: boolean;
|
|
42
|
+
defaultBackground: string;
|
|
43
|
+
defaultStrokeColor: string;
|
|
44
|
+
defaultStrokeWidth: number;
|
|
45
|
+
hoverBackground: string;
|
|
46
|
+
hoverStrokeColor: string;
|
|
47
|
+
}
|
|
48
|
+
export interface CanvasMarkerClaudeProps extends Pick<MarkerOptions, 'zIndex' | 'anchor' | 'visible'> {
|
|
49
|
+
polygons?: PolygonData[];
|
|
50
|
+
markers?: MarkerData[];
|
|
51
|
+
background?: string;
|
|
52
|
+
strokeColor?: string;
|
|
53
|
+
strokeWidth?: number;
|
|
54
|
+
onPolygonClick?: (polygon: PolygonData | null) => void;
|
|
55
|
+
onPolygonHover?: (polygon: PolygonData) => void;
|
|
56
|
+
onPolygonLeave?: () => void;
|
|
57
|
+
onMarkerClick?: (marker: MarkerData | null) => void;
|
|
58
|
+
onMarkerHover?: (marker: MarkerData) => void;
|
|
59
|
+
onMarkerLeave?: () => void;
|
|
60
|
+
onRenderComplete?: () => void;
|
|
61
|
+
markerRenderer?: (params: MarkerRendererParams) => MarkerBounds;
|
|
62
|
+
}
|
|
63
|
+
export declare const CanvasMarkerClaude: React.NamedExoticComponent<CanvasMarkerClaudeProps>;
|