@aivex/ui 1.2.0-dev.1 → 1.2.0-dev.3

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 (82) hide show
  1. package/dist/Button-C_GP2mJ-.cjs +2 -0
  2. package/dist/Button-C_GP2mJ-.cjs.map +1 -0
  3. package/dist/Button-CzqDPqUT.js +8600 -0
  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/Icon/index.d.ts +5 -4
  27. package/dist/components/Logo/index.d.ts +2 -1
  28. package/dist/components/Messagebox/Messagebox.d.ts +3 -1
  29. package/dist/components/ShapeEditor/ShapeEditor.d.ts +9 -0
  30. package/dist/components/ShapeEditor/_components/AssistantOverlay.d.ts +17 -0
  31. package/dist/components/ShapeEditor/_components/ContextMenu.d.ts +13 -0
  32. package/dist/components/ShapeEditor/_components/CursorGuide.d.ts +8 -0
  33. package/dist/components/ShapeEditor/_components/ImageStateOverlay.d.ts +11 -0
  34. package/dist/components/ShapeEditor/_components/Minimap.d.ts +45 -0
  35. package/dist/components/ShapeEditor/_components/MinimapShape.d.ts +6 -0
  36. package/dist/components/ShapeEditor/_components/RoiOverlay.d.ts +21 -0
  37. package/dist/components/ShapeEditor/_components/SelectionInfo.d.ts +13 -0
  38. package/dist/components/ShapeEditor/_components/SettingsPanel.d.ts +15 -0
  39. package/dist/components/ShapeEditor/_constants.d.ts +33 -0
  40. package/dist/components/ShapeEditor/_model/brush.d.ts +3 -0
  41. package/dist/components/ShapeEditor/_model/cursors.d.ts +18 -0
  42. package/dist/components/ShapeEditor/_model/geometry.d.ts +128 -0
  43. package/dist/components/ShapeEditor/_model/imageTiles.d.ts +11 -0
  44. package/dist/components/ShapeEditor/_model/keymap.d.ts +15 -0
  45. package/dist/components/ShapeEditor/_model/konva.d.ts +4 -0
  46. package/dist/components/ShapeEditor/_model/overlays.d.ts +55 -0
  47. package/dist/components/ShapeEditor/_model/pinIcon.d.ts +13 -0
  48. package/dist/components/ShapeEditor/_model/props.d.ts +409 -0
  49. package/dist/components/ShapeEditor/_model/scalarMask.d.ts +21 -0
  50. package/dist/components/ShapeEditor/_model/shapeRenderStyle.d.ts +16 -0
  51. package/dist/components/ShapeEditor/_model/strings.d.ts +55 -0
  52. package/dist/components/ShapeEditor/_model/tools.d.ts +27 -0
  53. package/dist/components/ShapeEditor/_model/viewSettings.d.ts +15 -0
  54. package/dist/components/ShapeEditor/_model/viewport.d.ts +28 -0
  55. package/dist/components/ShapeEditor/_renderers/KonvaRenderer.d.ts +117 -0
  56. package/dist/components/ShapeEditor/_renderers/PixiRenderer.d.ts +163 -0
  57. package/dist/components/ShapeEditor/_renderers/transformSession.d.ts +63 -0
  58. package/dist/components/ShapeEditor/_renderers/types.d.ts +94 -0
  59. package/dist/components/ShapeEditor/_state/createInteractionController.d.ts +54 -0
  60. package/dist/components/ShapeEditor/_state/drawSessionState.d.ts +6 -0
  61. package/dist/components/ShapeEditor/_state/useAssistant.d.ts +48 -0
  62. package/dist/components/ShapeEditor/_state/useDrawSession.d.ts +60 -0
  63. package/dist/components/ShapeEditor/_state/useEditorDocument.d.ts +23 -0
  64. package/dist/components/ShapeEditor/_state/useEditorHotkeys.d.ts +23 -0
  65. package/dist/components/ShapeEditor/_state/useEngineLifecycle.d.ts +48 -0
  66. package/dist/components/ShapeEditor/_state/useMinimapNavigation.d.ts +27 -0
  67. package/dist/components/ShapeEditor/_state/useMinimapSync.d.ts +24 -0
  68. package/dist/components/ShapeEditor/_state/useSelectionActions.d.ts +29 -0
  69. package/dist/components/ShapeEditor/_state/useViewportControls.d.ts +23 -0
  70. package/dist/components/ShapeEditor/index.d.ts +6 -0
  71. package/dist/components/Slider/Slider.d.ts +3 -1
  72. package/dist/index.cjs +6 -46
  73. package/dist/index.cjs.map +1 -1
  74. package/dist/index.d.ts +1 -0
  75. package/dist/index.js +3276 -14817
  76. package/dist/index.js.map +1 -1
  77. package/dist/shape-editor.cjs +2 -0
  78. package/dist/shape-editor.cjs.map +1 -0
  79. package/dist/shape-editor.js +5315 -0
  80. package/dist/shape-editor.js.map +1 -0
  81. package/dist/styles.css +1 -1
  82. package/package.json +20 -2
@@ -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
+ };
@@ -206,11 +206,11 @@ export declare const Zoom100Icon: ({ size, color, className, ...props }: IconPro
206
206
  export declare const ZoomInIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
207
207
  export declare const ZoomOutIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
208
208
  export declare const PackageIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
209
- export declare const ControlIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
209
+ export declare const ArrowControlIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
210
210
  export declare const TagIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
211
211
  export declare const TagFilledIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
212
212
  export declare const AtIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
213
- export declare const ReadedMailIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
213
+ export declare const OpenedMailIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
214
214
  export declare const TestIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
215
215
  export declare const MinimizeIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
216
216
  export declare const StorageIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -274,8 +274,6 @@ export declare const HourglassIcon: ({ size, color, className, ...props }: IconP
274
274
  export declare const ThumbsUpIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
275
275
  export declare const ThumbsDownIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
276
276
  export declare const ThumbsDownFilledIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
277
- export declare const PageMinimizeIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
278
- export declare const PageMaximizeIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
279
277
  export declare const PageIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
280
278
  export declare const MinimizeWindowIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
281
279
  export declare const TaskQueueIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -283,4 +281,7 @@ export declare const ShrinkIcon: ({ size, color, className, ...props }: IconProp
283
281
  export declare const ExpandIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
284
282
  export declare const AiVotIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
285
283
  export declare const AiViewIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
284
+ export declare const HeadphonesIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
285
+ export declare const LinkedInIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
286
+ export declare const PhoneIcon: ({ size, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
286
287
  export {};
@@ -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;
@@ -5,8 +5,10 @@ declare const messageboxVariants: (props?: ({
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export interface MessageboxProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof messageboxVariants> {
7
7
  message: string;
8
+ subText?: ReactNode;
8
9
  children?: ReactNode;
10
+ onClose?: () => void;
9
11
  ref?: Ref<HTMLDivElement>;
10
12
  }
11
- declare function Messagebox({ className, type, message, children, ref, ...props }: MessageboxProps): import("react/jsx-runtime").JSX.Element;
13
+ declare function Messagebox({ className, type, message, subText, children, onClose, ref, ...props }: MessageboxProps): import("react/jsx-runtime").JSX.Element;
12
14
  export { Messagebox, messageboxVariants };
@@ -0,0 +1,9 @@
1
+ import type { ShapeEditorProps } from "./_model/props";
2
+ /**
3
+ * ShapeEditor — renderer backend 기반 도형 에디터. 상호작용/문서/키보드/메뉴는 여기서 소유하고,
4
+ * 그리기·히트테스트·뷰포트는 `EditorRenderer`(Konva/Pixi)에 위임한다. `backend`로 교체.
5
+ * 갭(회전/꼭짓점추가 등)은 여기서 한 번 구현하면 양쪽 렌더러에 적용된다.
6
+ */
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, rois, excludedZones, guideMask, maskPalette, overlayMarkers, renderOverlayMarker, onOverlayMarkerClick, renderImageOverlay, getSelectionLabel, hideSelectionLabelDot, formatSelectionInfo, externalTools, assistant, keymap, handleRef, backend, onActiveToolChange, onSelectionChange, onEditingChange, onShapesCreated, onShapesUpdated, onShapesDeleted, onDrawSessionChange, onViewportChange, }: ShapeEditorProps<TMeta, TMarkerMeta> & {
8
+ backend?: "konva" | "pixi";
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { AssistantPromptPoint } from "../_model/props";
2
+ import type { AssistantStatus } from "../_state/useAssistant";
3
+ export declare function AssistantOverlay({ image, points, boxes, status, }: {
4
+ image: {
5
+ w: number;
6
+ h: number;
7
+ };
8
+ points: AssistantPromptPoint[];
9
+ /** 진행 중인 박스 프롬프트들(병렬 요청 — 각각 shimmer 표시). */
10
+ boxes: {
11
+ x: number;
12
+ y: number;
13
+ width: number;
14
+ height: number;
15
+ }[];
16
+ status: AssistantStatus;
17
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import type { ContextMenuItem } from "../_model/props";
2
+ export type { ContextMenuItem };
3
+ /**
4
+ * 캔버스 우클릭 컨텍스트 메뉴(도메인 무관). 항목/위치는 호출부가 결정한다.
5
+ * @aivex/ui Menu(Radix Dropdown)를 커서 위치의 0크기 트리거에 앵커해 띄운다.
6
+ * 바깥 클릭·Escape·스크롤 닫힘은 Radix가 onOpenChange로 처리한다(비모달).
7
+ */
8
+ export declare function ContextMenu({ x, y, items, onClose, }: {
9
+ x: number;
10
+ y: number;
11
+ items: ContextMenuItem[];
12
+ onClose: () => void;
13
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 마우스 위치에 십자 가이드라인을 그리는 오버레이(도메인 무관).
3
+ * 부모(컨테이너)를 채우고 pointer-events 없음 → 캔버스 상호작용 방해 안 함.
4
+ * 고빈도(mousemove)라 React state 없이 line ref를 명령형 갱신.
5
+ */
6
+ export declare function CursorGuide({ color }: {
7
+ color?: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from "react";
2
+ /**
3
+ * 이미지 로딩/에러 상태 오버레이. 에디터 영역 전체를 덮는다.
4
+ * 호스트가 renderImageState로 커스텀하지 않으면 기본 스피너/에러 메시지를 그린다.
5
+ */
6
+ export declare function ImageStateOverlay({ status, render, loadingLabel, errorLabel, }: {
7
+ status: "loading" | "error";
8
+ render?: (status: "loading" | "error") => ReactNode;
9
+ loadingLabel?: string;
10
+ errorLabel?: string;
11
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import type { RefObject } from "react";
2
+ import { type EditorShape } from "../_model/geometry";
3
+ import type { ExcludedZone, RoiRect } from "../_model/overlays";
4
+ import { type EditorStrings } from "../_model/strings";
5
+ import type { ViewSettings } from "../_model/viewSettings";
6
+ import type { MinimapNavigation } from "../_state/useMinimapNavigation";
7
+ /**
8
+ * 미니맵 패널(좌하단) — 축소 이미지 + 가이드마스크/ROI 오버레이 + 도형 미리보기 +
9
+ * 현재 뷰포트 사각형 + 줌 컨트롤 바 + 보기설정 팝오버.
10
+ *
11
+ * 내비게이션 로직(패닝/줌)은 useMinimapNavigation(nav)에, 뷰포트 사각형/줌라벨의 실시간
12
+ * 갱신은 호스트의 syncMinimap이 rectRef/zoomLabelRef로 담당한다. 여긴 순수 표시.
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, }: {
15
+ image: {
16
+ w: number;
17
+ h: number;
18
+ };
19
+ imageUrl: string;
20
+ /** 메인 캔버스와 동기화된 표시 여부 — 전환 시 즉시 숨기고 로드 후 페이드인. */
21
+ imageVisible?: boolean;
22
+ maskDataUrl: string | null;
23
+ rois?: RoiRect[];
24
+ excludedZones?: ExcludedZone[];
25
+ roiMaskId: string;
26
+ shapes: EditorShape<TMeta>[];
27
+ view: ViewSettings;
28
+ onChangeView: (patch: Partial<ViewSettings>) => void;
29
+ nav: MinimapNavigation;
30
+ registerShape: (id: string, el: SVGElement | null) => void;
31
+ rectRef: RefObject<HTMLDivElement | null>;
32
+ zoomLabelRef: RefObject<HTMLSpanElement | null>;
33
+ onZoom100: () => void;
34
+ open: boolean;
35
+ onToggleOpen: () => void;
36
+ /** 보기설정(기어) 버튼 표시 여부(기본 true). */
37
+ showSettings?: boolean;
38
+ settingsOpen: boolean;
39
+ onToggleSettings: () => void;
40
+ onCloseSettings: () => void;
41
+ /** UI 문자열(aria/버튼). 기본 한국어. */
42
+ labels?: EditorStrings["minimap"];
43
+ /** 설정 팝오버 문자열. 기본 한국어. */
44
+ settingsLabels?: EditorStrings["viewSettings"];
45
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { EditorShape } from "../_model/geometry";
2
+ export declare function MinimapShape<TMeta>({ shape, strokeSize, register, }: {
3
+ shape: EditorShape<TMeta>;
4
+ strokeSize?: number;
5
+ register?: (id: string, el: SVGElement | null) => void;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import type { CSSProperties } from "react";
2
+ import type { ExcludedZone, RoiRect } from "../_model/overlays";
3
+ /**
4
+ * ROI(어둡게 처리)/제외영역 오버레이 SVG. 캔버스 오버레이와 미니맵이 공유한다.
5
+ * ROI 밖을 반투명 검정으로 덮고, 제외영역은 다시 뚫으며, 경계선을 점선으로 그린다.
6
+ * 좌표계는 이미지 좌표(viewBox=image), 화면 크기/선 두께는 호출부가 정한다.
7
+ */
8
+ export declare function RoiOverlay({ image, rois, excludedZones, maskId, width, height, strokeWidth, strokeDasharray, style, }: {
9
+ image: {
10
+ w: number;
11
+ h: number;
12
+ };
13
+ rois: RoiRect[];
14
+ excludedZones?: ExcludedZone[];
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;
@@ -0,0 +1,13 @@
1
+ import { type EditorShape, type Point } from "../_model/geometry";
2
+ import type { EditorSelectionInfo } from "../_model/props";
3
+ /** shape + 실제 좌표(points)로 selection info 데이터를 만든다(에디터 계산분). */
4
+ export declare function buildSelectionInfo<TMeta>(shape: EditorShape<TMeta>, points: Point[]): EditorSelectionInfo<TMeta>;
5
+ /** formatSelectionInfo 미지정 시 기본 텍스트. */
6
+ export declare function defaultSelectionInfoText<TMeta>(info: EditorSelectionInfo<TMeta>): string;
7
+ export declare function SelectionInfo<TMeta>({ shapes, getLabel, hideDot, formatInfo, register, }: {
8
+ shapes: EditorShape<TMeta>[];
9
+ getLabel?: (shape: EditorShape<TMeta>) => string | undefined;
10
+ hideDot?: boolean;
11
+ formatInfo?: (info: EditorSelectionInfo<TMeta>) => string;
12
+ register: (id: string, el: HTMLDivElement | null) => void;
13
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { type EditorStrings } from "../_model/strings";
2
+ import { type ViewSettings } from "../_model/viewSettings";
3
+ export { DEFAULT_VIEW_SETTINGS, type ViewSettings, } from "../_model/viewSettings";
4
+ /**
5
+ * 미니맵 기어 버튼에서 열리는 보기 설정 팝오버(도메인 무관).
6
+ * 바깥 클릭/Esc로 닫힘. 값은 호출부가 소유하고 onChange로 부분 갱신.
7
+ * 컨트롤은 @aivex/ui(Button/Slider/Switch/Divider)로 렌더한다.
8
+ */
9
+ export declare function SettingsPanel({ value, onChange, onClose, labels, }: {
10
+ value: ViewSettings;
11
+ onChange: (patch: Partial<ViewSettings>) => void;
12
+ onClose: () => void;
13
+ /** UI 문자열. 기본 한국어. */
14
+ labels?: EditorStrings["viewSettings"];
15
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ export declare const MIN_SCALE = 0.1;
2
+ export declare const MAX_SCALE = 10;
3
+ export declare const ZOOM_FACTOR = 1.1;
4
+ export declare const POINT_RADIUS = 5;
5
+ export declare const HANDLE_RADIUS = 5;
6
+ export declare const HANDLE_SQUARE = 8;
7
+ export declare const HANDLE_NAME = "v2-handle";
8
+ export declare const FIXED_NAME = "v2-fixed";
9
+ export declare const HANDLE_COLOR = "#1e88e5";
10
+ export declare const POLY_CLOSE_PX = 12;
11
+ export declare const ROTATE_GAP_PX = 28;
12
+ export declare const NUDGE_PX = 1;
13
+ export declare const NUDGE_BIG_PX = 10;
14
+ export declare const DUPLICATE_OFFSET_PX = 12;
15
+ export declare const ROTATE_SNAP_RAD: number;
16
+ export declare const MINIMAP_SIZE = 180;
17
+ export declare const MINIMAP_VP_STROKE = "#00ff00";
18
+ export declare const MINIMAP_VP_FILL = "rgba(0, 255, 0, 0.1)";
19
+ export declare const DEFAULT_COLOR = "#00e5ff";
20
+ export declare const SELECTED_COLOR = "#ffffff";
21
+ export declare const STROKE_SIZE = 2;
22
+ export declare const SELECTION_BORDER_COLOR = "#669DEF";
23
+ export declare const SELECTION_BORDER_PAD = 3;
24
+ export declare const SELECTION_AREA_COLOR = "#669DEF";
25
+ export declare const SELECTION_AREA_FILL_ALPHA = 0.1;
26
+ export declare const FILL_ALPHA_HEX = "20";
27
+ export declare const FILL_ALPHA: number;
28
+ export declare const ROI_BORDER_COLOR = "#ffffff";
29
+ export declare const ROI_BORDER_WIDTH = 2;
30
+ export declare const ROI_BORDER_DASH: [number, number];
31
+ export declare const STRIPED_OPACITY = 0.7;
32
+ export declare const STRIPED_STROKE_SCALE = 2.5;
33
+ export declare const STRIPED_DASH_GAP_SCALE = 2;
@@ -0,0 +1,3 @@
1
+ import type { Point } from "./geometry";
2
+ /** RDP 경로 단순화(이미지 좌표). */
3
+ export declare function simplifyPath(points: Point[], epsilon?: number): Point[];
@@ -0,0 +1,18 @@
1
+ import type { Anchor } from "./geometry";
2
+ import { type Tool } from "./tools";
3
+ export declare function resizeCursorForAnchor(anchor: Anchor, angleRad?: number): string;
4
+ export declare function cursorForTool({ tool, externalToolCursor, isSpacePressed, isPolygonDrawing, }: {
5
+ tool: Tool;
6
+ externalToolCursor?: string;
7
+ isSpacePressed: boolean;
8
+ isPolygonDrawing: boolean;
9
+ }): string;
10
+ export type EditorInteractionMode = "idle" | "drawing" | "marquee" | "moving" | "panning" | "resizing" | "rotating" | "vertexDragging";
11
+ export declare function resolveEditorCursor({ tool, externalToolCursor, isSpacePressed, interactionMode, rendererCursorHint, isPolygonDrawing, }: {
12
+ tool: Tool;
13
+ externalToolCursor?: string;
14
+ isSpacePressed: boolean;
15
+ interactionMode: EditorInteractionMode;
16
+ rendererCursorHint?: string | null;
17
+ isPolygonDrawing: boolean;
18
+ }): string;
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Editor의 도메인 무관 기하/도형 모델.
3
+ *
4
+ * 이 에디터는 "색 입힌 도형을 그리고 편집"할 뿐, 클래스/라벨/태스크 같은 라벨링 도메인
5
+ * 개념을 모른다. 분류 정보(classId 등)는 호스트가 `meta`에 담아 넘기면 에디터는 건드리지
6
+ * 않고 그대로 되돌려준다. 렌더에 필요한 색/채움은 `style`로 받는다.
7
+ */
8
+ export interface Point {
9
+ x: number;
10
+ y: number;
11
+ }
12
+ export declare const SHAPE_TYPE: {
13
+ readonly POINT: "POINT";
14
+ readonly RECTANGLE: "RECTANGLE";
15
+ readonly ROTATED_RECTANGLE: "ROTATED_RECTANGLE";
16
+ readonly POLYGON: "POLYGON";
17
+ readonly ELLIPSE: "ELLIPSE";
18
+ readonly LINE: "LINE";
19
+ };
20
+ export type ShapeType = (typeof SHAPE_TYPE)[keyof typeof SHAPE_TYPE];
21
+ /** 도형 렌더 힌트. 호스트가 (예: 클래스→색) 계산해 주입한다. */
22
+ export interface ShapeStyle {
23
+ color?: string;
24
+ filled?: boolean;
25
+ opacity?: number;
26
+ /** 도형별 선 두께(화면 px). 없으면 에디터 기본값을 사용한다. */
27
+ strokeWidth?: number;
28
+ /** 채움 투명도(0~1). 없으면 렌더러 기본값을 사용한다. */
29
+ fillOpacity?: number;
30
+ /** 점선 패턴(화면 px). */
31
+ dash?: number[];
32
+ /** POINT 도형 반경(화면 px). */
33
+ pointRadius?: number;
34
+ /** 렌더 순서. 없으면 문서 배열 순서를 따른다. */
35
+ zIndex?: number;
36
+ }
37
+ export interface ShapeInteraction {
38
+ /** false면 렌더하지 않고 hit-test/선택/편집에서도 제외한다. */
39
+ visible?: boolean;
40
+ /** false면 도형 클릭·마퀴·선택 API에서 선택 대상이 되지 않는다. */
41
+ selectable?: boolean;
42
+ /** false면 본체 드래그 이동을 막는다. */
43
+ draggable?: boolean;
44
+ /** false면 트랜스포머/꼭짓점 편집/삭제 같은 문서 변경 편집을 막는다. */
45
+ editable?: boolean;
46
+ /** true면 렌더는 하되 포인터 hit-test 대상에서 제외한다. */
47
+ hitTestDisabled?: boolean;
48
+ }
49
+ /**
50
+ * 에디터가 그리고 편집하는 단위.
51
+ * - POINT: points 1개, RECTANGLE·ELLIPSE: 2개(대각 bbox), ROTATED_RECTANGLE: 4개,
52
+ * POLYGON: N개(닫힘), LINE: N개(열린 폴리라인/자유곡선).
53
+ * - id: **클라이언트 생성**(에디터가 도형 생성 시 부여). 서버 id는 에디터가 모른다 —
54
+ * 호스트가 clientId↔serverId 매핑을 들거나 meta에 보관한다.
55
+ * - meta: 호스트 전용 불투명 데이터(classId, serverId 등). 에디터는 읽지 않고 보존만 한다.
56
+ * - style: 렌더 힌트(색/채움). 호스트가 클래스→색을 계산해 주입/시드한다.
57
+ */
58
+ export interface EditorShape<TMeta = unknown> {
59
+ id: string;
60
+ type: ShapeType;
61
+ points: Point[];
62
+ rotation?: number;
63
+ /**
64
+ * 편집 불가(예: 모델 예측/평가 도형). 하위 호환 shorthand이며 selectable은 유지하고
65
+ * draggable/editable만 false처럼 취급한다.
66
+ */
67
+ readOnly?: boolean;
68
+ interaction?: ShapeInteraction;
69
+ style?: ShapeStyle;
70
+ meta?: TMeta;
71
+ }
72
+ export interface Viewport {
73
+ scale: number;
74
+ position: Point;
75
+ }
76
+ export declare function isShapeVisible(shape: EditorShape): boolean;
77
+ export declare function isShapeHitTestable(shape: EditorShape): boolean;
78
+ export declare function isShapeSelectable(shape: EditorShape): boolean;
79
+ export declare function isShapeEditable(shape: EditorShape): boolean;
80
+ export declare function isShapeDraggable(shape: EditorShape): boolean;
81
+ export declare function sortShapesForRender<TMeta>(shapes: EditorShape<TMeta>[]): EditorShape<TMeta>[];
82
+ export declare function clamp(value: number, min: number, max: number): number;
83
+ export declare function generateId(): string;
84
+ export interface BBox {
85
+ minX: number;
86
+ minY: number;
87
+ maxX: number;
88
+ maxY: number;
89
+ }
90
+ export type Anchor = "tl" | "t" | "tr" | "r" | "br" | "b" | "bl" | "l";
91
+ export declare const ANCHORS: Anchor[];
92
+ export declare function getBBox(points: Point[]): BBox;
93
+ export declare function anchorPoint(anchor: Anchor, b: BBox): Point;
94
+ export declare function boxFromAnchor(anchor: Anchor, b: BBox, hx: number, hy: number): BBox;
95
+ export declare function squareEnd(start: Point, p: Point): Point;
96
+ export declare function rotatePoint(p: Point, pivot: Point, angle: number): Point;
97
+ export declare function rectTo4(points: Point[]): Point[];
98
+ /**
99
+ * 두 점(a,b)이 이루는 바운딩 박스에 **내접하는 타원**을 폴리곤으로 샘플링한다.
100
+ * 그리기 미리보기(previewBox "ellipse": rx=w/2, ry=h/2)와 동일한 도형이어야 커밋 결과가
101
+ * 드래그 중 보이던 것과 일치한다(정사각형 드래그면 원). 예전엔 대각선을 지름으로 한 원을
102
+ * 만들어 미리보기(내접 타원)와 크기·모양이 달랐다.
103
+ */
104
+ export declare function circleToPolygon(a: Point, b: Point, count?: number): Point[];
105
+ /**
106
+ * 볼록 껍질(Andrew monotone chain). 입력 점들의 볼록 다각형 코너를 반시계로 반환.
107
+ * 3점 미만이면 입력을 그대로 돌려준다(최소사각형 계산의 전처리용).
108
+ */
109
+ export declare function convexHull(points: Point[]): Point[];
110
+ /**
111
+ * 최소 넓이 회전 사각형(rotating calipers). 점들을 감싸는 넓이 최소의 (기울 수 있는)
112
+ * 사각형 4개 코너를 둘레 순서로 반환한다. OBB(회전 바운딩박스) 어시스트 결과 변환용.
113
+ * 최소사각형의 한 변은 반드시 볼록껍질의 한 변과 평행하다는 성질을 이용한다.
114
+ */
115
+ export declare function minAreaRect(points: Point[]): Point[];
116
+ export declare const vsub: (a: Point, b: Point) => Point;
117
+ export declare const vdot: (a: Point, b: Point) => number;
118
+ export declare const vlen: (a: Point) => number;
119
+ export declare const vnorm: (a: Point) => Point;
120
+ export declare const mid: (a: Point, b: Point) => Point;
121
+ export declare const centerOf: (pts: Point[]) => Point;
122
+ export declare function orientedHandles(c: Point[]): Point[];
123
+ export declare function rotateHandlePos(c: Point[], gap: number): Point;
124
+ /** 회전 사각형 위변(tl→tr) 각도(라디안). */
125
+ export declare function rotatedRectAngle(points: Point[]): number;
126
+ export declare function localBoxToCorners(box: BBox, R: Point, u: Point, v: Point): Point[];
127
+ export declare function resizeRotatedRectFromAnchor(points: Point[], anchor: Anchor, target: Point): Point[];
128
+ export declare function rescalePoints(points: Point[], from: BBox, to: BBox): Point[];
@@ -0,0 +1,11 @@
1
+ export declare const IMAGE_TILE_SIZE = 4000;
2
+ export interface ImageTile {
3
+ x: number;
4
+ y: number;
5
+ width: number;
6
+ height: number;
7
+ srcX: number;
8
+ srcY: number;
9
+ }
10
+ export declare function getImageTiles(width: number, height: number, tileSize?: number): ImageTile[];
11
+ export declare function createImageTileCanvas(image: HTMLImageElement, tile: ImageTile): HTMLCanvasElement;