@focus.matters/diagrams 0.1.1 → 0.2.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.
- package/dist/{DirectedPoint-BcpEj8ub.js → DirectedPoint-BSGh_PUt.js} +2 -2
- package/dist/DirectedPoint-BSGh_PUt.js.map +1 -0
- package/dist/diagrams.css +1 -1
- package/dist/index-y4Eon_hl.js +16196 -0
- package/dist/{index-hTkL5cDr.js.map → index-y4Eon_hl.js.map} +1 -1
- package/dist/index.es.js +25 -8
- 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/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/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/elements/Events.d.ts +2 -1
- package/dist/src/index.d.ts +20 -0
- package/package.json +4 -1
- package/dist/DirectedPoint-BcpEj8ub.js.map +0 -1
- package/dist/index-hTkL5cDr.js +0 -12037
|
@@ -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
|
+
};
|
|
@@ -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;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -5,7 +5,27 @@ 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';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@focus.matters/diagrams",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
"svg-path-bbox": "^2.1.0"
|
|
39
39
|
},
|
|
40
40
|
"gitHead": "f866b7ee0e0b98b4d9525fcb71185029df8a4996",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@dagrejs/dagre": "^3.0.0"
|
|
43
|
+
},
|
|
41
44
|
"scripts": {
|
|
42
45
|
"build": "vite build",
|
|
43
46
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
@@ -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;"}
|