开源白板工具(SaaS),一体化白板,包含思维导图、流程图、自由画等。All in one open-source whiteboard tool with mind, flowchart, freehand and etc.
feat(shapes): support both curly note of left and curly note of right
pubuzhixing842736b83bb0d
diff --git a/packages/drawnix/src/components/icons.tsx b/packages/drawnix/src/components/icons.tsxindex fc77e08..13a14dc 100644--- a/packages/drawnix/src/components/icons.tsx+++ b/packages/drawnix/src/components/icons.tsx@@ -553,3 +553,19 @@ export const StraightLineIcon = createIcon(</g></svg>);++export const NoteCurlyRightIcon = createIcon(+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">+ <g stroke="none" fill="currentColor" fillRule="evenodd">+ <path d="M13,4 L13,5.2 L6,5.2 L6,4 L13,4 Z M14,7.4 L14,8.6 L6,8.6 L6,7.4 L14,7.4 Z M10,10.8 L10,12 L6,12 L6,10.8 L10,10.8 Z M1,15.0041595 L1,13.8041595 L2.79468336,13.8041595 L2.79468336,9.78041534 C2.79468336,9.50369117 2.86643344,9.23268025 3.0016431,8.99336795 L3.09031773,8.85379228 L3.67068336,8.03815953 L3.05107199,7.08070632 C2.91160731,6.86500725 2.82653611,6.61956432 2.80205305,6.36536742 L2.79468336,6.21196672 L2.79468336,2.20015953 L1,2.2 L1,1 L3.39468336,1 C3.72605421,1 3.99468365,1.26862915 3.99468365,1.6 L3.99468365,6.21196672 C3.99468365,6.28902439 4.01694112,6.3644419 4.05878052,6.42915162 L4.89853762,7.72793804 C5.03190909,7.93421321 5.02607838,8.20094898 4.88382047,8.40119903 L4.06859195,9.54875958 C4.02051339,9.61643761 3.99468365,9.69739809 3.99468365,9.78041534 L3.99468365,14.4041595 C3.99468365,14.7355304 3.72605421,15.0041595 3.39468336,15.0041595 L1,15.0041595 Z" />+ </g>+ </svg>+);++export const NoteCurlyLeftIcon = createIcon(+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">+ <g stroke="none" fill="currentColor" fillRule="evenodd">+ <path d="M9,4 L9,5.2 L2,5.2 L2,4 L9,4 Z M10,7.4 L10,8.6 L2,8.6 L2,7.4 L10,7.4 Z M6,10.8 L6,12 L2,12 L2,10.8 L6,10.8 Z M15.0155409,1 L15.0155409,2.2 L13.2208576,2.2 L13.2208576,6.22374419 C13.2208576,6.50046836 13.1491075,6.77147928 13.0138978,7.01079158 L12.9252232,7.15036725 L12.3448576,7.966 L12.9644689,8.92345321 C13.1039336,9.13915228 13.1890048,9.38459521 13.2134879,9.63879211 L13.2208576,9.79219281 L13.2208576,13.804 L15.0155409,13.8041595 L15.0155409,15.0041595 L12.6208576,15.0041595 C12.2894867,15.0041595 12.0208573,14.7355304 12.0208573,14.4041595 L12.0208573,9.79219281 C12.0208573,9.71513514 11.9985998,9.63971763 11.9567604,9.57500791 L11.1170033,8.2762215 C10.9836318,8.06994632 10.9894625,7.80321055 11.1317204,7.6029605 L11.946949,6.45539995 C11.9950275,6.38772192 12.0208573,6.30676144 12.0208573,6.22374419 L12.0208573,1.6 C12.0208573,1.26862915 12.2894867,1 12.6208576,1 L15.0155409,1 Z" />+ </g>+ </svg>+);diff --git a/packages/drawnix/src/components/shape-picker.tsx b/packages/drawnix/src/components/shape-picker.tsxindex 54e77fa..ebdaa0f 100644--- a/packages/drawnix/src/components/shape-picker.tsx+++ b/packages/drawnix/src/components/shape-picker.tsx@@ -10,8 +10,10 @@ import {ParallelogramIcon,RoundRectangleIcon,TerminalIcon,+ NoteCurlyLeftIcon,+ NoteCurlyRightIcon,} from './icons';-import { BoardTransforms , PlaitBoard } from '@plait/core';+import { BoardTransforms, PlaitBoard } from '@plait/core';import React from 'react';import { BoardCreationMode, setCreationMode } from '@plait/common';import { BasicShapes, DrawPointerType, FlowchartSymbols } from '@plait/draw';@@ -46,6 +48,16 @@ export const SHAPES: ShapeProps[] = [title: 'toolbar.shape.terminal',pointer: FlowchartSymbols.terminal,},+ {+ icon: NoteCurlyRightIcon,+ title: 'toolbar.shape.noteCurlyRight',+ pointer: FlowchartSymbols.noteCurlyRight,+ },+ {+ icon: NoteCurlyLeftIcon,+ title: 'toolbar.shape.noteCurlyLeft',+ pointer: FlowchartSymbols.noteCurlyLeft,+ },{icon: DiamondIcon,title: 'toolbar.shape.diamond',@@ -69,9 +81,7 @@ export type ShapePickerProps = {onPointerUp: (pointer: DrawPointerType) => void;};-export const ShapePicker: React.FC<ShapePickerProps> = ({- onPointerUp,-}) => {+export const ShapePicker: React.FC<ShapePickerProps> = ({ onPointerUp }) => {const board = useBoard();const { t } = useI18n();return (@@ -90,8 +100,12 @@ export const ShapePicker: React.FC<ShapePickerProps> = ({visible={true}selected={PlaitBoard.isPointer(board, shape.pointer)}icon={shape.icon}- title={t((shape.title || 'toolbar.shape') as keyof Translations)}- aria-label={t((shape.title || 'toolbar.shape') as keyof Translations)}+ title={t(+ (shape.title || 'toolbar.shape') as keyof Translations+ )}+ aria-label={t(+ (shape.title || 'toolbar.shape') as keyof Translations+ )}onPointerDown={() => {setCreationMode(board, BoardCreationMode.dnd);BoardTransforms.updatePointerType(board, shape.pointer);diff --git a/packages/drawnix/src/i18n/translations/ar.ts b/packages/drawnix/src/i18n/translations/ar.tsindex d776898..685aa94 100644--- a/packages/drawnix/src/i18n/translations/ar.ts+++ b/packages/drawnix/src/i18n/translations/ar.ts@@ -21,6 +21,8 @@ const arTranslations: Translations = {"toolbar.shape.ellipse": "بيضاوي — O","toolbar.shape.triangle": "مثلث","toolbar.shape.terminal": "نهائي",+ "toolbar.shape.noteCurlyLeft": "ملاحظة معقوفة — يسار",+ "toolbar.shape.noteCurlyRight": "ملاحظة معقوفة — يمين","toolbar.shape.diamond": "معين","toolbar.shape.parallelogram": "متوازي أضلاع","toolbar.shape.roundRectangle": "مستطيل دائري الحواف",@@ -174,4 +176,4 @@ const arTranslations: Translations = {'tutorial.themeDescription': 'التبديل بين السمة الفاتحة والداكنة',};-export default arTranslations;\ No newline at end of file+export default arTranslations;diff --git a/packages/drawnix/src/i18n/translations/en.ts b/packages/drawnix/src/i18n/translations/en.tsindex 3681579..0eafb4e 100644--- a/packages/drawnix/src/i18n/translations/en.ts+++ b/packages/drawnix/src/i18n/translations/en.ts@@ -22,6 +22,8 @@ const enTranslations: Translations = {'toolbar.shape.ellipse': 'Ellipse — O','toolbar.shape.triangle': 'Triangle','toolbar.shape.terminal': 'Terminal',+ 'toolbar.shape.noteCurlyLeft': 'Curly Note — Left',+ 'toolbar.shape.noteCurlyRight': 'Curly Note — Right','toolbar.shape.diamond': 'Diamond','toolbar.shape.parallelogram': 'Parallelogram','toolbar.shape.roundRectangle': 'Round Rectangle',diff --git a/packages/drawnix/src/i18n/translations/ru.ts b/packages/drawnix/src/i18n/translations/ru.tsindex 1e2942f..5c136d0 100644--- a/packages/drawnix/src/i18n/translations/ru.ts+++ b/packages/drawnix/src/i18n/translations/ru.ts@@ -22,6 +22,8 @@ const ruTranslations: Translations = {'toolbar.shape.ellipse': 'Эллипс — O','toolbar.shape.triangle': 'Треугольник','toolbar.shape.terminal': 'Останов',+ 'toolbar.shape.noteCurlyLeft': 'Фигурная заметка — слева',+ 'toolbar.shape.noteCurlyRight': 'Фигурная заметка — справа','toolbar.shape.diamond': 'Ромб','toolbar.shape.parallelogram': 'Параллелограмм','toolbar.shape.roundRectangle': 'Скруглённый прямоугольник',@@ -179,4 +181,4 @@ const ruTranslations: Translations = {'tutorial.themeDescription': 'Переключение между светлой и тёмной темами',};-export default ruTranslations;\ No newline at end of file+export default ruTranslations;diff --git a/packages/drawnix/src/i18n/translations/vi.ts b/packages/drawnix/src/i18n/translations/vi.tsindex dfed279..f306b8c 100644--- a/packages/drawnix/src/i18n/translations/vi.ts+++ b/packages/drawnix/src/i18n/translations/vi.ts@@ -22,6 +22,8 @@ const viTranslations: Translations = {'toolbar.shape.ellipse': 'Hình elip — O','toolbar.shape.triangle': 'Hình tam giác','toolbar.shape.terminal': 'Terminal',+ 'toolbar.shape.noteCurlyLeft': 'Ghi chú ngoặc móc trái',+ 'toolbar.shape.noteCurlyRight': 'Ghi chú ngoặc móc phải','toolbar.shape.diamond': 'Hình thoi','toolbar.shape.parallelogram': 'Hình bình hành','toolbar.shape.roundRectangle': 'Hình chữ nhật bo tròn',diff --git a/packages/drawnix/src/i18n/translations/zh.ts b/packages/drawnix/src/i18n/translations/zh.tsindex 5a44f50..60d7149 100644--- a/packages/drawnix/src/i18n/translations/zh.ts+++ b/packages/drawnix/src/i18n/translations/zh.ts@@ -22,6 +22,8 @@ const zhTranslations: Translations = {'toolbar.shape.ellipse': '圆 — O','toolbar.shape.triangle': '三角形','toolbar.shape.terminal': '椭圆角矩形',+ 'toolbar.shape.noteCurlyLeft': '左花括注释',+ 'toolbar.shape.noteCurlyRight': '右花括注释','toolbar.shape.diamond': '菱形','toolbar.shape.parallelogram': '平行四边形','toolbar.shape.roundRectangle': '圆角矩形',diff --git a/packages/drawnix/src/i18n/types.ts b/packages/drawnix/src/i18n/types.tsindex a17bad4..c63012b 100644--- a/packages/drawnix/src/i18n/types.ts+++ b/packages/drawnix/src/i18n/types.ts@@ -26,6 +26,8 @@ export interface Translations {'toolbar.shape.ellipse': string;'toolbar.shape.triangle': string;'toolbar.shape.terminal': string;+ 'toolbar.shape.noteCurlyLeft': string;+ 'toolbar.shape.noteCurlyRight': string;'toolbar.shape.diamond': string;'toolbar.shape.parallelogram': string;'toolbar.shape.roundRectangle': string;