Skip to content

Commit

Permalink
fix(draw): fix link swimlane error by autocomplete #WIK-15966 (#940)
Browse files Browse the repository at this point in the history
  • Loading branch information
huanhuanwa authored Jul 4, 2024
1 parent b6aad20 commit ff83a27
Show file tree
Hide file tree
Showing 11 changed files with 176 additions and 138 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-insects-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@plait/draw': patch
---

fix link swimlane error by autocomplete
99 changes: 49 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"graphology": "^0.25.4",
"graphology-layout": "^0.6.1",
"graphology-layout-forceatlas2": "^0.10.1",
"graphology-types": "^0.24.7",
"is-hotkey": "^0.2.0",
"points-on-curve": "^1.0.0",
"roughjs": "^4.5.2",
Expand Down
9 changes: 3 additions & 6 deletions packages/draw/src/plugins/with-swimlane-create.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { PlaitBoard, Point, RectangleClient, createG, preventTouchMove, toHostPoint, toViewBoxPoint } from '@plait/core';
import { PlaitSwimlane, SwimlaneDrawSymbols } from '../interfaces';
import { insertElement } from '../utils';
import { getSwimlanePointers } from '../constants';
import {
normalizeShapePoints,
isDndMode,
Expand All @@ -13,23 +12,21 @@ import {
import { isKeyHotkey } from 'is-hotkey';
import { getSnapResizingRef } from '../utils/snap-resizing';
import { TableGenerator } from '../generators/table.generator';
import { createDefaultSwimlane, getDefaultSwimlanePoints } from '../utils/swimlane';
import { createDefaultSwimlane, getDefaultSwimlanePoints, isSwimlanePointers } from '../utils/swimlane';

export interface FakeCreateTextRef {
g: SVGGElement;
textManage: TextManage;
}

const isSwimlaneDndMode = (board: PlaitBoard) => {
const swimlanePointers = getSwimlanePointers();
const isSwimlanePointer = PlaitBoard.isInPointer(board, swimlanePointers);
const isSwimlanePointer = isSwimlanePointers(board);
const dndMode = isSwimlanePointer && isDndMode(board);
return dndMode;
};

const isSwimlaneDrawingMode = (board: PlaitBoard) => {
const swimlanePointers = getSwimlanePointers();
const isSwimlanePointer = PlaitBoard.isInPointer(board, swimlanePointers);
const isSwimlanePointer = isSwimlanePointers(board);
const drawingMode = isSwimlanePointer && isDrawingMode(board);
return drawingMode;
};
Expand Down
Loading

0 comments on commit ff83a27

Please sign in to comment.