@aivex/ui 1.2.0-dev.47 → 1.2.0-dev.49
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.
- package/README.md +25 -0
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/comment.cjs +1 -5
- package/dist/comment.js +4 -316
- package/dist/components/Avatar/Avatar.cjs +2 -0
- package/dist/components/Avatar/Avatar.cjs.map +1 -0
- package/dist/components/Avatar/Avatar.js +105 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Badge/Badge.cjs +2 -0
- package/dist/components/Badge/Badge.cjs.map +1 -0
- package/dist/components/Badge/Badge.js +232 -0
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/BreadCrumb/BreadCrumb.cjs +2 -0
- package/dist/components/BreadCrumb/BreadCrumb.cjs.map +1 -0
- package/dist/components/BreadCrumb/BreadCrumb.d.ts +3 -1
- package/dist/components/BreadCrumb/BreadCrumb.js +100 -0
- package/dist/components/BreadCrumb/BreadCrumb.js.map +1 -0
- package/dist/components/Button/Button.cjs +2 -0
- package/dist/components/Button/Button.cjs.map +1 -0
- package/dist/components/Button/Button.js +123 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Calendar/Calendar.cjs +2 -0
- package/dist/components/Calendar/Calendar.cjs.map +1 -0
- package/dist/components/Calendar/Calendar.js +103 -0
- package/dist/components/Calendar/Calendar.js.map +1 -0
- package/dist/components/Calendar/date.cjs +2 -0
- package/dist/components/Calendar/date.cjs.map +1 -0
- package/dist/components/Calendar/date.js +33 -0
- package/dist/components/Calendar/date.js.map +1 -0
- package/dist/components/Card/Card.cjs +2 -0
- package/dist/components/Card/Card.cjs.map +1 -0
- package/dist/components/Card/Card.d.ts +6 -2
- package/dist/components/Card/Card.js +30 -0
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.cjs +2 -0
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/Checkbox/Checkbox.js +59 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Checkbox/ChipsCheckbox.cjs +2 -0
- package/dist/components/Checkbox/ChipsCheckbox.cjs.map +1 -0
- package/dist/components/Checkbox/ChipsCheckbox.d.ts +5 -3
- package/dist/components/Checkbox/ChipsCheckbox.js +45 -0
- package/dist/components/Checkbox/ChipsCheckbox.js.map +1 -0
- package/dist/components/Coachmark/Coachmark.cjs +2 -0
- package/dist/components/Coachmark/Coachmark.cjs.map +1 -0
- package/dist/components/Coachmark/Coachmark.d.ts +3 -1
- package/dist/components/Coachmark/Coachmark.js +102 -0
- package/dist/components/Coachmark/Coachmark.js.map +1 -0
- package/dist/components/Comment/CommentInput.cjs +2 -0
- package/dist/components/Comment/CommentInput.cjs.map +1 -0
- package/dist/components/Comment/CommentInput.js +75 -0
- package/dist/components/Comment/CommentInput.js.map +1 -0
- package/dist/components/Comment/CommentPin.cjs +2 -0
- package/dist/components/Comment/CommentPin.cjs.map +1 -0
- package/dist/components/Comment/CommentPin.js +31 -0
- package/dist/components/Comment/CommentPin.js.map +1 -0
- package/dist/components/Comment/MentionInput.cjs +2 -0
- package/dist/components/Comment/MentionInput.cjs.map +1 -0
- package/dist/components/Comment/MentionInput.js +78 -0
- package/dist/components/Comment/MentionInput.js.map +1 -0
- package/dist/components/Comment/MentionList.cjs +2 -0
- package/dist/components/Comment/MentionList.cjs.map +1 -0
- package/dist/components/Comment/MentionList.d.ts +6 -1
- package/dist/components/Comment/MentionList.js +97 -0
- package/dist/components/Comment/MentionList.js.map +1 -0
- package/dist/components/Comment/mentionContent.cjs +5 -0
- package/dist/components/Comment/mentionContent.cjs.map +1 -0
- package/dist/components/Comment/mentionContent.js +40 -0
- package/dist/components/Comment/mentionContent.js.map +1 -0
- package/dist/components/Comment/useMentionSuggestion.cjs +2 -0
- package/dist/components/Comment/useMentionSuggestion.cjs.map +1 -0
- package/dist/components/Comment/useMentionSuggestion.js +68 -0
- package/dist/components/Comment/useMentionSuggestion.js.map +1 -0
- package/dist/components/DataGrid/DataGrid.cjs +2 -0
- package/dist/components/DataGrid/DataGrid.cjs.map +1 -0
- package/dist/components/DataGrid/DataGrid.js +187 -0
- package/dist/components/DataGrid/DataGrid.js.map +1 -0
- package/dist/components/DataGrid/DataGridColumnSettings.cjs +2 -0
- package/dist/components/DataGrid/DataGridColumnSettings.cjs.map +1 -0
- package/dist/components/DataGrid/DataGridColumnSettings.d.ts +6 -1
- package/dist/components/DataGrid/DataGridColumnSettings.js +186 -0
- package/dist/components/DataGrid/DataGridColumnSettings.js.map +1 -0
- package/dist/components/DataGrid/DataGridPrimitives.cjs +2 -0
- package/dist/components/DataGrid/DataGridPrimitives.cjs.map +1 -0
- package/dist/components/DataGrid/DataGridPrimitives.js +137 -0
- package/dist/components/DataGrid/DataGridPrimitives.js.map +1 -0
- package/dist/components/DataGrid/DataGridRows.cjs +2 -0
- package/dist/components/DataGrid/DataGridRows.cjs.map +1 -0
- package/dist/components/DataGrid/DataGridRows.js +108 -0
- package/dist/components/DataGrid/DataGridRows.js.map +1 -0
- package/dist/components/DataGrid/index.js +6 -0
- package/dist/components/Dialog/Dialog.cjs +2 -0
- package/dist/components/Dialog/Dialog.cjs.map +1 -0
- package/dist/components/Dialog/Dialog.js +97 -0
- package/dist/components/Dialog/Dialog.js.map +1 -0
- package/dist/components/Divider/Divider.cjs +2 -0
- package/dist/components/Divider/Divider.cjs.map +1 -0
- package/dist/components/Divider/Divider.js +58 -0
- package/dist/components/Divider/Divider.js.map +1 -0
- package/dist/components/DraggableScroll/DraggableScroll.cjs +2 -0
- package/dist/components/DraggableScroll/DraggableScroll.cjs.map +1 -0
- package/dist/components/DraggableScroll/DraggableScroll.js +45 -0
- package/dist/components/DraggableScroll/DraggableScroll.js.map +1 -0
- package/dist/components/Drawer/Drawer.cjs +2 -0
- package/dist/components/Drawer/Drawer.cjs.map +1 -0
- package/dist/components/Drawer/Drawer.d.ts +8 -1
- package/dist/components/Drawer/Drawer.js +44 -0
- package/dist/components/Drawer/Drawer.js.map +1 -0
- package/dist/components/Field/Field.cjs +2 -0
- package/dist/components/Field/Field.cjs.map +1 -0
- package/dist/components/Field/Field.js +90 -0
- package/dist/components/Field/Field.js.map +1 -0
- package/dist/components/FilterModal/FilterModal.cjs +2 -0
- package/dist/components/FilterModal/FilterModal.cjs.map +1 -0
- package/dist/components/FilterModal/FilterModal.js +119 -0
- package/dist/components/FilterModal/FilterModal.js.map +1 -0
- package/dist/components/Icon/index.cjs +2 -0
- package/dist/components/Icon/index.cjs.map +1 -0
- package/dist/components/Icon/index.d.ts +1982 -284
- package/dist/components/Icon/index.js +4415 -0
- package/dist/components/Icon/index.js.map +1 -0
- package/dist/components/Icon/svgA11y.cjs +2 -0
- package/dist/components/Icon/svgA11y.cjs.map +1 -0
- package/dist/components/Icon/svgA11y.d.ts +10 -0
- package/dist/components/Icon/svgA11y.js +9 -0
- package/dist/components/Icon/svgA11y.js.map +1 -0
- package/dist/components/Icon/uniqueSvgIds.cjs +2 -0
- package/dist/components/Icon/uniqueSvgIds.cjs.map +1 -0
- package/dist/components/Icon/uniqueSvgIds.d.ts +8 -0
- package/dist/components/Icon/uniqueSvgIds.js +42 -0
- package/dist/components/Icon/uniqueSvgIds.js.map +1 -0
- package/dist/components/IconButton/IconButton.cjs +2 -0
- package/dist/components/IconButton/IconButton.cjs.map +1 -0
- package/dist/components/IconButton/IconButton.js +70 -0
- package/dist/components/IconButton/IconButton.js.map +1 -0
- package/dist/components/InputBase/InputBase.cjs +2 -0
- package/dist/components/InputBase/InputBase.cjs.map +1 -0
- package/dist/components/InputBase/InputBase.js +87 -0
- package/dist/components/InputBase/InputBase.js.map +1 -0
- package/dist/components/InputBase/useInputState.cjs +2 -0
- package/dist/components/InputBase/useInputState.cjs.map +1 -0
- package/dist/components/InputBase/useInputState.d.ts +19 -0
- package/dist/components/InputBase/useInputState.js +25 -0
- package/dist/components/InputBase/useInputState.js.map +1 -0
- package/dist/components/InteractionLayer/InteractionLayer.cjs +2 -0
- package/dist/components/InteractionLayer/InteractionLayer.cjs.map +1 -0
- package/dist/components/InteractionLayer/InteractionLayer.js +17 -0
- package/dist/components/InteractionLayer/InteractionLayer.js.map +1 -0
- package/dist/components/Logo/index.cjs +2 -0
- package/dist/components/Logo/index.cjs.map +1 -0
- package/dist/components/Logo/index.d.ts +42 -12
- package/dist/components/Logo/index.js +1464 -0
- package/dist/components/Logo/index.js.map +1 -0
- package/dist/components/Menu/Menu.cjs +2 -0
- package/dist/components/Menu/Menu.cjs.map +1 -0
- package/dist/components/Menu/Menu.js +194 -0
- package/dist/components/Menu/Menu.js.map +1 -0
- package/dist/components/Messagebox/Messagebox.cjs +2 -0
- package/dist/components/Messagebox/Messagebox.cjs.map +1 -0
- package/dist/components/Messagebox/Messagebox.d.ts +9 -3
- package/dist/components/Messagebox/Messagebox.js +84 -0
- package/dist/components/Messagebox/Messagebox.js.map +1 -0
- package/dist/components/Messagebox/index.d.ts +1 -1
- package/dist/components/Modal/Modal.cjs +2 -0
- package/dist/components/Modal/Modal.cjs.map +1 -0
- package/dist/components/Modal/Modal.js +196 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/ModalBase.cjs +2 -0
- package/dist/components/Modal/ModalBase.cjs.map +1 -0
- package/dist/components/Modal/ModalBase.js +32 -0
- package/dist/components/Modal/ModalBase.js.map +1 -0
- package/dist/components/Nav/Nav.cjs +2 -0
- package/dist/components/Nav/Nav.cjs.map +1 -0
- package/dist/components/Nav/Nav.js +73 -0
- package/dist/components/Nav/Nav.js.map +1 -0
- package/dist/components/Overlay/Overlay.cjs +2 -0
- package/dist/components/Overlay/Overlay.cjs.map +1 -0
- package/dist/components/Overlay/Overlay.d.ts +12 -4
- package/dist/components/Overlay/Overlay.js +24 -0
- package/dist/components/Overlay/Overlay.js.map +1 -0
- package/dist/components/Overlay/index.d.ts +1 -1
- package/dist/components/Pagination/Pagination.cjs +2 -0
- package/dist/components/Pagination/Pagination.cjs.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +3 -2
- package/dist/components/Pagination/Pagination.js +113 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Panel/Panel.cjs +2 -0
- package/dist/components/Panel/Panel.cjs.map +1 -0
- package/dist/components/Panel/Panel.js +55 -0
- package/dist/components/Panel/Panel.js.map +1 -0
- package/dist/components/Popover/Popover.cjs +2 -0
- package/dist/components/Popover/Popover.cjs.map +1 -0
- package/dist/components/Popover/Popover.d.ts +9 -2
- package/dist/components/Popover/Popover.js +75 -0
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/ProgressBar/ProgressBar.cjs +2 -0
- package/dist/components/ProgressBar/ProgressBar.cjs.map +1 -0
- package/dist/components/ProgressBar/ProgressBar.js +41 -0
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -0
- package/dist/components/Radio/Radio.cjs +2 -0
- package/dist/components/Radio/Radio.cjs.map +1 -0
- package/dist/components/Radio/Radio.js +52 -0
- package/dist/components/Radio/Radio.js.map +1 -0
- package/dist/components/ScrollArea/ScrollArea.cjs +2 -0
- package/dist/components/ScrollArea/ScrollArea.cjs.map +1 -0
- package/dist/components/ScrollArea/ScrollArea.js +42 -0
- package/dist/components/ScrollArea/ScrollArea.js.map +1 -0
- package/dist/components/Segmented/Segmented.cjs +2 -0
- package/dist/components/Segmented/Segmented.cjs.map +1 -0
- package/dist/components/Segmented/Segmented.js +61 -0
- package/dist/components/Segmented/Segmented.js.map +1 -0
- package/dist/components/SelectBox/SelectBox.cjs +2 -0
- package/dist/components/SelectBox/SelectBox.cjs.map +1 -0
- package/dist/components/SelectBox/SelectBox.d.ts +6 -2
- package/dist/components/SelectBox/SelectBox.js +72 -0
- package/dist/components/SelectBox/SelectBox.js.map +1 -0
- package/dist/components/SelectButton/SelectButton.cjs +2 -0
- package/dist/components/SelectButton/SelectButton.cjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.js +43 -0
- package/dist/components/SelectButton/SelectButton.js.map +1 -0
- package/dist/components/ShapeEditor/ShapeEditor.cjs +2 -0
- package/dist/components/ShapeEditor/ShapeEditor.cjs.map +1 -0
- package/dist/components/ShapeEditor/ShapeEditor.d.ts +4 -6
- package/dist/components/ShapeEditor/ShapeEditor.js +585 -0
- package/dist/components/ShapeEditor/ShapeEditor.js.map +1 -0
- package/dist/components/ShapeEditor/ShapeViewer.cjs +2 -0
- package/dist/components/ShapeEditor/ShapeViewer.cjs.map +1 -0
- package/dist/components/ShapeEditor/ShapeViewer.js +299 -0
- package/dist/components/ShapeEditor/ShapeViewer.js.map +1 -0
- package/dist/components/ShapeEditor/_components/AssistantOverlay.cjs +2 -0
- package/dist/components/ShapeEditor/_components/AssistantOverlay.cjs.map +1 -0
- package/dist/components/ShapeEditor/_components/AssistantOverlay.js +64 -0
- package/dist/components/ShapeEditor/_components/AssistantOverlay.js.map +1 -0
- package/dist/components/ShapeEditor/_components/ContextMenu.cjs +2 -0
- package/dist/components/ShapeEditor/_components/ContextMenu.cjs.map +1 -0
- package/dist/components/ShapeEditor/_components/ContextMenu.js +67 -0
- package/dist/components/ShapeEditor/_components/ContextMenu.js.map +1 -0
- package/dist/components/ShapeEditor/_components/CursorGuide.cjs +2 -0
- package/dist/components/ShapeEditor/_components/CursorGuide.cjs.map +1 -0
- package/dist/components/ShapeEditor/_components/CursorGuide.js +56 -0
- package/dist/components/ShapeEditor/_components/CursorGuide.js.map +1 -0
- package/dist/components/ShapeEditor/_components/ImageStateOverlay.cjs +2 -0
- package/dist/components/ShapeEditor/_components/ImageStateOverlay.cjs.map +1 -0
- package/dist/components/ShapeEditor/_components/ImageStateOverlay.js +90 -0
- package/dist/components/ShapeEditor/_components/ImageStateOverlay.js.map +1 -0
- package/dist/components/ShapeEditor/_components/Minimap.cjs +2 -0
- package/dist/components/ShapeEditor/_components/Minimap.cjs.map +1 -0
- package/dist/components/ShapeEditor/_components/Minimap.d.ts +1 -2
- package/dist/components/ShapeEditor/_components/Minimap.js +175 -0
- package/dist/components/ShapeEditor/_components/Minimap.js.map +1 -0
- package/dist/components/ShapeEditor/_components/MinimapShape.cjs +2 -0
- package/dist/components/ShapeEditor/_components/MinimapShape.cjs.map +1 -0
- package/dist/components/ShapeEditor/_components/MinimapShape.js +55 -0
- package/dist/components/ShapeEditor/_components/MinimapShape.js.map +1 -0
- package/dist/components/ShapeEditor/_components/RegionOverlay.cjs +2 -0
- package/dist/components/ShapeEditor/_components/RegionOverlay.cjs.map +1 -0
- package/dist/components/ShapeEditor/_components/RegionOverlay.js +59 -0
- package/dist/components/ShapeEditor/_components/RegionOverlay.js.map +1 -0
- package/dist/components/ShapeEditor/_components/SelectionInfo.cjs +2 -0
- package/dist/components/ShapeEditor/_components/SelectionInfo.cjs.map +1 -0
- package/dist/components/ShapeEditor/_components/SelectionInfo.js +115 -0
- package/dist/components/ShapeEditor/_components/SelectionInfo.js.map +1 -0
- package/dist/components/ShapeEditor/_components/SettingsPanel.cjs +2 -0
- package/dist/components/ShapeEditor/_components/SettingsPanel.cjs.map +1 -0
- package/dist/components/ShapeEditor/_components/SettingsPanel.d.ts +2 -4
- package/dist/components/ShapeEditor/_components/SettingsPanel.js +167 -0
- package/dist/components/ShapeEditor/_components/SettingsPanel.js.map +1 -0
- package/dist/components/ShapeEditor/_constants.cjs +2 -0
- package/dist/components/ShapeEditor/_constants.cjs.map +1 -0
- package/dist/components/ShapeEditor/_constants.js +7 -0
- package/dist/components/ShapeEditor/_constants.js.map +1 -0
- package/dist/components/ShapeEditor/_model/brush.cjs +2 -0
- package/dist/components/ShapeEditor/_model/brush.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/brush.js +27 -0
- package/dist/components/ShapeEditor/_model/brush.js.map +1 -0
- package/dist/components/ShapeEditor/_model/clipboard.cjs +2 -0
- package/dist/components/ShapeEditor/_model/clipboard.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/clipboard.js +85 -0
- package/dist/components/ShapeEditor/_model/clipboard.js.map +1 -0
- package/dist/components/ShapeEditor/_model/cursors.cjs +2 -0
- package/dist/components/ShapeEditor/_model/cursors.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/cursors.js +52 -0
- package/dist/components/ShapeEditor/_model/cursors.js.map +1 -0
- package/dist/components/ShapeEditor/_model/geometry.cjs +2 -0
- package/dist/components/ShapeEditor/_model/geometry.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/geometry.d.ts +4 -0
- package/dist/components/ShapeEditor/_model/geometry.js +431 -0
- package/dist/components/ShapeEditor/_model/geometry.js.map +1 -0
- package/dist/components/ShapeEditor/_model/imageDiagnosis.cjs +2 -0
- package/dist/components/ShapeEditor/_model/imageDiagnosis.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/imageDiagnosis.d.ts +2 -0
- package/dist/components/ShapeEditor/_model/imageDiagnosis.js +138 -0
- package/dist/components/ShapeEditor/_model/imageDiagnosis.js.map +1 -0
- package/dist/components/ShapeEditor/_model/imageLoad.cjs +2 -0
- package/dist/components/ShapeEditor/_model/imageLoad.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/imageLoad.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/imageLoad.js +68 -0
- package/dist/components/ShapeEditor/_model/imageLoad.js.map +1 -0
- package/dist/components/ShapeEditor/_model/imageTiles.cjs +2 -0
- package/dist/components/ShapeEditor/_model/imageTiles.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/imageTiles.js +28 -0
- package/dist/components/ShapeEditor/_model/imageTiles.js.map +1 -0
- package/dist/components/ShapeEditor/_model/keymap.cjs +2 -0
- package/dist/components/ShapeEditor/_model/keymap.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/keymap.js +75 -0
- package/dist/components/ShapeEditor/_model/keymap.js.map +1 -0
- package/dist/components/ShapeEditor/_model/overlays.cjs +2 -0
- package/dist/components/ShapeEditor/_model/overlays.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/overlays.d.ts +1 -5
- package/dist/components/ShapeEditor/_model/overlays.js +186 -0
- package/dist/components/ShapeEditor/_model/overlays.js.map +1 -0
- package/dist/components/ShapeEditor/_model/pinIcon.cjs +2 -0
- package/dist/components/ShapeEditor/_model/pinIcon.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/pinIcon.js +10 -0
- package/dist/components/ShapeEditor/_model/pinIcon.js.map +1 -0
- package/dist/components/ShapeEditor/_model/polygonFill.cjs +2 -0
- package/dist/components/ShapeEditor/_model/polygonFill.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/polygonFill.d.ts +2 -0
- package/dist/components/ShapeEditor/_model/polygonFill.js +12 -0
- package/dist/components/ShapeEditor/_model/polygonFill.js.map +1 -0
- package/dist/components/ShapeEditor/_model/props.d.ts +8 -491
- package/dist/components/ShapeEditor/_model/scalarMask.cjs +2 -0
- package/dist/components/ShapeEditor/_model/scalarMask.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/scalarMask.js +188 -0
- package/dist/components/ShapeEditor/_model/scalarMask.js.map +1 -0
- package/dist/components/ShapeEditor/_model/shapeHitTest.cjs +2 -0
- package/dist/components/ShapeEditor/_model/shapeHitTest.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/shapeHitTest.d.ts +14 -0
- package/dist/components/ShapeEditor/_model/shapeHitTest.js +38 -0
- package/dist/components/ShapeEditor/_model/shapeHitTest.js.map +1 -0
- package/dist/components/ShapeEditor/_model/shapeRenderStyle.cjs +2 -0
- package/dist/components/ShapeEditor/_model/shapeRenderStyle.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/shapeRenderStyle.js +19 -0
- package/dist/components/ShapeEditor/_model/shapeRenderStyle.js.map +1 -0
- package/dist/components/ShapeEditor/_model/strings.cjs +2 -0
- package/dist/components/ShapeEditor/_model/strings.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/strings.js +92 -0
- package/dist/components/ShapeEditor/_model/strings.js.map +1 -0
- package/dist/components/ShapeEditor/_model/tools.cjs +2 -0
- package/dist/components/ShapeEditor/_model/tools.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/tools.js +19 -0
- package/dist/components/ShapeEditor/_model/tools.js.map +1 -0
- package/dist/components/ShapeEditor/_model/types/assistant.d.ts +35 -0
- package/dist/components/ShapeEditor/_model/types/handle.d.ts +98 -0
- package/dist/components/ShapeEditor/_model/types/props.d.ts +367 -0
- package/dist/components/ShapeEditor/_model/viewSettings.cjs +2 -0
- package/dist/components/ShapeEditor/_model/viewSettings.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/viewSettings.d.ts +2 -0
- package/dist/components/ShapeEditor/_model/viewSettings.js +57 -0
- package/dist/components/ShapeEditor/_model/viewSettings.js.map +1 -0
- package/dist/components/ShapeEditor/_model/viewerPatch.cjs +2 -0
- package/dist/components/ShapeEditor/_model/viewerPatch.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/viewerPatch.js +57 -0
- package/dist/components/ShapeEditor/_model/viewerPatch.js.map +1 -0
- package/dist/components/ShapeEditor/_model/viewport.cjs +2 -0
- package/dist/components/ShapeEditor/_model/viewport.cjs.map +1 -0
- package/dist/components/ShapeEditor/_model/viewport.d.ts +9 -1
- package/dist/components/ShapeEditor/_model/viewport.js +79 -0
- package/dist/components/ShapeEditor/_model/viewport.js.map +1 -0
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.cjs +2 -0
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.cjs.map +1 -0
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.d.ts +18 -85
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.js +305 -0
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.js.map +1 -0
- package/dist/components/ShapeEditor/_renderers/imageLayer.cjs +2 -0
- package/dist/components/ShapeEditor/_renderers/imageLayer.cjs.map +1 -0
- package/dist/components/ShapeEditor/_renderers/imageLayer.d.ts +35 -0
- package/dist/components/ShapeEditor/_renderers/imageLayer.js +59 -0
- package/dist/components/ShapeEditor/_renderers/imageLayer.js.map +1 -0
- package/dist/components/ShapeEditor/_renderers/overlayLayer.cjs +2 -0
- package/dist/components/ShapeEditor/_renderers/overlayLayer.cjs.map +1 -0
- package/dist/components/ShapeEditor/_renderers/overlayLayer.d.ts +36 -0
- package/dist/components/ShapeEditor/_renderers/overlayLayer.js +65 -0
- package/dist/components/ShapeEditor/_renderers/overlayLayer.js.map +1 -0
- package/dist/components/ShapeEditor/_renderers/previewLayer.cjs +2 -0
- package/dist/components/ShapeEditor/_renderers/previewLayer.cjs.map +1 -0
- package/dist/components/ShapeEditor/_renderers/previewLayer.d.ts +32 -0
- package/dist/components/ShapeEditor/_renderers/previewLayer.js +109 -0
- package/dist/components/ShapeEditor/_renderers/previewLayer.js.map +1 -0
- package/dist/components/ShapeEditor/_renderers/shapeLayer.cjs +2 -0
- package/dist/components/ShapeEditor/_renderers/shapeLayer.cjs.map +1 -0
- package/dist/components/ShapeEditor/_renderers/shapeLayer.d.ts +49 -0
- package/dist/components/ShapeEditor/_renderers/shapeLayer.js +94 -0
- package/dist/components/ShapeEditor/_renderers/shapeLayer.js.map +1 -0
- package/dist/components/ShapeEditor/_renderers/shapePainter.cjs +2 -0
- package/dist/components/ShapeEditor/_renderers/shapePainter.cjs.map +1 -0
- package/dist/components/ShapeEditor/_renderers/shapePainter.d.ts +27 -0
- package/dist/components/ShapeEditor/_renderers/shapePainter.js +166 -0
- package/dist/components/ShapeEditor/_renderers/shapePainter.js.map +1 -0
- package/dist/components/ShapeEditor/_renderers/transformDriver.cjs +2 -0
- package/dist/components/ShapeEditor/_renderers/transformDriver.cjs.map +1 -0
- package/dist/components/ShapeEditor/_renderers/transformDriver.d.ts +55 -0
- package/dist/components/ShapeEditor/_renderers/transformDriver.js +94 -0
- package/dist/components/ShapeEditor/_renderers/transformDriver.js.map +1 -0
- package/dist/components/ShapeEditor/_renderers/transformSession.cjs +2 -0
- package/dist/components/ShapeEditor/_renderers/transformSession.cjs.map +1 -0
- package/dist/components/ShapeEditor/_renderers/transformSession.d.ts +9 -3
- package/dist/components/ShapeEditor/_renderers/transformSession.js +135 -0
- package/dist/components/ShapeEditor/_renderers/transformSession.js.map +1 -0
- package/dist/components/ShapeEditor/_renderers/transformerLayer.cjs +2 -0
- package/dist/components/ShapeEditor/_renderers/transformerLayer.cjs.map +1 -0
- package/dist/components/ShapeEditor/_renderers/transformerLayer.d.ts +69 -0
- package/dist/components/ShapeEditor/_renderers/transformerLayer.js +248 -0
- package/dist/components/ShapeEditor/_renderers/transformerLayer.js.map +1 -0
- package/dist/components/ShapeEditor/_renderers/types.d.ts +7 -9
- package/dist/components/ShapeEditor/_state/buildContextMenuItems.cjs +2 -0
- package/dist/components/ShapeEditor/_state/buildContextMenuItems.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/buildContextMenuItems.d.ts +26 -0
- package/dist/components/ShapeEditor/_state/buildContextMenuItems.js +118 -0
- package/dist/components/ShapeEditor/_state/buildContextMenuItems.js.map +1 -0
- package/dist/components/ShapeEditor/_state/buildHotkeyActions.cjs +2 -0
- package/dist/components/ShapeEditor/_state/buildHotkeyActions.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/buildHotkeyActions.d.ts +42 -0
- package/dist/components/ShapeEditor/_state/buildHotkeyActions.js +86 -0
- package/dist/components/ShapeEditor/_state/buildHotkeyActions.js.map +1 -0
- package/dist/components/ShapeEditor/_state/createInteractionController.cjs +2 -0
- package/dist/components/ShapeEditor/_state/createInteractionController.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/createInteractionController.d.ts +14 -1
- package/dist/components/ShapeEditor/_state/createInteractionController.js +396 -0
- package/dist/components/ShapeEditor/_state/createInteractionController.js.map +1 -0
- package/dist/components/ShapeEditor/_state/drawSessionState.cjs +2 -0
- package/dist/components/ShapeEditor/_state/drawSessionState.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/drawSessionState.js +21 -0
- package/dist/components/ShapeEditor/_state/drawSessionState.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useAssistant.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useAssistant.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useAssistant.js +171 -0
- package/dist/components/ShapeEditor/_state/useAssistant.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useDrawSession.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useDrawSession.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useDrawSession.js +352 -0
- package/dist/components/ShapeEditor/_state/useDrawSession.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useEditorDocument.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useEditorDocument.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useEditorDocument.js +143 -0
- package/dist/components/ShapeEditor/_state/useEditorDocument.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useEditorHandle.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useEditorHandle.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useEditorHandle.d.ts +34 -0
- package/dist/components/ShapeEditor/_state/useEditorHandle.js +95 -0
- package/dist/components/ShapeEditor/_state/useEditorHandle.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.js +44 -0
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useEditorView.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useEditorView.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useEditorView.d.ts +15 -0
- package/dist/components/ShapeEditor/_state/useEditorView.js +45 -0
- package/dist/components/ShapeEditor/_state/useEditorView.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.d.ts +4 -5
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.js +125 -0
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useLatestRef.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useLatestRef.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useLatestRef.d.ts +7 -0
- package/dist/components/ShapeEditor/_state/useLatestRef.js +13 -0
- package/dist/components/ShapeEditor/_state/useLatestRef.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useMinimapNavigation.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useMinimapNavigation.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useMinimapNavigation.js +118 -0
- package/dist/components/ShapeEditor/_state/useMinimapNavigation.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useMinimapSync.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useMinimapSync.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useMinimapSync.js +69 -0
- package/dist/components/ShapeEditor/_state/useMinimapSync.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useSelectionActions.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useSelectionActions.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useSelectionActions.d.ts +1 -0
- package/dist/components/ShapeEditor/_state/useSelectionActions.js +151 -0
- package/dist/components/ShapeEditor/_state/useSelectionActions.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useSelectionInfoOverlay.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useSelectionInfoOverlay.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useSelectionInfoOverlay.d.ts +32 -0
- package/dist/components/ShapeEditor/_state/useSelectionInfoOverlay.js +64 -0
- package/dist/components/ShapeEditor/_state/useSelectionInfoOverlay.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useSelectionModel.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useSelectionModel.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useSelectionModel.d.ts +24 -0
- package/dist/components/ShapeEditor/_state/useSelectionModel.js +58 -0
- package/dist/components/ShapeEditor/_state/useSelectionModel.js.map +1 -0
- package/dist/components/ShapeEditor/_state/useViewportControls.cjs +2 -0
- package/dist/components/ShapeEditor/_state/useViewportControls.cjs.map +1 -0
- package/dist/components/ShapeEditor/_state/useViewportControls.js +79 -0
- package/dist/components/ShapeEditor/_state/useViewportControls.js.map +1 -0
- package/dist/components/ShapeEditor/index.d.ts +0 -1
- package/dist/components/Shortcut/Shortcut.cjs +2 -0
- package/dist/components/Shortcut/Shortcut.cjs.map +1 -0
- package/dist/components/Shortcut/Shortcut.js +22 -0
- package/dist/components/Shortcut/Shortcut.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.cjs +2 -0
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.js +17 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/Slider/Slider.cjs +2 -0
- package/dist/components/Slider/Slider.cjs.map +1 -0
- package/dist/components/Slider/Slider.d.ts +3 -1
- package/dist/components/Slider/Slider.js +69 -0
- package/dist/components/Slider/Slider.js.map +1 -0
- package/dist/components/Spinner/Spinner.cjs +2 -0
- package/dist/components/Spinner/Spinner.cjs.map +1 -0
- package/dist/components/Spinner/Spinner.js +27 -0
- package/dist/components/Spinner/Spinner.js.map +1 -0
- package/dist/components/Switch/Switch.cjs +2 -0
- package/dist/components/Switch/Switch.cjs.map +1 -0
- package/dist/components/Switch/Switch.js +45 -0
- package/dist/components/Switch/Switch.js.map +1 -0
- package/dist/components/Tab/Tab.cjs +2 -0
- package/dist/components/Tab/Tab.cjs.map +1 -0
- package/dist/components/Tab/Tab.js +39 -0
- package/dist/components/Tab/Tab.js.map +1 -0
- package/dist/components/Tag/Tag.cjs +2 -0
- package/dist/components/Tag/Tag.cjs.map +1 -0
- package/dist/components/Tag/Tag.d.ts +6 -3
- package/dist/components/Tag/Tag.js +60 -0
- package/dist/components/Tag/Tag.js.map +1 -0
- package/dist/components/Tag/index.d.ts +1 -1
- package/dist/components/Tagbox/Tagbox.cjs +2 -0
- package/dist/components/Tagbox/Tagbox.cjs.map +1 -0
- package/dist/components/Tagbox/Tagbox.d.ts +5 -3
- package/dist/components/Tagbox/Tagbox.js +85 -0
- package/dist/components/Tagbox/Tagbox.js.map +1 -0
- package/dist/components/Textarea/Textarea.cjs +2 -0
- package/dist/components/Textarea/Textarea.cjs.map +1 -0
- package/dist/components/Textarea/Textarea.js +55 -0
- package/dist/components/Textarea/Textarea.js.map +1 -0
- package/dist/components/Textbox/Textbox.cjs +2 -0
- package/dist/components/Textbox/Textbox.cjs.map +1 -0
- package/dist/components/Textbox/Textbox.d.ts +9 -4
- package/dist/components/Textbox/Textbox.js +59 -0
- package/dist/components/Textbox/Textbox.js.map +1 -0
- package/dist/components/Textbox/index.d.ts +1 -1
- package/dist/components/Toast/Toast.cjs +2 -0
- package/dist/components/Toast/Toast.cjs.map +1 -0
- package/dist/components/Toast/Toast.d.ts +7 -3
- package/dist/components/Toast/Toast.js +81 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleButton.cjs +2 -0
- package/dist/components/ToggleButton/ToggleButton.cjs.map +1 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +5 -2
- package/dist/components/ToggleButton/ToggleButton.js +117 -0
- package/dist/components/ToggleButton/ToggleButton.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.cjs +2 -0
- package/dist/components/Tooltip/Tooltip.cjs.map +1 -0
- package/dist/components/Tooltip/Tooltip.js +51 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/Typography/Typography.cjs +2 -0
- package/dist/components/Typography/Typography.cjs.map +1 -0
- package/dist/components/Typography/Typography.js +59 -0
- package/dist/components/Typography/Typography.js.map +1 -0
- package/dist/components/UploadArea/UploadArea.cjs +2 -0
- package/dist/components/UploadArea/UploadArea.cjs.map +1 -0
- package/dist/components/UploadArea/UploadArea.js +100 -0
- package/dist/components/UploadArea/UploadArea.js.map +1 -0
- package/dist/fonts.css +4 -0
- package/dist/index.cjs +1 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +57 -4614
- package/dist/shape-editor.cjs +1 -2
- package/dist/shape-editor.js +7 -6885
- package/dist/styles.css +3 -1
- package/dist/tokens/tokens.css +18 -2
- package/dist/utils/keyboard.cjs +2 -0
- package/dist/utils/keyboard.cjs.map +1 -0
- package/dist/utils/keyboard.js +14 -0
- package/dist/utils/keyboard.js.map +1 -0
- package/dist/utils/useControllableState.cjs +2 -0
- package/dist/utils/useControllableState.cjs.map +1 -0
- package/dist/utils/useControllableState.d.ts +17 -0
- package/dist/utils/useControllableState.js +13 -0
- package/dist/utils/useControllableState.js.map +1 -0
- package/dist/utils/useModalAutoFocus.cjs +2 -0
- package/dist/utils/useModalAutoFocus.cjs.map +1 -0
- package/dist/utils/useModalAutoFocus.d.ts +7 -1
- package/dist/utils/useModalAutoFocus.js +22 -0
- package/dist/utils/useModalAutoFocus.js.map +1 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/package.json +7 -3
- package/dist/Button-CNdJSINB.js +0 -7065
- package/dist/Button-CNdJSINB.js.map +0 -1
- package/dist/Button-DI8Fzb0u.cjs +0 -2
- package/dist/Button-DI8Fzb0u.cjs.map +0 -1
- package/dist/IconButton-CQyt0J6s.js +0 -209
- package/dist/IconButton-CQyt0J6s.js.map +0 -1
- package/dist/IconButton-bfbqZDue.cjs +0 -2
- package/dist/IconButton-bfbqZDue.cjs.map +0 -1
- package/dist/comment.cjs.map +0 -1
- package/dist/comment.js.map +0 -1
- package/dist/components/Calendar/Calendar.test.d.ts +0 -1
- package/dist/components/Calendar/date.test.d.ts +0 -1
- package/dist/components/Chips/index.d.ts +0 -19
- package/dist/components/Comment/mentionContent.test.d.ts +0 -1
- package/dist/components/ShapeEditor/_model/clipboard.test.d.ts +0 -1
- package/dist/components/ShapeEditor/_model/cursors.test.d.ts +0 -1
- package/dist/components/ShapeEditor/_model/geometry.evenodd-audit.test.d.ts +0 -1
- package/dist/components/ShapeEditor/_model/geometry.test.d.ts +0 -1
- package/dist/components/ShapeEditor/_model/imageDiagnosis.test.d.ts +0 -1
- package/dist/components/ShapeEditor/_model/imageLoad.test.d.ts +0 -1
- package/dist/components/ShapeEditor/_model/konva.d.ts +0 -4
- package/dist/components/ShapeEditor/_model/overlays.test.d.ts +0 -1
- package/dist/components/ShapeEditor/_model/viewSettings.test.d.ts +0 -1
- package/dist/components/ShapeEditor/_model/viewerPatch.test.d.ts +0 -1
- package/dist/components/ShapeEditor/_renderers/KonvaRenderer.d.ts +0 -138
- package/dist/components/ShapeEditor/_state/createInteractionController.test.d.ts +0 -1
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.test.d.ts +0 -1
- package/dist/components/Table/Table.d.ts +0 -71
- package/dist/components/Table/index.d.ts +0 -2
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/keyboard-B4NpK7Sx.js +0 -398
- package/dist/keyboard-B4NpK7Sx.js.map +0 -1
- package/dist/keyboard-D3yExFth.cjs +0 -2
- package/dist/keyboard-D3yExFth.cjs.map +0 -1
- package/dist/shape-editor.cjs.map +0 -1
- package/dist/shape-editor.js.map +0 -1
|
@@ -1,496 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ShapeEditor 공개 타입의 단일 진입점. 정의는 `./types/{props,handle,assistant}`로
|
|
3
|
+
* 나뉘어 있고, 기존 import 경로(`_model/props`)는 그대로 유지된다.
|
|
4
|
+
*/
|
|
5
|
+
import type { EditorShape, Point, ShapeStyle, Viewport } from "./geometry";
|
|
5
6
|
import type { EditorAction, KeymapOverrides } from "./keymap";
|
|
6
7
|
import type { PolygonArea, RectArea, RegionMask, RegionOutlineStyle } from "./overlays";
|
|
7
|
-
import type { EditorStringsOverride } from "./strings";
|
|
8
8
|
import type { BrushScalarMode, Tool } from "./tools";
|
|
9
9
|
import type { ViewSettings } from "./viewSettings";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* 에디터가 **자기 도형 문서와 undo/redo 히스토리를 소유**한다(tldraw/Excalidraw 식).
|
|
14
|
-
* 전역 zustand 스토어가 아니라 컴포넌트 로컬 상태라 멀티 인스턴스 안전. 호스트는
|
|
15
|
-
* `initialShapes`로 시드하고, 변경은 이벤트로 받아 영속화하며, 호스트發 수정은
|
|
16
|
-
* 명령형 핸들(ShapeEditorHandle)로 요청한다.
|
|
17
|
-
*
|
|
18
|
-
* 클래스/라벨 개념은 없다 — 색은 style, 분류는 meta(불투명), 새 도형 스타일/메타는
|
|
19
|
-
* draftStyle/draftMeta로 호스트가 주입한다. id는 에디터가 클라이언트 생성한다.
|
|
20
|
-
*/
|
|
21
|
-
export interface EditorOverlayMarker<TMeta = unknown> {
|
|
22
|
-
id: string;
|
|
23
|
-
point: Point;
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
selected?: boolean;
|
|
26
|
-
meta?: TMeta;
|
|
27
|
-
/**
|
|
28
|
-
* 앵커점을 마커 콘텐츠의 어디에 맞출지. "center"(기본)=중앙, "topLeft"=좌상단 원점.
|
|
29
|
-
* 코멘트 핀처럼 특정 모서리(뾰족한 끝)로 위치를 가리켜야 하는 마커는 "topLeft"를 쓰고
|
|
30
|
-
* 콘텐츠에서 오프셋으로 원하는 모서리를 원점에 맞춘다. 확대/축소 시에도 그 점이 고정된다.
|
|
31
|
-
*/
|
|
32
|
-
anchor?: "center" | "topLeft";
|
|
33
|
-
}
|
|
34
|
-
/** 우클릭 컨텍스트 메뉴 항목(도메인 무관). */
|
|
35
|
-
export type ContextMenuItem = {
|
|
36
|
-
/** 기본 항목 식별자(예: "delete"). 호스트는 라벨 문자열 대신 이걸로 필터링한다. */
|
|
37
|
-
id?: string;
|
|
38
|
-
label: string;
|
|
39
|
-
onClick: () => void;
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
danger?: boolean;
|
|
42
|
-
shortcut?: string;
|
|
43
|
-
/** 라벨 왼쪽에 표시할 아이콘(예: AI 어시스트 항목의 마법봉). */
|
|
44
|
-
icon?: ReactNode;
|
|
45
|
-
} | {
|
|
46
|
-
separator: true;
|
|
47
|
-
};
|
|
48
|
-
export interface EditorPointerEvent {
|
|
49
|
-
pointerId?: number;
|
|
50
|
-
button?: number;
|
|
51
|
-
shiftKey?: boolean;
|
|
52
|
-
altKey?: boolean;
|
|
53
|
-
ctrlKey?: boolean;
|
|
54
|
-
metaKey?: boolean;
|
|
55
|
-
global?: Point;
|
|
56
|
-
insideCanvas?: boolean;
|
|
57
|
-
}
|
|
58
|
-
export interface EditorCanvasViewport {
|
|
59
|
-
scale: number;
|
|
60
|
-
x: number;
|
|
61
|
-
y: number;
|
|
62
|
-
}
|
|
63
|
-
export interface EditorExternalToolContext {
|
|
64
|
-
point: Point;
|
|
65
|
-
targetId?: string | null;
|
|
66
|
-
event: EditorPointerEvent;
|
|
67
|
-
readOnly?: boolean;
|
|
68
|
-
viewport: EditorCanvasViewport;
|
|
69
|
-
}
|
|
70
|
-
export interface EditorExternalTool {
|
|
71
|
-
id: string;
|
|
72
|
-
cursor?: string;
|
|
73
|
-
onPointerDown?: (ctx: EditorExternalToolContext) => void;
|
|
74
|
-
onPointerMove?: (ctx: EditorExternalToolContext) => void;
|
|
75
|
-
onPointerUp?: (ctx: EditorExternalToolContext) => void;
|
|
76
|
-
/**
|
|
77
|
-
* Esc 처리. false를 반환하면 "취소할 것이 없었다"는 뜻으로 Esc 사슬이 계속
|
|
78
|
-
* 진행된다(선택 해제 → 툴 SELECT 복귀 등). void/true는 소비로 간주.
|
|
79
|
-
*/
|
|
80
|
-
onCancel?: () => boolean | void;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* 선택 도형의 동적 정보(에디터 계산). 표시 텍스트는 호스트가 formatSelectionInfo로 결정.
|
|
84
|
-
* 좌표/크기는 이미지 픽셀 단위(뷰포트 줌과 무관).
|
|
85
|
-
*/
|
|
86
|
-
export interface EditorSelectionInfo<TMeta = unknown> {
|
|
87
|
-
shape: EditorShape<TMeta>;
|
|
88
|
-
/** bbox 좌상단 x (이미지 px). */
|
|
89
|
-
x: number;
|
|
90
|
-
/** bbox 좌상단 y (이미지 px). */
|
|
91
|
-
y: number;
|
|
92
|
-
/** bbox 너비 (이미지 px). */
|
|
93
|
-
width: number;
|
|
94
|
-
/** bbox 높이 (이미지 px). */
|
|
95
|
-
height: number;
|
|
96
|
-
}
|
|
97
|
-
export interface AssistantPromptPoint {
|
|
98
|
-
x: number;
|
|
99
|
-
y: number;
|
|
100
|
-
/** true=긍정(포함), false=부정(제외). */
|
|
101
|
-
positive: boolean;
|
|
102
|
-
}
|
|
103
|
-
/** 에디터가 수집해 호스트 infer로 넘기는 프롬프트(이미지 좌표). */
|
|
104
|
-
export type AssistantPrompt = {
|
|
105
|
-
kind: "box";
|
|
106
|
-
box: {
|
|
107
|
-
x: number;
|
|
108
|
-
y: number;
|
|
109
|
-
width: number;
|
|
110
|
-
height: number;
|
|
111
|
-
};
|
|
112
|
-
} | {
|
|
113
|
-
kind: "points";
|
|
114
|
-
points: AssistantPromptPoint[];
|
|
115
|
-
/** refine 대상(선택된 폴리곤 좌표). 없으면 신규. */
|
|
116
|
-
base?: Point[];
|
|
117
|
-
};
|
|
118
|
-
export interface EditorAssistant {
|
|
119
|
-
/**
|
|
120
|
-
* 프롬프트를 받아 폴리곤(들)을 추론해 반환. 각 폴리곤은 이미지 좌표 점 배열.
|
|
121
|
-
* null 또는 빈 배열이면 결과 없음(에디터가 프리뷰를 비움). 취소 시 reject 무방.
|
|
122
|
-
*/
|
|
123
|
-
infer: (prompt: AssistantPrompt) => Promise<Point[][] | null>;
|
|
124
|
-
/**
|
|
125
|
-
* ASSISTANT_RECT 도구가 추론 폴리곤을 어떤 사각형으로 커밋할지. 기본 "rect"(축정렬
|
|
126
|
-
* min/max 바운딩). "rotatedRect"면 최소넓이 회전사각형(OBB 디텍션 등). ASSISTANT_POLYGON
|
|
127
|
-
* (폴리곤 어시스트)에는 영향 없음.
|
|
128
|
-
*/
|
|
129
|
-
rectResult?: "rect" | "rotatedRect";
|
|
130
|
-
}
|
|
131
|
-
/** 편집 문서(시드 계약). id 변경=문서 전환, 같은 id의 URL 변경=화질 스왑. */
|
|
132
|
-
export interface ShapeEditorDocument<TMeta = unknown> {
|
|
133
|
-
/**
|
|
134
|
-
* 문서 identity — 전환/스왑 판정의 유일한 기준. URL은 identity가 아니다
|
|
135
|
-
* (다른 문서가 같은 URL을, 같은 문서가 다른 URL을 가질 수 있음).
|
|
136
|
-
*/
|
|
137
|
-
id: string;
|
|
138
|
-
/** 시드 이미지 URL. 빈 값 = 이미지 없는 문서(도형은 시드, 표시는 이미지 로드까지 보류). */
|
|
139
|
-
imageUrl: string;
|
|
140
|
-
/**
|
|
141
|
-
* 실제로 렌더할 URL(화질 스왑). 바꿔도 문서는 리셋되지 않는다.
|
|
142
|
-
* imageUrl과 픽셀 크기가 다르면 coordinateSize로 좌표계를 고정할 것.
|
|
143
|
-
*/
|
|
144
|
-
displayImageUrl?: string;
|
|
145
|
-
/**
|
|
146
|
-
* 도형 좌표계 크기(원본 픽셀). 지정하면 표시 이미지(썸네일 등)를 이 크기로 늘려
|
|
147
|
-
* 그린다 — 이미지 파일 크기와 좌표계가 다를 때(ShapeViewer coordinateSize와 동일
|
|
148
|
-
* 의미). displayImageUrl과 함께 쓰면 화질 변형 간 픽셀 크기가 달라도 좌표계가
|
|
149
|
-
* 고정된다. 미지정 시 로드된 이미지의 실제 픽셀 크기.
|
|
150
|
-
*
|
|
151
|
-
* imageSize: 좌표공간 안에서 이미지가 차지하는 크기(원점 기준). 이미지가
|
|
152
|
-
* 좌표공간의 일부만 덮는 경우에 지정 — 예: 여러 해상도가 원점을 공유하는
|
|
153
|
-
* 좌표계에서 좌표공간은 최대 해상도, 이미지는 선택 해상도. 미지정 시
|
|
154
|
-
* 좌표공간 전체로 늘려 그린다.
|
|
155
|
-
*/
|
|
156
|
-
coordinateSize?: {
|
|
157
|
-
width: number;
|
|
158
|
-
height: number;
|
|
159
|
-
imageSize?: {
|
|
160
|
-
width: number;
|
|
161
|
-
height: number;
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
/** 초기 도형(시드). 이후 문서는 에디터가 소유. */
|
|
165
|
-
initialShapes?: EditorShape<TMeta>[];
|
|
166
|
-
/**
|
|
167
|
-
* 시드 시 1회 적용할 초기 선택(도형 id) — 이후 선택은 에디터 소유라 같은
|
|
168
|
-
* 문서에서 값·데이터가 바뀌어도 되돌리지 않는다. 없는 id는 걸러진다.
|
|
169
|
-
*/
|
|
170
|
-
initialSelectedIds?: string[];
|
|
171
|
-
}
|
|
172
|
-
/** 미니맵 패널이 붙는 뷰어 모서리. */
|
|
173
|
-
export type MinimapPosition = "bottom-left" | "bottom-right" | "top-left" | "top-right";
|
|
174
|
-
export interface ShapeEditorProps<TMeta = unknown, TMarkerMeta = unknown> {
|
|
175
|
-
/** 편집 문서(시드 계약). null = 문서 없음(시드 대기) — 센티널 값 대신 null로. */
|
|
176
|
-
document: ShapeEditorDocument<TMeta> | null;
|
|
177
|
-
/**
|
|
178
|
-
* 시스템 클립보드 공유 범위. 같은 값의 에디터끼리만 도형을 붙여넣을 수 있다.
|
|
179
|
-
* 프로젝트처럼 meta의 의미가 같은 범위의 안정적인 식별자를 전달한다.
|
|
180
|
-
* 미지정 시 현재 문서(identity) 안에서만 공유한다.
|
|
181
|
-
*/
|
|
182
|
-
clipboardScope?: string;
|
|
183
|
-
/**
|
|
184
|
-
* 이미지 로딩/에러 상태 오버레이 커스텀. 미지정 시 기본 스피너/에러 메시지.
|
|
185
|
-
* error일 때 diagnosis에 원인 분류·기술 근거가 실린다(진단 실패 시 null).
|
|
186
|
-
*/
|
|
187
|
-
renderImageState?: (status: "loading" | "error" | "missing", diagnosis?: EditorImageDiagnosis | null) => ReactNode;
|
|
188
|
-
/**
|
|
189
|
-
* true면 이미지를 반투명 검정으로 덮는다(레이블은 위에 밝게). 도메인 무관 —
|
|
190
|
-
* 호스트가 "라벨링 완료/잠금" 등 상태에서 켠다(기존 Editor의 isLabelingCompleted 딤).
|
|
191
|
-
*/
|
|
192
|
-
dimmed?: boolean;
|
|
193
|
-
/**
|
|
194
|
-
* 렌더 시점 도형 상호작용 오버라이드(도메인 무관). 문서를 바꾸지 않고(undo 안전)
|
|
195
|
-
* 표시/선택/편집 가능 여부를 동적으로 덮어쓴다 — 호스트의 가시성 토글(숨김),
|
|
196
|
-
* 임계값 필터(보이되 비활성) 등에 쓴다. null/undefined면 원본 유지.
|
|
197
|
-
* 새로 생성되는 도형에도 즉시 적용된다(id 목록이 아니라 판정 함수라서).
|
|
198
|
-
*/
|
|
199
|
-
overrideShapeInteraction?: (shape: EditorShape<TMeta>) => Partial<ShapeInteraction> | null | undefined;
|
|
200
|
-
/** 선택 도형 id. 제공하면 selection은 호스트가 소유하는 controlled 모드로 동작한다. */
|
|
201
|
-
selectedIds?: string[];
|
|
202
|
-
/**
|
|
203
|
-
* true면 SELECT 도구의 빈 공간 드래그 마퀴(범위 선택)를 끈다 — 클릭 단건 선택만.
|
|
204
|
-
* 빈 공간 클릭 시 선택 해제는 그대로 동작한다. 단건 선택만 허용하는 뷰어형
|
|
205
|
-
* 호스트(검수 상세 등)에서 켠다.
|
|
206
|
-
*/
|
|
207
|
-
disableMarquee?: boolean;
|
|
208
|
-
activeTool: Tool;
|
|
209
|
-
/** 없으면 그리기 비활성. */
|
|
210
|
-
draftStyle?: ShapeStyle;
|
|
211
|
-
draftMeta?: TMeta;
|
|
212
|
-
readOnly?: boolean;
|
|
213
|
-
/**
|
|
214
|
-
* 편집 잠금. true면 문서를 바꾸는 상호작용(그리기/이동/편집/어시스트)을 막고,
|
|
215
|
-
* 편집 시도(그리기 도구·도형 드래그·정점 편집 진입·방향키·삭제·복제·붙여넣기·
|
|
216
|
-
* 잘라내기·핸들의 createShapes/updateShapes/deleteShapes)에는 `onLockedInteraction`을
|
|
217
|
-
* 호출한다. 그 밖의 변경 경로(실행 취소, 겹침 순서, 핸들의 선택 기반 액션 등)는
|
|
218
|
-
* 알림 없이 막는다. 클릭 선택·마퀴·복사·팬·우클릭메뉴·외부도구(코멘트)는 허용.
|
|
219
|
-
* 도메인 무관 — 호스트가 "라벨링 완료" 등에서 켠다.
|
|
220
|
-
*/
|
|
221
|
-
locked?: boolean;
|
|
222
|
-
/** locked 상태에서 편집을 시도했을 때(호스트가 확인 모달 등을 띄운다). */
|
|
223
|
-
onLockedInteraction?: () => void;
|
|
224
|
-
/**
|
|
225
|
-
* 그리기 도구가 활성인데 `draftStyle`이 없어 그리기를 시작할 수 없을 때 호출.
|
|
226
|
-
* 도메인 무관 — 에디터는 "그릴 값이 없다"는 사실만 알리고, 그 의미(예: 호스트가
|
|
227
|
-
* 스타일을 만들 수단을 안내)는 호스트가 해석한다. 없으면 기존처럼 무시된다.
|
|
228
|
-
*/
|
|
229
|
-
onDrawAttemptWithoutDraft?: () => void;
|
|
230
|
-
/**
|
|
231
|
-
* Esc 처리 사슬(어시스트 취소 → 그리기 취소 → 선택 해제)이 전부 해당 없을 때 호출.
|
|
232
|
-
* 호스트가 "툴을 SELECT로 복귀 → 그래도 idle이면 에디터 닫기" 같은 후속 동작을
|
|
233
|
-
* 잇는 데 쓴다(기존 Editor의 Esc 사슬 꼬리).
|
|
234
|
-
*/
|
|
235
|
-
onIdleEscape?: () => void;
|
|
236
|
-
/**
|
|
237
|
-
* 문서 밖 장식 도형(예: 다른 해상도 가이드 사각형). 도형 레이어에 렌더만 되고
|
|
238
|
-
* 선택·undo 히스토리·히트테스트·getShapes()에서 완전히 제외된다 — 스타일 변경
|
|
239
|
-
* (hover 강조 등)은 prop 교체로 반영되며 히스토리에 쌓이지 않는다.
|
|
240
|
-
* z순서는 style.zIndex로 제어한다(음수면 문서 도형 아래).
|
|
241
|
-
*/
|
|
242
|
-
decorationShapes?: EditorShape<TMeta>[];
|
|
243
|
-
/** 이미지 위 가림 효과. 제품 의미는 호스트가 해석하고 에디터는 순수 영역만 렌더링한다. */
|
|
244
|
-
regionMask?: RegionMask;
|
|
245
|
-
overlayMarkers?: EditorOverlayMarker<TMarkerMeta>[];
|
|
246
|
-
renderOverlayMarker?: (marker: EditorOverlayMarker<TMarkerMeta>) => ReactNode;
|
|
247
|
-
onOverlayMarkerClick?: (marker: EditorOverlayMarker<TMarkerMeta>) => void;
|
|
248
|
-
renderImageOverlay?: (props: {
|
|
249
|
-
image: {
|
|
250
|
-
w: number;
|
|
251
|
-
h: number;
|
|
252
|
-
};
|
|
253
|
-
viewport: EditorCanvasViewport;
|
|
254
|
-
}) => ReactNode;
|
|
255
|
-
externalTools?: EditorExternalTool[];
|
|
256
|
-
/**
|
|
257
|
-
* AI 어시스트(SAM 식). 제공하면 ASSISTANT_POLYGON/ASSISTANT_POINT 도구가 동작한다.
|
|
258
|
-
* 에디터가 프롬프트를 모아 infer로 넘기고, 결과 폴리곤을 프리뷰→Enter로 커밋한다
|
|
259
|
-
* (draftStyle/draftMeta 적용). Esc로 취소.
|
|
260
|
-
*/
|
|
261
|
-
assistant?: EditorAssistant;
|
|
262
|
-
/**
|
|
263
|
-
* 선택 도형 위에 표시할 라벨(예: 클래스명). 반환하면 색 점 + 텍스트 배지가 뜬다.
|
|
264
|
-
* 도메인 무관 — meta 해석은 호스트.
|
|
265
|
-
*/
|
|
266
|
-
getSelectionLabel?: (shape: EditorShape<TMeta>) => string | undefined;
|
|
267
|
-
/**
|
|
268
|
-
* 선택 라벨 배지에서 도형 색을 나타내는 색 점을 숨긴다. 기본 false(표시).
|
|
269
|
-
* 클래스 색이 도메인상 의미가 없는 호스트에서 사용.
|
|
270
|
-
*/
|
|
271
|
-
hideSelectionLabelDot?: boolean;
|
|
272
|
-
/**
|
|
273
|
-
* 선택 도형 아래 표시할 정보 텍스트. 에디터가 계산한 픽셀 데이터(info)를 받아
|
|
274
|
-
* 프로덕트별 템플릿으로 포맷한다. 미지정 시 기본값 `W x H px`. 빈 문자열이면 숨김.
|
|
275
|
-
* 점 도형은 표시하지 않는다.
|
|
276
|
-
*/
|
|
277
|
-
formatSelectionInfo?: (info: EditorSelectionInfo<TMeta>) => string;
|
|
278
|
-
/**
|
|
279
|
-
* 보기 설정 초깃값(밝기/대비/픽셀화/선 두께/가이드·ROI 표시/줌 유지/휠 줌).
|
|
280
|
-
* 마운트 시 seed로만 쓰이고 이후엔 에디터 내부 설정 팝오버가 소유한다(uncontrolled).
|
|
281
|
-
* 지정하지 않은 키는 DEFAULT_VIEW_SETTINGS를 따른다.
|
|
282
|
-
* 숫자 값은 VIEW_SETTING_RANGES로 클램프된다(예: brightness 2 → 1.5).
|
|
283
|
-
*/
|
|
284
|
-
defaultViewSettings?: Partial<ViewSettings>;
|
|
285
|
-
/**
|
|
286
|
-
* 보기 설정 외부 동기화(선택). 여기 지정한 키의 값이 바뀌면 에디터 내부 설정에
|
|
287
|
-
* 반영된다(호스트 설정 UI → 에디터 방향). 에디터 내부 변경은 onViewSettingsChange로
|
|
288
|
-
* 나간다. 미지정 키는 계속 에디터 내부 소유.
|
|
289
|
-
* 여기 값도 VIEW_SETTING_RANGES로 클램프되므로, 범위 밖 저장값을 그대로 넘겨도
|
|
290
|
-
* 에디터는 범위 안 값으로 동작한다(호스트 저장값은 다음 설정 변경 시 교정된다).
|
|
291
|
-
*/
|
|
292
|
-
viewSettings?: Partial<ViewSettings>;
|
|
293
|
-
/**
|
|
294
|
-
* 미니맵 패널(축소맵+줌바+설정 버튼) 표시 여부(기본 true).
|
|
295
|
-
* 읽기전용 프리뷰 등 크롬이 부담스러운 콜사이트에서 끈다.
|
|
296
|
-
*/
|
|
297
|
-
showMinimap?: boolean;
|
|
298
|
-
/**
|
|
299
|
-
* 미니맵 패널이 붙는 모서리(기본 "bottom-left"). 위쪽 모서리에서는 줌 바가
|
|
300
|
-
* 위에 고정되고 축소맵이 아래로 펼쳐진다.
|
|
301
|
-
*/
|
|
302
|
-
minimapPosition?: MinimapPosition;
|
|
303
|
-
/** 미니맵 패널의 보기설정(기어) 버튼 표시 여부(기본 true). */
|
|
304
|
-
showViewSettings?: boolean;
|
|
305
|
-
/**
|
|
306
|
-
* 우클릭 컨텍스트 메뉴 항목 커스터마이즈. 에디터 기본 항목(defaults: 복제/삭제/
|
|
307
|
-
* z-순서/전체선택 등, readOnly에서는 복사/선택/확대)을 받아 가공(추가·제거·재배열)해
|
|
308
|
-
* 반환한다. 도메인 액션(예: 클래스 변경)을 끼워 넣는 확장 지점. 미지정 시 기본 항목 그대로.
|
|
309
|
-
*/
|
|
310
|
-
getContextMenuItems?: (defaults: ContextMenuItem[], ctx: {
|
|
311
|
-
selectedIds: string[];
|
|
312
|
-
readOnly: boolean;
|
|
313
|
-
}) => ContextMenuItem[];
|
|
314
|
-
/**
|
|
315
|
-
* UI 문자열 부분 재정의(컨텍스트 메뉴/보기설정/미니맵/이미지 로딩·에러).
|
|
316
|
-
* 기본값은 한국어(DEFAULT_EDITOR_STRINGS). 호스트가 번역 값을 만들어 주입한다.
|
|
317
|
-
*/
|
|
318
|
-
strings?: EditorStringsOverride;
|
|
319
|
-
/**
|
|
320
|
-
* 보기 설정 팝오버의 항목 구성(표시 여부·순서). 제품마다 노출 범위가 다르다 —
|
|
321
|
-
* 예: 아이브데이터는 단순화 강도·픽셀화를 감춘다(6547:201301).
|
|
322
|
-
* 미지정 시 전 항목(기존 순서).
|
|
323
|
-
*/
|
|
324
|
-
viewSettingItems?: ViewSettingItemKey[];
|
|
325
|
-
/**
|
|
326
|
-
* 합치기(우클릭 메뉴) 허용 판정. 선택된 닫힌 도형 2개 이상일 때 호출되며,
|
|
327
|
-
* false면 항목이 비활성화된다. 도메인 제약(예: 같은 클래스끼리만) 주입용.
|
|
328
|
-
* 미지정 시 항상 허용. 결과 도형의 style/meta는 첫 도형을 따른다.
|
|
329
|
-
*/
|
|
330
|
-
canMergeSelection?: (shapes: EditorShape<TMeta>[]) => boolean;
|
|
331
|
-
/**
|
|
332
|
-
* 보기 설정이 에디터 내부(설정 팝오버/단축키)에서 바뀔 때 전체 스냅샷으로 호출.
|
|
333
|
-
* 호스트가 영속화하거나 외부 설정 UI와 동기화하는 데 쓴다.
|
|
334
|
-
*/
|
|
335
|
-
onViewSettingsChange?: (settings: ViewSettings) => void;
|
|
336
|
-
/** 붓 도구 반경(이미지 px, 기본 20). */
|
|
337
|
-
brushSize?: number;
|
|
338
|
-
/**
|
|
339
|
-
* 단축키 재정의. 액션→조합키("mod+shift+z" 등, 배열 가능). 미지정 액션은 기본값,
|
|
340
|
-
* null이면 비활성. 툴 전환 액션은 onActiveToolChange로 발생한다.
|
|
341
|
-
* (방향키 넛지·Space 팬은 고정.)
|
|
342
|
-
*/
|
|
343
|
-
keymap?: KeymapOverrides;
|
|
344
|
-
/**
|
|
345
|
-
* 특정 레이블/영역으로 애니메이션 줌(기존 Editor `zoomBound`).
|
|
346
|
-
* handleRef.zoomToBounds(즉시 명령)와 달리 **이미지 로드(ready) 이후**에 1회 실행을
|
|
347
|
-
* 보장하는 선언적 원샷 — 딥링크(코멘트/상세 진입)처럼 마운트 시점에 목표가 정해지는
|
|
348
|
-
* 경우에 쓴다. 상호작용 중 즉시 줌은 handleRef의 zoomToBounds/zoomToShapes를 쓸 것.
|
|
349
|
-
*/
|
|
350
|
-
zoomBound?: {
|
|
351
|
-
x: number;
|
|
352
|
-
y: number;
|
|
353
|
-
width: number;
|
|
354
|
-
height: number;
|
|
355
|
-
};
|
|
356
|
-
/** zoomBound·zoomToShapes 애니메이션 길이(ms, 기본 300). */
|
|
357
|
-
zoomAnimationDuration?: number;
|
|
358
|
-
/** 에디터 내부에서 활성 도구가 바뀔 때(예: 그리기 완료 후 자동 복귀) 발생. */
|
|
359
|
-
onActiveToolChange?: (tool: Tool) => void;
|
|
360
|
-
onSelectionChange?: (ids: string[]) => void;
|
|
361
|
-
/**
|
|
362
|
-
* 폴리곤/라인 정점 편집모드 진입/해제 통지(더블클릭 진입, 툴·선택 변경 시 해제).
|
|
363
|
-
* 호스트가 편집모드용 안내 툴바 등을 띄우는 데 쓴다(도메인 무관).
|
|
364
|
-
*/
|
|
365
|
-
onEditingChange?: (editingId: string | null) => void;
|
|
366
|
-
/**
|
|
367
|
-
* 도형이 에디터 문서에 커밋된 뒤 발생하는 후행 이벤트.
|
|
368
|
-
* undo/redo 시에도 현재 문서 기준의 역연산 이벤트로 발생한다.
|
|
369
|
-
*/
|
|
370
|
-
onShapesCreated?: (shapes: EditorShape<TMeta>[]) => void;
|
|
371
|
-
/**
|
|
372
|
-
* 도형 변경이 에디터 문서에 커밋된 뒤 발생하는 후행 이벤트.
|
|
373
|
-
* undo/redo 시에도 현재 문서 기준의 역연산 이벤트로 발생한다.
|
|
374
|
-
*/
|
|
375
|
-
onShapesUpdated?: (shapes: EditorShape<TMeta>[]) => void;
|
|
376
|
-
/**
|
|
377
|
-
* 도형 삭제가 에디터 문서에 커밋된 뒤 발생하는 후행 이벤트.
|
|
378
|
-
* undo/redo 시에도 현재 문서 기준의 역연산 이벤트로 발생한다.
|
|
379
|
-
*/
|
|
380
|
-
onShapesDeleted?: (ids: string[]) => void;
|
|
381
|
-
onViewportChange?: (viewport: EditorCanvasViewport) => void;
|
|
382
|
-
/** 이동·리사이즈·정점 편집 중인 도형 좌표. 문서 커밋 전 시각 동기화용이다. */
|
|
383
|
-
onShapesTransformPreview?: (updates: {
|
|
384
|
-
id: string;
|
|
385
|
-
points: Point[];
|
|
386
|
-
}[]) => void;
|
|
387
|
-
/**
|
|
388
|
-
* 그리는 중인 임시 도형. ROI 등 호스트 전용 실시간 오버레이 동기화에 사용한다.
|
|
389
|
-
* 자유선 PATH는 커밋 결과와 동일하게 POLYGON 타입으로 전달된다.
|
|
390
|
-
*/
|
|
391
|
-
onDraftShapeChange?: (shape: Pick<EditorShape<TMeta>, "type" | "points" | "meta"> | null) => void;
|
|
392
|
-
/**
|
|
393
|
-
* 그리기 세션(붓·폴리곤·패스)의 제어 상태가 바뀔 때 발생한다.
|
|
394
|
-
* 정점·커서 좌표 변화는 포함하지 않으므로, 임시 도형 좌표가 필요한 호스트는
|
|
395
|
-
* onDraftShapeChange를 사용한다.
|
|
396
|
-
*/
|
|
397
|
-
onDrawSessionChange?: (session: DrawSessionChange) => void;
|
|
398
|
-
/** 호스트發 수정/undo·redo/선택 제어용 명령형 핸들. */
|
|
399
|
-
handleRef?: Ref<ShapeEditorHandle<TMeta>>;
|
|
400
|
-
}
|
|
401
|
-
export type DrawSessionKind = "none" | "brush" | "polygon" | "path";
|
|
402
|
-
export interface DrawSessionChange {
|
|
403
|
-
active: boolean;
|
|
404
|
-
kind: DrawSessionKind;
|
|
405
|
-
canUndo: boolean;
|
|
406
|
-
canRedo: boolean;
|
|
407
|
-
brush?: {
|
|
408
|
-
mode: BrushScalarMode;
|
|
409
|
-
editing: boolean;
|
|
410
|
-
editTargetIds: string[];
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* 호스트가 에디터에 명령을 보내는 창구. 모든 변경은 에디터 히스토리에 쌓여 undo 가능.
|
|
415
|
-
*/
|
|
416
|
-
export interface ShapeEditorHandle<TMeta = unknown> {
|
|
417
|
-
/**
|
|
418
|
-
* 드래그·드로잉 중 고빈도 오버레이 프리뷰 — regionMask prop(React 왕복)을 우회해
|
|
419
|
-
* 렌더러에 즉시 반영한다(같은 프레임 보장). null이면 prop 기반 오버레이로 복귀.
|
|
420
|
-
* 문서 상태의 진실은 여전히 regionMask prop — 커밋 후 prop 갱신이 이 값을 덮어쓴다.
|
|
421
|
-
*/
|
|
422
|
-
previewRegionMask: (regionMask: RegionMask | null) => void;
|
|
423
|
-
/** 문서 undo. 그리기 세션이 있으면 `undoSession`이 우선. */
|
|
424
|
-
undo: () => void;
|
|
425
|
-
/** 문서 redo. 그리기 세션이 있으면 `redoSession`이 우선. */
|
|
426
|
-
redo: () => void;
|
|
427
|
-
canUndo: () => boolean;
|
|
428
|
-
canRedo: () => boolean;
|
|
429
|
-
/** 그리기 세션(붓·폴리곤·패스) 내 undo — 세션 없으면 false. */
|
|
430
|
-
undoSession: () => boolean;
|
|
431
|
-
redoSession: () => boolean;
|
|
432
|
-
canUndoSession: () => boolean;
|
|
433
|
-
canRedoSession: () => boolean;
|
|
434
|
-
hasDraftSession: () => boolean;
|
|
435
|
-
/** Esc — 그리기 세션 취소. */
|
|
436
|
-
cancelDraftSession: () => void;
|
|
437
|
-
/** Enter — 그리기 세션 확정(붓·폴리곤). */
|
|
438
|
-
commitDraftSession: () => boolean;
|
|
439
|
-
setSelection: (ids: string[]) => void;
|
|
440
|
-
/** 호스트發 생성(예: 레이블 어시스턴트 결과). locked면 적용 없이 onLockedInteraction. */
|
|
441
|
-
createShapes: (shapes: EditorShape<TMeta>[]) => void;
|
|
442
|
-
/** 호스트發 수정(예: 선택 라벨의 클래스/색 변경). locked면 적용 없이 onLockedInteraction. */
|
|
443
|
-
updateShapes: (shapes: EditorShape<TMeta>[]) => void;
|
|
444
|
-
/** locked면 적용 없이 onLockedInteraction. */
|
|
445
|
-
deleteShapes: (ids: string[]) => void;
|
|
446
|
-
getShapes: () => EditorShape<TMeta>[];
|
|
447
|
-
/** 전체 선택. */
|
|
448
|
-
selectAll: () => void;
|
|
449
|
-
/** 선택 해제. */
|
|
450
|
-
clearSelection: () => void;
|
|
451
|
-
/** 선택 도형 삭제. */
|
|
452
|
-
deleteSelection: () => void;
|
|
453
|
-
/** 선택 도형을 시스템 클립보드에 복사. 사용할 수 없으면 같은 탭 메모리로 대체한다. */
|
|
454
|
-
copySelection: () => void;
|
|
455
|
-
/** 시스템/메모리 클립보드 도형 붙여넣기. 좌표 지정 시 중심을 맞추고, 미지정 시 캐스케이드. */
|
|
456
|
-
paste: (at?: Point) => void;
|
|
457
|
-
/** 선택 도형 복제. */
|
|
458
|
-
duplicate: () => void;
|
|
459
|
-
/** 선택 도형 맨 앞으로. */
|
|
460
|
-
bringToFront: () => void;
|
|
461
|
-
/** 선택 도형 맨 뒤로. */
|
|
462
|
-
sendToBack: () => void;
|
|
463
|
-
/** 줌: 이미지 전체 맞춤. */
|
|
464
|
-
zoomFit: () => void;
|
|
465
|
-
/** 줌: 100%. */
|
|
466
|
-
zoom100: () => void;
|
|
467
|
-
/** 줌: 화면 중심 기준 확대/축소(호스트 줌 버튼용). */
|
|
468
|
-
zoomIn: () => void;
|
|
469
|
-
zoomOut: () => void;
|
|
470
|
-
/** 줌: 선택 영역 맞춤(애니메이션). */
|
|
471
|
-
zoomToSelection: () => void;
|
|
472
|
-
/** 줌: 지정 도형(레이블)으로 이동(애니메이션, 기존 Editor `handleZoomTo`). */
|
|
473
|
-
zoomToShapes: (ids: string[], duration?: number) => void;
|
|
474
|
-
/** 줌: bbox로 이동(애니메이션). */
|
|
475
|
-
zoomToBounds: (bounds: {
|
|
476
|
-
x: number;
|
|
477
|
-
y: number;
|
|
478
|
-
width: number;
|
|
479
|
-
height: number;
|
|
480
|
-
}, duration?: number) => void;
|
|
481
|
-
/** 붓 도구 전용 명령 묶음(도구 특화라 네임스페이스로 분리). */
|
|
482
|
-
brush: {
|
|
483
|
-
/** 서브모드 — 그리기/지우기. */
|
|
484
|
-
setScalarMode: (mode: BrushScalarMode) => void;
|
|
485
|
-
getScalarMode: () => BrushScalarMode;
|
|
486
|
-
/** 붓 스트로크가 누적 중인지. */
|
|
487
|
-
hasSession: () => boolean;
|
|
488
|
-
/** Enter — 마스크를 폴리곤(들)로 확정. */
|
|
489
|
-
commit: () => boolean;
|
|
490
|
-
/** Esc — 붓 세션 취소. */
|
|
491
|
-
cancel: () => void;
|
|
492
|
-
/** 선택 도형을 베이스 마스크로 붓 편집 시작. 붓 도구일 때만. */
|
|
493
|
-
beginEditFromSelection: () => boolean;
|
|
494
|
-
};
|
|
495
|
-
}
|
|
10
|
+
export type { AssistantPrompt, AssistantPromptPoint, EditorAssistant } from "./types/assistant";
|
|
11
|
+
export type { DrawSessionChange, DrawSessionKind, ShapeEditorHandle } from "./types/handle";
|
|
12
|
+
export type { ContextMenuItem, EditorCanvasViewport, EditorExternalTool, EditorExternalToolContext, EditorOverlayMarker, EditorPointerEvent, EditorSelectionInfo, MinimapPosition, ShapeEditorDocument, ShapeEditorProps, } from "./types/props";
|
|
496
13
|
export type { BrushScalarMode, EditorAction, EditorShape, KeymapOverrides, Point, PolygonArea, RectArea, RegionMask, RegionOutlineStyle, ShapeStyle, Tool, Viewport, ViewSettings, };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";const e=require(`./geometry.cjs`),t=require(`./brush.cjs`);var n=4096,r=4;function i(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=e[(n+1)%e.length];t+=r.x*i.y-i.x*r.y}return Math.abs(t/2)}function a(e,t,n){let r=new Uint8Array(t*n);for(let i=0;i<t*n;i++)r[i]=e[i*4+3]>128?255:0;return r}function o(e){let t=new Uint8ClampedArray(e.length*4);for(let n=0;n<e.length;n++)e[n]>128&&(t[n*4+3]=255);return t}function s(e,t,n,r,i){let a=new Uint8Array(t*n),o=[[r,i]];for(;o.length;){let[r,i]=o.pop(),s=i*t+r;r<0||i<0||r>=t||i>=n||e[s]<=128||(e[s]=0,a[s]=255,o.push([r+1,i],[r-1,i],[r,i+1],[r,i-1]))}return a}function c(e,t,n){let r=a(e,t,n),i=[];for(;;){let e=-1,a=-1;outer:for(let i=0;i<n;i++)for(let n=0;n<t;n++)if(r[i*t+n]>128){e=n,a=i;break outer}if(e<0)break;let c=u(o(s(r,t,n,e,a)),t,n);c.length>=3&&i.push(c)}return i}function l(e,t,n,r,i){return r<0||i<0||r>=t||i>=n?!1:e[(i*t+r)*4+3]>128}function u(e,t,n){let r=-1,i=-1;outer:for(let a=0;a<n;a++)for(let o=0;o<t;o++)if(l(e,t,n,o,a)){r=o,i=a;break outer}if(r<0)return[];let a=[1,1,0,-1,-1,-1,0,1],o=[0,1,1,1,0,-1,-1,-1],s=[],c=r,u=i,d=7,f={x:c,y:u},p=0;do{s.push({x:c,y:u});let r=!1;for(let i=0;i<8;i++){let s=(d+i)%8,f=c+a[s],p=u+o[s];if(l(e,t,n,f,p)){c=f,u=p,d=(s+6)%8,r=!0;break}}if(!r||(p+=1,p>t*n*4))break}while(c!==f.x||u!==f.y||s.length===1);return s}function d(e,t){let n=[];for(let t of e)for(let e of t.points)n.push(e);for(let e of t)for(let t of e)n.push(t);return n}function f(t){switch(t.type){case e.SHAPE_TYPE.RECTANGLE:return t.points.length<2?null:e.rectTo4(t.points);case e.SHAPE_TYPE.POLYGON:case e.SHAPE_TYPE.ROTATED_RECTANGLE:case e.SHAPE_TYPE.ELLIPSE:return t.points.length>=3?t.points:null;case e.SHAPE_TYPE.POINT:{let n=t.points[0];return n?e.circleToPolygon({x:n.x-6,y:n.y-6},{x:n.x+6,y:n.y+6}):null}default:return null}}function p(e){return e.map(f).filter(e=>!!e&&e.length>=3)}function m(t,r,i=[]){if(r<=0||!t.length&&!i.length)return null;let a=d(t,i);if(!a.length)return null;let o=r+4,s=e.getBBox(a),c=Math.ceil(s.maxX-s.minX+o*2),l=Math.ceil(s.maxY-s.minY+o*2),u=Math.min(1,n/Math.max(c,l,1));c=Math.max(1,Math.ceil(c*u)),l=Math.max(1,Math.ceil(l*u));let f=s.minX-o,p=s.minY-o,m=e=>({x:(e.x-f)*u,y:(e.y-p)*u}),h=document.createElement(`canvas`);h.width=c,h.height=l;let g=h.getContext(`2d`);if(!g)return null;g.lineCap=`round`,g.lineJoin=`round`,g.lineWidth=r*2*u,g.fillStyle=`#000`;for(let e of i){if(e.length<3)continue;g.beginPath();let t=m(e[0]);g.moveTo(t.x,t.y);for(let t=1;t<e.length;t++){let n=m(e[t]);g.lineTo(n.x,n.y)}g.closePath(),g.fill()}for(let e of t){if(!e.points.length)continue;g.globalCompositeOperation=e.mode===`erase`?`destination-out`:`source-over`,g.strokeStyle=e.mode===`erase`?`rgba(0,0,0,1)`:`#000`,g.beginPath();let t=m(e.points[0]);g.moveTo(t.x,t.y);for(let t=1;t<e.points.length;t++){let n=m(e.points[t]);g.lineTo(n.x,n.y)}e.points.length===1&&g.lineTo(t.x+.01,t.y),g.stroke()}return{canvas:h,ox:f,oy:p,scale:u}}function h(e,n=1.5){let{canvas:a,ox:o,oy:s,scale:l}=e,u=c(a.getContext(`2d`).getImageData(0,0,a.width,a.height).data,a.width,a.height);if(!u.length)return[];let d=e=>({x:e.x/l+o,y:e.y/l+s}),f=[];for(let e of u){let a=e.map(d),o=t.simplifyPath(a,n),s=o.length>=3?o:a;s.length>=3&&i(s)>=r&&f.push(s)}return f}function g(e,t){let{canvas:n}=e,r=document.createElement(`canvas`);r.width=n.width,r.height=n.height;let i=r.getContext(`2d`);return i?(i.drawImage(n,0,0),i.globalCompositeOperation=`source-in`,i.fillStyle=t,i.fillRect(0,0,r.width,r.height),r):n}exports.buildScalarMaskPreviewCanvas=g,exports.buildScalarMaskRaster=m,exports.polygonArea=i,exports.scalarMaskToPolygons=h,exports.shapesToFilledPolygons=p;
|
|
2
|
+
//# sourceMappingURL=scalarMask.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalarMask.cjs","names":[],"sources":["../../../../src/components/ShapeEditor/_model/scalarMask.ts"],"sourcesContent":["import { simplifyPath } from \"./brush\";\nimport {\n circleToPolygon,\n type EditorShape,\n getBBox,\n type Point,\n rectTo4,\n SHAPE_TYPE,\n} from \"./geometry\";\n\nconst MAX_CANVAS_DIM = 4096;\nconst MIN_POLYGON_AREA = 4;\n\nfunction polygonArea(points: Point[]): number {\n let sum = 0;\n for (let i = 0; i < points.length; i++) {\n const a = points[i];\n const b = points[(i + 1) % points.length];\n sum += a.x * b.y - b.x * a.y;\n }\n return Math.abs(sum / 2);\n}\n\nfunction extractAlpha(data: Uint8ClampedArray, width: number, height: number): Uint8Array {\n const alpha = new Uint8Array(width * height);\n for (let i = 0; i < width * height; i++) {\n alpha[i] = data[i * 4 + 3] > 128 ? 255 : 0;\n }\n return alpha;\n}\n\nfunction alphaToRgba(alpha: Uint8Array): Uint8ClampedArray {\n const data = new Uint8ClampedArray(alpha.length * 4);\n for (let i = 0; i < alpha.length; i++) {\n if (alpha[i] > 128) data[i * 4 + 3] = 255;\n }\n return data;\n}\n\nfunction floodFillComponent(\n work: Uint8Array,\n width: number,\n height: number,\n sx: number,\n sy: number,\n): Uint8Array {\n const component = new Uint8Array(width * height);\n const stack: [number, number][] = [[sx, sy]];\n while (stack.length) {\n const [x, y] = stack.pop()!;\n const idx = y * width + x;\n if (x < 0 || y < 0 || x >= width || y >= height) continue;\n if (work[idx] <= 128) continue;\n work[idx] = 0;\n component[idx] = 255;\n stack.push([x + 1, y], [x - 1, y], [x, y + 1], [x, y - 1]);\n }\n return component;\n}\n\n/** 마스크에서 분리된 모든 외곽선을 추출. */\nfunction traceAllOuterContours(data: Uint8ClampedArray, width: number, height: number): Point[][] {\n const work = extractAlpha(data, width, height);\n const contours: Point[][] = [];\n\n while (true) {\n let sx = -1;\n let sy = -1;\n outer: for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n if (work[y * width + x] > 128) {\n sx = x;\n sy = y;\n break outer;\n }\n }\n }\n if (sx < 0) break;\n\n const component = floodFillComponent(work, width, height, sx, sy);\n const contour = traceOuterContour(alphaToRgba(component), width, height);\n if (contour.length >= 3) contours.push(contour);\n }\n\n return contours;\n}\n\nexport type ScalarStrokeMode = \"add\" | \"erase\";\n\nexport interface ScalarStroke {\n points: Point[];\n mode: ScalarStrokeMode;\n}\n\nexport interface ScalarMaskRaster {\n canvas: HTMLCanvasElement;\n ox: number;\n oy: number;\n scale: number;\n}\n\nfunction isFilled(data: Uint8ClampedArray, width: number, height: number, x: number, y: number) {\n if (x < 0 || y < 0 || x >= width || y >= height) return false;\n return data[(y * width + x) * 4 + 3] > 128;\n}\n\n/** 채워진 영역의 외곽선을 Moore-neighbor로 추적. */\nfunction traceOuterContour(data: Uint8ClampedArray, width: number, height: number): Point[] {\n let sx = -1;\n let sy = -1;\n outer: for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n if (isFilled(data, width, height, x, y)) {\n sx = x;\n sy = y;\n break outer;\n }\n }\n }\n if (sx < 0) return [];\n\n const dx = [1, 1, 0, -1, -1, -1, 0, 1];\n const dy = [0, 1, 1, 1, 0, -1, -1, -1];\n const contour: Point[] = [];\n let x = sx;\n let y = sy;\n let dir = 7;\n const start = { x, y };\n let guard = 0;\n\n do {\n contour.push({ x, y });\n let found = false;\n for (let i = 0; i < 8; i++) {\n const nd = (dir + i) % 8;\n const nx = x + dx[nd];\n const ny = y + dy[nd];\n if (isFilled(data, width, height, nx, ny)) {\n x = nx;\n y = ny;\n dir = (nd + 6) % 8;\n found = true;\n break;\n }\n }\n if (!found) break;\n guard += 1;\n if (guard > width * height * 4) break;\n } while (x !== start.x || y !== start.y || contour.length === 1);\n\n return contour;\n}\n\nfunction collectPoints(strokes: ScalarStroke[], basePolygons: Point[][]): Point[] {\n const all: Point[] = [];\n for (const stroke of strokes) {\n for (const p of stroke.points) all.push(p);\n }\n for (const poly of basePolygons) {\n for (const p of poly) all.push(p);\n }\n return all;\n}\n\n/** 면적 편집 가능한 도형 → 채움 폴리곤 꼭짓점. */\nfunction shapeToFilledPolygon(shape: EditorShape): Point[] | null {\n switch (shape.type) {\n case SHAPE_TYPE.RECTANGLE:\n if (shape.points.length < 2) return null;\n return rectTo4(shape.points);\n case SHAPE_TYPE.POLYGON:\n case SHAPE_TYPE.ROTATED_RECTANGLE:\n case SHAPE_TYPE.ELLIPSE:\n return shape.points.length >= 3 ? shape.points : null;\n case SHAPE_TYPE.POINT: {\n const p = shape.points[0];\n if (!p) return null;\n const r = 6;\n return circleToPolygon({ x: p.x - r, y: p.y - r }, { x: p.x + r, y: p.y + r });\n }\n default:\n return null;\n }\n}\n\nexport function shapesToFilledPolygons(shapes: EditorShape[]): Point[][] {\n return shapes\n .map(shapeToFilledPolygon)\n .filter((points): points is Point[] => !!points && points.length >= 3);\n}\n\n/** 붓/지우개 스트로크(+ 선택 도형 베이스)를 이진 마스크 캔버스로 래스터화. */\nexport function buildScalarMaskRaster(\n strokes: ScalarStroke[],\n radius: number,\n basePolygons: Point[][] = [],\n): ScalarMaskRaster | null {\n if (radius <= 0) return null;\n if (!strokes.length && !basePolygons.length) return null;\n\n const allPoints = collectPoints(strokes, basePolygons);\n if (!allPoints.length) return null;\n\n const padding = radius + 4;\n const bbox = getBBox(allPoints);\n let width = Math.ceil(bbox.maxX - bbox.minX + padding * 2);\n let height = Math.ceil(bbox.maxY - bbox.minY + padding * 2);\n const scale = Math.min(1, MAX_CANVAS_DIM / Math.max(width, height, 1));\n width = Math.max(1, Math.ceil(width * scale));\n height = Math.max(1, Math.ceil(height * scale));\n\n const ox = bbox.minX - padding;\n const oy = bbox.minY - padding;\n const toLocal = (p: Point) => ({\n x: (p.x - ox) * scale,\n y: (p.y - oy) * scale,\n });\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return null;\n\n ctx.lineCap = \"round\";\n ctx.lineJoin = \"round\";\n ctx.lineWidth = radius * 2 * scale;\n\n ctx.fillStyle = \"#000\";\n for (const poly of basePolygons) {\n if (poly.length < 3) continue;\n ctx.beginPath();\n const start = toLocal(poly[0]);\n ctx.moveTo(start.x, start.y);\n for (let i = 1; i < poly.length; i++) {\n const p = toLocal(poly[i]);\n ctx.lineTo(p.x, p.y);\n }\n ctx.closePath();\n ctx.fill();\n }\n\n for (const stroke of strokes) {\n if (!stroke.points.length) continue;\n ctx.globalCompositeOperation = stroke.mode === \"erase\" ? \"destination-out\" : \"source-over\";\n ctx.strokeStyle = stroke.mode === \"erase\" ? \"rgba(0,0,0,1)\" : \"#000\";\n ctx.beginPath();\n const first = toLocal(stroke.points[0]);\n ctx.moveTo(first.x, first.y);\n for (let i = 1; i < stroke.points.length; i++) {\n const p = toLocal(stroke.points[i]);\n ctx.lineTo(p.x, p.y);\n }\n if (stroke.points.length === 1) {\n ctx.lineTo(first.x + 0.01, first.y);\n }\n ctx.stroke();\n }\n\n return { canvas, ox, oy, scale };\n}\n\n/** 스칼라 마스크를 분리된 폴리곤 외곽선들로 변환. */\nexport function scalarMaskToPolygons(raster: ScalarMaskRaster, simplifyEpsilon = 1.5): Point[][] {\n const { canvas, ox, oy, scale } = raster;\n const contours = traceAllOuterContours(\n canvas.getContext(\"2d\")!.getImageData(0, 0, canvas.width, canvas.height).data,\n canvas.width,\n canvas.height,\n );\n if (!contours.length) return [];\n\n const toWorld = (p: Point) => ({\n x: p.x / scale + ox,\n y: p.y / scale + oy,\n });\n\n const polys: Point[][] = [];\n for (const contour of contours) {\n const world = contour.map(toWorld);\n const simplified = simplifyPath(world, simplifyEpsilon);\n const points = simplified.length >= 3 ? simplified : world;\n if (points.length >= 3 && polygonArea(points) >= MIN_POLYGON_AREA) {\n polys.push(points);\n }\n }\n return polys;\n}\n\nexport { polygonArea };\n\n/** 미리보기용 색상 오버레이 캔버스. */\nexport function buildScalarMaskPreviewCanvas(\n raster: ScalarMaskRaster,\n color: string,\n): HTMLCanvasElement {\n const { canvas } = raster;\n const preview = document.createElement(\"canvas\");\n preview.width = canvas.width;\n preview.height = canvas.height;\n const ctx = preview.getContext(\"2d\");\n if (!ctx) return canvas;\n\n ctx.drawImage(canvas, 0, 0);\n ctx.globalCompositeOperation = \"source-in\";\n ctx.fillStyle = color;\n ctx.fillRect(0, 0, preview.width, preview.height);\n return preview;\n}\n"],"mappings":"wEAUA,IAAM,EAAiB,KACjB,EAAmB,EAEzB,SAAS,EAAY,EAAyB,CAC5C,IAAI,EAAM,EACV,IAAK,IAAI,EAAI,EAAG,EAAI,EAAO,OAAQ,IAAK,CACtC,IAAM,EAAI,EAAO,GACX,EAAI,GAAQ,EAAI,GAAK,EAAO,QAClC,GAAO,EAAE,EAAI,EAAE,EAAI,EAAE,EAAI,EAAE,EAE7B,OAAO,KAAK,IAAI,EAAM,EAAE,CAG1B,SAAS,EAAa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