@aivex/ui 1.2.0-dev.55 → 1.2.0-dev.56
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 +57 -1
- package/dist/DESIGN.md +241 -0
- package/dist/comment.cjs +1 -1
- package/dist/comment.js +1 -1
- package/dist/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.d.cts +42 -0
- package/dist/components/Avatar/Avatar.d.ts +24 -0
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/index.d.cts +2 -0
- package/dist/components/Avatar/index.d.ts +2 -2
- package/dist/components/Badge/Badge.cjs.map +1 -1
- package/dist/components/Badge/Badge.d.cts +93 -0
- package/dist/components/Badge/Badge.d.ts +58 -0
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge/index.d.cts +2 -0
- package/dist/components/Badge/index.d.ts +2 -2
- package/dist/components/BreadCrumb/BreadCrumb.cjs.map +1 -1
- package/dist/components/BreadCrumb/BreadCrumb.d.cts +57 -0
- package/dist/components/BreadCrumb/BreadCrumb.d.ts +32 -2
- package/dist/components/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/components/BreadCrumb/index.d.cts +2 -0
- package/dist/components/BreadCrumb/index.d.ts +2 -2
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.d.cts +50 -0
- package/dist/components/Button/Button.d.ts +31 -1
- package/dist/components/Button/Button.js +25 -24
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/index.d.cts +2 -0
- package/dist/components/Button/index.d.ts +2 -2
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.cjs.map +1 -1
- package/dist/components/Calendar/Calendar.d.cts +81 -0
- package/dist/components/Calendar/Calendar.d.ts +48 -5
- package/dist/components/Calendar/Calendar.js +104 -57
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Calendar/date.cjs +1 -1
- package/dist/components/Calendar/date.cjs.map +1 -1
- package/dist/components/Calendar/date.d.cts +35 -0
- package/dist/components/Calendar/date.d.ts +10 -0
- package/dist/components/Calendar/date.js +22 -1
- package/dist/components/Calendar/date.js.map +1 -1
- package/dist/components/Calendar/index.d.cts +2 -0
- package/dist/components/Calendar/index.d.ts +2 -2
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.d.cts +46 -0
- package/dist/components/Card/Card.d.ts +30 -3
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/index.d.cts +2 -0
- package/dist/components/Card/index.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.cts +37 -0
- package/dist/components/Checkbox/Checkbox.d.ts +24 -0
- package/dist/components/Checkbox/Checkbox.js +24 -23
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/ChipsCheckbox.cjs.map +1 -1
- package/dist/components/Checkbox/ChipsCheckbox.d.cts +24 -0
- package/dist/components/Checkbox/ChipsCheckbox.d.ts +15 -0
- package/dist/components/Checkbox/ChipsCheckbox.js.map +1 -1
- package/dist/components/Checkbox/index.d.cts +4 -0
- package/dist/components/Checkbox/index.d.ts +4 -4
- package/dist/components/Coachmark/Coachmark.cjs.map +1 -1
- package/dist/components/Coachmark/Coachmark.d.cts +87 -0
- package/dist/components/Coachmark/Coachmark.d.ts +39 -8
- package/dist/components/Coachmark/Coachmark.js.map +1 -1
- package/dist/components/Coachmark/index.d.cts +2 -0
- package/dist/components/Coachmark/index.d.ts +2 -2
- package/dist/components/Comment/CommentInput.cjs +1 -1
- package/dist/components/Comment/CommentInput.cjs.map +1 -1
- package/dist/components/Comment/CommentInput.d.cts +75 -0
- package/dist/components/Comment/CommentInput.d.ts +46 -6
- package/dist/components/Comment/CommentInput.js +15 -14
- package/dist/components/Comment/CommentInput.js.map +1 -1
- package/dist/components/Comment/CommentPin.cjs +1 -1
- package/dist/components/Comment/CommentPin.cjs.map +1 -1
- package/dist/components/Comment/CommentPin.d.cts +48 -0
- package/dist/components/Comment/CommentPin.d.ts +35 -4
- package/dist/components/Comment/CommentPin.js +29 -20
- package/dist/components/Comment/CommentPin.js.map +1 -1
- package/dist/components/Comment/MentionInput.cjs +1 -1
- package/dist/components/Comment/MentionInput.cjs.map +1 -1
- package/dist/components/Comment/MentionInput.d.cts +45 -0
- package/dist/components/Comment/MentionInput.d.ts +19 -4
- package/dist/components/Comment/MentionInput.js +51 -38
- package/dist/components/Comment/MentionInput.js.map +1 -1
- package/dist/components/Comment/MentionList.cjs +1 -1
- package/dist/components/Comment/MentionList.cjs.map +1 -1
- package/dist/components/Comment/MentionList.d.cts +19 -0
- package/dist/components/Comment/MentionList.d.ts +3 -3
- package/dist/components/Comment/MentionList.js +1 -1
- package/dist/components/Comment/MentionList.js.map +1 -1
- package/dist/components/Comment/index.d.cts +4 -0
- package/dist/components/Comment/index.d.ts +4 -4
- package/dist/components/Comment/mentionContent.d.cts +5 -0
- package/dist/components/Comment/types.d.cts +16 -0
- package/dist/components/Comment/types.d.ts +6 -2
- package/dist/components/Comment/useMentionSuggestion.cjs +1 -1
- package/dist/components/Comment/useMentionSuggestion.cjs.map +1 -1
- package/dist/components/Comment/useMentionSuggestion.d.cts +19 -0
- package/dist/components/Comment/useMentionSuggestion.d.ts +6 -2
- package/dist/components/Comment/useMentionSuggestion.js +72 -62
- package/dist/components/Comment/useMentionSuggestion.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.cjs +1 -1
- package/dist/components/DataGrid/DataGrid.cjs.map +1 -1
- package/dist/components/DataGrid/DataGrid.d.cts +136 -0
- package/dist/components/DataGrid/DataGrid.d.ts +77 -5
- package/dist/components/DataGrid/DataGrid.js +109 -106
- package/dist/components/DataGrid/DataGrid.js.map +1 -1
- package/dist/components/DataGrid/DataGridColumnSettings.cjs +1 -1
- package/dist/components/DataGrid/DataGridColumnSettings.cjs.map +1 -1
- package/dist/components/DataGrid/DataGridColumnSettings.d.cts +41 -0
- package/dist/components/DataGrid/DataGridColumnSettings.d.ts +21 -3
- package/dist/components/DataGrid/DataGridColumnSettings.js +8 -5
- package/dist/components/DataGrid/DataGridColumnSettings.js.map +1 -1
- package/dist/components/DataGrid/DataGridPrimitives.cjs.map +1 -1
- package/dist/components/DataGrid/DataGridPrimitives.d.cts +167 -0
- package/dist/components/DataGrid/DataGridPrimitives.d.ts +81 -1
- package/dist/components/DataGrid/DataGridPrimitives.js.map +1 -1
- package/dist/components/DataGrid/DataGridRows.d.cts +66 -0
- package/dist/components/DataGrid/index.d.cts +8 -0
- package/dist/components/DataGrid/index.d.ts +6 -6
- package/dist/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/components/Dialog/Dialog.d.cts +66 -0
- package/dist/components/Dialog/Dialog.d.ts +47 -1
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dialog/index.d.cts +2 -0
- package/dist/components/Dialog/index.d.ts +2 -2
- package/dist/components/Divider/Divider.cjs.map +1 -1
- package/dist/components/Divider/Divider.d.cts +30 -0
- package/dist/components/Divider/Divider.d.ts +19 -0
- package/dist/components/Divider/Divider.js.map +1 -1
- package/dist/components/Divider/index.d.cts +2 -0
- package/dist/components/Divider/index.d.ts +2 -2
- package/dist/components/DraggableScroll/DraggableScroll.cjs.map +1 -1
- package/dist/components/DraggableScroll/DraggableScroll.d.cts +47 -0
- package/dist/components/DraggableScroll/DraggableScroll.d.ts +32 -1
- package/dist/components/DraggableScroll/DraggableScroll.js.map +1 -1
- package/dist/components/DraggableScroll/index.d.cts +2 -0
- package/dist/components/DraggableScroll/index.d.ts +2 -2
- package/dist/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/components/Drawer/Drawer.d.cts +149 -0
- package/dist/components/Drawer/Drawer.d.ts +64 -5
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/index.d.cts +2 -0
- package/dist/components/Drawer/index.d.ts +2 -2
- package/dist/components/Field/Field.cjs +1 -1
- package/dist/components/Field/Field.cjs.map +1 -1
- package/dist/components/Field/Field.d.cts +100 -0
- package/dist/components/Field/Field.d.ts +59 -5
- package/dist/components/Field/Field.js +49 -42
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/Field/index.d.cts +1 -0
- package/dist/components/Field/index.d.ts +1 -1
- package/dist/components/FilterModal/FilterModal.cjs +1 -1
- package/dist/components/FilterModal/FilterModal.cjs.map +1 -1
- package/dist/components/FilterModal/FilterModal.d.cts +83 -0
- package/dist/components/FilterModal/FilterModal.d.ts +52 -1
- package/dist/components/FilterModal/FilterModal.js +5 -4
- package/dist/components/FilterModal/FilterModal.js.map +1 -1
- package/dist/components/FilterModal/index.d.cts +2 -0
- package/dist/components/FilterModal/index.d.ts +2 -2
- package/dist/components/Icon/index.cjs.map +1 -1
- package/dist/components/Icon/index.d.cts +2077 -0
- package/dist/components/Icon/index.d.ts +41 -0
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Icon/svgA11y.d.cts +10 -0
- package/dist/components/Icon/uniqueSvgIds.d.cts +8 -0
- package/dist/components/IconButton/IconButton.cjs +1 -1
- package/dist/components/IconButton/IconButton.cjs.map +1 -1
- package/dist/components/IconButton/IconButton.d.cts +45 -0
- package/dist/components/IconButton/IconButton.d.ts +31 -3
- package/dist/components/IconButton/IconButton.js +25 -24
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/IconButton/index.d.cts +2 -0
- package/dist/components/IconButton/index.d.ts +2 -2
- package/dist/components/Illustration/Illustration.cjs +2 -0
- package/dist/components/Illustration/Illustration.cjs.map +1 -0
- package/dist/components/Illustration/Illustration.d.cts +37 -0
- package/dist/components/Illustration/Illustration.d.ts +37 -0
- package/dist/components/Illustration/Illustration.js +40 -0
- package/dist/components/Illustration/Illustration.js.map +1 -0
- package/dist/components/Illustration/assets/box-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/box-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/box-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/box-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/box-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/box-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/box-light.webp.js +7 -0
- package/dist/components/Illustration/assets/box-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/equipment-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/equipment-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/equipment-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/equipment-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/equipment-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/equipment-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/equipment-light.webp.js +7 -0
- package/dist/components/Illustration/assets/equipment-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/failed-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/failed-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/failed-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/failed-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/failed-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/failed-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/failed-light.webp.js +7 -0
- package/dist/components/Illustration/assets/failed-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/file-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/file-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/file-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/file-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/file-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/file-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/file-light.webp.js +7 -0
- package/dist/components/Illustration/assets/file-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/images-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/images-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/images-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/images-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/images-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/images-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/images-light.webp.js +7 -0
- package/dist/components/Illustration/assets/images-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/letter-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/letter-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/letter-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/letter-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/letter-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/letter-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/letter-light.webp.js +7 -0
- package/dist/components/Illustration/assets/letter-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/message-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/message-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/message-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/message-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/message-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/message-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/message-light.webp.js +7 -0
- package/dist/components/Illustration/assets/message-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/network-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/network-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/network-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/network-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/network-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/network-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/network-light.webp.js +7 -0
- package/dist/components/Illustration/assets/network-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/no-data-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/no-data-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/no-data-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/no-data-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/no-data-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/no-data-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/no-data-light.webp.js +7 -0
- package/dist/components/Illustration/assets/no-data-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/paper-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/paper-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/paper-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/paper-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/paper-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/paper-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/paper-light.webp.js +7 -0
- package/dist/components/Illustration/assets/paper-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/success-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/success-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/success-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/success-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/success-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/success-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/success-light.webp.js +7 -0
- package/dist/components/Illustration/assets/success-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/warning-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/warning-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/warning-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/warning-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/warning-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/warning-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/warning-light.webp.js +7 -0
- package/dist/components/Illustration/assets/warning-light.webp.js.map +1 -0
- package/dist/components/Illustration/illustrations.cjs +2 -0
- package/dist/components/Illustration/illustrations.cjs.map +1 -0
- package/dist/components/Illustration/illustrations.d.cts +81 -0
- package/dist/components/Illustration/illustrations.d.ts +81 -0
- package/dist/components/Illustration/illustrations.js +104 -0
- package/dist/components/Illustration/illustrations.js.map +1 -0
- package/dist/components/Illustration/index.d.cts +1 -0
- package/dist/components/Illustration/index.d.ts +1 -0
- package/dist/components/InputBase/InputBase.cjs.map +1 -1
- package/dist/components/InputBase/InputBase.d.cts +59 -0
- package/dist/components/InputBase/InputBase.d.ts +30 -0
- package/dist/components/InputBase/InputBase.js.map +1 -1
- package/dist/components/InputBase/index.d.cts +1 -0
- package/dist/components/InputBase/index.d.ts +1 -1
- package/dist/components/InputBase/useInputState.d.cts +19 -0
- package/dist/components/InteractionLayer/InteractionLayer.cjs.map +1 -1
- package/dist/components/InteractionLayer/InteractionLayer.d.cts +43 -0
- package/dist/components/InteractionLayer/InteractionLayer.d.ts +34 -0
- package/dist/components/InteractionLayer/InteractionLayer.js.map +1 -1
- package/dist/components/InteractionLayer/index.d.cts +1 -0
- package/dist/components/InteractionLayer/index.d.ts +1 -1
- package/dist/components/Logo/index.cjs.map +1 -1
- package/dist/components/Logo/index.d.cts +73 -0
- package/dist/components/Logo/index.d.ts +27 -1
- package/dist/components/Logo/index.js.map +1 -1
- package/dist/components/Menu/Menu.cjs.map +1 -1
- package/dist/components/Menu/Menu.d.cts +146 -0
- package/dist/components/Menu/Menu.d.ts +62 -0
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Menu/index.d.cts +2 -0
- package/dist/components/Menu/index.d.ts +2 -2
- package/dist/components/Messagebox/Messagebox.cjs.map +1 -1
- package/dist/components/Messagebox/Messagebox.d.cts +50 -0
- package/dist/components/Messagebox/Messagebox.d.ts +33 -3
- package/dist/components/Messagebox/Messagebox.js.map +1 -1
- package/dist/components/Messagebox/index.d.cts +2 -0
- package/dist/components/Messagebox/index.d.ts +2 -2
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.d.cts +137 -0
- package/dist/components/Modal/Modal.d.ts +95 -2
- package/dist/components/Modal/Modal.js +0 -1
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/ModalBase.cjs.map +1 -1
- package/dist/components/Modal/ModalBase.d.cts +71 -0
- package/dist/components/Modal/ModalBase.d.ts +39 -1
- package/dist/components/Modal/ModalBase.js.map +1 -1
- package/dist/components/Modal/index.d.cts +4 -0
- package/dist/components/Modal/index.d.ts +4 -4
- package/dist/components/Nav/Nav.cjs.map +1 -1
- package/dist/components/Nav/Nav.d.cts +69 -0
- package/dist/components/Nav/Nav.d.ts +46 -0
- package/dist/components/Nav/Nav.js.map +1 -1
- package/dist/components/Nav/index.d.cts +2 -0
- package/dist/components/Nav/index.d.ts +2 -2
- package/dist/components/Overlay/Overlay.cjs.map +1 -1
- package/dist/components/Overlay/Overlay.d.cts +36 -0
- package/dist/components/Overlay/Overlay.d.ts +20 -2
- package/dist/components/Overlay/Overlay.js.map +1 -1
- package/dist/components/Overlay/index.d.cts +2 -0
- package/dist/components/Overlay/index.d.ts +2 -2
- package/dist/components/Pagination/Pagination.cjs +1 -1
- package/dist/components/Pagination/Pagination.cjs.map +1 -1
- package/dist/components/Pagination/Pagination.d.cts +68 -0
- package/dist/components/Pagination/Pagination.d.ts +43 -1
- package/dist/components/Pagination/Pagination.js +55 -41
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Pagination/index.d.cts +2 -0
- package/dist/components/Pagination/index.d.ts +2 -2
- package/dist/components/Panel/Panel.cjs.map +1 -1
- package/dist/components/Panel/Panel.d.cts +124 -0
- package/dist/components/Panel/Panel.d.ts +45 -3
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/index.d.cts +2 -0
- package/dist/components/Panel/index.d.ts +2 -2
- package/dist/components/Popover/Popover.cjs.map +1 -1
- package/dist/components/Popover/Popover.d.cts +96 -0
- package/dist/components/Popover/Popover.d.ts +42 -0
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Popover/index.d.cts +2 -0
- package/dist/components/Popover/index.d.ts +2 -2
- package/dist/components/ProgressBar/ProgressBar.cjs.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.cts +45 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +32 -0
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/ProgressBar/index.d.cts +2 -0
- package/dist/components/ProgressBar/index.d.ts +2 -2
- package/dist/components/Radio/Radio.cjs.map +1 -1
- package/dist/components/Radio/Radio.d.cts +32 -0
- package/dist/components/Radio/Radio.d.ts +21 -0
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Radio/index.d.cts +2 -0
- package/dist/components/Radio/index.d.ts +2 -2
- package/dist/components/ScrollArea/ScrollArea.cjs.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.d.cts +42 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +24 -0
- package/dist/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/components/ScrollArea/index.d.cts +2 -0
- package/dist/components/ScrollArea/index.d.ts +2 -2
- package/dist/components/Segmented/Segmented.cjs.map +1 -1
- package/dist/components/Segmented/Segmented.d.cts +41 -0
- package/dist/components/Segmented/Segmented.d.ts +26 -0
- package/dist/components/Segmented/Segmented.js.map +1 -1
- package/dist/components/Segmented/index.d.cts +2 -0
- package/dist/components/Segmented/index.d.ts +2 -2
- package/dist/components/SelectBox/SelectBox.cjs +1 -1
- package/dist/components/SelectBox/SelectBox.cjs.map +1 -1
- package/dist/components/SelectBox/SelectBox.d.cts +95 -0
- package/dist/components/SelectBox/SelectBox.d.ts +55 -3
- package/dist/components/SelectBox/SelectBox.js +17 -12
- package/dist/components/SelectBox/SelectBox.js.map +1 -1
- package/dist/components/SelectBox/index.d.cts +2 -0
- package/dist/components/SelectBox/index.d.ts +2 -2
- package/dist/components/SelectButton/SelectButton.cjs +1 -1
- package/dist/components/SelectButton/SelectButton.cjs.map +1 -1
- package/dist/components/SelectButton/SelectButton.d.cts +54 -0
- package/dist/components/SelectButton/SelectButton.d.ts +37 -1
- package/dist/components/SelectButton/SelectButton.js +31 -31
- package/dist/components/SelectButton/SelectButton.js.map +1 -1
- package/dist/components/SelectButton/index.d.cts +2 -0
- package/dist/components/SelectButton/index.d.ts +2 -2
- package/dist/components/ShapeEditor/ShapeEditor.cjs +1 -1
- package/dist/components/ShapeEditor/ShapeEditor.cjs.map +1 -1
- package/dist/components/ShapeEditor/ShapeEditor.d.cts +40 -0
- package/dist/components/ShapeEditor/ShapeEditor.d.ts +36 -3
- package/dist/components/ShapeEditor/ShapeEditor.js +1 -1
- package/dist/components/ShapeEditor/ShapeEditor.js.map +1 -1
- package/dist/components/ShapeEditor/ShapeViewer.cjs +1 -1
- package/dist/components/ShapeEditor/ShapeViewer.cjs.map +1 -1
- package/dist/components/ShapeEditor/ShapeViewer.d.cts +92 -0
- package/dist/components/ShapeEditor/ShapeViewer.d.ts +55 -5
- package/dist/components/ShapeEditor/ShapeViewer.js +47 -41
- package/dist/components/ShapeEditor/ShapeViewer.js.map +1 -1
- package/dist/components/ShapeEditor/_components/AssistantOverlay.d.cts +17 -0
- package/dist/components/ShapeEditor/_components/AssistantOverlay.d.ts +2 -2
- package/dist/components/ShapeEditor/_components/ContextMenu.d.cts +13 -0
- package/dist/components/ShapeEditor/_components/ContextMenu.d.ts +1 -1
- package/dist/components/ShapeEditor/_components/CursorGuide.d.cts +8 -0
- package/dist/components/ShapeEditor/_components/ImageStateOverlay.d.cts +17 -0
- package/dist/components/ShapeEditor/_components/ImageStateOverlay.d.ts +1 -1
- package/dist/components/ShapeEditor/_components/Minimap.d.cts +46 -0
- package/dist/components/ShapeEditor/_components/Minimap.d.ts +6 -6
- package/dist/components/ShapeEditor/_components/MinimapShape.d.cts +6 -0
- package/dist/components/ShapeEditor/_components/MinimapShape.d.ts +1 -1
- package/dist/components/ShapeEditor/_components/RegionOverlay.d.cts +21 -0
- package/dist/components/ShapeEditor/_components/RegionOverlay.d.ts +1 -1
- package/dist/components/ShapeEditor/_components/SelectionInfo.d.cts +20 -0
- package/dist/components/ShapeEditor/_components/SelectionInfo.d.ts +3 -3
- package/dist/components/ShapeEditor/_components/SettingsPanel.cjs.map +1 -1
- package/dist/components/ShapeEditor/_components/SettingsPanel.d.cts +28 -0
- package/dist/components/ShapeEditor/_components/SettingsPanel.d.ts +5 -5
- package/dist/components/ShapeEditor/_components/SettingsPanel.js.map +1 -1
- package/dist/components/ShapeEditor/_constants.cjs +1 -1
- package/dist/components/ShapeEditor/_constants.cjs.map +1 -1
- package/dist/components/ShapeEditor/_constants.d.cts +15 -0
- package/dist/components/ShapeEditor/_constants.d.ts +0 -21
- package/dist/components/ShapeEditor/_constants.js +1 -1
- package/dist/components/ShapeEditor/_constants.js.map +1 -1
- package/dist/components/ShapeEditor/_model/brush.d.cts +3 -0
- package/dist/components/ShapeEditor/_model/brush.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/clipboard.d.cts +22 -0
- package/dist/components/ShapeEditor/_model/clipboard.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/cursors.d.cts +23 -0
- package/dist/components/ShapeEditor/_model/cursors.d.ts +2 -2
- package/dist/components/ShapeEditor/_model/geometry.cjs.map +1 -1
- package/dist/components/ShapeEditor/_model/geometry.d.cts +182 -0
- package/dist/components/ShapeEditor/_model/geometry.d.ts +17 -1
- package/dist/components/ShapeEditor/_model/geometry.js.map +1 -1
- package/dist/components/ShapeEditor/_model/imageDiagnosis.cjs +1 -1
- package/dist/components/ShapeEditor/_model/imageDiagnosis.cjs.map +1 -1
- package/dist/components/ShapeEditor/_model/imageDiagnosis.d.cts +38 -0
- package/dist/components/ShapeEditor/_model/imageDiagnosis.d.ts +4 -1
- package/dist/components/ShapeEditor/_model/imageDiagnosis.js +29 -20
- package/dist/components/ShapeEditor/_model/imageDiagnosis.js.map +1 -1
- package/dist/components/ShapeEditor/_model/imageLoad.d.cts +29 -0
- package/dist/components/ShapeEditor/_model/imageSignature.d.cts +18 -0
- package/dist/components/ShapeEditor/_model/imageTiles.d.cts +11 -0
- package/dist/components/ShapeEditor/_model/keymap.cjs.map +1 -1
- package/dist/components/ShapeEditor/_model/keymap.d.cts +17 -0
- package/dist/components/ShapeEditor/_model/keymap.d.ts +2 -0
- package/dist/components/ShapeEditor/_model/keymap.js.map +1 -1
- package/dist/components/ShapeEditor/_model/overlays.d.cts +108 -0
- package/dist/components/ShapeEditor/_model/overlays.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/pinIcon.d.cts +13 -0
- package/dist/components/ShapeEditor/_model/polygonFill.d.cts +2 -0
- package/dist/components/ShapeEditor/_model/polygonFill.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/props.d.cts +13 -0
- package/dist/components/ShapeEditor/_model/props.d.ts +8 -8
- package/dist/components/ShapeEditor/_model/scalarMask.d.cts +21 -0
- package/dist/components/ShapeEditor/_model/scalarMask.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/shapeHitTest.d.cts +14 -0
- package/dist/components/ShapeEditor/_model/shapeHitTest.d.ts +2 -2
- package/dist/components/ShapeEditor/_model/shapeRenderStyle.d.cts +16 -0
- package/dist/components/ShapeEditor/_model/shapeRenderStyle.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/strings.cjs.map +1 -1
- package/dist/components/ShapeEditor/_model/strings.d.cts +62 -0
- package/dist/components/ShapeEditor/_model/strings.d.ts +2 -1
- package/dist/components/ShapeEditor/_model/strings.js.map +1 -1
- package/dist/components/ShapeEditor/_model/tools.cjs.map +1 -1
- package/dist/components/ShapeEditor/_model/tools.d.cts +29 -0
- package/dist/components/ShapeEditor/_model/tools.d.ts +4 -2
- package/dist/components/ShapeEditor/_model/tools.js.map +1 -1
- package/dist/components/ShapeEditor/_model/types/assistant.d.cts +37 -0
- package/dist/components/ShapeEditor/_model/types/assistant.d.ts +3 -1
- package/dist/components/ShapeEditor/_model/types/handle.d.cts +124 -0
- package/dist/components/ShapeEditor/_model/types/handle.d.ts +30 -4
- package/dist/components/ShapeEditor/_model/types/props.d.cts +430 -0
- package/dist/components/ShapeEditor/_model/types/props.d.ts +83 -20
- package/dist/components/ShapeEditor/_model/viewSettings.cjs.map +1 -1
- package/dist/components/ShapeEditor/_model/viewSettings.d.cts +73 -0
- package/dist/components/ShapeEditor/_model/viewSettings.d.ts +13 -1
- package/dist/components/ShapeEditor/_model/viewSettings.js.map +1 -1
- package/dist/components/ShapeEditor/_model/viewerPatch.d.cts +60 -0
- package/dist/components/ShapeEditor/_model/viewerPatch.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/viewport.d.cts +36 -0
- package/dist/components/ShapeEditor/_model/viewport.d.ts +1 -1
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.cjs +1 -1
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.cjs.map +1 -1
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.d.cts +121 -0
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.d.ts +5 -5
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.js +1 -1
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.js.map +1 -1
- package/dist/components/ShapeEditor/_renderers/imageLayer.d.cts +35 -0
- package/dist/components/ShapeEditor/_renderers/overlayLayer.d.cts +36 -0
- package/dist/components/ShapeEditor/_renderers/overlayLayer.d.ts +2 -2
- package/dist/components/ShapeEditor/_renderers/previewLayer.cjs +1 -1
- package/dist/components/ShapeEditor/_renderers/previewLayer.cjs.map +1 -1
- package/dist/components/ShapeEditor/_renderers/previewLayer.d.cts +34 -0
- package/dist/components/ShapeEditor/_renderers/previewLayer.d.ts +5 -3
- package/dist/components/ShapeEditor/_renderers/previewLayer.js +3 -0
- package/dist/components/ShapeEditor/_renderers/previewLayer.js.map +1 -1
- package/dist/components/ShapeEditor/_renderers/shapeLayer.d.cts +49 -0
- package/dist/components/ShapeEditor/_renderers/shapeLayer.d.ts +3 -3
- package/dist/components/ShapeEditor/_renderers/shapePainter.d.cts +27 -0
- package/dist/components/ShapeEditor/_renderers/shapePainter.d.ts +1 -1
- package/dist/components/ShapeEditor/_renderers/transformDriver.d.cts +55 -0
- package/dist/components/ShapeEditor/_renderers/transformDriver.d.ts +3 -3
- package/dist/components/ShapeEditor/_renderers/transformSession.d.cts +74 -0
- package/dist/components/ShapeEditor/_renderers/transformSession.d.ts +1 -1
- package/dist/components/ShapeEditor/_renderers/transformerLayer.d.cts +69 -0
- package/dist/components/ShapeEditor/_renderers/transformerLayer.d.ts +2 -2
- package/dist/components/ShapeEditor/_renderers/types.d.cts +129 -0
- package/dist/components/ShapeEditor/_renderers/types.d.ts +6 -6
- package/dist/components/ShapeEditor/_state/buildContextMenuItems.d.cts +26 -0
- package/dist/components/ShapeEditor/_state/buildContextMenuItems.d.ts +5 -5
- package/dist/components/ShapeEditor/_state/buildHotkeyActions.d.cts +42 -0
- package/dist/components/ShapeEditor/_state/buildHotkeyActions.d.ts +7 -7
- package/dist/components/ShapeEditor/_state/createInteractionController.d.cts +73 -0
- package/dist/components/ShapeEditor/_state/createInteractionController.d.ts +9 -9
- package/dist/components/ShapeEditor/_state/drawSessionState.d.cts +6 -0
- package/dist/components/ShapeEditor/_state/drawSessionState.d.ts +2 -2
- package/dist/components/ShapeEditor/_state/useAssistant.d.cts +48 -0
- package/dist/components/ShapeEditor/_state/useAssistant.d.ts +3 -3
- package/dist/components/ShapeEditor/_state/useDrawSession.d.cts +61 -0
- package/dist/components/ShapeEditor/_state/useDrawSession.d.ts +5 -5
- package/dist/components/ShapeEditor/_state/useEditorDocument.d.cts +23 -0
- package/dist/components/ShapeEditor/_state/useEditorDocument.d.ts +1 -1
- package/dist/components/ShapeEditor/_state/useEditorHandle.d.cts +34 -0
- package/dist/components/ShapeEditor/_state/useEditorHandle.d.ts +9 -9
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.cjs +1 -1
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.cjs.map +1 -1
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.d.cts +25 -0
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.d.ts +1 -1
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.js +15 -15
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.js.map +1 -1
- package/dist/components/ShapeEditor/_state/useEditorView.d.cts +15 -0
- package/dist/components/ShapeEditor/_state/useEditorView.d.ts +1 -1
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.cjs +1 -1
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.cjs.map +1 -1
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.d.cts +89 -0
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.d.ts +6 -6
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.js +23 -20
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.js.map +1 -1
- package/dist/components/ShapeEditor/_state/useLatestRef.d.cts +7 -0
- package/dist/components/ShapeEditor/_state/useMinimapNavigation.d.cts +27 -0
- package/dist/components/ShapeEditor/_state/useMinimapNavigation.d.ts +1 -1
- package/dist/components/ShapeEditor/_state/useMinimapSync.d.cts +26 -0
- package/dist/components/ShapeEditor/_state/useMinimapSync.d.ts +3 -3
- package/dist/components/ShapeEditor/_state/useSelectionActions.d.cts +31 -0
- package/dist/components/ShapeEditor/_state/useSelectionActions.d.ts +2 -2
- package/dist/components/ShapeEditor/_state/useSelectionInfoOverlay.d.cts +32 -0
- package/dist/components/ShapeEditor/_state/useSelectionInfoOverlay.d.ts +4 -4
- package/dist/components/ShapeEditor/_state/useSelectionModel.d.cts +24 -0
- package/dist/components/ShapeEditor/_state/useSelectionModel.d.ts +4 -4
- package/dist/components/ShapeEditor/_state/useViewportControls.d.cts +23 -0
- package/dist/components/ShapeEditor/_state/useViewportControls.d.ts +3 -3
- package/dist/components/ShapeEditor/index.d.cts +13 -0
- package/dist/components/ShapeEditor/index.d.ts +13 -8
- package/dist/components/Shortcut/Shortcut.cjs.map +1 -1
- package/dist/components/Shortcut/Shortcut.d.cts +24 -0
- package/dist/components/Shortcut/Shortcut.d.ts +16 -0
- package/dist/components/Shortcut/Shortcut.js.map +1 -1
- package/dist/components/Shortcut/index.d.cts +2 -0
- package/dist/components/Shortcut/index.d.ts +2 -2
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.cts +26 -0
- package/dist/components/Skeleton/Skeleton.d.ts +19 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Skeleton/index.d.cts +2 -0
- package/dist/components/Skeleton/index.d.ts +2 -2
- package/dist/components/Slider/Slider.cjs +1 -1
- package/dist/components/Slider/Slider.cjs.map +1 -1
- package/dist/components/Slider/Slider.d.cts +45 -0
- package/dist/components/Slider/Slider.d.ts +33 -1
- package/dist/components/Slider/Slider.js +18 -14
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Slider/index.d.cts +2 -0
- package/dist/components/Slider/index.d.ts +2 -2
- package/dist/components/Spinner/Spinner.cjs.map +1 -1
- package/dist/components/Spinner/Spinner.d.cts +32 -0
- package/dist/components/Spinner/Spinner.d.ts +18 -1
- package/dist/components/Spinner/Spinner.js.map +1 -1
- package/dist/components/Spinner/index.d.cts +2 -0
- package/dist/components/Spinner/index.d.ts +2 -2
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.cjs.map +1 -1
- package/dist/components/Switch/Switch.d.cts +29 -0
- package/dist/components/Switch/Switch.d.ts +16 -0
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Switch/index.d.cts +2 -0
- package/dist/components/Switch/index.d.ts +2 -2
- package/dist/components/Tab/Tab.cjs.map +1 -1
- package/dist/components/Tab/Tab.d.cts +45 -0
- package/dist/components/Tab/Tab.d.ts +26 -0
- package/dist/components/Tab/Tab.js.map +1 -1
- package/dist/components/Tab/index.d.cts +2 -0
- package/dist/components/Tab/index.d.ts +2 -2
- package/dist/components/Tag/Tag.cjs.map +1 -1
- package/dist/components/Tag/Tag.d.cts +50 -0
- package/dist/components/Tag/Tag.d.ts +32 -1
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Tag/index.d.cts +2 -0
- package/dist/components/Tag/index.d.ts +2 -2
- package/dist/components/Tagbox/Tagbox.cjs +1 -1
- package/dist/components/Tagbox/Tagbox.cjs.map +1 -1
- package/dist/components/Tagbox/Tagbox.d.cts +67 -0
- package/dist/components/Tagbox/Tagbox.d.ts +46 -3
- package/dist/components/Tagbox/Tagbox.js +5 -3
- package/dist/components/Tagbox/Tagbox.js.map +1 -1
- package/dist/components/Tagbox/index.d.cts +2 -0
- package/dist/components/Tagbox/index.d.ts +2 -2
- package/dist/components/Textarea/Textarea.cjs +1 -1
- package/dist/components/Textarea/Textarea.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.d.cts +51 -0
- package/dist/components/Textarea/Textarea.d.ts +32 -3
- package/dist/components/Textarea/Textarea.js +20 -19
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/index.d.cts +2 -0
- package/dist/components/Textarea/index.d.ts +2 -2
- package/dist/components/Textbox/Textbox.cjs.map +1 -1
- package/dist/components/Textbox/Textbox.d.cts +49 -0
- package/dist/components/Textbox/Textbox.d.ts +30 -1
- package/dist/components/Textbox/Textbox.js.map +1 -1
- package/dist/components/Textbox/index.d.cts +2 -0
- package/dist/components/Textbox/index.d.ts +2 -2
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.d.cts +99 -0
- package/dist/components/Toast/Toast.d.ts +72 -4
- package/dist/components/Toast/Toast.js +3 -2
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toast/index.d.cts +2 -0
- package/dist/components/Toast/index.d.ts +2 -2
- package/dist/components/ToggleButton/ToggleButton.cjs.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.d.cts +41 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +21 -0
- package/dist/components/ToggleButton/ToggleButton.js.map +1 -1
- package/dist/components/ToggleButton/index.d.cts +2 -0
- package/dist/components/ToggleButton/index.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.cts +40 -0
- package/dist/components/Tooltip/Tooltip.d.ts +27 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/index.d.cts +2 -0
- package/dist/components/Tooltip/index.d.ts +2 -2
- package/dist/components/TruncatedText/TruncatedText.cjs.map +1 -1
- package/dist/components/TruncatedText/TruncatedText.d.cts +44 -0
- package/dist/components/TruncatedText/TruncatedText.d.ts +22 -0
- package/dist/components/TruncatedText/TruncatedText.js.map +1 -1
- package/dist/components/TruncatedText/index.d.cts +2 -0
- package/dist/components/TruncatedText/index.d.ts +2 -2
- package/dist/components/Typography/Typography.cjs.map +1 -1
- package/dist/components/Typography/Typography.d.cts +33 -0
- package/dist/components/Typography/Typography.d.ts +21 -0
- package/dist/components/Typography/Typography.js.map +1 -1
- package/dist/components/Typography/index.d.cts +2 -0
- package/dist/components/Typography/index.d.ts +2 -2
- package/dist/components/UploadArea/UploadArea.cjs +1 -1
- package/dist/components/UploadArea/UploadArea.cjs.map +1 -1
- package/dist/components/UploadArea/UploadArea.d.cts +82 -0
- package/dist/components/UploadArea/UploadArea.d.ts +66 -1
- package/dist/components/UploadArea/UploadArea.js +55 -34
- package/dist/components/UploadArea/UploadArea.js.map +1 -1
- package/dist/components/UploadArea/index.d.cts +2 -0
- package/dist/components/UploadArea/index.d.ts +2 -2
- package/dist/illustration.cjs +1 -0
- package/dist/illustration.js +3 -0
- package/dist/index.d.cts +52 -0
- package/dist/index.d.ts +52 -52
- package/dist/llms-full.txt +5993 -0
- package/dist/llms.txt +118 -0
- package/dist/shape-editor.cjs +2 -1
- package/dist/shape-editor.cjs.map +1 -0
- package/dist/shape-editor.js +8 -3
- package/dist/shape-editor.js.map +1 -0
- package/dist/styles.css +2 -2
- package/dist/tailwind.css +434 -0
- package/dist/utils/cn.d.cts +12 -0
- package/dist/utils/cn.d.ts +10 -0
- package/dist/utils/keyboard.d.cts +3 -0
- package/dist/utils/sheet.d.cts +17 -0
- package/dist/utils/useControllableState.d.cts +17 -0
- package/dist/utils/useModalAutoFocus.d.cts +11 -0
- package/dist/utils/useResizableWidth.d.cts +30 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +54 -17
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { EditorExternalTool } from "../_model/props.cjs";
|
|
2
|
+
import { type Tool } from "../_model/tools.cjs";
|
|
3
|
+
import type { InteractionController } from "./createInteractionController.cjs";
|
|
4
|
+
import type { AssistantSession } from "./useAssistant.cjs";
|
|
5
|
+
import type { DrawSession } from "./useDrawSession.cjs";
|
|
6
|
+
import type { EditorActionHandlers } from "./useEditorHotkeys.cjs";
|
|
7
|
+
import type { SelectionActions } from "./useSelectionActions.cjs";
|
|
8
|
+
/** 문서·그리기 세션 공용 실행 취소. 잠금·읽기전용이면 되돌리지 않는다. */
|
|
9
|
+
export interface EditorHistory {
|
|
10
|
+
undo: () => void;
|
|
11
|
+
redo: () => void;
|
|
12
|
+
canUndo: () => boolean;
|
|
13
|
+
canRedo: () => boolean;
|
|
14
|
+
}
|
|
15
|
+
interface HotkeyContext<TMeta> {
|
|
16
|
+
history: EditorHistory;
|
|
17
|
+
selection: SelectionActions<TMeta>;
|
|
18
|
+
drawSession: DrawSession<TMeta>;
|
|
19
|
+
assistant: AssistantSession<TMeta>;
|
|
20
|
+
controller: () => InteractionController | null;
|
|
21
|
+
externalTool: () => EditorExternalTool | undefined;
|
|
22
|
+
hasSelection: () => boolean;
|
|
23
|
+
/** 잠금으로 막힌 편집 시도면 호스트에 알리고 true. */
|
|
24
|
+
rejectLockedEdit: (hasTarget?: boolean) => boolean;
|
|
25
|
+
editLocked: boolean;
|
|
26
|
+
editingId: string | null;
|
|
27
|
+
setEditingId: (id: string | null) => void;
|
|
28
|
+
/** 선택된 단일 정점 편집 가능 도형 id(없으면 null). */
|
|
29
|
+
vertexEditTarget: () => string | null;
|
|
30
|
+
deleteEditingVertices: () => boolean;
|
|
31
|
+
zoomAtCenter: (factor: number) => void;
|
|
32
|
+
zoom100: () => void;
|
|
33
|
+
zoomFit: () => void;
|
|
34
|
+
toggleMinimap: () => void;
|
|
35
|
+
toggleCursorGuide: () => void;
|
|
36
|
+
togglePixelation: () => void;
|
|
37
|
+
selectTool: (tool: Tool) => void;
|
|
38
|
+
onIdleEscape?: () => void;
|
|
39
|
+
}
|
|
40
|
+
/** 기본 단축키 동작 — keymap prop이 키 배정을 재정의/비활성화한다. */
|
|
41
|
+
export declare function buildHotkeyActions<TMeta>(ctx: HotkeyContext<TMeta>): EditorActionHandlers;
|
|
42
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { EditorExternalTool } from "../_model/props";
|
|
2
|
-
import { type Tool } from "../_model/tools";
|
|
3
|
-
import type { InteractionController } from "./createInteractionController";
|
|
4
|
-
import type { AssistantSession } from "./useAssistant";
|
|
5
|
-
import type { DrawSession } from "./useDrawSession";
|
|
6
|
-
import type { EditorActionHandlers } from "./useEditorHotkeys";
|
|
7
|
-
import type { SelectionActions } from "./useSelectionActions";
|
|
1
|
+
import type { EditorExternalTool } from "../_model/props.js";
|
|
2
|
+
import { type Tool } from "../_model/tools.js";
|
|
3
|
+
import type { InteractionController } from "./createInteractionController.js";
|
|
4
|
+
import type { AssistantSession } from "./useAssistant.js";
|
|
5
|
+
import type { DrawSession } from "./useDrawSession.js";
|
|
6
|
+
import type { EditorActionHandlers } from "./useEditorHotkeys.js";
|
|
7
|
+
import type { SelectionActions } from "./useSelectionActions.js";
|
|
8
8
|
/** 문서·그리기 세션 공용 실행 취소. 잠금·읽기전용이면 되돌리지 않는다. */
|
|
9
9
|
export interface EditorHistory {
|
|
10
10
|
undo: () => void;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import type { EditorInteractionMode } from "../_model/cursors.cjs";
|
|
3
|
+
import { type EditorShape, type Point, type ShapeStyle } from "../_model/geometry.cjs";
|
|
4
|
+
import type { EditorExternalTool } from "../_model/props.cjs";
|
|
5
|
+
import type { ShapeRenderStyleDefaults } from "../_model/shapeRenderStyle.cjs";
|
|
6
|
+
import { type Tool } from "../_model/tools.cjs";
|
|
7
|
+
import type { EditorRenderer, EditorRendererCallbacks } from "../_renderers/types.cjs";
|
|
8
|
+
import type { AssistantSession } from "./useAssistant.cjs";
|
|
9
|
+
import type { DrawSession } from "./useDrawSession.cjs";
|
|
10
|
+
import type { EditorDocument } from "./useEditorDocument.cjs";
|
|
11
|
+
/**
|
|
12
|
+
* 캔버스 포인터 상호작용 상태머신. 렌더러가 올려주는 포인터 이벤트를 받아
|
|
13
|
+
* 팬/그리기/마퀴/꼭짓점드래그/외부도구를 조율하고, 문서·선택·그리기세션에 위임한다.
|
|
14
|
+
*
|
|
15
|
+
* 엔진 인스턴스마다 1회 생성한다(그때의 상호작용 임시 상태를 클로저로 보관). 최신 상태는
|
|
16
|
+
* 전부 ref/drawSession으로 읽으므로 재생성 없이 최신 값을 반영한다.
|
|
17
|
+
*/
|
|
18
|
+
export interface InteractionControllerCtx<TMeta> {
|
|
19
|
+
engineRef: RefObject<EditorRenderer | null>;
|
|
20
|
+
toolRef: RefObject<Tool>;
|
|
21
|
+
externalToolMapRef: RefObject<Map<string, EditorExternalTool>>;
|
|
22
|
+
spaceRef: RefObject<boolean>;
|
|
23
|
+
docRef: RefObject<EditorDocument<TMeta>>;
|
|
24
|
+
/** 숨김/비활성 오버라이드가 적용된 도형. 포인터 판정은 화면 상태를 따른다. */
|
|
25
|
+
renderShapesRef: RefObject<EditorShape<TMeta>[]>;
|
|
26
|
+
renderDefaultsRef: RefObject<ShapeRenderStyleDefaults>;
|
|
27
|
+
/** 부모가 확정한 선택. 단축키·메뉴·드래그 대상은 모두 이 값을 기준으로 한다. */
|
|
28
|
+
selRef: RefObject<string[]>;
|
|
29
|
+
draftRef: RefObject<ShapeStyle | undefined>;
|
|
30
|
+
readOnlyRef: RefObject<boolean | undefined>;
|
|
31
|
+
/** true면 SELECT 도구 마퀴(범위 선택) 비활성 — 클릭 단건 선택만. */
|
|
32
|
+
disableMarqueeRef?: RefObject<boolean | undefined>;
|
|
33
|
+
/**
|
|
34
|
+
* 편집 잠금(완료 등). 선택은 허용하고, 그리기·도형 드래그·정점 편집 진입
|
|
35
|
+
* 시도는 막고 onLockedInteraction을 호출한다.
|
|
36
|
+
*/
|
|
37
|
+
lockedRef: RefObject<boolean | undefined>;
|
|
38
|
+
onLockedInteraction: () => void;
|
|
39
|
+
/** 그리기 도구인데 draft가 없어 시작할 수 없을 때 호출(호스트가 안내). */
|
|
40
|
+
onDrawAttemptWithoutDraft: () => void;
|
|
41
|
+
createRef: RefObject<(type: EditorShape<TMeta>["type"], points: Point[]) => void>;
|
|
42
|
+
selectRef: RefObject<(ids: string[]) => void>;
|
|
43
|
+
/** 폴리곤 정점 편집모드 진입(더블클릭). */
|
|
44
|
+
enterEditRef: RefObject<(id: string) => void>;
|
|
45
|
+
/** 현재 편집모드 대상 폴리곤 id(null이면 비편집). 마퀴를 정점 범위선택으로 전환. */
|
|
46
|
+
editingIdRef: RefObject<string | null>;
|
|
47
|
+
drawSessionRef: RefObject<DrawSession<TMeta>>;
|
|
48
|
+
assistantRef: RefObject<AssistantSession<TMeta>>;
|
|
49
|
+
setCursorHint: (cursor: string | null) => void;
|
|
50
|
+
setInteractionMode: (mode: EditorInteractionMode) => void;
|
|
51
|
+
syncMinimap: () => void;
|
|
52
|
+
onTransformPreview: (updates: {
|
|
53
|
+
id: string;
|
|
54
|
+
points: Point[];
|
|
55
|
+
}[]) => void;
|
|
56
|
+
/**
|
|
57
|
+
* 박스 드래그 그리는 중 미리보기 지오메트리 통지 — 좌상단 클래스 배지 + 우하단
|
|
58
|
+
* 크기(W×H) 정보 오버레이용. 그리는 중엔 bbox 두 꼭짓점, 종료 시 null.
|
|
59
|
+
*/
|
|
60
|
+
onDrawPreview: (info: {
|
|
61
|
+
type: EditorShape<TMeta>["type"];
|
|
62
|
+
points: Point[];
|
|
63
|
+
} | null) => void;
|
|
64
|
+
}
|
|
65
|
+
export interface InteractionController extends EditorRendererCallbacks {
|
|
66
|
+
/** 새 선택 요청 — 선택에 묶인 클릭 대기와 렌더러 변형만 취소한다. 취소했으면 true. */
|
|
67
|
+
interruptSelection: () => boolean;
|
|
68
|
+
/** Esc·도구/문서 전환 — 진행 중인 포인터 제스처와 렌더러 변형을 모두 취소한다. */
|
|
69
|
+
cancelGesture: () => boolean;
|
|
70
|
+
/** 부모가 확정 선택을 내려줄 때마다 호출 — 다른 선택으로 바뀌면 진행 중인 제스처를 취소한다. */
|
|
71
|
+
confirmSelection: (confirmed: string[]) => void;
|
|
72
|
+
}
|
|
73
|
+
export declare function createInteractionController<TMeta>(ctx: InteractionControllerCtx<TMeta>): InteractionController;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { RefObject } from "react";
|
|
2
|
-
import type { EditorInteractionMode } from "../_model/cursors";
|
|
3
|
-
import { type EditorShape, type Point, type ShapeStyle } from "../_model/geometry";
|
|
4
|
-
import type { EditorExternalTool } from "../_model/props";
|
|
5
|
-
import type { ShapeRenderStyleDefaults } from "../_model/shapeRenderStyle";
|
|
6
|
-
import { type Tool } from "../_model/tools";
|
|
7
|
-
import type { EditorRenderer, EditorRendererCallbacks } from "../_renderers/types";
|
|
8
|
-
import type { AssistantSession } from "./useAssistant";
|
|
9
|
-
import type { DrawSession } from "./useDrawSession";
|
|
10
|
-
import type { EditorDocument } from "./useEditorDocument";
|
|
2
|
+
import type { EditorInteractionMode } from "../_model/cursors.js";
|
|
3
|
+
import { type EditorShape, type Point, type ShapeStyle } from "../_model/geometry.js";
|
|
4
|
+
import type { EditorExternalTool } from "../_model/props.js";
|
|
5
|
+
import type { ShapeRenderStyleDefaults } from "../_model/shapeRenderStyle.js";
|
|
6
|
+
import { type Tool } from "../_model/tools.js";
|
|
7
|
+
import type { EditorRenderer, EditorRendererCallbacks } from "../_renderers/types.js";
|
|
8
|
+
import type { AssistantSession } from "./useAssistant.js";
|
|
9
|
+
import type { DrawSession } from "./useDrawSession.js";
|
|
10
|
+
import type { EditorDocument } from "./useEditorDocument.js";
|
|
11
11
|
/**
|
|
12
12
|
* 캔버스 포인터 상호작용 상태머신. 렌더러가 올려주는 포인터 이벤트를 받아
|
|
13
13
|
* 팬/그리기/마퀴/꼭짓점드래그/외부도구를 조율하고, 문서·선택·그리기세션에 위임한다.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Point } from "../_model/geometry.cjs";
|
|
2
|
+
import type { ScalarStroke } from "../_model/scalarMask.cjs";
|
|
3
|
+
export declare function cloneScalarStrokes(strokes: ScalarStroke[]): ScalarStroke[];
|
|
4
|
+
export declare function scalarStrokesEqual(a: ScalarStroke[], b: ScalarStroke[]): boolean;
|
|
5
|
+
export declare function clonePoints(points: Point[]): Point[];
|
|
6
|
+
export declare function pointsEqual(a: Point[], b: Point[]): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Point } from "../_model/geometry";
|
|
2
|
-
import type { ScalarStroke } from "../_model/scalarMask";
|
|
1
|
+
import type { Point } from "../_model/geometry.js";
|
|
2
|
+
import type { ScalarStroke } from "../_model/scalarMask.js";
|
|
3
3
|
export declare function cloneScalarStrokes(strokes: ScalarStroke[]): ScalarStroke[];
|
|
4
4
|
export declare function scalarStrokesEqual(a: ScalarStroke[], b: ScalarStroke[]): boolean;
|
|
5
5
|
export declare function clonePoints(points: Point[]): Point[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { type EditorShape, type Point, type ShapeStyle } from "../_model/geometry.cjs";
|
|
3
|
+
import type { EditorAssistant } from "../_model/props.cjs";
|
|
4
|
+
import type { EditorDocument } from "./useEditorDocument.cjs";
|
|
5
|
+
export type AssistantStatus = "idle" | "loading" | "ready";
|
|
6
|
+
interface UseAssistantParams<TMeta> {
|
|
7
|
+
docRef: RefObject<EditorDocument<TMeta>>;
|
|
8
|
+
draftRef: RefObject<ShapeStyle | undefined>;
|
|
9
|
+
draftMeta: TMeta | undefined;
|
|
10
|
+
changeSelection: (ids: string[]) => void;
|
|
11
|
+
assistantRef: RefObject<EditorAssistant | undefined>;
|
|
12
|
+
}
|
|
13
|
+
type Box = {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* AI 어시스트 세션(SAM 식). 프롬프트 수집(박스/포인트)·호스트 infer 호출·**즉시 커밋**.
|
|
21
|
+
* 옵스 에디터와 동일하게 추론 결과를 프리뷰 없이 바로 도형으로 만든다.
|
|
22
|
+
*
|
|
23
|
+
* 두 갈래의 수명 주기(옵스 파리티):
|
|
24
|
+
* - **박스 프롬프트(ASSISTANT_POLYGON/RECT)**: 드래그마다 **병렬 독립 요청** —
|
|
25
|
+
* 앞 요청이 진행 중이어도 새 드래그가 그것을 취소하지 않고 각자 완료 시 커밋된다.
|
|
26
|
+
* 커밋된 결과는 확정(Esc로 지워지지 않음 — 일반 undo/삭제로 다룬다).
|
|
27
|
+
* - **포인트 프롬프트(마법봉)**: 단일 세션. 클릭=이전 세션 확정+새 세션, Alt+클릭=
|
|
28
|
+
* 같은 도형 제자리 refine. Esc=세션 취소(이번 세션 생성분 제거 + 진행 중 응답 폐기).
|
|
29
|
+
*/
|
|
30
|
+
export declare function useAssistant<TMeta>({ docRef, draftRef, draftMeta, changeSelection, assistantRef, }: UseAssistantParams<TMeta>): {
|
|
31
|
+
status: AssistantStatus;
|
|
32
|
+
points: {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
positive: boolean;
|
|
36
|
+
}[];
|
|
37
|
+
/** 진행 중인 박스 프롬프트들(병렬). 오버레이 shimmer 표시용. */
|
|
38
|
+
boxes: Box[];
|
|
39
|
+
beginBox: (b: Box, resultShape?: "polygon" | "rect") => void;
|
|
40
|
+
addPoint: (p: Point, positive: boolean) => void;
|
|
41
|
+
newPolygon: (p: Point) => void;
|
|
42
|
+
refineShape: (shape: EditorShape<TMeta>, p: Point, positive: boolean) => void;
|
|
43
|
+
finalize: () => void;
|
|
44
|
+
cancel: () => void;
|
|
45
|
+
isActive: () => boolean;
|
|
46
|
+
};
|
|
47
|
+
export type AssistantSession<TMeta> = ReturnType<typeof useAssistant<TMeta>>;
|
|
48
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type RefObject } from "react";
|
|
2
|
-
import { type EditorShape, type Point, type ShapeStyle } from "../_model/geometry";
|
|
3
|
-
import type { EditorAssistant } from "../_model/props";
|
|
4
|
-
import type { EditorDocument } from "./useEditorDocument";
|
|
2
|
+
import { type EditorShape, type Point, type ShapeStyle } from "../_model/geometry.js";
|
|
3
|
+
import type { EditorAssistant } from "../_model/props.js";
|
|
4
|
+
import type { EditorDocument } from "./useEditorDocument.js";
|
|
5
5
|
export type AssistantStatus = "idle" | "loading" | "ready";
|
|
6
6
|
interface UseAssistantParams<TMeta> {
|
|
7
7
|
docRef: RefObject<EditorDocument<TMeta>>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { type EditorShape, type Point, type ShapeStyle } from "../_model/geometry.cjs";
|
|
3
|
+
import type { DrawSessionChange } from "../_model/props.cjs";
|
|
4
|
+
import { type BrushScalarMode, type Tool } from "../_model/tools.cjs";
|
|
5
|
+
import type { EditorRenderer } from "../_renderers/types.cjs";
|
|
6
|
+
import type { useEditorDocument } from "./useEditorDocument.cjs";
|
|
7
|
+
type DocApi<TMeta> = ReturnType<typeof useEditorDocument<TMeta>>;
|
|
8
|
+
/** useDrawSession가 반환하는 그리기 세션 핸들. */
|
|
9
|
+
export type DrawSession<TMeta> = ReturnType<typeof useDrawSession<TMeta>>;
|
|
10
|
+
interface UseDrawSessionParams<TMeta> {
|
|
11
|
+
toolRef: RefObject<Tool>;
|
|
12
|
+
selRef: RefObject<string[]>;
|
|
13
|
+
docRef: RefObject<DocApi<TMeta>>;
|
|
14
|
+
readOnlyRef: RefObject<boolean | undefined>;
|
|
15
|
+
draftRef: RefObject<ShapeStyle | undefined>;
|
|
16
|
+
brushSizeRef: RefObject<number>;
|
|
17
|
+
/** 자유선/붓→폴리곤 단순화 강도(RDP epsilon). */
|
|
18
|
+
simplifyEpsilonRef: RefObject<number>;
|
|
19
|
+
draftMeta: TMeta | undefined;
|
|
20
|
+
engineRef: RefObject<EditorRenderer | null>;
|
|
21
|
+
onDrawSessionChange?: (session: DrawSessionChange) => void;
|
|
22
|
+
onDraftShapeChange?: (shape: Pick<EditorShape<TMeta>, "type" | "points" | "meta"> | null) => void;
|
|
23
|
+
changeSelection: (ids: string[]) => void;
|
|
24
|
+
createShape: (type: EditorShape<TMeta>["type"], points: Point[]) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare function useDrawSession<TMeta>({ toolRef, selRef, docRef, readOnlyRef, draftRef, brushSizeRef, simplifyEpsilonRef, draftMeta, engineRef, onDrawSessionChange, onDraftShapeChange, changeSelection, createShape, }: UseDrawSessionParams<TMeta>): {
|
|
27
|
+
reset: () => void;
|
|
28
|
+
undoSession: () => boolean;
|
|
29
|
+
redoSession: () => boolean;
|
|
30
|
+
canUndoSession: () => boolean;
|
|
31
|
+
canRedoSession: () => boolean;
|
|
32
|
+
hasDraftSession: () => boolean;
|
|
33
|
+
hasDraftPoints: () => boolean;
|
|
34
|
+
commitDraftSession: () => boolean;
|
|
35
|
+
completeFreehandStroke: () => void;
|
|
36
|
+
setBrushScalarMode: (mode: BrushScalarMode) => void;
|
|
37
|
+
getBrushScalarMode: () => BrushScalarMode;
|
|
38
|
+
hasBrushSession: () => boolean;
|
|
39
|
+
commitBrush: () => boolean;
|
|
40
|
+
cancelBrush: () => void;
|
|
41
|
+
beginBrushEditFromSelection: () => boolean;
|
|
42
|
+
deleteDraftSelectedPoints: () => boolean;
|
|
43
|
+
hitDraftPoint: (p: Point) => number;
|
|
44
|
+
getDraftPointsSnapshot: () => Point[];
|
|
45
|
+
tryClosePolygon: (p: Point, closeRadius: number) => boolean;
|
|
46
|
+
removeDraftPoint: (index: number) => boolean;
|
|
47
|
+
selectDraftPointForDrag: (index: number, additive: boolean) => {
|
|
48
|
+
base: Point[];
|
|
49
|
+
indices: number[];
|
|
50
|
+
} | null;
|
|
51
|
+
appendPolygonPoint: (p: Point) => void;
|
|
52
|
+
beginStroke: (p: Point) => void;
|
|
53
|
+
appendStrokePoint: (p: Point, step: number) => boolean;
|
|
54
|
+
moveDraftPoints: (base: Point[], indices: number[], dx: number, dy: number) => void;
|
|
55
|
+
commitDraftPointDrag: (moved: boolean) => void;
|
|
56
|
+
setDraftCursor: (p: Point | null) => void;
|
|
57
|
+
finishScalarStroke: () => void;
|
|
58
|
+
handleToolChange: (tool: Tool, isExternalTool: boolean) => void;
|
|
59
|
+
handleBrushSelectionChange: (selectedIds: string[], readOnly: boolean | undefined) => void;
|
|
60
|
+
};
|
|
61
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type RefObject } from "react";
|
|
2
|
-
import { type EditorShape, type Point, type ShapeStyle } from "../_model/geometry";
|
|
3
|
-
import type { DrawSessionChange } from "../_model/props";
|
|
4
|
-
import { type BrushScalarMode, type Tool } from "../_model/tools";
|
|
5
|
-
import type { EditorRenderer } from "../_renderers/types";
|
|
6
|
-
import type { useEditorDocument } from "./useEditorDocument";
|
|
2
|
+
import { type EditorShape, type Point, type ShapeStyle } from "../_model/geometry.js";
|
|
3
|
+
import type { DrawSessionChange } from "../_model/props.js";
|
|
4
|
+
import { type BrushScalarMode, type Tool } from "../_model/tools.js";
|
|
5
|
+
import type { EditorRenderer } from "../_renderers/types.js";
|
|
6
|
+
import type { useEditorDocument } from "./useEditorDocument.js";
|
|
7
7
|
type DocApi<TMeta> = ReturnType<typeof useEditorDocument<TMeta>>;
|
|
8
8
|
/** useDrawSession가 반환하는 그리기 세션 핸들. */
|
|
9
9
|
export type DrawSession<TMeta> = ReturnType<typeof useDrawSession<TMeta>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { EditorShape } from "../_model/geometry.cjs";
|
|
2
|
+
interface DocCallbacks<TMeta> {
|
|
3
|
+
onShapesCreated?: (shapes: EditorShape<TMeta>[]) => void;
|
|
4
|
+
onShapesUpdated?: (shapes: EditorShape<TMeta>[]) => void;
|
|
5
|
+
onShapesDeleted?: (ids: string[]) => void;
|
|
6
|
+
}
|
|
7
|
+
/** useEditorDocument가 반환하는 문서 핸들(에디터 도형+히스토리 제어). */
|
|
8
|
+
export type EditorDocument<TMeta> = ReturnType<typeof useEditorDocument<TMeta>>;
|
|
9
|
+
export declare function useEditorDocument<TMeta>(callbacks: DocCallbacks<TMeta>): {
|
|
10
|
+
shapes: EditorShape<TMeta>[];
|
|
11
|
+
create: (shapes: EditorShape<TMeta> | EditorShape<TMeta>[]) => void;
|
|
12
|
+
update: (shapes: EditorShape<TMeta>[]) => void;
|
|
13
|
+
remove: (ids: string[]) => void;
|
|
14
|
+
replace: (removeIds: string[], shapes: EditorShape<TMeta>[]) => void;
|
|
15
|
+
reorder: (ids: string[], edge: "front" | "back") => void;
|
|
16
|
+
reset: (shapes: EditorShape<TMeta>[]) => void;
|
|
17
|
+
undo: () => void;
|
|
18
|
+
redo: () => void;
|
|
19
|
+
canUndo: () => boolean;
|
|
20
|
+
canRedo: () => boolean;
|
|
21
|
+
getShapes: () => EditorShape<TMeta>[];
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Ref, type RefObject } from "react";
|
|
2
|
+
import { type RegionOverlayData } from "../_model/overlays.cjs";
|
|
3
|
+
import type { ShapeEditorHandle } from "../_model/props.cjs";
|
|
4
|
+
import type { ViewSettings } from "../_model/viewSettings.cjs";
|
|
5
|
+
import type { EditorRenderer } from "../_renderers/types.cjs";
|
|
6
|
+
import type { EditorHistory } from "./buildHotkeyActions.cjs";
|
|
7
|
+
import type { DrawSession } from "./useDrawSession.cjs";
|
|
8
|
+
import type { EditorDocument } from "./useEditorDocument.cjs";
|
|
9
|
+
import type { SelectionActions } from "./useSelectionActions.cjs";
|
|
10
|
+
import type { useViewportControls } from "./useViewportControls.cjs";
|
|
11
|
+
type ViewportActions = Pick<ReturnType<typeof useViewportControls>, "zoomToBounds" | "zoomToShapes" | "zoomToSelection" | "zoomAtCenter">;
|
|
12
|
+
/**
|
|
13
|
+
* ShapeEditorHandle 구현. 문서·그리기 세션·선택·뷰포트 액션을 하나의 명령형 핸들로
|
|
14
|
+
* 묶는다. 의존 함수가 모두 안정적이면 핸들은 도형 문서가 바뀔 때만 재생성된다.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useEditorHandle<TMeta>({ handleRef, engineRef, loadedImageRef, regionOverlayRef, viewRef, doc, history, drawSession, selection, changeSelection, rejectLockedEdit, viewport, }: {
|
|
17
|
+
handleRef: Ref<ShapeEditorHandle<TMeta>> | undefined;
|
|
18
|
+
engineRef: RefObject<EditorRenderer | null>;
|
|
19
|
+
loadedImageRef: RefObject<{
|
|
20
|
+
w: number;
|
|
21
|
+
h: number;
|
|
22
|
+
} | null>;
|
|
23
|
+
regionOverlayRef: RefObject<RegionOverlayData | null>;
|
|
24
|
+
viewRef: RefObject<ViewSettings>;
|
|
25
|
+
doc: EditorDocument<TMeta>;
|
|
26
|
+
history: EditorHistory;
|
|
27
|
+
drawSession: DrawSession<TMeta>;
|
|
28
|
+
selection: SelectionActions<TMeta>;
|
|
29
|
+
changeSelection: (ids: string[]) => void;
|
|
30
|
+
/** 잠금으로 막힌 편집이면 호스트에 알리고 true. */
|
|
31
|
+
rejectLockedEdit: (hasTarget?: boolean) => boolean;
|
|
32
|
+
viewport: ViewportActions;
|
|
33
|
+
}): void;
|
|
34
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type Ref, type RefObject } from "react";
|
|
2
|
-
import { type RegionOverlayData } from "../_model/overlays";
|
|
3
|
-
import type { ShapeEditorHandle } from "../_model/props";
|
|
4
|
-
import type { ViewSettings } from "../_model/viewSettings";
|
|
5
|
-
import type { EditorRenderer } from "../_renderers/types";
|
|
6
|
-
import type { EditorHistory } from "./buildHotkeyActions";
|
|
7
|
-
import type { DrawSession } from "./useDrawSession";
|
|
8
|
-
import type { EditorDocument } from "./useEditorDocument";
|
|
9
|
-
import type { SelectionActions } from "./useSelectionActions";
|
|
10
|
-
import type { useViewportControls } from "./useViewportControls";
|
|
2
|
+
import { type RegionOverlayData } from "../_model/overlays.js";
|
|
3
|
+
import type { ShapeEditorHandle } from "../_model/props.js";
|
|
4
|
+
import type { ViewSettings } from "../_model/viewSettings.js";
|
|
5
|
+
import type { EditorRenderer } from "../_renderers/types.js";
|
|
6
|
+
import type { EditorHistory } from "./buildHotkeyActions.js";
|
|
7
|
+
import type { DrawSession } from "./useDrawSession.js";
|
|
8
|
+
import type { EditorDocument } from "./useEditorDocument.js";
|
|
9
|
+
import type { SelectionActions } from "./useSelectionActions.js";
|
|
10
|
+
import type { useViewportControls } from "./useViewportControls.js";
|
|
11
11
|
type ViewportActions = Pick<ReturnType<typeof useViewportControls>, "zoomToBounds" | "zoomToShapes" | "zoomToSelection" | "zoomAtCenter">;
|
|
12
12
|
/**
|
|
13
13
|
* ShapeEditorHandle 구현. 문서·그리기 세션·선택·뷰포트 액션을 하나의 명령형 핸들로
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../utils/keyboard.cjs`),t=require(`./useLatestRef.cjs`),n=require(`../_model/keymap.cjs`);let r=require(`react`);var i={ArrowUp:[0,-1],ArrowDown:[0,1],ArrowLeft:[-1,0],ArrowRight:[1,0]}
|
|
1
|
+
"use client";require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../utils/keyboard.cjs`),t=require(`./useLatestRef.cjs`),n=require(`../_model/keymap.cjs`);let r=require(`react`);var i={ArrowUp:[0,-1],ArrowDown:[0,1],ArrowLeft:[-1,0],ArrowRight:[1,0]},a=`button,a[href],summary,[role="button"],[role="checkbox"],[role="switch"],[role="radio"],[role="option"],[role="menuitem"],[role="tab"]`;function o(o){let{spaceRef:s}=o,c=(0,r.useMemo)(()=>n.resolveKeymap(o.keymap),[o.keymap]),l=t.useLatestRef(o),u=t.useLatestRef(c);(0,r.useEffect)(()=>{let t=l.current.hostRef.current,r=t?.ownerDocument.defaultView;if(!t||!r)return;let o=r=>{if(r.defaultPrevented&&r.key!==`Escape`||e.isEditableTarget(r.target)||!e.isShortcutTarget(t,r.target))return;r.code===`Space`&&(r.repeat||(s.current=!0,l.current.onSpaceDown()),r.target instanceof Element&&r.target.closest(a)||r.preventDefault());let o=i[r.key];if(o){let e=r.shiftKey?10:1;l.current.nudge(o[0]*e,o[1]*e)!==!1&&r.preventDefault();return}let c=n.eventToCombo(r);if(!c)return;let d=u.current.get(c);d&&l.current.actions[d]?.()!==!1&&r.preventDefault()},c=e=>{e.code===`Space`&&s.current&&(s.current=!1,l.current.onSpaceUp())},d=()=>{s.current&&(s.current=!1,l.current.onSpaceUp())};return t.addEventListener(`keydown`,o),r.addEventListener(`keyup`,c,!0),r.addEventListener(`blur`,d),()=>{t.removeEventListener(`keydown`,o),r.removeEventListener(`keyup`,c,!0),r.removeEventListener(`blur`,d),d()}},[s])}exports.useEditorHotkeys=o;
|
|
2
2
|
//# sourceMappingURL=useEditorHotkeys.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditorHotkeys.cjs","names":[],"sources":["../../../../src/components/ShapeEditor/_state/useEditorHotkeys.ts"],"sourcesContent":["import { type RefObject, useEffect, useMemo } from \"react\";\nimport { isEditableTarget, isShortcutTarget } from \"@/utils/keyboard\";\nimport {\n type EditorAction,\n eventToCombo,\n type KeymapOverrides,\n resolveKeymap,\n} from \"../_model/keymap\";\nimport { useLatestRef } from \"./useLatestRef\";\n\n/** 액션 핸들러. false 반환 시 \"미처리\"로 보고 preventDefault를 건너뛴다. */\nexport type EditorActionHandlers = Partial<Record<EditorAction, () => boolean | void>>;\n\ninterface EditorHotkeysCtx {\n /** 호스트 재정의(문자열/배열=재매핑, null=비활성). 미지정 키는 기본값. */\n keymap?: KeymapOverrides;\n /** 에디터 루트 요소. 에디터를 포함하지 않는 모달 위에서는 액션을 무시하는 데 쓴다. */\n hostRef: RefObject<HTMLElement | null>;\n actions: EditorActionHandlers;\n spaceRef: RefObject<boolean>;\n /** Space 눌림/뗌 시 커서 갱신 등(index 소유). */\n onSpaceDown: () => void;\n onSpaceUp: () => void;\n /** 방향키 넛지. 이동 대상이 없으면 false를 반환해 호스트 단축키에 양보한다. */\n nudge: (dx: number, dy: number) => boolean | void;\n}\n\nconst ARROW_DELTA: Record<string, [number, number]> = {\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n};\n\n/**\n * 에디터 키보드 단축키. 기본 keymap을 내장하되 호스트가 재정의/비활성할 수 있다.\n * Space 추적과 방향키 넛지는 고정(재매핑 불가), 그 외 액션은 keymap 기반.\n * Shift 등 수식키는 여기서 추적하지 않는다 — 포인터 이벤트가 실어 오는 값을 쓴다.\n * 최신 keymap/액션을 ref로 읽어 리스너는 1회만 바인딩한다.\n */\nexport function useEditorHotkeys(ctx: EditorHotkeysCtx) {\n const { spaceRef } = ctx;\n const lookup = useMemo(() => resolveKeymap(ctx.keymap), [ctx.keymap]);\n\n const ref = useLatestRef(ctx);\n const lookupRef = useLatestRef(lookup);\n\n useEffect(() => {\n const host = ref.current.hostRef.current;\n const ownerWindow = host?.ownerDocument.defaultView;\n if (!host || !ownerWindow) return;\n const down = (e: KeyboardEvent) => {\n // 부모 모달이 capture에서 Escape 닫힘을 막아도 캔버스의 취소 단계는 이어받는다.\n if ((e.defaultPrevented && e.key !== \"Escape\") || isEditableTarget(e.target)) return;\n if (!isShortcutTarget(host, e.target)) return;\n if (e.code === \"Space\") {\n spaceRef.current = true;\n
|
|
1
|
+
{"version":3,"file":"useEditorHotkeys.cjs","names":[],"sources":["../../../../src/components/ShapeEditor/_state/useEditorHotkeys.ts"],"sourcesContent":["import { type RefObject, useEffect, useMemo } from \"react\";\nimport { isEditableTarget, isShortcutTarget } from \"@/utils/keyboard\";\nimport {\n type EditorAction,\n eventToCombo,\n type KeymapOverrides,\n resolveKeymap,\n} from \"../_model/keymap\";\nimport { useLatestRef } from \"./useLatestRef\";\n\n/** 액션 핸들러. false 반환 시 \"미처리\"로 보고 preventDefault를 건너뛴다. */\nexport type EditorActionHandlers = Partial<Record<EditorAction, () => boolean | void>>;\n\ninterface EditorHotkeysCtx {\n /** 호스트 재정의(문자열/배열=재매핑, null=비활성). 미지정 키는 기본값. */\n keymap?: KeymapOverrides;\n /** 에디터 루트 요소. 에디터를 포함하지 않는 모달 위에서는 액션을 무시하는 데 쓴다. */\n hostRef: RefObject<HTMLElement | null>;\n actions: EditorActionHandlers;\n spaceRef: RefObject<boolean>;\n /** Space 눌림/뗌 시 커서 갱신 등(index 소유). */\n onSpaceDown: () => void;\n onSpaceUp: () => void;\n /** 방향키 넛지. 이동 대상이 없으면 false를 반환해 호스트 단축키에 양보한다. */\n nudge: (dx: number, dy: number) => boolean | void;\n}\n\nconst ARROW_DELTA: Record<string, [number, number]> = {\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n};\n\n/** Space로 활성화되는 요소 — 이 위에서는 Space의 기본 동작을 막지 않는다. */\nconst SPACE_ACTIVATED =\n 'button,a[href],summary,[role=\"button\"],[role=\"checkbox\"],[role=\"switch\"],[role=\"radio\"],[role=\"option\"],[role=\"menuitem\"],[role=\"tab\"]';\n\n/**\n * 에디터 키보드 단축키. 기본 keymap을 내장하되 호스트가 재정의/비활성할 수 있다.\n * Space 추적과 방향키 넛지는 고정(재매핑 불가), 그 외 액션은 keymap 기반.\n * Shift 등 수식키는 여기서 추적하지 않는다 — 포인터 이벤트가 실어 오는 값을 쓴다.\n * 최신 keymap/액션을 ref로 읽어 리스너는 1회만 바인딩한다.\n */\nexport function useEditorHotkeys(ctx: EditorHotkeysCtx) {\n const { spaceRef } = ctx;\n const lookup = useMemo(() => resolveKeymap(ctx.keymap), [ctx.keymap]);\n\n const ref = useLatestRef(ctx);\n const lookupRef = useLatestRef(lookup);\n\n useEffect(() => {\n const host = ref.current.hostRef.current;\n const ownerWindow = host?.ownerDocument.defaultView;\n if (!host || !ownerWindow) return;\n const down = (e: KeyboardEvent) => {\n // 부모 모달이 capture에서 Escape 닫힘을 막아도 캔버스의 취소 단계는 이어받는다.\n if ((e.defaultPrevented && e.key !== \"Escape\") || isEditableTarget(e.target)) return;\n if (!isShortcutTarget(host, e.target)) return;\n if (e.code === \"Space\") {\n // 누르고 있는 동안의 반복 keydown은 팬 모드를 다시 켤 필요가 없다.\n if (!e.repeat) {\n spaceRef.current = true;\n ref.current.onSpaceDown();\n }\n // 캔버스에서 Space가 페이지를 스크롤하지 않게 한다. 포커스된 버튼류는 Space로\n // 눌러야 하므로 기본 동작을 남긴다.\n if (!(e.target instanceof Element && e.target.closest(SPACE_ACTIVATED))) {\n e.preventDefault();\n }\n }\n\n const arrow = ARROW_DELTA[e.key];\n if (arrow) {\n const step = e.shiftKey ? 10 : 1;\n if (ref.current.nudge(arrow[0] * step, arrow[1] * step) !== false) {\n e.preventDefault();\n }\n return;\n }\n\n const combo = eventToCombo(e);\n if (!combo) return;\n const action = lookupRef.current.get(combo);\n if (!action) return;\n const handled = ref.current.actions[action]?.();\n if (handled !== false) e.preventDefault();\n };\n const up = (e: KeyboardEvent) => {\n if (e.code === \"Space\" && spaceRef.current) {\n spaceRef.current = false;\n ref.current.onSpaceUp();\n }\n };\n const release = () => {\n if (spaceRef.current) {\n spaceRef.current = false;\n ref.current.onSpaceUp();\n }\n };\n host.addEventListener(\"keydown\", down);\n // 키 해제는 입력창의 전파 차단보다 먼저 처리한다. 창 밖에서 키를 떼어\n // keyup을 받지 못하는 경우에는 blur에서 눌림 상태를 정리한다.\n ownerWindow.addEventListener(\"keyup\", up, true);\n ownerWindow.addEventListener(\"blur\", release);\n return () => {\n host.removeEventListener(\"keydown\", down);\n ownerWindow.removeEventListener(\"keyup\", up, true);\n ownerWindow.removeEventListener(\"blur\", release);\n // effect 재설정 때도 팬 모드와 커서를 해제한다. ref만 지우면 엔진 상태가 남는다.\n release();\n };\n }, [spaceRef]);\n}\n"],"mappings":"wMA2BA,IAAM,EAAgD,CACpD,QAAS,CAAC,EAAG,GAAG,CAChB,UAAW,CAAC,EAAG,EAAE,CACjB,UAAW,CAAC,GAAI,EAAE,CAClB,WAAY,CAAC,EAAG,EAAE,CACnB,CAGK,EACJ,yIAQF,SAAgB,EAAiB,EAAuB,CACtD,GAAM,CAAE,YAAa,EACf,GAAA,EAAA,EAAA,aAAuB,EAAA,cAAc,EAAI,OAAO,CAAE,CAAC,EAAI,OAAO,CAAC,CAE/D,EAAM,EAAA,aAAa,EAAI,CACvB,EAAY,EAAA,aAAa,EAAO,EAEtC,EAAA,EAAA,eAAgB,CACd,IAAM,EAAO,EAAI,QAAQ,QAAQ,QAC3B,EAAc,GAAM,cAAc,YACxC,GAAI,CAAC,GAAQ,CAAC,EAAa,OAC3B,IAAM,EAAQ,GAAqB,CAGjC,GADK,EAAE,kBAAoB,EAAE,MAAQ,UAAa,EAAA,iBAAiB,EAAE,OAAO,EACxE,CAAC,EAAA,iBAAiB,EAAM,EAAE,OAAO,CAAE,OACnC,EAAE,OAAS,UAER,EAAE,SACL,EAAS,QAAU,GACnB,EAAI,QAAQ,aAAa,EAIrB,EAAE,kBAAkB,SAAW,EAAE,OAAO,QAAQ,EAAgB,EACpE,EAAE,gBAAgB,EAItB,IAAM,EAAQ,EAAY,EAAE,KAC5B,GAAI,EAAO,CACT,IAAM,EAAO,EAAE,SAAW,GAAK,EAC3B,EAAI,QAAQ,MAAM,EAAM,GAAK,EAAM,EAAM,GAAK,EAAK,GAAK,IAC1D,EAAE,gBAAgB,CAEpB,OAGF,IAAM,EAAQ,EAAA,aAAa,EAAE,CAC7B,GAAI,CAAC,EAAO,OACZ,IAAM,EAAS,EAAU,QAAQ,IAAI,EAAM,CACtC,GACW,EAAI,QAAQ,QAAQ,MAAW,GAC/B,IAAO,EAAE,gBAAgB,EAErC,EAAM,GAAqB,CAC3B,EAAE,OAAS,SAAW,EAAS,UACjC,EAAS,QAAU,GACnB,EAAI,QAAQ,WAAW,GAGrB,MAAgB,CAChB,EAAS,UACX,EAAS,QAAU,GACnB,EAAI,QAAQ,WAAW,GAQ3B,OALA,EAAK,iBAAiB,UAAW,EAAK,CAGtC,EAAY,iBAAiB,QAAS,EAAI,GAAK,CAC/C,EAAY,iBAAiB,OAAQ,EAAQ,KAChC,CACX,EAAK,oBAAoB,UAAW,EAAK,CACzC,EAAY,oBAAoB,QAAS,EAAI,GAAK,CAClD,EAAY,oBAAoB,OAAQ,EAAQ,CAEhD,GAAS,GAEV,CAAC,EAAS,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { type EditorAction, type KeymapOverrides } from "../_model/keymap.cjs";
|
|
3
|
+
/** 액션 핸들러. false 반환 시 "미처리"로 보고 preventDefault를 건너뛴다. */
|
|
4
|
+
export type EditorActionHandlers = Partial<Record<EditorAction, () => boolean | void>>;
|
|
5
|
+
interface EditorHotkeysCtx {
|
|
6
|
+
/** 호스트 재정의(문자열/배열=재매핑, null=비활성). 미지정 키는 기본값. */
|
|
7
|
+
keymap?: KeymapOverrides;
|
|
8
|
+
/** 에디터 루트 요소. 에디터를 포함하지 않는 모달 위에서는 액션을 무시하는 데 쓴다. */
|
|
9
|
+
hostRef: RefObject<HTMLElement | null>;
|
|
10
|
+
actions: EditorActionHandlers;
|
|
11
|
+
spaceRef: RefObject<boolean>;
|
|
12
|
+
/** Space 눌림/뗌 시 커서 갱신 등(index 소유). */
|
|
13
|
+
onSpaceDown: () => void;
|
|
14
|
+
onSpaceUp: () => void;
|
|
15
|
+
/** 방향키 넛지. 이동 대상이 없으면 false를 반환해 호스트 단축키에 양보한다. */
|
|
16
|
+
nudge: (dx: number, dy: number) => boolean | void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 에디터 키보드 단축키. 기본 keymap을 내장하되 호스트가 재정의/비활성할 수 있다.
|
|
20
|
+
* Space 추적과 방향키 넛지는 고정(재매핑 불가), 그 외 액션은 keymap 기반.
|
|
21
|
+
* Shift 등 수식키는 여기서 추적하지 않는다 — 포인터 이벤트가 실어 오는 값을 쓴다.
|
|
22
|
+
* 최신 keymap/액션을 ref로 읽어 리스너는 1회만 바인딩한다.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useEditorHotkeys(ctx: EditorHotkeysCtx): void;
|
|
25
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RefObject } from "react";
|
|
2
|
-
import { type EditorAction, type KeymapOverrides } from "../_model/keymap";
|
|
2
|
+
import { type EditorAction, type KeymapOverrides } from "../_model/keymap.js";
|
|
3
3
|
/** 액션 핸들러. false 반환 시 "미처리"로 보고 preventDefault를 건너뛴다. */
|
|
4
4
|
export type EditorActionHandlers = Partial<Record<EditorAction, () => boolean | void>>;
|
|
5
5
|
interface EditorHotkeysCtx {
|
|
@@ -9,36 +9,36 @@ var s = {
|
|
|
9
9
|
ArrowDown: [0, 1],
|
|
10
10
|
ArrowLeft: [-1, 0],
|
|
11
11
|
ArrowRight: [1, 0]
|
|
12
|
-
};
|
|
13
|
-
function
|
|
14
|
-
let { spaceRef:
|
|
12
|
+
}, c = "button,a[href],summary,[role=\"button\"],[role=\"checkbox\"],[role=\"switch\"],[role=\"radio\"],[role=\"option\"],[role=\"menuitem\"],[role=\"tab\"]";
|
|
13
|
+
function l(l) {
|
|
14
|
+
let { spaceRef: u } = l, d = o(() => i(l.keymap), [l.keymap]), f = n(l), p = n(d);
|
|
15
15
|
a(() => {
|
|
16
|
-
let n =
|
|
16
|
+
let n = f.current.hostRef.current, i = n?.ownerDocument.defaultView;
|
|
17
17
|
if (!n || !i) return;
|
|
18
18
|
let a = (i) => {
|
|
19
19
|
if (i.defaultPrevented && i.key !== "Escape" || e(i.target) || !t(n, i.target)) return;
|
|
20
|
-
i.code === "Space" && (
|
|
20
|
+
i.code === "Space" && (i.repeat || (u.current = !0, f.current.onSpaceDown()), i.target instanceof Element && i.target.closest(c) || i.preventDefault());
|
|
21
21
|
let a = s[i.key];
|
|
22
22
|
if (a) {
|
|
23
23
|
let e = i.shiftKey ? 10 : 1;
|
|
24
|
-
|
|
24
|
+
f.current.nudge(a[0] * e, a[1] * e) !== !1 && i.preventDefault();
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
let o = r(i);
|
|
28
28
|
if (!o) return;
|
|
29
|
-
let
|
|
30
|
-
|
|
29
|
+
let l = p.current.get(o);
|
|
30
|
+
l && f.current.actions[l]?.() !== !1 && i.preventDefault();
|
|
31
31
|
}, o = (e) => {
|
|
32
|
-
e.code === "Space" &&
|
|
33
|
-
},
|
|
34
|
-
|
|
32
|
+
e.code === "Space" && u.current && (u.current = !1, f.current.onSpaceUp());
|
|
33
|
+
}, l = () => {
|
|
34
|
+
u.current && (u.current = !1, f.current.onSpaceUp());
|
|
35
35
|
};
|
|
36
|
-
return n.addEventListener("keydown", a), i.addEventListener("keyup", o, !0), i.addEventListener("blur",
|
|
37
|
-
n.removeEventListener("keydown", a), i.removeEventListener("keyup", o, !0), i.removeEventListener("blur",
|
|
36
|
+
return n.addEventListener("keydown", a), i.addEventListener("keyup", o, !0), i.addEventListener("blur", l), () => {
|
|
37
|
+
n.removeEventListener("keydown", a), i.removeEventListener("keyup", o, !0), i.removeEventListener("blur", l), l();
|
|
38
38
|
};
|
|
39
|
-
}, [
|
|
39
|
+
}, [u]);
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
|
-
export {
|
|
42
|
+
export { l as useEditorHotkeys };
|
|
43
43
|
|
|
44
44
|
//# sourceMappingURL=useEditorHotkeys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditorHotkeys.js","names":[],"sources":["../../../../src/components/ShapeEditor/_state/useEditorHotkeys.ts"],"sourcesContent":["import { type RefObject, useEffect, useMemo } from \"react\";\nimport { isEditableTarget, isShortcutTarget } from \"@/utils/keyboard\";\nimport {\n type EditorAction,\n eventToCombo,\n type KeymapOverrides,\n resolveKeymap,\n} from \"../_model/keymap\";\nimport { useLatestRef } from \"./useLatestRef\";\n\n/** 액션 핸들러. false 반환 시 \"미처리\"로 보고 preventDefault를 건너뛴다. */\nexport type EditorActionHandlers = Partial<Record<EditorAction, () => boolean | void>>;\n\ninterface EditorHotkeysCtx {\n /** 호스트 재정의(문자열/배열=재매핑, null=비활성). 미지정 키는 기본값. */\n keymap?: KeymapOverrides;\n /** 에디터 루트 요소. 에디터를 포함하지 않는 모달 위에서는 액션을 무시하는 데 쓴다. */\n hostRef: RefObject<HTMLElement | null>;\n actions: EditorActionHandlers;\n spaceRef: RefObject<boolean>;\n /** Space 눌림/뗌 시 커서 갱신 등(index 소유). */\n onSpaceDown: () => void;\n onSpaceUp: () => void;\n /** 방향키 넛지. 이동 대상이 없으면 false를 반환해 호스트 단축키에 양보한다. */\n nudge: (dx: number, dy: number) => boolean | void;\n}\n\nconst ARROW_DELTA: Record<string, [number, number]> = {\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n};\n\n/**\n * 에디터 키보드 단축키. 기본 keymap을 내장하되 호스트가 재정의/비활성할 수 있다.\n * Space 추적과 방향키 넛지는 고정(재매핑 불가), 그 외 액션은 keymap 기반.\n * Shift 등 수식키는 여기서 추적하지 않는다 — 포인터 이벤트가 실어 오는 값을 쓴다.\n * 최신 keymap/액션을 ref로 읽어 리스너는 1회만 바인딩한다.\n */\nexport function useEditorHotkeys(ctx: EditorHotkeysCtx) {\n const { spaceRef } = ctx;\n const lookup = useMemo(() => resolveKeymap(ctx.keymap), [ctx.keymap]);\n\n const ref = useLatestRef(ctx);\n const lookupRef = useLatestRef(lookup);\n\n useEffect(() => {\n const host = ref.current.hostRef.current;\n const ownerWindow = host?.ownerDocument.defaultView;\n if (!host || !ownerWindow) return;\n const down = (e: KeyboardEvent) => {\n // 부모 모달이 capture에서 Escape 닫힘을 막아도 캔버스의 취소 단계는 이어받는다.\n if ((e.defaultPrevented && e.key !== \"Escape\") || isEditableTarget(e.target)) return;\n if (!isShortcutTarget(host, e.target)) return;\n if (e.code === \"Space\") {\n spaceRef.current = true;\n
|
|
1
|
+
{"version":3,"file":"useEditorHotkeys.js","names":[],"sources":["../../../../src/components/ShapeEditor/_state/useEditorHotkeys.ts"],"sourcesContent":["import { type RefObject, useEffect, useMemo } from \"react\";\nimport { isEditableTarget, isShortcutTarget } from \"@/utils/keyboard\";\nimport {\n type EditorAction,\n eventToCombo,\n type KeymapOverrides,\n resolveKeymap,\n} from \"../_model/keymap\";\nimport { useLatestRef } from \"./useLatestRef\";\n\n/** 액션 핸들러. false 반환 시 \"미처리\"로 보고 preventDefault를 건너뛴다. */\nexport type EditorActionHandlers = Partial<Record<EditorAction, () => boolean | void>>;\n\ninterface EditorHotkeysCtx {\n /** 호스트 재정의(문자열/배열=재매핑, null=비활성). 미지정 키는 기본값. */\n keymap?: KeymapOverrides;\n /** 에디터 루트 요소. 에디터를 포함하지 않는 모달 위에서는 액션을 무시하는 데 쓴다. */\n hostRef: RefObject<HTMLElement | null>;\n actions: EditorActionHandlers;\n spaceRef: RefObject<boolean>;\n /** Space 눌림/뗌 시 커서 갱신 등(index 소유). */\n onSpaceDown: () => void;\n onSpaceUp: () => void;\n /** 방향키 넛지. 이동 대상이 없으면 false를 반환해 호스트 단축키에 양보한다. */\n nudge: (dx: number, dy: number) => boolean | void;\n}\n\nconst ARROW_DELTA: Record<string, [number, number]> = {\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n};\n\n/** Space로 활성화되는 요소 — 이 위에서는 Space의 기본 동작을 막지 않는다. */\nconst SPACE_ACTIVATED =\n 'button,a[href],summary,[role=\"button\"],[role=\"checkbox\"],[role=\"switch\"],[role=\"radio\"],[role=\"option\"],[role=\"menuitem\"],[role=\"tab\"]';\n\n/**\n * 에디터 키보드 단축키. 기본 keymap을 내장하되 호스트가 재정의/비활성할 수 있다.\n * Space 추적과 방향키 넛지는 고정(재매핑 불가), 그 외 액션은 keymap 기반.\n * Shift 등 수식키는 여기서 추적하지 않는다 — 포인터 이벤트가 실어 오는 값을 쓴다.\n * 최신 keymap/액션을 ref로 읽어 리스너는 1회만 바인딩한다.\n */\nexport function useEditorHotkeys(ctx: EditorHotkeysCtx) {\n const { spaceRef } = ctx;\n const lookup = useMemo(() => resolveKeymap(ctx.keymap), [ctx.keymap]);\n\n const ref = useLatestRef(ctx);\n const lookupRef = useLatestRef(lookup);\n\n useEffect(() => {\n const host = ref.current.hostRef.current;\n const ownerWindow = host?.ownerDocument.defaultView;\n if (!host || !ownerWindow) return;\n const down = (e: KeyboardEvent) => {\n // 부모 모달이 capture에서 Escape 닫힘을 막아도 캔버스의 취소 단계는 이어받는다.\n if ((e.defaultPrevented && e.key !== \"Escape\") || isEditableTarget(e.target)) return;\n if (!isShortcutTarget(host, e.target)) return;\n if (e.code === \"Space\") {\n // 누르고 있는 동안의 반복 keydown은 팬 모드를 다시 켤 필요가 없다.\n if (!e.repeat) {\n spaceRef.current = true;\n ref.current.onSpaceDown();\n }\n // 캔버스에서 Space가 페이지를 스크롤하지 않게 한다. 포커스된 버튼류는 Space로\n // 눌러야 하므로 기본 동작을 남긴다.\n if (!(e.target instanceof Element && e.target.closest(SPACE_ACTIVATED))) {\n e.preventDefault();\n }\n }\n\n const arrow = ARROW_DELTA[e.key];\n if (arrow) {\n const step = e.shiftKey ? 10 : 1;\n if (ref.current.nudge(arrow[0] * step, arrow[1] * step) !== false) {\n e.preventDefault();\n }\n return;\n }\n\n const combo = eventToCombo(e);\n if (!combo) return;\n const action = lookupRef.current.get(combo);\n if (!action) return;\n const handled = ref.current.actions[action]?.();\n if (handled !== false) e.preventDefault();\n };\n const up = (e: KeyboardEvent) => {\n if (e.code === \"Space\" && spaceRef.current) {\n spaceRef.current = false;\n ref.current.onSpaceUp();\n }\n };\n const release = () => {\n if (spaceRef.current) {\n spaceRef.current = false;\n ref.current.onSpaceUp();\n }\n };\n host.addEventListener(\"keydown\", down);\n // 키 해제는 입력창의 전파 차단보다 먼저 처리한다. 창 밖에서 키를 떼어\n // keyup을 받지 못하는 경우에는 blur에서 눌림 상태를 정리한다.\n ownerWindow.addEventListener(\"keyup\", up, true);\n ownerWindow.addEventListener(\"blur\", release);\n return () => {\n host.removeEventListener(\"keydown\", down);\n ownerWindow.removeEventListener(\"keyup\", up, true);\n ownerWindow.removeEventListener(\"blur\", release);\n // effect 재설정 때도 팬 모드와 커서를 해제한다. ref만 지우면 엔진 상태가 남는다.\n release();\n };\n }, [spaceRef]);\n}\n"],"mappings":";;;;;;AA2BA,IAAM,IAAgD;CACpD,SAAS,CAAC,GAAG,GAAG;CAChB,WAAW,CAAC,GAAG,EAAE;CACjB,WAAW,CAAC,IAAI,EAAE;CAClB,YAAY,CAAC,GAAG,EAAE;CACnB,EAGK,IACJ;AAQF,SAAgB,EAAiB,GAAuB;CACtD,IAAM,EAAE,gBAAa,GACf,IAAS,QAAc,EAAc,EAAI,OAAO,EAAE,CAAC,EAAI,OAAO,CAAC,EAE/D,IAAM,EAAa,EAAI,EACvB,IAAY,EAAa,EAAO;AAEtC,SAAgB;EACd,IAAM,IAAO,EAAI,QAAQ,QAAQ,SAC3B,IAAc,GAAM,cAAc;AACxC,MAAI,CAAC,KAAQ,CAAC,EAAa;EAC3B,IAAM,KAAQ,MAAqB;AAGjC,OADK,EAAE,oBAAoB,EAAE,QAAQ,YAAa,EAAiB,EAAE,OAAO,IACxE,CAAC,EAAiB,GAAM,EAAE,OAAO,CAAE;AACvC,GAAI,EAAE,SAAS,YAER,EAAE,WACL,EAAS,UAAU,IACnB,EAAI,QAAQ,aAAa,GAIrB,EAAE,kBAAkB,WAAW,EAAE,OAAO,QAAQ,EAAgB,IACpE,EAAE,gBAAgB;GAItB,IAAM,IAAQ,EAAY,EAAE;AAC5B,OAAI,GAAO;IACT,IAAM,IAAO,EAAE,WAAW,KAAK;AAC/B,IAAI,EAAI,QAAQ,MAAM,EAAM,KAAK,GAAM,EAAM,KAAK,EAAK,KAAK,MAC1D,EAAE,gBAAgB;AAEpB;;GAGF,IAAM,IAAQ,EAAa,EAAE;AAC7B,OAAI,CAAC,EAAO;GACZ,IAAM,IAAS,EAAU,QAAQ,IAAI,EAAM;AACtC,QACW,EAAI,QAAQ,QAAQ,MAAW,KAC/B,MAAO,EAAE,gBAAgB;KAErC,KAAM,MAAqB;AAC/B,GAAI,EAAE,SAAS,WAAW,EAAS,YACjC,EAAS,UAAU,IACnB,EAAI,QAAQ,WAAW;KAGrB,UAAgB;AACpB,GAAI,EAAS,YACX,EAAS,UAAU,IACnB,EAAI,QAAQ,WAAW;;AAQ3B,SALA,EAAK,iBAAiB,WAAW,EAAK,EAGtC,EAAY,iBAAiB,SAAS,GAAI,GAAK,EAC/C,EAAY,iBAAiB,QAAQ,EAAQ,QAChC;AAKX,GAJA,EAAK,oBAAoB,WAAW,EAAK,EACzC,EAAY,oBAAoB,SAAS,GAAI,GAAK,EAClD,EAAY,oBAAoB,QAAQ,EAAQ,EAEhD,GAAS;;IAEV,CAAC,EAAS,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ViewSettings } from "../_model/viewSettings.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* 에디터-로컬 보기 설정. 호스트 기본값으로 시드하고, viewSettings prop을 반영하며,
|
|
4
|
+
* 사용자 변경을 onViewSettingsChange로 알린다.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useEditorView({ defaultViewSettings, viewSettings, onViewSettingsChange, }: {
|
|
7
|
+
defaultViewSettings: Partial<ViewSettings> | undefined;
|
|
8
|
+
viewSettings: Partial<ViewSettings> | undefined;
|
|
9
|
+
onViewSettingsChange: ((settings: ViewSettings) => void) | undefined;
|
|
10
|
+
}): {
|
|
11
|
+
seededDefaults: ViewSettings;
|
|
12
|
+
view: ViewSettings;
|
|
13
|
+
setView: import("react").Dispatch<import("react").SetStateAction<ViewSettings>>;
|
|
14
|
+
updateView: (patch: Partial<ViewSettings>) => void;
|
|
15
|
+
};
|