@focus.matters/diagrams 0.1.2 → 0.2.20
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/dist/{DirectedPoint-BcpEj8ub.js → DirectedPoint-DNhrnCXr.js} +2 -2
- package/dist/DirectedPoint-DNhrnCXr.js.map +1 -0
- package/dist/diagrams.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +16448 -9
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/src/Diagrams/components/objects/RenderEdge/EdgeMidpoints.d.ts +2 -1
- package/dist/src/Diagrams/components/objects/RenderEdge/types.d.ts +6 -3
- package/dist/src/Diagrams/components/objects/edgeLabelPlacement.d.ts +4 -1
- package/dist/src/Diagrams/components/stopDiagramControlEvent.d.ts +11 -0
- package/dist/src/Diagrams/components/useDiagramPointerCapture.d.ts +14 -0
- package/dist/src/Diagrams/context-menu/buildDiagramContextMenu.d.ts +1 -0
- package/dist/src/Diagrams/custom/bpmn/config/BPMNLabels.d.ts +1 -1
- package/dist/src/Diagrams/custom/bpmn/extensions/BPMNModelerExtension.d.ts +14 -1
- package/dist/src/Diagrams/custom/bpmn/nodes/BPMNEventDefinition.d.ts +11 -2
- package/dist/src/Diagrams/custom/bpmn/nodes/DocumentNode.d.ts +75 -1
- package/dist/src/Diagrams/custom/bpmn/nodes/GateNode.d.ts +2 -1
- package/dist/src/Diagrams/custom/bpmn/nodes/TaskNode.d.ts +16 -0
- package/dist/src/Diagrams/custom/bpmn/ui/BPMNElementMenu.d.ts +2 -1
- package/dist/src/Diagrams/custom/bpmn/ui/BPMNIcon.d.ts +1 -1
- package/dist/src/Diagrams/custom/bpmn/ui/BPMNPropertiesPanel.d.ts +11 -1
- package/dist/src/Diagrams/custom/bpmnExecution/BPMNExecutionDiagram.d.ts +30 -0
- package/dist/src/Diagrams/custom/bpmnExecution/BPMNExecutionEdge.d.ts +67 -0
- package/dist/src/Diagrams/custom/bpmnExecution/BPMNExecutionExtension.d.ts +9 -0
- package/dist/src/Diagrams/custom/bpmnExecution/BPMNExecutionMarker.d.ts +12 -0
- package/dist/src/Diagrams/custom/bpmnExecution/BPMNNodeExecutionState.d.ts +27 -0
- package/dist/src/Diagrams/custom/bpmnExecution/isBPMNExecutionNode.d.ts +7 -0
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionBlackBoxPoolNode.d.ts +70 -0
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionDataStoreNode.d.ts +70 -0
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionDocumentAnnotationNode.d.ts +70 -0
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionDocumentNode.d.ts +71 -0
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionEventNode.d.ts +81 -0
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionGateNode.d.ts +71 -0
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionLanes.d.ts +14 -0
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionTaskNode.d.ts +76 -0
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionTextAnnotationNode.d.ts +70 -0
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionUnknownNode.d.ts +71 -0
- package/dist/src/Diagrams/custom/bpmnExecution/promoteBPMNExecutionEdge.d.ts +3 -0
- package/dist/src/Diagrams/custom/bpmnExecution/promoteBPMNExecutionNode.d.ts +3 -0
- package/dist/src/Diagrams/custom/bpmnExecution/types.d.ts +38 -0
- package/dist/src/Diagrams/custom/bpmnExecution/ui/BPMNExecutionMarkers.d.ts +6 -0
- package/dist/src/Diagrams/custom/bpmnExecution/ui/BPMNExecutionPropertiesPanel.d.ts +6 -0
- package/dist/src/Diagrams/custom/mr/MRDiagram.d.ts +17 -0
- package/dist/src/Diagrams/custom/mr/bindAttributeRelationshipHover.d.ts +3 -0
- package/dist/src/Diagrams/custom/mr/edges/MRForeignKeyEdge.d.ts +77 -0
- package/dist/src/Diagrams/custom/mr/extensions/MRModelerExtension.d.ts +45 -0
- package/dist/src/Diagrams/custom/mr/extensions/MRPropertyChangeEvent.d.ts +4 -0
- package/dist/src/Diagrams/custom/mr/layout/applyMRAutoLayout.d.ts +3 -0
- package/dist/src/Diagrams/custom/mr/nodes/MRTableNode.d.ts +105 -0
- package/dist/src/Diagrams/custom/mr/types.d.ts +51 -0
- package/dist/src/Diagrams/custom/mr/ui/MRPropertiesPanel.d.ts +6 -0
- package/dist/src/Diagrams/store/Canvas.d.ts +45 -0
- package/dist/src/Diagrams/store/Diagram.d.ts +6 -0
- package/dist/src/Diagrams/store/elements/Events.d.ts +2 -1
- package/dist/src/Diagrams/store/revealDiagramNode.d.ts +10 -0
- package/dist/src/index.d.ts +26 -0
- package/package.json +50 -45
- package/dist/DirectedPoint-BcpEj8ub.js.map +0 -1
- package/dist/index-hTkL5cDr.js +0 -12037
- package/dist/index-hTkL5cDr.js.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TDiagramSettings } from '../../store/Diagram';
|
|
2
|
+
import { EditableDiagram } from '../editable/EditableDiagram';
|
|
3
|
+
import { MRForeignKeyEdge } from './edges/MRForeignKeyEdge';
|
|
4
|
+
import { MRTableNode } from './nodes/MRTableNode';
|
|
5
|
+
import { MRForeignKeyModel, MRTableKind } from './types';
|
|
6
|
+
/** Configures an editable relational/UML data model with tables and foreign keys. */
|
|
7
|
+
export declare class MRDiagram extends EditableDiagram {
|
|
8
|
+
constructor(settings?: TDiagramSettings);
|
|
9
|
+
/** Creates and selects one table centered on an exact client-space point. */
|
|
10
|
+
createTableFromClientPoint(kind: MRTableKind, clientX: number, clientY: number, label?: string): MRTableNode;
|
|
11
|
+
/** Creates and selects one table centered on an exact canvas-space point. */
|
|
12
|
+
createTableAtCanvasPoint(kind: MRTableKind, x: number, y: number, label?: string): MRTableNode;
|
|
13
|
+
/** Arranges relational dependencies in readable left-to-right Dagre layers. */
|
|
14
|
+
autoLayout(): boolean;
|
|
15
|
+
/** Connects a dependent table to a referenced table with foreign-key metadata. */
|
|
16
|
+
connectForeignKey(source: MRTableNode, target: MRTableNode, model?: Partial<MRForeignKeyModel>): MRForeignKeyEdge;
|
|
17
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Edge } from '../../../store/elements/Edge';
|
|
2
|
+
import { Element } from '../../../store/elements/Element';
|
|
3
|
+
import { Coordinates } from '../../../store/primitives/Coordinates';
|
|
4
|
+
import { TEdgeState } from '../../../store/types';
|
|
5
|
+
import { MRCardinality, MRForeignKeyModel, MRMatchType, MRReferentialAction } from '../types';
|
|
6
|
+
type MRForeignKeyEdgeState = Partial<TEdgeState> & Partial<MRForeignKeyModel>;
|
|
7
|
+
/** Models one relational foreign-key constraint on top of a routed diagram edge. */
|
|
8
|
+
export declare class MRForeignKeyEdge extends Edge {
|
|
9
|
+
constraintId: string;
|
|
10
|
+
mappingIndex: number;
|
|
11
|
+
name: string;
|
|
12
|
+
sourceAttributeIds: string[];
|
|
13
|
+
targetAttributeIds: string[];
|
|
14
|
+
sourceCardinality: MRCardinality;
|
|
15
|
+
targetCardinality: MRCardinality;
|
|
16
|
+
onDelete: MRReferentialAction;
|
|
17
|
+
onUpdate: MRReferentialAction;
|
|
18
|
+
matchType: MRMatchType;
|
|
19
|
+
identifying: boolean;
|
|
20
|
+
deferrable: boolean;
|
|
21
|
+
initiallyDeferred: boolean;
|
|
22
|
+
constructor(parent: Element | null, state: MRForeignKeyEdgeState);
|
|
23
|
+
/** Updates foreign-key semantics and refreshes its identifying line style. */
|
|
24
|
+
updateModel(patch: Partial<MRForeignKeyModel>): void;
|
|
25
|
+
/** Stores a first route and positions the generated constraint label at its midpoint. */
|
|
26
|
+
setSteps(steps: Coordinates[]): void;
|
|
27
|
+
private applyStyle;
|
|
28
|
+
/** Serializes every referential action, mapping, cardinality, and edge route. */
|
|
29
|
+
serialize(): {
|
|
30
|
+
constraintId: string;
|
|
31
|
+
mappingIndex: number;
|
|
32
|
+
name: string;
|
|
33
|
+
sourceAttributeIds: string[];
|
|
34
|
+
targetAttributeIds: string[];
|
|
35
|
+
sourceCardinality: MRCardinality;
|
|
36
|
+
targetCardinality: MRCardinality;
|
|
37
|
+
onDelete: MRReferentialAction;
|
|
38
|
+
onUpdate: MRReferentialAction;
|
|
39
|
+
matchType: MRMatchType;
|
|
40
|
+
identifying: boolean;
|
|
41
|
+
deferrable: boolean;
|
|
42
|
+
initiallyDeferred: boolean;
|
|
43
|
+
arrowHeadEnd: import('../../../store/types').EdgeArrowHead | undefined;
|
|
44
|
+
arrowHeadStart: import('../../../store/types').EdgeArrowHead | undefined;
|
|
45
|
+
displacementEnd: [number, number] | undefined;
|
|
46
|
+
displacementStart: [number, number] | undefined;
|
|
47
|
+
lineStyle: import('../../../store/types').EdgeLineStyle | undefined;
|
|
48
|
+
labels: {
|
|
49
|
+
alignment: "right" | "left" | "center";
|
|
50
|
+
id: string;
|
|
51
|
+
size: {
|
|
52
|
+
height: number;
|
|
53
|
+
width: number;
|
|
54
|
+
};
|
|
55
|
+
text: string;
|
|
56
|
+
position: [number, number];
|
|
57
|
+
}[];
|
|
58
|
+
pathType: import('../../../store/types').EdgePathType;
|
|
59
|
+
startAnchor: {
|
|
60
|
+
mode: import('../../../store/types').EdgeAnchorMode;
|
|
61
|
+
position: [number, number] | undefined;
|
|
62
|
+
};
|
|
63
|
+
endAnchor: {
|
|
64
|
+
mode: import('../../../store/types').EdgeAnchorMode;
|
|
65
|
+
position: [number, number] | undefined;
|
|
66
|
+
};
|
|
67
|
+
steps: import('../../../store/elements/EdgePoint').TSerializedEdgePoint[];
|
|
68
|
+
stroke: string | undefined;
|
|
69
|
+
strokeWidth: number | undefined;
|
|
70
|
+
to: string;
|
|
71
|
+
toParentId: string;
|
|
72
|
+
class: string;
|
|
73
|
+
};
|
|
74
|
+
/** Restores foreign-key semantics after generic edge routing has been imported. */
|
|
75
|
+
deserialize(state: ReturnType<this["serialize"]>): void;
|
|
76
|
+
}
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DiagramExtension } from '../../../store/extensions/DiagramExtension';
|
|
2
|
+
import { Coordinates } from '../../../store/primitives/Coordinates';
|
|
3
|
+
import { EdgePathType } from '../../../store/types';
|
|
4
|
+
import { MRForeignKeyEdge } from '../edges/MRForeignKeyEdge';
|
|
5
|
+
import { MRTableNode } from '../nodes/MRTableNode';
|
|
6
|
+
import { MRAttribute, MRConstraint, MRConstraintKind, MRForeignKeyModel, MRShowcaseElement, MRTableKind } from '../types';
|
|
7
|
+
/** Coordinates relational-model creation and every inspector-driven schema mutation. */
|
|
8
|
+
export declare class MRModelerExtension extends DiagramExtension {
|
|
9
|
+
RenderUI: (({ diagram, extension }: import('../../../store/extensions/DiagramExtension').TDiagramExtensionRenderProps<MRModelerExtension>) => import("react").JSX.Element) & {
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
/** Initializes this stateless modeler extension for fixed inspector rendering. */
|
|
13
|
+
init(): void;
|
|
14
|
+
/** Creates a table node centered at an exact canvas-space point and selects it. */
|
|
15
|
+
createTable(position: Coordinates, kind?: MRTableKind, label?: string): MRTableNode;
|
|
16
|
+
/** Adds any catalog element, applying embedded elements to the selected table. */
|
|
17
|
+
addShowcaseElement(kind: MRShowcaseElement): MRTableNode | MRForeignKeyEdge;
|
|
18
|
+
/** Returns the only selected relational table, or null for mixed selections. */
|
|
19
|
+
get selectedTable(): MRTableNode | null;
|
|
20
|
+
/** Renames one relational table while preserving the generic node contract. */
|
|
21
|
+
renameTable(node: MRTableNode, name: string): void;
|
|
22
|
+
/** Updates schema, description, or table-kind metadata in one history mutation. */
|
|
23
|
+
updateTable(node: MRTableNode, patch: Parameters<MRTableNode["updateModel"]>[0]): void;
|
|
24
|
+
/** Adds one fully editable column definition to the supplied relational table. */
|
|
25
|
+
addAttribute(node: MRTableNode, overrides?: Partial<MRAttribute>): MRAttribute;
|
|
26
|
+
/** Applies a partial column update and synchronizes foreign-key references. */
|
|
27
|
+
updateAttribute(node: MRTableNode, id: string, patch: Partial<MRAttribute>): void;
|
|
28
|
+
/** Removes one column plus foreign keys that would otherwise reference it. */
|
|
29
|
+
removeAttribute(node: MRTableNode, id: string): void;
|
|
30
|
+
/** Reorders one table attribute and preserves all column-specific edge anchors. */
|
|
31
|
+
moveAttribute(node: MRTableNode, attributeId: string, beforeAttributeId: string | null): void;
|
|
32
|
+
/** Adds a table-level primary, unique, check, or index constraint with metadata. */
|
|
33
|
+
addConstraint(node: MRTableNode, kind: MRConstraintKind, overrides?: Partial<MRConstraint>): MRConstraint;
|
|
34
|
+
/** Updates all editable metadata stored by one table-level relational constraint. */
|
|
35
|
+
updateConstraint(node: MRTableNode, id: string, patch: Partial<MRConstraint>): void;
|
|
36
|
+
/** Removes one table-level constraint in a single history-aware operation. */
|
|
37
|
+
removeConstraint(node: MRTableNode, id: string): void;
|
|
38
|
+
/** Updates mappings, actions, cardinalities, and integrity flags of a foreign key. */
|
|
39
|
+
updateForeignKey(edge: MRForeignKeyEdge, patch: Partial<MRForeignKeyModel>): void;
|
|
40
|
+
/** Changes the routing family used to draw one relational foreign-key connection. */
|
|
41
|
+
updateForeignKeyPath(edge: MRForeignKeyEdge, pathType: EdgePathType): void;
|
|
42
|
+
private createForeignKeyExample;
|
|
43
|
+
private rewireForeignKey;
|
|
44
|
+
private recordChange;
|
|
45
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Diagram } from '../../../store/Diagram';
|
|
2
|
+
import { Element } from '../../../store/elements/Element';
|
|
3
|
+
import { Gateway } from '../../../store/elements/Gateway';
|
|
4
|
+
import { Node, TNodeConstructorProps } from '../../../store/elements/Node';
|
|
5
|
+
import { MRAttribute, MRConstraint, MRConstraintKind, MRTableModel } from '../types';
|
|
6
|
+
type MRTableNodeState = TNodeConstructorProps & {
|
|
7
|
+
model?: Partial<MRTableModel>;
|
|
8
|
+
};
|
|
9
|
+
/** Models and renders one relational table or UML data class with its full schema. */
|
|
10
|
+
export declare class MRTableNode extends Node<any> {
|
|
11
|
+
model: MRTableModel;
|
|
12
|
+
constructor(parent: Element | null, state: MRTableNodeState);
|
|
13
|
+
protected initializeGateways(): void;
|
|
14
|
+
/** Attaches the table and recalculates row geometry from the diagram grid size. */
|
|
15
|
+
setDiagram(diagram: Diagram): void;
|
|
16
|
+
/** Adds one column definition and expands the rendered table when necessary. */
|
|
17
|
+
addAttribute(overrides?: Partial<MRAttribute>): MRAttribute;
|
|
18
|
+
/** Updates selected column properties while enforcing primary-key nullability. */
|
|
19
|
+
updateAttribute(id: string, patch: Partial<MRAttribute>): void;
|
|
20
|
+
/** Removes one column and clears every table constraint referencing that column. */
|
|
21
|
+
removeAttribute(id: string): void;
|
|
22
|
+
/** Moves one attribute before another row and reroutes every affected column edge. */
|
|
23
|
+
moveAttribute(attributeId: string, beforeAttributeId: string | null): void;
|
|
24
|
+
/** Adds a named table constraint with optional columns and expression metadata. */
|
|
25
|
+
addConstraint(kind: MRConstraintKind, overrides?: Partial<MRConstraint>): MRConstraint;
|
|
26
|
+
/** Updates one table-level primary, unique, check, or index constraint definition. */
|
|
27
|
+
updateConstraint(id: string, patch: Partial<MRConstraint>): void;
|
|
28
|
+
/** Removes one table constraint without changing any of its referenced columns. */
|
|
29
|
+
removeConstraint(id: string): void;
|
|
30
|
+
/** Updates table metadata and keeps the visual kind modifier synchronized. */
|
|
31
|
+
updateModel(patch: Partial<Omit<MRTableModel, "attributes" | "constraints">>): void;
|
|
32
|
+
private fitHeightToContent;
|
|
33
|
+
private get attributeRowHeight();
|
|
34
|
+
private syncAttributeGateways;
|
|
35
|
+
private syncAttributeGatewayPositions;
|
|
36
|
+
/** Returns the exact left or right gateway anchored to one relational attribute row. */
|
|
37
|
+
gatewayForAttribute(attributeId: string, side: "left" | "right"): Gateway | undefined;
|
|
38
|
+
/** Resolves persisted attribute gateways early enough for cross-table edge imports. */
|
|
39
|
+
getGateway(which: any): Gateway | undefined;
|
|
40
|
+
/** Serializes relational metadata together with generic node geometry and edges. */
|
|
41
|
+
serialize(): {
|
|
42
|
+
model: MRTableModel;
|
|
43
|
+
box: [number, number, number, number];
|
|
44
|
+
id: string;
|
|
45
|
+
label: string;
|
|
46
|
+
movable: boolean | undefined;
|
|
47
|
+
selectable: boolean | undefined;
|
|
48
|
+
selected: boolean | undefined;
|
|
49
|
+
gateways: {
|
|
50
|
+
coordinates: [number, number];
|
|
51
|
+
fill: string | undefined;
|
|
52
|
+
id: string;
|
|
53
|
+
orientation: import('../../../store/types').TOrientation;
|
|
54
|
+
radius: number;
|
|
55
|
+
stroke: string | undefined;
|
|
56
|
+
strokeWidth: number;
|
|
57
|
+
outEdges: {
|
|
58
|
+
arrowHeadEnd: import('../../../store/types').EdgeArrowHead | undefined;
|
|
59
|
+
arrowHeadStart: import('../../../store/types').EdgeArrowHead | undefined;
|
|
60
|
+
displacementEnd: [number, number] | undefined;
|
|
61
|
+
displacementStart: [number, number] | undefined;
|
|
62
|
+
lineStyle: import('../../../store/types').EdgeLineStyle | undefined;
|
|
63
|
+
labels: {
|
|
64
|
+
alignment: "right" | "left" | "center";
|
|
65
|
+
id: string;
|
|
66
|
+
size: {
|
|
67
|
+
height: number;
|
|
68
|
+
width: number;
|
|
69
|
+
};
|
|
70
|
+
text: string;
|
|
71
|
+
position: [number, number];
|
|
72
|
+
}[];
|
|
73
|
+
pathType: import('../../../store/types').EdgePathType;
|
|
74
|
+
startAnchor: {
|
|
75
|
+
mode: import('../../../store/types').EdgeAnchorMode;
|
|
76
|
+
position: [number, number] | undefined;
|
|
77
|
+
};
|
|
78
|
+
endAnchor: {
|
|
79
|
+
mode: import('../../../store/types').EdgeAnchorMode;
|
|
80
|
+
position: [number, number] | undefined;
|
|
81
|
+
};
|
|
82
|
+
steps: import('../../../store/elements/EdgePoint').TSerializedEdgePoint[];
|
|
83
|
+
stroke: string | undefined;
|
|
84
|
+
strokeWidth: number | undefined;
|
|
85
|
+
to: string;
|
|
86
|
+
toParentId: string;
|
|
87
|
+
class: string;
|
|
88
|
+
}[];
|
|
89
|
+
class: string;
|
|
90
|
+
}[];
|
|
91
|
+
fill: string | undefined;
|
|
92
|
+
labelFontSize: number | undefined;
|
|
93
|
+
labelOffset: [number, number] | undefined;
|
|
94
|
+
stroke: string | undefined;
|
|
95
|
+
strokewWidth: number | undefined;
|
|
96
|
+
class: string;
|
|
97
|
+
};
|
|
98
|
+
/** Restores relational metadata and recalculates the minimum visual table height. */
|
|
99
|
+
deserialize(state: ReturnType<this["serialize"]>): void;
|
|
100
|
+
RenderOverlay: (() => import("react").JSX.Element) & {
|
|
101
|
+
displayName: string;
|
|
102
|
+
};
|
|
103
|
+
RenderScreen: null;
|
|
104
|
+
}
|
|
105
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type MRTableKind = "table" | "view" | "junction";
|
|
2
|
+
export type MRAttribute = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
dataType: string;
|
|
6
|
+
length: string;
|
|
7
|
+
nullable: boolean;
|
|
8
|
+
primaryKey: boolean;
|
|
9
|
+
unique: boolean;
|
|
10
|
+
autoIncrement: boolean;
|
|
11
|
+
defaultValue: string;
|
|
12
|
+
generatedExpression: string;
|
|
13
|
+
checkExpression: string;
|
|
14
|
+
comment: string;
|
|
15
|
+
};
|
|
16
|
+
export type MRConstraintKind = "primary-key" | "unique" | "check" | "index";
|
|
17
|
+
export type MRConstraint = {
|
|
18
|
+
id: string;
|
|
19
|
+
kind: MRConstraintKind;
|
|
20
|
+
name: string;
|
|
21
|
+
attributeIds: string[];
|
|
22
|
+
expression: string;
|
|
23
|
+
indexMethod: string;
|
|
24
|
+
};
|
|
25
|
+
export type MRTableModel = {
|
|
26
|
+
schemaName: string;
|
|
27
|
+
tableKind: MRTableKind;
|
|
28
|
+
description: string;
|
|
29
|
+
attributes: MRAttribute[];
|
|
30
|
+
constraints: MRConstraint[];
|
|
31
|
+
};
|
|
32
|
+
export type MRReferentialAction = "no-action" | "restrict" | "cascade" | "set-null" | "set-default";
|
|
33
|
+
export type MRCardinality = "zero-one" | "one" | "zero-many" | "one-many";
|
|
34
|
+
export type MRMatchType = "simple" | "full" | "partial";
|
|
35
|
+
export type MRForeignKeyModel = {
|
|
36
|
+
constraintId: string;
|
|
37
|
+
mappingIndex: number;
|
|
38
|
+
name: string;
|
|
39
|
+
sourceAttributeIds: string[];
|
|
40
|
+
targetAttributeIds: string[];
|
|
41
|
+
sourceCardinality: MRCardinality;
|
|
42
|
+
targetCardinality: MRCardinality;
|
|
43
|
+
onDelete: MRReferentialAction;
|
|
44
|
+
onUpdate: MRReferentialAction;
|
|
45
|
+
matchType: MRMatchType;
|
|
46
|
+
identifying: boolean;
|
|
47
|
+
deferrable: boolean;
|
|
48
|
+
initiallyDeferred: boolean;
|
|
49
|
+
};
|
|
50
|
+
export type MRShowcaseElement = "table" | "view" | "junction" | "attribute" | "primary-key" | "foreign-key" | "unique" | "check" | "index";
|
|
51
|
+
export declare const MR_DATA_TYPES: readonly ["BIGINT", "INTEGER", "SMALLINT", "DECIMAL", "NUMERIC", "REAL", "DOUBLE PRECISION", "BOOLEAN", "CHAR", "VARCHAR", "TEXT", "DATE", "TIME", "TIMESTAMP", "TIMESTAMPTZ", "UUID", "JSON", "JSONB", "BINARY", "BLOB"];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TDiagramExtensionRenderProps } from '../../../store/extensions/DiagramExtension';
|
|
2
|
+
import { MRModelerExtension } from '../extensions/MRModelerExtension';
|
|
3
|
+
/** Renders the relational-model inspector for one selected table or foreign key. */
|
|
4
|
+
export declare const MRPropertiesPanel: (({ diagram, extension }: TDiagramExtensionRenderProps<MRModelerExtension>) => import("react").JSX.Element) & {
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
@@ -10,11 +10,23 @@ export type ScaleEvent = {
|
|
|
10
10
|
/** Owns viewport scale, displacement, interaction sessions, and rendered canvas bounds. */
|
|
11
11
|
export declare class Canvas extends Element {
|
|
12
12
|
private unbindDocumentEvents;
|
|
13
|
+
private readonly detachHandlers;
|
|
13
14
|
private mouseSessionStartedInFrame;
|
|
15
|
+
private keyboardSessionActive;
|
|
14
16
|
private centerAnimationFrame;
|
|
15
17
|
protected _displacement: Coordinates;
|
|
16
18
|
_scale: number;
|
|
17
19
|
private gridSize;
|
|
20
|
+
private minimumScale;
|
|
21
|
+
private maximumScale;
|
|
22
|
+
private wheelSensitivity;
|
|
23
|
+
private animatedZoom;
|
|
24
|
+
private zoomFrame;
|
|
25
|
+
private zoomTarget;
|
|
26
|
+
private zoomDeadline;
|
|
27
|
+
private zoomLastFrame;
|
|
28
|
+
private zoomCenter;
|
|
29
|
+
private applyingZoomFrame;
|
|
18
30
|
size: Coordinates;
|
|
19
31
|
get scale(): number;
|
|
20
32
|
element: HTMLElement | null;
|
|
@@ -26,6 +38,8 @@ export declare class Canvas extends Element {
|
|
|
26
38
|
constructor(parent: Diagram);
|
|
27
39
|
/** Releases document listeners and cancels any viewport animation still in flight. */
|
|
28
40
|
dispose(): void;
|
|
41
|
+
/** Registers cleanup for decorations owned by a currently attached canvas surface. */
|
|
42
|
+
onDetach(callback: () => void): () => void;
|
|
29
43
|
/** Marks programmatic pointer sessions as eligible for the canvas drag lifecycle. */
|
|
30
44
|
markMouseSessionStartedInFrame(): void;
|
|
31
45
|
get dragging(): boolean;
|
|
@@ -35,6 +49,11 @@ export declare class Canvas extends Element {
|
|
|
35
49
|
protected bound(): void;
|
|
36
50
|
/** Centers a world point in the viewport and optionally animates the pan. */
|
|
37
51
|
centerOnPoint(c: Coordinates, animated?: boolean): void;
|
|
52
|
+
/**
|
|
53
|
+
* Minimally pans the viewport until a world-space box has the requested margin.
|
|
54
|
+
*/
|
|
55
|
+
ensureVisible(box: Dimensions, padding?: number, animated?: boolean): boolean;
|
|
56
|
+
private visibleOriginForInterval;
|
|
38
57
|
private animateDisplacement;
|
|
39
58
|
private cancelCenterAnimation;
|
|
40
59
|
private applyDisplacement;
|
|
@@ -42,6 +61,27 @@ export declare class Canvas extends Element {
|
|
|
42
61
|
displace(c: Coordinates): Coordinates;
|
|
43
62
|
/** Replaces the viewport displacement while respecting configured canvas bounds. */
|
|
44
63
|
setDisplacement(c: Coordinates): void;
|
|
64
|
+
/** Configures validated viewport limits and a constant scale increment per wheel pixel. */
|
|
65
|
+
configureZoom(options: {
|
|
66
|
+
minimumScale?: number;
|
|
67
|
+
maximumScale?: number;
|
|
68
|
+
wheelSensitivity?: number;
|
|
69
|
+
animated?: boolean;
|
|
70
|
+
}): void;
|
|
71
|
+
/** Applies the same configured limits to manual zoom, fitted content and restored cameras. */
|
|
72
|
+
clampScale(value: number): number;
|
|
73
|
+
/** Captures serializable camera coordinates without choosing an application storage backend. */
|
|
74
|
+
getCamera(): {
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
scale: number;
|
|
78
|
+
};
|
|
79
|
+
/** Restores a validated camera snapshot using the same limits as interactive viewport zoom. */
|
|
80
|
+
restoreCamera(camera: {
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
scale: number;
|
|
84
|
+
}): void;
|
|
45
85
|
/** Changes viewport scale around a screen-space focus point and preserves alignment. */
|
|
46
86
|
setScale(newScale: number, zoomCenter?: Coordinates): void;
|
|
47
87
|
/**
|
|
@@ -72,8 +112,13 @@ export declare class Canvas extends Element {
|
|
|
72
112
|
protected handleClick(originalEvent: MouseEvent): void;
|
|
73
113
|
protected handleMouseUp(originalEvent: MouseEvent): void;
|
|
74
114
|
protected handleMouseDown(originalEvent: MouseEvent): void;
|
|
115
|
+
protected handleFocusIn(originalEvent: FocusEvent): void;
|
|
75
116
|
protected handleKeyDown(originalEvent: KeyboardEvent): void;
|
|
76
117
|
protected handleKeyUp(originalEvent: KeyboardEvent): void;
|
|
77
118
|
protected handleKeyPress(originalEvent: KeyboardEvent): void;
|
|
119
|
+
private cancelZoomAnimation;
|
|
120
|
+
private animateWheelZoom;
|
|
121
|
+
private advanceWheelZoom;
|
|
122
|
+
private applyWheelZoom;
|
|
78
123
|
protected handleWheel(originalEvent: WheelEvent): void;
|
|
79
124
|
}
|
|
@@ -48,6 +48,12 @@ export type TDefaultExensions = {
|
|
|
48
48
|
};
|
|
49
49
|
export type TDiagramSettings = Partial<{
|
|
50
50
|
extensions: TDefaultExensions;
|
|
51
|
+
zoom: {
|
|
52
|
+
minimumScale?: number;
|
|
53
|
+
maximumScale?: number;
|
|
54
|
+
wheelSensitivity?: number;
|
|
55
|
+
animated?: boolean;
|
|
56
|
+
};
|
|
51
57
|
}>;
|
|
52
58
|
/** Owns diagram elements, extensions, camera state, and application interactions. */
|
|
53
59
|
export declare class Diagram extends Element {
|
|
@@ -142,8 +142,9 @@ export declare class DNodeConnectionIntentEvent extends DNodesConnectionEvent {
|
|
|
142
142
|
export declare class DNodesConnectActionEvent extends DNodesConnectionEvent {
|
|
143
143
|
origin: Node<any>;
|
|
144
144
|
target: Node<any>;
|
|
145
|
+
edge?: Edge | undefined;
|
|
145
146
|
protected readonly __brand: void;
|
|
146
|
-
constructor(src: Element, origin: Node<any>, target: Node<any
|
|
147
|
+
constructor(src: Element, origin: Node<any>, target: Node<any>, edge?: Edge | undefined);
|
|
147
148
|
}
|
|
148
149
|
export declare class DNodeChangeTypeEvent extends DChangeEvent {
|
|
149
150
|
protected readonly __brand: void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Diagram } from './Diagram';
|
|
2
|
+
import { Node } from './elements/Node';
|
|
3
|
+
import { Coordinates } from './primitives/Coordinates';
|
|
4
|
+
/** Selects, frames and persistently highlights a reference destination until a click outside it. */
|
|
5
|
+
export declare function revealDiagramNode(diagram: Diagram, node: Node, options?: {
|
|
6
|
+
point?: Coordinates;
|
|
7
|
+
attributeId?: string;
|
|
8
|
+
padding?: number;
|
|
9
|
+
preferredScale?: number;
|
|
10
|
+
}): boolean;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -5,7 +5,33 @@ export { BPMDiagram } from './Diagrams/custom/bpmn/BPMDiagram';
|
|
|
5
5
|
export type { BPMDiagramSettings } from './Diagrams/custom/bpmn/BPMDiagram';
|
|
6
6
|
export { BPMN_LABELS, configureBPMNLabels } from './Diagrams/custom/bpmn/config/BPMNLabels';
|
|
7
7
|
export type { BPMNLabelOverrides, BPMNLabels } from './Diagrams/custom/bpmn/config/BPMNLabels';
|
|
8
|
+
export { BPMNExecutionDiagram } from './Diagrams/custom/bpmnExecution/BPMNExecutionDiagram';
|
|
9
|
+
export type { BPMNExecutionDiagramSettings } from './Diagrams/custom/bpmnExecution/BPMNExecutionDiagram';
|
|
10
|
+
export { BPMNExecutionEdge } from './Diagrams/custom/bpmnExecution/BPMNExecutionEdge';
|
|
11
|
+
export { BPMNExecutionMarker } from './Diagrams/custom/bpmnExecution/BPMNExecutionMarker';
|
|
12
|
+
export { BPMNNodeExecutionState } from './Diagrams/custom/bpmnExecution/BPMNNodeExecutionState';
|
|
13
|
+
export { BPMNExecutionBlackBoxPoolNode } from './Diagrams/custom/bpmnExecution/nodes/BPMNExecutionBlackBoxPoolNode';
|
|
14
|
+
export { BPMNExecutionDataStoreNode } from './Diagrams/custom/bpmnExecution/nodes/BPMNExecutionDataStoreNode';
|
|
15
|
+
export { BPMNExecutionDocumentAnnotationNode } from './Diagrams/custom/bpmnExecution/nodes/BPMNExecutionDocumentAnnotationNode';
|
|
16
|
+
export { BPMNExecutionDocumentNode } from './Diagrams/custom/bpmnExecution/nodes/BPMNExecutionDocumentNode';
|
|
17
|
+
export { BPMNExecutionEventNode } from './Diagrams/custom/bpmnExecution/nodes/BPMNExecutionEventNode';
|
|
18
|
+
export { BPMNExecutionGateNode } from './Diagrams/custom/bpmnExecution/nodes/BPMNExecutionGateNode';
|
|
19
|
+
export { BPMNExecutionLanes } from './Diagrams/custom/bpmnExecution/nodes/BPMNExecutionLanes';
|
|
20
|
+
export { BPMNExecutionTaskNode } from './Diagrams/custom/bpmnExecution/nodes/BPMNExecutionTaskNode';
|
|
21
|
+
export { BPMNExecutionTextAnnotationNode } from './Diagrams/custom/bpmnExecution/nodes/BPMNExecutionTextAnnotationNode';
|
|
22
|
+
export { BPMNExecutionUnknownNode } from './Diagrams/custom/bpmnExecution/nodes/BPMNExecutionUnknownNode';
|
|
23
|
+
export type * from './Diagrams/custom/bpmnExecution/types';
|
|
8
24
|
export { CommunicationDiagram } from './Diagrams/custom/communication/CommunicationDiagram';
|
|
9
25
|
export type { CommunicationNodeType } from './Diagrams/custom/communication/types';
|
|
26
|
+
export { MRForeignKeyEdge } from './Diagrams/custom/mr/edges/MRForeignKeyEdge';
|
|
27
|
+
export { MRDiagram } from './Diagrams/custom/mr/MRDiagram';
|
|
28
|
+
export { MRTableNode } from './Diagrams/custom/mr/nodes/MRTableNode';
|
|
29
|
+
export type * from './Diagrams/custom/mr/types';
|
|
10
30
|
export { DiagramEditor } from './Diagrams/DiagramEditor';
|
|
11
31
|
export { Diagram } from './Diagrams/store/Diagram';
|
|
32
|
+
export { customRendererProps } from './Diagrams/components/objects/customRendererProps';
|
|
33
|
+
export { stopDiagramControlEvent } from './Diagrams/components/stopDiagramControlEvent';
|
|
34
|
+
export { useDiagramPointerCapture } from './Diagrams/components/useDiagramPointerCapture';
|
|
35
|
+
export { bindAttributeRelationshipHover } from './Diagrams/custom/mr/bindAttributeRelationshipHover';
|
|
36
|
+
export { Coordinates } from './Diagrams/store/primitives/Coordinates';
|
|
37
|
+
export { revealDiagramNode } from './Diagrams/store/revealDiagramNode';
|
package/package.json
CHANGED
|
@@ -1,45 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@focus.matters/diagrams",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
}
|
|
45
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@focus.matters/diagrams",
|
|
3
|
+
"version": "0.2.20",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"main": "./dist/index.umd.js",
|
|
10
|
+
"module": "./dist/index.es.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.es.js",
|
|
16
|
+
"require": "./dist/index.umd.js"
|
|
17
|
+
},
|
|
18
|
+
"./diagrams.css": "./dist/diagrams.css"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "vite build",
|
|
25
|
+
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"html2canvas": "^1.4.1",
|
|
29
|
+
"mobx": "^6.13.7",
|
|
30
|
+
"mobx-react-lite": "^4.1.0",
|
|
31
|
+
"react": "^19.0.0",
|
|
32
|
+
"react-dom": "^19.0.0",
|
|
33
|
+
"react-icons": "^5.0.0",
|
|
34
|
+
"svg-path-bbox": "^2.1.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"html2canvas": "^1.4.1",
|
|
38
|
+
"mobx": "^6.13.7",
|
|
39
|
+
"mobx-react-lite": "^4.1.0",
|
|
40
|
+
"react": "^19.0.0",
|
|
41
|
+
"react-dom": "^19.0.0",
|
|
42
|
+
"react-icons": "^5.0.0",
|
|
43
|
+
"svg-path-bbox": "^2.1.0"
|
|
44
|
+
},
|
|
45
|
+
"gitHead": "f866b7ee0e0b98b4d9525fcb71185029df8a4996",
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@dagrejs/dagre": "^3.0.0"
|
|
48
|
+
},
|
|
49
|
+
"candidateSourceCommit": "f71a92ce06888e913044f4ef56d1680b0b19ce70"
|
|
50
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DirectedPoint-BcpEj8ub.js","sources":["../src/Diagrams/store/primitives/DirectedPoint.ts"],"sourcesContent":["import type { TOrientation } from \"../types\";\r\nimport { Coordinates } from \"./Coordinates\";\r\n\r\nexport class DirectedPoint extends Coordinates {\r\n direction: TOrientation = \"left\";\r\n\r\n get rawDirectedPoint() {\r\n return {\r\n x: this.x,\r\n y: this.y,\r\n direction: this.direction,\r\n };\r\n }\r\n\r\n stepBack() {\r\n switch (this.direction) {\r\n case \"down\":\r\n this.y--;\r\n break;\r\n case \"left\":\r\n this.x++;\r\n break;\r\n case \"right\":\r\n this.x--;\r\n break;\r\n case \"up\":\r\n this.y++;\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n stepForward() {\r\n switch (this.direction) {\r\n case \"down\":\r\n this.y++;\r\n break;\r\n case \"left\":\r\n this.x--;\r\n break;\r\n case \"right\":\r\n this.x++;\r\n break;\r\n case \"up\":\r\n this.y--;\r\n break;\r\n }\r\n return this;\r\n }\r\n}\r\n"],"names":["_DirectedPoint","Coordinates","__name","DirectedPoint"],"mappings":";;;AAGO,MAAMA,IAAN,MAAMA,UAAsBC,EAAY;AAAA,EAC7C,YAA0B;AAAA,EAE1B,IAAI,mBAAmB;AACrB,WAAO;AAAA,MACL,GAAG,KAAK;AAAA,MACR,GAAG,KAAK;AAAA,MACR,WAAW,KAAK;AAAA,IAAA;AAAA,EAEpB;AAAA,EAEA,WAAW;AACT,YAAQ,KAAK,WAAA;AAAA,MACX,KAAK;AACH,aAAK;AACL;AAAA,MACF,KAAK;AACH,aAAK;AACL;AAAA,MACF,KAAK;AACH,aAAK;AACL;AAAA,MACF,KAAK;AACH,aAAK;AACL;AAAA,IAAA;AAEJ,WAAO;AAAA,EACT;AAAA,EAEA,cAAc;AACZ,YAAQ,KAAK,WAAA;AAAA,MACX,KAAK;AACH,aAAK;AACL;AAAA,MACF,KAAK;AACH,aAAK;AACL;AAAA,MACF,KAAK;AACH,aAAK;AACL;AAAA,MACF,KAAK;AACH,aAAK;AACL;AAAA,IAAA;AAEJ,WAAO;AAAA,EACT;AACF;AA9C+CC,EAAAF,GAAA;AAAxC,IAAMG,IAANH;"}
|