@aivex/ui 1.2.0-dev.28 → 1.2.0-dev.29

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.
@@ -1,6 +1,6 @@
1
1
  import { type EditorStrings } from "../_model/strings";
2
- import type { ViewSettings } from "../_model/viewSettings";
3
- export { DEFAULT_VIEW_SETTINGS, type ViewSettings, } from "../_model/viewSettings";
2
+ import { type ViewSettings } from "../_model/viewSettings";
3
+ export { DEFAULT_VIEW_SETTINGS, VIEW_SETTING_RANGES, type ViewSettings, } from "../_model/viewSettings";
4
4
  /**
5
5
  * 미니맵 기어 버튼에서 열리는 보기 설정 팝오버(도메인 무관).
6
6
  * 바깥 클릭/Esc로 닫힘. 값은 호출부가 소유하고 onChange로 부분 갱신.
@@ -282,12 +282,15 @@ export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
282
282
  * 보기 설정 초깃값(밝기/대비/픽셀화/선 두께/가이드·ROI 표시/줌 유지/휠 줌).
283
283
  * 마운트 시 seed로만 쓰이고 이후엔 에디터 내부 설정 팝오버가 소유한다(uncontrolled).
284
284
  * 지정하지 않은 키는 DEFAULT_VIEW_SETTINGS를 따른다.
285
+ * 숫자 값은 VIEW_SETTING_RANGES로 클램프된다(예: brightness 2 → 1.5).
285
286
  */
286
287
  defaultViewSettings?: Partial<ViewSettings>;
287
288
  /**
288
289
  * 보기 설정 외부 동기화(선택). 여기 지정한 키의 값이 바뀌면 에디터 내부 설정에
289
290
  * 반영된다(호스트 설정 UI → 에디터 방향). 에디터 내부 변경은 onViewSettingsChange로
290
291
  * 나간다. 미지정 키는 계속 에디터 내부 소유.
292
+ * 여기 값도 VIEW_SETTING_RANGES로 클램프되므로, 범위 밖 저장값을 그대로 넘겨도
293
+ * 에디터는 범위 안 값으로 동작한다(호스트 저장값은 다음 설정 변경 시 교정된다).
291
294
  */
292
295
  viewSettings?: Partial<ViewSettings>;
293
296
  /**
@@ -15,3 +15,46 @@ export interface ViewSettings {
15
15
  zoomSensitivity: number;
16
16
  }
17
17
  export declare const DEFAULT_VIEW_SETTINGS: ViewSettings;
18
+ /** 숫자형 보기 설정의 허용 범위 — 슬라이더와 클램프가 공유하는 단일 출처. */
19
+ export interface ViewSettingRange {
20
+ min: number;
21
+ max: number;
22
+ step: number;
23
+ }
24
+ /**
25
+ * 밝기/대비는 0에 가까우면 완전 검정·평면 회색이 되어 이미지가 사라지고,
26
+ * 너무 높으면 화이트아웃된다. 사진을 계속 식별할 수 있는 구간으로 묶는다.
27
+ */
28
+ export declare const VIEW_SETTING_RANGES: {
29
+ readonly brightness: {
30
+ readonly min: 0.5;
31
+ readonly max: 1.5;
32
+ readonly step: 0.05;
33
+ };
34
+ readonly contrast: {
35
+ readonly min: 0.5;
36
+ readonly max: 1.5;
37
+ readonly step: 0.05;
38
+ };
39
+ readonly strokeSize: {
40
+ readonly min: 1;
41
+ readonly max: 10;
42
+ readonly step: 0.5;
43
+ };
44
+ readonly simplifyStrength: {
45
+ readonly min: 0.5;
46
+ readonly max: 5;
47
+ readonly step: 0.5;
48
+ };
49
+ readonly zoomSensitivity: {
50
+ readonly min: 0.2;
51
+ readonly max: 3;
52
+ readonly step: 0.1;
53
+ };
54
+ };
55
+ /**
56
+ * 범위 밖 값을 허용 구간 안으로 되돌린다(구버전 저장값 마이그레이션 겸용).
57
+ * NaN/Infinity는 기본값으로 되살린다. 지정되지 않은(undefined) 키는 만들어내지 않으므로
58
+ * 부분 패치에도 그대로 쓸 수 있다. 고칠 게 없으면 새 객체를 만들지 않고 입력을 그대로 반환한다.
59
+ */
60
+ export declare function clampViewSettings<T extends Partial<ViewSettings>>(settings: T): T;
@@ -4,6 +4,6 @@ export type { ExcludedZone, RoiRect } from "./_model/overlays";
4
4
  export type { AssistantPrompt, AssistantPromptPoint, BrushScalarMode, ContextMenuItem, DrawSessionChange, DrawSessionKind, EditorAction, EditorAssistant, EditorCanvasViewport, EditorExternalTool, EditorExternalToolContext, EditorOverlayMarker, EditorPointerEvent, EditorSelectionInfo, EditorShape, GuideMaskRaster, KeymapOverrides, MaskPalette, MinimapPosition, Point, PolygonArea, RectArea, RegionMask, RegionOutlineStyle, ShapeEditorDocument, ShapeEditorHandle, ShapeEditorProps, ShapeStyle, Tool, Viewport, ViewSettings, } from "./_model/props";
5
5
  export { DEFAULT_EDITOR_STRINGS, type EditorStrings, type EditorStringsOverride, } from "./_model/strings";
6
6
  export { type BuiltInTool, TOOL } from "./_model/tools";
7
- export { DEFAULT_VIEW_SETTINGS } from "./_model/viewSettings";
7
+ export { clampViewSettings, DEFAULT_VIEW_SETTINGS, VIEW_SETTING_RANGES, type ViewSettingRange, } from "./_model/viewSettings";
8
8
  export { default, default as ShapeEditor } from "./ShapeEditor";
9
9
  export { default as ShapeViewer, type ShapeViewerProps, } from "./ShapeViewer";