orcasvn-react-diagrams 0.1.6 → 0.1.8
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/cjs/index.js +27 -1
- package/dist/cjs/types/index.d.ts +1 -6
- package/dist/cjs/types/mocks/portIn.d.ts +4 -0
- package/dist/cjs/types/models/implementations/Element.d.ts +1 -1
- package/dist/cjs/types/models/implementations/index.d.ts +2 -1
- package/dist/esm/index.js +27 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/index.d.ts +1 -6
- package/dist/esm/types/mocks/portIn.d.ts +4 -0
- package/dist/esm/types/models/implementations/Element.d.ts +1 -1
- package/dist/esm/types/models/implementations/index.d.ts +2 -1
- package/dist/index.d.ts +14 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -441,7 +441,7 @@ function generateUniqueId() {
|
|
|
441
441
|
}
|
|
442
442
|
|
|
443
443
|
var Element$1 = /** @class */ (function () {
|
|
444
|
-
function Element(x, y, width, height, cssClass, renderShape, texts, ports, portMovealeAreas, portSlideRailSVGClassName, portDirection) {
|
|
444
|
+
function Element(x, y, width, height, cssClass, renderShape, texts, ports, portMovealeAreas, portSlideRailSVGClassName, portDirection, parentElement) {
|
|
445
445
|
if (portMovealeAreas === void 0) { portMovealeAreas = []; }
|
|
446
446
|
this.resizability = {
|
|
447
447
|
enabled: true,
|
|
@@ -459,6 +459,7 @@ var Element$1 = /** @class */ (function () {
|
|
|
459
459
|
this.portMoveableAreas = portMovealeAreas;
|
|
460
460
|
this.portSlideRailSVGClassName = portSlideRailSVGClassName;
|
|
461
461
|
this.portDirection = portDirection;
|
|
462
|
+
this.parentElement = parentElement;
|
|
462
463
|
}
|
|
463
464
|
Object.defineProperty(Element.prototype, "id", {
|
|
464
465
|
get: function () {
|
|
@@ -610,6 +611,28 @@ var ElementLink$1 = /** @class */ (function () {
|
|
|
610
611
|
return ElementLink;
|
|
611
612
|
}());
|
|
612
613
|
|
|
614
|
+
var Text$2 = /** @class */ (function () {
|
|
615
|
+
function Text(content, width, height, x, y, align, fontSize, border) {
|
|
616
|
+
this._id = generateUniqueId();
|
|
617
|
+
this.content = content;
|
|
618
|
+
this.align = align;
|
|
619
|
+
this.fontSize = fontSize;
|
|
620
|
+
this.border = border;
|
|
621
|
+
this.size = { width: width, height: height };
|
|
622
|
+
if (x && y) {
|
|
623
|
+
this.position = { x: x, y: y };
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
Object.defineProperty(Text.prototype, "id", {
|
|
627
|
+
get: function () {
|
|
628
|
+
return this._id;
|
|
629
|
+
},
|
|
630
|
+
enumerable: false,
|
|
631
|
+
configurable: true
|
|
632
|
+
});
|
|
633
|
+
return Text;
|
|
634
|
+
}());
|
|
635
|
+
|
|
613
636
|
var EditorContext = /** @class */ (function () {
|
|
614
637
|
function EditorContext(elements, links, texts) {
|
|
615
638
|
this._elements = elements;
|
|
@@ -7788,6 +7811,7 @@ var Element = function (props) {
|
|
|
7788
7811
|
};
|
|
7789
7812
|
//Normalize port position
|
|
7790
7813
|
var normalizePortPosition = function (tempNewPosition) {
|
|
7814
|
+
console.info('normalizePortPosition', tempNewPosition);
|
|
7791
7815
|
var newPosition;
|
|
7792
7816
|
if (portMoveableAreas && portMoveableAreas.length > 0) { //If moveable areas is defined
|
|
7793
7817
|
newPosition = normalizePortPositionOnMoveableAreas(portMoveableAreas, tempNewPosition);
|
|
@@ -7914,6 +7938,7 @@ var Element = function (props) {
|
|
|
7914
7938
|
};
|
|
7915
7939
|
//Get rotate angle of port by port direction is defined.
|
|
7916
7940
|
var rotatePort = React.useCallback(function (port) {
|
|
7941
|
+
console.info('calculating port rotation', port);
|
|
7917
7942
|
if (!portSlideRailSVGClassName)
|
|
7918
7943
|
return 0;
|
|
7919
7944
|
var slideRailSVG = getSlideRailSVG(portSlideRailSVGClassName);
|
|
@@ -8763,5 +8788,6 @@ exports.PortRC = Port;
|
|
|
8763
8788
|
exports.RectangleRC = Rectangle;
|
|
8764
8789
|
exports.RectangularFrameRC = RectangularFrame;
|
|
8765
8790
|
exports.ShapeWrapperRC = ShapeWrapper;
|
|
8791
|
+
exports.Text = Text$2;
|
|
8766
8792
|
exports.TextRC = Text$1;
|
|
8767
8793
|
exports.default = Editor;
|
|
@@ -28,7 +28,7 @@ export default class Element implements IElement {
|
|
|
28
28
|
onResized?: ((width: number, height: number) => void) | undefined;
|
|
29
29
|
onMoved?: ((x: number, y: number) => void) | undefined;
|
|
30
30
|
_eventEmitter: EventEmitter;
|
|
31
|
-
constructor(x: number, y: number, width: number, height: number, cssClass?: string, renderShape?: (props: IElementProps) => JSX.Element, texts?: IText[], ports?: IPort[], portMovealeAreas?: IPosition[][], portSlideRailSVGClassName?: string, portDirection?: SubObjectDirection);
|
|
31
|
+
constructor(x: number, y: number, width: number, height: number, cssClass?: string, renderShape?: (props: IElementProps) => JSX.Element, texts?: IText[], ports?: IPort[], portMovealeAreas?: IPosition[][], portSlideRailSVGClassName?: string, portDirection?: SubObjectDirection, parentElement?: Element);
|
|
32
32
|
get id(): string;
|
|
33
33
|
get size(): ISize;
|
|
34
34
|
set size(value: ISize);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Element from './Element';
|
|
2
2
|
import Port from './Port';
|
|
3
3
|
import ElementLink from './ElementLink';
|
|
4
|
+
import Text from './Text';
|
|
4
5
|
export * from './EditorContext';
|
|
5
6
|
export * from './CustomPort';
|
|
6
|
-
export { Element, Port, ElementLink };
|
|
7
|
+
export { Element, Port, ElementLink, Text };
|
package/dist/esm/index.js
CHANGED
|
@@ -437,7 +437,7 @@ function generateUniqueId() {
|
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
var Element$1 = /** @class */ (function () {
|
|
440
|
-
function Element(x, y, width, height, cssClass, renderShape, texts, ports, portMovealeAreas, portSlideRailSVGClassName, portDirection) {
|
|
440
|
+
function Element(x, y, width, height, cssClass, renderShape, texts, ports, portMovealeAreas, portSlideRailSVGClassName, portDirection, parentElement) {
|
|
441
441
|
if (portMovealeAreas === void 0) { portMovealeAreas = []; }
|
|
442
442
|
this.resizability = {
|
|
443
443
|
enabled: true,
|
|
@@ -455,6 +455,7 @@ var Element$1 = /** @class */ (function () {
|
|
|
455
455
|
this.portMoveableAreas = portMovealeAreas;
|
|
456
456
|
this.portSlideRailSVGClassName = portSlideRailSVGClassName;
|
|
457
457
|
this.portDirection = portDirection;
|
|
458
|
+
this.parentElement = parentElement;
|
|
458
459
|
}
|
|
459
460
|
Object.defineProperty(Element.prototype, "id", {
|
|
460
461
|
get: function () {
|
|
@@ -606,6 +607,28 @@ var ElementLink$1 = /** @class */ (function () {
|
|
|
606
607
|
return ElementLink;
|
|
607
608
|
}());
|
|
608
609
|
|
|
610
|
+
var Text$2 = /** @class */ (function () {
|
|
611
|
+
function Text(content, width, height, x, y, align, fontSize, border) {
|
|
612
|
+
this._id = generateUniqueId();
|
|
613
|
+
this.content = content;
|
|
614
|
+
this.align = align;
|
|
615
|
+
this.fontSize = fontSize;
|
|
616
|
+
this.border = border;
|
|
617
|
+
this.size = { width: width, height: height };
|
|
618
|
+
if (x && y) {
|
|
619
|
+
this.position = { x: x, y: y };
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
Object.defineProperty(Text.prototype, "id", {
|
|
623
|
+
get: function () {
|
|
624
|
+
return this._id;
|
|
625
|
+
},
|
|
626
|
+
enumerable: false,
|
|
627
|
+
configurable: true
|
|
628
|
+
});
|
|
629
|
+
return Text;
|
|
630
|
+
}());
|
|
631
|
+
|
|
609
632
|
var EditorContext = /** @class */ (function () {
|
|
610
633
|
function EditorContext(elements, links, texts) {
|
|
611
634
|
this._elements = elements;
|
|
@@ -7784,6 +7807,7 @@ var Element = function (props) {
|
|
|
7784
7807
|
};
|
|
7785
7808
|
//Normalize port position
|
|
7786
7809
|
var normalizePortPosition = function (tempNewPosition) {
|
|
7810
|
+
console.info('normalizePortPosition', tempNewPosition);
|
|
7787
7811
|
var newPosition;
|
|
7788
7812
|
if (portMoveableAreas && portMoveableAreas.length > 0) { //If moveable areas is defined
|
|
7789
7813
|
newPosition = normalizePortPositionOnMoveableAreas(portMoveableAreas, tempNewPosition);
|
|
@@ -7910,6 +7934,7 @@ var Element = function (props) {
|
|
|
7910
7934
|
};
|
|
7911
7935
|
//Get rotate angle of port by port direction is defined.
|
|
7912
7936
|
var rotatePort = useCallback(function (port) {
|
|
7937
|
+
console.info('calculating port rotation', port);
|
|
7913
7938
|
if (!portSlideRailSVGClassName)
|
|
7914
7939
|
return 0;
|
|
7915
7940
|
var slideRailSVG = getSlideRailSVG(portSlideRailSVGClassName);
|
|
@@ -8746,5 +8771,5 @@ function Editor(_a) {
|
|
|
8746
8771
|
React.createElement(Paper, { size: { width: 3000, height: 3000 }, elements: editorContext.elements, links: editorContext.links, texts: editorContext.texts, onPaperClicked: editorContext.onPaperClicked, onPortMoved: editorContext.onPortMoved, onElementMoved: editorContext.onElementMoved, onElementResized: editorContext.onElementResized, onLinkValidation: editorContext.validateLink, onCreatingLink: editorContext.onCreatingLink, onCreatingPortByLinking: editorContext.onCreatingPortByLinking })));
|
|
8747
8772
|
}
|
|
8748
8773
|
|
|
8749
|
-
export { Circle as CircleRC, Crescent as CrescentRC, CustomPort, CustomShape as CustomShapeRC, EditorContext, Element$1 as Element, ElementLink$1 as ElementLink, ElementLink as ElementLinkRC, Port$1 as Port, Port as PortRC, PositioningAnchor, Rectangle as RectangleRC, RectangularFrame as RectangularFrameRC, ResizingDirection, ShapeWrapper as ShapeWrapperRC, SubObjectDirection, TextAlign, Text$1 as TextRC, Editor as default };
|
|
8774
|
+
export { Circle as CircleRC, Crescent as CrescentRC, CustomPort, CustomShape as CustomShapeRC, EditorContext, Element$1 as Element, ElementLink$1 as ElementLink, ElementLink as ElementLinkRC, Port$1 as Port, Port as PortRC, PositioningAnchor, Rectangle as RectangleRC, RectangularFrame as RectangularFrameRC, ResizingDirection, ShapeWrapper as ShapeWrapperRC, SubObjectDirection, Text$2 as Text, TextAlign, Text$1 as TextRC, Editor as default };
|
|
8750
8775
|
//# sourceMappingURL=index.js.map
|