|
|
|
|
@ -60,14 +60,7 @@ export const SHAPES = [
@@ -60,14 +60,7 @@ export const SHAPES = [
|
|
|
|
|
icon: ( |
|
|
|
|
// custom
|
|
|
|
|
<svg viewBox="0 0 6 6"> |
|
|
|
|
<line |
|
|
|
|
x1="0" |
|
|
|
|
y1="3" |
|
|
|
|
x2="6" |
|
|
|
|
y2="3" |
|
|
|
|
stroke="black" |
|
|
|
|
strokeLinecap="round" |
|
|
|
|
/> |
|
|
|
|
<line x1="0" y1="3" x2="6" y2="3" stroke="#000" strokeLinecap="round" /> |
|
|
|
|
</svg> |
|
|
|
|
), |
|
|
|
|
value: "line" |
|
|
|
|
@ -75,13 +68,15 @@ export const SHAPES = [
@@ -75,13 +68,15 @@ export const SHAPES = [
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
export const shapesShortcutKeys = SHAPES.map((shape, index) => [ |
|
|
|
|
shape.value[0], (index + 1).toString()] |
|
|
|
|
).flat(1); |
|
|
|
|
shape.value[0], |
|
|
|
|
(index + 1).toString() |
|
|
|
|
]).flat(1); |
|
|
|
|
|
|
|
|
|
export function findShapeByKey(key: string) { |
|
|
|
|
const defaultElement = "selection"; |
|
|
|
|
return SHAPES.reduce((element, shape, index) => { |
|
|
|
|
if (shape.value[0] !== key && key !== (index + 1).toString()) return element; |
|
|
|
|
if (shape.value[0] !== key && key !== (index + 1).toString()) |
|
|
|
|
return element; |
|
|
|
|
|
|
|
|
|
return shape.value; |
|
|
|
|
}, defaultElement); |
|
|
|
|
|