@aivex/ui 1.2.0-dev.15 → 1.2.0-dev.16
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/dist/components/ShapeEditor/_model/geometry.d.ts +14 -0
- package/dist/components/ShapeEditor/_model/geometry.test.d.ts +1 -0
- package/dist/components/ShapeEditor/_model/strings.d.ts +1 -0
- package/dist/components/ShapeEditor/_model/viewSettings.d.ts +2 -0
- package/dist/components/ShapeEditor/_renderers/KonvaRenderer.d.ts +6 -0
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.d.ts +8 -0
- package/dist/components/ShapeEditor/_renderers/types.d.ts +4 -0
- package/dist/components/ShapeEditor/_state/createInteractionController.d.ts +2 -0
- package/dist/shape-editor.cjs +1 -1
- package/dist/shape-editor.cjs.map +1 -1
- package/dist/shape-editor.js +1552 -1341
- package/dist/shape-editor.js.map +1 -1
- package/package.json +1 -1
|
@@ -128,3 +128,17 @@ export declare function rotatedRectAngle(points: Point[]): number;
|
|
|
128
128
|
export declare function localBoxToCorners(box: BBox, R: Point, u: Point, v: Point): Point[];
|
|
129
129
|
export declare function resizeRotatedRectFromAnchor(points: Point[], anchor: Anchor, target: Point): Point[];
|
|
130
130
|
export declare function rescalePoints(points: Point[], from: BBox, to: BBox): Point[];
|
|
131
|
+
/**
|
|
132
|
+
* 폴리곤 자기교차(모래시계 등) 여부 — 인접하지 않은 변끼리 교차 검사.
|
|
133
|
+
* O(n²)라 정점이 아주 많은 폴리곤(자동 추적 마스크 등)은 검사하지 않고 false를
|
|
134
|
+
* 돌려준다(수동 정점 편집으로 만드는 폴리곤 크기에서만 의미 있는 검사).
|
|
135
|
+
*/
|
|
136
|
+
export declare function polygonSelfIntersects(points: Point[], maxPoints?: number): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* 자기교차 폴리곤을 교차점에서 잘라 단순 폴리곤들로 분해한다(모래시계 → 삼각형 2개).
|
|
139
|
+
* earcut 기반 렌더러(Pixi)의 면 채움용 — 교차가 없으면 [points] 그대로 반환.
|
|
140
|
+
* 노드 리스트(원 정점 + 변별 t 정렬 교차점)를 순회하다 교차점에 도착하면 쌍둥이
|
|
141
|
+
* 노드로 건너뛰어 루프를 닫는 고전적 분해. polygonSelfIntersects와 같은 이유로
|
|
142
|
+
* 정점이 maxPoints를 넘으면 분해하지 않는다.
|
|
143
|
+
*/
|
|
144
|
+
export declare function splitSelfIntersectingPolygon(points: Point[], maxPoints?: number): Point[][];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,5 +11,7 @@ export interface ViewSettings {
|
|
|
11
11
|
showRegionMask: boolean;
|
|
12
12
|
keepZoomOnImageChange: boolean;
|
|
13
13
|
wheelZoom: boolean;
|
|
14
|
+
/** 휠/핀치 확대·축소 민감도 배율(1 = 기본). 마우스별 휠 이벤트 밀도 차이 보정용. */
|
|
15
|
+
zoomSensitivity: number;
|
|
14
16
|
}
|
|
15
17
|
export declare const DEFAULT_VIEW_SETTINGS: ViewSettings;
|
|
@@ -41,6 +41,7 @@ export declare class KonvaRenderer implements EditorRenderer {
|
|
|
41
41
|
private ro;
|
|
42
42
|
private activeDrag;
|
|
43
43
|
private midNodes;
|
|
44
|
+
private ghostNode;
|
|
44
45
|
private selectedVertices;
|
|
45
46
|
private vertexPolygonId;
|
|
46
47
|
private editingId;
|
|
@@ -74,6 +75,8 @@ export declare class KonvaRenderer implements EditorRenderer {
|
|
|
74
75
|
clearImage(): void;
|
|
75
76
|
setFilter(brightness: number, contrast: number): void;
|
|
76
77
|
setStrokeSize(strokeSize: number): void;
|
|
78
|
+
/** 편집모드 정점 핸들 반지름 — 선두께에 비례(기본 두께 2에서 기존 크기 5 유지). */
|
|
79
|
+
private vertexHandleRadius;
|
|
77
80
|
setImageSmoothing(smooth: boolean): void;
|
|
78
81
|
setOverlays(maskCanvas: HTMLCanvasElement | null, region: RegionOverlayData | null, dimmed: boolean): void;
|
|
79
82
|
setRegionOverlay(region: RegionOverlayData | null): void;
|
|
@@ -86,6 +89,9 @@ export declare class KonvaRenderer implements EditorRenderer {
|
|
|
86
89
|
setSelection(selected: string[]): void;
|
|
87
90
|
/** 폴리곤 정점 편집모드 진입/해제(null이면 해제). */
|
|
88
91
|
setEditing(id: string | null): void;
|
|
92
|
+
getVertexSelection(): number[];
|
|
93
|
+
/** 편집모드 정점 다중선택 교체(마퀴 범위선택). 편집모드가 아니면 무시. */
|
|
94
|
+
setVertexSelection(indices: number[]): void;
|
|
89
95
|
private makeNode;
|
|
90
96
|
liveUpdateShape(id: string, points: Point[]): void;
|
|
91
97
|
private pointRadius;
|
|
@@ -50,6 +50,7 @@ export declare class PixiRenderer {
|
|
|
50
50
|
private lastDragImg;
|
|
51
51
|
private activeDrag;
|
|
52
52
|
private midNodes;
|
|
53
|
+
private ghostNode;
|
|
53
54
|
private selectedVertices;
|
|
54
55
|
private vertexPolygonId;
|
|
55
56
|
private editingId;
|
|
@@ -86,6 +87,8 @@ export declare class PixiRenderer {
|
|
|
86
87
|
}): Promise<void>;
|
|
87
88
|
setFilter(brightness: number, contrast: number): void;
|
|
88
89
|
setStrokeSize(strokeSize: number): void;
|
|
90
|
+
/** 편집모드 정점 핸들 반지름 — 선두께에 비례(기본 두께 2에서 기존 크기 5 유지). */
|
|
91
|
+
private vertexHandleRadius;
|
|
89
92
|
private applySpriteFilter;
|
|
90
93
|
clearImage(): void;
|
|
91
94
|
private clearImageTiles;
|
|
@@ -102,6 +105,9 @@ export declare class PixiRenderer {
|
|
|
102
105
|
setSelection(selected: string[]): void;
|
|
103
106
|
/** 폴리곤 정점 편집모드 진입/해제(null이면 해제). */
|
|
104
107
|
setEditing(id: string | null): void;
|
|
108
|
+
getVertexSelection(): number[];
|
|
109
|
+
/** 편집모드 정점 다중선택 교체(마퀴 범위선택). 편집모드가 아니면 무시. */
|
|
110
|
+
setVertexSelection(indices: number[]): void;
|
|
105
111
|
/** SELECT 모드 + 비-readOnly일 때만 핸들 표시(호스트가 설정). */
|
|
106
112
|
setTransformEnabled(enabled: boolean): void;
|
|
107
113
|
setPanMode(active: boolean): void;
|
|
@@ -170,6 +176,8 @@ export declare class PixiRenderer {
|
|
|
170
176
|
private repositionOrientedHandles;
|
|
171
177
|
/** 폴리곤/라인 꼭짓점·변 중점 핸들을 이미지 좌표 기준으로 재배치. */
|
|
172
178
|
private repositionPolygonHandles;
|
|
179
|
+
/** 변(이미지 좌표 a→b) 주위 히트 쿼드 — 변 호버/클릭 히트영역(정점 핸들에 비례). */
|
|
180
|
+
private edgeHitQuad;
|
|
173
181
|
private resetMoveOffsets;
|
|
174
182
|
private commitTransformUpdates;
|
|
175
183
|
private dragTransform;
|
|
@@ -89,6 +89,10 @@ export interface EditorRenderer<TMeta = unknown> {
|
|
|
89
89
|
setSelection(selected: string[]): void;
|
|
90
90
|
/** 폴리곤 정점 편집모드 대상(null이면 해제). 편집모드일 때만 정점 핸들 표시. */
|
|
91
91
|
setEditing(id: string | null): void;
|
|
92
|
+
/** 편집모드 정점 다중선택을 교체한다(마퀴 범위선택용). 편집모드가 아니면 무시. */
|
|
93
|
+
setVertexSelection(indices: number[]): void;
|
|
94
|
+
/** 현재 편집모드 정점 다중선택 인덱스(Shift 마퀴 추가선택의 기준값). */
|
|
95
|
+
getVertexSelection(): number[];
|
|
92
96
|
setTransformEnabled(enabled: boolean): void;
|
|
93
97
|
/**
|
|
94
98
|
* 팬(스페이스) 모드 토글. 활성 시 트랜스포머/정점 핸들의 히트테스트를 꺼서
|
|
@@ -33,6 +33,8 @@ export interface InteractionControllerCtx<TMeta> {
|
|
|
33
33
|
selectRef: RefObject<(ids: string[]) => void>;
|
|
34
34
|
/** 폴리곤 정점 편집모드 진입(더블클릭). */
|
|
35
35
|
enterEditRef: RefObject<(id: string) => void>;
|
|
36
|
+
/** 현재 편집모드 대상 폴리곤 id(null이면 비편집). 마퀴를 정점 범위선택으로 전환. */
|
|
37
|
+
editingIdRef: RefObject<string | null>;
|
|
36
38
|
drawSessionRef: RefObject<DrawSession<TMeta>>;
|
|
37
39
|
assistantRef: RefObject<AssistantSession<TMeta>>;
|
|
38
40
|
setCursorHint: (cursor: string | null) => void;
|