@metadev/daga 4.1.0 → 4.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metadev/daga",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "dependencies": {},
5
5
  "peerDependencies": {
6
6
  "d3": "^7.9.0",
@@ -27,11 +27,11 @@
27
27
  "./package.json": "./package.json",
28
28
  ".": {
29
29
  "module": "./index.esm.js",
30
- "types": "./index.esm.d.ts",
30
+ "types": "./index.d.ts",
31
31
  "import": "./index.cjs.mjs",
32
32
  "default": "./index.cjs.js"
33
33
  }
34
34
  },
35
35
  "module": "./index.esm.js",
36
- "types": "./index.esm.d.ts"
36
+ "types": "./index.d.ts"
37
37
  }
@@ -189,6 +189,14 @@ export interface NodeTemplateConfig {
189
189
  * Id of the type of node of this template. Must correspond to the id of a type of node defined in the nodeTypes list.
190
190
  */
191
191
  type: string;
192
+ /**
193
+ * Width of this template as it appears on the palette. By default, the width of the type of node is used.
194
+ */
195
+ width?: number | null;
196
+ /**
197
+ * Height of this template as it appears on the palette. By default, the height of the type of node is used.
198
+ */
199
+ height?: number | null;
192
200
  /**
193
201
  * Look of this template as it appears on the palette which can be used to override the default look of the nodes of this type.
194
202
  */
@@ -311,6 +311,11 @@ export interface FieldConfig {
311
311
  * @default 'center'
312
312
  */
313
313
  verticalAlign?: VerticalAlign;
314
+ /**
315
+ * The orientation of the text of this field. It may be a side or a number of degrees.
316
+ * @default 'top'
317
+ */
318
+ orientation?: Side | number;
314
319
  /**
315
320
  * Whether this field and its root element should be resized automatically if the size of the text increases.
316
321
  * Setting this to true should also entail setting reasonable `minWidth` and `minHeight` values for the configuration of any nodes or sections that contain this field.
@@ -73,7 +73,7 @@ export declare abstract class DiagramElement implements DiagramEntity {
73
73
  */
74
74
  abstract updateInView(): void;
75
75
  /**
76
- * Put this element above other elements of its kind in the view.
76
+ * Put this element above other elements in the view.
77
77
  * @public
78
78
  */
79
79
  abstract raise(): void;
@@ -1,5 +1,5 @@
1
1
  import { Point } from '../../util/canvas-util';
2
- import { HorizontalAlign, VerticalAlign } from '../../util/svg-util';
2
+ import { HorizontalAlign, Side, VerticalAlign } from '../../util/svg-util';
3
3
  import { CollabTimestamp } from '../collab/primitives';
4
4
  import { FieldConfig } from '../config/diagram-config';
5
5
  import { DiagramElement, DiagramElementSet } from './diagram-element';
@@ -19,6 +19,7 @@ export declare const DIAGRAM_FIELD_DEFAULTS: {
19
19
  selectedColor: string;
20
20
  horizontalAlign: HorizontalAlign;
21
21
  verticalAlign: VerticalAlign;
22
+ orientation: Side;
22
23
  fit: boolean;
23
24
  };
24
25
  export interface LabeledElement {
@@ -82,6 +83,11 @@ export declare class DiagramField extends DiagramElement {
82
83
  * @public
83
84
  */
84
85
  verticalAlign: VerticalAlign;
86
+ /**
87
+ * Orientation of the text of this field.
88
+ * @public
89
+ */
90
+ orientation: Side | number;
85
91
  private _text;
86
92
  /**
87
93
  * Default text that this field's text resets to when empty.
@@ -109,7 +115,7 @@ export declare class DiagramField extends DiagramElement {
109
115
  * @public
110
116
  */
111
117
  fit: boolean;
112
- constructor(model: DiagramModel, rootElement: (LabeledElement & DiagramElement) | undefined, coords: Point, width: number, height: number, fontSize: number, fontFamily: string | null, color: string, selectedColor: string, horizontalAlign: HorizontalAlign, verticalAlign: VerticalAlign, text: string, editable: boolean, fit: boolean);
118
+ constructor(model: DiagramModel, rootElement: (LabeledElement & DiagramElement) | undefined, coords: Point, width: number, height: number, fontSize: number, fontFamily: string | null, color: string, selectedColor: string, horizontalAlign: HorizontalAlign, verticalAlign: VerticalAlign, orientation: Side | number, text: string, editable: boolean, fit: boolean);
113
119
  get removed(): boolean;
114
120
  updateInView(): void;
115
121
  raise(): void;
@@ -132,7 +138,7 @@ export declare class DiagramFieldSet extends DiagramElementSet<DiagramField> {
132
138
  * Instance a new field and add it to this set. This method is normally called when instancing an element with a field and it is rarely called by itself.
133
139
  * @private
134
140
  */
135
- new(rootElement: (LabeledElement & DiagramElement) | undefined, coords: Point, fontSize: number, fontFamily: string | null, color: string, selectedColor: string, width: number, height: number, horizontalAlign: HorizontalAlign, verticalAlign: VerticalAlign, text: string, editable: boolean, fit: boolean): DiagramField;
141
+ new(rootElement: (LabeledElement & DiagramElement) | undefined, coords: Point, fontSize: number, fontFamily: string | null, color: string, selectedColor: string, width: number, height: number, horizontalAlign: HorizontalAlign, verticalAlign: VerticalAlign, orientation: Side | number, text: string, editable: boolean, fit: boolean): DiagramField;
136
142
  remove(id: string): void;
137
143
  }
138
144
  export declare const getBottomMargin: (config?: FieldConfig | null) => number;
package/index.cjs.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./src\\index";
package/index.esm.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./src\\index";