@mint-ui/map 1.1.1 → 1.2.0-test.1

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 (31) hide show
  1. package/.claude/settings.local.json +16 -0
  2. package/.vscode/settings.json +11 -0
  3. package/CLAUDE.md +100 -0
  4. package/README.md +190 -0
  5. package/dist/components/mint-map/core/MintMapController.d.ts +1 -1
  6. package/dist/components/mint-map/core/MintMapCore.js +4 -1
  7. package/dist/components/mint-map/core/advanced/canvas/CanvasMarkerClaude.d.ts +63 -0
  8. package/dist/components/mint-map/core/advanced/canvas/CanvasMarkerClaude.js +1084 -0
  9. package/dist/components/mint-map/core/advanced/canvas/CanvasMarkerHanquf.d.ts +22 -0
  10. package/dist/components/mint-map/core/advanced/canvas/CanvasMarkerHanquf.js +413 -0
  11. package/dist/components/mint-map/core/advanced/canvas/index.d.ts +2 -0
  12. package/dist/components/mint-map/core/advanced/woongCanvas/ClusterMarker.d.ts +11 -0
  13. package/dist/components/mint-map/core/advanced/woongCanvas/WoongKonvaMarker.d.ts +48 -0
  14. package/dist/components/mint-map/core/advanced/woongCanvas/shared/context.d.ts +31 -0
  15. package/dist/components/mint-map/core/advanced/woongCanvas/shared/context.js +159 -0
  16. package/dist/components/mint-map/core/advanced/woongCanvas/shared/index.d.ts +4 -0
  17. package/dist/components/mint-map/core/advanced/woongCanvas/shared/performance.d.ts +161 -0
  18. package/dist/components/mint-map/core/advanced/woongCanvas/shared/types.d.ts +121 -0
  19. package/dist/components/mint-map/core/advanced/woongCanvas/shared/utils.d.ts +23 -0
  20. package/dist/components/mint-map/core/util/geohash.d.ts +2 -0
  21. package/dist/components/mint-map/core/util/geohash.js +125 -0
  22. package/dist/components/mint-map/google/GoogleMintMapController.js +1 -0
  23. package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +58 -0
  24. package/dist/components/mint-map/kakao/KakaoMintMapController.js +1 -0
  25. package/dist/components/mint-map/naver/NaverMintMapController.js +1 -0
  26. package/dist/components/mint-map/types/CommonTypes.d.ts +11 -0
  27. package/dist/index.es.js +1863 -137
  28. package/dist/index.js +4 -0
  29. package/dist/index.umd.js +1862 -134
  30. package/dist/mock.d.ts +133 -0
  31. package/package.json +17 -4
@@ -0,0 +1,16 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Read(//var/folders/7t/vchtbctx3m788mhcq9fn2x540000gn/T/TemporaryItems/NSIRD_screencaptureui_OsfFWn/**)",
5
+ "Read(//Users/hans/Desktop/**)",
6
+ "WebSearch",
7
+ "Read(//var/folders/7t/vchtbctx3m788mhcq9fn2x540000gn/T/TemporaryItems/NSIRD_screencaptureui_4DskwH/**)",
8
+ "WebFetch(domain:www.bdsplanet.com)",
9
+ "mcp__ide__getDiagnostics",
10
+ "Bash(npm run storybook:*)",
11
+ "Read(//var/folders/7t/vchtbctx3m788mhcq9fn2x540000gn/T/TemporaryItems/NSIRD_screencaptureui_HMhrPV/**)"
12
+ ],
13
+ "deny": [],
14
+ "ask": []
15
+ }
16
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "editor.formatOnSave": false,
3
+ "editor.codeActionsOnSave": {
4
+ "source.fixAll": "never",
5
+ "source.fixAll.eslint": "never",
6
+ "source.organizeImports": "never"
7
+ },
8
+ "eslint.enable": false,
9
+ "typescript.format.enable": false,
10
+ "javascript.format.enable": false
11
+ }
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
@@ -79,3 +79,193 @@ root.render((<MyMapComponent/>))
79
79
  ## Document / Reference Site
80
80
 
81
81
  [https://dev-rsquare.github.io/mint-ui-map-guide](https://dev-rsquare.github.io/mint-ui-map-guide)
82
+
83
+ ## 개발 및 NPM 배포
84
+
85
+ ### NPM 배포하는 방법
86
+
87
+ #### 1. NPM 계정 로그인 확인
88
+ 먼저 NPM에 로그인되어 있는지 확인합니다.
89
+ ```bash
90
+ npm whoami
91
+ ```
92
+ 만약 로그인이 안되어 있다면:
93
+ ```bash
94
+ npm login
95
+ ```
96
+
97
+ #### 2. 프로젝트 빌드
98
+ 배포하기 전에 반드시 프로젝트를 빌드해야 합니다.
99
+ ```bash
100
+ npm run build
101
+ ```
102
+ 이 명령어는 `dist/` 폴더에 배포용 파일들을 생성합니다.
103
+
104
+ #### 3. 버전 업데이트 (필요한 경우)
105
+ 새로운 기능이나 버그 수정이 있다면 버전을 올려야 합니다.
106
+
107
+ - **버그 수정**: `1.1.2` → `1.1.3` (patch)
108
+ ```bash
109
+ npm version patch
110
+ ```
111
+
112
+ - **새로운 기능 추가**: `1.1.2` → `1.2.0` (minor)
113
+ ```bash
114
+ npm version minor
115
+ ```
116
+
117
+ - **호환성이 깨지는 변경**: `1.1.2` → `2.0.0` (major)
118
+ ```bash
119
+ npm version major
120
+ ```
121
+
122
+ #### 4. 배포 전 확인 (권장)
123
+ 실제 배포하기 전에 어떤 파일들이 배포될지 확인해보세요.
124
+ ```bash
125
+ npm pack
126
+ ```
127
+ 이 명령어는 `.tgz` 파일을 생성하고, 배포될 파일 목록을 보여줍니다.
128
+
129
+ #### 5. NPM에 배포
130
+ 스코프 패키지(`@mint-ui/map`)는 기본적으로 private이므로 public으로 배포해야 합니다.
131
+ ```bash
132
+ npm publish --access public
133
+ ```
134
+
135
+ #### 6. 배포 완료 확인
136
+ 배포가 성공했는지 NPM 웹사이트에서 확인하거나:
137
+ ```bash
138
+ npm view @mint-ui/map
139
+ ```
140
+
141
+ ### 전체 배포 과정 요약
142
+
143
+ ```bash
144
+ # 1단계: 로그인 확인
145
+ npm whoami
146
+
147
+ # 2단계: 빌드
148
+ npm run build
149
+
150
+ # 3단계: 버전 업데이트 (필요시)
151
+ npm version patch
152
+
153
+ # 4단계: 배포 전 확인 (선택사항)
154
+ npm pack
155
+
156
+ # 5단계: 배포
157
+ npm publish --access public
158
+ ```
159
+
160
+ ### 현재 패키지 정보
161
+ - **패키지명**: `@mint-ui/map`
162
+ - **현재 버전**: `1.1.2`
163
+ - **패키지 타입**: 스코프 패키지 (`@mint-ui` 네임스페이스 사용)
164
+
165
+ ### 테스트 버전 배포 (Test Tag)
166
+
167
+ 새로운 기능을 개발 중이거나 테스트가 필요한 경우, `test` tag를 사용하여 배포할 수 있습니다.
168
+
169
+ #### 테스트 버전 배포 방법
170
+
171
+ 1. **새로운 브랜치 생성 및 이동**
172
+ - main 브랜치에서 분리하여 작업
173
+ ```bash
174
+ # 새로운 브랜치 생성 및 체크아웃
175
+ git checkout -b 1.2.0-test.1
176
+ ```
177
+
178
+ 2. **개발 중인 버전의 pre-release 버전 생성**
179
+ - 예: 1.2.0을 개발 중이라면 `1.2.0-test.1` 형식 사용
180
+ ```bash
181
+ # 버전 변경 (git tag 생성하지 않음)
182
+ npm version 1.2.0-test.1 --no-git-tag-version
183
+
184
+ # 빌드
185
+ npm run build
186
+
187
+ # test tag로 배포
188
+ npm publish --access public --tag test
189
+ ```
190
+
191
+ 3. **변경사항 커밋 및 푸시**
192
+ ```bash
193
+ git add .
194
+ git commit -m "chore: release 1.2.0-test.1"
195
+ git push origin 1.2.0-test.1
196
+ ```
197
+
198
+ 4. **수정 후 재배포 (같은 브랜치에서)**
199
+ ```bash
200
+ # 버전 업데이트
201
+ npm version 1.2.0-test.2 --no-git-tag-version
202
+
203
+ # 빌드 및 배포
204
+ npm run build
205
+ npm publish --access public --tag test
206
+
207
+ # 커밋 및 푸시
208
+ git add .
209
+ git commit -m "chore: release 1.2.0-test.2"
210
+ git push origin 1.2.0-test.1
211
+ ```
212
+
213
+ 또는 새로운 테스트 브랜치를 만들 수도 있습니다:
214
+ ```bash
215
+ git checkout -b 1.2.0-test.2
216
+ npm version 1.2.0-test.2 --no-git-tag-version
217
+ npm run build
218
+ npm publish --access public --tag test
219
+ git add .
220
+ git commit -m "chore: release 1.2.0-test.2"
221
+ git push origin 1.2.0-test.2
222
+ ```
223
+
224
+ 5. **테스트 완료 후 정식 배포**
225
+ ```bash
226
+ # main 브랜치로 이동
227
+ git checkout main
228
+
229
+ # 테스트 브랜치 병합 (또는 PR 생성)
230
+ git merge 1.2.0-test.1
231
+
232
+ # 정식 버전으로 업데이트
233
+ npm version 1.2.0
234
+
235
+ # 빌드 및 배포
236
+ npm run build
237
+ npm publish --access public
238
+
239
+ # main에 푸시
240
+ git push origin main
241
+ git push origin 1.2.0 # version 명령어로 생성된 태그도 푸시
242
+ ```
243
+
244
+ #### 테스트 버전 설치 방법
245
+
246
+ ```bash
247
+ # test tag로 설치
248
+ npm install @mint-ui/map@test
249
+
250
+ # 특정 test 버전으로 설치
251
+ npm install @mint-ui/map@1.2.0-test.1
252
+ ```
253
+
254
+ #### 버전 네이밍 규칙
255
+
256
+ - **현재 버전 기반 테스트**: `1.1.2-test.1` (현재 버전 1.1.2를 테스트하는 경우)
257
+ - **신규 버전 개발 테스트**: `1.2.0-test.1` (새로운 기능으로 1.2.0을 만드는 경우)
258
+ - **테스트 버전 증가**: `1.2.0-test.2`, `1.2.0-test.3` ...
259
+
260
+ #### Tag별 버전 관리
261
+
262
+ - **latest tag** (기본): 안정적인 정식 버전 (예: `1.1.2`)
263
+ - **test tag**: 테스트 중인 버전 (예: `1.2.0-test.1`)
264
+
265
+ `npm install @mint-ui/map` 명령어는 항상 `latest` tag의 버전을 설치하므로, test 버전은 명시적으로 `@test`를 붙여야만 설치됩니다.
266
+
267
+ ### 주의사항
268
+ - 배포하기 전에 반드시 `npm run build`를 실행해야 합니다
269
+ - 버전은 한 번 배포하면 되돌릴 수 없으니 신중하게 결정하세요
270
+ - 스코프 패키지는 `--access public` 옵션을 반드시 붙여야 합니다
271
+ - test tag로 배포할 때는 `--no-git-tag-version` 옵션을 사용하여 git tag 생성을 방지합니다
@@ -41,7 +41,7 @@ export declare abstract class MintMapController {
41
41
  mapInitialized: boolean;
42
42
  mapDivElement: HTMLDivElement;
43
43
  constructor(props: MintMapProps);
44
- getMap(): any;
44
+ getMap(): MapVendorType | null;
45
45
  getMapType(): MapType;
46
46
  positionToOffset(position: Position): Offset;
47
47
  offsetToPosition(offset: Offset): Position;
@@ -8,6 +8,9 @@ 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');
11
14
 
12
15
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
16
 
@@ -96,7 +99,7 @@ function MintMapCore(_a) {
96
99
  }, [center]);
97
100
  return React__default["default"].createElement("div", {
98
101
  className: cn('mint-map-root')
99
- }, mapInitialized && children, React__default["default"].createElement("div", {
102
+ }, mapInitialized && React__default["default"].createElement(context.KonvaMarkerProvider, null, children), React__default["default"].createElement("div", {
100
103
  className: cn('mint-map-container'),
101
104
  style: {
102
105
  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>;