bruce-models 0.8.7 → 0.8.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/bruce-models.es5.js +104 -8
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +104 -8
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/common/cartes.js +68 -0
- package/dist/lib/common/cartes.js.map +1 -1
- package/dist/lib/markup/markup.js +36 -8
- package/dist/lib/markup/markup.js.map +1 -1
- package/dist/types/common/cartes.d.ts +32 -0
- package/dist/types/markup/markup.d.ts +14 -11
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -2333,6 +2333,74 @@
|
|
|
2333
2333
|
return true;
|
|
2334
2334
|
}
|
|
2335
2335
|
Cartes.IsEqualCartes3 = IsEqualCartes3;
|
|
2336
|
+
/**
|
|
2337
|
+
* Returns true if the given ring is closed.
|
|
2338
|
+
* A ring is closed if the first and last point are equal.
|
|
2339
|
+
* A ring with less than 2 points is not closed.
|
|
2340
|
+
* @param points
|
|
2341
|
+
* @returns
|
|
2342
|
+
*/
|
|
2343
|
+
function IsRing2Closed(points) {
|
|
2344
|
+
if (points.length < 2) {
|
|
2345
|
+
return false;
|
|
2346
|
+
}
|
|
2347
|
+
else if (!IsEqualCartes2(points[0], points[points.length - 1])) {
|
|
2348
|
+
return false;
|
|
2349
|
+
}
|
|
2350
|
+
return true;
|
|
2351
|
+
}
|
|
2352
|
+
Cartes.IsRing2Closed = IsRing2Closed;
|
|
2353
|
+
/**
|
|
2354
|
+
* Returns true if the given ring is closed.
|
|
2355
|
+
* A ring is closed if the first and last point are equal.
|
|
2356
|
+
* A ring with less than 2 points is not closed.
|
|
2357
|
+
* @param points
|
|
2358
|
+
* @returns
|
|
2359
|
+
*/
|
|
2360
|
+
function IsRing3Closed(points) {
|
|
2361
|
+
if (points.length < 2) {
|
|
2362
|
+
return false;
|
|
2363
|
+
}
|
|
2364
|
+
else if (!IsEqualCartes3(points[0], points[points.length - 1])) {
|
|
2365
|
+
return false;
|
|
2366
|
+
}
|
|
2367
|
+
return true;
|
|
2368
|
+
}
|
|
2369
|
+
Cartes.IsRing3Closed = IsRing3Closed;
|
|
2370
|
+
/**
|
|
2371
|
+
* Closes given ring by adding the first point to the end of the array.
|
|
2372
|
+
* This will mutate the given array.
|
|
2373
|
+
* Will not do anything if the ring is already closed.
|
|
2374
|
+
* @param points
|
|
2375
|
+
* @returns
|
|
2376
|
+
*/
|
|
2377
|
+
function CloseRing2(points) {
|
|
2378
|
+
if (points.length < 2) {
|
|
2379
|
+
return;
|
|
2380
|
+
}
|
|
2381
|
+
else if (IsRing2Closed(points)) {
|
|
2382
|
+
return;
|
|
2383
|
+
}
|
|
2384
|
+
points.push(points[0]);
|
|
2385
|
+
}
|
|
2386
|
+
Cartes.CloseRing2 = CloseRing2;
|
|
2387
|
+
/**
|
|
2388
|
+
* Closes given ring by adding the first point to the end of the array.
|
|
2389
|
+
* This will mutate the given array.
|
|
2390
|
+
* Will not do anything if the ring is already closed.
|
|
2391
|
+
* @param points
|
|
2392
|
+
* @returns
|
|
2393
|
+
*/
|
|
2394
|
+
function CloseRing3(points) {
|
|
2395
|
+
if (points.length < 2) {
|
|
2396
|
+
return;
|
|
2397
|
+
}
|
|
2398
|
+
else if (IsRing3Closed(points)) {
|
|
2399
|
+
return;
|
|
2400
|
+
}
|
|
2401
|
+
points.push(points[0]);
|
|
2402
|
+
}
|
|
2403
|
+
Cartes.CloseRing3 = CloseRing3;
|
|
2336
2404
|
})(exports.Cartes || (exports.Cartes = {}));
|
|
2337
2405
|
|
|
2338
2406
|
/**
|
|
@@ -6967,9 +7035,45 @@
|
|
|
6967
7035
|
EType["OpenBookmark"] = "BOOKMARK";
|
|
6968
7036
|
})(EType = ItemAction.EType || (ItemAction.EType = {}));
|
|
6969
7037
|
})(ItemAction = Div.ItemAction || (Div.ItemAction = {}));
|
|
7038
|
+
Div.DEFAULT = {
|
|
7039
|
+
contentRows: [
|
|
7040
|
+
{
|
|
7041
|
+
height: 100,
|
|
7042
|
+
items: [
|
|
7043
|
+
{
|
|
7044
|
+
contentType: EItemType.Default,
|
|
7045
|
+
text: "Type here...",
|
|
7046
|
+
width: 100,
|
|
7047
|
+
backgroundColor: "white",
|
|
7048
|
+
fontColor: "black",
|
|
7049
|
+
textAlign: "center",
|
|
7050
|
+
verticalAlign: "center",
|
|
7051
|
+
fontSize: 15
|
|
7052
|
+
}
|
|
7053
|
+
]
|
|
7054
|
+
}
|
|
7055
|
+
],
|
|
7056
|
+
height: null,
|
|
7057
|
+
width: null,
|
|
7058
|
+
id: null,
|
|
7059
|
+
x: null,
|
|
7060
|
+
y: null,
|
|
7061
|
+
borderColor: "black",
|
|
7062
|
+
borderWidth: 1,
|
|
7063
|
+
borderUsingPercent: false,
|
|
7064
|
+
borderRadius: 8,
|
|
7065
|
+
type: EType.Default
|
|
7066
|
+
};
|
|
6970
7067
|
})(Div = Markup.Div || (Markup.Div = {}));
|
|
6971
7068
|
var Drawing;
|
|
6972
7069
|
(function (Drawing) {
|
|
7070
|
+
// Describes a line end's head.
|
|
7071
|
+
var EHeadStyle;
|
|
7072
|
+
(function (EHeadStyle) {
|
|
7073
|
+
EHeadStyle["None"] = "NONE";
|
|
7074
|
+
EHeadStyle["Circle"] = "CIRCLE";
|
|
7075
|
+
EHeadStyle["Arrow"] = "ARROW";
|
|
7076
|
+
})(EHeadStyle = Drawing.EHeadStyle || (Drawing.EHeadStyle = {}));
|
|
6973
7077
|
var Line;
|
|
6974
7078
|
(function (Line) {
|
|
6975
7079
|
// Dictates where on a DIV an anchor should snap to.
|
|
@@ -6991,14 +7095,6 @@
|
|
|
6991
7095
|
EAnchorLineSide[EAnchorLineSide["Start"] = 0] = "Start";
|
|
6992
7096
|
EAnchorLineSide[EAnchorLineSide["End"] = 1] = "End";
|
|
6993
7097
|
})(EAnchorLineSide = Line.EAnchorLineSide || (Line.EAnchorLineSide = {}));
|
|
6994
|
-
// Types of anchor heads when anchor is used in context of a line.
|
|
6995
|
-
// None means the anchor is transparent.
|
|
6996
|
-
var EAnchorHeadStyle;
|
|
6997
|
-
(function (EAnchorHeadStyle) {
|
|
6998
|
-
EAnchorHeadStyle["None"] = "NONE";
|
|
6999
|
-
EAnchorHeadStyle["Circle"] = "CIRCLE";
|
|
7000
|
-
EAnchorHeadStyle["Arrow"] = "ARROW";
|
|
7001
|
-
})(EAnchorHeadStyle = Line.EAnchorHeadStyle || (Line.EAnchorHeadStyle = {}));
|
|
7002
7098
|
Line.DEFAULT = {
|
|
7003
7099
|
brushColor: "rgba(255, 255, 255, 1)",
|
|
7004
7100
|
brushSize: 4,
|