@mint-ui/map 1.1.4 → 1.2.0-test.10
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/README.md +7 -7
- package/dist/components/mint-map/core/MintMapController.d.ts +0 -1
- package/dist/components/mint-map/core/MintMapCore.js +6 -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 +1 -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 +54 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/WoongKonvaMarker.js +1130 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/index.d.ts +3 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/context.d.ts +32 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/context.js +168 -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 +131 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/types.js +14 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/utils.d.ts +31 -0
- package/dist/components/mint-map/core/advanced/woongCanvas/shared/utils.js +164 -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 +5 -4
- package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +0 -1
- package/dist/components/mint-map/kakao/KakaoMintMapController.js +5 -4
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +0 -3
- package/dist/components/mint-map/naver/NaverMintMapController.js +8 -37
- package/dist/index.es.js +5232 -1964
- package/dist/index.js +26 -0
- package/dist/index.umd.js +5248 -1965
- package/dist/mock.d.ts +133 -0
- package/package.json +17 -4
- package/.claude/settings.local.json +0 -16
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
|
package/README.md
CHANGED
|
@@ -129,7 +129,7 @@ npm pack
|
|
|
129
129
|
#### 5. NPM에 배포
|
|
130
130
|
스코프 패키지(`@mint-ui/map`)는 기본적으로 private이므로 public으로 배포해야 합니다.
|
|
131
131
|
```bash
|
|
132
|
-
npm publish
|
|
132
|
+
npm publish
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
#### 6. 배포 완료 확인
|
|
@@ -154,7 +154,7 @@ npm version patch
|
|
|
154
154
|
npm pack
|
|
155
155
|
|
|
156
156
|
# 5단계: 배포
|
|
157
|
-
npm publish
|
|
157
|
+
npm publish
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
### 현재 패키지 정보
|
|
@@ -185,7 +185,7 @@ npm publish --access public
|
|
|
185
185
|
npm run build
|
|
186
186
|
|
|
187
187
|
# test tag로 배포
|
|
188
|
-
npm publish
|
|
188
|
+
npm publish --tag test
|
|
189
189
|
```
|
|
190
190
|
|
|
191
191
|
3. **변경사항 커밋 및 푸시**
|
|
@@ -202,7 +202,7 @@ npm publish --access public
|
|
|
202
202
|
|
|
203
203
|
# 빌드 및 배포
|
|
204
204
|
npm run build
|
|
205
|
-
npm publish
|
|
205
|
+
npm publish --tag test
|
|
206
206
|
|
|
207
207
|
# 커밋 및 푸시
|
|
208
208
|
git add .
|
|
@@ -215,7 +215,7 @@ npm publish --access public
|
|
|
215
215
|
git checkout -b 1.2.0-test.2
|
|
216
216
|
npm version 1.2.0-test.2 --no-git-tag-version
|
|
217
217
|
npm run build
|
|
218
|
-
npm publish
|
|
218
|
+
npm publish --tag test
|
|
219
219
|
git add .
|
|
220
220
|
git commit -m "chore: release 1.2.0-test.2"
|
|
221
221
|
git push origin 1.2.0-test.2
|
|
@@ -234,7 +234,7 @@ npm publish --access public
|
|
|
234
234
|
|
|
235
235
|
# 빌드 및 배포
|
|
236
236
|
npm run build
|
|
237
|
-
npm publish
|
|
237
|
+
npm publish
|
|
238
238
|
|
|
239
239
|
# main에 푸시
|
|
240
240
|
git push origin main
|
|
@@ -267,5 +267,5 @@ npm install @mint-ui/map@1.2.0-test.1
|
|
|
267
267
|
### 주의사항
|
|
268
268
|
- 배포하기 전에 반드시 `npm run build`를 실행해야 합니다
|
|
269
269
|
- 버전은 한 번 배포하면 되돌릴 수 없으니 신중하게 결정하세요
|
|
270
|
-
- 스코프 패키지는
|
|
270
|
+
- 스코프 패키지는 `` 옵션을 반드시 붙여야 합니다
|
|
271
271
|
- test tag로 배포할 때는 `--no-git-tag-version` 옵션을 사용하여 git tag 생성을 방지합니다
|
|
@@ -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,11 @@ 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('./advanced/woongCanvas/shared/types.js');
|
|
12
|
+
require('../types/MapDrawables.js');
|
|
13
|
+
require('../types/MapEventTypes.js');
|
|
14
|
+
var context = require('./advanced/woongCanvas/shared/context.js');
|
|
15
|
+
require('./advanced/woongCanvas/shared/performance.js');
|
|
11
16
|
|
|
12
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
18
|
|
|
@@ -96,7 +101,7 @@ function MintMapCore(_a) {
|
|
|
96
101
|
}, [center]);
|
|
97
102
|
return React__default["default"].createElement("div", {
|
|
98
103
|
className: cn('mint-map-root')
|
|
99
|
-
}, mapInitialized && children, React__default["default"].createElement("div", {
|
|
104
|
+
}, mapInitialized && React__default["default"].createElement(context.KonvaMarkerProvider, null, children), React__default["default"].createElement("div", {
|
|
100
105
|
className: cn('mint-map-container'),
|
|
101
106
|
style: {
|
|
102
107
|
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>;
|