@mint-ui/map 1.2.0-test.35 → 1.2.0-test.37

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 (22) hide show
  1. package/dist/components/mint-map/core/advanced/shared/context.d.ts +9 -71
  2. package/dist/components/mint-map/core/advanced/shared/context.js +43 -137
  3. package/dist/components/mint-map/core/advanced/shared/helpers.d.ts +5 -13
  4. package/dist/components/mint-map/core/advanced/shared/helpers.js +8 -20
  5. package/dist/components/mint-map/core/advanced/shared/hooks.d.ts +6 -76
  6. package/dist/components/mint-map/core/advanced/shared/hooks.js +18 -112
  7. package/dist/components/mint-map/core/advanced/shared/performance.d.ts +9 -188
  8. package/dist/components/mint-map/core/advanced/shared/performance.js +53 -229
  9. package/dist/components/mint-map/core/advanced/shared/types.d.ts +22 -153
  10. package/dist/components/mint-map/core/advanced/shared/types.js +0 -1
  11. package/dist/components/mint-map/core/advanced/shared/utils.d.ts +21 -126
  12. package/dist/components/mint-map/core/advanced/shared/utils.js +46 -152
  13. package/dist/components/mint-map/core/advanced/shared/viewport.d.ts +4 -34
  14. package/dist/components/mint-map/core/advanced/shared/viewport.js +4 -34
  15. package/dist/components/mint-map/core/advanced/woongCanvasMarker/WoongCanvasMarker.d.ts +22 -74
  16. package/dist/components/mint-map/core/advanced/woongCanvasMarker/WoongCanvasMarker.js +128 -519
  17. package/dist/components/mint-map/core/advanced/woongCanvasPolygon/WoongCanvasPolygon.d.ts +26 -76
  18. package/dist/components/mint-map/core/advanced/woongCanvasPolygon/WoongCanvasPolygon.js +118 -432
  19. package/dist/components/mint-map/core/advanced/woongCanvasPolygon/renderer.d.ts +3 -3
  20. package/dist/index.es.js +419 -1637
  21. package/dist/index.umd.js +419 -1637
  22. package/package.json +1 -1
@@ -1,79 +1,31 @@
1
1
  import React from "react";
2
2
  import { Offset } from "../../../types";
3
- import { KonvaCanvasData } from "./types";
3
+ import { CanvasData } from "./types";
4
4
  /**
5
- * 다중 WoongCanvasMarker/WoongCanvasPolygon 인스턴스를 관리하기 위한 Context
6
- *
7
- * 여러 WoongCanvas 컴포넌트가 함께 사용될 때 zIndex 기반으로 이벤트 우선순위를 관리합니다.
8
- *
9
- * @remarks
10
- * **주요 용도:**
11
- * - zIndex 기반 이벤트 우선순위 처리 (높은 zIndex가 먼저 처리)
12
- * - 전역 클릭/호버 이벤트 조정
13
- * - 여러 레이어 간 상호작용 관리
14
- *
15
- * @example
16
- * ```tsx
17
- * <WoongCanvasProvider>
18
- * <WoongCanvasMarker data={markers} zIndex={10} />
19
- * <WoongCanvasPolygon data={polygons} zIndex={5} />
20
- * </WoongCanvasProvider>
21
- * ```
5
+ * WoongCanvas 컴포넌트 인스턴스 인터페이스
22
6
  *
23
7
  * @template T 마커/폴리곤 데이터의 추가 속성 타입
24
8
  */
25
9
  export interface ComponentInstance<T> {
26
10
  zIndex: number;
27
11
  hitTest: (offset: Offset) => boolean;
28
- onClick?: (payload: KonvaCanvasData<T>, selectedIds: Set<string>) => void;
29
- onMouseOver?: (payload: KonvaCanvasData<T>) => void;
30
- onMouseOut?: (payload: KonvaCanvasData<T>) => void;
31
- findData: (offset: Offset) => KonvaCanvasData<T> | null;
32
- setHovered: (data: KonvaCanvasData<T> | null) => void;
33
- handleLocalClick: (data: KonvaCanvasData<T>) => void;
12
+ onClick?: (payload: CanvasData<T>, selectedIds: Set<string>) => void;
13
+ onMouseOver?: (payload: CanvasData<T>) => void;
14
+ onMouseOut?: (payload: CanvasData<T>) => void;
15
+ findData: (offset: Offset) => CanvasData<T> | null;
16
+ setHovered: (data: CanvasData<T> | null) => void;
17
+ handleLocalClick: (data: CanvasData<T>) => void;
34
18
  getSelectedIds: () => Set<string>;
35
19
  isInteractionDisabled: () => boolean;
36
20
  }
37
- /**
38
- * WoongCanvas Context Value 인터페이스
39
- *
40
- * @template T 마커/폴리곤 데이터의 추가 속성 타입
41
- */
42
21
  interface WoongCanvasContextValue {
43
- /**
44
- * 컴포넌트 인스턴스 등록
45
- *
46
- * @param instance 등록할 컴포넌트 인스턴스
47
- */
48
22
  registerComponent: <T>(instance: ComponentInstance<T>) => void;
49
- /**
50
- * 컴포넌트 인스턴스 등록 해제
51
- *
52
- * @param instance 등록 해제할 컴포넌트 인스턴스
53
- */
54
23
  unregisterComponent: <T>(instance: ComponentInstance<T>) => void;
55
24
  }
56
25
  /**
57
26
  * WoongCanvasProvider 컴포넌트
58
27
  *
59
- * 다중 WoongCanvas 컴포넌트 인스턴스를 관리하는 Context Provider입니다.
60
- * 여러 WoongCanvasMarker/WoongCanvasPolygon이 함께 사용될 때 전역 이벤트 조정을 수행합니다.
61
- *
62
- * @param props 컴포넌트 props
63
- * @param props.children 자식 컴포넌트
64
- *
65
- * @remarks
66
- * - zIndex 기반으로 이벤트 우선순위 처리
67
- * - 전역 클릭/호버 이벤트 조정
68
- * - 여러 레이어 간 상호작용 관리
69
- *
70
- * @example
71
- * ```tsx
72
- * <WoongCanvasProvider>
73
- * <WoongCanvasMarker data={markers} zIndex={10} />
74
- * <WoongCanvasPolygon data={polygons} zIndex={5} />
75
- * </WoongCanvasProvider>
76
- * ```
28
+ * 다중 WoongCanvas 인스턴스를 관리하고 zIndex 기반 이벤트 우선순위를 처리합니다.
77
29
  */
78
30
  export declare const WoongCanvasProvider: React.FC<{
79
31
  children: React.ReactNode;
@@ -81,21 +33,7 @@ export declare const WoongCanvasProvider: React.FC<{
81
33
  /**
82
34
  * WoongCanvas Context Hook
83
35
  *
84
- * WoongCanvasProvider로 감싸진 컴포넌트에서 Context에 접근할 수 있는 hook입니다.
85
- *
86
36
  * @returns WoongCanvasContextValue 또는 null (Provider 없으면)
87
- *
88
- * @remarks
89
- * - Provider로 감싸지지 않으면 null 반환 (각 컴포넌트가 로컬 이벤트 처리)
90
- * - Provider로 감싸져 있으면 전역 이벤트 조정 활성화
91
- *
92
- * @example
93
- * ```typescript
94
- * const context = useWoongCanvasContext();
95
- * if (context) {
96
- * // Context 사용 중 (전역 이벤트 조정)
97
- * }
98
- * ```
99
37
  */
100
38
  export declare const useWoongCanvasContext: () => WoongCanvasContextValue | null;
101
39
  export {};
@@ -13,62 +13,25 @@ var WoongCanvasContext = React.createContext(null);
13
13
  /**
14
14
  * WoongCanvasProvider 컴포넌트
15
15
  *
16
- * 다중 WoongCanvas 컴포넌트 인스턴스를 관리하는 Context Provider입니다.
17
- * 여러 WoongCanvasMarker/WoongCanvasPolygon이 함께 사용될 때 전역 이벤트 조정을 수행합니다.
18
- *
19
- * @param props 컴포넌트 props
20
- * @param props.children 자식 컴포넌트
21
- *
22
- * @remarks
23
- * - zIndex 기반으로 이벤트 우선순위 처리
24
- * - 전역 클릭/호버 이벤트 조정
25
- * - 여러 레이어 간 상호작용 관리
26
- *
27
- * @example
28
- * ```tsx
29
- * <WoongCanvasProvider>
30
- * <WoongCanvasMarker data={markers} zIndex={10} />
31
- * <WoongCanvasPolygon data={polygons} zIndex={5} />
32
- * </WoongCanvasProvider>
33
- * ```
16
+ * 다중 WoongCanvas 인스턴스를 관리하고 zIndex 기반 이벤트 우선순위를 처리합니다.
34
17
  */
35
18
 
36
19
  var WoongCanvasProvider = function (_a) {
37
20
  var children = _a.children;
38
- var controller = MintMapProvider.useMintMapController(); // Refs
39
-
21
+ var controller = MintMapProvider.useMintMapController();
40
22
  var componentsRef = React.useRef([]);
41
23
  var currentHoveredRef = React.useRef(null);
42
24
  var currentHoveredDataRef = React.useRef(null);
43
- var draggingRef = React.useRef(false);
44
- /**
45
- * 컴포넌트 등록 (zIndex 내림차순 정렬)
46
- *
47
- * 컴포넌트 인스턴스를 등록하고 zIndex 기준으로 내림차순 정렬합니다.
48
- * 높은 zIndex를 가진 컴포넌트가 이벤트 처리에서 우선순위를 가집니다.
49
- *
50
- * @template T 마커/폴리곤 데이터의 추가 속성 타입
51
- * @param instance 등록할 컴포넌트 인스턴스
52
- */
25
+ var draggingRef = React.useRef(false); // 컴포넌트 등록 (zIndex 내림차순 정렬)
53
26
 
54
27
  var registerComponent = React.useCallback(function (instance) {
55
28
  componentsRef.current.push(instance);
56
29
  componentsRef.current.sort(function (a, b) {
57
30
  return b.zIndex - a.zIndex;
58
31
  });
59
- }, []);
60
- /**
61
- * 컴포넌트 등록 해제
62
- *
63
- * 컴포넌트 인스턴스를 등록 해제합니다.
64
- * hover 중이던 컴포넌트면 hover 상태도 초기화합니다.
65
- *
66
- * @template T 마커/폴리곤 데이터의 추가 속성 타입
67
- * @param instance 등록 해제할 컴포넌트 인스턴스
68
- */
32
+ }, []); // 컴포넌트 등록 해제
69
33
 
70
34
  var unregisterComponent = React.useCallback(function (instance) {
71
- // Hover 중이던 컴포넌트면 초기화
72
35
  if (currentHoveredRef.current === instance) {
73
36
  currentHoveredRef.current = null;
74
37
  currentHoveredDataRef.current = null;
@@ -77,118 +40,77 @@ var WoongCanvasProvider = function (_a) {
77
40
  componentsRef.current = componentsRef.current.filter(function (c) {
78
41
  return c !== instance;
79
42
  });
80
- }, []);
81
- /**
82
- * 전역 클릭 핸들러 (zIndex 우선순위)
83
- *
84
- * 모든 등록된 WoongCanvas 컴포넌트 중 zIndex가 높은 컴포넌트부터 클릭 이벤트를 처리합니다.
85
- *
86
- * @param event 클릭 이벤트 파라미터
87
- *
88
- * @remarks
89
- * - zIndex가 높은 컴포넌트부터 순회하여 첫 번째 히트만 처리
90
- * - 상호작용이 비활성화된 컴포넌트는 스킵
91
- * - Context가 없으면 각 컴포넌트의 로컬 핸들러가 처리
92
- */
43
+ }, []); // 전역 클릭 핸들러 (zIndex 우선순위)
93
44
 
94
45
  var handleGlobalClick = React.useCallback(function (event) {
95
- var _a;
46
+ var _a, _b;
96
47
 
97
48
  if (!((_a = event === null || event === void 0 ? void 0 : event.param) === null || _a === void 0 ? void 0 : _a.position)) return;
98
- var clickedOffset = controller.positionToOffset(event.param.position); // zIndex 순서대로 순회 (높은 것부터)
99
-
100
- for (var _i = 0, _b = componentsRef.current; _i < _b.length; _i++) {
101
- var component = _b[_i]; // 🚫 상호작용이 비활성화된 컴포넌트는 스킵
49
+ var clickedOffset = controller.positionToOffset(event.param.position); // zIndex 내림차순으로 정렬된 컴포넌트 순회 (높은 zIndex가 먼저 처리)
102
50
 
51
+ for (var _i = 0, _c = componentsRef.current; _i < _c.length; _i++) {
52
+ var component = _c[_i];
103
53
  if (component.isInteractionDisabled()) continue;
104
54
  var data = component.findData(clickedOffset);
55
+ if (!data) continue; // 첫 번째로 찾은 항목만 처리하고 종료 (zIndex 우선순위)
105
56
 
106
- if (data) {
107
- component.handleLocalClick(data);
108
-
109
- if (component.onClick) {
110
- component.onClick(data, component.getSelectedIds());
111
- }
112
-
113
- return; // 첫 번째 히트만 처리
114
- }
57
+ component.handleLocalClick(data);
58
+ (_b = component.onClick) === null || _b === void 0 ? void 0 : _b.call(component, data, component.getSelectedIds());
59
+ return;
115
60
  }
116
- }, [controller]);
117
- /**
118
- * 전역 마우스 이동 핸들러 (zIndex 우선순위)
119
- *
120
- * 모든 등록된 WoongCanvas 컴포넌트 중 zIndex가 높은 컴포넌트부터 hover 이벤트를 처리합니다.
121
- *
122
- * @param event 마우스 이동 이벤트 파라미터
123
- *
124
- * @remarks
125
- * - zIndex가 높은 컴포넌트부터 순회하여 첫 번째 히트만 처리
126
- * - 상호작용이 비활성화된 컴포넌트는 스킵
127
- * - 드래그 중이면 이벤트 무시 (성능 최적화)
128
- * - hover 상태 변경 감지 후 이전 hover 해제 및 새 hover 설정
129
- */
61
+ }, [controller]); // 전역 마우스 이동 핸들러 (zIndex 우선순위)
130
62
 
131
63
  var handleGlobalMouseMove = React.useCallback(function (event) {
132
64
  var _a;
133
65
 
134
66
  if (draggingRef.current || !((_a = event === null || event === void 0 ? void 0 : event.param) === null || _a === void 0 ? void 0 : _a.position)) return;
135
- var mouseOffset = controller.positionToOffset(event.param.position); // zIndex 순서대로 순회하여 Hover 대상 찾기
136
-
67
+ var mouseOffset = controller.positionToOffset(event.param.position);
137
68
  var newHoveredComponent = null;
138
- var newHoveredData = null;
69
+ var newHoveredData = null; // zIndex 내림차순으로 정렬된 컴포넌트 순회 (높은 zIndex가 먼저 처리)
139
70
 
140
71
  for (var _i = 0, _b = componentsRef.current; _i < _b.length; _i++) {
141
- var component = _b[_i]; // 🚫 상호작용이 비활성화된 컴포넌트는 스킵
142
-
72
+ var component = _b[_i];
143
73
  if (component.isInteractionDisabled()) continue;
144
74
  var data = component.findData(mouseOffset);
75
+ if (!data) continue; // 첫 번째로 찾은 항목만 hover 처리 (zIndex 우선순위)
145
76
 
146
- if (data) {
147
- newHoveredComponent = component;
148
- newHoveredData = data;
149
- break; // 번째 히트만 처리
150
- }
151
- } // Hover 상태 변경 감지 (최적화: 별도 ref로 직접 비교)
152
-
77
+ newHoveredComponent = component;
78
+ newHoveredData = data;
79
+ break;
80
+ } // hover 상태가 변경되지 않았으면 종료 (불필요한 렌더링 방지)
153
81
 
154
- if (currentHoveredRef.current !== newHoveredComponent || currentHoveredDataRef.current !== newHoveredData) {
155
- // 이전 hover 해제
156
- if (currentHoveredRef.current) {
157
- currentHoveredRef.current.setHovered(null);
158
82
 
159
- if (currentHoveredRef.current.onMouseOut && currentHoveredDataRef.current) {
160
- currentHoveredRef.current.onMouseOut(currentHoveredDataRef.current);
161
- }
162
- } // 새 hover 설정
83
+ if (currentHoveredRef.current === newHoveredComponent && currentHoveredDataRef.current === newHoveredData) {
84
+ return;
85
+ } // 기존 hover 항목에 mouseOut 이벤트 발생
163
86
 
164
87
 
165
- if (newHoveredComponent && newHoveredData) {
166
- newHoveredComponent.setHovered(newHoveredData);
88
+ if (currentHoveredRef.current) {
89
+ currentHoveredRef.current.setHovered(null);
167
90
 
168
- if (newHoveredComponent.onMouseOver) {
169
- newHoveredComponent.onMouseOver(newHoveredData);
170
- }
91
+ if (currentHoveredRef.current.onMouseOut && currentHoveredDataRef.current) {
92
+ currentHoveredRef.current.onMouseOut(currentHoveredDataRef.current);
171
93
  }
94
+ } // 새 hover 항목에 mouseOver 이벤트 발생
95
+
96
+
97
+ if (newHoveredComponent && newHoveredData) {
98
+ newHoveredComponent.setHovered(newHoveredData);
172
99
 
173
- currentHoveredRef.current = newHoveredComponent;
174
- currentHoveredDataRef.current = newHoveredData;
100
+ if (newHoveredComponent.onMouseOver) {
101
+ newHoveredComponent.onMouseOver(newHoveredData);
102
+ }
175
103
  }
176
- }, [controller]);
177
- /**
178
- * 줌/드래그 시작 (마우스 이동 이벤트 무시)
179
- */
180
104
 
105
+ currentHoveredRef.current = newHoveredComponent;
106
+ currentHoveredDataRef.current = newHoveredData;
107
+ }, [controller]);
181
108
  var handleZoomStart = React.useCallback(function () {
182
109
  draggingRef.current = true;
183
110
  }, []);
184
- /**
185
- * 지도 idle (마우스 이동 이벤트 재개)
186
- */
187
-
188
111
  var handleIdle = React.useCallback(function () {
189
112
  draggingRef.current = false;
190
- }, []); // 이벤트 리스너 등록
191
-
113
+ }, []);
192
114
  React.useEffect(function () {
193
115
  controller.addEventListener('CLICK', handleGlobalClick);
194
116
  controller.addEventListener('MOUSEMOVE', handleGlobalMouseMove);
@@ -200,8 +122,7 @@ var WoongCanvasProvider = function (_a) {
200
122
  controller.removeEventListener('ZOOMSTART', handleZoomStart);
201
123
  controller.removeEventListener('IDLE', handleIdle);
202
124
  };
203
- }, [controller, handleGlobalClick, handleGlobalMouseMove, handleZoomStart, handleIdle]); // Context value 메모이제이션
204
-
125
+ }, [controller, handleGlobalClick, handleGlobalMouseMove, handleZoomStart, handleIdle]);
205
126
  var contextValue = React.useMemo(function () {
206
127
  return {
207
128
  registerComponent: registerComponent,
@@ -215,26 +136,11 @@ var WoongCanvasProvider = function (_a) {
215
136
  /**
216
137
  * WoongCanvas Context Hook
217
138
  *
218
- * WoongCanvasProvider로 감싸진 컴포넌트에서 Context에 접근할 수 있는 hook입니다.
219
- *
220
139
  * @returns WoongCanvasContextValue 또는 null (Provider 없으면)
221
- *
222
- * @remarks
223
- * - Provider로 감싸지지 않으면 null 반환 (각 컴포넌트가 로컬 이벤트 처리)
224
- * - Provider로 감싸져 있으면 전역 이벤트 조정 활성화
225
- *
226
- * @example
227
- * ```typescript
228
- * const context = useWoongCanvasContext();
229
- * if (context) {
230
- * // Context 사용 중 (전역 이벤트 조정)
231
- * }
232
- * ```
233
140
  */
234
141
 
235
142
  var useWoongCanvasContext = function () {
236
- var context = React.useContext(WoongCanvasContext);
237
- return context;
143
+ return React.useContext(WoongCanvasContext);
238
144
  };
239
145
 
240
146
  exports.WoongCanvasProvider = WoongCanvasProvider;
@@ -2,27 +2,19 @@ import { EventParam, MapUIEventParam } from "../../../types";
2
2
  import type { MintMapController } from "../../MintMapController";
3
3
  import type { Offset } from "../../../types";
4
4
  /**
5
- * 이벤트 유효성 검증 헬퍼
5
+ * 이벤트 유효성 검증 및 좌표 변환
6
6
  *
7
7
  * @param event 이벤트 파라미터
8
- * @param context Context가 있는지 여부
8
+ * @param context WoongCanvasContext 인스턴스
9
9
  * @param controller MintMapController 인스턴스
10
- * @returns 유효한 offset 또는 null
11
- *
12
- * @remarks
13
- * Context가 있으면 전역 이벤트 핸들러가 처리하므로 로컬 핸들러는 스킵
10
+ * @returns 유효한 화면 좌표 또는 null
14
11
  */
15
12
  export declare const validateEvent: (event: EventParam<MapUIEventParam> | null | undefined, context: any, controller: MintMapController) => Offset | null;
16
13
  /**
17
- * Map의 values를 배열로 변환 (최적화 버전)
14
+ * Map의 values를 배열로 변환
18
15
  *
16
+ * @template T Map 값의 타입
19
17
  * @param map 변환할 Map
20
18
  * @returns Map의 값 배열
21
- *
22
- * @remarks
23
- * Map.values()는 IterableIterator를 반환하므로 배열 변환이 필요할 때 사용합니다.
24
- * 성능: O(n) 시간복잡도
25
- *
26
- * 최적화: Array.from을 사용하되, 크기를 미리 할당하여 메모리 재할당 최소화
27
19
  */
28
20
  export declare const mapValuesToArray: <T>(map: Map<string, T>) => T[];
@@ -3,22 +3,17 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  /**
6
- * 이벤트 유효성 검증 헬퍼
6
+ * 이벤트 유효성 검증 및 좌표 변환
7
7
  *
8
8
  * @param event 이벤트 파라미터
9
- * @param context Context가 있는지 여부
9
+ * @param context WoongCanvasContext 인스턴스
10
10
  * @param controller MintMapController 인스턴스
11
- * @returns 유효한 offset 또는 null
12
- *
13
- * @remarks
14
- * Context가 있으면 전역 이벤트 핸들러가 처리하므로 로컬 핸들러는 스킵
11
+ * @returns 유효한 화면 좌표 또는 null
15
12
  */
16
13
  var validateEvent = function (event, context, controller) {
17
- var _a; // Context가 있으면 전역 핸들러가 처리
18
-
19
-
20
- if (context) return null; // 이벤트 파라미터 검증
14
+ var _a;
21
15
 
16
+ if (context) return null;
22
17
  if (!((_a = event === null || event === void 0 ? void 0 : event.param) === null || _a === void 0 ? void 0 : _a.position)) return null;
23
18
 
24
19
  try {
@@ -29,22 +24,15 @@ var validateEvent = function (event, context, controller) {
29
24
  }
30
25
  };
31
26
  /**
32
- * Map의 values를 배열로 변환 (최적화 버전)
27
+ * Map의 values를 배열로 변환
33
28
  *
29
+ * @template T Map 값의 타입
34
30
  * @param map 변환할 Map
35
31
  * @returns Map의 값 배열
36
- *
37
- * @remarks
38
- * Map.values()는 IterableIterator를 반환하므로 배열 변환이 필요할 때 사용합니다.
39
- * 성능: O(n) 시간복잡도
40
- *
41
- * 최적화: Array.from을 사용하되, 크기를 미리 할당하여 메모리 재할당 최소화
42
32
  */
43
33
 
44
34
  var mapValuesToArray = function (map) {
45
- // Map이 비어있으면 배열 반환 (메모리 할당 최소화)
46
- if (map.size === 0) return []; // Array.from 사용 (TypeScript 컴파일러 호환성)
47
-
35
+ if (map.size === 0) return [];
48
36
  return Array.from(map.values());
49
37
  };
50
38
 
@@ -1,7 +1,7 @@
1
1
  import { MutableRefObject } from "react";
2
2
  import type { MintMapController } from "../../MintMapController";
3
3
  import type { Marker, MarkerOptions } from "../../../types";
4
- import type { KonvaCanvasData } from "./types";
4
+ import type { CanvasData } from "./types";
5
5
  import type { BoundingBox } from "./viewport";
6
6
  import type { SpatialHashGrid } from "./performance";
7
7
  /**
@@ -32,33 +32,9 @@ export interface EventHandlerDeps<T> {
32
32
  /**
33
33
  * 지도 이벤트 핸들러 생성 함수
34
34
  *
35
- * 지도 이동, 줌, 드래그 등의 이벤트를 처리하는 핸들러들을 생성합니다.
36
- *
37
35
  * @template T 마커/폴리곤 데이터의 추가 속성 타입
38
36
  * @param deps 이벤트 핸들러 생성에 필요한 의존성
39
37
  * @returns 지도 이벤트 핸들러 객체
40
- *
41
- * @example
42
- * ```typescript
43
- * const {
44
- * handleIdle,
45
- * handleZoomStart,
46
- * handleZoomEnd,
47
- * handleCenterChanged,
48
- * handleDragStart,
49
- * handleDragEnd,
50
- * } = createMapEventHandlers({
51
- * controller,
52
- * containerRef,
53
- * markerRef,
54
- * options,
55
- * prevCenterOffsetRef,
56
- * accumTranslateRef,
57
- * offsetCacheRef,
58
- * boundingBoxCacheRef,
59
- * renderAllImmediate,
60
- * });
61
- * ```
62
38
  */
63
39
  export declare const createMapEventHandlers: <T>(deps: EventHandlerDeps<T>) => {
64
40
  handleIdle: () => void;
@@ -71,74 +47,28 @@ export declare const createMapEventHandlers: <T>(deps: EventHandlerDeps<T>) => {
71
47
  /**
72
48
  * 공간 인덱스 빌드 (빠른 Hit Test를 위한 자료구조)
73
49
  *
74
- * Spatial Hash Grid에 모든 데이터의 바운딩 박스를 삽입합니다.
75
- * 이를 통해 클릭/호버 시 O(1) 수준의 빠른 Hit Test가 가능합니다.
76
- *
77
50
  * @template T 마커/폴리곤 데이터의 추가 속성 타입
78
51
  * @param data 공간 인덱스에 삽입할 데이터 배열
79
52
  * @param spatialIndex Spatial Hash Grid 인스턴스
80
53
  * @param computeBoundingBox 바운딩 박스 계산 함수
81
- *
82
- * @remarks
83
- * - 성능: O(n) 시간복잡도, n은 데이터 개수
84
- * - 호출 시점: 데이터 변경 시 또는 지도 이동/줌 완료 시
85
- *
86
- * @example
87
- * ```typescript
88
- * buildSpatialIndex(
89
- * dataRef.current,
90
- * spatialIndexRef.current,
91
- * computeBoundingBox
92
- * );
93
- * ```
94
54
  */
95
- export declare const buildSpatialIndex: <T>(data: KonvaCanvasData<T>[], spatialIndex: SpatialHashGrid<KonvaCanvasData<T>>, computeBoundingBox: (item: KonvaCanvasData<T>) => BoundingBox | null) => void;
55
+ export declare const buildSpatialIndex: <T>(data: CanvasData<T>[], spatialIndex: SpatialHashGrid<CanvasData<T>>, computeBoundingBox: (item: CanvasData<T>) => BoundingBox | null) => void;
96
56
  /**
97
- * 선택 상태 동기화 유틸리티
98
- *
99
- * 데이터 변경 시 선택된 항목의 참조를 최신 데이터로 업데이트합니다.
100
- * 화면 밖에 있는 선택된 항목도 선택 상태를 유지합니다.
57
+ * 선택 상태 동기화 (화면 밖 데이터도 선택 상태 유지)
101
58
  *
102
59
  * @template T 마커/폴리곤 데이터의 추가 속성 타입
103
60
  * @param data 최신 데이터 배열
104
61
  * @param selectedIds 선택된 항목 ID Set
105
62
  * @param selectedItemsMap 현재 선택된 항목 Map
106
63
  * @returns 업데이트된 선택된 항목 Map
107
- *
108
- * @remarks
109
- * - 성능: O(n + m), n은 전체 데이터 수, m은 선택된 항목 수
110
- * - 화면 밖 데이터도 선택 상태 유지 (최신 데이터가 없으면 기존 데이터 유지)
111
- *
112
- * @example
113
- * ```typescript
114
- * selectedItemsMapRef.current = syncSelectedItems(
115
- * data,
116
- * selectedIdsRef.current,
117
- * selectedItemsMapRef.current
118
- * );
119
- * ```
120
64
  */
121
- export declare const syncSelectedItems: <T>(data: KonvaCanvasData<T>[], selectedIds: Set<string>, selectedItemsMap: Map<string, KonvaCanvasData<T>>) => Map<string, KonvaCanvasData<T>>;
65
+ export declare const syncSelectedItems: <T>(data: CanvasData<T>[], selectedIds: Set<string>, selectedItemsMap: Map<string, CanvasData<T>>) => Map<string, CanvasData<T>>;
122
66
  /**
123
67
  * 외부 selectedItems를 내부 상태로 동기화
124
68
  *
125
- * 외부에서 전달된 selectedItems prop을 내부 ref 상태로 동기화합니다.
126
- *
127
69
  * @template T 마커/폴리곤 데이터의 추가 속성 타입
128
- * @param externalSelectedItems 외부에서 전달된 선택된 항목 배열 (undefined면 동기화 안 함)
70
+ * @param externalSelectedItems 외부에서 전달된 선택된 항목 배열
129
71
  * @param selectedIdsRef 선택된 ID Set ref
130
72
  * @param selectedItemsMapRef 선택된 항목 Map ref
131
- *
132
- * @remarks
133
- * - externalSelectedItems가 undefined면 외부 제어가 아니므로 아무 작업도 하지 않음
134
- * - 성능: O(m), m은 externalSelectedItems의 길이
135
- *
136
- * @example
137
- * ```typescript
138
- * useEffect(() => {
139
- * syncExternalSelectedItems(externalSelectedItems, selectedIdsRef, selectedItemsMapRef);
140
- * // 렌더링...
141
- * }, [externalSelectedItems]);
142
- * ```
143
73
  */
144
- export declare const syncExternalSelectedItems: <T>(externalSelectedItems: KonvaCanvasData<T>[] | undefined, selectedIdsRef: MutableRefObject<Set<string>>, selectedItemsMapRef: MutableRefObject<Map<string, KonvaCanvasData<T>>>) => void;
74
+ export declare const syncExternalSelectedItems: <T>(externalSelectedItems: CanvasData<T>[] | undefined, selectedIdsRef: MutableRefObject<Set<string>>, selectedItemsMapRef: MutableRefObject<Map<string, CanvasData<T>>>) => void;