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

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 (98) hide show
  1. package/dist/{Switch-c8rHebeK.js → Button-B6WM7faP.js} +2345 -4756
  2. package/dist/Button-B6WM7faP.js.map +1 -0
  3. package/dist/Button-C4WtB38c.cjs +2 -0
  4. package/dist/Button-C4WtB38c.cjs.map +1 -0
  5. package/dist/IconButton-CuO-3IXh.cjs +2 -0
  6. package/dist/IconButton-CuO-3IXh.cjs.map +1 -0
  7. package/dist/IconButton-pgdAaijX.js +560 -0
  8. package/dist/IconButton-pgdAaijX.js.map +1 -0
  9. package/dist/Switch-CtjEelTs.cjs +42 -0
  10. package/dist/Switch-CtjEelTs.cjs.map +1 -0
  11. package/dist/Switch-rKD8bdwo.js +2537 -0
  12. package/dist/Switch-rKD8bdwo.js.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/Badge/Badge.d.ts +8 -1
  18. package/dist/components/Coachmark/Coachmark.d.ts +54 -0
  19. package/dist/components/Coachmark/index.d.ts +2 -0
  20. package/dist/components/Comment/CommentInput.d.ts +30 -0
  21. package/dist/components/Comment/CommentPin.d.ts +17 -0
  22. package/dist/components/Comment/MentionInput.d.ts +30 -0
  23. package/dist/components/Comment/MentionList.d.ts +14 -0
  24. package/dist/components/Comment/index.d.ts +4 -0
  25. package/dist/components/Comment/types.d.ts +12 -0
  26. package/dist/components/Comment/useMentionSuggestion.d.ts +15 -0
  27. package/dist/components/DataGrid/DataGrid.d.ts +29 -71
  28. package/dist/components/DataGrid/DataGridColumnSettings.d.ts +18 -0
  29. package/dist/components/DataGrid/DataGridPrimitives.d.ts +77 -0
  30. package/dist/components/DataGrid/DataGridRows.d.ts +25 -0
  31. package/dist/components/DataGrid/index.d.ts +6 -2
  32. package/dist/components/DatePicker/DatePicker.d.ts +8 -18
  33. package/dist/components/DatePicker/date.d.ts +1 -0
  34. package/dist/components/DatePicker/index.d.ts +1 -1
  35. package/dist/components/Icon/index.d.ts +3 -1
  36. package/dist/components/InputBase/InputBase.d.ts +5 -7
  37. package/dist/components/Logo/index.d.ts +2 -1
  38. package/dist/components/Modal/Modal.d.ts +9 -2
  39. package/dist/components/Modal/index.d.ts +1 -1
  40. package/dist/components/SelectBox/SelectBox.d.ts +7 -4
  41. package/dist/components/SelectButton/SelectButton.d.ts +18 -0
  42. package/dist/components/SelectButton/index.d.ts +2 -0
  43. package/dist/components/ShapeEditor/ShapeEditor.d.ts +1 -1
  44. package/dist/components/ShapeEditor/ShapeViewer.d.ts +42 -0
  45. package/dist/components/ShapeEditor/_components/ContextMenu.d.ts +1 -1
  46. package/dist/components/ShapeEditor/_components/Minimap.d.ts +10 -6
  47. package/dist/components/ShapeEditor/_components/MinimapShape.d.ts +2 -2
  48. package/dist/components/ShapeEditor/_components/RegionOverlay.d.ts +21 -0
  49. package/dist/components/ShapeEditor/_components/SelectionInfo.d.ts +4 -1
  50. package/dist/components/ShapeEditor/_components/SettingsPanel.d.ts +4 -2
  51. package/dist/components/ShapeEditor/_constants.d.ts +7 -4
  52. package/dist/components/ShapeEditor/_model/clipboard.d.ts +22 -0
  53. package/dist/components/ShapeEditor/_model/clipboard.test.d.ts +1 -0
  54. package/dist/components/ShapeEditor/_model/geometry.d.ts +22 -1
  55. package/dist/components/ShapeEditor/_model/geometry.test.d.ts +1 -0
  56. package/dist/components/ShapeEditor/_model/imageFetch.d.ts +9 -0
  57. package/dist/components/ShapeEditor/_model/keymap.d.ts +1 -1
  58. package/dist/components/ShapeEditor/_model/overlays.d.ts +82 -15
  59. package/dist/components/ShapeEditor/_model/overlays.test.d.ts +1 -0
  60. package/dist/components/ShapeEditor/_model/props.d.ts +96 -22
  61. package/dist/components/ShapeEditor/_model/strings.d.ts +2 -3
  62. package/dist/components/ShapeEditor/_model/viewSettings.d.ts +3 -1
  63. package/dist/components/ShapeEditor/_renderers/KonvaRenderer.d.ts +28 -7
  64. package/dist/components/ShapeEditor/_renderers/PixiRenderer.d.ts +38 -11
  65. package/dist/components/ShapeEditor/_renderers/transformSession.d.ts +5 -0
  66. package/dist/components/ShapeEditor/_renderers/types.d.ts +36 -10
  67. package/dist/components/ShapeEditor/_state/createInteractionController.d.ts +4 -0
  68. package/dist/components/ShapeEditor/_state/useDrawSession.d.ts +2 -1
  69. package/dist/components/ShapeEditor/_state/useEditorHotkeys.d.ts +2 -0
  70. package/dist/components/ShapeEditor/_state/useEngineLifecycle.d.ts +38 -11
  71. package/dist/components/ShapeEditor/_state/useEngineLifecycle.test.d.ts +1 -0
  72. package/dist/components/ShapeEditor/_state/useSelectionActions.d.ts +6 -5
  73. package/dist/components/ShapeEditor/index.d.ts +3 -1
  74. package/dist/components/Slider/Slider.d.ts +3 -1
  75. package/dist/components/Spinner/Spinner.d.ts +15 -0
  76. package/dist/components/Spinner/index.d.ts +2 -0
  77. package/dist/components/Switch/Switch.d.ts +2 -1
  78. package/dist/components/Tagbox/Tagbox.d.ts +1 -4
  79. package/dist/components/Textarea/Textarea.d.ts +7 -4
  80. package/dist/components/Textbox/Textbox.d.ts +1 -5
  81. package/dist/components/Toast/Toast.d.ts +12 -2
  82. package/dist/components/Toast/index.d.ts +1 -1
  83. package/dist/index.cjs +13 -6
  84. package/dist/index.cjs.map +1 -1
  85. package/dist/index.d.ts +3 -0
  86. package/dist/index.js +6430 -3709
  87. package/dist/index.js.map +1 -1
  88. package/dist/shape-editor.cjs +1 -1
  89. package/dist/shape-editor.cjs.map +1 -1
  90. package/dist/shape-editor.js +2977 -2053
  91. package/dist/shape-editor.js.map +1 -1
  92. package/dist/styles.css +1 -1
  93. package/dist/tokens/tokens.css +611 -611
  94. package/package.json +25 -2
  95. package/dist/Switch-DX-FkCbT.cjs +0 -42
  96. package/dist/Switch-DX-FkCbT.cjs.map +0 -1
  97. package/dist/Switch-c8rHebeK.js.map +0 -1
  98. package/dist/components/ShapeEditor/_components/RoiOverlay.d.ts +0 -21
@@ -1,13 +1,19 @@
1
1
  import { type ReactNode, type Ref } from "react";
2
2
  import { type ButtonProps } from "@/components/Button";
3
+ import type { IconButtonProps } from "@/components/IconButton";
3
4
  type ModalOpenAutoFocusHandler = (event: Event) => void;
4
5
  export type ModalSize = "sm" | "md" | "lg" | "xl" | "full";
6
+ export interface ModalHeadingButtonProps extends Omit<IconButtonProps, "asChild" | "children" | "className" | "ref" | "shape" | "size"> {
7
+ "aria-label": string;
8
+ children: ReactNode;
9
+ }
5
10
  export interface ModalButtonProps extends Omit<ButtonProps, "asChild" | "children" | "className" | "color" | "ref" | "size" | "style" | "variant"> {
6
11
  children: ReactNode;
7
12
  }
8
13
  export interface ModalSurfaceProps {
9
14
  title: ReactNode;
10
15
  description?: ReactNode;
16
+ headingButton?: ModalHeadingButtonProps;
11
17
  children?: ReactNode;
12
18
  tertiaryButton?: ModalButtonProps;
13
19
  secondaryButton?: ModalButtonProps;
@@ -17,13 +23,14 @@ export interface ModalSurfaceProps {
17
23
  closeAriaLabel?: string;
18
24
  ref?: Ref<HTMLDivElement>;
19
25
  }
20
- declare function ModalSurface({ title, description, children, tertiaryButton, secondaryButton, primaryButton, size, onClose, closeAriaLabel, ref, }: ModalSurfaceProps): import("react/jsx-runtime").JSX.Element;
26
+ declare function ModalSurface({ title, description, headingButton, children, tertiaryButton, secondaryButton, primaryButton, size, onClose, closeAriaLabel, ref, }: ModalSurfaceProps): import("react/jsx-runtime").JSX.Element;
21
27
  export interface ModalProps {
22
28
  open?: boolean;
23
29
  defaultOpen?: boolean;
24
30
  onOpenChange?: (open: boolean) => void;
25
31
  title: ReactNode;
26
32
  description?: ReactNode;
33
+ headingButton?: ModalHeadingButtonProps;
27
34
  children?: ReactNode;
28
35
  tertiaryButton?: ModalButtonProps;
29
36
  secondaryButton?: ModalButtonProps;
@@ -33,5 +40,5 @@ export interface ModalProps {
33
40
  onOpenAutoFocus?: ModalOpenAutoFocusHandler;
34
41
  closeAriaLabel?: string;
35
42
  }
36
- declare function Modal({ open, defaultOpen, onOpenChange, title, description, children, tertiaryButton, secondaryButton, primaryButton, size, closeOnInteractOutside, onOpenAutoFocus, closeAriaLabel, }: ModalProps): import("react/jsx-runtime").JSX.Element;
43
+ declare function Modal({ open, defaultOpen, onOpenChange, title, description, headingButton, children, tertiaryButton, secondaryButton, primaryButton, size, closeOnInteractOutside, onOpenAutoFocus, closeAriaLabel, }: ModalProps): import("react/jsx-runtime").JSX.Element;
37
44
  export { Modal, ModalSurface };
@@ -1,2 +1,2 @@
1
- export type { ModalButtonProps, ModalProps, ModalSize, ModalSurfaceProps } from "./Modal";
1
+ export type { ModalButtonProps, ModalHeadingButtonProps, ModalProps, ModalSize, ModalSurfaceProps, } from "./Modal";
2
2
  export { Modal, ModalSurface } from "./Modal";
@@ -1,3 +1,4 @@
1
+ import { type AriaAttributes } from "react";
1
2
  export interface SelectBoxOption {
2
3
  value: string;
3
4
  label: string;
@@ -26,11 +27,13 @@ export interface SelectBoxProps {
26
27
  * @example renderValue={(option, group) => `${group.title} / ${option.label}`}
27
28
  */
28
29
  renderValue?: (option: SelectBoxOption, group: SelectBoxGroup) => string;
29
- /** 최외곽 래퍼에 추가할 className */
30
+ /** 트리거 버튼에 추가할 className */
30
31
  className?: string;
31
- label?: string;
32
- helperText?: string;
33
32
  error?: boolean;
33
+ /** Field(FieldControl)가 주입하는 id — FieldLabel(htmlFor) 연결용 */
34
+ id?: string;
35
+ "aria-describedby"?: string;
36
+ "aria-invalid"?: AriaAttributes["aria-invalid"];
34
37
  }
35
- declare function SelectBox({ groups, value, placeholder, disabled, size, onChange, renderValue, className, label, helperText, error, }: SelectBoxProps): import("react/jsx-runtime").JSX.Element;
38
+ declare function SelectBox({ groups, value, placeholder, disabled, size, onChange, renderValue, className, error, id, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, }: SelectBoxProps): import("react/jsx-runtime").JSX.Element;
36
39
  export { SelectBox };
@@ -0,0 +1,18 @@
1
+ import type { ButtonHTMLAttributes, ReactNode, Ref } from "react";
2
+ export interface SelectButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
3
+ /** 표시할 선택 값. 없으면 placeholder를 tertiary 색으로 표시 */
4
+ value?: ReactNode;
5
+ placeholder?: string;
6
+ size?: "sm" | "md";
7
+ error?: boolean;
8
+ /** 연결된 팝업(모달·드롭다운 등) 열림 상태 — 포커스 링과 chevron 회전에 반영 */
9
+ open?: boolean;
10
+ ref?: Ref<HTMLButtonElement>;
11
+ }
12
+ /**
13
+ * 셀렉트 트리거와 동일한 외형의 버튼.
14
+ * 드롭다운 대신 모달 등 커스텀 팝업을 여는 "선택" 진입점에 사용한다.
15
+ * SelectBox의 트리거도 이 컴포넌트를 사용한다.
16
+ */
17
+ declare function SelectButton({ value, placeholder, size, error, open, disabled, className, ref, onFocus, onBlur, type, "aria-expanded": ariaExpanded, children, ...props }: SelectButtonProps): import("react/jsx-runtime").JSX.Element;
18
+ export { SelectButton };
@@ -0,0 +1,2 @@
1
+ export type { SelectButtonProps } from "./SelectButton";
2
+ export { SelectButton } from "./SelectButton";
@@ -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>({ document: editorDocument, clipboardScope, renderImageState, dimmed, 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
- import type { RefObject } from "react";
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 const Minimap: import("react").MemoExoticComponent<<TMeta>({ image, imageUrl, imageVisible, loading, maskDataUrl, region, roiMaskId, shapes, view, viewDefaults, 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;
@@ -19,12 +19,16 @@ export declare function Minimap<TMeta>({ image, imageUrl, imageVisible, maskData
19
19
  imageUrl: string;
20
20
  /** 메인 캔버스와 동기화된 표시 여부 — 전환 시 즉시 숨기고 로드 후 페이드인. */
21
21
  imageVisible?: boolean;
22
+ /** 문서 이미지 전환 중에는 패널을 유지하되 이미지 내비게이션만 잠근다. */
23
+ loading?: boolean;
22
24
  maskDataUrl: string | null;
23
- rois?: RoiRect[];
24
- excludedZones?: ExcludedZone[];
25
+ /** 리졸브된 영역 마스크 오버레이(딤·윤곽 벡터). */
26
+ region?: RegionOverlayData | null;
25
27
  roiMaskId: string;
26
28
  shapes: EditorShape<TMeta>[];
27
29
  view: ViewSettings;
30
+ /** "초기화"가 되돌릴 기준값(호스트 기본값 반영). */
31
+ viewDefaults: ViewSettings;
28
32
  onChangeView: (patch: Partial<ViewSettings>) => void;
29
33
  nav: MinimapNavigation;
30
34
  registerShape: (id: string, el: SVGElement | null) => void;
@@ -42,4 +46,4 @@ export declare function Minimap<TMeta>({ image, imageUrl, imageVisible, maskData
42
46
  labels?: EditorStrings["minimap"];
43
47
  /** 설정 팝오버 문자열. 기본 한국어. */
44
48
  settingsLabels?: EditorStrings["viewSettings"];
45
- }): import("react/jsx-runtime").JSX.Element;
49
+ }) => import("react/jsx-runtime").JSX.Element>;
@@ -1,6 +1,6 @@
1
1
  import type { EditorShape } from "../_model/geometry";
2
- export declare function MinimapShape<TMeta>({ shape, strokeSize, register, }: {
2
+ export declare const MinimapShape: import("react").MemoExoticComponent<<TMeta>({ shape, strokeSize, register, }: {
3
3
  shape: EditorShape<TMeta>;
4
4
  strokeSize?: number;
5
5
  register?: (id: string, el: SVGElement | null) => void;
6
- }): import("react/jsx-runtime").JSX.Element;
6
+ }) => import("react/jsx-runtime").JSX.Element>;
@@ -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;
@@ -1,12 +1,15 @@
1
1
  import { type EditorShape, type Point } from "../_model/geometry";
2
2
  import type { EditorSelectionInfo } from "../_model/props";
3
+ /** 드래그 프리뷰 중 레이아웃 변경 없이 라벨과 크기 텍스트를 bbox 모서리로 이동한다. */
4
+ export declare function updateSelectionInfoBounds(el: HTMLDivElement, points: Point[]): HTMLElement | null;
3
5
  /** shape + 실제 좌표(points)로 selection info 데이터를 만든다(에디터 계산분). */
4
6
  export declare function buildSelectionInfo<TMeta>(shape: EditorShape<TMeta>, points: Point[]): EditorSelectionInfo<TMeta>;
5
7
  /** formatSelectionInfo 미지정 시 기본 텍스트. */
6
8
  export declare function defaultSelectionInfoText<TMeta>(info: EditorSelectionInfo<TMeta>): string;
7
- export declare function SelectionInfo<TMeta>({ shapes, getLabel, formatInfo, register, }: {
9
+ export declare function SelectionInfo<TMeta>({ shapes, getLabel, hideDot, formatInfo, register, }: {
8
10
  shapes: EditorShape<TMeta>[];
9
11
  getLabel?: (shape: EditorShape<TMeta>) => string | undefined;
12
+ hideDot?: boolean;
10
13
  formatInfo?: (info: EditorSelectionInfo<TMeta>) => string;
11
14
  register: (id: string, el: HTMLDivElement | null) => void;
12
15
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,15 @@
1
1
  import { type EditorStrings } from "../_model/strings";
2
- import { type ViewSettings } from "../_model/viewSettings";
2
+ import type { ViewSettings } from "../_model/viewSettings";
3
3
  export { DEFAULT_VIEW_SETTINGS, type ViewSettings, } from "../_model/viewSettings";
4
4
  /**
5
5
  * 미니맵 기어 버튼에서 열리는 보기 설정 팝오버(도메인 무관).
6
6
  * 바깥 클릭/Esc로 닫힘. 값은 호출부가 소유하고 onChange로 부분 갱신.
7
7
  * 컨트롤은 @aivex/ui(Button/Slider/Switch/Divider)로 렌더한다.
8
8
  */
9
- export declare function SettingsPanel({ value, onChange, onClose, labels, }: {
9
+ export declare function SettingsPanel({ value, defaults, onChange, onClose, labels, }: {
10
10
  value: ViewSettings;
11
+ /** "초기화"가 되돌릴 기준값 — 호스트 기본값이 반영된 시드. */
12
+ defaults: ViewSettings;
11
13
  onChange: (patch: Partial<ViewSettings>) => void;
12
14
  onClose: () => void;
13
15
  /** UI 문자열. 기본 한국어. */
@@ -13,7 +13,7 @@ export declare const NUDGE_PX = 1;
13
13
  export declare const NUDGE_BIG_PX = 10;
14
14
  export declare const DUPLICATE_OFFSET_PX = 12;
15
15
  export declare const ROTATE_SNAP_RAD: number;
16
- export declare const MINIMAP_SIZE = 180;
16
+ export declare const MINIMAP_SIZE = 204;
17
17
  export declare const MINIMAP_VP_STROKE = "#00ff00";
18
18
  export declare const MINIMAP_VP_FILL = "rgba(0, 255, 0, 0.1)";
19
19
  export declare const DEFAULT_COLOR = "#00e5ff";
@@ -28,6 +28,9 @@ export declare const FILL_ALPHA: number;
28
28
  export declare const ROI_BORDER_COLOR = "#ffffff";
29
29
  export declare const ROI_BORDER_WIDTH = 2;
30
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;
31
+ /**
32
+ * style.dashed 도형 점선 — [칸 배수, 간격 배수].
33
+ * 칸이 선 두께의 2배 미만이면 점처럼 자글거리고 6배 이상이면 짧은 변에서 실선처럼
34
+ * 보인다. 꼭짓점 많은 폴리곤을 감안해 3배·1:1로 둔다.
35
+ */
36
+ export declare const DASHED_SCALE: [number, number];
@@ -0,0 +1,22 @@
1
+ import { type EditorShape } from "./geometry";
2
+ declare const CLIPBOARD_VERSION = 1;
3
+ export interface ShapeClipboardPayload<TMeta = unknown> {
4
+ kind: "aivex-shape-editor";
5
+ version: typeof CLIPBOARD_VERSION;
6
+ scope?: string;
7
+ documentId?: string;
8
+ shapes: EditorShape<TMeta>[];
9
+ }
10
+ export declare function createShapeClipboardPayload<TMeta>(shapes: EditorShape<TMeta>[], documentId?: string, scope?: string): ShapeClipboardPayload<TMeta>;
11
+ /** 원본 URL을 클립보드에 노출하지 않고 같은 문서 여부만 비교하기 위한 짧은 식별자. */
12
+ export declare function createClipboardDocumentId(value: string): string;
13
+ export declare function serializeShapeClipboard(payload: ShapeClipboardPayload): string;
14
+ export declare function parseShapeClipboard<TMeta = unknown>(text: string): ShapeClipboardPayload<TMeta> | null;
15
+ export declare function writeShapeClipboard<TMeta>(payload: ShapeClipboardPayload<TMeta>): void;
16
+ export declare function canReadShapeClipboard(scope?: string): boolean;
17
+ export declare function readShapeClipboard<TMeta>(scope?: string): Promise<ShapeClipboardPayload<TMeta> | null>;
18
+ export declare function getClipboardCascadeOffset(pasteCount: number, isDifferentDocument: boolean, step: number): {
19
+ offset: number;
20
+ nextPasteCount: number;
21
+ };
22
+ export {};
@@ -21,14 +21,21 @@ 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). 없으면 에디터 기본값을 사용한다. */
27
29
  strokeWidth?: number;
28
30
  /** 채움 투명도(0~1). 없으면 렌더러 기본값을 사용한다. */
29
31
  fillOpacity?: number;
30
- /** 점선 패턴(화면 px). */
32
+ /** 점선 패턴(화면 px). 고정값이라 선 두께가 바뀌어도 따라오지 않는다. */
31
33
  dash?: number[];
34
+ /**
35
+ * 점선으로 그린다. 패턴은 에디터가 선 두께에 맞춰 정하므로 소비처는 의도만 밝힌다.
36
+ * dash로 직접 지정하면 그쪽이 우선한다.
37
+ */
38
+ dashed?: boolean;
32
39
  /** POINT 도형 반경(화면 px). */
33
40
  pointRadius?: number;
34
41
  /** 렌더 순서. 없으면 문서 배열 순서를 따른다. */
@@ -126,3 +133,17 @@ export declare function rotatedRectAngle(points: Point[]): number;
126
133
  export declare function localBoxToCorners(box: BBox, R: Point, u: Point, v: Point): Point[];
127
134
  export declare function resizeRotatedRectFromAnchor(points: Point[], anchor: Anchor, target: Point): Point[];
128
135
  export declare function rescalePoints(points: Point[], from: BBox, to: BBox): Point[];
136
+ /**
137
+ * 폴리곤 자기교차(모래시계 등) 여부 — 인접하지 않은 변끼리 교차 검사.
138
+ * O(n²)라 정점이 아주 많은 폴리곤(자동 추적 마스크 등)은 검사하지 않고 false를
139
+ * 돌려준다(수동 정점 편집으로 만드는 폴리곤 크기에서만 의미 있는 검사).
140
+ */
141
+ export declare function polygonSelfIntersects(points: Point[], maxPoints?: number): boolean;
142
+ /**
143
+ * 자기교차 폴리곤을 교차점에서 잘라 단순 폴리곤들로 분해한다(모래시계 → 삼각형 2개).
144
+ * earcut 기반 렌더러(Pixi)의 면 채움용 — 교차가 없으면 [points] 그대로 반환.
145
+ * 노드 리스트(원 정점 + 변별 t 정렬 교차점)를 순회하다 교차점에 도착하면 쌍둥이
146
+ * 노드로 건너뛰어 루프를 닫는 고전적 분해. polygonSelfIntersects와 같은 이유로
147
+ * 정점이 maxPoints를 넘으면 분해하지 않는다.
148
+ */
149
+ export declare function splitSelfIntersectingPolygon(points: Point[], maxPoints?: number): Point[][];
@@ -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,7 +6,7 @@
6
6
  * 키 토큰은 e.code 기반(레이아웃/IME 무관): 글자 a–z, 숫자 0–9,
7
7
  * 기호(= - [ ] ; . , / `), 이름키(escape/enter/backspace/delete/arrow*).
8
8
  */
9
- export type EditorAction = "undo" | "redo" | "selectAll" | "copy" | "cut" | "paste" | "duplicate" | "delete" | "cancel" | "commitDraft" | "bringToFront" | "sendToBack" | "flipHorizontal" | "flipVertical" | "zoomIn" | "zoomOut" | "zoom100" | "zoomFit" | "toggleMinimap" | "toggleCursorGuide" | "togglePixelation" | "selectTool" | "rectangleTool" | "rotatedRectangleTool" | "circleTool" | "polygonTool" | "pathTool" | "brushTool" | "pointTool";
9
+ export type EditorAction = "undo" | "redo" | "selectAll" | "copy" | "cut" | "paste" | "duplicate" | "delete" | "cancel" | "commitDraft" | "bringToFront" | "sendToBack" | "zoomIn" | "zoomOut" | "zoom100" | "zoomFit" | "toggleMinimap" | "toggleCursorGuide" | "togglePixelation" | "selectTool" | "rectangleTool" | "rotatedRectangleTool" | "circleTool" | "polygonTool" | "pathTool" | "brushTool" | "pointTool";
10
10
  export declare const DEFAULT_KEYMAP: Record<EditorAction, string[]>;
11
11
  /** KeyboardEvent → 조합키 문자열(예: "mod+shift+z"). 매핑 불가 시 null. */
12
12
  export declare function eventToCombo(e: KeyboardEvent): 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;