microboard-temp 0.5.104 → 0.5.106
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/browser.js +16 -22
- package/dist/cjs/index.js +16 -22
- package/dist/cjs/node.js +20 -26
- package/dist/esm/browser.js +13 -19
- package/dist/esm/index.js +13 -19
- package/dist/esm/node.js +13 -19
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -11186,7 +11186,7 @@ function bail(error) {
|
|
|
11186
11186
|
}
|
|
11187
11187
|
|
|
11188
11188
|
// node_modules/unified/lib/index.js
|
|
11189
|
-
var import_extend = __toESM(require_extend());
|
|
11189
|
+
var import_extend = __toESM(require_extend(), 1);
|
|
11190
11190
|
|
|
11191
11191
|
// node_modules/devlop/lib/development.js
|
|
11192
11192
|
var codesWarned = new Set;
|
|
@@ -15909,7 +15909,7 @@ var attentionMarkers = { null: [codes.asterisk, codes.underscore] };
|
|
|
15909
15909
|
var disable = { null: [] };
|
|
15910
15910
|
|
|
15911
15911
|
// node_modules/micromark/dev/lib/create-tokenizer.js
|
|
15912
|
-
var import_debug = __toESM(require_browser());
|
|
15912
|
+
var import_debug = __toESM(require_browser(), 1);
|
|
15913
15913
|
var debug = import_debug.default("micromark");
|
|
15914
15914
|
function createTokenizer(parser, initialize, from) {
|
|
15915
15915
|
let point2 = {
|
|
@@ -17068,7 +17068,7 @@ function remarkParse(options) {
|
|
|
17068
17068
|
}
|
|
17069
17069
|
}
|
|
17070
17070
|
// node_modules/remark-slate/dist/remark-slate.esm.js
|
|
17071
|
-
var import_escape_html = __toESM(require_escape_html());
|
|
17071
|
+
var import_escape_html = __toESM(require_escape_html(), 1);
|
|
17072
17072
|
function _extends() {
|
|
17073
17073
|
_extends = Object.assign || function(target) {
|
|
17074
17074
|
for (var i = 1;i < arguments.length; i++) {
|
|
@@ -36670,7 +36670,6 @@ function radiansBetweenPoints(point1, point22) {
|
|
|
36670
36670
|
}
|
|
36671
36671
|
|
|
36672
36672
|
// src/Items/Connector/getLine/findOrthogonalPath.ts
|
|
36673
|
-
var ITEM_OFFSET = 1;
|
|
36674
36673
|
function getDirection(from, to) {
|
|
36675
36674
|
if (!to) {
|
|
36676
36675
|
return null;
|
|
@@ -36713,7 +36712,7 @@ function getNeighbors(node2, grid, obstacles) {
|
|
|
36713
36712
|
for (const pos of potentialNeighbors) {
|
|
36714
36713
|
if (pos.x >= 0 && pos.x < grid.length && pos.y >= 0) {
|
|
36715
36714
|
const newPoint = grid[pos.x][pos.y];
|
|
36716
|
-
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint,
|
|
36715
|
+
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint, conf.CONNECTOR_ITEM_OFFSET - 1))) {
|
|
36717
36716
|
neighbors.push({
|
|
36718
36717
|
point: newPoint,
|
|
36719
36718
|
costSoFar: 0,
|
|
@@ -36761,10 +36760,10 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36761
36760
|
const endDir = getPointerDirection(end);
|
|
36762
36761
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36763
36762
|
const offsetMap = {
|
|
36764
|
-
top: { x: 0, y: -
|
|
36765
|
-
bottom: { x: 0, y:
|
|
36766
|
-
right: { x:
|
|
36767
|
-
left: { x: -
|
|
36763
|
+
top: { x: 0, y: -conf.CONNECTOR_ITEM_OFFSET },
|
|
36764
|
+
bottom: { x: 0, y: conf.CONNECTOR_ITEM_OFFSET },
|
|
36765
|
+
right: { x: conf.CONNECTOR_ITEM_OFFSET, y: 0 },
|
|
36766
|
+
left: { x: -conf.CONNECTOR_ITEM_OFFSET, y: 0 }
|
|
36768
36767
|
};
|
|
36769
36768
|
const horizontalLines = [];
|
|
36770
36769
|
const verticalLines = [];
|
|
@@ -36775,19 +36774,10 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36775
36774
|
const mbrFloored = new Mbr(Math.floor(itemMbr.left), Math.floor(itemMbr.top), Math.floor(itemMbr.right), Math.floor(itemMbr.bottom));
|
|
36776
36775
|
const pointOnMbr = mbrFloored.getLines()[revertMapDir[dir2]].getNearestPointOnLineSegment(point5);
|
|
36777
36776
|
const newPoint = Object.create(Object.getPrototypeOf(point5), Object.getOwnPropertyDescriptors(point5));
|
|
36778
|
-
newPoint.x = pointOnMbr.x;
|
|
36779
|
-
newPoint.y = pointOnMbr.y;
|
|
36780
|
-
|
|
36781
|
-
|
|
36782
|
-
} else if (dir2 === "bottom") {
|
|
36783
|
-
newPoint.y += ITEM_OFFSET;
|
|
36784
|
-
} else if (dir2 === "left") {
|
|
36785
|
-
newPoint.x -= ITEM_OFFSET;
|
|
36786
|
-
} else if (dir2 === "right") {
|
|
36787
|
-
newPoint.x += ITEM_OFFSET;
|
|
36788
|
-
}
|
|
36789
|
-
verticalLines.push(mbrFloored.left - ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + ITEM_OFFSET);
|
|
36790
|
-
horizontalLines.push(mbrFloored.top - ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + ITEM_OFFSET);
|
|
36777
|
+
newPoint.x = pointOnMbr.x + offsetMap[dir2].x;
|
|
36778
|
+
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
36779
|
+
verticalLines.push(mbrFloored.left - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36780
|
+
horizontalLines.push(mbrFloored.top - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36791
36781
|
return newPoint;
|
|
36792
36782
|
};
|
|
36793
36783
|
if (start.pointType !== "Board" && startDir) {
|
|
@@ -54457,6 +54447,10 @@ class Board {
|
|
|
54457
54447
|
itemData.endPoint.x += -minX + x;
|
|
54458
54448
|
itemData.endPoint.y += -minY + y;
|
|
54459
54449
|
}
|
|
54450
|
+
if (itemData.middlePoint?.pointType === "Board") {
|
|
54451
|
+
itemData.endPoint.x += -minX + x;
|
|
54452
|
+
itemData.endPoint.y += -minY + y;
|
|
54453
|
+
}
|
|
54460
54454
|
} else if (itemData.transformation) {
|
|
54461
54455
|
itemData.transformation.translateX = translateX - minX + x;
|
|
54462
54456
|
itemData.transformation.translateY = translateY - minY + y;
|
package/dist/cjs/index.js
CHANGED
|
@@ -11186,7 +11186,7 @@ function bail(error) {
|
|
|
11186
11186
|
}
|
|
11187
11187
|
|
|
11188
11188
|
// node_modules/unified/lib/index.js
|
|
11189
|
-
var import_extend = __toESM(require_extend());
|
|
11189
|
+
var import_extend = __toESM(require_extend(), 1);
|
|
11190
11190
|
|
|
11191
11191
|
// node_modules/devlop/lib/development.js
|
|
11192
11192
|
var codesWarned = new Set;
|
|
@@ -15909,7 +15909,7 @@ var attentionMarkers = { null: [codes.asterisk, codes.underscore] };
|
|
|
15909
15909
|
var disable = { null: [] };
|
|
15910
15910
|
|
|
15911
15911
|
// node_modules/micromark/dev/lib/create-tokenizer.js
|
|
15912
|
-
var import_debug = __toESM(require_browser());
|
|
15912
|
+
var import_debug = __toESM(require_browser(), 1);
|
|
15913
15913
|
var debug = import_debug.default("micromark");
|
|
15914
15914
|
function createTokenizer(parser, initialize, from) {
|
|
15915
15915
|
let point2 = {
|
|
@@ -17068,7 +17068,7 @@ function remarkParse(options) {
|
|
|
17068
17068
|
}
|
|
17069
17069
|
}
|
|
17070
17070
|
// node_modules/remark-slate/dist/remark-slate.esm.js
|
|
17071
|
-
var import_escape_html = __toESM(require_escape_html());
|
|
17071
|
+
var import_escape_html = __toESM(require_escape_html(), 1);
|
|
17072
17072
|
function _extends() {
|
|
17073
17073
|
_extends = Object.assign || function(target) {
|
|
17074
17074
|
for (var i = 1;i < arguments.length; i++) {
|
|
@@ -36670,7 +36670,6 @@ function radiansBetweenPoints(point1, point22) {
|
|
|
36670
36670
|
}
|
|
36671
36671
|
|
|
36672
36672
|
// src/Items/Connector/getLine/findOrthogonalPath.ts
|
|
36673
|
-
var ITEM_OFFSET = 1;
|
|
36674
36673
|
function getDirection(from, to) {
|
|
36675
36674
|
if (!to) {
|
|
36676
36675
|
return null;
|
|
@@ -36713,7 +36712,7 @@ function getNeighbors(node2, grid, obstacles) {
|
|
|
36713
36712
|
for (const pos of potentialNeighbors) {
|
|
36714
36713
|
if (pos.x >= 0 && pos.x < grid.length && pos.y >= 0) {
|
|
36715
36714
|
const newPoint = grid[pos.x][pos.y];
|
|
36716
|
-
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint,
|
|
36715
|
+
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint, conf.CONNECTOR_ITEM_OFFSET - 1))) {
|
|
36717
36716
|
neighbors.push({
|
|
36718
36717
|
point: newPoint,
|
|
36719
36718
|
costSoFar: 0,
|
|
@@ -36761,10 +36760,10 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36761
36760
|
const endDir = getPointerDirection(end);
|
|
36762
36761
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36763
36762
|
const offsetMap = {
|
|
36764
|
-
top: { x: 0, y: -
|
|
36765
|
-
bottom: { x: 0, y:
|
|
36766
|
-
right: { x:
|
|
36767
|
-
left: { x: -
|
|
36763
|
+
top: { x: 0, y: -conf.CONNECTOR_ITEM_OFFSET },
|
|
36764
|
+
bottom: { x: 0, y: conf.CONNECTOR_ITEM_OFFSET },
|
|
36765
|
+
right: { x: conf.CONNECTOR_ITEM_OFFSET, y: 0 },
|
|
36766
|
+
left: { x: -conf.CONNECTOR_ITEM_OFFSET, y: 0 }
|
|
36768
36767
|
};
|
|
36769
36768
|
const horizontalLines = [];
|
|
36770
36769
|
const verticalLines = [];
|
|
@@ -36775,19 +36774,10 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36775
36774
|
const mbrFloored = new Mbr(Math.floor(itemMbr.left), Math.floor(itemMbr.top), Math.floor(itemMbr.right), Math.floor(itemMbr.bottom));
|
|
36776
36775
|
const pointOnMbr = mbrFloored.getLines()[revertMapDir[dir2]].getNearestPointOnLineSegment(point5);
|
|
36777
36776
|
const newPoint = Object.create(Object.getPrototypeOf(point5), Object.getOwnPropertyDescriptors(point5));
|
|
36778
|
-
newPoint.x = pointOnMbr.x;
|
|
36779
|
-
newPoint.y = pointOnMbr.y;
|
|
36780
|
-
|
|
36781
|
-
|
|
36782
|
-
} else if (dir2 === "bottom") {
|
|
36783
|
-
newPoint.y += ITEM_OFFSET;
|
|
36784
|
-
} else if (dir2 === "left") {
|
|
36785
|
-
newPoint.x -= ITEM_OFFSET;
|
|
36786
|
-
} else if (dir2 === "right") {
|
|
36787
|
-
newPoint.x += ITEM_OFFSET;
|
|
36788
|
-
}
|
|
36789
|
-
verticalLines.push(mbrFloored.left - ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + ITEM_OFFSET);
|
|
36790
|
-
horizontalLines.push(mbrFloored.top - ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + ITEM_OFFSET);
|
|
36777
|
+
newPoint.x = pointOnMbr.x + offsetMap[dir2].x;
|
|
36778
|
+
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
36779
|
+
verticalLines.push(mbrFloored.left - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36780
|
+
horizontalLines.push(mbrFloored.top - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36791
36781
|
return newPoint;
|
|
36792
36782
|
};
|
|
36793
36783
|
if (start.pointType !== "Board" && startDir) {
|
|
@@ -54457,6 +54447,10 @@ class Board {
|
|
|
54457
54447
|
itemData.endPoint.x += -minX + x;
|
|
54458
54448
|
itemData.endPoint.y += -minY + y;
|
|
54459
54449
|
}
|
|
54450
|
+
if (itemData.middlePoint?.pointType === "Board") {
|
|
54451
|
+
itemData.endPoint.x += -minX + x;
|
|
54452
|
+
itemData.endPoint.y += -minY + y;
|
|
54453
|
+
}
|
|
54460
54454
|
} else if (itemData.transformation) {
|
|
54461
54455
|
itemData.transformation.translateX = translateX - minX + x;
|
|
54462
54456
|
itemData.transformation.translateY = translateY - minY + y;
|
package/dist/cjs/node.js
CHANGED
|
@@ -11355,7 +11355,7 @@ function fillText(ctx, textBlock) {
|
|
|
11355
11355
|
|
|
11356
11356
|
// src/Items/RichText/EditorContainer.ts
|
|
11357
11357
|
var import_slate29 = require("slate");
|
|
11358
|
-
var import_slate_history = __toESM(require_dist());
|
|
11358
|
+
var import_slate_history = __toESM(require_dist(), 1);
|
|
11359
11359
|
var import_slate_react5 = require("slate-react");
|
|
11360
11360
|
|
|
11361
11361
|
// src/Items/RichText/editorHelpers/common/isTextEmpty.ts
|
|
@@ -12011,7 +12011,7 @@ function bail(error) {
|
|
|
12011
12011
|
}
|
|
12012
12012
|
|
|
12013
12013
|
// node_modules/unified/lib/index.js
|
|
12014
|
-
var import_extend = __toESM(require_extend());
|
|
12014
|
+
var import_extend = __toESM(require_extend(), 1);
|
|
12015
12015
|
|
|
12016
12016
|
// node_modules/devlop/lib/development.js
|
|
12017
12017
|
var codesWarned = new Set;
|
|
@@ -18615,7 +18615,7 @@ var attentionMarkers = { null: [codes.asterisk, codes.underscore] };
|
|
|
18615
18615
|
var disable = { null: [] };
|
|
18616
18616
|
|
|
18617
18617
|
// node_modules/micromark/dev/lib/create-tokenizer.js
|
|
18618
|
-
var import_debug = __toESM(require_src());
|
|
18618
|
+
var import_debug = __toESM(require_src(), 1);
|
|
18619
18619
|
var debug = import_debug.default("micromark");
|
|
18620
18620
|
function createTokenizer(parser, initialize, from) {
|
|
18621
18621
|
let point2 = {
|
|
@@ -19774,7 +19774,7 @@ function remarkParse(options) {
|
|
|
19774
19774
|
}
|
|
19775
19775
|
}
|
|
19776
19776
|
// src/Items/RichText/editorHelpers/markdown/markdownProcessor.ts
|
|
19777
|
-
var import_remark_slate = __toESM(require_dist2());
|
|
19777
|
+
var import_remark_slate = __toESM(require_dist2(), 1);
|
|
19778
19778
|
|
|
19779
19779
|
// src/Items/RichText/setNodeStyles.ts
|
|
19780
19780
|
var import_slate18 = require("slate");
|
|
@@ -22795,7 +22795,7 @@ function multiSelect(arr2, left, right, n, compare) {
|
|
|
22795
22795
|
}
|
|
22796
22796
|
|
|
22797
22797
|
// node_modules/rbush-knn/index.js
|
|
22798
|
-
var import_tinyqueue = __toESM(require_tinyqueue());
|
|
22798
|
+
var import_tinyqueue = __toESM(require_tinyqueue(), 1);
|
|
22799
22799
|
function knn(tree, x, y, n, predicate, maxDistance) {
|
|
22800
22800
|
let node2 = tree.data;
|
|
22801
22801
|
const result = [];
|
|
@@ -38145,7 +38145,7 @@ function remarkStringify(options) {
|
|
|
38145
38145
|
}
|
|
38146
38146
|
}
|
|
38147
38147
|
// src/Items/RichText/transformHtmlToMarkdown.ts
|
|
38148
|
-
var import_remark_slate2 = __toESM(require_dist2());
|
|
38148
|
+
var import_remark_slate2 = __toESM(require_dist2(), 1);
|
|
38149
38149
|
var transformHtmlOrTextToMarkdown = async (text5, html4) => {
|
|
38150
38150
|
let markdownString = text5;
|
|
38151
38151
|
if (html4) {
|
|
@@ -39143,7 +39143,6 @@ function radiansBetweenPoints(point1, point22) {
|
|
|
39143
39143
|
}
|
|
39144
39144
|
|
|
39145
39145
|
// src/Items/Connector/getLine/findOrthogonalPath.ts
|
|
39146
|
-
var ITEM_OFFSET = 1;
|
|
39147
39146
|
function getDirection(from, to) {
|
|
39148
39147
|
if (!to) {
|
|
39149
39148
|
return null;
|
|
@@ -39186,7 +39185,7 @@ function getNeighbors(node2, grid, obstacles) {
|
|
|
39186
39185
|
for (const pos of potentialNeighbors) {
|
|
39187
39186
|
if (pos.x >= 0 && pos.x < grid.length && pos.y >= 0) {
|
|
39188
39187
|
const newPoint = grid[pos.x][pos.y];
|
|
39189
|
-
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint,
|
|
39188
|
+
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint, conf.CONNECTOR_ITEM_OFFSET - 1))) {
|
|
39190
39189
|
neighbors.push({
|
|
39191
39190
|
point: newPoint,
|
|
39192
39191
|
costSoFar: 0,
|
|
@@ -39234,10 +39233,10 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
39234
39233
|
const endDir = getPointerDirection(end);
|
|
39235
39234
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
39236
39235
|
const offsetMap = {
|
|
39237
|
-
top: { x: 0, y: -
|
|
39238
|
-
bottom: { x: 0, y:
|
|
39239
|
-
right: { x:
|
|
39240
|
-
left: { x: -
|
|
39236
|
+
top: { x: 0, y: -conf.CONNECTOR_ITEM_OFFSET },
|
|
39237
|
+
bottom: { x: 0, y: conf.CONNECTOR_ITEM_OFFSET },
|
|
39238
|
+
right: { x: conf.CONNECTOR_ITEM_OFFSET, y: 0 },
|
|
39239
|
+
left: { x: -conf.CONNECTOR_ITEM_OFFSET, y: 0 }
|
|
39241
39240
|
};
|
|
39242
39241
|
const horizontalLines = [];
|
|
39243
39242
|
const verticalLines = [];
|
|
@@ -39248,19 +39247,10 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
39248
39247
|
const mbrFloored = new Mbr(Math.floor(itemMbr.left), Math.floor(itemMbr.top), Math.floor(itemMbr.right), Math.floor(itemMbr.bottom));
|
|
39249
39248
|
const pointOnMbr = mbrFloored.getLines()[revertMapDir[dir2]].getNearestPointOnLineSegment(point5);
|
|
39250
39249
|
const newPoint = Object.create(Object.getPrototypeOf(point5), Object.getOwnPropertyDescriptors(point5));
|
|
39251
|
-
newPoint.x = pointOnMbr.x;
|
|
39252
|
-
newPoint.y = pointOnMbr.y;
|
|
39253
|
-
|
|
39254
|
-
|
|
39255
|
-
} else if (dir2 === "bottom") {
|
|
39256
|
-
newPoint.y += ITEM_OFFSET;
|
|
39257
|
-
} else if (dir2 === "left") {
|
|
39258
|
-
newPoint.x -= ITEM_OFFSET;
|
|
39259
|
-
} else if (dir2 === "right") {
|
|
39260
|
-
newPoint.x += ITEM_OFFSET;
|
|
39261
|
-
}
|
|
39262
|
-
verticalLines.push(mbrFloored.left - ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + ITEM_OFFSET);
|
|
39263
|
-
horizontalLines.push(mbrFloored.top - ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + ITEM_OFFSET);
|
|
39250
|
+
newPoint.x = pointOnMbr.x + offsetMap[dir2].x;
|
|
39251
|
+
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
39252
|
+
verticalLines.push(mbrFloored.left - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
39253
|
+
horizontalLines.push(mbrFloored.top - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
39264
39254
|
return newPoint;
|
|
39265
39255
|
};
|
|
39266
39256
|
if (start.pointType !== "Board" && startDir) {
|
|
@@ -56930,6 +56920,10 @@ class Board {
|
|
|
56930
56920
|
itemData.endPoint.x += -minX + x;
|
|
56931
56921
|
itemData.endPoint.y += -minY + y;
|
|
56932
56922
|
}
|
|
56923
|
+
if (itemData.middlePoint?.pointType === "Board") {
|
|
56924
|
+
itemData.endPoint.x += -minX + x;
|
|
56925
|
+
itemData.endPoint.y += -minY + y;
|
|
56926
|
+
}
|
|
56933
56927
|
} else if (itemData.transformation) {
|
|
56934
56928
|
itemData.transformation.translateX = translateX - minX + x;
|
|
56935
56929
|
itemData.transformation.translateY = translateY - minY + y;
|
|
@@ -59748,7 +59742,7 @@ function getMeasureCtx() {
|
|
|
59748
59742
|
}
|
|
59749
59743
|
|
|
59750
59744
|
// src/api/initNodeSettings.ts
|
|
59751
|
-
var import_css = __toESM(require_css_escape());
|
|
59745
|
+
var import_css = __toESM(require_css_escape(), 1);
|
|
59752
59746
|
function initNodeSettings() {
|
|
59753
59747
|
const documentFactory = new NodeDocumentFactory;
|
|
59754
59748
|
conf.documentFactory = documentFactory;
|
package/dist/esm/browser.js
CHANGED
|
@@ -36515,7 +36515,6 @@ function radiansBetweenPoints(point1, point22) {
|
|
|
36515
36515
|
}
|
|
36516
36516
|
|
|
36517
36517
|
// src/Items/Connector/getLine/findOrthogonalPath.ts
|
|
36518
|
-
var ITEM_OFFSET = 1;
|
|
36519
36518
|
function getDirection(from, to) {
|
|
36520
36519
|
if (!to) {
|
|
36521
36520
|
return null;
|
|
@@ -36558,7 +36557,7 @@ function getNeighbors(node2, grid, obstacles) {
|
|
|
36558
36557
|
for (const pos of potentialNeighbors) {
|
|
36559
36558
|
if (pos.x >= 0 && pos.x < grid.length && pos.y >= 0) {
|
|
36560
36559
|
const newPoint = grid[pos.x][pos.y];
|
|
36561
|
-
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint,
|
|
36560
|
+
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint, conf.CONNECTOR_ITEM_OFFSET - 1))) {
|
|
36562
36561
|
neighbors.push({
|
|
36563
36562
|
point: newPoint,
|
|
36564
36563
|
costSoFar: 0,
|
|
@@ -36606,10 +36605,10 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36606
36605
|
const endDir = getPointerDirection(end);
|
|
36607
36606
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36608
36607
|
const offsetMap = {
|
|
36609
|
-
top: { x: 0, y: -
|
|
36610
|
-
bottom: { x: 0, y:
|
|
36611
|
-
right: { x:
|
|
36612
|
-
left: { x: -
|
|
36608
|
+
top: { x: 0, y: -conf.CONNECTOR_ITEM_OFFSET },
|
|
36609
|
+
bottom: { x: 0, y: conf.CONNECTOR_ITEM_OFFSET },
|
|
36610
|
+
right: { x: conf.CONNECTOR_ITEM_OFFSET, y: 0 },
|
|
36611
|
+
left: { x: -conf.CONNECTOR_ITEM_OFFSET, y: 0 }
|
|
36613
36612
|
};
|
|
36614
36613
|
const horizontalLines = [];
|
|
36615
36614
|
const verticalLines = [];
|
|
@@ -36620,19 +36619,10 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36620
36619
|
const mbrFloored = new Mbr(Math.floor(itemMbr.left), Math.floor(itemMbr.top), Math.floor(itemMbr.right), Math.floor(itemMbr.bottom));
|
|
36621
36620
|
const pointOnMbr = mbrFloored.getLines()[revertMapDir[dir2]].getNearestPointOnLineSegment(point5);
|
|
36622
36621
|
const newPoint = Object.create(Object.getPrototypeOf(point5), Object.getOwnPropertyDescriptors(point5));
|
|
36623
|
-
newPoint.x = pointOnMbr.x;
|
|
36624
|
-
newPoint.y = pointOnMbr.y;
|
|
36625
|
-
|
|
36626
|
-
|
|
36627
|
-
} else if (dir2 === "bottom") {
|
|
36628
|
-
newPoint.y += ITEM_OFFSET;
|
|
36629
|
-
} else if (dir2 === "left") {
|
|
36630
|
-
newPoint.x -= ITEM_OFFSET;
|
|
36631
|
-
} else if (dir2 === "right") {
|
|
36632
|
-
newPoint.x += ITEM_OFFSET;
|
|
36633
|
-
}
|
|
36634
|
-
verticalLines.push(mbrFloored.left - ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + ITEM_OFFSET);
|
|
36635
|
-
horizontalLines.push(mbrFloored.top - ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + ITEM_OFFSET);
|
|
36622
|
+
newPoint.x = pointOnMbr.x + offsetMap[dir2].x;
|
|
36623
|
+
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
36624
|
+
verticalLines.push(mbrFloored.left - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36625
|
+
horizontalLines.push(mbrFloored.top - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36636
36626
|
return newPoint;
|
|
36637
36627
|
};
|
|
36638
36628
|
if (start.pointType !== "Board" && startDir) {
|
|
@@ -54302,6 +54292,10 @@ class Board {
|
|
|
54302
54292
|
itemData.endPoint.x += -minX + x;
|
|
54303
54293
|
itemData.endPoint.y += -minY + y;
|
|
54304
54294
|
}
|
|
54295
|
+
if (itemData.middlePoint?.pointType === "Board") {
|
|
54296
|
+
itemData.endPoint.x += -minX + x;
|
|
54297
|
+
itemData.endPoint.y += -minY + y;
|
|
54298
|
+
}
|
|
54305
54299
|
} else if (itemData.transformation) {
|
|
54306
54300
|
itemData.transformation.translateX = translateX - minX + x;
|
|
54307
54301
|
itemData.transformation.translateY = translateY - minY + y;
|
package/dist/esm/index.js
CHANGED
|
@@ -36508,7 +36508,6 @@ function radiansBetweenPoints(point1, point22) {
|
|
|
36508
36508
|
}
|
|
36509
36509
|
|
|
36510
36510
|
// src/Items/Connector/getLine/findOrthogonalPath.ts
|
|
36511
|
-
var ITEM_OFFSET = 1;
|
|
36512
36511
|
function getDirection(from, to) {
|
|
36513
36512
|
if (!to) {
|
|
36514
36513
|
return null;
|
|
@@ -36551,7 +36550,7 @@ function getNeighbors(node2, grid, obstacles) {
|
|
|
36551
36550
|
for (const pos of potentialNeighbors) {
|
|
36552
36551
|
if (pos.x >= 0 && pos.x < grid.length && pos.y >= 0) {
|
|
36553
36552
|
const newPoint = grid[pos.x][pos.y];
|
|
36554
|
-
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint,
|
|
36553
|
+
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint, conf.CONNECTOR_ITEM_OFFSET - 1))) {
|
|
36555
36554
|
neighbors.push({
|
|
36556
36555
|
point: newPoint,
|
|
36557
36556
|
costSoFar: 0,
|
|
@@ -36599,10 +36598,10 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36599
36598
|
const endDir = getPointerDirection(end);
|
|
36600
36599
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36601
36600
|
const offsetMap = {
|
|
36602
|
-
top: { x: 0, y: -
|
|
36603
|
-
bottom: { x: 0, y:
|
|
36604
|
-
right: { x:
|
|
36605
|
-
left: { x: -
|
|
36601
|
+
top: { x: 0, y: -conf.CONNECTOR_ITEM_OFFSET },
|
|
36602
|
+
bottom: { x: 0, y: conf.CONNECTOR_ITEM_OFFSET },
|
|
36603
|
+
right: { x: conf.CONNECTOR_ITEM_OFFSET, y: 0 },
|
|
36604
|
+
left: { x: -conf.CONNECTOR_ITEM_OFFSET, y: 0 }
|
|
36606
36605
|
};
|
|
36607
36606
|
const horizontalLines = [];
|
|
36608
36607
|
const verticalLines = [];
|
|
@@ -36613,19 +36612,10 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36613
36612
|
const mbrFloored = new Mbr(Math.floor(itemMbr.left), Math.floor(itemMbr.top), Math.floor(itemMbr.right), Math.floor(itemMbr.bottom));
|
|
36614
36613
|
const pointOnMbr = mbrFloored.getLines()[revertMapDir[dir2]].getNearestPointOnLineSegment(point5);
|
|
36615
36614
|
const newPoint = Object.create(Object.getPrototypeOf(point5), Object.getOwnPropertyDescriptors(point5));
|
|
36616
|
-
newPoint.x = pointOnMbr.x;
|
|
36617
|
-
newPoint.y = pointOnMbr.y;
|
|
36618
|
-
|
|
36619
|
-
|
|
36620
|
-
} else if (dir2 === "bottom") {
|
|
36621
|
-
newPoint.y += ITEM_OFFSET;
|
|
36622
|
-
} else if (dir2 === "left") {
|
|
36623
|
-
newPoint.x -= ITEM_OFFSET;
|
|
36624
|
-
} else if (dir2 === "right") {
|
|
36625
|
-
newPoint.x += ITEM_OFFSET;
|
|
36626
|
-
}
|
|
36627
|
-
verticalLines.push(mbrFloored.left - ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + ITEM_OFFSET);
|
|
36628
|
-
horizontalLines.push(mbrFloored.top - ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + ITEM_OFFSET);
|
|
36615
|
+
newPoint.x = pointOnMbr.x + offsetMap[dir2].x;
|
|
36616
|
+
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
36617
|
+
verticalLines.push(mbrFloored.left - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36618
|
+
horizontalLines.push(mbrFloored.top - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36629
36619
|
return newPoint;
|
|
36630
36620
|
};
|
|
36631
36621
|
if (start.pointType !== "Board" && startDir) {
|
|
@@ -54295,6 +54285,10 @@ class Board {
|
|
|
54295
54285
|
itemData.endPoint.x += -minX + x;
|
|
54296
54286
|
itemData.endPoint.y += -minY + y;
|
|
54297
54287
|
}
|
|
54288
|
+
if (itemData.middlePoint?.pointType === "Board") {
|
|
54289
|
+
itemData.endPoint.x += -minX + x;
|
|
54290
|
+
itemData.endPoint.y += -minY + y;
|
|
54291
|
+
}
|
|
54298
54292
|
} else if (itemData.transformation) {
|
|
54299
54293
|
itemData.transformation.translateX = translateX - minX + x;
|
|
54300
54294
|
itemData.transformation.translateY = translateY - minY + y;
|
package/dist/esm/node.js
CHANGED
|
@@ -38976,7 +38976,6 @@ function radiansBetweenPoints(point1, point22) {
|
|
|
38976
38976
|
}
|
|
38977
38977
|
|
|
38978
38978
|
// src/Items/Connector/getLine/findOrthogonalPath.ts
|
|
38979
|
-
var ITEM_OFFSET = 1;
|
|
38980
38979
|
function getDirection(from, to) {
|
|
38981
38980
|
if (!to) {
|
|
38982
38981
|
return null;
|
|
@@ -39019,7 +39018,7 @@ function getNeighbors(node2, grid, obstacles) {
|
|
|
39019
39018
|
for (const pos of potentialNeighbors) {
|
|
39020
39019
|
if (pos.x >= 0 && pos.x < grid.length && pos.y >= 0) {
|
|
39021
39020
|
const newPoint = grid[pos.x][pos.y];
|
|
39022
|
-
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint,
|
|
39021
|
+
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint, conf.CONNECTOR_ITEM_OFFSET - 1))) {
|
|
39023
39022
|
neighbors.push({
|
|
39024
39023
|
point: newPoint,
|
|
39025
39024
|
costSoFar: 0,
|
|
@@ -39067,10 +39066,10 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
39067
39066
|
const endDir = getPointerDirection(end);
|
|
39068
39067
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
39069
39068
|
const offsetMap = {
|
|
39070
|
-
top: { x: 0, y: -
|
|
39071
|
-
bottom: { x: 0, y:
|
|
39072
|
-
right: { x:
|
|
39073
|
-
left: { x: -
|
|
39069
|
+
top: { x: 0, y: -conf.CONNECTOR_ITEM_OFFSET },
|
|
39070
|
+
bottom: { x: 0, y: conf.CONNECTOR_ITEM_OFFSET },
|
|
39071
|
+
right: { x: conf.CONNECTOR_ITEM_OFFSET, y: 0 },
|
|
39072
|
+
left: { x: -conf.CONNECTOR_ITEM_OFFSET, y: 0 }
|
|
39074
39073
|
};
|
|
39075
39074
|
const horizontalLines = [];
|
|
39076
39075
|
const verticalLines = [];
|
|
@@ -39081,19 +39080,10 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
39081
39080
|
const mbrFloored = new Mbr(Math.floor(itemMbr.left), Math.floor(itemMbr.top), Math.floor(itemMbr.right), Math.floor(itemMbr.bottom));
|
|
39082
39081
|
const pointOnMbr = mbrFloored.getLines()[revertMapDir[dir2]].getNearestPointOnLineSegment(point5);
|
|
39083
39082
|
const newPoint = Object.create(Object.getPrototypeOf(point5), Object.getOwnPropertyDescriptors(point5));
|
|
39084
|
-
newPoint.x = pointOnMbr.x;
|
|
39085
|
-
newPoint.y = pointOnMbr.y;
|
|
39086
|
-
|
|
39087
|
-
|
|
39088
|
-
} else if (dir2 === "bottom") {
|
|
39089
|
-
newPoint.y += ITEM_OFFSET;
|
|
39090
|
-
} else if (dir2 === "left") {
|
|
39091
|
-
newPoint.x -= ITEM_OFFSET;
|
|
39092
|
-
} else if (dir2 === "right") {
|
|
39093
|
-
newPoint.x += ITEM_OFFSET;
|
|
39094
|
-
}
|
|
39095
|
-
verticalLines.push(mbrFloored.left - ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + ITEM_OFFSET);
|
|
39096
|
-
horizontalLines.push(mbrFloored.top - ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + ITEM_OFFSET);
|
|
39083
|
+
newPoint.x = pointOnMbr.x + offsetMap[dir2].x;
|
|
39084
|
+
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
39085
|
+
verticalLines.push(mbrFloored.left - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
39086
|
+
horizontalLines.push(mbrFloored.top - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
39097
39087
|
return newPoint;
|
|
39098
39088
|
};
|
|
39099
39089
|
if (start.pointType !== "Board" && startDir) {
|
|
@@ -56763,6 +56753,10 @@ class Board {
|
|
|
56763
56753
|
itemData.endPoint.x += -minX + x;
|
|
56764
56754
|
itemData.endPoint.y += -minY + y;
|
|
56765
56755
|
}
|
|
56756
|
+
if (itemData.middlePoint?.pointType === "Board") {
|
|
56757
|
+
itemData.endPoint.x += -minX + x;
|
|
56758
|
+
itemData.endPoint.y += -minY + y;
|
|
56759
|
+
}
|
|
56766
56760
|
} else if (itemData.transformation) {
|
|
56767
56761
|
itemData.transformation.translateX = translateX - minX + x;
|
|
56768
56762
|
itemData.transformation.translateY = translateY - minY + y;
|