@aivex/ui 1.2.0-dev.2 โ 1.2.0-dev.21
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/{Switch-c8rHebeK.js โ Button-B6WM7faP.js} +2345 -4756
- package/dist/Button-B6WM7faP.js.map +1 -0
- package/dist/Button-C4WtB38c.cjs +2 -0
- package/dist/Button-C4WtB38c.cjs.map +1 -0
- package/dist/IconButton-CuO-3IXh.cjs +2 -0
- package/dist/IconButton-CuO-3IXh.cjs.map +1 -0
- package/dist/IconButton-pgdAaijX.js +560 -0
- package/dist/IconButton-pgdAaijX.js.map +1 -0
- package/dist/Switch-CtjEelTs.cjs +42 -0
- package/dist/Switch-CtjEelTs.cjs.map +1 -0
- package/dist/Switch-rKD8bdwo.js +2537 -0
- package/dist/Switch-rKD8bdwo.js.map +1 -0
- package/dist/comment.cjs +114 -0
- package/dist/comment.cjs.map +1 -0
- package/dist/comment.js +13624 -0
- package/dist/comment.js.map +1 -0
- package/dist/components/Badge/Badge.d.ts +8 -1
- package/dist/components/Coachmark/Coachmark.d.ts +54 -0
- package/dist/components/Coachmark/index.d.ts +2 -0
- package/dist/components/Comment/CommentInput.d.ts +30 -0
- package/dist/components/Comment/CommentPin.d.ts +17 -0
- package/dist/components/Comment/MentionInput.d.ts +30 -0
- package/dist/components/Comment/MentionList.d.ts +14 -0
- package/dist/components/Comment/index.d.ts +4 -0
- package/dist/components/Comment/types.d.ts +12 -0
- package/dist/components/Comment/useMentionSuggestion.d.ts +15 -0
- package/dist/components/DataGrid/DataGrid.d.ts +29 -71
- package/dist/components/DataGrid/DataGridColumnSettings.d.ts +18 -0
- package/dist/components/DataGrid/DataGridPrimitives.d.ts +77 -0
- package/dist/components/DataGrid/DataGridRows.d.ts +25 -0
- package/dist/components/DataGrid/index.d.ts +6 -2
- package/dist/components/DatePicker/DatePicker.d.ts +8 -18
- package/dist/components/DatePicker/date.d.ts +1 -0
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/Icon/index.d.ts +3 -1
- package/dist/components/InputBase/InputBase.d.ts +5 -7
- package/dist/components/Logo/index.d.ts +2 -1
- package/dist/components/Modal/Modal.d.ts +9 -2
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/SelectBox/SelectBox.d.ts +7 -4
- package/dist/components/SelectButton/SelectButton.d.ts +18 -0
- package/dist/components/SelectButton/index.d.ts +2 -0
- package/dist/components/ShapeEditor/ShapeEditor.d.ts +1 -1
- package/dist/components/ShapeEditor/ShapeViewer.d.ts +42 -0
- package/dist/components/ShapeEditor/_components/ContextMenu.d.ts +1 -1
- package/dist/components/ShapeEditor/_components/Minimap.d.ts +10 -6
- package/dist/components/ShapeEditor/_components/MinimapShape.d.ts +2 -2
- package/dist/components/ShapeEditor/_components/RegionOverlay.d.ts +21 -0
- package/dist/components/ShapeEditor/_components/SelectionInfo.d.ts +4 -1
- package/dist/components/ShapeEditor/_components/SettingsPanel.d.ts +4 -2
- package/dist/components/ShapeEditor/_constants.d.ts +7 -4
- package/dist/components/ShapeEditor/_model/clipboard.d.ts +22 -0
- package/dist/components/ShapeEditor/_model/clipboard.test.d.ts +1 -0
- package/dist/components/ShapeEditor/_model/geometry.d.ts +22 -1
- package/dist/components/ShapeEditor/_model/geometry.test.d.ts +1 -0
- package/dist/components/ShapeEditor/_model/imageFetch.d.ts +9 -0
- package/dist/components/ShapeEditor/_model/keymap.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/overlays.d.ts +82 -15
- package/dist/components/ShapeEditor/_model/overlays.test.d.ts +1 -0
- package/dist/components/ShapeEditor/_model/props.d.ts +98 -22
- package/dist/components/ShapeEditor/_model/strings.d.ts +2 -3
- package/dist/components/ShapeEditor/_model/viewSettings.d.ts +3 -1
- package/dist/components/ShapeEditor/_renderers/KonvaRenderer.d.ts +28 -7
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.d.ts +38 -11
- package/dist/components/ShapeEditor/_renderers/transformSession.d.ts +5 -0
- package/dist/components/ShapeEditor/_renderers/types.d.ts +55 -22
- package/dist/components/ShapeEditor/_state/createInteractionController.d.ts +4 -0
- package/dist/components/ShapeEditor/_state/createInteractionController.test.d.ts +1 -0
- package/dist/components/ShapeEditor/_state/useDrawSession.d.ts +2 -1
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.d.ts +2 -0
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.d.ts +38 -11
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.test.d.ts +1 -0
- package/dist/components/ShapeEditor/_state/useSelectionActions.d.ts +6 -5
- package/dist/components/ShapeEditor/index.d.ts +3 -1
- package/dist/components/Slider/Slider.d.ts +3 -1
- package/dist/components/Spinner/Spinner.d.ts +15 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +2 -1
- package/dist/components/Tagbox/Tagbox.d.ts +1 -4
- package/dist/components/Textarea/Textarea.d.ts +7 -4
- package/dist/components/Textbox/Textbox.d.ts +1 -5
- package/dist/components/Toast/Toast.d.ts +12 -2
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/index.cjs +13 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6430 -3709
- package/dist/index.js.map +1 -1
- package/dist/shape-editor.cjs +1 -1
- package/dist/shape-editor.cjs.map +1 -1
- package/dist/shape-editor.js +3030 -2070
- package/dist/shape-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tokens/tokens.css +611 -611
- package/package.json +25 -2
- package/dist/Switch-DX-FkCbT.cjs +0 -42
- package/dist/Switch-DX-FkCbT.cjs.map +0 -1
- package/dist/Switch-c8rHebeK.js.map +0 -1
- package/dist/components/ShapeEditor/_components/RoiOverlay.d.ts +0 -21
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode, Ref } from "react";
|
|
2
2
|
import type { EditorShape, Point, ShapeInteraction, ShapeStyle, Viewport } from "./geometry";
|
|
3
3
|
import type { EditorAction, KeymapOverrides } from "./keymap";
|
|
4
|
-
import type {
|
|
4
|
+
import type { GuideMaskRaster, MaskPalette, PolygonArea, RectArea, RegionMask, RegionOutlineStyle } from "./overlays";
|
|
5
5
|
import type { EditorStringsOverride } from "./strings";
|
|
6
6
|
import type { BrushScalarMode, Tool } from "./tools";
|
|
7
7
|
import type { ViewSettings } from "./viewSettings";
|
|
@@ -31,6 +31,8 @@ export interface EditorOverlayMarker<TMeta = unknown> {
|
|
|
31
31
|
}
|
|
32
32
|
/** ์ฐํด๋ฆญ ์ปจํ
์คํธ ๋ฉ๋ด ํญ๋ชฉ(๋๋ฉ์ธ ๋ฌด๊ด). */
|
|
33
33
|
export type ContextMenuItem = {
|
|
34
|
+
/** ๊ธฐ๋ณธ ํญ๋ชฉ ์๋ณ์(์: "delete"). ํธ์คํธ๋ ๋ผ๋ฒจ ๋ฌธ์์ด ๋์ ์ด๊ฑธ๋ก ํํฐ๋งํ๋ค. */
|
|
35
|
+
id?: string;
|
|
34
36
|
label: string;
|
|
35
37
|
onClick: () => void;
|
|
36
38
|
disabled?: boolean;
|
|
@@ -42,12 +44,14 @@ export type ContextMenuItem = {
|
|
|
42
44
|
separator: true;
|
|
43
45
|
};
|
|
44
46
|
export interface EditorPointerEvent {
|
|
47
|
+
pointerId?: number;
|
|
45
48
|
button?: number;
|
|
46
49
|
shiftKey?: boolean;
|
|
47
50
|
altKey?: boolean;
|
|
48
51
|
ctrlKey?: boolean;
|
|
49
52
|
metaKey?: boolean;
|
|
50
53
|
global?: Point;
|
|
54
|
+
insideCanvas?: boolean;
|
|
51
55
|
}
|
|
52
56
|
export interface EditorCanvasViewport {
|
|
53
57
|
scale: number;
|
|
@@ -122,14 +126,56 @@ export interface EditorAssistant {
|
|
|
122
126
|
*/
|
|
123
127
|
rectResult?: "rect" | "rotatedRect";
|
|
124
128
|
}
|
|
125
|
-
|
|
129
|
+
/** ํธ์ง ๋ฌธ์(์๋ ๊ณ์ฝ). id ๋ณ๊ฒฝ=๋ฌธ์ ์ ํ, ๊ฐ์ id์ URL ๋ณ๊ฒฝ=ํ์ง ์ค์. */
|
|
130
|
+
export interface ShapeEditorDocument<TMeta = unknown> {
|
|
131
|
+
/**
|
|
132
|
+
* ๋ฌธ์ identity โ ์ ํ/์ค์ ํ์ ์ ์ ์ผํ ๊ธฐ์ค. URL์ identity๊ฐ ์๋๋ค
|
|
133
|
+
* (๋ค๋ฅธ ๋ฌธ์๊ฐ ๊ฐ์ URL์, ๊ฐ์ ๋ฌธ์๊ฐ ๋ค๋ฅธ URL์ ๊ฐ์ง ์ ์์).
|
|
134
|
+
*/
|
|
135
|
+
id: string;
|
|
136
|
+
/** ์๋ ์ด๋ฏธ์ง URL. ๋น ๊ฐ = ์ด๋ฏธ์ง ์๋ ๋ฌธ์(๋ํ์ ์๋, ํ์๋ ์ด๋ฏธ์ง ๋ก๋๊น์ง ๋ณด๋ฅ). */
|
|
126
137
|
imageUrl: string;
|
|
127
138
|
/**
|
|
128
|
-
* ์ค์ ๋ก ๋ ๋ํ
|
|
129
|
-
* imageUrl
|
|
130
|
-
* ๋ฆฌ์
๋์ง ์๋๋ค(์ ํด์โ๊ณ ํด์ ํ ๊ธ). **imageUrl๊ณผ ๊ฐ์ ํฝ์
ํฌ๊ธฐ์ฌ์ผ ํ๋ค.**
|
|
139
|
+
* ์ค์ ๋ก ๋ ๋ํ URL(ํ์ง ์ค์). ๋ฐ๊ฟ๋ ๋ฌธ์๋ ๋ฆฌ์
๋์ง ์๋๋ค.
|
|
140
|
+
* imageUrl๊ณผ ํฝ์
ํฌ๊ธฐ๊ฐ ๋ค๋ฅด๋ฉด coordinateSize๋ก ์ขํ๊ณ๋ฅผ ๊ณ ์ ํ ๊ฒ.
|
|
131
141
|
*/
|
|
132
142
|
displayImageUrl?: string;
|
|
143
|
+
/**
|
|
144
|
+
* ๋ํ ์ขํ๊ณ ํฌ๊ธฐ(์๋ณธ ํฝ์
). ์ง์ ํ๋ฉด ํ์ ์ด๋ฏธ์ง(์ธ๋ค์ผ ๋ฑ)๋ฅผ ์ด ํฌ๊ธฐ๋ก ๋๋ ค
|
|
145
|
+
* ๊ทธ๋ฆฐ๋ค โ ์ด๋ฏธ์ง ํ์ผ ํฌ๊ธฐ์ ์ขํ๊ณ๊ฐ ๋ค๋ฅผ ๋(ShapeViewer coordinateSize์ ๋์ผ
|
|
146
|
+
* ์๋ฏธ). displayImageUrl๊ณผ ํจ๊ป ์ฐ๋ฉด ํ์ง ๋ณํ ๊ฐ ํฝ์
ํฌ๊ธฐ๊ฐ ๋ฌ๋ผ๋ ์ขํ๊ณ๊ฐ
|
|
147
|
+
* ๊ณ ์ ๋๋ค. ๋ฏธ์ง์ ์ ๋ก๋๋ ์ด๋ฏธ์ง์ ์ค์ ํฝ์
ํฌ๊ธฐ.
|
|
148
|
+
*
|
|
149
|
+
* imageSize: ์ขํ๊ณต๊ฐ ์์์ ์ด๋ฏธ์ง๊ฐ ์ฐจ์งํ๋ ํฌ๊ธฐ(์์ ๊ธฐ์ค). ์ด๋ฏธ์ง๊ฐ
|
|
150
|
+
* ์ขํ๊ณต๊ฐ์ ์ผ๋ถ๋ง ๋ฎ๋ ๊ฒฝ์ฐ์ ์ง์ โ ์: ์ฌ๋ฌ ํด์๋๊ฐ ์์ ์ ๊ณต์ ํ๋
|
|
151
|
+
* ์ขํ๊ณ์์ ์ขํ๊ณต๊ฐ์ ์ต๋ ํด์๋, ์ด๋ฏธ์ง๋ ์ ํ ํด์๋. ๋ฏธ์ง์ ์
|
|
152
|
+
* ์ขํ๊ณต๊ฐ ์ ์ฒด๋ก ๋๋ ค ๊ทธ๋ฆฐ๋ค.
|
|
153
|
+
*/
|
|
154
|
+
coordinateSize?: {
|
|
155
|
+
width: number;
|
|
156
|
+
height: number;
|
|
157
|
+
imageSize?: {
|
|
158
|
+
width: number;
|
|
159
|
+
height: number;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
/** ์ด๊ธฐ ๋ํ(์๋). ์ดํ ๋ฌธ์๋ ์๋ํฐ๊ฐ ์์ . */
|
|
163
|
+
initialShapes?: EditorShape<TMeta>[];
|
|
164
|
+
/**
|
|
165
|
+
* ์๋ ์ 1ํ ์ ์ฉํ ์ด๊ธฐ ์ ํ(๋ํ id) โ ์ดํ ์ ํ์ ์๋ํฐ ์์ ๋ผ ๊ฐ์
|
|
166
|
+
* ๋ฌธ์์์ ๊ฐยท๋ฐ์ดํฐ๊ฐ ๋ฐ๋์ด๋ ๋๋๋ฆฌ์ง ์๋๋ค. ์๋ id๋ ๊ฑธ๋ฌ์ง๋ค.
|
|
167
|
+
*/
|
|
168
|
+
initialSelectedIds?: string[];
|
|
169
|
+
}
|
|
170
|
+
export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
|
|
171
|
+
/** ํธ์ง ๋ฌธ์(์๋ ๊ณ์ฝ). null = ๋ฌธ์ ์์(์๋ ๋๊ธฐ) โ ์ผํฐ๋ ๊ฐ ๋์ null๋ก. */
|
|
172
|
+
document: ShapeEditorDocument<TMeta> | null;
|
|
173
|
+
/**
|
|
174
|
+
* ์์คํ
ํด๋ฆฝ๋ณด๋ ๊ณต์ ๋ฒ์. ๊ฐ์ ๊ฐ์ ์๋ํฐ๋ผ๋ฆฌ๋ง ๋ํ์ ๋ถ์ฌ๋ฃ์ ์ ์๋ค.
|
|
175
|
+
* ํ๋ก์ ํธ์ฒ๋ผ meta์ ์๋ฏธ๊ฐ ๊ฐ์ ๋ฒ์์ ์์ ์ ์ธ ์๋ณ์๋ฅผ ์ ๋ฌํ๋ค.
|
|
176
|
+
* ๋ฏธ์ง์ ์ ํ์ฌ ๋ฌธ์(identity) ์์์๋ง ๊ณต์ ํ๋ค.
|
|
177
|
+
*/
|
|
178
|
+
clipboardScope?: string;
|
|
133
179
|
/**
|
|
134
180
|
* ์ด๋ฏธ์ง ๋ก๋ฉ/์๋ฌ ์ํ ์ค๋ฒ๋ ์ด ์ปค์คํ
. ๋ฏธ์ง์ ์ ๊ธฐ๋ณธ ์คํผ๋/์๋ฌ ๋ฉ์์ง.
|
|
135
181
|
*/
|
|
@@ -139,8 +185,6 @@ export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
|
|
|
139
185
|
* ํธ์คํธ๊ฐ "๋ผ๋ฒจ๋ง ์๋ฃ/์ ๊ธ" ๋ฑ ์ํ์์ ์ผ ๋ค(๊ธฐ์กด Editor์ isLabelingCompleted ๋ค).
|
|
140
186
|
*/
|
|
141
187
|
dimmed?: boolean;
|
|
142
|
-
/** ์ด๊ธฐ ๋ํ(์๋). ์ดํ ๋ฌธ์๋ ์๋ํฐ๊ฐ ์์ . imageUrl์ด ๋ฐ๋๋ฉด ์ ์๋๋ก ๋ฆฌ์
. */
|
|
143
|
-
initialShapes?: EditorShape<TMeta>[];
|
|
144
188
|
/**
|
|
145
189
|
* ๋ ๋ ์์ ๋ํ ์ํธ์์ฉ ์ค๋ฒ๋ผ์ด๋(๋๋ฉ์ธ ๋ฌด๊ด). ๋ฌธ์๋ฅผ ๋ฐ๊พธ์ง ์๊ณ (undo ์์ )
|
|
146
190
|
* ํ์/์ ํ/ํธ์ง ๊ฐ๋ฅ ์ฌ๋ถ๋ฅผ ๋์ ์ผ๋ก ๋ฎ์ด์ด๋ค โ ํธ์คํธ์ ๊ฐ์์ฑ ํ ๊ธ(์จ๊น),
|
|
@@ -150,6 +194,12 @@ export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
|
|
|
150
194
|
overrideShapeInteraction?: (shape: EditorShape<TMeta>) => Partial<ShapeInteraction> | null | undefined;
|
|
151
195
|
/** ์ ํ ๋ํ id. ์ ๊ณตํ๋ฉด selection์ ํธ์คํธ๊ฐ ์์ ํ๋ controlled ๋ชจ๋๋ก ๋์ํ๋ค. */
|
|
152
196
|
selectedIds?: string[];
|
|
197
|
+
/**
|
|
198
|
+
* true๋ฉด SELECT ๋๊ตฌ์ ๋น ๊ณต๊ฐ ๋๋๊ทธ ๋งํด(๋ฒ์ ์ ํ)๋ฅผ ๋๋ค โ ํด๋ฆญ ๋จ๊ฑด ์ ํ๋ง.
|
|
199
|
+
* ๋น ๊ณต๊ฐ ํด๋ฆญ ์ ์ ํ ํด์ ๋ ๊ทธ๋๋ก ๋์ํ๋ค. ๋จ๊ฑด ์ ํ๋ง ํ์ฉํ๋ ๋ทฐ์ดํ
|
|
200
|
+
* ํธ์คํธ(๊ฒ์ ์์ธ ๋ฑ)์์ ์ผ ๋ค.
|
|
201
|
+
*/
|
|
202
|
+
disableMarquee?: boolean;
|
|
153
203
|
activeTool: Tool;
|
|
154
204
|
/** ์์ผ๋ฉด ๊ทธ๋ฆฌ๊ธฐ ๋นํ์ฑ. */
|
|
155
205
|
draftStyle?: ShapeStyle;
|
|
@@ -169,10 +219,15 @@ export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
|
|
|
169
219
|
* ์๋ ๋ฐ ์ด๋ค(๊ธฐ์กด Editor์ Esc ์ฌ์ฌ ๊ผฌ๋ฆฌ).
|
|
170
220
|
*/
|
|
171
221
|
onIdleEscape?: () => void;
|
|
172
|
-
/**
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
222
|
+
/**
|
|
223
|
+
* ๋ฌธ์ ๋ฐ ์ฅ์ ๋ํ(์: ๋ค๋ฅธ ํด์๋ ๊ฐ์ด๋ ์ฌ๊ฐํ). ๋ํ ๋ ์ด์ด์ ๋ ๋๋ง ๋๊ณ
|
|
224
|
+
* ์ ํยทundo ํ์คํ ๋ฆฌยทํํธํ
์คํธยทgetShapes()์์ ์์ ํ ์ ์ธ๋๋ค โ ์คํ์ผ ๋ณ๊ฒฝ
|
|
225
|
+
* (hover ๊ฐ์กฐ ๋ฑ)์ prop ๊ต์ฒด๋ก ๋ฐ์๋๋ฉฐ ํ์คํ ๋ฆฌ์ ์์ด์ง ์๋๋ค.
|
|
226
|
+
* z์์๋ style.zIndex๋ก ์ ์ดํ๋ค(์์๋ฉด ๋ฌธ์ ๋ํ ์๋).
|
|
227
|
+
*/
|
|
228
|
+
decorationShapes?: EditorShape<TMeta>[];
|
|
229
|
+
/** ์ด๋ฏธ์ง ์ ๊ฐ๋ฆผ ํจ๊ณผ. ์ ํ ์๋ฏธ๋ ํธ์คํธ๊ฐ ํด์ํ๊ณ ์๋ํฐ๋ ์์ ์์ญ๋ง ๋ ๋๋งํ๋ค. */
|
|
230
|
+
regionMask?: RegionMask;
|
|
176
231
|
/**
|
|
177
232
|
* ๊ฐ์ด๋ ๋ง์คํฌ ๋์คํฐ(๋์ฝ๋ฉ๋ width/height/indices). maskPalette์ ํจ๊ป ์ฌ์ฉ.
|
|
178
233
|
* ์๋ฒ ์์ด์ด ํฌ๋งท(๋ฐ์ด๋๋ฆฌ ํค๋ ๋ฑ) ๋์ฝ๋ฉ์ ํธ์คํธ ์ฑ
์(LabelEditor/guideMask.ts).
|
|
@@ -202,6 +257,11 @@ export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
|
|
|
202
257
|
* ๋๋ฉ์ธ ๋ฌด๊ด โ meta ํด์์ ํธ์คํธ.
|
|
203
258
|
*/
|
|
204
259
|
getSelectionLabel?: (shape: EditorShape<TMeta>) => string | undefined;
|
|
260
|
+
/**
|
|
261
|
+
* ์ ํ ๋ผ๋ฒจ ๋ฐฐ์ง์์ ๋ํ ์์ ๋ํ๋ด๋ ์ ์ ์ ์จ๊ธด๋ค. ๊ธฐ๋ณธ false(ํ์).
|
|
262
|
+
* ํด๋์ค ์์ด ๋๋ฉ์ธ์ ์๋ฏธ๊ฐ ์๋ ํธ์คํธ์์ ์ฌ์ฉ.
|
|
263
|
+
*/
|
|
264
|
+
hideSelectionLabelDot?: boolean;
|
|
205
265
|
/**
|
|
206
266
|
* ์ ํ ๋ํ ์๋ ํ์ํ ์ ๋ณด ํ
์คํธ. ์๋ํฐ๊ฐ ๊ณ์ฐํ ํฝ์
๋ฐ์ดํฐ(info)๋ฅผ ๋ฐ์
|
|
207
267
|
* ํ๋ก๋ํธ๋ณ ํ
ํ๋ฆฟ์ผ๋ก ํฌ๋งทํ๋ค. ๋ฏธ์ง์ ์ ๊ธฐ๋ณธ๊ฐ `W x H px`. ๋น ๋ฌธ์์ด์ด๋ฉด ์จ๊น.
|
|
@@ -229,8 +289,8 @@ export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
|
|
|
229
289
|
showViewSettings?: boolean;
|
|
230
290
|
/**
|
|
231
291
|
* ์ฐํด๋ฆญ ์ปจํ
์คํธ ๋ฉ๋ด ํญ๋ชฉ ์ปค์คํฐ๋ง์ด์ฆ. ์๋ํฐ ๊ธฐ๋ณธ ํญ๋ชฉ(defaults: ๋ณต์ /์ญ์ /
|
|
232
|
-
* z
|
|
233
|
-
* (์: ํด๋์ค ๋ณ๊ฒฝ)์ ๋ผ์ ๋ฃ๋ ํ์ฅ ์ง์ . ๋ฏธ์ง์ ์ ๊ธฐ๋ณธ ํญ๋ชฉ ๊ทธ๋๋ก.
|
|
292
|
+
* z-์์/์ ์ฒด์ ํ ๋ฑ, readOnly์์๋ ๋ณต์ฌ/์ ํ/ํ๋)์ ๋ฐ์ ๊ฐ๊ณต(์ถ๊ฐยท์ ๊ฑฐยท์ฌ๋ฐฐ์ด)ํด
|
|
293
|
+
* ๋ฐํํ๋ค. ๋๋ฉ์ธ ์ก์
(์: ํด๋์ค ๋ณ๊ฒฝ)์ ๋ผ์ ๋ฃ๋ ํ์ฅ ์ง์ . ๋ฏธ์ง์ ์ ๊ธฐ๋ณธ ํญ๋ชฉ ๊ทธ๋๋ก.
|
|
234
294
|
*/
|
|
235
295
|
getContextMenuItems?: (defaults: ContextMenuItem[], ctx: {
|
|
236
296
|
selectedIds: string[];
|
|
@@ -298,7 +358,21 @@ export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
|
|
|
298
358
|
*/
|
|
299
359
|
onShapesDeleted?: (ids: string[]) => void;
|
|
300
360
|
onViewportChange?: (viewport: EditorCanvasViewport) => void;
|
|
301
|
-
/**
|
|
361
|
+
/** ์ด๋ยท๋ฆฌ์ฌ์ด์ฆยท์ ์ ํธ์ง ์ค์ธ ๋ํ ์ขํ. ๋ฌธ์ ์ปค๋ฐ ์ ์๊ฐ ๋๊ธฐํ์ฉ์ด๋ค. */
|
|
362
|
+
onShapesTransformPreview?: (updates: {
|
|
363
|
+
id: string;
|
|
364
|
+
points: Point[];
|
|
365
|
+
}[]) => void;
|
|
366
|
+
/**
|
|
367
|
+
* ๊ทธ๋ฆฌ๋ ์ค์ธ ์์ ๋ํ. ROI ๋ฑ ํธ์คํธ ์ ์ฉ ์ค์๊ฐ ์ค๋ฒ๋ ์ด ๋๊ธฐํ์ ์ฌ์ฉํ๋ค.
|
|
368
|
+
* ์์ ์ PATH๋ ์ปค๋ฐ ๊ฒฐ๊ณผ์ ๋์ผํ๊ฒ POLYGON ํ์
์ผ๋ก ์ ๋ฌ๋๋ค.
|
|
369
|
+
*/
|
|
370
|
+
onDraftShapeChange?: (shape: Pick<EditorShape<TMeta>, "type" | "points" | "meta"> | null) => void;
|
|
371
|
+
/**
|
|
372
|
+
* ๊ทธ๋ฆฌ๊ธฐ ์ธ์
(๋ถยทํด๋ฆฌ๊ณคยทํจ์ค)์ ์ ์ด ์ํ๊ฐ ๋ฐ๋ ๋ ๋ฐ์ํ๋ค.
|
|
373
|
+
* ์ ์ ยท์ปค์ ์ขํ ๋ณํ๋ ํฌํจํ์ง ์์ผ๋ฏ๋ก, ์์ ๋ํ ์ขํ๊ฐ ํ์ํ ํธ์คํธ๋
|
|
374
|
+
* onDraftShapeChange๋ฅผ ์ฌ์ฉํ๋ค.
|
|
375
|
+
*/
|
|
302
376
|
onDrawSessionChange?: (session: DrawSessionChange) => void;
|
|
303
377
|
/** ํธ์คํธ็ผ ์์ /undoยทredo/์ ํ ์ ์ด์ฉ ๋ช
๋ นํ ํธ๋ค. */
|
|
304
378
|
handleRef?: Ref<ShapeEditorHandle<TMeta>>;
|
|
@@ -319,6 +393,12 @@ export interface DrawSessionChange {
|
|
|
319
393
|
* ํธ์คํธ๊ฐ ์๋ํฐ์ ๋ช
๋ น์ ๋ณด๋ด๋ ์ฐฝ๊ตฌ. ๋ชจ๋ ๋ณ๊ฒฝ์ ์๋ํฐ ํ์คํ ๋ฆฌ์ ์์ฌ undo ๊ฐ๋ฅ.
|
|
320
394
|
*/
|
|
321
395
|
export interface ShapeEditorHandle<TMeta = unknown> {
|
|
396
|
+
/**
|
|
397
|
+
* ๋๋๊ทธยท๋๋ก์ ์ค ๊ณ ๋น๋ ์ค๋ฒ๋ ์ด ํ๋ฆฌ๋ทฐ โ regionMask prop(React ์๋ณต)์ ์ฐํํด
|
|
398
|
+
* ๋ ๋๋ฌ์ ์ฆ์ ๋ฐ์ํ๋ค(๊ฐ์ ํ๋ ์ ๋ณด์ฅ). null์ด๋ฉด prop ๊ธฐ๋ฐ ์ค๋ฒ๋ ์ด๋ก ๋ณต๊ท.
|
|
399
|
+
* ๋ฌธ์ ์ํ์ ์ง์ค์ ์ฌ์ ํ regionMask prop โ ์ปค๋ฐ ํ prop ๊ฐฑ์ ์ด ์ด ๊ฐ์ ๋ฎ์ด์ด๋ค.
|
|
400
|
+
*/
|
|
401
|
+
previewRegionMask: (regionMask: RegionMask | null) => void;
|
|
322
402
|
/** ๋ฌธ์ undo. ๊ทธ๋ฆฌ๊ธฐ ์ธ์
์ด ์์ผ๋ฉด `undoSession`์ด ์ฐ์ . */
|
|
323
403
|
undo: () => void;
|
|
324
404
|
/** ๋ฌธ์ redo. ๊ทธ๋ฆฌ๊ธฐ ์ธ์
์ด ์์ผ๋ฉด `redoSession`์ด ์ฐ์ . */
|
|
@@ -348,20 +428,16 @@ export interface ShapeEditorHandle<TMeta = unknown> {
|
|
|
348
428
|
clearSelection: () => void;
|
|
349
429
|
/** ์ ํ ๋ํ ์ญ์ . */
|
|
350
430
|
deleteSelection: () => void;
|
|
351
|
-
/** ์ ํ ๋ํ์
|
|
431
|
+
/** ์ ํ ๋ํ์ ์์คํ
ํด๋ฆฝ๋ณด๋์ ๋ณต์ฌ. ์ฌ์ฉํ ์ ์์ผ๋ฉด ๊ฐ์ ํญ ๋ฉ๋ชจ๋ฆฌ๋ก ๋์ฒดํ๋ค. */
|
|
352
432
|
copySelection: () => void;
|
|
353
|
-
/** ํด๋ฆฝ๋ณด๋ ๋ํ
|
|
354
|
-
paste: () => void;
|
|
433
|
+
/** ์์คํ
/๋ฉ๋ชจ๋ฆฌ ํด๋ฆฝ๋ณด๋ ๋ํ ๋ถ์ฌ๋ฃ๊ธฐ. ์ขํ ์ง์ ์ ์ค์ฌ์ ๋ง์ถ๊ณ , ๋ฏธ์ง์ ์ ์บ์ค์ผ์ด๋. */
|
|
434
|
+
paste: (at?: Point) => void;
|
|
355
435
|
/** ์ ํ ๋ํ ๋ณต์ . */
|
|
356
436
|
duplicate: () => void;
|
|
357
437
|
/** ์ ํ ๋ํ ๋งจ ์์ผ๋ก. */
|
|
358
438
|
bringToFront: () => void;
|
|
359
439
|
/** ์ ํ ๋ํ ๋งจ ๋ค๋ก. */
|
|
360
440
|
sendToBack: () => void;
|
|
361
|
-
/** ์ ํ ๋ํ ์ข์ฐ ๋ฐ์ (bbox ์ค์ฌ). */
|
|
362
|
-
flipHorizontal: () => void;
|
|
363
|
-
/** ์ ํ ๋ํ ์ํ ๋ฐ์ (bbox ์ค์ฌ). */
|
|
364
|
-
flipVertical: () => void;
|
|
365
441
|
/** ์ค: ์ด๋ฏธ์ง ์ ์ฒด ๋ง์ถค. */
|
|
366
442
|
zoomFit: () => void;
|
|
367
443
|
/** ์ค: 100%. */
|
|
@@ -395,4 +471,4 @@ export interface ShapeEditorHandle<TMeta = unknown> {
|
|
|
395
471
|
beginEditFromSelection: () => boolean;
|
|
396
472
|
};
|
|
397
473
|
}
|
|
398
|
-
export type { BrushScalarMode, EditorAction, EditorShape,
|
|
474
|
+
export type { BrushScalarMode, EditorAction, EditorShape, GuideMaskRaster, KeymapOverrides, MaskPalette, Point, PolygonArea, RectArea, RegionMask, RegionOutlineStyle, ShapeStyle, Tool, Viewport, ViewSettings, };
|
|
@@ -11,8 +11,6 @@ export interface EditorStrings {
|
|
|
11
11
|
delete: string;
|
|
12
12
|
bringToFront: string;
|
|
13
13
|
sendToBack: string;
|
|
14
|
-
flipHorizontal: string;
|
|
15
|
-
flipVertical: string;
|
|
16
14
|
editVertices: string;
|
|
17
15
|
merge: string;
|
|
18
16
|
assistExpand: string;
|
|
@@ -33,9 +31,10 @@ export interface EditorStrings {
|
|
|
33
31
|
pixelation: string;
|
|
34
32
|
cursorGuide: string;
|
|
35
33
|
guideMask: string;
|
|
36
|
-
|
|
34
|
+
regionMask: string;
|
|
37
35
|
keepZoomOnImageChange: string;
|
|
38
36
|
wheelZoom: string;
|
|
37
|
+
zoomSensitivity: string;
|
|
39
38
|
};
|
|
40
39
|
minimap: {
|
|
41
40
|
zoomIn: string;
|
|
@@ -8,8 +8,10 @@ export interface ViewSettings {
|
|
|
8
8
|
/** ์์ ์ /๋ถโํด๋ฆฌ๊ณค ๋จ์ํ ๊ฐ๋(RDP epsilon, ์ด๋ฏธ์ง px). ๋์์๋ก ์ ์ด ์ ์ด์ง. */
|
|
9
9
|
simplifyStrength: number;
|
|
10
10
|
showGuide: boolean;
|
|
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;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type BBox, type EditorShape, type Point } from "../_model/geometry";
|
|
2
|
-
import type
|
|
1
|
+
import { type BBox, type EditorShape, type Point, type ShapeStyle } from "../_model/geometry";
|
|
2
|
+
import { type RegionOverlayData } from "../_model/overlays";
|
|
3
3
|
import type { ScalarMaskRaster } from "../_model/scalarMask";
|
|
4
|
+
import { type ShapeRenderStyleDefaults } from "../_model/shapeRenderStyle";
|
|
4
5
|
import type { EditorRenderer, EditorRendererCallbacks, PreviewKind, Viewport } from "./types";
|
|
5
6
|
/**
|
|
6
7
|
* KonvaRenderer โ EditorRenderer์ Konva(canvas2D) ๊ตฌํ(๋ช
๋ นํ, react-konva ์๋).
|
|
@@ -13,6 +14,9 @@ export declare class KonvaRenderer implements EditorRenderer {
|
|
|
13
14
|
private world;
|
|
14
15
|
private bgGroup;
|
|
15
16
|
private overlayGroup;
|
|
17
|
+
private guideOverlayGroup;
|
|
18
|
+
private regionOverlayGroup;
|
|
19
|
+
private dimOverlayGroup;
|
|
16
20
|
private shapeGroup;
|
|
17
21
|
private selGroup;
|
|
18
22
|
private previewGroup;
|
|
@@ -27,6 +31,7 @@ export declare class KonvaRenderer implements EditorRenderer {
|
|
|
27
31
|
private shapes;
|
|
28
32
|
private selected;
|
|
29
33
|
private nodes;
|
|
34
|
+
private altNodes;
|
|
30
35
|
private lastAppliedScale;
|
|
31
36
|
private imageLoadToken;
|
|
32
37
|
private transformEnabled;
|
|
@@ -37,6 +42,7 @@ export declare class KonvaRenderer implements EditorRenderer {
|
|
|
37
42
|
private ro;
|
|
38
43
|
private activeDrag;
|
|
39
44
|
private midNodes;
|
|
45
|
+
private ghostNode;
|
|
40
46
|
private selectedVertices;
|
|
41
47
|
private vertexPolygonId;
|
|
42
48
|
private editingId;
|
|
@@ -60,12 +66,21 @@ export declare class KonvaRenderer implements EditorRenderer {
|
|
|
60
66
|
private bindCursor;
|
|
61
67
|
private toImage;
|
|
62
68
|
private imgToScreen;
|
|
63
|
-
setImage(url: string
|
|
69
|
+
setImage(url: string, coordinateSize?: {
|
|
70
|
+
width: number;
|
|
71
|
+
height: number;
|
|
72
|
+
}, imageSize?: {
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
}): Promise<void>;
|
|
64
76
|
clearImage(): void;
|
|
65
77
|
setFilter(brightness: number, contrast: number): void;
|
|
66
|
-
|
|
78
|
+
setRenderDefaults(defaults: Partial<ShapeRenderStyleDefaults>): void;
|
|
79
|
+
/** ํธ์ง๋ชจ๋ ์ ์ ํธ๋ค ๋ฐ์ง๋ฆ โ ์ ๋๊ป์ ๋น๋ก(๊ธฐ๋ณธ ๋๊ป 2์์ ๊ธฐ์กด ํฌ๊ธฐ 5 ์ ์ง). */
|
|
80
|
+
private vertexHandleRadius;
|
|
67
81
|
setImageSmoothing(smooth: boolean): void;
|
|
68
|
-
setOverlays(maskCanvas: HTMLCanvasElement | null,
|
|
82
|
+
setOverlays(maskCanvas: HTMLCanvasElement | null, region: RegionOverlayData | null, dimmed: boolean): void;
|
|
83
|
+
setRegionOverlay(region: RegionOverlayData | null): void;
|
|
69
84
|
get viewport(): Viewport;
|
|
70
85
|
applyViewport(v: Viewport): void;
|
|
71
86
|
fit(): void;
|
|
@@ -75,6 +90,9 @@ export declare class KonvaRenderer implements EditorRenderer {
|
|
|
75
90
|
setSelection(selected: string[]): void;
|
|
76
91
|
/** ํด๋ฆฌ๊ณค ์ ์ ํธ์ง๋ชจ๋ ์ง์
/ํด์ (null์ด๋ฉด ํด์ ). */
|
|
77
92
|
setEditing(id: string | null): void;
|
|
93
|
+
getVertexSelection(): number[];
|
|
94
|
+
/** ํธ์ง๋ชจ๋ ์ ์ ๋ค์ค์ ํ ๊ต์ฒด(๋งํด ๋ฒ์์ ํ). ํธ์ง๋ชจ๋๊ฐ ์๋๋ฉด ๋ฌด์. */
|
|
95
|
+
setVertexSelection(indices: number[]): void;
|
|
78
96
|
private makeNode;
|
|
79
97
|
liveUpdateShape(id: string, points: Point[]): void;
|
|
80
98
|
private pointRadius;
|
|
@@ -85,12 +103,15 @@ export declare class KonvaRenderer implements EditorRenderer {
|
|
|
85
103
|
/** ๋๋๊ทธ ์ค ์ ํ ํ
๋๋ฆฌ๋ฅผ ๋ผ์ด๋ธ ์ขํ๋ก ๋๊ธฐํ. */
|
|
86
104
|
private updateSelectionBordersLive;
|
|
87
105
|
private selectionOutlinePoints;
|
|
106
|
+
/** ๊ทธ๋ฆฌ๋ ์ค ํด๋ฆฌ๊ณค ์ด์ ๋ง์ง๋ง ํ๋ผ๋ฏธํฐ โ ์ค ์ ์ ์ ์ ํฌ๊ธฐ ์ฌ๊ณ์ฐ์ฉ
|
|
107
|
+
* (์ ์ strokeScaleEnabled=false๋ก ํ๋ฉด ๊ณ ์ ์ด๋ผ ์ฌ๋์ ๋ถํ์). */
|
|
108
|
+
private lastPreviewPoly;
|
|
88
109
|
clearPreview(): void;
|
|
89
110
|
clearMarquee(): void;
|
|
90
111
|
private preview;
|
|
91
112
|
private marquee;
|
|
92
|
-
previewBox(kind: PreviewKind, a: Point, b: Point,
|
|
93
|
-
previewPoly(points: Point[], cursor: Point | null,
|
|
113
|
+
previewBox(kind: PreviewKind, a: Point, b: Point, style: ShapeStyle): void;
|
|
114
|
+
previewPoly(points: Point[], cursor: Point | null, style: ShapeStyle, closed: boolean, selectedPointIndices?: number[], showVertices?: boolean): void;
|
|
94
115
|
previewScalarMask(raster: ScalarMaskRaster, color: string): void;
|
|
95
116
|
previewMarquee(a: Point, b: Point): void;
|
|
96
117
|
setTransformEnabled(enabled: boolean): void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Application, ColorMatrixFilter, Container, type FederatedPointerEvent } from "pixi.js";
|
|
2
|
-
import { type EditorShape, type Point } from "../_model/geometry";
|
|
3
|
-
import type {
|
|
2
|
+
import { type EditorShape, type Point, type ShapeStyle } from "../_model/geometry";
|
|
3
|
+
import type { RegionOverlayData } from "../_model/overlays";
|
|
4
4
|
import { type ScalarMaskRaster } from "../_model/scalarMask";
|
|
5
|
+
import { type ShapeRenderStyleDefaults } from "../_model/shapeRenderStyle";
|
|
5
6
|
import type { EditorRendererCallbacks, Viewport } from "./types";
|
|
6
7
|
export type { Viewport };
|
|
7
8
|
/**
|
|
@@ -13,6 +14,9 @@ export declare class PixiRenderer {
|
|
|
13
14
|
world: Container<import("pixi.js").ContainerChild>;
|
|
14
15
|
bgLayer: Container<import("pixi.js").ContainerChild>;
|
|
15
16
|
overlayLayer: Container<import("pixi.js").ContainerChild>;
|
|
17
|
+
private guideOverlayLayer;
|
|
18
|
+
private regionOverlayLayer;
|
|
19
|
+
private dimOverlayLayer;
|
|
16
20
|
shapeLayer: Container<import("pixi.js").ContainerChild>;
|
|
17
21
|
selLayer: Container<import("pixi.js").ContainerChild>;
|
|
18
22
|
previewLayer: Container<import("pixi.js").ContainerChild>;
|
|
@@ -23,8 +27,12 @@ export declare class PixiRenderer {
|
|
|
23
27
|
private imageTileTextures;
|
|
24
28
|
private imageLoadToken;
|
|
25
29
|
private overlayTextures;
|
|
26
|
-
private
|
|
27
|
-
private
|
|
30
|
+
private region;
|
|
31
|
+
private regionDimMaskG;
|
|
32
|
+
private regionDimG;
|
|
33
|
+
private regionZoneMaskG;
|
|
34
|
+
private regionZoneG;
|
|
35
|
+
private regionOutlineG;
|
|
28
36
|
private cb;
|
|
29
37
|
private host;
|
|
30
38
|
private baseCursor;
|
|
@@ -43,6 +51,7 @@ export declare class PixiRenderer {
|
|
|
43
51
|
private lastDragImg;
|
|
44
52
|
private activeDrag;
|
|
45
53
|
private midNodes;
|
|
54
|
+
private ghostNode;
|
|
46
55
|
private selectedVertices;
|
|
47
56
|
private vertexPolygonId;
|
|
48
57
|
private editingId;
|
|
@@ -70,14 +79,23 @@ export declare class PixiRenderer {
|
|
|
70
79
|
get dom(): HTMLElement;
|
|
71
80
|
/** ํ๋ฉด ์ขํ(global) โ ์ด๋ฏธ์ง ์ขํ(world local). */
|
|
72
81
|
toImage(e: FederatedPointerEvent): Point;
|
|
73
|
-
setImage(url: string
|
|
82
|
+
setImage(url: string, coordinateSize?: {
|
|
83
|
+
width: number;
|
|
84
|
+
height: number;
|
|
85
|
+
}, imageSize?: {
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
}): Promise<void>;
|
|
74
89
|
setFilter(brightness: number, contrast: number): void;
|
|
75
|
-
|
|
90
|
+
setRenderDefaults(defaults: Partial<ShapeRenderStyleDefaults>): void;
|
|
91
|
+
/** ํธ์ง๋ชจ๋ ์ ์ ํธ๋ค ๋ฐ์ง๋ฆ โ ์ ๋๊ป์ ๋น๋ก(๊ธฐ๋ณธ ๋๊ป 2์์ ๊ธฐ์กด ํฌ๊ธฐ 5 ์ ์ง). */
|
|
92
|
+
private vertexHandleRadius;
|
|
76
93
|
private applySpriteFilter;
|
|
77
94
|
clearImage(): void;
|
|
78
95
|
private clearImageTiles;
|
|
79
96
|
setImageSmoothing(smooth: boolean): void;
|
|
80
|
-
setOverlays(maskCanvas: HTMLCanvasElement | null,
|
|
97
|
+
setOverlays(maskCanvas: HTMLCanvasElement | null, region: RegionOverlayData | null, dimmed: boolean): void;
|
|
98
|
+
setRegionOverlay(region: RegionOverlayData | null): void;
|
|
81
99
|
get viewport(): Viewport;
|
|
82
100
|
applyViewport(v: Viewport): void;
|
|
83
101
|
fit(): void;
|
|
@@ -88,6 +106,9 @@ export declare class PixiRenderer {
|
|
|
88
106
|
setSelection(selected: string[]): void;
|
|
89
107
|
/** ํด๋ฆฌ๊ณค ์ ์ ํธ์ง๋ชจ๋ ์ง์
/ํด์ (null์ด๋ฉด ํด์ ). */
|
|
90
108
|
setEditing(id: string | null): void;
|
|
109
|
+
getVertexSelection(): number[];
|
|
110
|
+
/** ํธ์ง๋ชจ๋ ์ ์ ๋ค์ค์ ํ ๊ต์ฒด(๋งํด ๋ฒ์์ ํ). ํธ์ง๋ชจ๋๊ฐ ์๋๋ฉด ๋ฌด์. */
|
|
111
|
+
setVertexSelection(indices: number[]): void;
|
|
91
112
|
/** SELECT ๋ชจ๋ + ๋น-readOnly์ผ ๋๋ง ํธ๋ค ํ์(ํธ์คํธ๊ฐ ์ค์ ). */
|
|
92
113
|
setTransformEnabled(enabled: boolean): void;
|
|
93
114
|
setPanMode(active: boolean): void;
|
|
@@ -113,11 +134,15 @@ export declare class PixiRenderer {
|
|
|
113
134
|
private previewMaskSprite;
|
|
114
135
|
private previewMaskTexture;
|
|
115
136
|
private previewReady;
|
|
137
|
+
/** ๊ทธ๋ฆฌ๋ ์ค ์ด์(ํด๋ฆฌ๊ณค/๋ฐ์ค) ๋ง์ง๋ง ํ๋ผ๋ฏธํฐ โ ์ค ์ ํ๋ฉด๊ณ ์ ๋๊ป๋ก ์ฌ๋์์ฉ. */
|
|
138
|
+
private lastPreview;
|
|
139
|
+
/** ์ค ํ ์ด์์ ํ์ฌ ์ค์ผ์ผ ๊ธฐ์ค ๋๊ป/์ ์ ํฌ๊ธฐ๋ก ๋ค์ ๊ทธ๋ฆฐ๋ค. */
|
|
140
|
+
private repaintPreview;
|
|
116
141
|
private ensurePreview;
|
|
117
142
|
clearPreview(): void;
|
|
118
143
|
clearMarquee(): void;
|
|
119
|
-
previewBox(kind: "rect" | "ellipse", a: Point, b: Point,
|
|
120
|
-
previewPoly(points: Point[], cursor: Point | null,
|
|
144
|
+
previewBox(kind: "rect" | "ellipse", a: Point, b: Point, style: ShapeStyle): void;
|
|
145
|
+
previewPoly(points: Point[], cursor: Point | null, style: ShapeStyle, closed: boolean, selectedPointIndices?: number[], showVertices?: boolean): void;
|
|
121
146
|
previewScalarMask(raster: ScalarMaskRaster, color: string): void;
|
|
122
147
|
previewMarquee(a: Point, b: Point): void;
|
|
123
148
|
/** ์ค ์ ํ๋ฉด๊ณ ์ ์ ๋๊ป ์ ์ง ์ํด ๋ค์ ๊ทธ๋ฆผ(๋ํ ์ ๋ง์ผ๋ฉด ๋น์ฉ โ ํ์ ์ต์ ํ). */
|
|
@@ -127,8 +152,8 @@ export declare class PixiRenderer {
|
|
|
127
152
|
* ๋ํ์ด ๋ง์๋ ์ค์ด ๋ฌด๊ฒ์ง ์๊ฒ ํ๋ค. ๋
ธ๋๊ฐ ์์ง ์์ผ๋ฉด ์ต์ด 1ํ๋ง ์ ์ฒด ์์ฑ.
|
|
128
153
|
*/
|
|
129
154
|
private restrokeShapes;
|
|
130
|
-
/**
|
|
131
|
-
private
|
|
155
|
+
/** ์์ญ ์ค๊ณฝ ์ ์ โ ๋๊ปยท์ ์ ์ ํ๋ฉด px๋ก ์ ์ง(์ค ์ ์ฌ๋์). */
|
|
156
|
+
private redrawRegionOutline;
|
|
132
157
|
private path;
|
|
133
158
|
private dashedStrokeShape;
|
|
134
159
|
private strokeDashedPolyline;
|
|
@@ -152,6 +177,8 @@ export declare class PixiRenderer {
|
|
|
152
177
|
private repositionOrientedHandles;
|
|
153
178
|
/** ํด๋ฆฌ๊ณค/๋ผ์ธ ๊ผญ์ง์ ยท๋ณ ์ค์ ํธ๋ค์ ์ด๋ฏธ์ง ์ขํ ๊ธฐ์ค์ผ๋ก ์ฌ๋ฐฐ์น. */
|
|
154
179
|
private repositionPolygonHandles;
|
|
180
|
+
/** ๋ณ(์ด๋ฏธ์ง ์ขํ aโb) ์ฃผ์ ํํธ ์ฟผ๋ โ ๋ณ ํธ๋ฒ/ํด๋ฆญ ํํธ์์ญ(์ ์ ํธ๋ค์ ๋น๋ก). */
|
|
181
|
+
private edgeHitQuad;
|
|
155
182
|
private resetMoveOffsets;
|
|
156
183
|
private commitTransformUpdates;
|
|
157
184
|
private dragTransform;
|
|
@@ -43,6 +43,11 @@ export declare function computeDragUpdates(d: ActiveDrag, img: Point, isRotatedR
|
|
|
43
43
|
updates: ShapeUpdate[];
|
|
44
44
|
box: BBox | null;
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* ํฌ์ธํฐ ์ด๋ ์ (ํด๋ฆญ ์ ์ง ์ํ) ๋๋๊ทธ ์ง์ค๋ฉํธ๋ฆฌ๋ฅผ ๋ฐ๊พธ์ง ์๋ ํฌ์ธํฐ ์ด๋ฏธ์ง ์ขํ.
|
|
48
|
+
* ๋ทฐํฌํธ ๋ณ๊ฒฝ(์ค/ํฌ) ์ค ๋๋๊ทธ ์ํ๋ฅผ ๊ฑด๋๋ฆฌ์ง ์๊ณ ํธ๋คยทํ๋ฆฌ๋ทฐ๋ง ์ฌ๋ฐฐ์นํ ๋ ์ด๋ค.
|
|
49
|
+
*/
|
|
50
|
+
export declare function dragIdentityImage(shapes: EditorShape[], d: ActiveDrag): Point;
|
|
46
51
|
/** ์ด๋ ๋๋๊ทธ ์์ ์ํ โ ๋๋๊ทธ ๊ฐ๋ฅํ ๋์๋ง ์ถ๋ ค ์ค๋
์ท๊ณผ ํฉ์งํฉ ๋ฐ์ค๋ฅผ ๋ง๋ ๋ค. */
|
|
47
52
|
export declare function makeMoveDrag(shapes: EditorShape[], ids: string[], start: Point): Extract<ActiveDrag, {
|
|
48
53
|
kind: "move";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { EditorInteractionMode } from "../_model/cursors";
|
|
2
|
-
import type { BBox, EditorShape, Point } from "../_model/geometry";
|
|
3
|
-
import type {
|
|
2
|
+
import type { BBox, EditorShape, Point, ShapeStyle } from "../_model/geometry";
|
|
3
|
+
import type { RegionOverlayData } from "../_model/overlays";
|
|
4
4
|
import type { ScalarMaskRaster } from "../_model/scalarMask";
|
|
5
|
+
import type { ShapeRenderStyleDefaults } from "../_model/shapeRenderStyle";
|
|
5
6
|
/**
|
|
6
7
|
* ๋ ๋๋ฌ ์ถ์ํ โ Editor๊ฐ ์ํธ์์ฉ/๋ฌธ์/ํค๋ณด๋๋ฅผ ์์ ํ๊ณ , ๊ทธ๋ฆฌ๊ธฐยทํํธํ
์คํธยท
|
|
7
8
|
* ๋ทฐํฌํธ๋ง ์ด ์ธํฐํ์ด์ค๋ก ์์ํ๋ค. Konva/Pixi ๊ตฌํ์ ๊ฐ์๋ผ์ธ ์ ์๋ค.
|
|
@@ -11,20 +12,26 @@ export interface Viewport {
|
|
|
11
12
|
x: number;
|
|
12
13
|
y: number;
|
|
13
14
|
}
|
|
15
|
+
interface EditorRendererPointerEventBase {
|
|
16
|
+
pointerId: number;
|
|
17
|
+
global: Point;
|
|
18
|
+
}
|
|
19
|
+
export interface EditorRendererPointerDownEvent extends EditorRendererPointerEventBase {
|
|
20
|
+
button: number;
|
|
21
|
+
shiftKey: boolean;
|
|
22
|
+
altKey: boolean;
|
|
23
|
+
ctrlKey: boolean;
|
|
24
|
+
metaKey: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface EditorRendererPointerUpEvent extends EditorRendererPointerEventBase {
|
|
27
|
+
/** ํฌ์ธํฐ๋ฅผ ์บ๋ฒ์ค ์์์ ๋์๋์ง ์ฌ๋ถ(pointerupoutside/window mouseup ๊ตฌ๋ถ). */
|
|
28
|
+
insideCanvas: boolean;
|
|
29
|
+
}
|
|
14
30
|
export interface EditorRendererCallbacks {
|
|
15
31
|
/** ๋น ๊ณต๊ฐ ๋๋ ๋ํ ์ ํฌ์ธํฐ๋ค์ด. targetId=๋ํ id ๋๋ null. */
|
|
16
|
-
onPointerDown: (p: Point, targetId: string | null, e:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
altKey: boolean;
|
|
20
|
-
ctrlKey: boolean;
|
|
21
|
-
metaKey: boolean;
|
|
22
|
-
global: Point;
|
|
23
|
-
}) => void;
|
|
24
|
-
onPointerMove: (p: Point, e: {
|
|
25
|
-
global: Point;
|
|
26
|
-
}) => void;
|
|
27
|
-
onPointerUp: (p: Point) => void;
|
|
32
|
+
onPointerDown: (p: Point, targetId: string | null, e: EditorRendererPointerDownEvent) => void;
|
|
33
|
+
onPointerMove: (p: Point, e: EditorRendererPointerEventBase) => void;
|
|
34
|
+
onPointerUp: (p: Point, e: EditorRendererPointerUpEvent) => void;
|
|
28
35
|
onViewportChange?: () => void;
|
|
29
36
|
/** ๋ ๋๋ฌ ๋ด๋ถ ํํธ ์์ญ(๋ํ/ํธ๋ค/๋๋๊ทธ)์ด ์ ์ํ๋ ์ปค์. ์ต์ข
๊ฒฐ์ ์ Editor๊ฐ ํ๋ค. */
|
|
30
37
|
onCursorHint?: (cursor: string | null) => void;
|
|
@@ -54,24 +61,49 @@ export interface EditorRenderer<TMeta = unknown> {
|
|
|
54
61
|
h: number;
|
|
55
62
|
};
|
|
56
63
|
readonly viewport: Viewport;
|
|
57
|
-
|
|
64
|
+
/**
|
|
65
|
+
* ์ด๋ฏธ์ง ๋ก๋/๊ต์ฒด. coordinateSize๋ฅผ ์ฃผ๋ฉด ๋ํ ์ขํ๊ณ๋ฅผ ๊ทธ ํฌ๊ธฐ๋ก ๊ณ ์ ํ๊ณ
|
|
66
|
+
* ์ด๋ฏธ์ง๋ฅผ ๋๋ ค ๊ทธ๋ฆฐ๋ค(์ธ๋ค์ผ ํ์ + ์๋ณธ ์ขํ ํธ์ง). ๋ฏธ์ง์ ์ ์ค์ ํฝ์
ํฌ๊ธฐ.
|
|
67
|
+
* imageSize๋ฅผ ์ฃผ๋ฉด ์ด๋ฏธ์ง๋ฅผ ์ขํ๊ณต๊ฐ ์ ์ฒด๊ฐ ์๋๋ผ ๊ทธ ํฌ๊ธฐ๋ก(์์ ๊ธฐ์ค) ๊ทธ๋ฆฐ๋ค โ
|
|
68
|
+
* ์ด๋ฏธ์ง๊ฐ ์ขํ๊ณต๊ฐ์ ์ผ๋ถ๋ง ๋ฎ๋ ๊ฒฝ์ฐ(๋ค์ค ํด์๋ ์ขํ๊ณ ๋ฑ).
|
|
69
|
+
*/
|
|
70
|
+
setImage(url: string, coordinateSize?: {
|
|
71
|
+
width: number;
|
|
72
|
+
height: number;
|
|
73
|
+
}, imageSize?: {
|
|
74
|
+
width: number;
|
|
75
|
+
height: number;
|
|
76
|
+
}): Promise<void>;
|
|
58
77
|
/** ์ด๋ฏธ์ง ํ์ผ ์ฆ์ ์ ๊ฑฐ(๋ฌธ์ ์ ํ ์ ์ด์ ์ด๋ฏธ์ง ์์ ๋ฐฉ์ง). ๋ํ/์ค๋ฒ๋ ์ด๋ ๋ณ๋. */
|
|
59
78
|
clearImage(): void;
|
|
60
79
|
setFilter(brightness: number, contrast: number): void;
|
|
61
|
-
|
|
80
|
+
/**
|
|
81
|
+
* ๋ํ์ด ์ง์ ์ง์ ํ์ง ์์์ ๋ ์ธ ๋ ๋ ๊ธฐ๋ณธ๊ฐ(๋ณด๊ธฐ ์ค์ ์์ ๋ด๋ ค์จ๋ค).
|
|
82
|
+
* ์ค์ ์ด ๋์ด๋ ์ธํฐํ์ด์ค๊ฐ ๋์ง ์๊ฒ ๋ถ๋ถ ๊ฐฑ์ ํ๋๋ก ๋ฐ๋๋ค.
|
|
83
|
+
*/
|
|
84
|
+
setRenderDefaults(defaults: Partial<ShapeRenderStyleDefaults>): void;
|
|
62
85
|
/** ์ด๋ฏธ์ง ์ค๋ฌด๋ฉ. false๋ฉด ํ๋ ์ ํฝ์
ํ(๋๋ ท). */
|
|
63
86
|
setImageSmoothing(smooth: boolean): void;
|
|
64
87
|
/**
|
|
65
|
-
* ์ด๋ฏธ์งโ๋ํ ์ฌ์ด ์ค๋ฒ๋ ์ด(๊ฐ์ด๋
|
|
66
|
-
*
|
|
67
|
-
*
|
|
88
|
+
* ์ด๋ฏธ์งโ๋ํ ์ฌ์ด ์ค๋ฒ๋ ์ด(๊ฐ์ด๋ ๋ง์คํฌยท์์ญ ๋ง์คํฌ)๋ฅผ ๊ทธ๋ฆฐ๋ค. ๋ค(๋ฉด)ยท์ค๊ณฝ์
|
|
89
|
+
* ๋ฒกํฐ(RegionOverlayData)๋ก ๋ฐ์ ์ค๊ณฝ์ ํ๋ฉด๊ณ ์ (์ค ๋ฌด๊ด) ์คํธ๋กํฌ๋ก ๊ทธ๋ฆฐ๋ค.
|
|
90
|
+
* null์ด๋ฉด ํด๋น ์ค๋ฒ๋ ์ด๋ฅผ ์ง์ด๋ค. ๋ํ์ ์ด ์์ ๊ทธ๋ ค์ง๋ค.
|
|
91
|
+
*/
|
|
92
|
+
setOverlays(maskCanvas: HTMLCanvasElement | null, region: RegionOverlayData | null, dimmed: boolean): void;
|
|
93
|
+
/**
|
|
94
|
+
* ๋๋๊ทธยท๋๋ก์ ์ค ์์ญ ์ค๋ฒ๋ ์ด๋ง ๊ฐฑ์ ํ๋ค. ๊ฐ์ด๋ ๋ง์คํฌ์ ์ ์ญ ๋ค์ ์ ์งํ๋ฉฐ,
|
|
95
|
+
* ๋ ๋๋ฌ๋ ๊ณ ๋น๋ ํธ์ถ์์ ๊ธฐ์กด ๊ทธ๋ํฝ ๊ฐ์ฒด๋ฅผ ์ฌ์ฌ์ฉํด์ผ ํ๋ค.
|
|
68
96
|
*/
|
|
69
|
-
|
|
97
|
+
setRegionOverlay(region: RegionOverlayData | null): void;
|
|
70
98
|
setCursor(cursor: string): void;
|
|
71
99
|
setShapes(shapes: EditorShape<TMeta>[], selected: string[]): void;
|
|
72
100
|
setSelection(selected: string[]): void;
|
|
73
101
|
/** ํด๋ฆฌ๊ณค ์ ์ ํธ์ง๋ชจ๋ ๋์(null์ด๋ฉด ํด์ ). ํธ์ง๋ชจ๋์ผ ๋๋ง ์ ์ ํธ๋ค ํ์. */
|
|
74
102
|
setEditing(id: string | null): void;
|
|
103
|
+
/** ํธ์ง๋ชจ๋ ์ ์ ๋ค์ค์ ํ์ ๊ต์ฒดํ๋ค(๋งํด ๋ฒ์์ ํ์ฉ). ํธ์ง๋ชจ๋๊ฐ ์๋๋ฉด ๋ฌด์. */
|
|
104
|
+
setVertexSelection(indices: number[]): void;
|
|
105
|
+
/** ํ์ฌ ํธ์ง๋ชจ๋ ์ ์ ๋ค์ค์ ํ ์ธ๋ฑ์ค(Shift ๋งํด ์ถ๊ฐ์ ํ์ ๊ธฐ์ค๊ฐ). */
|
|
106
|
+
getVertexSelection(): number[];
|
|
75
107
|
setTransformEnabled(enabled: boolean): void;
|
|
76
108
|
/**
|
|
77
109
|
* ํฌ(์คํ์ด์ค) ๋ชจ๋ ํ ๊ธ. ํ์ฑ ์ ํธ๋์คํฌ๋จธ/์ ์ ํธ๋ค์ ํํธํ
์คํธ๋ฅผ ๊บผ์
|
|
@@ -83,8 +115,8 @@ export interface EditorRenderer<TMeta = unknown> {
|
|
|
83
115
|
zoom100(): void;
|
|
84
116
|
zoomAt(cx: number, cy: number, factor: number): void;
|
|
85
117
|
beginMove(start: Point, ids: string[]): void;
|
|
86
|
-
previewBox(kind: PreviewKind, a: Point, b: Point,
|
|
87
|
-
previewPoly(points: Point[], cursor: Point | null,
|
|
118
|
+
previewBox(kind: PreviewKind, a: Point, b: Point, style: ShapeStyle): void;
|
|
119
|
+
previewPoly(points: Point[], cursor: Point | null, style: ShapeStyle, closed: boolean, selectedPointIndices?: number[], showVertices?: boolean): void;
|
|
88
120
|
previewScalarMask(raster: ScalarMaskRaster, color: string): void;
|
|
89
121
|
previewMarquee(a: Point, b: Point): void;
|
|
90
122
|
clearPreview(): void;
|
|
@@ -92,3 +124,4 @@ export interface EditorRenderer<TMeta = unknown> {
|
|
|
92
124
|
shapesIntersecting(box: BBox): string[];
|
|
93
125
|
}
|
|
94
126
|
export type EditorRendererFactory = (host: HTMLElement, cb: EditorRendererCallbacks) => EditorRenderer;
|
|
127
|
+
export {};
|
|
@@ -24,6 +24,8 @@ export interface InteractionControllerCtx<TMeta> {
|
|
|
24
24
|
selRef: RefObject<string[]>;
|
|
25
25
|
draftRef: RefObject<ShapeStyle | undefined>;
|
|
26
26
|
readOnlyRef: RefObject<boolean | undefined>;
|
|
27
|
+
/** true๋ฉด SELECT ๋๊ตฌ ๋งํด(๋ฒ์ ์ ํ) ๋นํ์ฑ โ ํด๋ฆญ ๋จ๊ฑด ์ ํ๋ง. */
|
|
28
|
+
disableMarqueeRef?: RefObject<boolean | undefined>;
|
|
27
29
|
/** ํธ์ง ์ ๊ธ(์๋ฃ ๋ฑ). true๋ฉด ํธ์ง ์๋๋ฅผ ๋ง๊ณ onLockedInteraction ํธ์ถ. */
|
|
28
30
|
lockedRef: RefObject<boolean | undefined>;
|
|
29
31
|
onLockedInteraction: () => void;
|
|
@@ -31,6 +33,8 @@ export interface InteractionControllerCtx<TMeta> {
|
|
|
31
33
|
selectRef: RefObject<(ids: string[]) => void>;
|
|
32
34
|
/** ํด๋ฆฌ๊ณค ์ ์ ํธ์ง๋ชจ๋ ์ง์
(๋๋ธํด๋ฆญ). */
|
|
33
35
|
enterEditRef: RefObject<(id: string) => void>;
|
|
36
|
+
/** ํ์ฌ ํธ์ง๋ชจ๋ ๋์ ํด๋ฆฌ๊ณค id(null์ด๋ฉด ๋นํธ์ง). ๋งํด๋ฅผ ์ ์ ๋ฒ์์ ํ์ผ๋ก ์ ํ. */
|
|
37
|
+
editingIdRef: RefObject<string | null>;
|
|
34
38
|
drawSessionRef: RefObject<DrawSession<TMeta>>;
|
|
35
39
|
assistantRef: RefObject<AssistantSession<TMeta>>;
|
|
36
40
|
setCursorHint: (cursor: string | null) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -19,10 +19,11 @@ interface UseDrawSessionParams<TMeta> {
|
|
|
19
19
|
draftMeta: TMeta | undefined;
|
|
20
20
|
engineRef: RefObject<EditorRenderer | null>;
|
|
21
21
|
onDrawSessionChange?: (session: DrawSessionChange) => void;
|
|
22
|
+
onDraftShapeChange?: (shape: Pick<EditorShape<TMeta>, "type" | "points" | "meta"> | null) => void;
|
|
22
23
|
changeSelection: (ids: string[]) => void;
|
|
23
24
|
createShape: (type: EditorShape<TMeta>["type"], points: Point[]) => void;
|
|
24
25
|
}
|
|
25
|
-
export declare function useDrawSession<TMeta>({ toolRef, selRef, docRef, readOnlyRef, draftRef, brushSizeRef, simplifyEpsilonRef, draftMeta, engineRef, onDrawSessionChange, changeSelection, createShape, }: UseDrawSessionParams<TMeta>): {
|
|
26
|
+
export declare function useDrawSession<TMeta>({ toolRef, selRef, docRef, readOnlyRef, draftRef, brushSizeRef, simplifyEpsilonRef, draftMeta, engineRef, onDrawSessionChange, onDraftShapeChange, changeSelection, createShape, }: UseDrawSessionParams<TMeta>): {
|
|
26
27
|
reset: () => void;
|
|
27
28
|
undoSession: () => boolean;
|
|
28
29
|
redoSession: () => boolean;
|
|
@@ -5,6 +5,8 @@ export type EditorActionHandlers = Partial<Record<EditorAction, () => boolean |
|
|
|
5
5
|
interface EditorHotkeysCtx {
|
|
6
6
|
/** ํธ์คํธ ์ฌ์ ์(๋ฌธ์์ด/๋ฐฐ์ด=์ฌ๋งคํ, null=๋นํ์ฑ). ๋ฏธ์ง์ ํค๋ ๊ธฐ๋ณธ๊ฐ. */
|
|
7
7
|
keymap?: KeymapOverrides;
|
|
8
|
+
/** ์๋ํฐ ๋ฃจํธ ์์. ์๋ํฐ๋ฅผ ํฌํจํ์ง ์๋ ๋ชจ๋ฌ ์์์๋ ์ก์
์ ๋ฌด์ํ๋ ๋ฐ ์ด๋ค. */
|
|
9
|
+
hostRef: RefObject<HTMLElement | null>;
|
|
8
10
|
actions: EditorActionHandlers;
|
|
9
11
|
spaceRef: RefObject<boolean>;
|
|
10
12
|
shiftRef: RefObject<boolean>;
|