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

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 (118) hide show
  1. package/README.md +68 -0
  2. package/dist/{Button-CzqDPqUT.js → Button-BrPqDGyO.js} +1502 -3115
  3. package/dist/Button-BrPqDGyO.js.map +1 -0
  4. package/dist/Button-EEErevS-.cjs +2 -0
  5. package/dist/Button-EEErevS-.cjs.map +1 -0
  6. package/dist/IconButton-CK4en7H6.js +209 -0
  7. package/dist/IconButton-CK4en7H6.js.map +1 -0
  8. package/dist/IconButton-DBlsEy3m.cjs +2 -0
  9. package/dist/IconButton-DBlsEy3m.cjs.map +1 -0
  10. package/dist/comment.cjs +3 -113
  11. package/dist/comment.cjs.map +1 -1
  12. package/dist/comment.js +153 -13491
  13. package/dist/comment.js.map +1 -1
  14. package/dist/components/Badge/Badge.d.ts +8 -1
  15. package/dist/components/Calendar/Calendar.d.ts +38 -0
  16. package/dist/components/Calendar/Calendar.test.d.ts +1 -0
  17. package/dist/components/{DatePicker → Calendar}/date.d.ts +4 -3
  18. package/dist/components/Calendar/date.test.d.ts +1 -0
  19. package/dist/components/Calendar/index.d.ts +2 -0
  20. package/dist/components/Comment/CommentInput.d.ts +6 -1
  21. package/dist/components/DataGrid/DataGrid.d.ts +38 -71
  22. package/dist/components/DataGrid/DataGridColumnSettings.d.ts +18 -0
  23. package/dist/components/DataGrid/DataGridPrimitives.d.ts +79 -0
  24. package/dist/components/DataGrid/DataGridRows.d.ts +66 -0
  25. package/dist/components/DataGrid/index.d.ts +6 -2
  26. package/dist/components/DraggableScroll/DraggableScroll.d.ts +6 -1
  27. package/dist/components/Drawer/Drawer.d.ts +35 -0
  28. package/dist/components/Drawer/index.d.ts +2 -0
  29. package/dist/components/Icon/index.d.ts +6 -1
  30. package/dist/components/InputBase/InputBase.d.ts +5 -7
  31. package/dist/components/Modal/Modal.d.ts +9 -2
  32. package/dist/components/Modal/ModalBase.d.ts +33 -0
  33. package/dist/components/Modal/index.d.ts +3 -1
  34. package/dist/components/ScrollArea/ScrollArea.d.ts +5 -1
  35. package/dist/components/SelectBox/SelectBox.d.ts +7 -4
  36. package/dist/components/SelectButton/SelectButton.d.ts +18 -0
  37. package/dist/components/SelectButton/index.d.ts +2 -0
  38. package/dist/components/ShapeEditor/ShapeEditor.d.ts +1 -1
  39. package/dist/components/ShapeEditor/ShapeViewer.d.ts +5 -5
  40. package/dist/components/ShapeEditor/_components/ImageStateOverlay.d.ts +8 -3
  41. package/dist/components/ShapeEditor/_components/Minimap.d.ts +13 -11
  42. package/dist/components/ShapeEditor/_components/MinimapShape.d.ts +2 -2
  43. package/dist/components/ShapeEditor/_components/SelectionInfo.d.ts +2 -0
  44. package/dist/components/ShapeEditor/_components/SettingsPanel.d.ts +18 -3
  45. package/dist/components/ShapeEditor/_constants.d.ts +7 -4
  46. package/dist/components/ShapeEditor/_model/clipboard.d.ts +22 -0
  47. package/dist/components/ShapeEditor/_model/clipboard.test.d.ts +1 -0
  48. package/dist/components/ShapeEditor/_model/cursors.d.ts +5 -0
  49. package/dist/components/ShapeEditor/_model/cursors.test.d.ts +1 -0
  50. package/dist/components/ShapeEditor/_model/geometry.d.ts +33 -1
  51. package/dist/components/ShapeEditor/_model/geometry.evenodd-audit.test.d.ts +1 -0
  52. package/dist/components/ShapeEditor/_model/geometry.test.d.ts +1 -0
  53. package/dist/components/ShapeEditor/_model/imageDiagnosis.d.ts +23 -0
  54. package/dist/components/ShapeEditor/_model/imageDiagnosis.test.d.ts +1 -0
  55. package/dist/components/ShapeEditor/_model/imageLoad.d.ts +13 -0
  56. package/dist/components/ShapeEditor/_model/imageLoad.test.d.ts +1 -0
  57. package/dist/components/ShapeEditor/_model/keymap.d.ts +1 -1
  58. package/dist/components/ShapeEditor/_model/overlays.d.ts +9 -19
  59. package/dist/components/ShapeEditor/_model/props.d.ts +100 -33
  60. package/dist/components/ShapeEditor/_model/strings.d.ts +7 -3
  61. package/dist/components/ShapeEditor/_model/viewSettings.d.ts +45 -1
  62. package/dist/components/ShapeEditor/_model/viewSettings.test.d.ts +1 -0
  63. package/dist/components/ShapeEditor/_renderers/KonvaRenderer.d.ts +23 -3
  64. package/dist/components/ShapeEditor/_renderers/PixiRenderer.d.ts +30 -5
  65. package/dist/components/ShapeEditor/_renderers/transformSession.d.ts +1 -1
  66. package/dist/components/ShapeEditor/_renderers/types.d.ts +52 -16
  67. package/dist/components/ShapeEditor/_state/createInteractionController.d.ts +8 -2
  68. package/dist/components/ShapeEditor/_state/createInteractionController.test.d.ts +1 -0
  69. package/dist/components/ShapeEditor/_state/useEditorHotkeys.d.ts +4 -4
  70. package/dist/components/ShapeEditor/_state/useEngineLifecycle.d.ts +52 -10
  71. package/dist/components/ShapeEditor/_state/useEngineLifecycle.test.d.ts +1 -0
  72. package/dist/components/ShapeEditor/_state/useSelectionActions.d.ts +7 -6
  73. package/dist/components/ShapeEditor/index.d.ts +3 -2
  74. package/dist/components/Spinner/Spinner.d.ts +15 -0
  75. package/dist/components/Spinner/index.d.ts +2 -0
  76. package/dist/components/Switch/Switch.d.ts +2 -1
  77. package/dist/components/Tagbox/Tagbox.d.ts +1 -4
  78. package/dist/components/Textarea/Textarea.d.ts +7 -4
  79. package/dist/components/Textbox/Textbox.d.ts +1 -5
  80. package/dist/components/Toast/Toast.d.ts +13 -3
  81. package/dist/components/Toast/index.d.ts +1 -1
  82. package/dist/index.cjs +1 -14
  83. package/dist/index.cjs.map +1 -1
  84. package/dist/index.d.ts +5 -1
  85. package/dist/index.js +2913 -7061
  86. package/dist/index.js.map +1 -1
  87. package/dist/keyboard-BMCakKCv.js +398 -0
  88. package/dist/keyboard-BMCakKCv.js.map +1 -0
  89. package/dist/keyboard-DCewgvMV.cjs +2 -0
  90. package/dist/keyboard-DCewgvMV.cjs.map +1 -0
  91. package/dist/shape-editor.cjs +1 -1
  92. package/dist/shape-editor.cjs.map +1 -1
  93. package/dist/shape-editor.js +3176 -2269
  94. package/dist/shape-editor.js.map +1 -1
  95. package/dist/styles.css +3 -2
  96. package/dist/tokens/tokens.css +613 -611
  97. package/dist/utils/keyboard.d.ts +3 -0
  98. package/dist/utils/useModalAutoFocus.d.ts +5 -0
  99. package/dist/utils.cjs +2 -0
  100. package/dist/utils.cjs.map +1 -0
  101. package/dist/utils.js +59 -0
  102. package/dist/utils.js.map +1 -0
  103. package/package.json +26 -14
  104. package/dist/Button-C_GP2mJ-.cjs +0 -2
  105. package/dist/Button-C_GP2mJ-.cjs.map +0 -1
  106. package/dist/Button-CzqDPqUT.js.map +0 -1
  107. package/dist/IconButton-B-MspnYP.cjs +0 -2
  108. package/dist/IconButton-B-MspnYP.cjs.map +0 -1
  109. package/dist/IconButton-DTGSfJme.js +0 -560
  110. package/dist/IconButton-DTGSfJme.js.map +0 -1
  111. package/dist/Switch-B2irM7Pp.js +0 -2656
  112. package/dist/Switch-B2irM7Pp.js.map +0 -1
  113. package/dist/Switch-CMKBdqkX.cjs +0 -42
  114. package/dist/Switch-CMKBdqkX.cjs.map +0 -1
  115. package/dist/components/DatePicker/Calendar.d.ts +0 -27
  116. package/dist/components/DatePicker/DatePicker.d.ts +0 -119
  117. package/dist/components/DatePicker/index.d.ts +0 -4
  118. package/dist/components/ShapeEditor/_model/imageFetch.d.ts +0 -9
@@ -2,13 +2,17 @@ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
2
2
  import type { ComponentProps, Ref, UIEventHandler } from "react";
3
3
  type ScrollAreaScrollbars = "both" | "horizontal" | "vertical";
4
4
  type ScrollAreaProps = ComponentProps<typeof ScrollAreaPrimitive.Root> & {
5
+ /** 세로 가장자리 페이드 — 가려진 방향만 40px, 넘치지 않으면 없음. 세로 전용 */
6
+ edgeFade?: boolean;
5
7
  onViewportScroll?: UIEventHandler<HTMLDivElement>;
6
8
  scrollbars?: ScrollAreaScrollbars;
9
+ /** 세로 스크롤바에 덧붙일 클래스 — 고정 헤더 아래에서 시작시킬 때 쓴다 */
10
+ verticalScrollbarClassName?: string;
7
11
  viewportClassName?: string;
8
12
  viewportRef?: Ref<HTMLDivElement>;
9
13
  };
10
14
  type ScrollBarProps = ComponentProps<typeof ScrollAreaPrimitive.Scrollbar>;
11
- declare function ScrollArea({ className, children, onViewportScroll, ref, scrollbars, type, viewportClassName, viewportRef, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
15
+ declare function ScrollArea({ className, children, edgeFade, onViewportScroll, ref, scrollbars, type, verticalScrollbarClassName, viewportClassName, viewportRef, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
12
16
  declare function ScrollBar({ className, orientation, ref, ...props }: ScrollBarProps): import("react/jsx-runtime").JSX.Element;
13
17
  export type { ScrollAreaProps, ScrollAreaScrollbars, ScrollBarProps };
14
18
  export { ScrollArea, ScrollBar };
@@ -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, 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> & {
7
+ export default function ShapeEditor<TMeta, TMarkerMeta = unknown>({ document: editorDocument, clipboardScope, renderImageState, dimmed, selectedIds: controlledSelectedIds, activeTool, draftStyle, draftMeta, readOnly, disableMarquee, locked, onLockedInteraction, onDrawAttemptWithoutDraft, onIdleEscape, overrideShapeInteraction, defaultViewSettings, viewSettings, onViewSettingsChange, showMinimap, minimapPosition, showViewSettings, getContextMenuItems, strings, viewSettingItems, canMergeSelection, brushSize, zoomBound, zoomAnimationDuration, decorationShapes, regionMask, 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;
@@ -1,6 +1,7 @@
1
1
  import type { CSSProperties, ReactNode } from "react";
2
2
  import { type EditorShape } from "./_model/geometry";
3
- import { type GuideMaskRaster, type MaskPalette, type RegionMask } from "./_model/overlays";
3
+ import { type EditorImageDiagnosis } from "./_model/imageDiagnosis";
4
+ import { type RegionMask } from "./_model/overlays";
4
5
  /**
5
6
  * ShapeViewer가 지원하는 EditorShape **표시 서브셋 계약**:
6
7
  * - 도형: POINT / RECTANGLE / ELLIPSE / POLYGON / LINE / ROTATED_RECTANGLE(꼭짓점 배열)
@@ -19,8 +20,6 @@ export interface ShapeViewerProps<TMeta = unknown> {
19
20
  };
20
21
  shapes?: EditorShape<TMeta>[];
21
22
  regionMask?: RegionMask;
22
- guideMask?: GuideMaskRaster | null;
23
- maskPalette?: MaskPalette;
24
23
  /** 지정한 도형이 화면을 채우도록 확대한다. */
25
24
  focusedShapeId?: string;
26
25
  /**
@@ -36,7 +35,8 @@ export interface ShapeViewerProps<TMeta = unknown> {
36
35
  lazy?: boolean;
37
36
  className?: string;
38
37
  style?: CSSProperties;
39
- renderImageState?: (status: "loading" | "error") => ReactNode;
38
+ /** error일 때 diagnosis에 원인 분류·기술 근거가 실린다(진단 전/실패 시 null). */
39
+ renderImageState?: (status: "loading" | "error" | "missing", diagnosis?: EditorImageDiagnosis | null) => ReactNode;
40
40
  }
41
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;
42
+ export default function ShapeViewer<TMeta = unknown>({ imageUrl, alt, coordinateSize, shapes, regionMask, focusedShapeId, focusFit, zoomPadding, strokeSize, brightness, contrast, imageSmoothing, lazy, className, style, renderImageState, }: ShapeViewerProps<TMeta>): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,16 @@
1
1
  import type { ReactNode } from "react";
2
+ import type { EditorImageDiagnosis, EditorImageErrorKind } from "../_model/imageDiagnosis";
2
3
  /**
3
4
  * 이미지 로딩/에러 상태 오버레이. 에디터 영역 전체를 덮는다.
4
5
  * 호스트가 renderImageState로 커스텀하지 않으면 기본 스피너/에러 메시지를 그린다.
6
+ * 에러에 진단(diagnosis)이 있으면 원인 안내문과 기술 근거를 함께 표시한다.
5
7
  */
6
- export declare function ImageStateOverlay({ status, render, loadingLabel, errorLabel, }: {
7
- status: "loading" | "error";
8
- render?: (status: "loading" | "error") => ReactNode;
8
+ export declare function ImageStateOverlay({ status, error, render, loadingLabel, missingLabel, errorLabel, errorHints, }: {
9
+ status: "loading" | "error" | "missing";
10
+ error?: EditorImageDiagnosis | null;
11
+ render?: (status: "loading" | "error" | "missing", diagnosis?: EditorImageDiagnosis | null) => ReactNode;
9
12
  loadingLabel?: string;
13
+ missingLabel?: string;
10
14
  errorLabel?: string;
15
+ errorHints?: Record<EditorImageErrorKind, string>;
11
16
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,17 +1,12 @@
1
- import type { RefObject } from "react";
1
+ import { type RefObject } from "react";
2
2
  import { type EditorShape } from "../_model/geometry";
3
3
  import type { RegionOverlayData } from "../_model/overlays";
4
+ import type { MinimapPosition } from "../_model/props";
4
5
  import { type EditorStrings } from "../_model/strings";
5
6
  import type { ViewSettings } from "../_model/viewSettings";
6
7
  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, region, roiMaskId, shapes, view, onChangeView, nav, registerShape, rectRef, zoomLabelRef, onZoom100, open, onToggleOpen, showSettings, settingsOpen, onToggleSettings, onCloseSettings, labels, settingsLabels, }: {
8
+ import type { ViewSettingItemKey } from "./SettingsPanel";
9
+ export declare const Minimap: import("react").MemoExoticComponent<<TMeta>({ image, imageUrl, imageVisible, loading, region, roiMaskId, shapes, view, viewDefaults, onChangeView, nav, registerShape, rectRef, zoomLabelRef, onZoom100, open, onToggleOpen, position, showSettings, settingsOpen, onToggleSettings, onCloseSettings, labels, settingsLabels, settingsItems, }: {
15
10
  image: {
16
11
  w: number;
17
12
  h: number;
@@ -19,12 +14,15 @@ export declare function Minimap<TMeta>({ image, imageUrl, imageVisible, maskData
19
14
  imageUrl: string;
20
15
  /** 메인 캔버스와 동기화된 표시 여부 — 전환 시 즉시 숨기고 로드 후 페이드인. */
21
16
  imageVisible?: boolean;
22
- maskDataUrl: string | null;
17
+ /** 문서 이미지 전환 중에는 패널을 유지하되 이미지 내비게이션만 잠근다. */
18
+ loading?: boolean;
23
19
  /** 리졸브된 영역 마스크 오버레이(딤·윤곽 벡터). */
24
20
  region?: RegionOverlayData | null;
25
21
  roiMaskId: string;
26
22
  shapes: EditorShape<TMeta>[];
27
23
  view: ViewSettings;
24
+ /** "초기화"가 되돌릴 기준값(호스트 기본값 반영). */
25
+ viewDefaults: ViewSettings;
28
26
  onChangeView: (patch: Partial<ViewSettings>) => void;
29
27
  nav: MinimapNavigation;
30
28
  registerShape: (id: string, el: SVGElement | null) => void;
@@ -33,6 +31,8 @@ export declare function Minimap<TMeta>({ image, imageUrl, imageVisible, maskData
33
31
  onZoom100: () => void;
34
32
  open: boolean;
35
33
  onToggleOpen: () => void;
34
+ /** 패널이 붙는 모서리(기본 "bottom-left"). */
35
+ position?: MinimapPosition;
36
36
  /** 보기설정(기어) 버튼 표시 여부(기본 true). */
37
37
  showSettings?: boolean;
38
38
  settingsOpen: boolean;
@@ -42,4 +42,6 @@ export declare function Minimap<TMeta>({ image, imageUrl, imageVisible, maskData
42
42
  labels?: EditorStrings["minimap"];
43
43
  /** 설정 팝오버 문자열. 기본 한국어. */
44
44
  settingsLabels?: EditorStrings["viewSettings"];
45
- }): import("react/jsx-runtime").JSX.Element;
45
+ /** 설정 팝오버 항목 구성 — SettingsPanel.items 그대로 전달. */
46
+ settingsItems?: ViewSettingItemKey[];
47
+ }) => 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>;
@@ -1,5 +1,7 @@
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 미지정 시 기본 텍스트. */
@@ -1,15 +1,30 @@
1
1
  import { type EditorStrings } from "../_model/strings";
2
2
  import { type ViewSettings } from "../_model/viewSettings";
3
- export { DEFAULT_VIEW_SETTINGS, type ViewSettings, } from "../_model/viewSettings";
3
+ export { DEFAULT_VIEW_SETTINGS, VIEW_SETTING_RANGES, type ViewSettings, } from "../_model/viewSettings";
4
+ /** 보기 설정 항목 키 — 슬라이더 5종 + 토글 6종. */
5
+ export type ViewSettingItemKey = "brightness" | "contrast" | "strokeSize" | "simplifyStrength" | "zoomSensitivity" | "pixelation" | "cursorGuide" | "regionMask" | "keepZoomOnImageChange" | "wheelZoom";
6
+ /** 기본 항목 구성 — 전 항목, 기존 표시 순서. 호스트가 items로 재구성한다. */
7
+ export declare const DEFAULT_VIEW_SETTING_ITEMS: ViewSettingItemKey[];
4
8
  /**
5
9
  * 미니맵 기어 버튼에서 열리는 보기 설정 팝오버(도메인 무관).
6
10
  * 바깥 클릭/Esc로 닫힘. 값은 호출부가 소유하고 onChange로 부분 갱신.
7
11
  * 컨트롤은 @aivex/ui(Button/Slider/Switch/Divider)로 렌더한다.
8
12
  */
9
- export declare function SettingsPanel({ value, onChange, onClose, labels, }: {
13
+ export declare function SettingsPanel({ value, defaults, onChange, labels, items, openDown, alignEnd, }: {
10
14
  value: ViewSettings;
15
+ /** "초기화"가 되돌릴 기준값 — 호스트 기본값이 반영된 시드. */
16
+ defaults: ViewSettings;
11
17
  onChange: (patch: Partial<ViewSettings>) => void;
12
- onClose: () => void;
13
18
  /** UI 문자열. 기본 한국어. */
14
19
  labels?: EditorStrings["viewSettings"];
20
+ /**
21
+ * 표시할 항목과 순서 — 제품마다 노출 범위가 다르다(예: 아이브데이터는
22
+ * 단순화 강도·픽셀화 없음, 6547:201301). 슬라이더와 토글은
23
+ * 각자 블록 안에서 이 배열의 순서를 따른다.
24
+ */
25
+ items?: ViewSettingItemKey[];
26
+ /** 미니맵이 위쪽 모서리에 붙으면 팝오버는 아래로 연다(기본은 위로). */
27
+ openDown?: boolean;
28
+ /** 미니맵이 오른쪽 모서리에 붙으면 우측 정렬로 열어 화면 밖으로 나가지 않게 한다. */
29
+ alignEnd?: boolean;
15
30
  }): import("react/jsx-runtime").JSX.Element;
@@ -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 {};
@@ -1,5 +1,10 @@
1
1
  import type { Anchor } from "./geometry";
2
2
  import { type Tool } from "./tools";
3
+ /**
4
+ * 비선택 도형 호버 힌트(CSS 커서 아님 — 소비층이 도구별로 해석).
5
+ * 선택 도구는 grab으로 표시하고, 박스 그리기 도구는 무시한다(클릭=그리기이므로).
6
+ */
7
+ export declare const UNSELECTED_HOVER_HINT = "grab-unselected";
3
8
  export declare function resizeCursorForAnchor(anchor: Anchor, angleRad?: number): string;
4
9
  export declare function cursorForTool({ tool, externalToolCursor, isSpacePressed, isPolygonDrawing, }: {
5
10
  tool: Tool;
@@ -29,8 +29,13 @@ export interface ShapeStyle {
29
29
  strokeWidth?: number;
30
30
  /** 채움 투명도(0~1). 없으면 렌더러 기본값을 사용한다. */
31
31
  fillOpacity?: number;
32
- /** 점선 패턴(화면 px). */
32
+ /** 점선 패턴(화면 px). 고정값이라 선 두께가 바뀌어도 따라오지 않는다. */
33
33
  dash?: number[];
34
+ /**
35
+ * 점선으로 그린다. 패턴은 에디터가 선 두께에 맞춰 정하므로 소비처는 의도만 밝힌다.
36
+ * dash로 직접 지정하면 그쪽이 우선한다.
37
+ */
38
+ dashed?: boolean;
34
39
  /** POINT 도형 반경(화면 px). */
35
40
  pointRadius?: number;
36
41
  /** 렌더 순서. 없으면 문서 배열 순서를 따른다. */
@@ -128,3 +133,30 @@ export declare function rotatedRectAngle(points: Point[]): number;
128
133
  export declare function localBoxToCorners(box: BBox, R: Point, u: Point, v: Point): Point[];
129
134
  export declare function resizeRotatedRectFromAnchor(points: Point[], anchor: Anchor, target: Point): Point[];
130
135
  export declare function rescalePoints(points: Point[], from: BBox, to: BBox): Point[];
136
+ /** 점이 닫힌 다각형 내부인가(ray casting, even-odd). */
137
+ export declare function pointInPolygon(p: Point, polygon: Point[]): boolean;
138
+ /**
139
+ * 도형과 축정렬 박스의 실제 기하 충돌 — 마퀴 선택 판정. bbox 근사와 달리
140
+ * 오목 폴리곤의 빈 구석·타원 모서리·회전 사각형 바깥을 잡지 않는다.
141
+ * 닫힌 도형은 면(영역)으로 본다: 박스가 도형 내부에 완전히 들어간 경우도 충돌.
142
+ */
143
+ export declare function shapeIntersectsBox(shape: EditorShape, box: BBox): boolean;
144
+ export interface FillGroup {
145
+ outline: Point[];
146
+ holes: Point[][];
147
+ /** 채움 겹수 — 2 이상이면 반투명 채움이 겹쳐 진해진다(겹침 영역 표현). */
148
+ layers: number;
149
+ }
150
+ /**
151
+ * 자기교차 폴리곤의 채움 그룹 계산 — 교차점을 정점으로 하는 평면 배치(arrangement)의
152
+ * 면(face)들을 반변(half-edge) 궤도로 추출한 뒤, 면별 감김수로 채움을 정한다:
153
+ * - 유계 면은 기본적으로 max(1, |감김수|)겹으로 칠한다 — 관통 웨지처럼 감김수가
154
+ * 상쇄(0)된 닫힌 포켓도 눈에는 도형의 일부이므로 비우지 않고, 같은 방향으로
155
+ * 두 번 감은 겹침(≥2)은 겹수만큼 포개 칠해 진해진다.
156
+ * - 예외: 홀수 면 안에 중첩된 감김수 짝수(≥2) 면 = 한붓 도넛의 구멍 — 비운다.
157
+ * - 무계(바깥) 면과 면의 안쪽 경계(구멍 궤도)는 칠하지 않고, 안쪽 경계는 그 면의
158
+ * cut 구멍으로 붙여 면들이 서로 겹치지 않게 한다(겹수 계산이 정확해지는 조건).
159
+ * 순수 evenodd/nonzero 어느 쪽도 아닌 의도적 선택 — "반투명 도형을 포개 그린"
160
+ * 직관(구멍만 비고, 겹치면 진해지고, 나머지는 전부 칠해짐)을 재현한다.
161
+ */
162
+ export declare function computePolygonFillGroups(points: Point[], maxPoints?: number): FillGroup[];
@@ -0,0 +1,23 @@
1
+ export type EditorImageErrorKind = "mixed-content" | "cors" | "auth" | "forbidden" | "not-found" | "server-error" | "http" | "offline" | "network" | "unexpected-content" | "decode" | "csp-img" | "csp-eval" | "webgl" | "renderer-init" | "unknown";
2
+ /** 이미지 로드 실패 분류 + 기술 근거(에러 오버레이·문의 대응용). */
3
+ export type EditorImageDiagnosis = {
4
+ kind: EditorImageErrorKind;
5
+ /** 언어 중립 기술 근거(상태코드·오리진 등). 분류별 안내문은 EditorStrings 몫. */
6
+ detail: string;
7
+ };
8
+ /** 테스트 전용 — 전역 fetch/Image 스텁과 메모가 얽히지 않게 비운다. */
9
+ export declare function clearImageDiagnosisMemo(): void;
10
+ /**
11
+ * 이미지 로드가 최종 실패했을 때 원인을 프로브로 분류한다. 회색 캔버스만 보이는
12
+ * 현장에서 콘솔 없이 원인을 특정하기 위한 것. 프로브는 cache:"no-store"로 보내
13
+ * HTTP 캐시를 건드리지 않는다.
14
+ */
15
+ export declare function diagnoseImageLoadFailure(url: string): Promise<EditorImageDiagnosis>;
16
+ /** WebGL 컨텍스트 생성 가능 여부 — 하드웨어 가속 꺼짐·보안 모드·GPU 차단 판별. */
17
+ export declare function isWebglAvailable(): boolean;
18
+ /**
19
+ * 렌더러 엔진 초기화/렌더 중 예외 분류 — 네트워크 단계가 아니라 프로브 없이
20
+ * 에러 메시지와 WebGL 가용성으로 판정한다(pixi는 CSP unsafe-eval 차단 시
21
+ * 명시적 에러를 던진다).
22
+ */
23
+ export declare function diagnoseEngineInitFailure(error: unknown): EditorImageDiagnosis;
@@ -0,0 +1,13 @@
1
+ /** 소스 하나로 이미지 로드를 시도한다(실패 시 null — 호출부가 폴백/진단 결정). */
2
+ export declare function loadImageElement(src: string, options?: {
3
+ crossOrigin?: boolean;
4
+ }): Promise<HTMLImageElement | null>;
5
+ /**
6
+ * CORS-clean 이미지 로드 — `<img crossOrigin>` 직행이 기본이다. blob을 쓰지
7
+ * 않으므로 CSP img-src blob:·보안 확장의 blob 간섭 여지가 없다. 실패하면 앱
8
+ * 어딘가의 no-cors `<img>`가 채운 오염 캐시(CORS 헤더 없는 응답)일 수 있으므로,
9
+ * cache:"reload" fetch로 캐시 항목을 정상 CORS 응답으로 수리한 뒤 한 번 더
10
+ * 시도한다. 그래도 실패면 null — 호출부가 상태/진단(imageDiagnosis.ts)을 처리한다.
11
+ * Konva/Pixi 렌더러와 ShapeViewer가 공유한다.
12
+ */
13
+ export declare function loadCorsImage(url: string): Promise<HTMLImageElement | 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;
@@ -57,25 +57,6 @@ export interface RegionMask {
57
57
  occludedStyle?: RegionOutlineStyle;
58
58
  };
59
59
  }
60
- /** 마스크 팔레트 — 픽셀 인덱스값 → 색(hex). 호스트가 클래스색에서 계산해 주입. */
61
- export type MaskPalette = Record<number, string>;
62
- /**
63
- * 디코딩된 가이드 마스크 래스터. `indices`는 width*height 픽셀 인덱스이고
64
- * 인덱스→색은 palette로 결정한다. transparent 인덱스는 그리지 않는다.
65
- * 서버/도메인별 와이어 포맷(바이너리 헤더 등) 디코딩은 호스트 책임 —
66
- * 에디터는 순수 래스터만 받는다(LabelEditor/guideMask.ts 참고).
67
- */
68
- export interface GuideMaskRaster {
69
- width: number;
70
- height: number;
71
- indices: Uint8Array;
72
- transparent?: number;
73
- }
74
- /**
75
- * 가이드 마스크 래스터 + 팔레트(인덱스→색)를 컬러 캔버스로 그린다.
76
- * 실패하면 null. 결과 캔버스는 이미지 원본 해상도(width×height).
77
- */
78
- export declare const buildMaskCanvas: (raster: GuideMaskRaster, palette: MaskPalette) => HTMLCanvasElement | null;
79
60
  /** 이미지 좌표 선분. 렌더러가 화면고정(줌 무관) 점선 스트로크로 그린다. */
80
61
  export type OutlineSegment = [Point, Point];
81
62
  /**
@@ -85,6 +66,15 @@ export type OutlineSegment = [Point, Point];
85
66
  * 인접 구멍 경계에 이음선이 생기지 않는다).
86
67
  */
87
68
  export declare function drawRegionDim(ctx: CanvasRenderingContext2D, region: Pick<RegionOverlayData, "rects" | "zones" | "dimHoles" | "dim">, width: number, height: number): void;
69
+ /**
70
+ * 완료 딤 스타일 — static/black + opacity/dim 토큰을 호스트 엘리먼트의 계산값으로
71
+ * 런타임에 해석한다. 캔버스는 CSS 변수를 직접 참조할 수 없어 여기서 읽어 넘긴다.
72
+ * 폴백은 토큰 미로드 환경(단위 테스트 등)용으로 현재 토큰 값과 같다.
73
+ */
74
+ export declare function resolveCompletedDimStyle(host: HTMLElement): {
75
+ color: string;
76
+ opacity: number;
77
+ };
88
78
  /** 기본값이 채워진 윤곽 스트로크 — 렌더러가 그대로 그린다. */
89
79
  export type ResolvedRegionOutlineStyle = Required<RegionOutlineStyle>;
90
80
  /**