Skip to content

Commit 07db35b

Browse files
committed
chore: update deps
1 parent a48a978 commit 07db35b

File tree

4 files changed

+153
-7
lines changed

4 files changed

+153
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
"clsx": "^2.1.1",
177177
"deep-equal": "^2.2.3",
178178
"docx": "^8.6.0",
179-
"easydrawer": "^0.0.12",
179+
"easydrawer": "^0.0.15",
180180
"frimousse": "^0.1.0",
181181
"katex": "^0.16.21",
182182
"lodash-es": "^4.17.21",

pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extensions/Drawer/components/ControlDrawer/ControlDrawer.tsx

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
import { cn } from '@/lib/utils';
88

99
import 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

1212
const 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

2327
const 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

src/extensions/Drawer/components/ControlDrawer/icon.tsx

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,3 +428,73 @@ export function PhLineSegmentFill(props: SVGProps<SVGSVGElement>) {
428428
</svg>
429429
);
430430
}
431+
432+
export function IcSharpFavorite(props: SVGProps<SVGSVGElement>) {
433+
return (
434+
<svg height="1em"
435+
viewBox="0 0 24 24"
436+
width="1em"
437+
xmlns="http://www.w3.org/2000/svg"
438+
{...props}
439+
>
440+
{/* Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE */}
441+
<path d="M12 20.325q-.35 0-.712-.125t-.638-.4l-1.725-1.575q-2.65-2.425-4.788-4.812T2 8.15Q2 5.8 3.575 4.225T7.5 2.65q1.325 0 2.5.562t2 1.538q.825-.975 2-1.537t2.5-.563q2.35 0 3.925 1.575T22 8.15q0 2.875-2.125 5.275T15.05 18.25l-1.7 1.55q-.275.275-.637.4t-.713.125M11.05 6.75q-.725-1.025-1.55-1.563t-2-.537q-1.5 0-2.5 1t-1 2.5q0 1.3.925 2.763t2.213 2.837t2.65 2.575T12 18.3q.85-.775 2.213-1.975t2.65-2.575t2.212-2.837T20 8.15q0-1.5-1-2.5t-2.5-1q-1.175 0-2 .538T12.95 6.75q-.175.25-.425.375T12 7.25t-.525-.125t-.425-.375m.95 4.725"
442+
fill="currentColor"
443+
>
444+
</path>
445+
</svg>
446+
);
447+
}
448+
449+
export function MaterialSymbolsKidStar(props: SVGProps<SVGSVGElement>) {
450+
return (
451+
<svg height="1em"
452+
viewBox="0 0 24 24"
453+
width="1em"
454+
xmlns="http://www.w3.org/2000/svg"
455+
{...props}
456+
>
457+
{/* Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE */}
458+
<path d="m7.625 6.4l2.8-3.625q.3-.4.713-.587T12 2t.863.188t.712.587l2.8 3.625l4.25 1.425q.65.2 1.025.738t.375 1.187q0 .3-.088.6t-.287.575l-2.75 3.9l.1 4.1q.025.875-.575 1.475t-1.4.6q-.05 0-.55-.075L12 19.675l-4.475 1.25q-.125.05-.275.063T6.975 21q-.8 0-1.4-.6T5 18.925l.1-4.125l-2.725-3.875q-.2-.275-.288-.575T2 9.75q0-.625.363-1.162t1.012-.763zM8.85 8.125L4 9.725L7.1 14.2L7 18.975l5-1.375l5 1.4l-.1-4.8L20 9.775l-4.85-1.65L12 4zM12 11.5"
459+
fill="currentColor"
460+
>
461+
</path>
462+
</svg>
463+
);
464+
}
465+
466+
export function MaterialSymbolsCloud(props: SVGProps<SVGSVGElement>) {
467+
return (
468+
<svg height="1em"
469+
viewBox="0 0 24 24"
470+
width="1em"
471+
xmlns="http://www.w3.org/2000/svg"
472+
{...props}
473+
>
474+
{/* Icon from Google Material Icons by Material Design Authors - https://github.com/material-icons/material-icons/blob/master/LICENSE */}
475+
<path d="M12.01 6c2.61 0 4.89 1.86 5.4 4.43l.3 1.5l1.52.11c1.56.11 2.78 1.41 2.78 2.96c0 1.65-1.35 3-3 3h-13c-2.21 0-4-1.79-4-4c0-2.05 1.53-3.76 3.56-3.97l1.07-.11l.5-.95A5.46 5.46 0 0 1 12.01 6m0-2C9.12 4 6.6 5.64 5.35 8.04C2.35 8.36.01 10.91.01 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5c0-2.64-2.05-4.78-4.64-4.96C18.68 6.59 15.65 4 12.01 4"
476+
fill="currentColor"
477+
>
478+
</path>
479+
</svg>
480+
);
481+
}
482+
483+
export function AkarIconsParallelogram(props: SVGProps<SVGSVGElement>) {
484+
return (
485+
<svg height="1em"
486+
viewBox="0 0 24 24"
487+
width="1em"
488+
xmlns="http://www.w3.org/2000/svg"
489+
{...props}
490+
>
491+
{/* Icon from Akar Icons by Arturo Wibawa - https://github.com/artcoholic/akar-icons/blob/master/LICENSE */}
492+
<path d="M5.586 6.45A2 2 0 0 1 7.509 5h11.84a2 2 0 0 1 1.923 2.55l-2.858 10A2 2 0 0 1 16.491 19H4.651a2 2 0 0 1-1.923-2.55z"
493+
fill="none"
494+
stroke="currentColor"
495+
strokeWidth="2"
496+
>
497+
</path>
498+
</svg>
499+
);
500+
}

0 commit comments

Comments
 (0)