开源白板工具(SaaS),一体化白板,包含思维导图、流程图、自由画等。All in one open-source whiteboard tool with mind, flowchart, freehand and etc.
build: bump plait into 0.75.0-next.7 to fix drag selection issue for closed freehand elements (#81)
pubuzhixing83993757011c9
diff --git a/package-lock.json b/package-lock.jsonindex 328374a..031ddb9 100644--- a/package-lock.json+++ b/package-lock.json@@ -10,12 +10,12 @@"license": "MIT","dependencies": {"@floating-ui/react": "^0.26.24",- "@plait/common": "^0.75.0-next.6",- "@plait/core": "^0.75.0-next.6",- "@plait/draw": "^0.75.0-next.6",- "@plait/layouts": "^0.75.0-next.6",- "@plait/mind": "^0.75.0-next.6",- "@plait/text-plugins": "^0.75.0-next.6",+ "@plait/common": "^0.75.0-next.7",+ "@plait/core": "^0.75.0-next.7",+ "@plait/draw": "^0.75.0-next.7",+ "@plait/layouts": "^0.75.0-next.7",+ "@plait/mind": "^0.75.0-next.7",+ "@plait/text-plugins": "^0.75.0-next.7","ahooks": "^3.8.0","browser-fs-access": "^0.35.0","classnames": "^2.5.1",@@ -4345,17 +4345,17 @@}},"node_modules/@plait/common": {- "version": "0.75.0-next.6",- "resolved": "https://registry.npmjs.org/@plait/common/-/common-0.75.0-next.6.tgz",- "integrity": "sha512-7v/ORuNPzxArkhh38N2sJTxowS0fpJ2TlHq8oYDK9NxQNiPul/svyMoMuvJU/CAovitL4qOanTz+cFFU7j7rEw==",+ "version": "0.75.0-next.7",+ "resolved": "https://registry.npmjs.org/@plait/common/-/common-0.75.0-next.7.tgz",+ "integrity": "sha512-Sk7CO/7wb9+hsgNASKesjHPmy4dVEvesTiBdrIVI4c3qetRhPkpyaxfFW0JiIlo15/dOvbFptqy73L2QMu+MPA==","dependencies": {"tslib": "^2.3.0"}},"node_modules/@plait/core": {- "version": "0.75.0-next.6",- "resolved": "https://registry.npmjs.org/@plait/core/-/core-0.75.0-next.6.tgz",- "integrity": "sha512-qVi8GdfjrAw0Ci1tvLpeA5ZfpbLojZy9CuiqL4gN5lOQzPpYs7aXQ2byDYjuumAspY/MJ1gzuSN4yTZlur9n+g==",+ "version": "0.75.0-next.7",+ "resolved": "https://registry.npmjs.org/@plait/core/-/core-0.75.0-next.7.tgz",+ "integrity": "sha512-Gfw+YHvvYJoMqOz+7dHYQdXPqgxXD4Bq+GrDjOg01rsW6yZd6nshYxuyOUgIGt+OD5jGPczrrodTCqdfYfFzjg==","dependencies": {"tslib": "^2.3.0"},@@ -4368,33 +4368,33 @@}},"node_modules/@plait/draw": {- "version": "0.75.0-next.6",- "resolved": "https://registry.npmjs.org/@plait/draw/-/draw-0.75.0-next.6.tgz",- "integrity": "sha512-1aqHE3tY/Vc8soqR1TCUkw1oij7JKWvylhzW7UVLUFGVCk+MxOhpk3pevtB2AO1HAnDNzFai05hS9n1GoFrfuQ==",+ "version": "0.75.0-next.7",+ "resolved": "https://registry.npmjs.org/@plait/draw/-/draw-0.75.0-next.7.tgz",+ "integrity": "sha512-3S0yF6KJnrcyffDwtjal7xospOoy+aulmmsUIDMdaYG3vcOy+EFME0VIYojSkbaqd/HIrtJF+q9GvRUtBz0p2w==","dependencies": {"tslib": "^2.3.0"}},"node_modules/@plait/layouts": {- "version": "0.75.0-next.6",- "resolved": "https://registry.npmjs.org/@plait/layouts/-/layouts-0.75.0-next.6.tgz",- "integrity": "sha512-X8StkJIYem35PomKlxMvEX/F8aPoKwkM5JLpasBBWL1oHprPy4Z1XKbcgRX23YlcK7UWsJRGvClJq9Zm9dL8hw==",+ "version": "0.75.0-next.7",+ "resolved": "https://registry.npmjs.org/@plait/layouts/-/layouts-0.75.0-next.7.tgz",+ "integrity": "sha512-05Bc8r9jC0N1YWQz8+C19w3K/26Q2FVWlPExp6Fp588I1ByzAaGIl3jOLkBQWQCOfklY2WcxNfepBN9onG2N4g==","dependencies": {"tslib": "^2.3.0"}},"node_modules/@plait/mind": {- "version": "0.75.0-next.6",- "resolved": "https://registry.npmjs.org/@plait/mind/-/mind-0.75.0-next.6.tgz",- "integrity": "sha512-aLOkKHoiukBAFZlnLxaOToTJuuwEcZHhqdPu+/P7qUrCK9jdY++80vvqWoDh8gph7E8GC9nIWNVG7CakLL2LcQ==",+ "version": "0.75.0-next.7",+ "resolved": "https://registry.npmjs.org/@plait/mind/-/mind-0.75.0-next.7.tgz",+ "integrity": "sha512-f4Ts5o+XhyI0zcW9jXYN/wmSKPodJtdxF8z7OLAlKhUHIw475YBI9lCzeIuV4NB1briT+LIpWnL7i5UJK/PQxw==","dependencies": {"tslib": "^2.3.0"}},"node_modules/@plait/text-plugins": {- "version": "0.75.0-next.6",- "resolved": "https://registry.npmjs.org/@plait/text-plugins/-/text-plugins-0.75.0-next.6.tgz",- "integrity": "sha512-NvGCDzmlQ00/XVDwYWR5TWtf6561G5L5GVwF9KcsvIBKfkDcpgcsNxWnRKF3bdFVaSXv45tqlEj5zr8kzBnuYQ==",+ "version": "0.75.0-next.7",+ "resolved": "https://registry.npmjs.org/@plait/text-plugins/-/text-plugins-0.75.0-next.7.tgz",+ "integrity": "sha512-hbikVOGcnlm3os+jxHIpPZ6buCgDEQHhBAcDFbLWPmOz1rz+GicthYNlhPP8wRthOj26eT+YJxxGEd4qYBiiOA==","dependencies": {"tslib": "^2.3.0"}diff --git a/package.json b/package.jsonindex d086b35..adc3d62 100644--- a/package.json+++ b/package.json@@ -10,12 +10,12 @@"private": true,"dependencies": {"@floating-ui/react": "^0.26.24",- "@plait/common": "^0.75.0-next.6",- "@plait/core": "^0.75.0-next.6",- "@plait/draw": "^0.75.0-next.6",- "@plait/layouts": "^0.75.0-next.6",- "@plait/mind": "^0.75.0-next.6",- "@plait/text-plugins": "^0.75.0-next.6",+ "@plait/common": "^0.75.0-next.7",+ "@plait/core": "^0.75.0-next.7",+ "@plait/draw": "^0.75.0-next.7",+ "@plait/layouts": "^0.75.0-next.7",+ "@plait/mind": "^0.75.0-next.7",+ "@plait/text-plugins": "^0.75.0-next.7","ahooks": "^3.8.0","browser-fs-access": "^0.35.0","classnames": "^2.5.1",diff --git a/packages/drawnix/src/plugins/freehand/with-freehand-create.ts b/packages/drawnix/src/plugins/freehand/with-freehand-create.tsindex c42dae9..fbfd461 100644--- a/packages/drawnix/src/plugins/freehand/with-freehand-create.ts+++ b/packages/drawnix/src/plugins/freehand/with-freehand-create.ts@@ -17,7 +17,7 @@ export const withFreehandCreate = (board: PlaitBoard) => {let isDrawing = false;- let isSnapping = false;+ let isSnappingStartAndEnd = false;let points: Point[] = [];@@ -35,7 +35,7 @@ export const withFreehandCreate = (board: PlaitBoard) => {const complete = (cancel?: boolean) => {if (isDrawing) {const pointer = PlaitBoard.getPointer(board) as FreehandShape;- if (isSnapping) {+ if (isSnappingStartAndEnd) {points.push(points[0]);}temporaryElement = createFreehandElement(pointer, points);@@ -78,9 +78,9 @@ export const withFreehandCreate = (board: PlaitBoard) => {currentScreenPoint[1]) < 8) {- isSnapping = true;+ isSnappingStartAndEnd = true;} else {- isSnapping = false;+ isSnappingStartAndEnd = false;}const smoothingPoint = smoother.process(currentScreenPoint);if (smoothingPoint) {diff --git a/packages/drawnix/src/plugins/with-pencil.ts b/packages/drawnix/src/plugins/with-pencil.tsindex 8aa7dc0..78f7f62 100644--- a/packages/drawnix/src/plugins/with-pencil.ts+++ b/packages/drawnix/src/plugins/with-pencil.ts@@ -1,12 +1,8 @@-import { PlaitBoard } from '@plait/core';+import { isPencilEvent, PlaitBoard } from '@plait/core';import { DrawnixState } from '../hooks/use-drawnix';const IS_PENCIL_MODE = new WeakMap<PlaitBoard, boolean>();-export const isPencilEvent = (event: PointerEvent) => {- return event.pointerType === 'pen';-};-export const isPencilMode = (board: PlaitBoard) => {return !!IS_PENCIL_MODE.get(board);};