@plait/draw 0.56.2 → 0.57.0

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.
@@ -13,6 +13,7 @@ export declare class GeometryComponent extends CommonPluginElement<PlaitGeometry
13
13
  lineAutoCompleteGenerator: LineAutoCompleteGenerator;
14
14
  shapeGenerator: GeometryShapeGenerator;
15
15
  get textManage(): TextManage;
16
+ constructor();
16
17
  initializeGenerator(): void;
17
18
  ngOnInit(): void;
18
19
  onContextChanged(value: PlaitPluginElementContext<PlaitGeometry, PlaitBoard>, previous: PlaitPluginElementContext<PlaitGeometry, PlaitBoard>): void;
@@ -10,6 +10,7 @@ export declare class ImageComponent extends CommonPluginElement<PlaitImage, Plai
10
10
  get activeGenerator(): import("@plait/common").ActiveGenerator<import("@plait/core").PlaitElement>;
11
11
  imageGenerator: ImageGenerator<PlaitImage>;
12
12
  lineAutoCompleteGenerator: LineAutoCompleteGenerator;
13
+ constructor();
13
14
  initializeGenerator(): void;
14
15
  ngOnInit(): void;
15
16
  onContextChanged(value: PlaitPluginElementContext<PlaitImage, PlaitBoard>, previous: PlaitPluginElementContext<PlaitImage, PlaitBoard>): void;
@@ -2,6 +2,7 @@ import { PlaitBoard, PlaitElement, Point, PointOfRectangle, RectangleClient, Vec
2
2
  import { Options } from 'roughjs/bin/core';
3
3
  import { ParagraphElement } from '@plait/text';
4
4
  import { StrokeStyle } from './element';
5
+ import { PlaitTable } from './table';
5
6
  export declare enum BasicShapes {
6
7
  rectangle = "rectangle",
7
8
  ellipse = "ellipse",
@@ -48,9 +49,17 @@ export declare enum FlowchartSymbols {
48
49
  internalStorage = "internalStorage",
49
50
  noteCurlyRight = "noteCurlyRight",
50
51
  noteCurlyLeft = "noteCurlyLeft",
51
- noteSquare = "noteSquare"
52
+ noteSquare = "noteSquare",
53
+ display = "display"
52
54
  }
53
- export type GeometryShapes = BasicShapes | FlowchartSymbols;
55
+ export declare enum TableSymbols {
56
+ table = "table"
57
+ }
58
+ export declare enum SwimlaneSymbols {
59
+ swimlaneVertical = "swimlaneVertical",
60
+ swimlaneHorizontal = "swimlaneHorizontal"
61
+ }
62
+ export type GeometryShapes = BasicShapes | FlowchartSymbols | SwimlaneSymbols | TableSymbols;
54
63
  export interface PlaitGeometry extends PlaitElement {
55
64
  points: [Point, Point];
56
65
  type: 'geometry';
@@ -73,6 +82,16 @@ export interface PlaitEllipse extends PlaitGeometry {
73
82
  export interface PlaitDiamond extends PlaitGeometry {
74
83
  shape: BasicShapes.diamond;
75
84
  }
85
+ export interface PlaitSwimlane extends PlaitTable {
86
+ type: 'geometry';
87
+ shape: SwimlaneSymbols;
88
+ }
89
+ export interface PlaitSwimlaneVertical extends PlaitSwimlane {
90
+ shape: SwimlaneSymbols.swimlaneVertical;
91
+ }
92
+ export interface PlaitSwimlaneHorizontal extends PlaitSwimlane {
93
+ shape: SwimlaneSymbols.swimlaneHorizontal;
94
+ }
76
95
  export declare const PlaitGeometry: {};
77
96
  export interface ShapeEngine {
78
97
  isInsidePoint: (rectangle: RectangleClient, point: Point) => boolean;
@@ -0,0 +1,27 @@
1
+ import { PlaitElement, Point } from '@plait/core';
2
+ import { ParagraphElement } from '@plait/text';
3
+ export interface PlaitTable extends PlaitElement {
4
+ id: string;
5
+ points: Point[];
6
+ rows: {
7
+ id: string;
8
+ height?: number;
9
+ }[];
10
+ columns: {
11
+ id: string;
12
+ width?: number;
13
+ }[];
14
+ cells: PlaitTableCell[];
15
+ groupId?: string;
16
+ }
17
+ export interface PlaitTableCell {
18
+ id: string;
19
+ rowId: string;
20
+ columnId: string;
21
+ colspan?: number;
22
+ rowspan?: number;
23
+ text?: PlaitTableCellParagraph;
24
+ }
25
+ export interface PlaitTableCellParagraph extends ParagraphElement {
26
+ writingMode: 'vertical-lr' | 'horizontal-tb';
27
+ }
@@ -16,6 +16,7 @@ export declare class LineComponent extends CommonPluginElement<PlaitLine, PlaitB
16
16
  shapeGenerator: LineShapeGenerator;
17
17
  activeGenerator: LineActiveGenerator;
18
18
  boundedElements: BoundedElements;
19
+ constructor();
19
20
  initializeGenerator(): void;
20
21
  ngOnInit(): void;
21
22
  getBoundedElements(): BoundedElements;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plait/draw",
3
- "version": "0.56.2",
3
+ "version": "0.57.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.2.4",
6
6
  "@angular/core": "^17.2.4",
@@ -0,0 +1,2 @@
1
+ import { PlaitBoard } from '@plait/core';
2
+ export declare const withTable: (board: PlaitBoard) => PlaitBoard;
@@ -0,0 +1,15 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { PlaitBoard, PlaitPluginElementContext, OnContextChanged } from '@plait/core';
3
+ import { ActiveGenerator, CommonPluginElement } from '@plait/common';
4
+ import { PlaitTable } from './interfaces/table';
5
+ import * as i0 from "@angular/core";
6
+ export declare class TableComponent extends CommonPluginElement<PlaitTable, PlaitBoard> implements OnInit, OnDestroy, OnContextChanged<PlaitTable, PlaitBoard> {
7
+ activeGenerator: ActiveGenerator<PlaitTable>;
8
+ constructor();
9
+ initializeGenerator(): void;
10
+ ngOnInit(): void;
11
+ onContextChanged(value: PlaitPluginElementContext<PlaitTable, PlaitBoard>, previous: PlaitPluginElementContext<PlaitTable, PlaitBoard>): void;
12
+ ngOnDestroy(): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "plait-draw-table", never, {}, {}, never, never, true, never>;
15
+ }