@aivex/ui 1.2.0-dev.2 → 1.2.0-dev.4

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 (64) hide show
  1. package/dist/Button-C_GP2mJ-.cjs +2 -0
  2. package/dist/Button-C_GP2mJ-.cjs.map +1 -0
  3. package/dist/{Switch-c8rHebeK.js → Button-CzqDPqUT.js} +1956 -4599
  4. package/dist/Button-CzqDPqUT.js.map +1 -0
  5. package/dist/IconButton-B-MspnYP.cjs +2 -0
  6. package/dist/IconButton-B-MspnYP.cjs.map +1 -0
  7. package/dist/IconButton-DTGSfJme.js +560 -0
  8. package/dist/IconButton-DTGSfJme.js.map +1 -0
  9. package/dist/Switch-B2irM7Pp.js +2656 -0
  10. package/dist/Switch-B2irM7Pp.js.map +1 -0
  11. package/dist/Switch-CMKBdqkX.cjs +42 -0
  12. package/dist/Switch-CMKBdqkX.cjs.map +1 -0
  13. package/dist/comment.cjs +114 -0
  14. package/dist/comment.cjs.map +1 -0
  15. package/dist/comment.js +13624 -0
  16. package/dist/comment.js.map +1 -0
  17. package/dist/components/Coachmark/Coachmark.d.ts +54 -0
  18. package/dist/components/Coachmark/index.d.ts +2 -0
  19. package/dist/components/Comment/CommentInput.d.ts +30 -0
  20. package/dist/components/Comment/CommentPin.d.ts +17 -0
  21. package/dist/components/Comment/MentionInput.d.ts +30 -0
  22. package/dist/components/Comment/MentionList.d.ts +14 -0
  23. package/dist/components/Comment/index.d.ts +4 -0
  24. package/dist/components/Comment/types.d.ts +12 -0
  25. package/dist/components/Comment/useMentionSuggestion.d.ts +15 -0
  26. package/dist/components/Logo/index.d.ts +2 -1
  27. package/dist/components/ShapeEditor/ShapeEditor.d.ts +1 -1
  28. package/dist/components/ShapeEditor/ShapeViewer.d.ts +42 -0
  29. package/dist/components/ShapeEditor/_components/ContextMenu.d.ts +1 -1
  30. package/dist/components/ShapeEditor/_components/Minimap.d.ts +4 -4
  31. package/dist/components/ShapeEditor/_components/RegionOverlay.d.ts +21 -0
  32. package/dist/components/ShapeEditor/_components/SelectionInfo.d.ts +2 -1
  33. package/dist/components/ShapeEditor/_model/geometry.d.ts +2 -0
  34. package/dist/components/ShapeEditor/_model/imageFetch.d.ts +9 -0
  35. package/dist/components/ShapeEditor/_model/overlays.d.ts +82 -15
  36. package/dist/components/ShapeEditor/_model/overlays.test.d.ts +1 -0
  37. package/dist/components/ShapeEditor/_model/props.d.ts +37 -6
  38. package/dist/components/ShapeEditor/_model/strings.d.ts +1 -1
  39. package/dist/components/ShapeEditor/_model/viewSettings.d.ts +1 -1
  40. package/dist/components/ShapeEditor/_renderers/KonvaRenderer.d.ts +9 -5
  41. package/dist/components/ShapeEditor/_renderers/PixiRenderer.d.ts +13 -9
  42. package/dist/components/ShapeEditor/_renderers/transformSession.d.ts +5 -0
  43. package/dist/components/ShapeEditor/_renderers/types.d.ts +8 -8
  44. package/dist/components/ShapeEditor/_state/createInteractionController.d.ts +2 -0
  45. package/dist/components/ShapeEditor/_state/useDrawSession.d.ts +2 -1
  46. package/dist/components/ShapeEditor/_state/useEditorHotkeys.d.ts +2 -0
  47. package/dist/components/ShapeEditor/_state/useEngineLifecycle.d.ts +6 -6
  48. package/dist/components/ShapeEditor/index.d.ts +3 -1
  49. package/dist/components/Slider/Slider.d.ts +3 -1
  50. package/dist/index.cjs +6 -6
  51. package/dist/index.cjs.map +1 -1
  52. package/dist/index.d.ts +1 -0
  53. package/dist/index.js +1933 -2284
  54. package/dist/index.js.map +1 -1
  55. package/dist/shape-editor.cjs +1 -1
  56. package/dist/shape-editor.cjs.map +1 -1
  57. package/dist/shape-editor.js +2002 -1512
  58. package/dist/shape-editor.js.map +1 -1
  59. package/dist/styles.css +1 -1
  60. package/package.json +13 -2
  61. package/dist/Switch-DX-FkCbT.cjs +0 -42
  62. package/dist/Switch-DX-FkCbT.cjs.map +0 -1
  63. package/dist/Switch-c8rHebeK.js.map +0 -1
  64. package/dist/components/ShapeEditor/_components/RoiOverlay.d.ts +0 -21
@@ -0,0 +1,54 @@
1
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
2
+ import type { ComponentPropsWithoutRef, ReactNode, Ref } from "react";
3
+ import { type ButtonProps } from "@/components/Button";
4
+ /** 버튼은 라벨을 children으로 받고, 스타일(variant/color/size)은 Coachmark가 고정한다. */
5
+ export interface CoachmarkButtonProps extends Omit<ButtonProps, "asChild" | "children" | "className" | "color" | "ref" | "size" | "style" | "variant"> {
6
+ children: ReactNode;
7
+ }
8
+ type CoachmarkRootProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>;
9
+ declare function CoachmarkRoot(props: CoachmarkRootProps): import("react/jsx-runtime").JSX.Element;
10
+ type CoachmarkTriggerProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger> & {
11
+ ref?: Ref<HTMLButtonElement>;
12
+ };
13
+ /** 코치마크를 붙일 요소. asChild로 임의 요소를 감싼다. */
14
+ declare function CoachmarkTrigger({ ref, ...props }: CoachmarkTriggerProps): import("react/jsx-runtime").JSX.Element;
15
+ type CoachmarkAnchorProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor>;
16
+ /** 클릭 트리거 없이 특정 요소를 기준점으로만 쓸 때 사용한다. */
17
+ declare function CoachmarkAnchor(props: CoachmarkAnchorProps): import("react/jsx-runtime").JSX.Element;
18
+ interface CoachmarkContentProps extends Omit<ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>, "children" | "title"> {
19
+ /** 상단 타이틀. 생략하면 타이틀 영역을 렌더하지 않는다. */
20
+ title?: ReactNode;
21
+ /** 본문(텍스트·이미지 등, min 40 / max 200px, 초과 시 스크롤). */
22
+ children?: ReactNode;
23
+ /** 좌측 하단 보조 버튼(예: 넘기기). */
24
+ tertiaryButton?: CoachmarkButtonProps;
25
+ /** 우측 보조 버튼(예: 이전). */
26
+ secondaryButton?: CoachmarkButtonProps;
27
+ /** 우측 주요 버튼(예: 다음). */
28
+ primaryButton?: CoachmarkButtonProps;
29
+ /** 지정하면 타이틀 우측에 닫기(X) 버튼을 렌더한다. */
30
+ onClose?: () => void;
31
+ /** 닫기 버튼 aria-label. 기본 "닫기". */
32
+ closeAriaLabel?: string;
33
+ ref?: Ref<HTMLDivElement>;
34
+ }
35
+ declare function CoachmarkContent({ className, sideOffset, title, children, tertiaryButton, secondaryButton, primaryButton, onClose, closeAriaLabel, ref, ...props }: CoachmarkContentProps): import("react/jsx-runtime").JSX.Element;
36
+ /**
37
+ * 특정 요소를 가리키며 안내·온보딩 정보를 띄우는 코치마크(Popover-Bubble, 3848:11976).
38
+ * `@radix-ui/react-popover` 기반이라 side/정렬/충돌 회피/화살표 위치를 Radix가 처리한다.
39
+ * 진한 배경 위에 타이틀·닫기·본문·버튼(넘기기/이전/다음)을 담는다.
40
+ *
41
+ * ```tsx
42
+ * <Coachmark open={open} onOpenChange={setOpen}>
43
+ * <Coachmark.Anchor asChild><TriggerEl /></Coachmark.Anchor>
44
+ * <Coachmark.Content side="bottom" title="…" onClose={dismiss}>본문</Coachmark.Content>
45
+ * </Coachmark>
46
+ * ```
47
+ */
48
+ declare const Coachmark: typeof CoachmarkRoot & {
49
+ Trigger: typeof CoachmarkTrigger;
50
+ Anchor: typeof CoachmarkAnchor;
51
+ Content: typeof CoachmarkContent;
52
+ };
53
+ export type { CoachmarkAnchorProps, CoachmarkContentProps, CoachmarkRootProps, CoachmarkTriggerProps, };
54
+ export { Coachmark };
@@ -0,0 +1,2 @@
1
+ export type { CoachmarkAnchorProps, CoachmarkButtonProps, CoachmarkContentProps, CoachmarkRootProps, CoachmarkTriggerProps, } from "./Coachmark";
2
+ export { Coachmark } from "./Coachmark";
@@ -0,0 +1,30 @@
1
+ import type { JSONContent } from "@tiptap/react";
2
+ import type { CommentUser } from "./types";
3
+ export interface CommentInputProps {
4
+ /** 작성자(입력행 아바타). */
5
+ user?: CommentUser;
6
+ value: string;
7
+ onChange: (value: string) => void;
8
+ /** 전송(Enter 또는 Send 버튼). 값이 비어 있으면 호출되지 않는다. */
9
+ onSubmit: () => void;
10
+ /** 헤더 닫기 버튼·Esc. */
11
+ onClose?: () => void;
12
+ /** 헤더 타이틀(호스트 i18n). 기본 "Comment". */
13
+ title?: string;
14
+ placeholder?: string;
15
+ /** 전송 버튼 라벨(호스트 i18n). 기본 "Send". */
16
+ submitLabel?: string;
17
+ /** 전송 중 여부 — 버튼 비활성(스피너 등은 호스트가 submitLabel 자리로). */
18
+ pending?: boolean;
19
+ /** 멘션(@) 후보. 생략하면 멘션 없이 동작. */
20
+ userList?: CommentUser[];
21
+ mentionEmptyText?: string;
22
+ initialContent?: JSONContent;
23
+ className?: string;
24
+ }
25
+ /**
26
+ * 새 코멘트 입력 패널 — 옵스 new-editor의 NewCommentPanel 이식(도메인/위치 결합 제거).
27
+ * 코멘트 스레드와 동일한 크롬: 헤더(타이틀+닫기) + 입력행(아바타 · 멘션 입력 · 오른쪽
28
+ * Send 버튼). 화면 배치(핀 오른쪽 등)는 호스트가 감싸는 컨테이너에서 담당한다.
29
+ */
30
+ export declare function CommentInput({ user, value, onChange, onSubmit, onClose, title, placeholder, submitLabel, pending, userList, mentionEmptyText, initialContent, className, }: CommentInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { CommentUser } from "./types";
2
+ export interface CommentPinProps {
3
+ /** 스레드 참여자(작성자 우선). 최대 maxAvatars명까지 아바타를 겹쳐 그린다. */
4
+ users: CommentUser[];
5
+ selected?: boolean;
6
+ /** 해결(resolve)된 코멘트 — 반투명 표시. */
7
+ resolved?: boolean;
8
+ onClick?: () => void;
9
+ maxAvatars?: number;
10
+ className?: string;
11
+ }
12
+ /**
13
+ * 코멘트 핀(다트) — 옵스 에디터 CommentDart의 말풍선 부분 이식.
14
+ * 좌하단이 뾰족한 말풍선(팁이 코멘트 지점을 가리킴). 위치·스케일 고정은 호스트가
15
+ * ShapeEditor overlayMarkers(anchor "topLeft") 등으로 담당한다.
16
+ */
17
+ export declare function CommentPin({ users, selected, resolved, onClick, maxAvatars, className, }: CommentPinProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { type JSONContent } from "@tiptap/react";
2
+ import { type Ref } from "react";
3
+ import type { CommentUser } from "./types";
4
+ export interface MentionInputHandle {
5
+ /** 입력기에 포커스를 준다(예: 전송 버튼 클릭 후 포커스 유지). */
6
+ focus: () => void;
7
+ }
8
+ export interface MentionInputProps {
9
+ value: string;
10
+ onChange: (value: string) => void;
11
+ placeholder?: string;
12
+ /** Enter(멘션 목록 닫힌 상태) 제출. */
13
+ onSubmit?: () => void;
14
+ /** Esc(멘션 목록 닫힌 상태) 취소. */
15
+ onEscape?: () => void;
16
+ /** 멘션(@) 후보. 빈 배열이면 멘션 없이 플레인 입력처럼 동작한다. */
17
+ userList?: CommentUser[];
18
+ initialContent?: JSONContent;
19
+ /** 멘션 후보 없음 문구(호스트 i18n). */
20
+ mentionEmptyText?: string;
21
+ /** 마운트 시 자동 포커스(기본 true). */
22
+ autoFocus?: boolean;
23
+ /** 명령형 핸들(포커스 제어). */
24
+ handleRef?: Ref<MentionInputHandle>;
25
+ }
26
+ /**
27
+ * 멘션(@) 지원 코멘트 입력기 — 옵스 에디터 MentionInput 이식.
28
+ * value는 평문 직렬화(`@[이름](id)`)로 주고받는다.
29
+ */
30
+ export default function MentionInput({ value, onChange, placeholder, onSubmit, onEscape, userList, initialContent, mentionEmptyText, autoFocus, handleRef, }: MentionInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { CommentUser } from "./types";
2
+ export interface MentionListHandle {
3
+ onKeyDown: (event: KeyboardEvent) => boolean;
4
+ }
5
+ interface MentionListProps {
6
+ items: CommentUser[];
7
+ command: (item: CommentUser) => void;
8
+ /** 후보 없음 문구(호스트 i18n). 기본 "No results found." */
9
+ emptyText?: string;
10
+ ref?: React.Ref<MentionListHandle>;
11
+ }
12
+ /** 멘션(@) 자동완성 목록 — 옵스 에디터 MentionList 이식(도메인 결합 제거). */
13
+ declare const MentionList: import("react").MemoExoticComponent<({ items, command, emptyText, ref, }: MentionListProps) => import("react/jsx-runtime").JSX.Element>;
14
+ export default MentionList;
@@ -0,0 +1,4 @@
1
+ export { CommentInput, type CommentInputProps } from "./CommentInput";
2
+ export { CommentPin, type CommentPinProps } from "./CommentPin";
3
+ export { default as MentionInput, type MentionInputHandle, type MentionInputProps, } from "./MentionInput";
4
+ export type { CommentUser } from "./types";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Comment 모듈의 도메인 무관 유저 표현 — 옵스의 UserInfo에서 코멘트 UI가 실제로
3
+ * 쓰는 필드만 추린 것. 호스트가 자기 유저 모델을 이 형태로 매핑해 넘긴다.
4
+ */
5
+ export interface CommentUser {
6
+ id: string;
7
+ name: string;
8
+ email?: string;
9
+ avatarUrl?: string;
10
+ /** 아바타 배경색(개인 색). 없으면 Avatar가 이름 기반으로 자동 배정. */
11
+ color?: string;
12
+ }
@@ -0,0 +1,15 @@
1
+ import type { CommentUser } from "./types";
2
+ /** tiptap Mention 확장에 꽂는 자동완성 설정 — 옵스 에디터 이식(CommentUser 기반). */
3
+ export declare const useMentionSuggestion: (userList: CommentUser[], onOpenChange?: (isOpen: boolean) => void, emptyText?: string) => {
4
+ items: ({ query }: {
5
+ query: string;
6
+ }) => CommentUser[];
7
+ render: () => {
8
+ onStart: (props: Record<string, any>) => void;
9
+ onUpdate(props: Record<string, any>): void;
10
+ onKeyDown(props: {
11
+ event: KeyboardEvent;
12
+ }): boolean;
13
+ onExit(): void;
14
+ };
15
+ };
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode, type SVGProps } from "react";
2
2
  export interface LogoProps extends Omit<SVGProps<SVGSVGElement>, "color"> {
3
- /** Logo color (applied to the monochrome master fill). Defaults to currentColor. */
3
+ /** Logo color (applied to the monochrome master fill). Defaults to brand Black #0D0D12 (LOGO 마스터 496:270). */
4
4
  color?: string;
5
5
  /** Accessible title. When omitted the logo is decorative (aria-hidden). */
6
6
  title?: string;
@@ -11,6 +11,7 @@ export declare const AiVisionTLogo: (props: LogoProps) => ReactNode;
11
11
  export declare const AiVisionSLogo: (props: LogoProps) => ReactNode;
12
12
  export declare const AiVisionMLogo: (props: LogoProps) => ReactNode;
13
13
  export declare const AiVDataLogo: (props: LogoProps) => ReactNode;
14
+ export declare const AiVDataSymbol: (props: LogoProps) => ReactNode;
14
15
  export declare const AiVOpsLogo: (props: LogoProps) => ReactNode;
15
16
  export declare const AiVotLogo: (props: LogoProps) => ReactNode;
16
17
  export declare const AiViewLogo: (props: LogoProps) => ReactNode;
@@ -4,6 +4,6 @@ import type { ShapeEditorProps } from "./_model/props";
4
4
  * 그리기·히트테스트·뷰포트는 `EditorRenderer`(Konva/Pixi)에 위임한다. `backend`로 교체.
5
5
  * 갭(회전/꼭짓점추가 등)은 여기서 한 번 구현하면 양쪽 렌더러에 적용된다.
6
6
  */
7
- export default function ShapeEditor<TMeta, TMarkerMeta = unknown>({ imageUrl, displayImageUrl, renderImageState, dimmed, initialShapes, selectedIds: controlledSelectedIds, activeTool, draftStyle, draftMeta, readOnly, locked, onLockedInteraction, onIdleEscape, overrideShapeInteraction, defaultViewSettings, viewSettings, onViewSettingsChange, showMinimap, showViewSettings, getContextMenuItems, strings, canMergeSelection, brushSize, zoomBound, zoomAnimationDuration, rois, excludedZones, guideMask, maskPalette, overlayMarkers, renderOverlayMarker, onOverlayMarkerClick, renderImageOverlay, getSelectionLabel, formatSelectionInfo, externalTools, assistant, keymap, handleRef, backend, onActiveToolChange, onSelectionChange, onEditingChange, onShapesCreated, onShapesUpdated, onShapesDeleted, onDrawSessionChange, onViewportChange, }: ShapeEditorProps<TMeta, TMarkerMeta> & {
7
+ export default function ShapeEditor<TMeta, TMarkerMeta = unknown>({ imageUrl, displayImageUrl, renderImageState, dimmed, initialShapes, selectedIds: controlledSelectedIds, activeTool, draftStyle, draftMeta, readOnly, disableMarquee, locked, onLockedInteraction, onIdleEscape, overrideShapeInteraction, defaultViewSettings, viewSettings, onViewSettingsChange, showMinimap, showViewSettings, getContextMenuItems, strings, canMergeSelection, brushSize, zoomBound, zoomAnimationDuration, decorationShapes, regionMask, guideMask, maskPalette, overlayMarkers, renderOverlayMarker, onOverlayMarkerClick, renderImageOverlay, getSelectionLabel, hideSelectionLabelDot, formatSelectionInfo, externalTools, assistant, keymap, handleRef, backend, onActiveToolChange, onSelectionChange, onEditingChange, onShapesCreated, onShapesUpdated, onShapesDeleted, onDrawSessionChange, onDraftShapeChange, onViewportChange, onShapesTransformPreview, }: ShapeEditorProps<TMeta, TMarkerMeta> & {
8
8
  backend?: "konva" | "pixi";
9
9
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import type { CSSProperties, ReactNode } from "react";
2
+ import { type EditorShape } from "./_model/geometry";
3
+ import { type GuideMaskRaster, type MaskPalette, type RegionMask } from "./_model/overlays";
4
+ /**
5
+ * ShapeViewer가 지원하는 EditorShape **표시 서브셋 계약**:
6
+ * - 도형: POINT / RECTANGLE / ELLIPSE / POLYGON / LINE / ROTATED_RECTANGLE(꼭짓점 배열)
7
+ * - 스타일: color·alternateColor·strokeWidth·dash·opacity·filled·fillOpacity·
8
+ * pointRadius·zIndex, readOnly 줄무늬 — 에디터 렌더러와 같은 의미
9
+ * (resolveShapeRenderStyle 공유)로 그린다.
10
+ * - 상호작용·선택·핸들·마커 등 편집 표현은 렌더링하지 않는다(interaction.visible만 존중).
11
+ */
12
+ export interface ShapeViewerProps<TMeta = unknown> {
13
+ imageUrl: string;
14
+ alt?: string;
15
+ /** 도형 좌표계 크기. 썸네일 이미지의 실제 픽셀 크기와 다를 때 지정한다. */
16
+ coordinateSize?: {
17
+ width: number;
18
+ height: number;
19
+ };
20
+ shapes?: EditorShape<TMeta>[];
21
+ regionMask?: RegionMask;
22
+ guideMask?: GuideMaskRaster | null;
23
+ maskPalette?: MaskPalette;
24
+ /** 지정한 도형이 화면을 채우도록 확대한다. */
25
+ focusedShapeId?: string;
26
+ /**
27
+ * 포커스 줌 시 이미지 밖 여백 처리. "cover"면 이미지가 항상 컨테이너를
28
+ * 가득 채우도록 배율을 올리고 오프셋을 이미지 안쪽으로 클램프한다(썸네일용).
29
+ */
30
+ focusFit?: "contain" | "cover";
31
+ zoomPadding?: number;
32
+ strokeSize?: number;
33
+ brightness?: number;
34
+ contrast?: number;
35
+ imageSmoothing?: boolean;
36
+ lazy?: boolean;
37
+ className?: string;
38
+ style?: CSSProperties;
39
+ renderImageState?: (status: "loading" | "error") => ReactNode;
40
+ }
41
+ /** 목록·카드 미리보기를 위한 상호작용 없는 Canvas2D 도형 뷰어. */
42
+ export default function ShapeViewer<TMeta = unknown>({ imageUrl, alt, coordinateSize, shapes, regionMask, guideMask, maskPalette, focusedShapeId, focusFit, zoomPadding, strokeSize, brightness, contrast, imageSmoothing, lazy, className, style, renderImageState, }: ShapeViewerProps<TMeta>): import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ export type { ContextMenuItem };
5
5
  * @aivex/ui Menu(Radix Dropdown)를 커서 위치의 0크기 트리거에 앵커해 띄운다.
6
6
  * 바깥 클릭·Escape·스크롤 닫힘은 Radix가 onOpenChange로 처리한다(비모달).
7
7
  */
8
- export declare function ContextMenu({ x, y, items, onClose, }: {
8
+ export declare function ContextMenu({ x, y, items: rawItems, onClose, }: {
9
9
  x: number;
10
10
  y: number;
11
11
  items: ContextMenuItem[];
@@ -1,6 +1,6 @@
1
1
  import type { RefObject } from "react";
2
2
  import { type EditorShape } from "../_model/geometry";
3
- import type { ExcludedZone, RoiRect } from "../_model/overlays";
3
+ import type { RegionOverlayData } from "../_model/overlays";
4
4
  import { type EditorStrings } from "../_model/strings";
5
5
  import type { ViewSettings } from "../_model/viewSettings";
6
6
  import type { MinimapNavigation } from "../_state/useMinimapNavigation";
@@ -11,7 +11,7 @@ import type { MinimapNavigation } from "../_state/useMinimapNavigation";
11
11
  * 내비게이션 로직(패닝/줌)은 useMinimapNavigation(nav)에, 뷰포트 사각형/줌라벨의 실시간
12
12
  * 갱신은 호스트의 syncMinimap이 rectRef/zoomLabelRef로 담당한다. 여긴 순수 표시.
13
13
  */
14
- export declare function Minimap<TMeta>({ image, imageUrl, imageVisible, maskDataUrl, rois, excludedZones, roiMaskId, shapes, view, onChangeView, nav, registerShape, rectRef, zoomLabelRef, onZoom100, open, onToggleOpen, showSettings, settingsOpen, onToggleSettings, onCloseSettings, labels, settingsLabels, }: {
14
+ export declare function Minimap<TMeta>({ image, imageUrl, imageVisible, maskDataUrl, region, roiMaskId, shapes, view, onChangeView, nav, registerShape, rectRef, zoomLabelRef, onZoom100, open, onToggleOpen, showSettings, settingsOpen, onToggleSettings, onCloseSettings, labels, settingsLabels, }: {
15
15
  image: {
16
16
  w: number;
17
17
  h: number;
@@ -20,8 +20,8 @@ export declare function Minimap<TMeta>({ image, imageUrl, imageVisible, maskData
20
20
  /** 메인 캔버스와 동기화된 표시 여부 — 전환 시 즉시 숨기고 로드 후 페이드인. */
21
21
  imageVisible?: boolean;
22
22
  maskDataUrl: string | null;
23
- rois?: RoiRect[];
24
- excludedZones?: ExcludedZone[];
23
+ /** 리졸브된 영역 마스크 오버레이(딤·윤곽 벡터). */
24
+ region?: RegionOverlayData | null;
25
25
  roiMaskId: string;
26
26
  shapes: EditorShape<TMeta>[];
27
27
  view: ViewSettings;
@@ -0,0 +1,21 @@
1
+ import type { CSSProperties } from "react";
2
+ import type { RegionOverlayData } from "../_model/overlays";
3
+ /**
4
+ * 영역 마스크 오버레이 SVG — 미니맵용.
5
+ * 보이는 영역 밖을 딤으로 덮고, 가림 영역은 다시 덮으며, 경계선은 리졸브된
6
+ * 윤곽 선분만 점선으로 그린다(미니맵 축소 특성상 색은 단일 흰색).
7
+ * 좌표계는 이미지 좌표(viewBox=image), 화면 크기/선 두께는 호출부가 정한다.
8
+ */
9
+ export declare function RegionOverlay({ image, region, maskId, width, height, strokeWidth, strokeDasharray, style, }: {
10
+ image: {
11
+ w: number;
12
+ h: number;
13
+ };
14
+ region: RegionOverlayData;
15
+ maskId: string;
16
+ width: number;
17
+ height: number;
18
+ strokeWidth: number | string;
19
+ strokeDasharray: string;
20
+ style?: CSSProperties;
21
+ }): import("react/jsx-runtime").JSX.Element;
@@ -4,9 +4,10 @@ import type { EditorSelectionInfo } from "../_model/props";
4
4
  export declare function buildSelectionInfo<TMeta>(shape: EditorShape<TMeta>, points: Point[]): EditorSelectionInfo<TMeta>;
5
5
  /** formatSelectionInfo 미지정 시 기본 텍스트. */
6
6
  export declare function defaultSelectionInfoText<TMeta>(info: EditorSelectionInfo<TMeta>): string;
7
- export declare function SelectionInfo<TMeta>({ shapes, getLabel, formatInfo, register, }: {
7
+ export declare function SelectionInfo<TMeta>({ shapes, getLabel, hideDot, formatInfo, register, }: {
8
8
  shapes: EditorShape<TMeta>[];
9
9
  getLabel?: (shape: EditorShape<TMeta>) => string | undefined;
10
+ hideDot?: boolean;
10
11
  formatInfo?: (info: EditorSelectionInfo<TMeta>) => string;
11
12
  register: (id: string, el: HTMLDivElement | null) => void;
12
13
  }): import("react/jsx-runtime").JSX.Element;
@@ -21,6 +21,8 @@ export type ShapeType = (typeof SHAPE_TYPE)[keyof typeof SHAPE_TYPE];
21
21
  /** 도형 렌더 힌트. 호스트가 (예: 클래스→색) 계산해 주입한다. */
22
22
  export interface ShapeStyle {
23
23
  color?: string;
24
+ /** 점선의 빈 구간에 표시할 보조색. 지정하면 보조색 실선 위에 주색 점선을 그린다. */
25
+ alternateColor?: string;
24
26
  filled?: boolean;
25
27
  opacity?: number;
26
28
  /** 도형별 선 두께(화면 px). 없으면 에디터 기본값을 사용한다. */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * CORS 안전 이미지 blob URL 로드 — HTTP 캐시를 우선 사용한다(재방문·페이지 전환·
3
+ * 화질 스왑 시 재다운로드 없음). 앱 다른 곳의 crossOrigin 없는 `<img>`가 캐시를
4
+ * CORS 헤더 없는 응답으로 채웠으면 cors fetch가 실패하므로, 그때만 cache:"reload"로
5
+ * 캐시 항목을 정상 CORS 응답으로 갈아끼우며 한 번 더 시도한다.
6
+ * 둘 다 실패하면 null — 호출부가 crossOrigin="anonymous" `<img>`로 폴백한다.
7
+ * Konva/Pixi 렌더러와 ShapeViewer가 공유한다.
8
+ */
9
+ export declare function fetchImageObjectUrl(url: string): Promise<string | null>;
@@ -6,18 +6,57 @@ import type { Point } from "./geometry";
6
6
  * 색(팔레트)만 안다. 호스트가 자기 도메인 데이터(클래스색·인덱스맵 등)에서 계산해
7
7
  * 주입하고, 에디터는 그대로 그리기만 한다. 비즈니스 로직 비종속.
8
8
  */
9
- /** 관심영역(ROI) — 이미지 좌표 사각형. 이 영역 밖은 어둡게 처리된다. */
10
- export interface RoiRect {
9
+ /** 이미지 좌표 사각형 영역 — 가림 효과에서 "보이는 창"(예: 호스트의 관심영역). */
10
+ export interface RectArea {
11
11
  id?: string;
12
12
  x: number;
13
13
  y: number;
14
14
  w: number;
15
15
  h: number;
16
16
  }
17
- /** 제외영역 — ROI 안에서 다시 빼내는 다각형(이미지 좌표). */
18
- export interface ExcludedZone {
17
+ /** 이미지 좌표 다각형 영역 — 보이는 창 안에서 다시 가리는 부분(예: 호스트의 마스킹). */
18
+ export interface PolygonArea {
19
19
  points: Point[];
20
20
  }
21
+ /** @deprecated 도메인 중립화로 `RectArea`로 개명. 다음 릴리스에서 제거 예정. */
22
+ export type RoiRect = RectArea;
23
+ /** @deprecated 도메인 중립화로 `PolygonArea`로 개명. 다음 릴리스에서 제거 예정. */
24
+ export type ExcludedZone = PolygonArea;
25
+ /** 영역 윤곽 스트로크 — 화면 px 기준(줌과 무관하게 고정). */
26
+ export interface RegionOutlineStyle {
27
+ color?: string;
28
+ opacity?: number;
29
+ /** 두께(화면 px). */
30
+ width?: number;
31
+ /** 점선 패턴(화면 px). */
32
+ dash?: [number, number];
33
+ /** 점선 빈 구간의 밑선 색(대비용). null이면 밑선 없음. 기본 검정. */
34
+ underlayColor?: string | null;
35
+ }
36
+ /**
37
+ * 이미지 위 가림 효과를 위한 순수 시각 계약. 영역의 제품 의미(관심영역·마스킹 등)는
38
+ * 호스트가 해석하고, 에디터는 "보이는 영역과 가려지는 영역"만 안다.
39
+ * 표시 정책(딤 농도·윤곽 색)은 기본값일 뿐 호스트가 전부 재정의할 수 있다.
40
+ */
41
+ export interface RegionMask {
42
+ visibleAreas: RectArea[];
43
+ occludedAreas?: PolygonArea[];
44
+ /** 가림 면 스타일. 기본 검정 50%. */
45
+ dim?: {
46
+ color?: string;
47
+ opacity?: number;
48
+ };
49
+ /**
50
+ * 윤곽 표시. false면 면만 그리고 윤곽은 도형 레이어에 맡긴다. 미지정=기본 스타일.
51
+ * mode "merged"(기본)=유효 영역(합집합 − 가림) 경계 하나를 visibleStyle로(보기 맥락),
52
+ * "separate"=사각형·가림 윤곽을 각각 visibleStyle/occludedStyle로 통째 표시(편집 맥락).
53
+ */
54
+ outline?: false | {
55
+ mode?: "merged" | "separate";
56
+ visibleStyle?: RegionOutlineStyle;
57
+ occludedStyle?: RegionOutlineStyle;
58
+ };
59
+ }
21
60
  /** 마스크 팔레트 — 픽셀 인덱스값 → 색(hex). 호스트가 클래스색에서 계산해 주입. */
22
61
  export type MaskPalette = Record<number, string>;
23
62
  /**
@@ -37,19 +76,47 @@ export interface GuideMaskRaster {
37
76
  * 실패하면 null. 결과 캔버스는 이미지 원본 해상도(width×height).
38
77
  */
39
78
  export declare const buildMaskCanvas: (raster: GuideMaskRaster, palette: MaskPalette) => HTMLCanvasElement | null;
79
+ /** 이미지 좌표 선분. 렌더러가 화면고정(줌 무관) 점선 스트로크로 그린다. */
80
+ export type OutlineSegment = [Point, Point];
81
+ /**
82
+ * Canvas2D에 벡터 딤을 그린다 — 이미지 전체를 딤 색으로 덮되 보이는 영역 합집합을
83
+ * 구멍(dimHoles, 무겹침이라 nonzero에서 안전)으로 뚫고, 가림 영역은 합집합 안쪽만
84
+ * 다시 덮는다. Konva 렌더러와 ShapeViewer가 공유한다(전체 경로 커버리지 채움이라
85
+ * 인접 구멍 경계에 이음선이 생기지 않는다).
86
+ */
87
+ export declare function drawRegionDim(ctx: CanvasRenderingContext2D, region: Pick<RegionOverlayData, "rects" | "zones" | "dimHoles" | "dim">, width: number, height: number): void;
88
+ /** 기본값이 채워진 윤곽 스트로크 — 렌더러가 그대로 그린다. */
89
+ export type ResolvedRegionOutlineStyle = Required<RegionOutlineStyle>;
40
90
  /**
41
- * 렌더러 오버레이용 ROI 데이터. 딤(면)은 이미지 좌표 래스터로 굽고,
42
- * 점선 테두리는 벡터 윤곽을 넘겨 각 렌더러가 화면고정(줌 무관) 스트로크로 그린다.
91
+ * 렌더러 오버레이용 영역 데이터. 딤(면)·윤곽 모두 벡터로 넘긴다 —
92
+ * 래스터(캔버스 굽기 + 텍스처 업로드)가 없어 드래그 중 프레임마다 재계산해도 싸다.
93
+ * 딤은 rects/zones로 각 렌더러가 직접 그리고(이미지 전체 − 사각형 합집합, 가림은
94
+ * 합집합 안쪽만 다시 덮음), 윤곽은 선분 목록을 화면고정(줌 무관) 스트로크로 그린다.
43
95
  */
44
- export interface RoiOverlayData {
45
- dimCanvas: HTMLCanvasElement;
46
- rects: RoiRect[];
47
- zones: ExcludedZone[];
96
+ export interface RegionOverlayData {
97
+ /** 딤 계산용 보이는 창들. visibleAreas가 비어 있으면 전체 이미지 사각형 1개. */
98
+ rects: RectArea[];
99
+ zones: PolygonArea[];
100
+ /** 사각형 합집합의 무겹침 분해 — 캔버스 딤 경로의 구멍용(겹치는 영역 안전). */
101
+ dimHoles: RectArea[];
102
+ dim: {
103
+ color: string;
104
+ opacity: number;
105
+ };
106
+ /** visibleStyle로 그릴 경계 조각. merged면 유효 영역 경계 전체가 여기 담긴다. */
107
+ visibleOutline: OutlineSegment[];
108
+ /** occludedStyle로 그릴 가림 윤곽 조각(separate 모드에서만 비어있지 않음). */
109
+ occludedOutline: OutlineSegment[];
110
+ /** null이면 윤곽 생략(outline: false). */
111
+ outlineStyles: {
112
+ visible: ResolvedRegionOutlineStyle;
113
+ occluded: ResolvedRegionOutlineStyle;
114
+ } | null;
48
115
  }
49
116
  /**
50
- * ROI(관심영역) 딤 오버레이를 이미지 좌표 캔버스로 그린다.
51
- * 전체를 반투명 검정으로 덮고 ROI 안을 뚫는다(제외영역은 다시 덮음). 테두리는 안 그림 —
52
- * 줌해도 두께·점선이 고정되도록 렌더러가 벡터로 그린다(RoiOverlayData.rects/zones).
53
- * 렌더러 오버레이 레이어(이미지↔도형 사이)에 스프라이트로 올려 레이블이 그 위에 보이게 한다.
117
+ * RegionMask를 렌더러가 그릴 벡터 데이터로 리졸브한다(기본 표시 정책 주입 포함).
118
+ * outline.mode "merged"(기본)면 유효 영역(합집합 − 가림) 경계 하나를,
119
+ * "separate"면 사각형·가림 윤곽을 각각 통째로 넘긴다.
120
+ * 렌더러 오버레이 레이어(이미지↔도형 사이)에 그려 도형이 그 위에 보이게 한다.
54
121
  */
55
- export declare const buildRoiOverlayData: (rois: RoiRect[], excludedZones: ExcludedZone[] | undefined, width: number, height: number) => RoiOverlayData | null;
122
+ export declare const buildRegionOverlayData: (mask: RegionMask, width: number, height: number) => RegionOverlayData | null;
@@ -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 { ExcludedZone, GuideMaskRaster, MaskPalette, RoiRect } from "./overlays";
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;
@@ -150,6 +152,12 @@ export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
150
152
  overrideShapeInteraction?: (shape: EditorShape<TMeta>) => Partial<ShapeInteraction> | null | undefined;
151
153
  /** 선택 도형 id. 제공하면 selection은 호스트가 소유하는 controlled 모드로 동작한다. */
152
154
  selectedIds?: string[];
155
+ /**
156
+ * true면 SELECT 도구의 빈 공간 드래그 마퀴(범위 선택)를 끈다 — 클릭 단건 선택만.
157
+ * 빈 공간 클릭 시 선택 해제는 그대로 동작한다. 단건 선택만 허용하는 뷰어형
158
+ * 호스트(검수 상세 등)에서 켠다.
159
+ */
160
+ disableMarquee?: boolean;
153
161
  activeTool: Tool;
154
162
  /** 없으면 그리기 비활성. */
155
163
  draftStyle?: ShapeStyle;
@@ -169,10 +177,15 @@ export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
169
177
  * 잇는 데 쓴다(기존 Editor의 Esc 사슬 꼬리).
170
178
  */
171
179
  onIdleEscape?: () => void;
172
- /** 관심영역(ROI) 사각형들(이미지 좌표). 영역 밖은 어둡게 처리. */
173
- rois?: RoiRect[];
174
- /** 제외영역 다각형들(이미지 좌표). ROI 안에서 다시 빼냄. */
175
- excludedZones?: ExcludedZone[];
180
+ /**
181
+ * 문서 밖 장식 도형(예: 다른 해상도 가이드 사각형). 도형 레이어에 렌더만 되고
182
+ * 선택·undo 히스토리·히트테스트·getShapes()에서 완전히 제외된다 — 스타일 변경
183
+ * (hover 강조 등)은 prop 교체로 반영되며 히스토리에 쌓이지 않는다.
184
+ * z순서는 style.zIndex로 제어한다(음수면 문서 도형 아래).
185
+ */
186
+ decorationShapes?: EditorShape<TMeta>[];
187
+ /** 이미지 위 가림 효과. 제품 의미는 호스트가 해석하고 에디터는 순수 영역만 렌더링한다. */
188
+ regionMask?: RegionMask;
176
189
  /**
177
190
  * 가이드 마스크 래스터(디코딩된 width/height/indices). maskPalette와 함께 사용.
178
191
  * 서버 와이어 포맷(바이너리 헤더 등) 디코딩은 호스트 책임(LabelEditor/guideMask.ts).
@@ -202,6 +215,11 @@ export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
202
215
  * 도메인 무관 — meta 해석은 호스트.
203
216
  */
204
217
  getSelectionLabel?: (shape: EditorShape<TMeta>) => string | undefined;
218
+ /**
219
+ * 선택 라벨 배지에서 도형 색을 나타내는 색 점을 숨긴다. 기본 false(표시).
220
+ * 클래스 색이 도메인상 의미가 없는 호스트에서 사용.
221
+ */
222
+ hideSelectionLabelDot?: boolean;
205
223
  /**
206
224
  * 선택 도형 아래 표시할 정보 텍스트. 에디터가 계산한 픽셀 데이터(info)를 받아
207
225
  * 프로덕트별 템플릿으로 포맷한다. 미지정 시 기본값 `W x H px`. 빈 문자열이면 숨김.
@@ -298,6 +316,13 @@ export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
298
316
  */
299
317
  onShapesDeleted?: (ids: string[]) => void;
300
318
  onViewportChange?: (viewport: EditorCanvasViewport) => void;
319
+ /** 이동·리사이즈·정점 편집 중인 도형 좌표. 문서 커밋 전 시각 동기화용이다. */
320
+ onShapesTransformPreview?: (updates: {
321
+ id: string;
322
+ points: Point[];
323
+ }[]) => void;
324
+ /** 그리는 중인 임시 도형. ROI 등 호스트 전용 실시간 오버레이 동기화에 사용한다. */
325
+ onDraftShapeChange?: (shape: Pick<EditorShape<TMeta>, "type" | "points" | "meta"> | null) => void;
301
326
  /** 그리기 세션(붓·폴리곤·패스) 상태 — 호스트 undo/툴바 연동용. */
302
327
  onDrawSessionChange?: (session: DrawSessionChange) => void;
303
328
  /** 호스트發 수정/undo·redo/선택 제어용 명령형 핸들. */
@@ -319,6 +344,12 @@ export interface DrawSessionChange {
319
344
  * 호스트가 에디터에 명령을 보내는 창구. 모든 변경은 에디터 히스토리에 쌓여 undo 가능.
320
345
  */
321
346
  export interface ShapeEditorHandle<TMeta = unknown> {
347
+ /**
348
+ * 드래그·드로잉 중 고빈도 오버레이 프리뷰 — regionMask prop(React 왕복)을 우회해
349
+ * 렌더러에 즉시 반영한다(같은 프레임 보장). null이면 prop 기반 오버레이로 복귀.
350
+ * 문서 상태의 진실은 여전히 regionMask prop — 커밋 후 prop 갱신이 이 값을 덮어쓴다.
351
+ */
352
+ previewRegionMask: (regionMask: RegionMask | null) => void;
322
353
  /** 문서 undo. 그리기 세션이 있으면 `undoSession`이 우선. */
323
354
  undo: () => void;
324
355
  /** 문서 redo. 그리기 세션이 있으면 `redoSession`이 우선. */
@@ -395,4 +426,4 @@ export interface ShapeEditorHandle<TMeta = unknown> {
395
426
  beginEditFromSelection: () => boolean;
396
427
  };
397
428
  }
398
- export type { BrushScalarMode, EditorAction, EditorShape, ExcludedZone, GuideMaskRaster, KeymapOverrides, MaskPalette, Point, RoiRect, ShapeStyle, Tool, Viewport, ViewSettings, };
429
+ export type { BrushScalarMode, EditorAction, EditorShape, GuideMaskRaster, KeymapOverrides, MaskPalette, Point, PolygonArea, RectArea, RegionMask, RegionOutlineStyle, ShapeStyle, Tool, Viewport, ViewSettings, };
@@ -33,7 +33,7 @@ export interface EditorStrings {
33
33
  pixelation: string;
34
34
  cursorGuide: string;
35
35
  guideMask: string;
36
- roi: string;
36
+ regionMask: string;
37
37
  keepZoomOnImageChange: string;
38
38
  wheelZoom: string;
39
39
  };
@@ -8,7 +8,7 @@ export interface ViewSettings {
8
8
  /** 자유선/붓→폴리곤 단순화 강도(RDP epsilon, 이미지 px). 높을수록 점이 적어짐. */
9
9
  simplifyStrength: number;
10
10
  showGuide: boolean;
11
- showRoi: boolean;
11
+ showRegionMask: boolean;
12
12
  keepZoomOnImageChange: boolean;
13
13
  wheelZoom: boolean;
14
14
  }