@metadev/daga 3.1.5 → 4.0.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.
@@ -157,9 +157,7 @@ export declare class ValueSet {
157
157
  propertySet: PropertySet;
158
158
  displayedProperties: Property[];
159
159
  hiddenProperties: Property[];
160
- values: {
161
- [key: string]: unknown;
162
- };
160
+ private values;
163
161
  private valueSets;
164
162
  /**
165
163
  * Collaborative timestamps for all keys in this.values that have ever been set,
@@ -344,6 +342,23 @@ export declare const diff: (a: {
344
342
  }, {
345
343
  [key: string]: unknown;
346
344
  }];
345
+ /**
346
+ * Calculates the differences between the two given values of a valueset and returns two objects containing the differences in each relative to the other.
347
+ *
348
+ * @param a An object.
349
+ * @param b An object.
350
+ * @param valueSet A ValueSet to use as reference for the keys and types of each property.
351
+ * @returns A tuple of two objects with each containing the keys that have a different value in the corresponding argument compared to the other argument.
352
+ */
353
+ export declare const diffProperties: (a: {
354
+ [key: string]: unknown;
355
+ }, b: {
356
+ [key: string]: unknown;
357
+ }, valueSet: ValueSet) => [{
358
+ [key: string]: unknown;
359
+ }, {
360
+ [key: string]: unknown;
361
+ }];
347
362
  /**
348
363
  * Checks if the given value is an object.
349
364
  * @public
@@ -1,30 +1,14 @@
1
1
  import { Point } from '../../util/canvas-util';
2
2
  import { Side } from '../../util/svg-util';
3
- import { SectionConfig, ShapedLook } from '../diagram-config';
3
+ import { FieldConfig, PortConfig, SectionConfig, SectionGridConfig } from '../config/diagram-config';
4
+ import { ImageLookConfig, ShapedLookConfig, StretchableImageLookConfig } from '../config/diagram-look-config';
4
5
  import { DiagramConnection } from './diagram-connection';
5
6
  import { DiagramDecorator } from './diagram-decorator';
6
7
  import { DiagramElement, DiagramElementSet } from './diagram-element';
7
8
  import { DiagramField, LabeledElement } from './diagram-field';
8
9
  import { DiagramModel } from './diagram-model';
9
- import { DiagramNode } from './diagram-node';
10
+ import { DiagramNode, NodeLook } from './diagram-node';
10
11
  import { DiagramPort } from './diagram-port';
11
- /**
12
- * Default values of the look of a diagram section.
13
- * @private
14
- * @see DIAGRAM_SECTION_DEFAULTS
15
- */
16
- export declare const DIAGRAM_SECTION_LOOK_DEFAULTS: ShapedLook;
17
- /**
18
- * Default values of the parameters of a diagram section.
19
- * @private
20
- * @see DiagramSection
21
- */
22
- export declare const DIAGRAM_SECTION_DEFAULTS: {
23
- label: null;
24
- ports: never[];
25
- look: ShapedLook;
26
- priority: number;
27
- };
28
12
  /**
29
13
  * Default value of the default width of a diagram section.
30
14
  * @private
@@ -54,6 +38,31 @@ export type DiagramSectionGeometry = {
54
38
  readonly width: number;
55
39
  readonly height: number;
56
40
  };
41
+ /**
42
+ * A grid of sections which a node has.
43
+ * @public
44
+ * @see DiagramNode
45
+ * @see SectionGridConfig
46
+ */
47
+ export declare class DiagramSectionGrid {
48
+ defaultWidths: number[] | null;
49
+ defaultHeights: number[] | null;
50
+ minWidths: number[] | null;
51
+ minHeights: number[] | null;
52
+ margin: number;
53
+ sections: DiagramSectionType[][];
54
+ constructor(options: SectionGridConfig);
55
+ }
56
+ export declare class DiagramSectionType {
57
+ label: FieldConfig | null;
58
+ ports: PortConfig[];
59
+ defaultLook: NodeLook;
60
+ selectedLook: NodeLook;
61
+ highlightedLook: NodeLook;
62
+ selectedAndHighlightedLook: NodeLook;
63
+ priority: number;
64
+ constructor(options: SectionConfig);
65
+ }
57
66
  /**
58
67
  * A section of a node which can have connections and display a property of the node.
59
68
  * @public
@@ -111,11 +120,26 @@ export declare class DiagramSection extends DiagramElement implements LabeledEle
111
120
  */
112
121
  get name(): string;
113
122
  set name(name: string);
123
+ private _defaultLook?;
124
+ private _selectedLook?;
125
+ private _highlightedLook?;
126
+ private _selectedAndHighlightedLook?;
127
+ /**
128
+ * Current look of this port.
129
+ * @private
130
+ */
131
+ get look(): NodeLook;
132
+ /**
133
+ * Sets the look configuration of the look to override the one determined by the type.
134
+ * `undefined` resets it to the one determined by the type.
135
+ * @private
136
+ */
137
+ set look(look: ShapedLookConfig | ImageLookConfig | StretchableImageLookConfig | undefined);
114
138
  constructor(model: DiagramModel, node: DiagramNode | undefined, indexXInNode: number, indexYInNode: number, coords: Point, width: number, height: number, id: string);
115
139
  get removed(): boolean;
116
140
  updateInView(): void;
117
141
  raise(): void;
118
- getConfig(): SectionConfig | undefined;
142
+ get type(): DiagramSectionType | undefined;
119
143
  getMinWidth(): number;
120
144
  getMinHeight(): number;
121
145
  getPriority(): number;
@@ -4,7 +4,7 @@ import { DiagramUserHighlight } from '../diagram/canvas/diagram-user-highlight';
4
4
  import { DiagramUserSelection } from '../diagram/canvas/diagram-user-selection';
5
5
  import { CollabEngine } from '../diagram/collab/collab-engine';
6
6
  import { ActionStack, DiagramAction, DiagramActionMethod, DiagramActions } from '../diagram/diagram-action';
7
- import { UserActionConfig } from '../diagram/diagram-config';
7
+ import { UserActionConfig } from '../diagram/config/diagram-config';
8
8
  import { DiagramEvent } from '../diagram/diagram-event';
9
9
  import { DiagramConnectionType } from '../diagram/model/diagram-connection';
10
10
  import { DiagramModel } from '../diagram/model/diagram-model';
@@ -0,0 +1 @@
1
+ export declare const escapeSelector: (selector: string) => string;
@@ -1,4 +1,4 @@
1
- import { DiagramConfig } from '../diagram/diagram-config';
1
+ import { DiagramConfig } from '../diagram/config/diagram-config';
2
2
  /**
3
3
  * Creates the structuredClone function if it doesn't exist.
4
4
  * @private