77import { cn } from '@/lib/utils' ;
88
99import styles from './ControlDrawer.module.scss' ;
10- import { MingcuteDiamondSquareLine , HugeiconsCursorRectangleSelection01 , IcSharpArrowRightAlt , MaterialSymbolsCircleOutline , MaterialSymbolsDelete , MaterialSymbolsEdit , MaterialSymbolsHexagonOutline , MaterialSymbolsRectangleOutline , MdiFormatLetterCase , MdiSquareOutline , OuiEraser , PhHighlighter , SolarUndoLeftRoundBold , SolarUndoRightRoundBold , TablerTriangle , PhLineSegmentFill } from './icon' ;
10+ import { MingcuteDiamondSquareLine , HugeiconsCursorRectangleSelection01 , IcSharpArrowRightAlt , MaterialSymbolsCircleOutline , MaterialSymbolsEdit , MaterialSymbolsHexagonOutline , MaterialSymbolsRectangleOutline , MdiFormatLetterCase , MdiSquareOutline , OuiEraser , PhHighlighter , TablerTriangle , PhLineSegmentFill , IcSharpFavorite , MaterialSymbolsKidStar , MaterialSymbolsCloud , AkarIconsParallelogram , SolarUndoLeftRoundBold , SolarUndoRightRoundBold , MaterialSymbolsDelete } from './icon' ;
1111
1212const enum ShapeType {
1313 square = 0 ,
@@ -17,7 +17,11 @@ const enum ShapeType {
1717 hexagonal = 4 ,
1818 diamond = 5 ,
1919 arrow = 6 ,
20- line = 7
20+ line = 7 ,
21+ heart = 8 ,
22+ star = 9 ,
23+ cloud = 10 ,
24+ parallelogram = 11
2125}
2226
2327const highlightC = [
@@ -470,6 +474,78 @@ function ControlDrawer(props: any) {
470474 < PhLineSegmentFill />
471475 </ button >
472476
477+ < button
478+ className = { cn ( styles . tool , {
479+ [ styles . active ] : tool === 'shapes' && type === ShapeType . heart ,
480+ } ) }
481+ onClick = { ( ) => {
482+ const penTool = refEditor . current ! . toolController . getPrimaryTools ( ) ;
483+
484+ refEditor . current ! . toolController . setToolEnabled ( penTool [ 5 ] ) ;
485+ setTool ( 'shapes' ) ;
486+ penTool [ 5 ] . setEnabled ( true ) ;
487+
488+ changeShape ( ShapeType . heart ) ;
489+ setType ( ShapeType . heart ) ;
490+ } }
491+ >
492+ < IcSharpFavorite />
493+ </ button >
494+
495+ < button
496+ className = { cn ( styles . tool , {
497+ [ styles . active ] : tool === 'shapes' && type === ShapeType . star ,
498+ } ) }
499+ onClick = { ( ) => {
500+ const penTool = refEditor . current ! . toolController . getPrimaryTools ( ) ;
501+
502+ refEditor . current ! . toolController . setToolEnabled ( penTool [ 5 ] ) ;
503+ setTool ( 'shapes' ) ;
504+ penTool [ 5 ] . setEnabled ( true ) ;
505+
506+ changeShape ( ShapeType . star ) ;
507+ setType ( ShapeType . star ) ;
508+ } }
509+ >
510+ < MaterialSymbolsKidStar />
511+ </ button >
512+
513+ < button
514+ className = { cn ( styles . tool , {
515+ [ styles . active ] : tool === 'shapes' && type === ShapeType . cloud ,
516+ } ) }
517+ onClick = { ( ) => {
518+ const penTool = refEditor . current ! . toolController . getPrimaryTools ( ) ;
519+
520+ refEditor . current ! . toolController . setToolEnabled ( penTool [ 5 ] ) ;
521+ setTool ( 'shapes' ) ;
522+ penTool [ 5 ] . setEnabled ( true ) ;
523+
524+ changeShape ( ShapeType . cloud ) ;
525+ setType ( ShapeType . cloud ) ;
526+ } }
527+ >
528+ < MaterialSymbolsCloud />
529+ </ button >
530+
531+ < button
532+ className = { cn ( styles . tool , {
533+ [ styles . active ] : tool === 'shapes' && type === ShapeType . parallelogram ,
534+ } ) }
535+ onClick = { ( ) => {
536+ const penTool = refEditor . current ! . toolController . getPrimaryTools ( ) ;
537+
538+ refEditor . current ! . toolController . setToolEnabled ( penTool [ 5 ] ) ;
539+ setTool ( 'shapes' ) ;
540+ penTool [ 5 ] . setEnabled ( true ) ;
541+
542+ changeShape ( ShapeType . parallelogram ) ;
543+ setType ( ShapeType . parallelogram ) ;
544+ } }
545+ >
546+ < AkarIconsParallelogram />
547+ </ button >
548+
473549 < div className = { styles . line } > </ div >
474550
475551 < button
0 commit comments