Skip to content

Commit a48a978

Browse files
committed
chore: update deps
1 parent f0bb380 commit a48a978

File tree

4 files changed

+94
-5
lines changed

4 files changed

+94
-5
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
"react-tweet": "^3.2.2",
190190
"react-visibility-sensor": "^5.1.1",
191191
"reactjs-signal": "^1.1.3",
192+
"reactjs-tiptap-editor": "workspace:^",
192193
"scroll-into-view-if-needed": "^3.1.0",
193194
"shiki": "^1.29.2",
194195
"svg64": "^2.0.0",

pnpm-lock.yaml

Lines changed: 3 additions & 0 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: 21 additions & 5 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 } from './icon';
10+
import { MingcuteDiamondSquareLine, HugeiconsCursorRectangleSelection01, IcSharpArrowRightAlt, MaterialSymbolsCircleOutline, MaterialSymbolsDelete, MaterialSymbolsEdit, MaterialSymbolsHexagonOutline, MaterialSymbolsRectangleOutline, MdiFormatLetterCase, MdiSquareOutline, OuiEraser, PhHighlighter, SolarUndoLeftRoundBold, SolarUndoRightRoundBold, TablerTriangle, PhLineSegmentFill } from './icon';
1111

1212
const enum ShapeType {
1313
square = 0,
@@ -17,6 +17,7 @@ const enum ShapeType {
1717
hexagonal = 4,
1818
diamond = 5,
1919
arrow = 6,
20+
line = 7
2021
}
2122

2223
const highlightC = [
@@ -95,6 +96,7 @@ function ColorPicker ({ onChange }: any) {
9596
))
9697
}
9798
</div>
99+
98100
<div className={styles.colorWrap}>
99101
{
100102
COLOR.slice(7).map((color, index) => (
@@ -211,10 +213,6 @@ function ControlDrawer(props: any) {
211213
const [tool, setTool] = useState<'select' | 'text' | 'pencil' | 'highlighter' | 'eraser' | 'shapes' | null>(null);
212214

213215
const [type, setType] = useState(ShapeType.square);
214-
console.log({
215-
type,
216-
tool
217-
});
218216

219217
return (
220218
<>
@@ -454,6 +452,24 @@ function ControlDrawer(props: any) {
454452
<IcSharpArrowRightAlt />
455453
</button>
456454

455+
<button
456+
className={cn(styles.tool, {
457+
[styles.active]: tool === 'shapes' && type === ShapeType.line,
458+
})}
459+
onClick={() => {
460+
const penTool = refEditor.current!.toolController.getPrimaryTools();
461+
462+
refEditor.current!.toolController.setToolEnabled(penTool[5]);
463+
setTool('shapes');
464+
penTool[5].setEnabled(true);
465+
466+
changeShape(ShapeType.line);
467+
setType(ShapeType.line);
468+
}}
469+
>
470+
<PhLineSegmentFill />
471+
</button>
472+
457473
<div className={styles.line}></div>
458474

459475
<button

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

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,3 +359,72 @@ export function AkarIconsDotGridFill(props: SVGProps<SVGSVGElement>) {
359359
</svg>
360360
);
361361
}
362+
363+
export function MageImageUpload(props: SVGProps<SVGSVGElement>) {
364+
return (
365+
<svg height="1em"
366+
viewBox="0 0 24 24"
367+
width="1em"
368+
xmlns="http://www.w3.org/2000/svg"
369+
{...props}
370+
>
371+
<g fill="none"
372+
stroke="currentColor"
373+
strokeLinecap="round"
374+
strokeWidth="1.5"
375+
>
376+
<path d="M21.25 13V8.5a5 5 0 0 0-5-5h-8.5a5 5 0 0 0-5 5v7a5 5 0 0 0 5 5h6.26"
377+
strokeLinejoin="round"
378+
>
379+
</path>
380+
381+
<path d="m3.01 17l2.74-3.2a2.2 2.2 0 0 1 2.77-.27a2.2 2.2 0 0 0 2.77-.27l2.33-2.33a4 4 0 0 1 5.16-.43l2.47 1.91M8.01 10.17a1.66 1.66 0 1 0-.02-3.32a1.66 1.66 0 0 0 .02 3.32"
382+
strokeLinejoin="round"
383+
>
384+
</path>
385+
386+
<path d="M18.707 15v5"
387+
strokeMiterlimit="10"
388+
>
389+
</path>
390+
391+
<path d="m21 17.105l-1.967-1.967a.46.46 0 0 0-.652 0l-1.967 1.967"
392+
strokeLinejoin="round"
393+
>
394+
</path>
395+
</g>
396+
</svg>
397+
);
398+
}
399+
400+
export function FluentColorBackground24Filled(props: SVGProps<SVGSVGElement>) {
401+
return (
402+
<svg height="1em"
403+
viewBox="0 0 24 24"
404+
width="1em"
405+
xmlns="http://www.w3.org/2000/svg"
406+
{...props}
407+
>
408+
<path d="M2 12.414V17.5A2.5 2.5 0 0 0 4.5 20h15a2.5 2.5 0 0 0 2.5-2.5v-11A2.5 2.5 0 0 0 19.5 4h-8.944l2.422 2.422a3 3 0 0 1 .719 3.09c.38.042.75.21 1.04.501l.003.002l.003.004l.01.009l.02.02a8 8 0 0 1 .311.338c.192.216.45.525.712.89c.26.36.545.808.77 1.3c.22.478.434 1.106.434 1.799C17 16.23 15.606 18 13.5 18S10 16.23 10 14.375c0-.29.037-.569.097-.83l-1.362 1.362a3 3 0 0 1-4.243 0zm9.342.58c-.188.409-.342.888-.342 1.381C11 15.765 12.029 17 13.5 17c1.47 0 2.5-1.235 2.5-2.625c0-.493-.154-.972-.342-1.381a7 7 0 0 0-.674-1.134a10 10 0 0 0-.649-.812l-.305-.328a.75.75 0 0 0-1.06 0l-.006.005c-.058.062-.214.226-.3.323c-.175.199-.411.48-.649.812a7 7 0 0 0-.673 1.134m2.158-.61q.13.162.265.35c.202.281.392.586.53.886c.14.305.205.56.205.755c0 .691-.481 1.125-1 1.125c-.52 0-1-.434-1-1.125c0-.194.064-.45.205-.755c.137-.3.327-.605.529-.886q.136-.188.266-.35M6.75 1a.75.75 0 0 0-.75.75v1.756l-.093.087l-4.243 4.243a2 2 0 0 0 0 2.828L5.199 14.2a2 2 0 0 0 2.829 0l4.243-4.243a2 2 0 0 0 0-2.828L8.735 3.593A2 2 0 0 0 7.5 3.015V1.75A.75.75 0 0 0 6.75 1M6 5.621v.629a.75.75 0 1 0 1.5 0V4.54a.5.5 0 0 1 .174.114l3.536 3.535c.09.09.138.205.145.322H3.11zm.26 7.518l-3.128-3.128h6.964l-3.129 3.128a.5.5 0 0 1-.707 0"
409+
fill="currentColor"
410+
>
411+
</path>
412+
</svg>
413+
);
414+
}
415+
416+
export function PhLineSegmentFill(props: SVGProps<SVGSVGElement>) {
417+
return (
418+
<svg height="1em"
419+
viewBox="0 0 256 256"
420+
width="1em"
421+
xmlns="http://www.w3.org/2000/svg"
422+
{...props}
423+
>
424+
<path d="M211.81 83.79a28 28 0 0 1-33.12 4.83l-90.07 90.07a28 28 0 1 1-44.43-6.48a28 28 0 0 1 33.12-4.83l90.07-90.07a28 28 0 1 1 44.43 6.48"
425+
fill="currentColor"
426+
>
427+
</path>
428+
</svg>
429+
);
430+
}

0 commit comments

Comments
 (0)