@plait/draw 0.60.1 → 0.61.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/constants/geometry.d.ts +40 -12
  2. package/constants/index.d.ts +1 -0
  3. package/constants/pointer.d.ts +2 -2
  4. package/constants/swimlane.d.ts +21 -0
  5. package/engines/uml/assembly.d.ts +2 -0
  6. package/engines/uml/component-box.d.ts +2 -0
  7. package/engines/uml/component.d.ts +2 -0
  8. package/engines/uml/provided-interface.d.ts +2 -0
  9. package/engines/uml/required-interface.d.ts +2 -0
  10. package/engines/uml/template.d.ts +2 -0
  11. package/esm2022/constants/geometry.mjs +29 -16
  12. package/esm2022/constants/index.mjs +2 -1
  13. package/esm2022/constants/pointer.mjs +3 -3
  14. package/esm2022/constants/swimlane.mjs +25 -0
  15. package/esm2022/engines/index.mjs +14 -2
  16. package/esm2022/engines/table/table.mjs +9 -3
  17. package/esm2022/engines/uml/assembly.mjs +56 -0
  18. package/esm2022/engines/uml/component-box.mjs +61 -0
  19. package/esm2022/engines/uml/component.mjs +72 -0
  20. package/esm2022/engines/uml/provided-interface.mjs +47 -0
  21. package/esm2022/engines/uml/required-interface.mjs +36 -0
  22. package/esm2022/engines/uml/template.mjs +47 -0
  23. package/esm2022/generators/table.generator.mjs +8 -4
  24. package/esm2022/image.component.mjs +2 -2
  25. package/esm2022/interfaces/geometry.mjs +7 -10
  26. package/esm2022/interfaces/index.mjs +18 -8
  27. package/esm2022/interfaces/swimlane.mjs +13 -0
  28. package/esm2022/interfaces/table.mjs +5 -1
  29. package/esm2022/plugins/with-draw-fragment.mjs +5 -2
  30. package/esm2022/plugins/with-draw.mjs +1 -1
  31. package/esm2022/plugins/with-swimlane-create.mjs +4 -4
  32. package/esm2022/plugins/with-swimlane.mjs +21 -2
  33. package/esm2022/plugins/with-table-resize.mjs +6 -5
  34. package/esm2022/plugins/with-table.mjs +28 -10
  35. package/esm2022/table.component.mjs +24 -5
  36. package/esm2022/transforms/geometry-text.mjs +1 -1
  37. package/esm2022/transforms/index.mjs +5 -3
  38. package/esm2022/transforms/swimlane.mjs +128 -36
  39. package/esm2022/utils/clipboard.mjs +27 -21
  40. package/esm2022/utils/common.mjs +5 -5
  41. package/esm2022/utils/hit.mjs +2 -2
  42. package/esm2022/utils/index.mjs +4 -1
  43. package/esm2022/utils/selected.mjs +3 -8
  44. package/esm2022/utils/style/stroke.mjs +2 -4
  45. package/esm2022/utils/swimlane.mjs +66 -77
  46. package/esm2022/utils/table-selected.mjs +26 -0
  47. package/esm2022/utils/table.mjs +26 -1
  48. package/esm2022/utils/uml.mjs +2 -2
  49. package/fesm2022/plait-draw.mjs +797 -246
  50. package/fesm2022/plait-draw.mjs.map +1 -1
  51. package/generators/table.generator.d.ts +2 -2
  52. package/interfaces/geometry.d.ts +14 -23
  53. package/interfaces/index.d.ts +11 -6
  54. package/interfaces/swimlane.d.ts +22 -0
  55. package/interfaces/table.d.ts +12 -3
  56. package/package.json +1 -1
  57. package/plugins/with-swimlane.d.ts +3 -2
  58. package/plugins/with-table-resize.d.ts +1 -1
  59. package/plugins/with-table.d.ts +1 -4
  60. package/transforms/index.d.ts +7 -5
  61. package/transforms/swimlane.d.ts +8 -5
  62. package/utils/clipboard.d.ts +4 -3
  63. package/utils/common.d.ts +4 -4
  64. package/utils/geometry.d.ts +15 -0
  65. package/utils/index.d.ts +3 -0
  66. package/utils/selected.d.ts +2 -4
  67. package/utils/shape.d.ts +1 -1
  68. package/utils/style/stroke.d.ts +3 -4
  69. package/utils/swimlane.d.ts +11 -26
  70. package/utils/table-selected.d.ts +9 -0
  71. package/utils/table.d.ts +9 -8
@@ -1,4 +1,4 @@
1
- import { ACTIVE_STROKE_WIDTH, ThemeColorMode, RectangleClient, idCreator, distanceBetweenPointAndSegments, HIT_DISTANCE_BUFFER, rotatePointsByElement, isPolylineHitRectangle, rotateAntiPointsByElement, distanceBetweenPointAndPoint, Transforms, clearSelectedElement, addSelectedElement, BoardTransforms, PlaitPointerType, depthFirstRecursion, PlaitBoard, getIsRecursionFunc, createG, SNAPPING_STROKE_WIDTH, SELECTION_BORDER_COLOR, SELECTION_FILL_COLOR, drawCircle, createDebugGenerator, Point, arrowPoints, createPath, drawLinearPath, rotate, catmullRomFitting, setStrokeLinecap, findElements, createMask, createRect, PlaitElement, getSelectedElements, getElementById, Path, Direction, PlaitNode, hasValidAngle, toViewBoxPoint, toHostPoint, rotatePoints, getRectangleByElements, getSelectionAngle, rotatedDataPoints, isAxisChangedByAngle, isSelectionMoving, drawRectangle, getRectangleByAngle, getSnapRectangles, getTripleAxis, getMinPointDelta, SNAP_TOLERANCE, drawPointSnapLines, drawSolidLines, isPointInPolygon, getNearestPointBetweenPointAndSegments, isPointInEllipse, getNearestPointBetweenPointAndEllipse, getEllipseTangentSlope, getVectorFromPointAndSlope, drawRoundRectangle, isPointInRoundRectangle, setPathStrokeLinecap, getCrossingPointsBetweenEllipseAndSegment, drawLine as drawLine$1, RgbaToHEX, getHitElementByPoint, preventTouchMove, WritableClipboardOperationType, createClipboardContext, WritableClipboardType, addClipboardContext, setAngleForG, CursorClass, temporaryDisableSelection, PRESS_AND_MOVE_BUFFER, isMainPointer, throttleRAF, getAngleBetweenPoints, normalizeAngle, degreesToRadians, rotateElements, MERGING, ROTATE_HANDLE_CLASS_NAME, SELECTION_RECTANGLE_CLASS_NAME, isSelectedElement } from '@plait/core';
1
+ import { ACTIVE_STROKE_WIDTH, ThemeColorMode, RectangleClient, idCreator, distanceBetweenPointAndSegments, HIT_DISTANCE_BUFFER, rotatePointsByElement, isPolylineHitRectangle, rotateAntiPointsByElement, distanceBetweenPointAndPoint, Transforms, clearSelectedElement, addSelectedElement, BoardTransforms, PlaitPointerType, depthFirstRecursion, PlaitBoard, getIsRecursionFunc, createG, SNAPPING_STROKE_WIDTH, SELECTION_BORDER_COLOR, SELECTION_FILL_COLOR, drawCircle, createDebugGenerator, Point, arrowPoints, createPath, drawLinearPath, rotate, catmullRomFitting, setStrokeLinecap, findElements, createMask, createRect, PlaitElement, getSelectedElements, getElementById, Path, Direction, PlaitNode, hasValidAngle, toViewBoxPoint, toHostPoint, rotatePoints, getRectangleByElements, getSelectionAngle, rotatedDataPoints, isAxisChangedByAngle, isSelectionMoving, drawRectangle, getRectangleByAngle, getSnapRectangles, getTripleAxis, getMinPointDelta, SNAP_TOLERANCE, drawPointSnapLines, drawSolidLines, isPointInPolygon, getNearestPointBetweenPointAndSegments, isPointInEllipse, getNearestPointBetweenPointAndEllipse, getEllipseTangentSlope, getVectorFromPointAndSlope, drawRoundRectangle, isPointInRoundRectangle, setPathStrokeLinecap, getCrossingPointsBetweenEllipseAndSegment, drawLine as drawLine$1, RgbaToHEX, getHitElementByPoint, preventTouchMove, WritableClipboardOperationType, createClipboardContext, WritableClipboardType, addClipboardContext, setAngleForG, CursorClass, temporaryDisableSelection, PRESS_AND_MOVE_BUFFER, isMainPointer, throttleRAF, getAngleBetweenPoints, normalizeAngle, degreesToRadians, rotateElements, MERGING, ROTATE_HANDLE_CLASS_NAME, SELECTION_RECTANGLE_CLASS_NAME, isSelectedElement, isDragging } from '@plait/core';
2
2
  import { WithTextPluginKey, ELEMENT_TO_TEXT_MANAGES, getMemorizedLatest, memorizeLatest, RESIZE_HANDLE_DIAMETER, getPointOnPolyline, TRANSPARENT, getTextEditorsByElement, Generator, removeDuplicatePoints, generateElbowLineRoute, simplifyOrthogonalPoints, getExtendPoint, getUnitVectorByPointAndPoint, getPointByVectorComponent, getFirstTextManage, ActiveGenerator, isSourceAndTargetIntersect, getPoints, DEFAULT_ROUTE_MARGIN, getDirectionByVector, normalizeShapePoints, getFirstTextEditor, resetPointsAfterResize, getRectangleResizeHandleRefs, getRotatedResizeCursorClassByAngle, ROTATE_HANDLE_DISTANCE_TO_ELEMENT, ROTATE_HANDLE_SIZE, isCornerHandle, getIndexByResizeHandle, withResize, drawHandle, getSymmetricHandleIndex, getResizeHandlePointByIndex, getDirectionFactorByDirectionComponent, getCrossingPointsBetweenPointAndSegment, isPointOnSegment, getDirectionByPointOfRectangle, getDirectionFactor, rotateVector, getOppositeDirection, rotateVectorAnti90, getSourceAndTargetOuterRectangle, getNextPoint, PRIMARY_COLOR, CommonElementFlavour, canResize, drawPrimaryHandle, drawFillPrimaryHandle, isVirtualKey, isDelete, isSpaceHotkey, isDndMode, isDrawingMode, getElementsText, acceptImageTypes, getElementOfFocusedImage, buildImage, isResizingByCondition, getRatioByPoint, getTextManages, ImageGenerator, ResizeHandle, addRotating, removeRotating, drawRotateHandle } from '@plait/common';
3
3
  import { Alignment, TextManage, buildText, DEFAULT_FONT_SIZE, getTextSize, AlignEditor } from '@plait/text';
4
4
  import { pointsOnBezierCurves } from 'points-on-curve';
@@ -57,15 +57,6 @@ var FlowchartSymbols;
57
57
  FlowchartSymbols["noteSquare"] = "noteSquare";
58
58
  FlowchartSymbols["display"] = "display";
59
59
  })(FlowchartSymbols || (FlowchartSymbols = {}));
60
- var TableSymbols;
61
- (function (TableSymbols) {
62
- TableSymbols["table"] = "table";
63
- })(TableSymbols || (TableSymbols = {}));
64
- var SwimlaneSymbols;
65
- (function (SwimlaneSymbols) {
66
- SwimlaneSymbols["swimlaneVertical"] = "swimlaneVertical";
67
- SwimlaneSymbols["swimlaneHorizontal"] = "swimlaneHorizontal";
68
- })(SwimlaneSymbols || (SwimlaneSymbols = {}));
69
60
  var UMLSymbols;
70
61
  (function (UMLSymbols) {
71
62
  UMLSymbols["actor"] = "actor";
@@ -81,8 +72,14 @@ var UMLSymbols;
81
72
  UMLSymbols["class"] = "class";
82
73
  UMLSymbols["interface"] = "interface";
83
74
  UMLSymbols["object"] = "object";
75
+ UMLSymbols["component"] = "component";
76
+ UMLSymbols["componentBox"] = "componentBox";
77
+ UMLSymbols["template"] = "template";
84
78
  UMLSymbols["activation"] = "activation";
85
79
  UMLSymbols["deletion"] = "deletion";
80
+ UMLSymbols["assembly"] = "assembly";
81
+ UMLSymbols["providedInterface"] = "providedInterface";
82
+ UMLSymbols["requiredInterface"] = "requiredInterface";
86
83
  })(UMLSymbols || (UMLSymbols = {}));
87
84
  var MultipleTextGeometryCommonTextKeys;
88
85
  (function (MultipleTextGeometryCommonTextKeys) {
@@ -91,6 +88,23 @@ var MultipleTextGeometryCommonTextKeys;
91
88
  })(MultipleTextGeometryCommonTextKeys || (MultipleTextGeometryCommonTextKeys = {}));
92
89
  const PlaitGeometry = {};
93
90
 
91
+ var SwimlaneSymbols;
92
+ (function (SwimlaneSymbols) {
93
+ SwimlaneSymbols["swimlaneVertical"] = "swimlaneVertical";
94
+ SwimlaneSymbols["swimlaneHorizontal"] = "swimlaneHorizontal";
95
+ })(SwimlaneSymbols || (SwimlaneSymbols = {}));
96
+ var SwimlaneDrawSymbols;
97
+ (function (SwimlaneDrawSymbols) {
98
+ SwimlaneDrawSymbols["swimlaneVertical"] = "swimlaneVertical";
99
+ SwimlaneDrawSymbols["swimlaneHorizontal"] = "swimlaneHorizontal";
100
+ SwimlaneDrawSymbols["swimlaneVerticalWithHeader"] = "swimlaneVerticalWithHeader";
101
+ SwimlaneDrawSymbols["swimlaneHorizontalWithHeader"] = "swimlaneHorizontalWithHeader";
102
+ })(SwimlaneDrawSymbols || (SwimlaneDrawSymbols = {}));
103
+
104
+ var TableSymbols;
105
+ (function (TableSymbols) {
106
+ TableSymbols["table"] = "table";
107
+ })(TableSymbols || (TableSymbols = {}));
94
108
  const PlaitTableElement = {
95
109
  isTable: (value) => {
96
110
  return value.type === 'table';
@@ -219,6 +233,10 @@ const DefaultObjectProperty = {
219
233
  width: 120,
220
234
  height: 60
221
235
  };
236
+ const DefaultComponentBoxProperty = {
237
+ width: 200,
238
+ height: 150
239
+ };
222
240
  const DefaultDeletionProperty = {
223
241
  width: 40,
224
242
  height: 40
@@ -227,6 +245,18 @@ const DefaultPortProperty = {
227
245
  width: 20,
228
246
  height: 20
229
247
  };
248
+ const DefaultRequiredInterfaceProperty = {
249
+ width: 70,
250
+ height: 56
251
+ };
252
+ const DefaultAssemblyProperty = {
253
+ width: 120,
254
+ height: 56
255
+ };
256
+ const DefaultProvidedInterfaceProperty = {
257
+ width: 70,
258
+ height: 34
259
+ };
230
260
  const DefaultCombinedFragmentProperty = {
231
261
  width: 400,
232
262
  height: 280,
@@ -269,14 +299,6 @@ const DefaultInterfaceProperty = {
269
299
  }
270
300
  ]
271
301
  };
272
- const DefaultSwimlaneVerticalProperty = {
273
- width: 450,
274
- height: 500
275
- };
276
- const DefaultSwimlaneHorizontalProperty = {
277
- width: 500,
278
- height: 450
279
- };
280
302
  const DefaultBasicShapePropertyMap = {
281
303
  [BasicShapes.pentagonArrow]: DefaultPentagonArrowProperty,
282
304
  [BasicShapes.processArrow]: DefaultPentagonArrowProperty,
@@ -325,17 +347,19 @@ const DefaultUMLPropertyMap = {
325
347
  [UMLSymbols.deletion]: DefaultDeletionProperty,
326
348
  [UMLSymbols.activityClass]: DefaultObjectProperty,
327
349
  [UMLSymbols.simpleClass]: DefaultObjectProperty,
350
+ [UMLSymbols.component]: DefaultMultiDocumentProperty,
351
+ [UMLSymbols.template]: DefaultMultiDocumentProperty,
352
+ [UMLSymbols.componentBox]: DefaultComponentBoxProperty,
328
353
  [UMLSymbols.port]: DefaultPortProperty,
329
- [UMLSymbols.branchMerge]: DefaultDeletionProperty
354
+ [UMLSymbols.branchMerge]: DefaultDeletionProperty,
355
+ [UMLSymbols.assembly]: DefaultAssemblyProperty,
356
+ [UMLSymbols.providedInterface]: DefaultProvidedInterfaceProperty,
357
+ [UMLSymbols.requiredInterface]: DefaultRequiredInterfaceProperty
330
358
  };
331
359
  const MultipleTextGeometryTextKeys = {
332
360
  [UMLSymbols.package]: Object.keys(MultipleTextGeometryCommonTextKeys),
333
361
  [UMLSymbols.combinedFragment]: Object.keys(MultipleTextGeometryCommonTextKeys)
334
362
  };
335
- const DefaultSwimlanePropertyMap = {
336
- [SwimlaneSymbols.swimlaneHorizontal]: DefaultSwimlaneHorizontalProperty,
337
- [SwimlaneSymbols.swimlaneVertical]: DefaultSwimlaneVerticalProperty
338
- };
339
363
  const LINE_HIT_GEOMETRY_BUFFER = 10;
340
364
  const LINE_SNAPPING_BUFFER = 6;
341
365
  const LINE_SNAPPING_CONNECTOR_BUFFER = 8;
@@ -345,7 +369,10 @@ const GEOMETRY_WITHOUT_TEXT = [
345
369
  UMLSymbols.activation,
346
370
  UMLSymbols.deletion,
347
371
  UMLSymbols.port,
348
- UMLSymbols.branchMerge
372
+ UMLSymbols.branchMerge,
373
+ UMLSymbols.assembly,
374
+ UMLSymbols.providedInterface,
375
+ UMLSymbols.requiredInterface
349
376
  ];
350
377
  const GEOMETRY_WITH_MULTIPLE_TEXT = [UMLSymbols.package, UMLSymbols.combinedFragment];
351
378
 
@@ -353,7 +380,7 @@ const getGeometryPointers = () => {
353
380
  return [...Object.keys(BasicShapes), ...Object.keys(FlowchartSymbols), ...Object.keys(UMLSymbols)];
354
381
  };
355
382
  const getSwimlanePointers = () => {
356
- return Object.keys(SwimlaneSymbols);
383
+ return Object.keys(SwimlaneDrawSymbols);
357
384
  };
358
385
  const getBasicPointers = () => {
359
386
  return Object.keys(BasicShapes);
@@ -399,6 +426,30 @@ const DrawThemeColors = {
399
426
 
400
427
  const DEFAULT_TEXT_HEIGHT = 20;
401
428
 
429
+ const SWIMLANE_HEADER_SIZE = 42;
430
+ const DefaultSwimlaneVerticalWithHeaderProperty = {
431
+ width: 580,
432
+ height: 524
433
+ };
434
+ const DefaultSwimlaneHorizontalWithHeaderProperty = {
435
+ width: 524,
436
+ height: 580
437
+ };
438
+ const DefaultSwimlaneVerticalProperty = {
439
+ width: 580,
440
+ height: 524
441
+ };
442
+ const DefaultSwimlaneHorizontalProperty = {
443
+ width: 524,
444
+ height: 580
445
+ };
446
+ const DefaultSwimlanePropertyMap = {
447
+ [SwimlaneDrawSymbols.swimlaneHorizontal]: DefaultSwimlaneHorizontalProperty,
448
+ [SwimlaneDrawSymbols.swimlaneVertical]: DefaultSwimlaneVerticalProperty,
449
+ [SwimlaneDrawSymbols.swimlaneHorizontalWithHeader]: DefaultSwimlaneHorizontalWithHeaderProperty,
450
+ [SwimlaneDrawSymbols.swimlaneVerticalWithHeader]: DefaultSwimlaneVerticalWithHeaderProperty
451
+ };
452
+
402
453
  const getElementShape = (value) => {
403
454
  if (PlaitDrawElement.isImage(value)) {
404
455
  return BasicShapes.rectangle;
@@ -651,6 +702,29 @@ function updateCellIds(cells) {
651
702
  function isCellIncludeText(cell) {
652
703
  return cell.text && cell.textHeight;
653
704
  }
705
+ function getCellsRectangle(board, element, cells) {
706
+ const cellsWithPoints = getCellsWithPoints(board, element);
707
+ const points = cells.map(cell => {
708
+ const cellWithPoints = cellsWithPoints.find(item => item.id === cell.id);
709
+ return cellWithPoints.points;
710
+ });
711
+ return RectangleClient.getRectangleByPoints(points);
712
+ }
713
+ const createCell = (rowId, columnId, text = null) => {
714
+ const cell = {
715
+ id: idCreator(),
716
+ rowId,
717
+ columnId
718
+ };
719
+ if (text !== null) {
720
+ cell['textHeight'] = DEFAULT_TEXT_HEIGHT;
721
+ cell['text'] = {
722
+ children: [{ text }],
723
+ align: Alignment.center
724
+ };
725
+ }
726
+ return cell;
727
+ };
654
728
 
655
729
  const SHAPE_MAX_LENGTH = 6;
656
730
  const memorizedShape = new WeakMap();
@@ -983,7 +1057,7 @@ const isInsideOfShape = (board, element, point, hitDistanceBuffer) => {
983
1057
  const isHitElementInside = (board, element, point) => {
984
1058
  const rectangle = board.getRectangle(element);
985
1059
  point = rotateAntiPointsByElement(point, element) || point;
986
- if (PlaitDrawElement.isGeometry(element)) {
1060
+ if (PlaitDrawElement.isGeometry(element) && !PlaitDrawElement.isGeometryByTable(element)) {
987
1061
  const engine = getEngine(getElementShape(element));
988
1062
  const isHitInside = engine.isInsidePoint(rectangle, point);
989
1063
  if (isHitInside) {
@@ -1046,7 +1120,7 @@ const isDrawElementIncludeText = (element) => {
1046
1120
  const editors = getTextEditorsByElement(element);
1047
1121
  return editors.length > 0;
1048
1122
  }
1049
- if (PlaitDrawElement.isTable(element)) {
1123
+ if (PlaitDrawElement.isElementByTable(element)) {
1050
1124
  return element.cells.some(cell => isCellIncludeText(cell));
1051
1125
  }
1052
1126
  return true;
@@ -1098,7 +1172,7 @@ const drawBoundReaction = (board, element, roughOptions = { hasMask: true, hasCo
1098
1172
  const activeRectangle = RectangleClient.inflate(rectangle, SNAPPING_STROKE_WIDTH);
1099
1173
  const shape = getElementShape(element);
1100
1174
  let drawOptions = {};
1101
- if (PlaitDrawElement.isTable(element)) {
1175
+ if (PlaitDrawElement.isElementByTable(element)) {
1102
1176
  drawOptions = { element };
1103
1177
  }
1104
1178
  const strokeG = drawShape(board, activeRectangle, shape, {
@@ -1137,7 +1211,7 @@ const getTextKey = (element, text) => {
1137
1211
  return text.key;
1138
1212
  }
1139
1213
  };
1140
- const getGeometryAlign = (element) => {
1214
+ const getGeometryAlign = (board, element) => {
1141
1215
  if (isMultipleTextGeometry(element)) {
1142
1216
  const drawShapeText = element.texts.find(item => item.key.includes(MultipleTextGeometryCommonTextKeys.content));
1143
1217
  return drawShapeText?.text.align || Alignment.center;
@@ -1145,7 +1219,7 @@ const getGeometryAlign = (element) => {
1145
1219
  if (isSingleTextGeometry(element)) {
1146
1220
  return element.text?.align || Alignment.center;
1147
1221
  }
1148
- if (PlaitDrawElement.isTable(element)) {
1222
+ if (PlaitDrawElement.isElementByTable(element)) {
1149
1223
  const firstTextCell = element.cells.find(item => item.text);
1150
1224
  return firstTextCell?.text?.align || Alignment.center;
1151
1225
  }
@@ -1158,9 +1232,7 @@ const getStrokeColorByElement = (board, element) => {
1158
1232
  return strokeColor;
1159
1233
  };
1160
1234
  const getFillByElement = (board, element) => {
1161
- const defaultFill = PlaitDrawElement.isFlowchart(element)
1162
- ? getFlowchartDefaultFill(board.theme.themeColorMode)
1163
- : DefaultDrawStyle.fill;
1235
+ const defaultFill = PlaitDrawElement.isFlowchart(element) ? getFlowchartDefaultFill(board.theme.themeColorMode) : DefaultDrawStyle.fill;
1164
1236
  const fill = element.fill || defaultFill;
1165
1237
  return fill;
1166
1238
  };
@@ -1869,7 +1941,7 @@ const createUMLClassOrInterfaceGeometryElement = (board, shape, points) => {
1869
1941
  const memorizedLatest = getMemorizedLatestByPointer(shape);
1870
1942
  const element = {
1871
1943
  id: idCreator(),
1872
- type: 'table',
1944
+ type: 'geometry',
1873
1945
  angle: 0,
1874
1946
  opacity: 1,
1875
1947
  points,
@@ -2304,13 +2376,9 @@ const isSingleSelectSwimlane = (board) => {
2304
2376
  const selectedElements = getSelectedElements(board);
2305
2377
  return selectedElements && selectedElements.length === 1 && PlaitDrawElement.isSwimlane(selectedElements[0]);
2306
2378
  };
2307
- const isSingleSelectTable = (board) => {
2379
+ const getSelectedSwimlane = (board) => {
2308
2380
  const selectedElements = getSelectedElements(board);
2309
- return selectedElements && selectedElements.length === 1 && PlaitTableElement.isTable(selectedElements[0]);
2310
- };
2311
- const getSelectedTableElements = (board, elements) => {
2312
- const selectedElements = elements?.length ? elements : getSelectedElements(board);
2313
- return selectedElements.filter(value => PlaitTableElement.isTable(value));
2381
+ return selectedElements.find(item => PlaitDrawElement.isSwimlane(item));
2314
2382
  };
2315
2383
 
2316
2384
  const resizeLine = (board, options, path) => {
@@ -2541,69 +2609,241 @@ const insertImage = (board, imageItem, startPoint) => {
2541
2609
  Transforms.addSelectionWithTemporaryElements(board, [imageElement]);
2542
2610
  };
2543
2611
 
2544
- const addSwimlaneRow = (board, swimlane, index) => {
2545
- if (PlaitDrawElement.isSwimlane(swimlane) && swimlane.shape === SwimlaneSymbols.swimlaneHorizontal) {
2612
+ function buildSwimlaneTable(element) {
2613
+ const swimlaneElement = { ...element };
2614
+ if (PlaitDrawElement.isHorizontalSwimlane(element)) {
2615
+ swimlaneElement.cells = element.cells.map((item, index) => {
2616
+ if (index === 0 && element.header) {
2617
+ item = {
2618
+ ...element.cells[0],
2619
+ rowspan: element.rows.length
2620
+ };
2621
+ }
2622
+ if (item.text && item.textHeight && !item.text.direction) {
2623
+ item = {
2624
+ ...item,
2625
+ text: {
2626
+ ...item.text,
2627
+ direction: 'vertical'
2628
+ }
2629
+ };
2630
+ }
2631
+ return item;
2632
+ });
2633
+ return swimlaneElement;
2634
+ }
2635
+ if (element.header) {
2636
+ swimlaneElement.cells = [
2637
+ {
2638
+ ...element.cells[0],
2639
+ colspan: element.columns.length
2640
+ },
2641
+ ...element.cells.slice(1, element.cells.length)
2642
+ ];
2643
+ }
2644
+ return swimlaneElement;
2645
+ }
2646
+ const getDefaultSwimlanePoints = (pointer, centerPoint) => {
2647
+ const property = DefaultSwimlanePropertyMap[pointer];
2648
+ return RectangleClient.getPoints(RectangleClient.getRectangleByCenterPoint(centerPoint, property.width, property.height));
2649
+ };
2650
+ const createDefaultSwimlane = (shape, points) => {
2651
+ const header = isSwimlaneWithHeader(shape);
2652
+ const dataShape = adjustSwimlaneShape(shape);
2653
+ const rows = createDefaultRowsOrColumns(dataShape, 'row', header);
2654
+ const columns = createDefaultRowsOrColumns(dataShape, 'column', header);
2655
+ const swimlane = {
2656
+ id: idCreator(),
2657
+ type: 'swimlane',
2658
+ shape: dataShape,
2659
+ points,
2660
+ rows,
2661
+ columns,
2662
+ header,
2663
+ cells: createDefaultCells(dataShape, rows, columns, header)
2664
+ };
2665
+ return swimlane;
2666
+ };
2667
+ const createDefaultRowsOrColumns = (shape, type, header) => {
2668
+ const createItems = (count) => new Array(count).fill('').map(() => ({ id: idCreator() }));
2669
+ let data = createItems(3);
2670
+ if ((type === 'row' && shape === SwimlaneSymbols.swimlaneVertical) ||
2671
+ (type === 'column' && shape === SwimlaneSymbols.swimlaneHorizontal)) {
2672
+ data = header ? data : createItems(2);
2673
+ const dimension = type === 'row' ? 'height' : 'width';
2674
+ data = data.map((item, index) => {
2675
+ if (index === 0 || (index === 1 && header)) {
2676
+ return {
2677
+ ...item,
2678
+ [dimension]: SWIMLANE_HEADER_SIZE
2679
+ };
2680
+ }
2681
+ return item;
2682
+ });
2683
+ }
2684
+ return data;
2685
+ };
2686
+ const createDefaultCells = (shape, rows, columns, header) => {
2687
+ let headerCell = [];
2688
+ let startIndex = 0;
2689
+ if (header) {
2690
+ headerCell = [createCell(rows[0].id, columns[0].id, 'New Swimlane')];
2691
+ startIndex = 1;
2692
+ }
2693
+ const cells = new Array(6).fill('').map((_, index) => {
2694
+ if (index < 3) {
2695
+ const rowId = shape === SwimlaneSymbols.swimlaneVertical ? rows[startIndex].id : rows[index].id;
2696
+ const columnId = shape === SwimlaneSymbols.swimlaneVertical ? columns[index].id : columns[startIndex].id;
2697
+ return createCell(rowId, columnId, header ? 'Lane' : 'New Swimlane');
2698
+ }
2699
+ const rowId = shape === SwimlaneSymbols.swimlaneVertical ? rows[startIndex + 1].id : rows[index - 3].id;
2700
+ const columnId = shape === SwimlaneSymbols.swimlaneVertical ? columns[index - 3].id : columns[startIndex + 1].id;
2701
+ return createCell(rowId, columnId);
2702
+ });
2703
+ return [...headerCell, ...cells];
2704
+ };
2705
+ const getSwimlaneCount = (swimlane) => {
2706
+ if (PlaitDrawElement.isHorizontalSwimlane(swimlane)) {
2707
+ return swimlane.rows.length;
2708
+ }
2709
+ if (PlaitDrawElement.isVerticalSwimlane(swimlane)) {
2710
+ return swimlane.columns.length;
2711
+ }
2712
+ return 0;
2713
+ };
2714
+ const isSwimlaneWithHeader = (shape) => {
2715
+ return [SwimlaneDrawSymbols.swimlaneHorizontalWithHeader, SwimlaneDrawSymbols.swimlaneVerticalWithHeader].includes(shape);
2716
+ };
2717
+ const adjustSwimlaneShape = (shape) => {
2718
+ return [SwimlaneDrawSymbols.swimlaneHorizontalWithHeader, SwimlaneDrawSymbols.swimlaneHorizontal].includes(shape)
2719
+ ? SwimlaneSymbols.swimlaneHorizontal
2720
+ : SwimlaneSymbols.swimlaneVertical;
2721
+ };
2722
+
2723
+ const updateSwimlaneCount = (board, swimlane, count) => {
2724
+ if (count > 0 && PlaitDrawElement.isSwimlane(swimlane)) {
2725
+ const currentCount = getSwimlaneCount(swimlane);
2726
+ if (PlaitDrawElement.isHorizontalSwimlane(swimlane)) {
2727
+ if (count > currentCount) {
2728
+ addSwimlaneRow(board, swimlane, swimlane.rows.length, count - currentCount);
2729
+ }
2730
+ else {
2731
+ const deleteIndex = swimlane.rows.length - (currentCount - count);
2732
+ removeSwimlaneRow(board, swimlane, deleteIndex, currentCount - count);
2733
+ }
2734
+ }
2735
+ if (PlaitDrawElement.isVerticalSwimlane(swimlane)) {
2736
+ if (count > currentCount) {
2737
+ addSwimlaneColumn(board, swimlane, swimlane.columns.length, count - currentCount);
2738
+ }
2739
+ else {
2740
+ const deleteIndex = swimlane.columns.length - (currentCount - count);
2741
+ removeSwimlaneColumn(board, swimlane, deleteIndex, currentCount - count);
2742
+ }
2743
+ }
2744
+ }
2745
+ };
2746
+ const addSwimlaneRow = (board, swimlane, index, count = 1) => {
2747
+ if (PlaitDrawElement.isHorizontalSwimlane(swimlane)) {
2546
2748
  const newRows = [...swimlane.rows];
2547
- const newRowId = idCreator();
2548
- newRows.splice(index, 0, { id: newRowId });
2549
- const newCells = [...swimlane.cells, ...createNewSwimlaneCells(swimlane, newRowId, 'column')];
2749
+ const addRows = [];
2750
+ for (let i = 0; i < count; i++) {
2751
+ addRows.push({ id: idCreator() });
2752
+ }
2753
+ newRows.splice(index, 0, ...addRows);
2754
+ const newCells = [...swimlane.cells];
2755
+ addRows.forEach(item => {
2756
+ newCells.push(...createNewSwimlaneCells(swimlane, item.id, 'column'));
2757
+ });
2550
2758
  const lastCellPoints = getCellWithPoints(board, swimlane, swimlane.cells[swimlane.cells.length - 1].id).points;
2551
2759
  const lastRowHeight = RectangleClient.getRectangleByPoints(lastCellPoints).height;
2552
- const newPoints = [swimlane.points[0], [swimlane.points[1][0], swimlane.points[1][1] + lastRowHeight]];
2760
+ const newPoints = [swimlane.points[0], [swimlane.points[1][0], swimlane.points[1][1] + lastRowHeight * count]];
2553
2761
  updateSwimlane(board, swimlane, swimlane.columns, newRows, newCells, newPoints);
2554
2762
  }
2555
2763
  };
2556
- const addSwimlaneColumn = (board, swimlane, index) => {
2557
- if (PlaitDrawElement.isSwimlane(swimlane) && swimlane.shape === SwimlaneSymbols.swimlaneVertical) {
2764
+ const addSwimlaneColumn = (board, swimlane, index, count = 1) => {
2765
+ if (PlaitDrawElement.isVerticalSwimlane(swimlane)) {
2558
2766
  const newColumns = [...swimlane.columns];
2559
- const newColumnId = idCreator();
2560
- newColumns.splice(index, 0, { id: newColumnId });
2561
- const newCells = [...swimlane.cells, ...createNewSwimlaneCells(swimlane, newColumnId, 'row')];
2767
+ const addColumns = [];
2768
+ for (let i = 0; i < count; i++) {
2769
+ addColumns.push({ id: idCreator() });
2770
+ }
2771
+ newColumns.splice(index, 0, ...addColumns);
2772
+ const newCells = [...swimlane.cells];
2773
+ addColumns.forEach(item => {
2774
+ newCells.push(...createNewSwimlaneCells(swimlane, item.id, 'row'));
2775
+ });
2562
2776
  const lastCellPoints = getCellWithPoints(board, swimlane, swimlane.cells[swimlane.cells.length - 1].id).points;
2563
2777
  const lastColumnWidth = RectangleClient.getRectangleByPoints(lastCellPoints).width;
2564
- const newPoints = [swimlane.points[0], [swimlane.points[1][0] + lastColumnWidth, swimlane.points[1][1]]];
2778
+ const newPoints = [swimlane.points[0], [swimlane.points[1][0] + lastColumnWidth * count, swimlane.points[1][1]]];
2565
2779
  updateSwimlane(board, swimlane, newColumns, swimlane.rows, newCells, newPoints);
2566
2780
  }
2567
2781
  };
2568
- const removeSwimlaneRow = (board, swimlane, index) => {
2569
- if (PlaitDrawElement.isSwimlane(swimlane) && swimlane.shape === SwimlaneSymbols.swimlaneHorizontal) {
2782
+ const removeSwimlaneRow = (board, swimlane, index, count = 1) => {
2783
+ if (PlaitDrawElement.isHorizontalSwimlane(swimlane)) {
2784
+ if (count > swimlane.rows.length) {
2785
+ return;
2786
+ }
2570
2787
  const newRows = [...swimlane.rows];
2571
- newRows.splice(index, 1);
2788
+ newRows.splice(index, count);
2572
2789
  if (newRows.length === 0) {
2573
2790
  const path = PlaitBoard.findPath(board, swimlane);
2574
2791
  Transforms.removeNode(board, path);
2575
2792
  }
2576
2793
  else {
2577
- const removeRow = swimlane.rows[index];
2578
- const newCells = swimlane.cells.filter(item => item.rowId !== removeRow.id);
2579
- let removeRowHeight = removeRow.height;
2580
- if (!removeRowHeight) {
2581
- const rowCell = swimlane.cells.find(item => item.rowId === removeRow.id);
2582
- const cellPoints = getCellWithPoints(board, swimlane, rowCell.id).points;
2583
- removeRowHeight = RectangleClient.getRectangleByPoints(cellPoints).height;
2794
+ let newCells = [...swimlane.cells];
2795
+ const removeRows = [];
2796
+ for (let i = index; i < count + index; i++) {
2797
+ const removeRow = swimlane.rows[i];
2798
+ removeRows.push(removeRow);
2799
+ newCells = newCells.filter(item => item.rowId !== removeRow.id);
2584
2800
  }
2801
+ let removeRowHeight = 0;
2802
+ removeRows.forEach(row => {
2803
+ if (!row.height) {
2804
+ const rowCell = swimlane.cells.find(item => item.rowId === row.id);
2805
+ const cellPoints = getCellWithPoints(board, swimlane, rowCell.id).points;
2806
+ removeRowHeight += RectangleClient.getRectangleByPoints(cellPoints).height;
2807
+ }
2808
+ else {
2809
+ removeRowHeight += row.height;
2810
+ }
2811
+ });
2585
2812
  const newPoints = [swimlane.points[0], [swimlane.points[1][0], swimlane.points[1][1] - removeRowHeight]];
2586
2813
  updateSwimlane(board, swimlane, swimlane.columns, newRows, newCells, newPoints);
2587
2814
  }
2588
2815
  }
2589
2816
  };
2590
- const removeSwimlaneColumn = (board, swimlane, index) => {
2591
- if (PlaitDrawElement.isSwimlane(swimlane) && swimlane.shape === SwimlaneSymbols.swimlaneVertical) {
2817
+ const removeSwimlaneColumn = (board, swimlane, index, count = 1) => {
2818
+ if (PlaitDrawElement.isVerticalSwimlane(swimlane)) {
2819
+ if (count > swimlane.columns.length) {
2820
+ return;
2821
+ }
2592
2822
  const newColumns = [...swimlane.columns];
2593
- newColumns.splice(index, 1);
2823
+ newColumns.splice(index, count);
2594
2824
  if (newColumns.length === 0) {
2595
2825
  const path = PlaitBoard.findPath(board, swimlane);
2596
2826
  Transforms.removeNode(board, path);
2597
2827
  }
2598
2828
  else {
2599
- const removeColumn = swimlane.columns[index];
2600
- const newCells = swimlane.cells.filter(item => item.columnId !== removeColumn.id);
2601
- let removeColumnWidth = removeColumn.width;
2602
- if (!removeColumnWidth) {
2603
- const columnCell = swimlane.cells.find(item => item.columnId === removeColumn.id);
2604
- const cellPoints = getCellWithPoints(board, swimlane, columnCell.id).points;
2605
- removeColumnWidth = RectangleClient.getRectangleByPoints(cellPoints).width;
2829
+ let newCells = [...swimlane.cells];
2830
+ const removeColumns = [];
2831
+ for (let i = index; i < count + index; i++) {
2832
+ const removeColumn = swimlane.columns[i];
2833
+ removeColumns.push(removeColumn);
2834
+ newCells = newCells.filter(item => item.columnId !== removeColumn.id);
2606
2835
  }
2836
+ let removeColumnWidth = 0;
2837
+ removeColumns.forEach(column => {
2838
+ if (!column.width) {
2839
+ const rowCell = swimlane.cells.find(item => item.columnId === column.id);
2840
+ const cellPoints = getCellWithPoints(board, swimlane, rowCell.id).points;
2841
+ removeColumnWidth += RectangleClient.getRectangleByPoints(cellPoints).width;
2842
+ }
2843
+ else {
2844
+ removeColumnWidth += column.width;
2845
+ }
2846
+ });
2607
2847
  const newPoints = [swimlane.points[0], [swimlane.points[1][0] - removeColumnWidth, swimlane.points[1][1]]];
2608
2848
  updateSwimlane(board, swimlane, newColumns, swimlane.rows, newCells, newPoints);
2609
2849
  }
@@ -2615,11 +2855,13 @@ const createNewSwimlaneCells = (swimlane, newId, type) => {
2615
2855
  rowId: type === 'row' ? item.id : newId,
2616
2856
  columnId: type === 'row' ? newId : item.id
2617
2857
  }));
2618
- cells.shift();
2858
+ if (swimlane.header) {
2859
+ cells.shift();
2860
+ }
2619
2861
  cells[0] = {
2620
2862
  ...cells[0],
2621
2863
  text: {
2622
- children: [{ text: 'Lane' }],
2864
+ children: [{ text: swimlane.header ? 'Lane' : 'New Swimlane' }],
2623
2865
  align: Alignment.center,
2624
2866
  direction: type === 'row' ? undefined : 'vertical'
2625
2867
  },
@@ -2636,6 +2878,33 @@ const updateSwimlane = (board, swimlane, newColumns, newRows, newCells, newPoint
2636
2878
  points: newPoints
2637
2879
  }, path);
2638
2880
  };
2881
+ const setSwimlaneFill = (board, element, fill, path) => {
2882
+ const selectedCells = getSelectedCells(element);
2883
+ let newCells = element.cells;
2884
+ if (selectedCells?.length) {
2885
+ newCells = element.cells.map(cell => {
2886
+ if (selectedCells.map(item => item.id).includes(cell.id)) {
2887
+ return {
2888
+ ...cell,
2889
+ fill
2890
+ };
2891
+ }
2892
+ return cell;
2893
+ });
2894
+ }
2895
+ else {
2896
+ newCells = element.cells.map(cell => {
2897
+ if (cell.text && cell.textHeight) {
2898
+ return {
2899
+ ...cell,
2900
+ fill
2901
+ };
2902
+ }
2903
+ return cell;
2904
+ });
2905
+ }
2906
+ Transforms.setNode(board, { cells: newCells }, path);
2907
+ };
2639
2908
 
2640
2909
  const setDrawShapeText = (board, element, text) => {
2641
2910
  const newTexts = element.texts?.map(item => {
@@ -2711,7 +2980,9 @@ const DrawTransforms = {
2711
2980
  addSwimlaneRow,
2712
2981
  addSwimlaneColumn,
2713
2982
  removeSwimlaneRow,
2714
- removeSwimlaneColumn
2983
+ removeSwimlaneColumn,
2984
+ setSwimlaneFill,
2985
+ updateSwimlaneCount
2715
2986
  };
2716
2987
 
2717
2988
  const getHitRectangleResizeHandleRef = (board, rectangle, point, angle = 0) => {
@@ -3168,6 +3439,29 @@ function drawIsometricSnapLines(board, activePoints, snapRectangles, resizeSnapO
3168
3439
  return drawSolidLines(board, isometricLines);
3169
3440
  }
3170
3441
 
3442
+ const isSingleSelectTable = (board) => {
3443
+ const selectedElements = getSelectedElements(board);
3444
+ return selectedElements && selectedElements.length === 1 && PlaitTableElement.isTable(selectedElements[0]);
3445
+ };
3446
+ const isSingleSelectElementByTable = (board) => {
3447
+ const selectedElements = getSelectedElements(board);
3448
+ return selectedElements && selectedElements.length === 1 && PlaitDrawElement.isElementByTable(selectedElements[0]);
3449
+ };
3450
+ const getSelectedTableElements = (board, elements) => {
3451
+ const selectedElements = elements?.length ? elements : getSelectedElements(board);
3452
+ return selectedElements.filter(value => PlaitTableElement.isTable(value));
3453
+ };
3454
+ const SELECTED_CELLS = new WeakMap();
3455
+ function getSelectedCells(element) {
3456
+ return SELECTED_CELLS.get(element);
3457
+ }
3458
+ function setSelectedCells(element, cells) {
3459
+ return SELECTED_CELLS.set(element, cells);
3460
+ }
3461
+ function clearSelectedCells(element) {
3462
+ return SELECTED_CELLS.delete(element);
3463
+ }
3464
+
3171
3465
  const getCenterPointsOnPolygon = (points) => {
3172
3466
  const centerPoints = [];
3173
3467
  for (let i = 0; i < points.length; i++) {
@@ -4936,9 +5230,15 @@ const TableEngine = {
4936
5230
  pointCells.forEach(cell => {
4937
5231
  const rectangle = RectangleClient.getRectangleByPoints(cell.points);
4938
5232
  const { x, y, width, height } = rectangle;
5233
+ const cellRectangle = drawRectangle(board, {
5234
+ x: x + ACTIVE_STROKE_WIDTH,
5235
+ y: y + ACTIVE_STROKE_WIDTH,
5236
+ width: width - ACTIVE_STROKE_WIDTH * 2,
5237
+ height: height - ACTIVE_STROKE_WIDTH * 2
5238
+ }, { fill: cell.fill, fillStyle: 'solid', strokeWidth: 0 });
4939
5239
  const cellRightBorder = drawLine$1(rs, [x + width, y], [x + width, y + height], roughOptions);
4940
5240
  const cellBottomBorder = drawLine$1(rs, [x, y + height], [x + width, y + height], roughOptions);
4941
- g.append(cellRightBorder, cellBottomBorder);
5241
+ g.append(cellRectangle, cellRightBorder, cellBottomBorder);
4942
5242
  });
4943
5243
  setStrokeLinecap(g, 'round');
4944
5244
  return g;
@@ -5382,6 +5682,300 @@ const NoteEngine = {
5382
5682
  }
5383
5683
  };
5384
5684
 
5685
+ const AssemblyEngine = {
5686
+ draw(board, rectangle, options) {
5687
+ const rs = PlaitBoard.getRoughSVG(board);
5688
+ const shape = rs.path(`
5689
+ M${rectangle.x} ${rectangle.y + rectangle.height / 2}
5690
+ H${rectangle.x + rectangle.width * 0.3}
5691
+ A${rectangle.width * 0.13} ${rectangle.height * 0.285}, 0, 1, 1 ${rectangle.x +
5692
+ rectangle.width * 0.3 +
5693
+ rectangle.width * 0.26} ${rectangle.y + rectangle.height / 2}
5694
+ A${rectangle.width * 0.13} ${rectangle.height * 0.285}, 0, 1, 1 ${rectangle.x + rectangle.width * 0.3} ${rectangle.y +
5695
+ rectangle.height / 2}
5696
+ M${rectangle.x + rectangle.width * 0.3 + rectangle.width * 0.13} ${rectangle.y}
5697
+ A${rectangle.width * 0.233} ${rectangle.height / 2}, 0, 0, 1 ${rectangle.x +
5698
+ rectangle.width * 0.3 +
5699
+ rectangle.width * 0.13} ${rectangle.y + rectangle.height}
5700
+ M${rectangle.x + rectangle.width * 0.3 + rectangle.width * 0.13 + rectangle.width * 0.233} ${rectangle.y +
5701
+ rectangle.height / 2} H${rectangle.x + rectangle.width}
5702
+ `, {
5703
+ ...options,
5704
+ fillStyle: 'solid'
5705
+ });
5706
+ setStrokeLinecap(shape, 'round');
5707
+ return shape;
5708
+ },
5709
+ isInsidePoint(rectangle, point) {
5710
+ const rangeRectangle = RectangleClient.getRectangleByPoints([point, point]);
5711
+ return RectangleClient.isHit(rectangle, rangeRectangle);
5712
+ },
5713
+ getCornerPoints(rectangle) {
5714
+ return RectangleClient.getCornerPoints(rectangle);
5715
+ },
5716
+ getConnectorPoints(rectangle) {
5717
+ return RectangleClient.getEdgeCenterPoints(rectangle);
5718
+ },
5719
+ getNearestPoint(rectangle, point) {
5720
+ const nearestPoint = getNearestPointBetweenPointAndSegments(point, RectangleEngine.getCornerPoints(rectangle));
5721
+ if (nearestPoint[0] === rectangle.x + rectangle.width / 2) {
5722
+ return getNearestPointBetweenPointAndEllipse(point, [rectangle.x + rectangle.width * 0.43, rectangle.y + rectangle.height / 2], rectangle.width * 0.223, rectangle.height / 2);
5723
+ }
5724
+ return nearestPoint;
5725
+ },
5726
+ getTangentVectorByConnectionPoint(rectangle, pointOfRectangle) {
5727
+ const connectionPoint = RectangleClient.getConnectionPoint(rectangle, pointOfRectangle);
5728
+ if (connectionPoint[0] > rectangle.x + rectangle.width * 0.43 && connectionPoint[1] < rectangle.y + rectangle.height / 2) {
5729
+ return rotateVector(getUnitVectorByPointAndPoint(connectionPoint, [rectangle.x, rectangle.y + rectangle.height / 2]), -Math.PI);
5730
+ }
5731
+ if (connectionPoint[0] > rectangle.x + rectangle.width * 0.43 && connectionPoint[1] > rectangle.y + rectangle.height / 2) {
5732
+ return getUnitVectorByPointAndPoint(connectionPoint, [rectangle.x, rectangle.y + rectangle.height / 2]);
5733
+ }
5734
+ return getUnitVectorByPointAndPoint(connectionPoint, [rectangle.x, rectangle.y + rectangle.height / 2]);
5735
+ }
5736
+ };
5737
+
5738
+ const RequiredInterfaceEngine = {
5739
+ draw(board, rectangle, options) {
5740
+ const rs = PlaitBoard.getRoughSVG(board);
5741
+ const shape = rs.path(`M${rectangle.x} ${rectangle.y}
5742
+ A${rectangle.width * 0.39} ${rectangle.height / 2}, 0, 0, 1 ${rectangle.x} ${rectangle.y + rectangle.height}
5743
+ M${rectangle.x + rectangle.width * 0.41} ${rectangle.y + rectangle.height / 2} H${rectangle.x + rectangle.width}
5744
+ `, {
5745
+ ...options,
5746
+ fillStyle: 'solid'
5747
+ });
5748
+ setStrokeLinecap(shape, 'round');
5749
+ return shape;
5750
+ },
5751
+ isInsidePoint(rectangle, point) {
5752
+ const rangeRectangle = RectangleClient.getRectangleByPoints([point, point]);
5753
+ return RectangleClient.isHit(rectangle, rangeRectangle);
5754
+ },
5755
+ getCornerPoints(rectangle) {
5756
+ return RectangleClient.getCornerPoints(rectangle);
5757
+ },
5758
+ getNearestPoint(rectangle, point) {
5759
+ return getNearestPointBetweenPointAndSegments(point, RectangleEngine.getCornerPoints(rectangle));
5760
+ },
5761
+ getEdgeByConnectionPoint(rectangle, pointOfRectangle) {
5762
+ const corners = RectangleEngine.getCornerPoints(rectangle);
5763
+ const point = RectangleClient.getConnectionPoint(rectangle, pointOfRectangle);
5764
+ return getPolygonEdgeByConnectionPoint(corners, point);
5765
+ },
5766
+ getConnectorPoints(rectangle) {
5767
+ return RectangleClient.getEdgeCenterPoints(rectangle);
5768
+ }
5769
+ };
5770
+
5771
+ const ProvidedInterfaceEngine = {
5772
+ draw(board, rectangle, options) {
5773
+ const rs = PlaitBoard.getRoughSVG(board);
5774
+ const shape = rs.path(` M${rectangle.x} ${rectangle.y + rectangle.height / 2}
5775
+ H${rectangle.x + rectangle.width * 0.54}
5776
+ A${(rectangle.width * 0.46) / 2} ${rectangle.height / 2}, 0, 1, 1 ${rectangle.x + rectangle.width} ${rectangle.y +
5777
+ rectangle.height / 2}
5778
+ A${(rectangle.width * 0.46) / 2} ${rectangle.height / 2}, 0, 1, 1 ${rectangle.x + rectangle.width * 0.54} ${rectangle.y +
5779
+ rectangle.height / 2}
5780
+ `, {
5781
+ ...options,
5782
+ fillStyle: 'solid'
5783
+ });
5784
+ setStrokeLinecap(shape, 'round');
5785
+ return shape;
5786
+ },
5787
+ isInsidePoint(rectangle, point) {
5788
+ const rangeRectangle = RectangleClient.getRectangleByPoints([point, point]);
5789
+ return RectangleClient.isHit(rectangle, rangeRectangle);
5790
+ },
5791
+ getCornerPoints(rectangle) {
5792
+ return RectangleClient.getCornerPoints(rectangle);
5793
+ },
5794
+ getConnectorPoints(rectangle) {
5795
+ return RectangleClient.getEdgeCenterPoints(rectangle);
5796
+ },
5797
+ getNearestPoint(rectangle, point) {
5798
+ const nearestPoint = getNearestPointBetweenPointAndSegments(point, RectangleEngine.getCornerPoints(rectangle));
5799
+ return nearestPoint;
5800
+ },
5801
+ getTangentVectorByConnectionPoint(rectangle, pointOfRectangle) {
5802
+ const connectionPoint = RectangleClient.getConnectionPoint(rectangle, pointOfRectangle);
5803
+ const centerPoint = [rectangle.x + (rectangle.width * 3) / 4, rectangle.y + rectangle.height / 2];
5804
+ if (connectionPoint[0] > rectangle.x + rectangle.width * 0.54) {
5805
+ const point = [connectionPoint[0] - centerPoint[0], -(connectionPoint[1] - centerPoint[1])];
5806
+ const rx = (rectangle.width * 0.46) / 2;
5807
+ const ry = rectangle.height / 2;
5808
+ const slope = getEllipseTangentSlope(point[0], point[1], rx, ry);
5809
+ return getVectorFromPointAndSlope(point[0], point[1], slope);
5810
+ }
5811
+ return getUnitVectorByPointAndPoint(connectionPoint, [rectangle.x, rectangle.y + rectangle.height / 2]);
5812
+ }
5813
+ };
5814
+
5815
+ const ComponentEngine = {
5816
+ draw(board, rectangle, options) {
5817
+ const rs = PlaitBoard.getRoughSVG(board);
5818
+ const boxSize = {
5819
+ with: rectangle.width > 70 ? 24 : rectangle.width * 0.2,
5820
+ height: rectangle.height - 28 - rectangle.height * 0.35 > 1 ? 14 : rectangle.height * 0.175
5821
+ };
5822
+ const shape = rs.path(`M${rectangle.x + 12} ${rectangle.y}
5823
+ v${rectangle.height * 0.175}
5824
+ h${boxSize.with / 2} v${boxSize.height} h${-boxSize.with} v${-boxSize.height} h${boxSize.with / 2}
5825
+
5826
+ M${rectangle.x + 12} ${rectangle.y + rectangle.height * 0.175 + boxSize.height}
5827
+
5828
+ v${rectangle.height - rectangle.height * 0.35 - boxSize.height * 2}
5829
+ h${boxSize.with / 2} v${boxSize.height} h${-boxSize.with} v${-boxSize.height} h${boxSize.with / 2}
5830
+ M${rectangle.x + 12} ${rectangle.y + rectangle.height - rectangle.height * 0.175}
5831
+ V${rectangle.y + rectangle.height}
5832
+ H${rectangle.x + rectangle.width}
5833
+ v${-rectangle.height}
5834
+ h${-(rectangle.width - 12)}
5835
+ `, { ...options, fillStyle: 'solid' });
5836
+ setStrokeLinecap(shape, 'round');
5837
+ return shape;
5838
+ },
5839
+ isInsidePoint(rectangle, point) {
5840
+ const rangeRectangle = RectangleClient.getRectangleByPoints([point, point]);
5841
+ return RectangleClient.isHit(rectangle, rangeRectangle);
5842
+ },
5843
+ getCornerPoints(rectangle) {
5844
+ return RectangleClient.getCornerPoints(rectangle);
5845
+ },
5846
+ getNearestPoint(rectangle, point) {
5847
+ let nearestPoint = getNearestPointBetweenPointAndSegments(point, RectangleEngine.getCornerPoints(rectangle));
5848
+ if (nearestPoint[1] === rectangle.y + rectangle.height / 2) {
5849
+ nearestPoint = getNearestPointBetweenPointAndSegments(point, [
5850
+ [rectangle.x + 12, rectangle.y + rectangle.height * 0.175 + 14],
5851
+ [rectangle.x + 12, rectangle.y + rectangle.height - rectangle.height * 0.175 - 14]
5852
+ ], false);
5853
+ }
5854
+ return nearestPoint;
5855
+ },
5856
+ getTangentVectorByConnectionPoint(rectangle, pointOfRectangle) {
5857
+ const connectionPoint = RectangleClient.getConnectionPoint(rectangle, pointOfRectangle);
5858
+ return getUnitVectorByPointAndPoint([rectangle.x + 12, rectangle.y + rectangle.height - rectangle.height * 0.175 - 14], connectionPoint);
5859
+ },
5860
+ getConnectorPoints(rectangle) {
5861
+ return [
5862
+ [rectangle.x + rectangle.width / 2, rectangle.y],
5863
+ [rectangle.x + rectangle.width, rectangle.y + rectangle.height / 2],
5864
+ [rectangle.x + rectangle.width / 2, rectangle.y + rectangle.height],
5865
+ [rectangle.x + 12, rectangle.y + rectangle.height / 2]
5866
+ ];
5867
+ },
5868
+ getTextRectangle(element) {
5869
+ const elementRectangle = RectangleClient.getRectangleByPoints(element.points);
5870
+ const strokeWidth = getStrokeWidthByElement(element);
5871
+ const height = element.textHeight;
5872
+ const width = elementRectangle.width - 24 - ShapeDefaultSpace.rectangleAndText * 2 - strokeWidth * 2;
5873
+ return {
5874
+ height,
5875
+ width: width > 0 ? width : 0,
5876
+ x: elementRectangle.x + 24 + ShapeDefaultSpace.rectangleAndText + strokeWidth,
5877
+ y: elementRectangle.y + (elementRectangle.height - height) / 2
5878
+ };
5879
+ }
5880
+ };
5881
+
5882
+ const ComponentBoxEngine = {
5883
+ draw(board, rectangle, options) {
5884
+ const rs = PlaitBoard.getRoughSVG(board);
5885
+ const componentWidth = rectangle.width - 45 * 2 - 18 > 1 ? 45 : rectangle.width * 0.25;
5886
+ const componentHeight = rectangle.height - 30 - 8 * 2 > 1 ? 30 : rectangle.height * 0.2;
5887
+ const componentRectangle = {
5888
+ x: rectangle.x + rectangle.width - 18 - componentWidth,
5889
+ y: rectangle.y + 8,
5890
+ width: componentWidth,
5891
+ height: componentHeight
5892
+ };
5893
+ const shape = rs.path(`M${rectangle.x} ${rectangle.y}
5894
+ H${rectangle.x + rectangle.width}
5895
+ V${rectangle.y + rectangle.height}
5896
+ H${rectangle.x} Z
5897
+
5898
+ `, { ...options, fillStyle: 'solid' });
5899
+ const componentShape = ComponentEngine.draw(board, componentRectangle, options);
5900
+ shape.append(componentShape);
5901
+ setStrokeLinecap(shape, 'round');
5902
+ return shape;
5903
+ },
5904
+ isInsidePoint(rectangle, point) {
5905
+ const rangeRectangle = RectangleClient.getRectangleByPoints([point, point]);
5906
+ return RectangleClient.isHit(rectangle, rangeRectangle);
5907
+ },
5908
+ getCornerPoints(rectangle) {
5909
+ return RectangleClient.getCornerPoints(rectangle);
5910
+ },
5911
+ getNearestPoint(rectangle, point) {
5912
+ return getNearestPointBetweenPointAndSegments(point, RectangleEngine.getCornerPoints(rectangle));
5913
+ },
5914
+ getEdgeByConnectionPoint(rectangle, pointOfRectangle) {
5915
+ const corners = RectangleEngine.getCornerPoints(rectangle);
5916
+ const point = RectangleClient.getConnectionPoint(rectangle, pointOfRectangle);
5917
+ return getPolygonEdgeByConnectionPoint(corners, point);
5918
+ },
5919
+ getConnectorPoints(rectangle) {
5920
+ return RectangleClient.getEdgeCenterPoints(rectangle);
5921
+ },
5922
+ getTextRectangle(element) {
5923
+ const elementRectangle = RectangleClient.getRectangleByPoints(element.points);
5924
+ const strokeWidth = getStrokeWidthByElement(element);
5925
+ const height = element.textHeight;
5926
+ const componentWidth = elementRectangle.width - 45 * 2 - 18 > 1 ? 45 : elementRectangle.width * 0.25;
5927
+ const width = elementRectangle.width - 18 - componentWidth - ShapeDefaultSpace.rectangleAndText - strokeWidth * 2;
5928
+ return {
5929
+ height,
5930
+ width: width > 0 ? width : 0,
5931
+ x: elementRectangle.x + ShapeDefaultSpace.rectangleAndText + strokeWidth,
5932
+ y: elementRectangle.y + (elementRectangle.height - height) / 2
5933
+ };
5934
+ }
5935
+ };
5936
+
5937
+ const TemplateEngine = {
5938
+ draw(board, rectangle, options) {
5939
+ const rs = PlaitBoard.getRoughSVG(board);
5940
+ return drawRoundRectangle(rs, rectangle.x, rectangle.y, rectangle.x + rectangle.width, rectangle.y + rectangle.height, {
5941
+ ...options,
5942
+ fillStyle: 'solid',
5943
+ dashGap: 10,
5944
+ strokeLineDash: [10, 10]
5945
+ }, false, 4);
5946
+ },
5947
+ isInsidePoint(rectangle, point) {
5948
+ const rangeRectangle = RectangleClient.getRectangleByPoints([point, point]);
5949
+ return RectangleClient.isHit(rectangle, rangeRectangle);
5950
+ },
5951
+ getCornerPoints(rectangle) {
5952
+ return RectangleClient.getCornerPoints(rectangle);
5953
+ },
5954
+ getNearestPoint(rectangle, point) {
5955
+ return getNearestPointBetweenPointAndSegments(point, RectangleEngine.getCornerPoints(rectangle));
5956
+ },
5957
+ getEdgeByConnectionPoint(rectangle, pointOfRectangle) {
5958
+ const corners = RectangleEngine.getCornerPoints(rectangle);
5959
+ const point = RectangleClient.getConnectionPoint(rectangle, pointOfRectangle);
5960
+ return getPolygonEdgeByConnectionPoint(corners, point);
5961
+ },
5962
+ getConnectorPoints(rectangle) {
5963
+ return RectangleClient.getEdgeCenterPoints(rectangle);
5964
+ },
5965
+ getTextRectangle(element) {
5966
+ const elementRectangle = RectangleClient.getRectangleByPoints(element.points);
5967
+ const strokeWidth = getStrokeWidthByElement(element);
5968
+ const height = element.textHeight;
5969
+ const width = elementRectangle.width - ShapeDefaultSpace.rectangleAndText * 2 - strokeWidth * 2;
5970
+ return {
5971
+ height,
5972
+ width: width > 0 ? width : 0,
5973
+ x: elementRectangle.x + ShapeDefaultSpace.rectangleAndText + strokeWidth,
5974
+ y: elementRectangle.y + (elementRectangle.height - height) / 2
5975
+ };
5976
+ }
5977
+ };
5978
+
5385
5979
  const ShapeEngineMap = {
5386
5980
  [BasicShapes.rectangle]: RectangleEngine,
5387
5981
  [BasicShapes.diamond]: DiamondEngine,
@@ -5444,8 +6038,14 @@ const ShapeEngineMap = {
5444
6038
  [UMLSymbols.deletion]: DeletionEngine,
5445
6039
  [UMLSymbols.activityClass]: ActiveClassEngine,
5446
6040
  [UMLSymbols.simpleClass]: RectangleEngine,
6041
+ [UMLSymbols.component]: ComponentEngine,
6042
+ [UMLSymbols.componentBox]: ComponentBoxEngine,
6043
+ [UMLSymbols.template]: TemplateEngine,
5447
6044
  [UMLSymbols.port]: RectangleEngine,
5448
- [UMLSymbols.branchMerge]: DiamondEngine
6045
+ [UMLSymbols.branchMerge]: DiamondEngine,
6046
+ [UMLSymbols.assembly]: AssemblyEngine,
6047
+ [UMLSymbols.requiredInterface]: RequiredInterfaceEngine,
6048
+ [UMLSymbols.providedInterface]: ProvidedInterfaceEngine
5449
6049
  };
5450
6050
  const getEngine = (shape) => {
5451
6051
  return ShapeEngineMap[shape];
@@ -5670,7 +6270,8 @@ const PlaitDrawElement = {
5670
6270
  if (PlaitDrawElement.isGeometry(value) ||
5671
6271
  PlaitDrawElement.isLine(value) ||
5672
6272
  PlaitDrawElement.isImage(value) ||
5673
- PlaitTableElement.isTable(value)) {
6273
+ PlaitDrawElement.isTable(value) ||
6274
+ PlaitDrawElement.isSwimlane(value)) {
5674
6275
  return true;
5675
6276
  }
5676
6277
  else {
@@ -5678,7 +6279,7 @@ const PlaitDrawElement = {
5678
6279
  }
5679
6280
  },
5680
6281
  isShapeElement: (value) => {
5681
- return PlaitDrawElement.isImage(value) || PlaitDrawElement.isGeometry(value) || PlaitDrawElement.isTable(value);
6282
+ return PlaitDrawElement.isImage(value) || PlaitDrawElement.isGeometry(value) || PlaitDrawElement.isTable(value) || PlaitDrawElement.isSwimlane(value);
5682
6283
  },
5683
6284
  isBasicShape: (value) => {
5684
6285
  return Object.keys(BasicShapes).includes(value.shape);
@@ -5690,17 +6291,23 @@ const PlaitDrawElement = {
5690
6291
  return Object.keys(UMLSymbols).includes(value.shape);
5691
6292
  },
5692
6293
  isSwimlane: (value) => {
5693
- return Object.keys(SwimlaneSymbols).includes(value.shape);
6294
+ return value.type === 'swimlane';
5694
6295
  },
5695
6296
  isVerticalSwimlane: (value) => {
5696
- return Object.keys(SwimlaneSymbols).includes(value.shape) && value.shape === SwimlaneSymbols.swimlaneVertical;
6297
+ return PlaitDrawElement.isSwimlane(value) && value.shape === SwimlaneSymbols.swimlaneVertical;
5697
6298
  },
5698
6299
  isHorizontalSwimlane: (value) => {
5699
- return Object.keys(SwimlaneSymbols).includes(value.shape) && value.shape === SwimlaneSymbols.swimlaneHorizontal;
6300
+ return PlaitDrawElement.isSwimlane(value) && value.shape === SwimlaneSymbols.swimlaneHorizontal;
5700
6301
  },
5701
6302
  isUMLClassOrInterface: (value) => {
5702
6303
  return Object.keys(UMLSymbols).includes(value.shape) && [UMLSymbols.class, UMLSymbols.interface].includes(value.shape);
5703
- }
6304
+ },
6305
+ isGeometryByTable: (value) => {
6306
+ return PlaitDrawElement.isUMLClassOrInterface(value);
6307
+ },
6308
+ isElementByTable: (value) => {
6309
+ return PlaitDrawElement.isTable(value) || PlaitDrawElement.isSwimlane(value) || PlaitDrawElement.isGeometryByTable(value);
6310
+ },
5704
6311
  };
5705
6312
 
5706
6313
  class GeometryShapeGenerator extends Generator {
@@ -6177,9 +6784,13 @@ class TableGenerator extends Generator {
6177
6784
  }
6178
6785
  draw(element, data) {
6179
6786
  const rectangle = RectangleClient.getRectangleByPoints(element.points);
6787
+ const strokeLineDash = getLineDashByElement(element);
6788
+ const strokeWidth = getStrokeWidthByElement(element);
6789
+ const strokeColor = getStrokeColorByElement(this.board, element);
6180
6790
  return getEngine(TableSymbols.table).draw(this.board, rectangle, {
6181
- strokeWidth: 2,
6182
- stroke: getDrawDefaultStrokeColor(this.board.theme.themeColorMode),
6791
+ strokeWidth,
6792
+ stroke: strokeColor,
6793
+ strokeLineDash,
6183
6794
  }, {
6184
6795
  element: element
6185
6796
  });
@@ -6368,7 +6979,7 @@ const withGeometryCreateByDrawing = (board) => {
6368
6979
 
6369
6980
  const buildClipboardData = (board, elements, startPoint) => {
6370
6981
  return elements.map(element => {
6371
- if (PlaitDrawElement.isGeometry(element) || PlaitDrawElement.isImage(element) || PlaitDrawElement.isTable(element)) {
6982
+ if (PlaitDrawElement.isShapeElement(element)) {
6372
6983
  const points = element.points.map(point => [point[0] - startPoint[0], point[1] - startPoint[1]]);
6373
6984
  return { ...element, points };
6374
6985
  }
@@ -6398,37 +7009,28 @@ const buildClipboardData = (board, elements, startPoint) => {
6398
7009
  };
6399
7010
  const insertClipboardData = (board, elements, startPoint) => {
6400
7011
  const lines = elements.filter(value => PlaitDrawElement.isLine(value));
6401
- const geometries = elements.filter(value => PlaitDrawElement.isGeometry(value) || PlaitDrawElement.isImage(value));
6402
- const tables = elements.filter(value => PlaitDrawElement.isTable(value));
7012
+ const geometries = elements.filter(value => (PlaitDrawElement.isGeometry(value) && !PlaitDrawElement.isGeometryByTable(value)) || PlaitDrawElement.isImage(value));
7013
+ const tables = elements.filter(value => PlaitDrawElement.isElementByTable(value));
6403
7014
  geometries.forEach(element => {
6404
- const sourceLines = [];
6405
- const targetLines = [];
6406
- lines.forEach(line => {
6407
- if (PlaitLine.isBoundElementOfSource(line, element)) {
6408
- sourceLines.push(line);
6409
- }
6410
- if (PlaitLine.isBoundElementOfTarget(line, element)) {
6411
- targetLines.push(line);
6412
- }
6413
- });
6414
- element.id = idCreator();
6415
- // update lines
6416
- sourceLines.forEach(sourceLine => (sourceLine.source.boundId = element.id));
6417
- targetLines.forEach(targetLine => (targetLine.target.boundId = element.id));
7015
+ const newId = idCreator();
7016
+ updateBoundLinesId(element, lines, newId);
7017
+ element.id = newId;
6418
7018
  element.points = element.points.map(point => [startPoint[0] + point[0], startPoint[1] + point[1]]);
6419
7019
  Transforms.insertNode(board, element, [board.children.length]);
6420
7020
  });
7021
+ insertClipboardTableData(board, tables, startPoint, lines);
6421
7022
  lines.forEach(element => {
6422
7023
  element.id = idCreator();
6423
7024
  element.points = element.points.map(point => [startPoint[0] + point[0], startPoint[1] + point[1]]);
6424
7025
  Transforms.insertNode(board, element, [board.children.length]);
6425
7026
  });
6426
- insertClipboardTableData(board, tables, startPoint);
6427
7027
  Transforms.addSelectionWithTemporaryElements(board, elements);
6428
7028
  };
6429
- const insertClipboardTableData = (board, elements, startPoint) => {
7029
+ const insertClipboardTableData = (board, elements, startPoint, lines) => {
6430
7030
  elements.forEach(element => {
6431
- element.id = idCreator();
7031
+ const newId = idCreator();
7032
+ updateBoundLinesId(element, lines, newId);
7033
+ element.id = newId;
6432
7034
  updateRowOrColumnIds(element, 'row');
6433
7035
  updateRowOrColumnIds(element, 'column');
6434
7036
  updateCellIds(element.cells);
@@ -6436,6 +7038,21 @@ const insertClipboardTableData = (board, elements, startPoint) => {
6436
7038
  Transforms.insertNode(board, element, [board.children.length]);
6437
7039
  });
6438
7040
  };
7041
+ const updateBoundLinesId = (element, lines, newId) => {
7042
+ const sourceLines = [];
7043
+ const targetLines = [];
7044
+ lines.forEach(line => {
7045
+ if (PlaitLine.isBoundElementOfSource(line, element)) {
7046
+ sourceLines.push(line);
7047
+ }
7048
+ if (PlaitLine.isBoundElementOfTarget(line, element)) {
7049
+ targetLines.push(line);
7050
+ }
7051
+ });
7052
+ // update lines
7053
+ sourceLines.forEach(sourceLine => (sourceLine.source.boundId = newId));
7054
+ targetLines.forEach(targetLine => (targetLine.target.boundId = newId));
7055
+ };
6439
7056
 
6440
7057
  const withDrawFragment = (baseBoard) => {
6441
7058
  const board = baseBoard;
@@ -6447,16 +7064,19 @@ const withDrawFragment = (baseBoard) => {
6447
7064
  const lineElements = drawElements.filter(value => PlaitDrawElement.isLine(value));
6448
7065
  const imageElements = drawElements.filter(value => PlaitDrawElement.isImage(value));
6449
7066
  const tableElements = drawElements.filter(value => PlaitDrawElement.isTable(value));
7067
+ const swimlaneElements = drawElements.filter(value => PlaitDrawElement.isSwimlane(value));
6450
7068
  const boundLineElements = [
6451
7069
  ...getBoundedLineElements(board, geometryElements),
6452
7070
  ...getBoundedLineElements(board, imageElements),
6453
- ...getBoundedLineElements(board, tableElements)
7071
+ ...getBoundedLineElements(board, tableElements),
7072
+ ...getBoundedLineElements(board, swimlaneElements)
6454
7073
  ].filter(line => !lineElements.includes(line));
6455
7074
  data.push(...[
6456
7075
  ...geometryElements,
6457
7076
  ...lineElements,
6458
7077
  ...imageElements,
6459
7078
  ...tableElements,
7079
+ ...swimlaneElements,
6460
7080
  ...boundLineElements.filter(line => !lineElements.includes(line))
6461
7081
  ]);
6462
7082
  }
@@ -6930,7 +7550,7 @@ class ImageComponent extends CommonElementFlavour {
6930
7550
  }
6931
7551
  else {
6932
7552
  const hasSameSelected = value.selected === previous.selected;
6933
- const hasSameHandleState = this.activeGenerator.options.hasResizeHandle() === this.activeGenerator.hasResizeHandle;
7553
+ const hasSameHandleState = this.activeGenerator && this.activeGenerator.options.hasResizeHandle() === this.activeGenerator.hasResizeHandle;
6934
7554
  if (!hasSameSelected || !hasSameHandleState) {
6935
7555
  this.imageGenerator.componentRef.instance.isFocus = this.selected;
6936
7556
  this.lineAutoCompleteGenerator.processDrawing(this.element, PlaitBoard.getElementActiveHost(this.board), {
@@ -7231,9 +7851,17 @@ class TableComponent extends CommonElementFlavour {
7231
7851
  return 1;
7232
7852
  },
7233
7853
  getRectangle: (value) => {
7854
+ const cells = getSelectedCells(value);
7855
+ if (cells?.length) {
7856
+ return getCellsRectangle(this.board, this.element, cells);
7857
+ }
7234
7858
  return RectangleClient.getRectangleByPoints(value.points);
7235
7859
  },
7236
7860
  hasResizeHandle: () => {
7861
+ const cells = getSelectedCells(this.element);
7862
+ if (cells?.length) {
7863
+ return false;
7864
+ }
7237
7865
  return canResize(this.board, this.element);
7238
7866
  }
7239
7867
  });
@@ -7256,7 +7884,8 @@ class TableComponent extends CommonElementFlavour {
7256
7884
  });
7257
7885
  }
7258
7886
  rotateVerticalText() {
7259
- this.element.cells.forEach(item => {
7887
+ const table = this.board.buildTable(this.element);
7888
+ table.cells.forEach(item => {
7260
7889
  if (PlaitTableElement.isVerticalText(item)) {
7261
7890
  const textManage = getTextManage(item.id);
7262
7891
  if (textManage) {
@@ -7313,7 +7942,13 @@ class TableComponent extends CommonElementFlavour {
7313
7942
  this.textGenerator.initialize();
7314
7943
  }
7315
7944
  onContextChanged(value, previous) {
7316
- if (value.element !== previous.element) {
7945
+ const isChangeTheme = this.board.operations.find(op => op.type === 'set_theme');
7946
+ if (value.element !== previous.element || isChangeTheme) {
7947
+ const previousSelectedCells = getSelectedCells(previous.element);
7948
+ if (previousSelectedCells?.length) {
7949
+ clearSelectedCells(previous.element);
7950
+ setSelectedCells(value.element, previousSelectedCells);
7951
+ }
7317
7952
  this.tableGenerator.processDrawing(value.element, this.getElementG());
7318
7953
  this.activeGenerator.processDrawing(value.element, PlaitBoard.getElementActiveHost(this.board), { selected: this.selected });
7319
7954
  const previousTexts = this.getDrawShapeTexts(previous.element.cells);
@@ -7324,11 +7959,15 @@ class TableComponent extends CommonElementFlavour {
7324
7959
  else {
7325
7960
  const hasSameSelected = value.selected === previous.selected;
7326
7961
  const hasSameHandleState = this.activeGenerator.options.hasResizeHandle() === this.activeGenerator.hasResizeHandle;
7327
- if (!hasSameSelected || !hasSameHandleState) {
7962
+ const currentSelectedCells = getSelectedCells(value.element);
7963
+ if (!hasSameSelected || !hasSameHandleState || currentSelectedCells?.length) {
7328
7964
  this.activeGenerator.processDrawing(value.element, PlaitBoard.getElementActiveHost(this.board), {
7329
7965
  selected: this.selected
7330
7966
  });
7331
7967
  }
7968
+ if (!this.selected) {
7969
+ clearSelectedCells(value.element);
7970
+ }
7332
7971
  }
7333
7972
  this.lineAutoCompleteGenerator.processDrawing(this.element, PlaitBoard.getElementActiveHost(this.board), {
7334
7973
  selected: this.selected
@@ -7353,12 +7992,13 @@ function withTableResize(board) {
7353
7992
  },
7354
7993
  hitTest: (point) => {
7355
7994
  const hitElement = getHitElementByPoint(board, point);
7356
- if (hitElement && PlaitTableElement.isTable(hitElement)) {
7995
+ if (hitElement && PlaitDrawElement.isElementByTable(hitElement)) {
7357
7996
  let rectangle = board.getRectangle(hitElement);
7358
7997
  let handleRef = getHitRectangleResizeHandleRef(board, rectangle, point, hitElement.angle);
7359
7998
  if (handleRef) {
7360
7999
  const selectElement = isSelectedElement(board, hitElement);
7361
- if ((selectElement && isSingleSelectTable(board)) || (!selectElement && !isCornerHandle(board, handleRef.handle))) {
8000
+ if ((selectElement && isSingleSelectElementByTable(board)) ||
8001
+ (!selectElement && !isCornerHandle(board, handleRef.handle))) {
7362
8002
  return {
7363
8003
  element: hitElement,
7364
8004
  handle: handleRef.handle,
@@ -7467,48 +8107,65 @@ function withTableResize(board) {
7467
8107
 
7468
8108
  const withTable = (board) => {
7469
8109
  const tableBoard = board;
7470
- const { drawElement, getRectangle, isRectangleHit, isHit, isMovable, dblClick } = tableBoard;
8110
+ const { drawElement, getRectangle, isRectangleHit, isHit, isMovable, dblClick, keyDown } = tableBoard;
7471
8111
  tableBoard.drawElement = (context) => {
7472
- if (PlaitTableElement.isTable(context.element)) {
8112
+ if (PlaitDrawElement.isElementByTable(context.element)) {
7473
8113
  return TableComponent;
7474
8114
  }
7475
8115
  return drawElement(context);
7476
8116
  };
7477
8117
  tableBoard.isHit = (element, point) => {
7478
- if (PlaitTableElement.isTable(element)) {
8118
+ if (PlaitDrawElement.isElementByTable(element)) {
7479
8119
  const client = RectangleClient.getRectangleByPoints(element.points);
7480
8120
  return RectangleClient.isPointInRectangle(client, point);
7481
8121
  }
7482
8122
  return isHit(element, point);
7483
8123
  };
7484
8124
  tableBoard.getRectangle = (element) => {
7485
- if (PlaitTableElement.isTable(element)) {
8125
+ if (PlaitDrawElement.isElementByTable(element)) {
7486
8126
  return RectangleClient.getRectangleByPoints(element.points);
7487
8127
  }
7488
8128
  return getRectangle(element);
7489
8129
  };
7490
8130
  tableBoard.isMovable = (element) => {
7491
- if (PlaitTableElement.isTable(element)) {
8131
+ if (PlaitDrawElement.isElementByTable(element)) {
7492
8132
  return true;
7493
8133
  }
7494
8134
  return isMovable(element);
7495
8135
  };
7496
8136
  tableBoard.isRectangleHit = (element, selection) => {
7497
- if (PlaitTableElement.isTable(element)) {
8137
+ if (PlaitDrawElement.isElementByTable(element)) {
7498
8138
  const rangeRectangle = RectangleClient.getRectangleByPoints([selection.anchor, selection.focus]);
7499
8139
  return isPolylineHitRectangle(element.points, rangeRectangle);
7500
8140
  }
7501
8141
  return isRectangleHit(element, selection);
7502
8142
  };
8143
+ tableBoard.keyDown = (event) => {
8144
+ const selectedElements = getSelectedElements(board);
8145
+ const isSingleSelection = selectedElements.length === 1;
8146
+ const targetElement = selectedElements[0];
8147
+ if (!PlaitBoard.isReadonly(board) && !isVirtualKey(event) && !isDelete(event) && !isSpaceHotkey(event) && isSingleSelection) {
8148
+ event.preventDefault();
8149
+ if (PlaitDrawElement.isElementByTable(targetElement)) {
8150
+ const firstTextCell = targetElement.cells.find(item => item.text && item.textHeight);
8151
+ if (firstTextCell) {
8152
+ editCell(firstTextCell);
8153
+ return;
8154
+ }
8155
+ }
8156
+ }
8157
+ keyDown(event);
8158
+ };
7503
8159
  tableBoard.dblClick = (event) => {
7504
8160
  event.preventDefault();
7505
8161
  if (!PlaitBoard.isReadonly(board)) {
7506
8162
  const point = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
7507
8163
  const hitElement = getHitElementByPoint(board, point);
7508
- if (hitElement && PlaitTableElement.isTable(hitElement)) {
8164
+ if (hitElement && PlaitDrawElement.isElementByTable(hitElement)) {
7509
8165
  const hitCell = getHitCell(tableBoard, hitElement, point);
7510
8166
  if (hitCell && hitCell.text && hitCell.textHeight) {
7511
8167
  editCell(hitCell);
8168
+ return;
7512
8169
  }
7513
8170
  }
7514
8171
  }
@@ -7520,129 +8177,6 @@ const withTable = (board) => {
7520
8177
  return withTableResize(tableBoard);
7521
8178
  };
7522
8179
 
7523
- function buildSwimlaneTable(element) {
7524
- const swimlaneElement = { ...element };
7525
- if (PlaitDrawElement.isHorizontalSwimlane(element)) {
7526
- swimlaneElement.cells = element.cells.map((item, index) => {
7527
- if (index === 0) {
7528
- item = {
7529
- ...element.cells[0],
7530
- rowspan: element.rows.length
7531
- };
7532
- }
7533
- if (item.text && item.textHeight && !item.text.direction) {
7534
- item = {
7535
- ...item,
7536
- text: {
7537
- ...item.text,
7538
- direction: 'vertical'
7539
- }
7540
- };
7541
- }
7542
- return item;
7543
- });
7544
- return swimlaneElement;
7545
- }
7546
- swimlaneElement.cells = [
7547
- {
7548
- ...element.cells[0],
7549
- colspan: element.columns.length
7550
- },
7551
- ...element.cells.slice(1, element.cells.length)
7552
- ];
7553
- return swimlaneElement;
7554
- }
7555
- const getDefaultSWimlanePoints = (pointer, centerPoint) => {
7556
- const property = DefaultSwimlanePropertyMap[pointer];
7557
- return RectangleClient.getPoints(RectangleClient.getRectangleByCenterPoint(centerPoint, property.width, property.height));
7558
- };
7559
- const createDefaultSwimlane = (shape, points) => {
7560
- const rows = createDefaultRowsOrColumns(shape, 'row');
7561
- const columns = createDefaultRowsOrColumns(shape, 'column');
7562
- const swimlane = {
7563
- id: idCreator(),
7564
- type: 'table',
7565
- shape,
7566
- points,
7567
- rows,
7568
- columns,
7569
- cells: createDefaultCells(shape, rows, columns)
7570
- };
7571
- return buildSwimlaneTable(swimlane);
7572
- };
7573
- const createDefaultRowsOrColumns = (shape, type) => {
7574
- let data = new Array(3).fill('').map(item => {
7575
- return { id: idCreator() };
7576
- });
7577
- if (type === 'row' && shape === SwimlaneSymbols.swimlaneVertical) {
7578
- data = data.map((item, index) => {
7579
- if (index === 0 || index === 1) {
7580
- return {
7581
- ...item,
7582
- height: 30
7583
- };
7584
- }
7585
- return item;
7586
- });
7587
- }
7588
- if (type === 'column' && shape === SwimlaneSymbols.swimlaneHorizontal) {
7589
- data = data.map((item, index) => {
7590
- if (index === 0 || index === 1) {
7591
- return {
7592
- ...item,
7593
- width: 30
7594
- };
7595
- }
7596
- return item;
7597
- });
7598
- }
7599
- return data;
7600
- };
7601
- const createDefaultCells = (shape, rows, columns) => {
7602
- return new Array(7).fill('').map((item, index) => {
7603
- if (index === 0) {
7604
- item = {
7605
- id: idCreator(),
7606
- rowId: rows[0].id,
7607
- columnId: columns[0].id,
7608
- textHeight: DEFAULT_TEXT_HEIGHT,
7609
- text: {
7610
- children: [
7611
- {
7612
- text: 'New Swimlane'
7613
- }
7614
- ],
7615
- align: 'center'
7616
- }
7617
- };
7618
- }
7619
- if ([1, 2, 3].includes(index)) {
7620
- item = {
7621
- id: idCreator(),
7622
- rowId: shape === SwimlaneSymbols.swimlaneVertical ? rows[1].id : rows[index - 1].id,
7623
- columnId: shape === SwimlaneSymbols.swimlaneVertical ? columns[index - 1].id : columns[1].id,
7624
- textHeight: DEFAULT_TEXT_HEIGHT,
7625
- text: {
7626
- children: [
7627
- {
7628
- text: 'Lane'
7629
- }
7630
- ],
7631
- align: 'center'
7632
- }
7633
- };
7634
- }
7635
- if ([4, 5, 6].includes(index)) {
7636
- item = {
7637
- id: idCreator(),
7638
- rowId: shape === SwimlaneSymbols.swimlaneVertical ? rows[2].id : rows[index - 4].id,
7639
- columnId: shape === SwimlaneSymbols.swimlaneVertical ? columns[index - 4].id : columns[2].id
7640
- };
7641
- }
7642
- return item;
7643
- });
7644
- };
7645
-
7646
8180
  const isSwimlaneDndMode = (board) => {
7647
8181
  const swimlanePointers = getSwimlanePointers();
7648
8182
  const isSwimlanePointer = PlaitBoard.isInPointer(board, swimlanePointers);
@@ -7667,7 +8201,7 @@ const withSwimlaneCreateByDrag = (board) => {
7667
8201
  const movingPoint = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
7668
8202
  const pointer = PlaitBoard.getPointer(board);
7669
8203
  if (dragMode) {
7670
- const points = getDefaultSWimlanePoints(pointer, movingPoint);
8204
+ const points = getDefaultSwimlanePoints(pointer, movingPoint);
7671
8205
  temporaryElement = createDefaultSwimlane(pointer, points);
7672
8206
  tableGenerator.processDrawing(temporaryElement, swimlaneG);
7673
8207
  PlaitBoard.getElementActiveHost(board).append(swimlaneG);
@@ -7748,7 +8282,7 @@ const withSwimlaneCreateByDrawing = (board) => {
7748
8282
  const { width, height } = RectangleClient.getRectangleByPoints([start, targetPoint]);
7749
8283
  if (Math.hypot(width, height) < 8) {
7750
8284
  const pointer = PlaitBoard.getPointer(board);
7751
- const points = getDefaultSWimlanePoints(pointer, targetPoint);
8285
+ const points = getDefaultSwimlanePoints(pointer, targetPoint);
7752
8286
  temporaryElement = createDefaultSwimlane(pointer, points);
7753
8287
  }
7754
8288
  if (temporaryElement) {
@@ -7768,7 +8302,7 @@ const withSwimlaneCreateByDrawing = (board) => {
7768
8302
  };
7769
8303
 
7770
8304
  const withSwimlane = (board) => {
7771
- const { drawElement, buildTable } = board;
8305
+ const { drawElement, buildTable, pointerUp } = board;
7772
8306
  board.drawElement = (context) => {
7773
8307
  if (PlaitDrawElement.isSwimlane(context.element)) {
7774
8308
  return TableComponent;
@@ -7781,6 +8315,23 @@ const withSwimlane = (board) => {
7781
8315
  }
7782
8316
  return buildTable(element);
7783
8317
  };
8318
+ board.pointerUp = (event) => {
8319
+ const isSetSelectionPointer = PlaitBoard.isPointer(board, PlaitPointerType.selection) || PlaitBoard.isPointer(board, PlaitPointerType.hand);
8320
+ const isSkip = !isMainPointer(event) || isDragging(board) || !isSetSelectionPointer;
8321
+ if (isSkip) {
8322
+ pointerUp(event);
8323
+ return;
8324
+ }
8325
+ if (isSingleSelectSwimlane(board)) {
8326
+ const point = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
8327
+ const element = getSelectedSwimlane(board);
8328
+ const hitCell = getHitCell(board, element, point);
8329
+ if (hitCell && hitCell.text && hitCell.textHeight) {
8330
+ setSelectedCells(element, [hitCell]);
8331
+ }
8332
+ }
8333
+ pointerUp(event);
8334
+ };
7784
8335
  return withSwimlaneCreateByDrawing(withSwimlaneCreateByDrag(board));
7785
8336
  };
7786
8337
 
@@ -7889,5 +8440,5 @@ const withDraw = (board) => {
7889
8440
  * Generated bundle index. Do not edit.
7890
8441
  */
7891
8442
 
7892
- export { BasicShapes, DEFAULT_IMAGE_WIDTH, DEFAULT_TEXT_HEIGHT, DefaultActivationProperty, DefaultActorProperty, DefaultArrowProperty, DefaultBasicShapeProperty, DefaultBasicShapePropertyMap, DefaultClassProperty, DefaultCloudProperty, DefaultCombinedFragmentProperty, DefaultConnectorProperty, DefaultContainerProperty, DefaultDataBaseProperty, DefaultDataProperty, DefaultDecisionProperty, DefaultDeletionProperty, DefaultDocumentProperty, DefaultDrawActiveStyle, DefaultDrawStyle, DefaultFlowchartProperty, DefaultFlowchartPropertyMap, DefaultInterfaceProperty, DefaultInternalStorageProperty, DefaultManualInputProperty, DefaultMergeProperty, DefaultMultiDocumentProperty, DefaultNoteProperty, DefaultObjectProperty, DefaultPackageProperty, DefaultPentagonArrowProperty, DefaultPortProperty, DefaultSwimlaneHorizontalProperty, DefaultSwimlanePropertyMap, DefaultSwimlaneVerticalProperty, DefaultTextProperty, DefaultTwoWayArrowProperty, DefaultUMLPropertyMap, DrawThemeColors, DrawTransforms, FlowchartSymbols, GEOMETRY_WITHOUT_TEXT, GEOMETRY_WITH_MULTIPLE_TEXT, GeometryComponent, GeometryShapeGenerator, GeometryThreshold, KEY_TO_TEXT_MANAGE, LINE_HIT_GEOMETRY_BUFFER, LINE_SNAPPING_BUFFER, LINE_SNAPPING_CONNECTOR_BUFFER, LineActiveGenerator, LineAutoCompleteGenerator, LineComponent, LineHandleKey, LineMarkerType, LineShape, MemorizeKey, MultipleTextGeometryCommonTextKeys, MultipleTextGeometryTextKeys, PlaitDrawElement, PlaitGeometry, PlaitLine, Q2C, ShapeDefaultSpace, SingleTextGenerator, StrokeStyle, SwimlaneSymbols, TableGenerator, TableSymbols, TextGenerator, UMLSymbols, WithLineAutoCompletePluginKey, alignElbowSegment, alignPoints, buildDefaultTextsByShape, createDefaultFlowchart, createDefaultGeometry, createGeometryElement, createGeometryElementWithText, createGeometryElementWithoutText, createLineElement, createMultipleTextGeometryElement, createTextElement, createUMLClassOrInterfaceGeometryElement, debugGenerator$1 as debugGenerator, deleteTextManage, drawBoundReaction, drawGeometry, drawLine, drawLineArrow, drawShape, editText, getAutoCompletePoints, getBasicPointers, getCenterPointsOnPolygon$1 as getCenterPointsOnPolygon, getConnectionPoint, getCurvePoints, getDefaultBasicShapeProperty, getDefaultFlowchartProperty, getDefaultGeometryPoints, getDefaultGeometryProperty, getDefaultTextPoints, getDefaultUMLProperty, getDrawDefaultStrokeColor, getElbowLineRouteOptions, getElbowPoints, getFillByElement, getFlowchartDefaultFill, getFlowchartPointers, getGeometryAlign, getGeometryPointers, getHitConnection, getHitConnectorPoint, getHitIndexOfAutoCompletePoint, getHitMultipleGeometryText, getHitShape, getIndexAndDeleteCountByKeyPoint, getLineDashByElement, getLineHandleRefPair, getLineMemorizedLatest, getLinePointers, getLinePoints, getLineTextRectangle, getLines, getMemorizeKey, getMemorizedLatestByPointer, getMemorizedLatestShape, getMidKeyPoints, getMiddlePoints, getMirrorDataPoints, getMultipleTextGeometryTextKeys, getNearestPoint, getNextRenderPoints, getNextSourceAndTargetPoints, getResizedPreviousAndNextPoint, getSelectedDrawElements, getSelectedGeometryElements, getSelectedImageElements, getSelectedLineElements, getSelectedTableElements, getSnapResizingRef, getSnapResizingRefOptions, getSnappingRef, getSnappingShape, getSourceAndTargetRectangle, getStrokeColorByElement, getStrokeStyleByElement, getStrokeWidthByElement, getSwimlanePointers, getTextKey, getTextManage, getTextRectangle, getTextShapeProperty, getUMLPointers, getVectorByConnection, handleLineCreating, hasIllegalElbowPoint, insertElement, isDrawElementIncludeText, isDrawElementsIncludeText, isGeometryIncludeText, isHitDrawElement, isHitEdgeOfShape, isHitElementInside, isHitElementText, isHitLine, isHitLineText, isHitPolyLine, isInsideOfShape, isMultipleTextGeometry, isMultipleTextShape, isRectangleHitDrawElement, isRectangleHitElementText, isSelfLoop, isSingleSelectSwimlane, isSingleSelectTable, isSingleTextGeometry, isSingleTextShape, isTextExceedingBounds, isUpdatedHandleIndex, isUseDefaultOrthogonalRoute, memorizeLatestShape, memorizeLatestText, rerenderGeometryActive, setTextManage, traverseDrawShapes, withDraw, withLineAutoComplete };
8443
+ export { BasicShapes, DEFAULT_IMAGE_WIDTH, DEFAULT_TEXT_HEIGHT, DefaultActivationProperty, DefaultActorProperty, DefaultArrowProperty, DefaultAssemblyProperty, DefaultBasicShapeProperty, DefaultBasicShapePropertyMap, DefaultClassProperty, DefaultCloudProperty, DefaultCombinedFragmentProperty, DefaultComponentBoxProperty, DefaultConnectorProperty, DefaultContainerProperty, DefaultDataBaseProperty, DefaultDataProperty, DefaultDecisionProperty, DefaultDeletionProperty, DefaultDocumentProperty, DefaultDrawActiveStyle, DefaultDrawStyle, DefaultFlowchartProperty, DefaultFlowchartPropertyMap, DefaultInterfaceProperty, DefaultInternalStorageProperty, DefaultManualInputProperty, DefaultMergeProperty, DefaultMultiDocumentProperty, DefaultNoteProperty, DefaultObjectProperty, DefaultPackageProperty, DefaultPentagonArrowProperty, DefaultPortProperty, DefaultProvidedInterfaceProperty, DefaultRequiredInterfaceProperty, DefaultSwimlaneHorizontalProperty, DefaultSwimlaneHorizontalWithHeaderProperty, DefaultSwimlanePropertyMap, DefaultSwimlaneVerticalProperty, DefaultSwimlaneVerticalWithHeaderProperty, DefaultTextProperty, DefaultTwoWayArrowProperty, DefaultUMLPropertyMap, DrawThemeColors, DrawTransforms, FlowchartSymbols, GEOMETRY_WITHOUT_TEXT, GEOMETRY_WITH_MULTIPLE_TEXT, GeometryComponent, GeometryShapeGenerator, GeometryThreshold, KEY_TO_TEXT_MANAGE, LINE_HIT_GEOMETRY_BUFFER, LINE_SNAPPING_BUFFER, LINE_SNAPPING_CONNECTOR_BUFFER, LineActiveGenerator, LineAutoCompleteGenerator, LineComponent, LineHandleKey, LineMarkerType, LineShape, MemorizeKey, MultipleTextGeometryCommonTextKeys, MultipleTextGeometryTextKeys, PlaitDrawElement, PlaitGeometry, PlaitLine, PlaitTableElement, Q2C, SELECTED_CELLS, SWIMLANE_HEADER_SIZE, ShapeDefaultSpace, SingleTextGenerator, StrokeStyle, SwimlaneDrawSymbols, SwimlaneSymbols, TableGenerator, TableSymbols, TextGenerator, UMLSymbols, WithLineAutoCompletePluginKey, adjustSwimlaneShape, alignElbowSegment, alignPoints, buildDefaultTextsByShape, buildSwimlaneTable, clearSelectedCells, createCell, createDefaultCells, createDefaultFlowchart, createDefaultGeometry, createDefaultRowsOrColumns, createDefaultSwimlane, createGeometryElement, createGeometryElementWithText, createGeometryElementWithoutText, createLineElement, createMultipleTextGeometryElement, createTextElement, createUMLClassOrInterfaceGeometryElement, debugGenerator$1 as debugGenerator, deleteTextManage, drawBoundReaction, drawGeometry, drawLine, drawLineArrow, drawShape, editCell, editText, getAutoCompletePoints, getBasicPointers, getCellWithPoints, getCellsRectangle, getCellsWithPoints, getCenterPointsOnPolygon$1 as getCenterPointsOnPolygon, getConnectionPoint, getCurvePoints, getDefaultBasicShapeProperty, getDefaultFlowchartProperty, getDefaultGeometryPoints, getDefaultGeometryProperty, getDefaultSwimlanePoints, getDefaultTextPoints, getDefaultUMLProperty, getDrawDefaultStrokeColor, getElbowLineRouteOptions, getElbowPoints, getFillByElement, getFlowchartDefaultFill, getFlowchartPointers, getGeometryAlign, getGeometryPointers, getHitCell, getHitConnection, getHitConnectorPoint, getHitIndexOfAutoCompletePoint, getHitMultipleGeometryText, getHitShape, getIndexAndDeleteCountByKeyPoint, getLineDashByElement, getLineHandleRefPair, getLineMemorizedLatest, getLinePointers, getLinePoints, getLineTextRectangle, getLines, getMemorizeKey, getMemorizedLatestByPointer, getMemorizedLatestShape, getMidKeyPoints, getMiddlePoints, getMirrorDataPoints, getMultipleTextGeometryTextKeys, getNearestPoint, getNextRenderPoints, getNextSourceAndTargetPoints, getResizedPreviousAndNextPoint, getSelectedCells, getSelectedDrawElements, getSelectedGeometryElements, getSelectedImageElements, getSelectedLineElements, getSelectedSwimlane, getSelectedTableElements, getSnapResizingRef, getSnapResizingRefOptions, getSnappingRef, getSnappingShape, getSourceAndTargetRectangle, getStrokeColorByElement, getStrokeStyleByElement, getStrokeWidthByElement, getSwimlaneCount, getSwimlanePointers, getTextKey, getTextManage, getTextManageByCell, getTextRectangle, getTextShapeProperty, getUMLPointers, getVectorByConnection, handleLineCreating, hasIllegalElbowPoint, insertElement, isCellIncludeText, isDrawElementIncludeText, isDrawElementsIncludeText, isGeometryIncludeText, isHitDrawElement, isHitEdgeOfShape, isHitElementInside, isHitElementText, isHitLine, isHitLineText, isHitPolyLine, isInsideOfShape, isMultipleTextGeometry, isMultipleTextShape, isRectangleHitDrawElement, isRectangleHitElementText, isSelfLoop, isSingleSelectElementByTable, isSingleSelectSwimlane, isSingleSelectTable, isSingleTextGeometry, isSingleTextShape, isSwimlaneWithHeader, isTextExceedingBounds, isUpdatedHandleIndex, isUseDefaultOrthogonalRoute, memorizeLatestShape, memorizeLatestText, rerenderGeometryActive, setSelectedCells, setTextManage, traverseDrawShapes, updateCellIds, updateCellIdsByRowOrColumn, updateColumns, updateRowOrColumnIds, updateRows, withDraw, withLineAutoComplete };
7893
8444
  //# sourceMappingURL=plait-draw.mjs.map