@inweb/markup 26.1.3 → 26.1.4
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/markup.js +416 -432
- package/dist/markup.js.map +1 -1
- package/dist/markup.min.js +1 -1
- package/dist/markup.module.js +38 -38
- package/dist/markup.module.js.map +1 -1
- package/lib/markup/IMarkup.d.ts +12 -11
- package/lib/markup/IMarkupArrow.d.ts +2 -2
- package/lib/markup/IMarkupCloud.d.ts +2 -2
- package/lib/markup/IMarkupColorable.d.ts +2 -2
- package/lib/markup/IMarkupEllipse.d.ts +2 -2
- package/lib/markup/IMarkupImage.d.ts +12 -12
- package/lib/markup/IMarkupLine.d.ts +2 -2
- package/lib/markup/IMarkupRectangle.d.ts +2 -2
- package/lib/markup/IMarkupText.d.ts +2 -2
- package/lib/markup/Konva/MarkupColor.d.ts +2 -2
- package/package.json +5 -5
- package/src/markup/IMarkup.ts +12 -11
- package/src/markup/IMarkupArrow.ts +2 -2
- package/src/markup/IMarkupCloud.ts +2 -2
- package/src/markup/IMarkupColorable.ts +2 -2
- package/src/markup/IMarkupEllipse.ts +2 -2
- package/src/markup/IMarkupImage.ts +12 -12
- package/src/markup/IMarkupLine.ts +2 -2
- package/src/markup/IMarkupRectangle.ts +2 -2
- package/src/markup/IMarkupText.ts +2 -2
- package/src/markup/Konva/MarkupColor.ts +2 -2
package/dist/markup.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
hasRequiredGlobal = 1;
|
|
26
26
|
(function (exports) {
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports._registerNode = exports.Konva = exports.glob =
|
|
28
|
+
exports._registerNode = exports.Konva = exports.glob = void 0;
|
|
29
29
|
const PI_OVER_180 = Math.PI / 180;
|
|
30
30
|
function detectBrowser() {
|
|
31
31
|
return (typeof window !== 'undefined' &&
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
: {};
|
|
42
42
|
exports.Konva = {
|
|
43
43
|
_global: exports.glob,
|
|
44
|
-
version: '9.3.
|
|
44
|
+
version: '9.3.16',
|
|
45
45
|
isBrowser: detectBrowser(),
|
|
46
46
|
isUnminified: /param/.test(function (param) { }.toString()),
|
|
47
47
|
dblClickWindow: 400,
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
isTransforming() {
|
|
75
75
|
var _a;
|
|
76
|
-
return (_a = exports.Konva['Transformer']) === null || _a ===
|
|
76
|
+
return (_a = exports.Konva['Transformer']) === null || _a === void 0 ? void 0 : _a.isTransforming();
|
|
77
77
|
},
|
|
78
78
|
isDragReady() {
|
|
79
79
|
return !!exports.Konva['DD'].node;
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
hasRequiredUtil = 1;
|
|
103
103
|
(function (exports) {
|
|
104
104
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
105
|
-
exports.Util = exports.Transform =
|
|
105
|
+
exports.Util = exports.Transform = void 0;
|
|
106
106
|
const Global_1 = requireGlobal();
|
|
107
107
|
class Transform {
|
|
108
108
|
constructor(m = [1, 0, 0, 1, 0, 0]) {
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
exports.Transform = Transform;
|
|
254
|
-
|
|
254
|
+
let OBJECT_ARRAY = '[object Array]', OBJECT_NUMBER = '[object Number]', OBJECT_STRING = '[object String]', OBJECT_BOOLEAN = '[object Boolean]', PI_OVER_DEG180 = Math.PI / 180, DEG180_OVER_PI = 180 / Math.PI, HASH = '#', EMPTY_STRING = '', ZERO = '0', KONVA_WARNING = 'Konva warning: ', KONVA_ERROR = 'Konva error: ', RGB_PAREN = 'rgb(', COLORS = {
|
|
255
255
|
aliceblue: [240, 248, 255],
|
|
256
256
|
antiquewhite: [250, 235, 215],
|
|
257
257
|
aqua: [0, 255, 255],
|
|
@@ -401,8 +401,7 @@
|
|
|
401
401
|
whitesmoke: [245, 245, 245],
|
|
402
402
|
yellow: [255, 255, 0],
|
|
403
403
|
yellowgreen: [154, 205, 5],
|
|
404
|
-
}, RGB_REGEX = /rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)
|
|
405
|
-
let animQueue = [];
|
|
404
|
+
}, RGB_REGEX = /rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/, animQueue = [];
|
|
406
405
|
const req = (typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame) ||
|
|
407
406
|
function (f) {
|
|
408
407
|
setTimeout(f, 60);
|
|
@@ -799,19 +798,19 @@
|
|
|
799
798
|
return pc;
|
|
800
799
|
},
|
|
801
800
|
_prepareArrayForTween(startArray, endArray, isClosed) {
|
|
802
|
-
|
|
801
|
+
let n, start = [], end = [];
|
|
803
802
|
if (startArray.length > endArray.length) {
|
|
804
803
|
const temp = endArray;
|
|
805
804
|
endArray = startArray;
|
|
806
805
|
startArray = temp;
|
|
807
806
|
}
|
|
808
|
-
for (
|
|
807
|
+
for (n = 0; n < startArray.length; n += 2) {
|
|
809
808
|
start.push({
|
|
810
809
|
x: startArray[n],
|
|
811
810
|
y: startArray[n + 1],
|
|
812
811
|
});
|
|
813
812
|
}
|
|
814
|
-
for (
|
|
813
|
+
for (n = 0; n < endArray.length; n += 2) {
|
|
815
814
|
end.push({
|
|
816
815
|
x: endArray[n],
|
|
817
816
|
y: endArray[n + 1],
|
|
@@ -980,8 +979,8 @@
|
|
|
980
979
|
function getNumberOrArrayOfNumbersValidator(noOfElements) {
|
|
981
980
|
if (Global_1.Konva.isUnminified) {
|
|
982
981
|
return function (val, attr) {
|
|
983
|
-
|
|
984
|
-
|
|
982
|
+
const isNumber = Util_1.Util._isNumber(val);
|
|
983
|
+
const isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements;
|
|
985
984
|
if (!isNumber && !isValidArray) {
|
|
986
985
|
Util_1.Util.warn(_formatValue(val) +
|
|
987
986
|
' is a not valid value for "' +
|
|
@@ -997,8 +996,8 @@
|
|
|
997
996
|
function getNumberOrAutoValidator() {
|
|
998
997
|
if (Global_1.Konva.isUnminified) {
|
|
999
998
|
return function (val, attr) {
|
|
1000
|
-
|
|
1001
|
-
|
|
999
|
+
const isNumber = Util_1.Util._isNumber(val);
|
|
1000
|
+
const isAuto = val === 'auto';
|
|
1002
1001
|
if (!(isNumber || isAuto)) {
|
|
1003
1002
|
Util_1.Util.warn(_formatValue(val) +
|
|
1004
1003
|
' is a not valid value for "' +
|
|
@@ -1027,7 +1026,7 @@
|
|
|
1027
1026
|
return function (val, attr) {
|
|
1028
1027
|
const isString = Util_1.Util._isString(val);
|
|
1029
1028
|
const isGradient = Object.prototype.toString.call(val) === '[object CanvasGradient]' ||
|
|
1030
|
-
(val && val
|
|
1029
|
+
(val && val.addColorStop);
|
|
1031
1030
|
if (!(isString || isGradient)) {
|
|
1032
1031
|
Util_1.Util.warn(_formatValue(val) +
|
|
1033
1032
|
' is a not valid value for "' +
|
|
@@ -1082,7 +1081,7 @@
|
|
|
1082
1081
|
function getBooleanValidator() {
|
|
1083
1082
|
if (Global_1.Konva.isUnminified) {
|
|
1084
1083
|
return function (val, attr) {
|
|
1085
|
-
|
|
1084
|
+
const isBool = val === true || val === false;
|
|
1086
1085
|
if (!isBool) {
|
|
1087
1086
|
Util_1.Util.warn(_formatValue(val) +
|
|
1088
1087
|
' is a not valid value for "' +
|
|
@@ -1120,11 +1119,10 @@
|
|
|
1120
1119
|
hasRequiredFactory = 1;
|
|
1121
1120
|
(function (exports) {
|
|
1122
1121
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1123
|
-
exports.Factory =
|
|
1122
|
+
exports.Factory = void 0;
|
|
1124
1123
|
const Util_1 = requireUtil();
|
|
1125
1124
|
const Validators_1 = requireValidators();
|
|
1126
|
-
const GET = 'get';
|
|
1127
|
-
const SET = 'set';
|
|
1125
|
+
const GET = 'get', SET = 'set';
|
|
1128
1126
|
exports.Factory = {
|
|
1129
1127
|
addGetterSetter(constructor, attr, def, validator, after) {
|
|
1130
1128
|
exports.Factory.addGetter(constructor, attr, def);
|
|
@@ -1132,7 +1130,7 @@
|
|
|
1132
1130
|
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
1133
1131
|
},
|
|
1134
1132
|
addGetter(constructor, attr, def) {
|
|
1135
|
-
|
|
1133
|
+
const method = GET + Util_1.Util._capitalize(attr);
|
|
1136
1134
|
constructor.prototype[method] =
|
|
1137
1135
|
constructor.prototype[method] ||
|
|
1138
1136
|
function () {
|
|
@@ -1141,13 +1139,13 @@
|
|
|
1141
1139
|
};
|
|
1142
1140
|
},
|
|
1143
1141
|
addSetter(constructor, attr, validator, after) {
|
|
1144
|
-
|
|
1142
|
+
const method = SET + Util_1.Util._capitalize(attr);
|
|
1145
1143
|
if (!constructor.prototype[method]) {
|
|
1146
1144
|
exports.Factory.overWriteSetter(constructor, attr, validator, after);
|
|
1147
1145
|
}
|
|
1148
1146
|
},
|
|
1149
1147
|
overWriteSetter(constructor, attr, validator, after) {
|
|
1150
|
-
|
|
1148
|
+
const method = SET + Util_1.Util._capitalize(attr);
|
|
1151
1149
|
constructor.prototype[method] = function (val) {
|
|
1152
1150
|
if (validator && val !== undefined && val !== null) {
|
|
1153
1151
|
val = validator.call(this, val, attr);
|
|
@@ -1160,25 +1158,25 @@
|
|
|
1160
1158
|
};
|
|
1161
1159
|
},
|
|
1162
1160
|
addComponentsGetterSetter(constructor, attr, components, validator, after) {
|
|
1163
|
-
|
|
1161
|
+
let len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr), n, component;
|
|
1164
1162
|
constructor.prototype[getter] = function () {
|
|
1165
1163
|
const ret = {};
|
|
1166
|
-
for (
|
|
1167
|
-
|
|
1164
|
+
for (n = 0; n < len; n++) {
|
|
1165
|
+
component = components[n];
|
|
1168
1166
|
ret[component] = this.getAttr(attr + capitalize(component));
|
|
1169
1167
|
}
|
|
1170
1168
|
return ret;
|
|
1171
1169
|
};
|
|
1172
1170
|
const basicValidator = (0, Validators_1.getComponentValidator)(components);
|
|
1173
1171
|
constructor.prototype[setter] = function (val) {
|
|
1174
|
-
|
|
1172
|
+
let oldVal = this.attrs[attr], key;
|
|
1175
1173
|
if (validator) {
|
|
1176
|
-
val = validator.call(this, val
|
|
1174
|
+
val = validator.call(this, val);
|
|
1177
1175
|
}
|
|
1178
1176
|
if (basicValidator) {
|
|
1179
1177
|
basicValidator.call(this, val, attr);
|
|
1180
1178
|
}
|
|
1181
|
-
for (
|
|
1179
|
+
for (key in val) {
|
|
1182
1180
|
if (!val.hasOwnProperty(key)) {
|
|
1183
1181
|
continue;
|
|
1184
1182
|
}
|
|
@@ -1198,7 +1196,7 @@
|
|
|
1198
1196
|
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
1199
1197
|
},
|
|
1200
1198
|
addOverloadedGetterSetter(constructor, attr) {
|
|
1201
|
-
|
|
1199
|
+
const capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;
|
|
1202
1200
|
constructor.prototype[attr] = function () {
|
|
1203
1201
|
if (arguments.length) {
|
|
1204
1202
|
this[setter](arguments[0]);
|
|
@@ -1258,13 +1256,13 @@
|
|
|
1258
1256
|
if (hasRequiredContext) return Context;
|
|
1259
1257
|
hasRequiredContext = 1;
|
|
1260
1258
|
Object.defineProperty(Context, "__esModule", { value: true });
|
|
1261
|
-
Context.HitContext = Context.SceneContext = Context.Context =
|
|
1259
|
+
Context.HitContext = Context.SceneContext = Context.Context = void 0;
|
|
1262
1260
|
const Util_1 = requireUtil();
|
|
1263
1261
|
const Global_1 = requireGlobal();
|
|
1264
1262
|
function simplifyArray(arr) {
|
|
1265
|
-
|
|
1266
|
-
for (
|
|
1267
|
-
|
|
1263
|
+
let retArr = [], len = arr.length, util = Util_1.Util, n, val;
|
|
1264
|
+
for (n = 0; n < len; n++) {
|
|
1265
|
+
val = arr[n];
|
|
1268
1266
|
if (util._isNumber(val)) {
|
|
1269
1267
|
val = Math.round(val * 1000) / 1000;
|
|
1270
1268
|
}
|
|
@@ -1747,7 +1745,7 @@
|
|
|
1747
1745
|
}
|
|
1748
1746
|
_applyShadow(shape) {
|
|
1749
1747
|
var _a, _b, _c;
|
|
1750
|
-
const color = (_a = shape.getShadowRGBA()) !== null && _a !==
|
|
1748
|
+
const color = (_a = shape.getShadowRGBA()) !== null && _a !== void 0 ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== void 0 ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {
|
|
1751
1749
|
x: 0,
|
|
1752
1750
|
y: 0,
|
|
1753
1751
|
}, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;
|
|
@@ -1806,7 +1804,7 @@
|
|
|
1806
1804
|
if (hasRequiredCanvas) return Canvas;
|
|
1807
1805
|
hasRequiredCanvas = 1;
|
|
1808
1806
|
Object.defineProperty(Canvas, "__esModule", { value: true });
|
|
1809
|
-
Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas =
|
|
1807
|
+
Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas = void 0;
|
|
1810
1808
|
const Util_1 = requireUtil();
|
|
1811
1809
|
const Context_1 = requireContext();
|
|
1812
1810
|
const Global_1 = requireGlobal();
|
|
@@ -1932,7 +1930,7 @@
|
|
|
1932
1930
|
hasRequiredDragAndDrop = 1;
|
|
1933
1931
|
(function (exports) {
|
|
1934
1932
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1935
|
-
exports.DD =
|
|
1933
|
+
exports.DD = void 0;
|
|
1936
1934
|
const Global_1 = requireGlobal();
|
|
1937
1935
|
const Util_1 = requireUtil();
|
|
1938
1936
|
exports.DD = {
|
|
@@ -2053,7 +2051,7 @@
|
|
|
2053
2051
|
if (hasRequiredNode) return Node;
|
|
2054
2052
|
hasRequiredNode = 1;
|
|
2055
2053
|
Object.defineProperty(Node, "__esModule", { value: true });
|
|
2056
|
-
Node.Node =
|
|
2054
|
+
Node.Node = void 0;
|
|
2057
2055
|
const Util_1 = requireUtil();
|
|
2058
2056
|
const Factory_1 = requireFactory();
|
|
2059
2057
|
const Canvas_1 = requireCanvas();
|
|
@@ -2958,7 +2956,7 @@
|
|
|
2958
2956
|
var _a, _b;
|
|
2959
2957
|
const m = this._cache.get(TRANSFORM) || new Util_1.Transform();
|
|
2960
2958
|
m.reset();
|
|
2961
|
-
const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !==
|
|
2959
|
+
const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== void 0 ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== void 0 ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;
|
|
2962
2960
|
if (x !== 0 || y !== 0) {
|
|
2963
2961
|
m.translate(x, y);
|
|
2964
2962
|
}
|
|
@@ -3160,7 +3158,7 @@
|
|
|
3160
3158
|
_requestDraw() {
|
|
3161
3159
|
if (Global_1.Konva.autoDrawEnabled) {
|
|
3162
3160
|
const drawNode = this.getLayer() || this.getStage();
|
|
3163
|
-
drawNode === null || drawNode ===
|
|
3161
|
+
drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();
|
|
3164
3162
|
}
|
|
3165
3163
|
}
|
|
3166
3164
|
_setAttr(key, val) {
|
|
@@ -3221,13 +3219,13 @@
|
|
|
3221
3219
|
}
|
|
3222
3220
|
_getProtoListeners(eventType) {
|
|
3223
3221
|
var _a, _b, _c;
|
|
3224
|
-
const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !==
|
|
3225
|
-
let events = allListeners === null || allListeners ===
|
|
3222
|
+
const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== void 0 ? _a : {};
|
|
3223
|
+
let events = allListeners === null || allListeners === void 0 ? void 0 : allListeners[eventType];
|
|
3226
3224
|
if (events === undefined) {
|
|
3227
3225
|
events = [];
|
|
3228
3226
|
let obj = Object.getPrototypeOf(this);
|
|
3229
3227
|
while (obj) {
|
|
3230
|
-
const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b ===
|
|
3228
|
+
const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === void 0 ? void 0 : _b[eventType]) !== null && _c !== void 0 ? _c : [];
|
|
3231
3229
|
events.push(...hierarchyEvents);
|
|
3232
3230
|
obj = Object.getPrototypeOf(obj);
|
|
3233
3231
|
}
|
|
@@ -3463,12 +3461,12 @@
|
|
|
3463
3461
|
Factory_1.Factory.addComponentsGetterSetter(Node$1, 'offset', ['x', 'y']);
|
|
3464
3462
|
addGetterSetter(Node$1, 'offsetX', 0, (0, Validators_1.getNumberValidator)());
|
|
3465
3463
|
addGetterSetter(Node$1, 'offsetY', 0, (0, Validators_1.getNumberValidator)());
|
|
3466
|
-
addGetterSetter(Node$1, 'dragDistance',
|
|
3464
|
+
addGetterSetter(Node$1, 'dragDistance', null, (0, Validators_1.getNumberValidator)());
|
|
3467
3465
|
addGetterSetter(Node$1, 'width', 0, (0, Validators_1.getNumberValidator)());
|
|
3468
3466
|
addGetterSetter(Node$1, 'height', 0, (0, Validators_1.getNumberValidator)());
|
|
3469
3467
|
addGetterSetter(Node$1, 'listening', true, (0, Validators_1.getBooleanValidator)());
|
|
3470
3468
|
addGetterSetter(Node$1, 'preventDefault', true, (0, Validators_1.getBooleanValidator)());
|
|
3471
|
-
addGetterSetter(Node$1, 'filters',
|
|
3469
|
+
addGetterSetter(Node$1, 'filters', null, function (val) {
|
|
3472
3470
|
this._filterUpToDate = false;
|
|
3473
3471
|
return val;
|
|
3474
3472
|
});
|
|
@@ -3493,7 +3491,7 @@
|
|
|
3493
3491
|
if (hasRequiredContainer) return Container;
|
|
3494
3492
|
hasRequiredContainer = 1;
|
|
3495
3493
|
Object.defineProperty(Container, "__esModule", { value: true });
|
|
3496
|
-
Container.Container =
|
|
3494
|
+
Container.Container = void 0;
|
|
3497
3495
|
const Factory_1 = requireFactory();
|
|
3498
3496
|
const Node_1 = requireNode();
|
|
3499
3497
|
const Validators_1 = requireValidators();
|
|
@@ -3650,13 +3648,13 @@
|
|
|
3650
3648
|
if (this.isCached()) {
|
|
3651
3649
|
return;
|
|
3652
3650
|
}
|
|
3653
|
-
(_a = this.children) === null || _a ===
|
|
3651
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (node) {
|
|
3654
3652
|
node._clearSelfAndDescendantCache(attr);
|
|
3655
3653
|
});
|
|
3656
3654
|
}
|
|
3657
3655
|
_setChildrenIndices() {
|
|
3658
3656
|
var _a;
|
|
3659
|
-
(_a = this.children) === null || _a ===
|
|
3657
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child, n) {
|
|
3660
3658
|
child.index = n;
|
|
3661
3659
|
});
|
|
3662
3660
|
this._requestDraw();
|
|
@@ -3727,7 +3725,7 @@
|
|
|
3727
3725
|
context.save();
|
|
3728
3726
|
context._applyGlobalCompositeOperation(this);
|
|
3729
3727
|
}
|
|
3730
|
-
(_a = this.children) === null || _a ===
|
|
3728
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
|
|
3731
3729
|
child[drawMethod](canvas, top, bufferCanvas);
|
|
3732
3730
|
});
|
|
3733
3731
|
if (hasComposition) {
|
|
@@ -3749,7 +3747,7 @@
|
|
|
3749
3747
|
height: 0,
|
|
3750
3748
|
};
|
|
3751
3749
|
const that = this;
|
|
3752
|
-
(_a = this.children) === null || _a ===
|
|
3750
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
|
|
3753
3751
|
if (!child.visible()) {
|
|
3754
3752
|
return;
|
|
3755
3753
|
}
|
|
@@ -3881,7 +3879,7 @@
|
|
|
3881
3879
|
hasRequiredStage = 1;
|
|
3882
3880
|
(function (exports) {
|
|
3883
3881
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3884
|
-
exports.Stage = exports.stages =
|
|
3882
|
+
exports.Stage = exports.stages = void 0;
|
|
3885
3883
|
const Util_1 = requireUtil();
|
|
3886
3884
|
const Factory_1 = requireFactory();
|
|
3887
3885
|
const Container_1 = requireContainer();
|
|
@@ -4039,8 +4037,8 @@
|
|
|
4039
4037
|
return true;
|
|
4040
4038
|
}
|
|
4041
4039
|
clear() {
|
|
4042
|
-
|
|
4043
|
-
for (
|
|
4040
|
+
let layers = this.children, len = layers.length, n;
|
|
4041
|
+
for (n = 0; n < len; n++) {
|
|
4044
4042
|
layers[n].clear();
|
|
4045
4043
|
}
|
|
4046
4044
|
return this;
|
|
@@ -4118,8 +4116,8 @@
|
|
|
4118
4116
|
if (!pos) {
|
|
4119
4117
|
return null;
|
|
4120
4118
|
}
|
|
4121
|
-
|
|
4122
|
-
for (
|
|
4119
|
+
let layers = this.children, len = layers.length, end = len - 1, n;
|
|
4120
|
+
for (n = end; n >= 0; n--) {
|
|
4123
4121
|
const shape = layers[n].getIntersection(pos);
|
|
4124
4122
|
if (shape) {
|
|
4125
4123
|
return shape;
|
|
@@ -4432,7 +4430,7 @@
|
|
|
4432
4430
|
});
|
|
4433
4431
|
}
|
|
4434
4432
|
Global_1.Konva['_' + eventType + 'ListenClick'] = false;
|
|
4435
|
-
if (evt.cancelable && eventType !== 'touch'
|
|
4433
|
+
if (evt.cancelable && eventType !== 'touch') {
|
|
4436
4434
|
evt.preventDefault();
|
|
4437
4435
|
}
|
|
4438
4436
|
}
|
|
@@ -4477,8 +4475,7 @@
|
|
|
4477
4475
|
PointerEvents.releaseCapture(evt.pointerId);
|
|
4478
4476
|
}
|
|
4479
4477
|
setPointersPositions(evt) {
|
|
4480
|
-
|
|
4481
|
-
let x = null, y = null;
|
|
4478
|
+
let contentPosition = this._getContentPosition(), x = null, y = null;
|
|
4482
4479
|
evt = evt ? evt : window.event;
|
|
4483
4480
|
if (evt.touches !== undefined) {
|
|
4484
4481
|
this._pointerPositions = [];
|
|
@@ -4598,7 +4595,7 @@
|
|
|
4598
4595
|
hasRequiredShape = 1;
|
|
4599
4596
|
(function (exports) {
|
|
4600
4597
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4601
|
-
exports.Shape = exports.shapes =
|
|
4598
|
+
exports.Shape = exports.shapes = void 0;
|
|
4602
4599
|
const Global_1 = requireGlobal();
|
|
4603
4600
|
const Util_1 = requireUtil();
|
|
4604
4601
|
const Factory_1 = requireFactory();
|
|
@@ -4831,7 +4828,7 @@
|
|
|
4831
4828
|
}
|
|
4832
4829
|
_useBufferCanvas(forceFill) {
|
|
4833
4830
|
var _a;
|
|
4834
|
-
const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !==
|
|
4831
|
+
const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== void 0 ? _a : true;
|
|
4835
4832
|
if (!perfectDrawEnabled) {
|
|
4836
4833
|
return false;
|
|
4837
4834
|
}
|
|
@@ -5000,16 +4997,16 @@
|
|
|
5000
4997
|
return this;
|
|
5001
4998
|
}
|
|
5002
4999
|
drawHitFromCache(alphaThreshold = 0) {
|
|
5003
|
-
|
|
5000
|
+
let cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha;
|
|
5004
5001
|
hitContext.clear();
|
|
5005
5002
|
hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight);
|
|
5006
5003
|
try {
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
for (
|
|
5012
|
-
|
|
5004
|
+
hitImageData = hitContext.getImageData(0, 0, hitWidth, hitHeight);
|
|
5005
|
+
hitData = hitImageData.data;
|
|
5006
|
+
len = hitData.length;
|
|
5007
|
+
rgbColorKey = Util_1.Util._hexToRgb(this.colorKey);
|
|
5008
|
+
for (i = 0; i < len; i += 4) {
|
|
5009
|
+
alpha = hitData[i + 3];
|
|
5013
5010
|
if (alpha > alphaThreshold) {
|
|
5014
5011
|
hitData[i] = rgbColorKey.r;
|
|
5015
5012
|
hitData[i + 1] = rgbColorKey.g;
|
|
@@ -5151,7 +5148,7 @@
|
|
|
5151
5148
|
if (hasRequiredLayer) return Layer;
|
|
5152
5149
|
hasRequiredLayer = 1;
|
|
5153
5150
|
Object.defineProperty(Layer, "__esModule", { value: true });
|
|
5154
|
-
Layer.Layer =
|
|
5151
|
+
Layer.Layer = void 0;
|
|
5155
5152
|
const Util_1 = requireUtil();
|
|
5156
5153
|
const Container_1 = requireContainer();
|
|
5157
5154
|
const Node_1 = requireNode();
|
|
@@ -5469,7 +5466,7 @@
|
|
|
5469
5466
|
if (hasRequiredFastLayer) return FastLayer;
|
|
5470
5467
|
hasRequiredFastLayer = 1;
|
|
5471
5468
|
Object.defineProperty(FastLayer, "__esModule", { value: true });
|
|
5472
|
-
FastLayer.FastLayer =
|
|
5469
|
+
FastLayer.FastLayer = void 0;
|
|
5473
5470
|
const Util_1 = requireUtil();
|
|
5474
5471
|
const Layer_1 = requireLayer();
|
|
5475
5472
|
const Global_1 = requireGlobal();
|
|
@@ -5494,7 +5491,7 @@
|
|
|
5494
5491
|
if (hasRequiredGroup) return Group;
|
|
5495
5492
|
hasRequiredGroup = 1;
|
|
5496
5493
|
Object.defineProperty(Group, "__esModule", { value: true });
|
|
5497
|
-
Group.Group =
|
|
5494
|
+
Group.Group = void 0;
|
|
5498
5495
|
const Util_1 = requireUtil();
|
|
5499
5496
|
const Container_1 = requireContainer();
|
|
5500
5497
|
const Global_1 = requireGlobal();
|
|
@@ -5520,7 +5517,7 @@
|
|
|
5520
5517
|
if (hasRequiredAnimation) return Animation;
|
|
5521
5518
|
hasRequiredAnimation = 1;
|
|
5522
5519
|
Object.defineProperty(Animation, "__esModule", { value: true });
|
|
5523
|
-
Animation.Animation =
|
|
5520
|
+
Animation.Animation = void 0;
|
|
5524
5521
|
const Global_1 = requireGlobal();
|
|
5525
5522
|
const Util_1 = requireUtil();
|
|
5526
5523
|
const now = (function () {
|
|
@@ -5676,19 +5673,18 @@
|
|
|
5676
5673
|
hasRequiredTween = 1;
|
|
5677
5674
|
(function (exports) {
|
|
5678
5675
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5679
|
-
exports.Easings = exports.Tween =
|
|
5676
|
+
exports.Easings = exports.Tween = void 0;
|
|
5680
5677
|
const Util_1 = requireUtil();
|
|
5681
5678
|
const Animation_1 = requireAnimation();
|
|
5682
5679
|
const Node_1 = requireNode();
|
|
5683
5680
|
const Global_1 = requireGlobal();
|
|
5684
|
-
|
|
5681
|
+
let blacklist = {
|
|
5685
5682
|
node: 1,
|
|
5686
5683
|
duration: 1,
|
|
5687
5684
|
easing: 1,
|
|
5688
5685
|
onFinish: 1,
|
|
5689
5686
|
yoyo: 1,
|
|
5690
|
-
}, PAUSED = 1, PLAYING = 2, REVERSING = 3, colorAttrs = ['fill', 'stroke', 'shadowColor'];
|
|
5691
|
-
let idCounter = 0;
|
|
5687
|
+
}, PAUSED = 1, PLAYING = 2, REVERSING = 3, idCounter = 0, colorAttrs = ['fill', 'stroke', 'shadowColor'];
|
|
5692
5688
|
class TweenEngine {
|
|
5693
5689
|
constructor(prop, propFunc, func, begin, finish, duration, yoyo) {
|
|
5694
5690
|
this.prop = prop;
|
|
@@ -5805,8 +5801,7 @@
|
|
|
5805
5801
|
}
|
|
5806
5802
|
class Tween {
|
|
5807
5803
|
constructor(config) {
|
|
5808
|
-
|
|
5809
|
-
let duration, key;
|
|
5804
|
+
let that = this, node = config.node, nodeId = node._id, duration, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo, key;
|
|
5810
5805
|
if (typeof config.duration === 'undefined') {
|
|
5811
5806
|
duration = 0.3;
|
|
5812
5807
|
}
|
|
@@ -5850,13 +5845,12 @@
|
|
|
5850
5845
|
this.onUpdate = config.onUpdate;
|
|
5851
5846
|
}
|
|
5852
5847
|
_addAttr(key, end) {
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
const tweenId = Tween.tweens[nodeId][key];
|
|
5848
|
+
let node = this.node, nodeId = node._id, start, diff, tweenId, n, len, trueEnd, trueStart, endRGBA;
|
|
5849
|
+
tweenId = Tween.tweens[nodeId][key];
|
|
5856
5850
|
if (tweenId) {
|
|
5857
5851
|
delete Tween.attrs[nodeId][tweenId][key];
|
|
5858
5852
|
}
|
|
5859
|
-
|
|
5853
|
+
start = node.getAttr(key);
|
|
5860
5854
|
if (Util_1.Util._isArray(end)) {
|
|
5861
5855
|
diff = [];
|
|
5862
5856
|
len = Math.max(end.length, start.length);
|
|
@@ -5871,7 +5865,7 @@
|
|
|
5871
5865
|
}
|
|
5872
5866
|
}
|
|
5873
5867
|
if (key.indexOf('fill') === 0) {
|
|
5874
|
-
for (
|
|
5868
|
+
for (n = 0; n < len; n++) {
|
|
5875
5869
|
if (n % 2 === 0) {
|
|
5876
5870
|
diff.push(end[n] - start[n]);
|
|
5877
5871
|
}
|
|
@@ -5889,7 +5883,7 @@
|
|
|
5889
5883
|
}
|
|
5890
5884
|
}
|
|
5891
5885
|
else {
|
|
5892
|
-
for (
|
|
5886
|
+
for (n = 0; n < len; n++) {
|
|
5893
5887
|
diff.push(end[n] - start[n]);
|
|
5894
5888
|
}
|
|
5895
5889
|
}
|
|
@@ -5917,8 +5911,7 @@
|
|
|
5917
5911
|
Tween.tweens[nodeId][key] = this._id;
|
|
5918
5912
|
}
|
|
5919
5913
|
_tweenFunc(i) {
|
|
5920
|
-
|
|
5921
|
-
let key, attr, start, diff, newVal, n, len, end;
|
|
5914
|
+
let node = this.node, attrs = Tween.attrs[node._id][this._id], key, attr, start, diff, newVal, n, len, end;
|
|
5922
5915
|
for (key in attrs) {
|
|
5923
5916
|
attr = attrs[key];
|
|
5924
5917
|
start = attr.start;
|
|
@@ -6030,9 +6023,9 @@
|
|
|
6030
6023
|
return this;
|
|
6031
6024
|
}
|
|
6032
6025
|
destroy() {
|
|
6033
|
-
|
|
6026
|
+
let nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId], key;
|
|
6034
6027
|
this.pause();
|
|
6035
|
-
for (
|
|
6028
|
+
for (key in attrs) {
|
|
6036
6029
|
delete Tween.tweens[nodeId][key];
|
|
6037
6030
|
}
|
|
6038
6031
|
delete Tween.attrs[nodeId][thisId];
|
|
@@ -6209,7 +6202,7 @@
|
|
|
6209
6202
|
hasRequired_CoreInternals = 1;
|
|
6210
6203
|
(function (exports) {
|
|
6211
6204
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6212
|
-
exports.Konva =
|
|
6205
|
+
exports.Konva = void 0;
|
|
6213
6206
|
const Global_1 = requireGlobal();
|
|
6214
6207
|
const Util_1 = requireUtil();
|
|
6215
6208
|
const Node_1 = requireNode();
|
|
@@ -6256,7 +6249,7 @@
|
|
|
6256
6249
|
if (hasRequiredArc) return Arc;
|
|
6257
6250
|
hasRequiredArc = 1;
|
|
6258
6251
|
Object.defineProperty(Arc, "__esModule", { value: true });
|
|
6259
|
-
Arc.Arc =
|
|
6252
|
+
Arc.Arc = void 0;
|
|
6260
6253
|
const Factory_1 = requireFactory();
|
|
6261
6254
|
const Shape_1 = requireShape();
|
|
6262
6255
|
const Global_1 = requireGlobal();
|
|
@@ -6326,7 +6319,7 @@
|
|
|
6326
6319
|
if (hasRequiredLine) return Line;
|
|
6327
6320
|
hasRequiredLine = 1;
|
|
6328
6321
|
Object.defineProperty(Line, "__esModule", { value: true });
|
|
6329
|
-
Line.Line =
|
|
6322
|
+
Line.Line = void 0;
|
|
6330
6323
|
const Factory_1 = requireFactory();
|
|
6331
6324
|
const Global_1 = requireGlobal();
|
|
6332
6325
|
const Shape_1 = requireShape();
|
|
@@ -6497,342 +6490,342 @@
|
|
|
6497
6490
|
hasRequiredBezierFunctions = 1;
|
|
6498
6491
|
(function (exports) {
|
|
6499
6492
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6500
|
-
exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues =
|
|
6493
|
+
exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = void 0;
|
|
6501
6494
|
exports.tValues = [
|
|
6502
6495
|
[],
|
|
6503
6496
|
[],
|
|
6504
6497
|
[
|
|
6505
|
-
-0.
|
|
6498
|
+
-0.5773502691896257645091487805019574556476,
|
|
6506
6499
|
0.5773502691896257645091487805019574556476,
|
|
6507
6500
|
],
|
|
6508
6501
|
[
|
|
6509
|
-
0, -0.
|
|
6502
|
+
0, -0.7745966692414833770358530799564799221665,
|
|
6510
6503
|
0.7745966692414833770358530799564799221665,
|
|
6511
6504
|
],
|
|
6512
6505
|
[
|
|
6513
|
-
-0.
|
|
6506
|
+
-0.3399810435848562648026657591032446872005,
|
|
6514
6507
|
0.3399810435848562648026657591032446872005,
|
|
6515
|
-
-0.
|
|
6508
|
+
-0.8611363115940525752239464888928095050957,
|
|
6516
6509
|
0.8611363115940525752239464888928095050957,
|
|
6517
6510
|
],
|
|
6518
6511
|
[
|
|
6519
|
-
0, -0.
|
|
6512
|
+
0, -0.5384693101056830910363144207002088049672,
|
|
6520
6513
|
0.5384693101056830910363144207002088049672,
|
|
6521
|
-
-0.
|
|
6514
|
+
-0.9061798459386639927976268782993929651256,
|
|
6522
6515
|
0.9061798459386639927976268782993929651256,
|
|
6523
6516
|
],
|
|
6524
6517
|
[
|
|
6525
6518
|
0.6612093864662645136613995950199053470064,
|
|
6526
|
-
-0.
|
|
6527
|
-
-0.
|
|
6519
|
+
-0.6612093864662645136613995950199053470064,
|
|
6520
|
+
-0.2386191860831969086305017216807119354186,
|
|
6528
6521
|
0.2386191860831969086305017216807119354186,
|
|
6529
|
-
-0.
|
|
6522
|
+
-0.9324695142031520278123015544939946091347,
|
|
6530
6523
|
0.9324695142031520278123015544939946091347,
|
|
6531
6524
|
],
|
|
6532
6525
|
[
|
|
6533
6526
|
0, 0.4058451513773971669066064120769614633473,
|
|
6534
|
-
-0.
|
|
6535
|
-
-0.
|
|
6527
|
+
-0.4058451513773971669066064120769614633473,
|
|
6528
|
+
-0.7415311855993944398638647732807884070741,
|
|
6536
6529
|
0.7415311855993944398638647732807884070741,
|
|
6537
|
-
-0.
|
|
6530
|
+
-0.9491079123427585245261896840478512624007,
|
|
6538
6531
|
0.9491079123427585245261896840478512624007,
|
|
6539
6532
|
],
|
|
6540
6533
|
[
|
|
6541
|
-
-0.
|
|
6534
|
+
-0.1834346424956498049394761423601839806667,
|
|
6542
6535
|
0.1834346424956498049394761423601839806667,
|
|
6543
|
-
-0.
|
|
6536
|
+
-0.5255324099163289858177390491892463490419,
|
|
6544
6537
|
0.5255324099163289858177390491892463490419,
|
|
6545
|
-
-0.
|
|
6538
|
+
-0.7966664774136267395915539364758304368371,
|
|
6546
6539
|
0.7966664774136267395915539364758304368371,
|
|
6547
|
-
-0.
|
|
6540
|
+
-0.9602898564975362316835608685694729904282,
|
|
6548
6541
|
0.9602898564975362316835608685694729904282,
|
|
6549
6542
|
],
|
|
6550
6543
|
[
|
|
6551
|
-
0, -0.
|
|
6544
|
+
0, -0.8360311073266357942994297880697348765441,
|
|
6552
6545
|
0.8360311073266357942994297880697348765441,
|
|
6553
|
-
-0.
|
|
6546
|
+
-0.9681602395076260898355762029036728700494,
|
|
6554
6547
|
0.9681602395076260898355762029036728700494,
|
|
6555
|
-
-0.
|
|
6548
|
+
-0.3242534234038089290385380146433366085719,
|
|
6556
6549
|
0.3242534234038089290385380146433366085719,
|
|
6557
|
-
-0.
|
|
6550
|
+
-0.6133714327005903973087020393414741847857,
|
|
6558
6551
|
0.6133714327005903973087020393414741847857,
|
|
6559
6552
|
],
|
|
6560
6553
|
[
|
|
6561
|
-
-0.
|
|
6554
|
+
-0.1488743389816312108848260011297199846175,
|
|
6562
6555
|
0.1488743389816312108848260011297199846175,
|
|
6563
|
-
-0.
|
|
6556
|
+
-0.4333953941292471907992659431657841622,
|
|
6564
6557
|
0.4333953941292471907992659431657841622,
|
|
6565
|
-
-0.
|
|
6558
|
+
-0.6794095682990244062343273651148735757692,
|
|
6566
6559
|
0.6794095682990244062343273651148735757692,
|
|
6567
|
-
-0.
|
|
6560
|
+
-0.8650633666889845107320966884234930485275,
|
|
6568
6561
|
0.8650633666889845107320966884234930485275,
|
|
6569
|
-
-0.
|
|
6562
|
+
-0.9739065285171717200779640120844520534282,
|
|
6570
6563
|
0.9739065285171717200779640120844520534282,
|
|
6571
6564
|
],
|
|
6572
6565
|
[
|
|
6573
|
-
0, -0.
|
|
6566
|
+
0, -0.2695431559523449723315319854008615246796,
|
|
6574
6567
|
0.2695431559523449723315319854008615246796,
|
|
6575
|
-
-0.
|
|
6568
|
+
-0.5190961292068118159257256694586095544802,
|
|
6576
6569
|
0.5190961292068118159257256694586095544802,
|
|
6577
|
-
-0.
|
|
6570
|
+
-0.7301520055740493240934162520311534580496,
|
|
6578
6571
|
0.7301520055740493240934162520311534580496,
|
|
6579
|
-
-0.
|
|
6572
|
+
-0.8870625997680952990751577693039272666316,
|
|
6580
6573
|
0.8870625997680952990751577693039272666316,
|
|
6581
|
-
-0.
|
|
6574
|
+
-0.9782286581460569928039380011228573907714,
|
|
6582
6575
|
0.9782286581460569928039380011228573907714,
|
|
6583
6576
|
],
|
|
6584
6577
|
[
|
|
6585
|
-
-0.
|
|
6578
|
+
-0.1252334085114689154724413694638531299833,
|
|
6586
6579
|
0.1252334085114689154724413694638531299833,
|
|
6587
|
-
-0.
|
|
6580
|
+
-0.3678314989981801937526915366437175612563,
|
|
6588
6581
|
0.3678314989981801937526915366437175612563,
|
|
6589
|
-
-0.
|
|
6582
|
+
-0.587317954286617447296702418940534280369,
|
|
6590
6583
|
0.587317954286617447296702418940534280369,
|
|
6591
|
-
-0.
|
|
6584
|
+
-0.7699026741943046870368938332128180759849,
|
|
6592
6585
|
0.7699026741943046870368938332128180759849,
|
|
6593
|
-
-0.
|
|
6586
|
+
-0.9041172563704748566784658661190961925375,
|
|
6594
6587
|
0.9041172563704748566784658661190961925375,
|
|
6595
|
-
-0.
|
|
6588
|
+
-0.9815606342467192506905490901492808229601,
|
|
6596
6589
|
0.9815606342467192506905490901492808229601,
|
|
6597
6590
|
],
|
|
6598
6591
|
[
|
|
6599
|
-
0, -0.
|
|
6592
|
+
0, -0.2304583159551347940655281210979888352115,
|
|
6600
6593
|
0.2304583159551347940655281210979888352115,
|
|
6601
|
-
-0.
|
|
6594
|
+
-0.4484927510364468528779128521276398678019,
|
|
6602
6595
|
0.4484927510364468528779128521276398678019,
|
|
6603
|
-
-0.
|
|
6596
|
+
-0.6423493394403402206439846069955156500716,
|
|
6604
6597
|
0.6423493394403402206439846069955156500716,
|
|
6605
|
-
-0.
|
|
6598
|
+
-0.8015780907333099127942064895828598903056,
|
|
6606
6599
|
0.8015780907333099127942064895828598903056,
|
|
6607
|
-
-0.
|
|
6600
|
+
-0.9175983992229779652065478365007195123904,
|
|
6608
6601
|
0.9175983992229779652065478365007195123904,
|
|
6609
|
-
-0.
|
|
6602
|
+
-0.9841830547185881494728294488071096110649,
|
|
6610
6603
|
0.9841830547185881494728294488071096110649,
|
|
6611
6604
|
],
|
|
6612
6605
|
[
|
|
6613
|
-
-0.
|
|
6606
|
+
-0.1080549487073436620662446502198347476119,
|
|
6614
6607
|
0.1080549487073436620662446502198347476119,
|
|
6615
|
-
-0.
|
|
6608
|
+
-0.3191123689278897604356718241684754668342,
|
|
6616
6609
|
0.3191123689278897604356718241684754668342,
|
|
6617
|
-
-0.
|
|
6610
|
+
-0.5152486363581540919652907185511886623088,
|
|
6618
6611
|
0.5152486363581540919652907185511886623088,
|
|
6619
|
-
-0.
|
|
6612
|
+
-0.6872929048116854701480198030193341375384,
|
|
6620
6613
|
0.6872929048116854701480198030193341375384,
|
|
6621
|
-
-0.
|
|
6614
|
+
-0.8272013150697649931897947426503949610397,
|
|
6622
6615
|
0.8272013150697649931897947426503949610397,
|
|
6623
|
-
-0.
|
|
6616
|
+
-0.928434883663573517336391139377874264477,
|
|
6624
6617
|
0.928434883663573517336391139377874264477,
|
|
6625
|
-
-0.
|
|
6618
|
+
-0.986283808696812338841597266704052801676,
|
|
6626
6619
|
0.986283808696812338841597266704052801676,
|
|
6627
6620
|
],
|
|
6628
6621
|
[
|
|
6629
|
-
0, -0.
|
|
6622
|
+
0, -0.2011940939974345223006283033945962078128,
|
|
6630
6623
|
0.2011940939974345223006283033945962078128,
|
|
6631
|
-
-0.
|
|
6624
|
+
-0.3941513470775633698972073709810454683627,
|
|
6632
6625
|
0.3941513470775633698972073709810454683627,
|
|
6633
|
-
-0.
|
|
6626
|
+
-0.5709721726085388475372267372539106412383,
|
|
6634
6627
|
0.5709721726085388475372267372539106412383,
|
|
6635
|
-
-0.
|
|
6628
|
+
-0.7244177313601700474161860546139380096308,
|
|
6636
6629
|
0.7244177313601700474161860546139380096308,
|
|
6637
|
-
-0.
|
|
6630
|
+
-0.8482065834104272162006483207742168513662,
|
|
6638
6631
|
0.8482065834104272162006483207742168513662,
|
|
6639
|
-
-0.
|
|
6632
|
+
-0.9372733924007059043077589477102094712439,
|
|
6640
6633
|
0.9372733924007059043077589477102094712439,
|
|
6641
|
-
-0.
|
|
6634
|
+
-0.9879925180204854284895657185866125811469,
|
|
6642
6635
|
0.9879925180204854284895657185866125811469,
|
|
6643
6636
|
],
|
|
6644
6637
|
[
|
|
6645
|
-
-0.
|
|
6638
|
+
-0.0950125098376374401853193354249580631303,
|
|
6646
6639
|
0.0950125098376374401853193354249580631303,
|
|
6647
|
-
-0.
|
|
6640
|
+
-0.281603550779258913230460501460496106486,
|
|
6648
6641
|
0.281603550779258913230460501460496106486,
|
|
6649
|
-
-0.
|
|
6642
|
+
-0.45801677765722738634241944298357757354,
|
|
6650
6643
|
0.45801677765722738634241944298357757354,
|
|
6651
|
-
-0.
|
|
6644
|
+
-0.6178762444026437484466717640487910189918,
|
|
6652
6645
|
0.6178762444026437484466717640487910189918,
|
|
6653
|
-
-0.
|
|
6646
|
+
-0.7554044083550030338951011948474422683538,
|
|
6654
6647
|
0.7554044083550030338951011948474422683538,
|
|
6655
|
-
-0.
|
|
6648
|
+
-0.8656312023878317438804678977123931323873,
|
|
6656
6649
|
0.8656312023878317438804678977123931323873,
|
|
6657
|
-
-0.
|
|
6650
|
+
-0.9445750230732325760779884155346083450911,
|
|
6658
6651
|
0.9445750230732325760779884155346083450911,
|
|
6659
|
-
-0.
|
|
6652
|
+
-0.9894009349916499325961541734503326274262,
|
|
6660
6653
|
0.9894009349916499325961541734503326274262,
|
|
6661
6654
|
],
|
|
6662
6655
|
[
|
|
6663
|
-
0, -0.
|
|
6656
|
+
0, -0.1784841814958478558506774936540655574754,
|
|
6664
6657
|
0.1784841814958478558506774936540655574754,
|
|
6665
|
-
-0.
|
|
6658
|
+
-0.3512317634538763152971855170953460050405,
|
|
6666
6659
|
0.3512317634538763152971855170953460050405,
|
|
6667
|
-
-0.
|
|
6660
|
+
-0.5126905370864769678862465686295518745829,
|
|
6668
6661
|
0.5126905370864769678862465686295518745829,
|
|
6669
|
-
-0.
|
|
6662
|
+
-0.6576711592166907658503022166430023351478,
|
|
6670
6663
|
0.6576711592166907658503022166430023351478,
|
|
6671
|
-
-0.
|
|
6664
|
+
-0.7815140038968014069252300555204760502239,
|
|
6672
6665
|
0.7815140038968014069252300555204760502239,
|
|
6673
|
-
-0.
|
|
6666
|
+
-0.8802391537269859021229556944881556926234,
|
|
6674
6667
|
0.8802391537269859021229556944881556926234,
|
|
6675
|
-
-0.
|
|
6668
|
+
-0.9506755217687677612227169578958030214433,
|
|
6676
6669
|
0.9506755217687677612227169578958030214433,
|
|
6677
|
-
-0.
|
|
6670
|
+
-0.9905754753144173356754340199406652765077,
|
|
6678
6671
|
0.9905754753144173356754340199406652765077,
|
|
6679
6672
|
],
|
|
6680
6673
|
[
|
|
6681
|
-
-0.
|
|
6674
|
+
-0.0847750130417353012422618529357838117333,
|
|
6682
6675
|
0.0847750130417353012422618529357838117333,
|
|
6683
|
-
-0.
|
|
6676
|
+
-0.2518862256915055095889728548779112301628,
|
|
6684
6677
|
0.2518862256915055095889728548779112301628,
|
|
6685
|
-
-0.
|
|
6678
|
+
-0.4117511614628426460359317938330516370789,
|
|
6686
6679
|
0.4117511614628426460359317938330516370789,
|
|
6687
|
-
-0.
|
|
6680
|
+
-0.5597708310739475346078715485253291369276,
|
|
6688
6681
|
0.5597708310739475346078715485253291369276,
|
|
6689
|
-
-0.
|
|
6682
|
+
-0.6916870430603532078748910812888483894522,
|
|
6690
6683
|
0.6916870430603532078748910812888483894522,
|
|
6691
|
-
-0.
|
|
6684
|
+
-0.8037049589725231156824174550145907971032,
|
|
6692
6685
|
0.8037049589725231156824174550145907971032,
|
|
6693
|
-
-0.
|
|
6686
|
+
-0.8926024664975557392060605911271455154078,
|
|
6694
6687
|
0.8926024664975557392060605911271455154078,
|
|
6695
|
-
-0.
|
|
6688
|
+
-0.9558239495713977551811958929297763099728,
|
|
6696
6689
|
0.9558239495713977551811958929297763099728,
|
|
6697
|
-
-0.
|
|
6690
|
+
-0.9915651684209309467300160047061507702525,
|
|
6698
6691
|
0.9915651684209309467300160047061507702525,
|
|
6699
6692
|
],
|
|
6700
6693
|
[
|
|
6701
|
-
0, -0.
|
|
6694
|
+
0, -0.1603586456402253758680961157407435495048,
|
|
6702
6695
|
0.1603586456402253758680961157407435495048,
|
|
6703
|
-
-0.
|
|
6696
|
+
-0.3165640999636298319901173288498449178922,
|
|
6704
6697
|
0.3165640999636298319901173288498449178922,
|
|
6705
|
-
-0.
|
|
6698
|
+
-0.4645707413759609457172671481041023679762,
|
|
6706
6699
|
0.4645707413759609457172671481041023679762,
|
|
6707
|
-
-0.
|
|
6700
|
+
-0.6005453046616810234696381649462392798683,
|
|
6708
6701
|
0.6005453046616810234696381649462392798683,
|
|
6709
|
-
-0.
|
|
6702
|
+
-0.7209661773352293786170958608237816296571,
|
|
6710
6703
|
0.7209661773352293786170958608237816296571,
|
|
6711
|
-
-0.
|
|
6704
|
+
-0.8227146565371428249789224867127139017745,
|
|
6712
6705
|
0.8227146565371428249789224867127139017745,
|
|
6713
|
-
-0.
|
|
6706
|
+
-0.9031559036148179016426609285323124878093,
|
|
6714
6707
|
0.9031559036148179016426609285323124878093,
|
|
6715
|
-
-0.
|
|
6708
|
+
-0.960208152134830030852778840687651526615,
|
|
6716
6709
|
0.960208152134830030852778840687651526615,
|
|
6717
|
-
-0.
|
|
6710
|
+
-0.9924068438435844031890176702532604935893,
|
|
6718
6711
|
0.9924068438435844031890176702532604935893,
|
|
6719
6712
|
],
|
|
6720
6713
|
[
|
|
6721
|
-
-0.
|
|
6714
|
+
-0.0765265211334973337546404093988382110047,
|
|
6722
6715
|
0.0765265211334973337546404093988382110047,
|
|
6723
|
-
-0.
|
|
6716
|
+
-0.227785851141645078080496195368574624743,
|
|
6724
6717
|
0.227785851141645078080496195368574624743,
|
|
6725
|
-
-0.
|
|
6718
|
+
-0.3737060887154195606725481770249272373957,
|
|
6726
6719
|
0.3737060887154195606725481770249272373957,
|
|
6727
|
-
-0.
|
|
6720
|
+
-0.5108670019508270980043640509552509984254,
|
|
6728
6721
|
0.5108670019508270980043640509552509984254,
|
|
6729
|
-
-0.
|
|
6722
|
+
-0.6360536807265150254528366962262859367433,
|
|
6730
6723
|
0.6360536807265150254528366962262859367433,
|
|
6731
|
-
-0.
|
|
6724
|
+
-0.7463319064601507926143050703556415903107,
|
|
6732
6725
|
0.7463319064601507926143050703556415903107,
|
|
6733
|
-
-0.
|
|
6726
|
+
-0.8391169718222188233945290617015206853296,
|
|
6734
6727
|
0.8391169718222188233945290617015206853296,
|
|
6735
|
-
-0.
|
|
6728
|
+
-0.9122344282513259058677524412032981130491,
|
|
6736
6729
|
0.9122344282513259058677524412032981130491,
|
|
6737
|
-
-0.
|
|
6730
|
+
-0.963971927277913791267666131197277221912,
|
|
6738
6731
|
0.963971927277913791267666131197277221912,
|
|
6739
|
-
-0.
|
|
6732
|
+
-0.9931285991850949247861223884713202782226,
|
|
6740
6733
|
0.9931285991850949247861223884713202782226,
|
|
6741
6734
|
],
|
|
6742
6735
|
[
|
|
6743
|
-
0, -0.
|
|
6736
|
+
0, -0.1455618541608950909370309823386863301163,
|
|
6744
6737
|
0.1455618541608950909370309823386863301163,
|
|
6745
|
-
-0.
|
|
6738
|
+
-0.288021316802401096600792516064600319909,
|
|
6746
6739
|
0.288021316802401096600792516064600319909,
|
|
6747
|
-
-0.
|
|
6740
|
+
-0.4243421202074387835736688885437880520964,
|
|
6748
6741
|
0.4243421202074387835736688885437880520964,
|
|
6749
|
-
-0.
|
|
6742
|
+
-0.551618835887219807059018796724313286622,
|
|
6750
6743
|
0.551618835887219807059018796724313286622,
|
|
6751
|
-
-0.
|
|
6744
|
+
-0.667138804197412319305966669990339162597,
|
|
6752
6745
|
0.667138804197412319305966669990339162597,
|
|
6753
|
-
-0.
|
|
6746
|
+
-0.7684399634756779086158778513062280348209,
|
|
6754
6747
|
0.7684399634756779086158778513062280348209,
|
|
6755
|
-
-0.
|
|
6748
|
+
-0.8533633645833172836472506385875676702761,
|
|
6756
6749
|
0.8533633645833172836472506385875676702761,
|
|
6757
|
-
-0.
|
|
6750
|
+
-0.9200993341504008287901871337149688941591,
|
|
6758
6751
|
0.9200993341504008287901871337149688941591,
|
|
6759
|
-
-0.
|
|
6752
|
+
-0.9672268385663062943166222149076951614246,
|
|
6760
6753
|
0.9672268385663062943166222149076951614246,
|
|
6761
|
-
-0.
|
|
6754
|
+
-0.9937521706203895002602420359379409291933,
|
|
6762
6755
|
0.9937521706203895002602420359379409291933,
|
|
6763
6756
|
],
|
|
6764
6757
|
[
|
|
6765
|
-
-0.
|
|
6758
|
+
-0.0697392733197222212138417961186280818222,
|
|
6766
6759
|
0.0697392733197222212138417961186280818222,
|
|
6767
|
-
-0.
|
|
6760
|
+
-0.2078604266882212854788465339195457342156,
|
|
6768
6761
|
0.2078604266882212854788465339195457342156,
|
|
6769
|
-
-0.
|
|
6762
|
+
-0.3419358208920842251581474204273796195591,
|
|
6770
6763
|
0.3419358208920842251581474204273796195591,
|
|
6771
|
-
-0.
|
|
6764
|
+
-0.4693558379867570264063307109664063460953,
|
|
6772
6765
|
0.4693558379867570264063307109664063460953,
|
|
6773
|
-
-0.
|
|
6766
|
+
-0.5876404035069115929588769276386473488776,
|
|
6774
6767
|
0.5876404035069115929588769276386473488776,
|
|
6775
|
-
-0.
|
|
6768
|
+
-0.6944872631866827800506898357622567712673,
|
|
6776
6769
|
0.6944872631866827800506898357622567712673,
|
|
6777
|
-
-0.
|
|
6770
|
+
-0.7878168059792081620042779554083515213881,
|
|
6778
6771
|
0.7878168059792081620042779554083515213881,
|
|
6779
|
-
-0.
|
|
6772
|
+
-0.8658125777203001365364256370193787290847,
|
|
6780
6773
|
0.8658125777203001365364256370193787290847,
|
|
6781
|
-
-0.
|
|
6774
|
+
-0.9269567721871740005206929392590531966353,
|
|
6782
6775
|
0.9269567721871740005206929392590531966353,
|
|
6783
|
-
-0.
|
|
6776
|
+
-0.9700604978354287271239509867652687108059,
|
|
6784
6777
|
0.9700604978354287271239509867652687108059,
|
|
6785
|
-
-0.
|
|
6778
|
+
-0.994294585482399292073031421161298980393,
|
|
6786
6779
|
0.994294585482399292073031421161298980393,
|
|
6787
6780
|
],
|
|
6788
6781
|
[
|
|
6789
|
-
0, -0.
|
|
6782
|
+
0, -0.1332568242984661109317426822417661370104,
|
|
6790
6783
|
0.1332568242984661109317426822417661370104,
|
|
6791
|
-
-0.
|
|
6784
|
+
-0.264135680970344930533869538283309602979,
|
|
6792
6785
|
0.264135680970344930533869538283309602979,
|
|
6793
|
-
-0.
|
|
6786
|
+
-0.390301038030290831421488872880605458578,
|
|
6794
6787
|
0.390301038030290831421488872880605458578,
|
|
6795
|
-
-0.
|
|
6788
|
+
-0.5095014778460075496897930478668464305448,
|
|
6796
6789
|
0.5095014778460075496897930478668464305448,
|
|
6797
|
-
-0.
|
|
6790
|
+
-0.6196098757636461563850973116495956533871,
|
|
6798
6791
|
0.6196098757636461563850973116495956533871,
|
|
6799
|
-
-0.
|
|
6792
|
+
-0.7186613631319501944616244837486188483299,
|
|
6800
6793
|
0.7186613631319501944616244837486188483299,
|
|
6801
|
-
-0.
|
|
6794
|
+
-0.8048884016188398921511184069967785579414,
|
|
6802
6795
|
0.8048884016188398921511184069967785579414,
|
|
6803
|
-
-0.
|
|
6796
|
+
-0.8767523582704416673781568859341456716389,
|
|
6804
6797
|
0.8767523582704416673781568859341456716389,
|
|
6805
|
-
-0.
|
|
6798
|
+
-0.9329710868260161023491969890384229782357,
|
|
6806
6799
|
0.9329710868260161023491969890384229782357,
|
|
6807
|
-
-0.
|
|
6800
|
+
-0.9725424712181152319560240768207773751816,
|
|
6808
6801
|
0.9725424712181152319560240768207773751816,
|
|
6809
|
-
-0.
|
|
6802
|
+
-0.9947693349975521235239257154455743605736,
|
|
6810
6803
|
0.9947693349975521235239257154455743605736,
|
|
6811
6804
|
],
|
|
6812
6805
|
[
|
|
6813
|
-
-0.
|
|
6806
|
+
-0.0640568928626056260850430826247450385909,
|
|
6814
6807
|
0.0640568928626056260850430826247450385909,
|
|
6815
|
-
-0.
|
|
6808
|
+
-0.1911188674736163091586398207570696318404,
|
|
6816
6809
|
0.1911188674736163091586398207570696318404,
|
|
6817
|
-
-0.
|
|
6810
|
+
-0.3150426796961633743867932913198102407864,
|
|
6818
6811
|
0.3150426796961633743867932913198102407864,
|
|
6819
|
-
-0.
|
|
6812
|
+
-0.4337935076260451384870842319133497124524,
|
|
6820
6813
|
0.4337935076260451384870842319133497124524,
|
|
6821
|
-
-0.
|
|
6814
|
+
-0.5454214713888395356583756172183723700107,
|
|
6822
6815
|
0.5454214713888395356583756172183723700107,
|
|
6823
|
-
-0.
|
|
6816
|
+
-0.6480936519369755692524957869107476266696,
|
|
6824
6817
|
0.6480936519369755692524957869107476266696,
|
|
6825
|
-
-0.
|
|
6818
|
+
-0.7401241915785543642438281030999784255232,
|
|
6826
6819
|
0.7401241915785543642438281030999784255232,
|
|
6827
|
-
-0.
|
|
6820
|
+
-0.8200019859739029219539498726697452080761,
|
|
6828
6821
|
0.8200019859739029219539498726697452080761,
|
|
6829
|
-
-0.
|
|
6822
|
+
-0.8864155270044010342131543419821967550873,
|
|
6830
6823
|
0.8864155270044010342131543419821967550873,
|
|
6831
|
-
-0.
|
|
6824
|
+
-0.9382745520027327585236490017087214496548,
|
|
6832
6825
|
0.9382745520027327585236490017087214496548,
|
|
6833
|
-
-0.
|
|
6826
|
+
-0.9747285559713094981983919930081690617411,
|
|
6834
6827
|
0.9747285559713094981983919930081690617411,
|
|
6835
|
-
-0.
|
|
6828
|
+
-0.9951872199970213601799974097007368118745,
|
|
6836
6829
|
0.9951872199970213601799974097007368118745,
|
|
6837
6830
|
],
|
|
6838
6831
|
];
|
|
@@ -7295,7 +7288,7 @@
|
|
|
7295
7288
|
if (hasRequiredPath) return Path;
|
|
7296
7289
|
hasRequiredPath = 1;
|
|
7297
7290
|
Object.defineProperty(Path, "__esModule", { value: true });
|
|
7298
|
-
Path.Path =
|
|
7291
|
+
Path.Path = void 0;
|
|
7299
7292
|
const Factory_1 = requireFactory();
|
|
7300
7293
|
const Shape_1 = requireShape();
|
|
7301
7294
|
const Global_1 = requireGlobal();
|
|
@@ -7478,8 +7471,8 @@
|
|
|
7478
7471
|
return null;
|
|
7479
7472
|
}
|
|
7480
7473
|
static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {
|
|
7481
|
-
fromX = fromX !== null && fromX !==
|
|
7482
|
-
fromY = fromY !== null && fromY !==
|
|
7474
|
+
fromX = fromX !== null && fromX !== void 0 ? fromX : P1x;
|
|
7475
|
+
fromY = fromY !== null && fromY !== void 0 ? fromY : P1y;
|
|
7483
7476
|
const len = this.getLineLength(P1x, P1y, P2x, P2y);
|
|
7484
7477
|
if (len < 1e-10) {
|
|
7485
7478
|
return { x: P1x, y: P1y };
|
|
@@ -7908,7 +7901,7 @@
|
|
|
7908
7901
|
if (hasRequiredArrow) return Arrow;
|
|
7909
7902
|
hasRequiredArrow = 1;
|
|
7910
7903
|
Object.defineProperty(Arrow, "__esModule", { value: true });
|
|
7911
|
-
Arrow.Arrow =
|
|
7904
|
+
Arrow.Arrow = void 0;
|
|
7912
7905
|
const Factory_1 = requireFactory();
|
|
7913
7906
|
const Line_1 = requireLine();
|
|
7914
7907
|
const Validators_1 = requireValidators();
|
|
@@ -7995,9 +7988,9 @@
|
|
|
7995
7988
|
const lineRect = super.getSelfRect();
|
|
7996
7989
|
const offset = this.pointerWidth() / 2;
|
|
7997
7990
|
return {
|
|
7998
|
-
x: lineRect.x,
|
|
7991
|
+
x: lineRect.x - offset,
|
|
7999
7992
|
y: lineRect.y - offset,
|
|
8000
|
-
width: lineRect.width,
|
|
7993
|
+
width: lineRect.width + offset * 2,
|
|
8001
7994
|
height: lineRect.height + offset * 2,
|
|
8002
7995
|
};
|
|
8003
7996
|
}
|
|
@@ -8020,7 +8013,7 @@
|
|
|
8020
8013
|
if (hasRequiredCircle) return Circle;
|
|
8021
8014
|
hasRequiredCircle = 1;
|
|
8022
8015
|
Object.defineProperty(Circle, "__esModule", { value: true });
|
|
8023
|
-
Circle.Circle =
|
|
8016
|
+
Circle.Circle = void 0;
|
|
8024
8017
|
const Factory_1 = requireFactory();
|
|
8025
8018
|
const Shape_1 = requireShape();
|
|
8026
8019
|
const Validators_1 = requireValidators();
|
|
@@ -8066,7 +8059,7 @@
|
|
|
8066
8059
|
if (hasRequiredEllipse) return Ellipse;
|
|
8067
8060
|
hasRequiredEllipse = 1;
|
|
8068
8061
|
Object.defineProperty(Ellipse, "__esModule", { value: true });
|
|
8069
|
-
Ellipse.Ellipse =
|
|
8062
|
+
Ellipse.Ellipse = void 0;
|
|
8070
8063
|
const Factory_1 = requireFactory();
|
|
8071
8064
|
const Shape_1 = requireShape();
|
|
8072
8065
|
const Validators_1 = requireValidators();
|
|
@@ -8116,7 +8109,7 @@
|
|
|
8116
8109
|
if (hasRequiredImage) return Image$1;
|
|
8117
8110
|
hasRequiredImage = 1;
|
|
8118
8111
|
Object.defineProperty(Image$1, "__esModule", { value: true });
|
|
8119
|
-
Image$1.Image =
|
|
8112
|
+
Image$1.Image = void 0;
|
|
8120
8113
|
const Util_1 = requireUtil();
|
|
8121
8114
|
const Factory_1 = requireFactory();
|
|
8122
8115
|
const Shape_1 = requireShape();
|
|
@@ -8207,11 +8200,11 @@
|
|
|
8207
8200
|
}
|
|
8208
8201
|
getWidth() {
|
|
8209
8202
|
var _a, _b;
|
|
8210
|
-
return (_a = this.attrs.width) !== null && _a !==
|
|
8203
|
+
return (_a = this.attrs.width) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.width;
|
|
8211
8204
|
}
|
|
8212
8205
|
getHeight() {
|
|
8213
8206
|
var _a, _b;
|
|
8214
|
-
return (_a = this.attrs.height) !== null && _a !==
|
|
8207
|
+
return (_a = this.attrs.height) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.height;
|
|
8215
8208
|
}
|
|
8216
8209
|
static fromURL(url, callback, onError = null) {
|
|
8217
8210
|
const img = Util_1.Util.createImageElement();
|
|
@@ -8247,7 +8240,7 @@
|
|
|
8247
8240
|
if (hasRequiredLabel) return Label;
|
|
8248
8241
|
hasRequiredLabel = 1;
|
|
8249
8242
|
Object.defineProperty(Label, "__esModule", { value: true });
|
|
8250
|
-
Label.Tag = Label.Label =
|
|
8243
|
+
Label.Tag = Label.Label = void 0;
|
|
8251
8244
|
const Factory_1 = requireFactory();
|
|
8252
8245
|
const Shape_1 = requireShape();
|
|
8253
8246
|
const Group_1 = requireGroup();
|
|
@@ -8434,7 +8427,7 @@
|
|
|
8434
8427
|
if (hasRequiredRect) return Rect;
|
|
8435
8428
|
hasRequiredRect = 1;
|
|
8436
8429
|
Object.defineProperty(Rect, "__esModule", { value: true });
|
|
8437
|
-
Rect.Rect =
|
|
8430
|
+
Rect.Rect = void 0;
|
|
8438
8431
|
const Factory_1 = requireFactory();
|
|
8439
8432
|
const Shape_1 = requireShape();
|
|
8440
8433
|
const Global_1 = requireGlobal();
|
|
@@ -8469,7 +8462,7 @@
|
|
|
8469
8462
|
if (hasRequiredRegularPolygon) return RegularPolygon;
|
|
8470
8463
|
hasRequiredRegularPolygon = 1;
|
|
8471
8464
|
Object.defineProperty(RegularPolygon, "__esModule", { value: true });
|
|
8472
|
-
RegularPolygon.RegularPolygon =
|
|
8465
|
+
RegularPolygon.RegularPolygon = void 0;
|
|
8473
8466
|
const Factory_1 = requireFactory();
|
|
8474
8467
|
const Shape_1 = requireShape();
|
|
8475
8468
|
const Validators_1 = requireValidators();
|
|
@@ -8547,7 +8540,7 @@
|
|
|
8547
8540
|
if (hasRequiredRing) return Ring;
|
|
8548
8541
|
hasRequiredRing = 1;
|
|
8549
8542
|
Object.defineProperty(Ring, "__esModule", { value: true });
|
|
8550
|
-
Ring.Ring =
|
|
8543
|
+
Ring.Ring = void 0;
|
|
8551
8544
|
const Factory_1 = requireFactory();
|
|
8552
8545
|
const Shape_1 = requireShape();
|
|
8553
8546
|
const Validators_1 = requireValidators();
|
|
@@ -8593,7 +8586,7 @@
|
|
|
8593
8586
|
if (hasRequiredSprite) return Sprite;
|
|
8594
8587
|
hasRequiredSprite = 1;
|
|
8595
8588
|
Object.defineProperty(Sprite, "__esModule", { value: true });
|
|
8596
|
-
Sprite.Sprite =
|
|
8589
|
+
Sprite.Sprite = void 0;
|
|
8597
8590
|
const Factory_1 = requireFactory();
|
|
8598
8591
|
const Shape_1 = requireShape();
|
|
8599
8592
|
const Animation_1 = requireAnimation();
|
|
@@ -8714,7 +8707,7 @@
|
|
|
8714
8707
|
if (hasRequiredStar) return Star;
|
|
8715
8708
|
hasRequiredStar = 1;
|
|
8716
8709
|
Object.defineProperty(Star, "__esModule", { value: true });
|
|
8717
|
-
Star.Star =
|
|
8710
|
+
Star.Star = void 0;
|
|
8718
8711
|
const Factory_1 = requireFactory();
|
|
8719
8712
|
const Shape_1 = requireShape();
|
|
8720
8713
|
const Validators_1 = requireValidators();
|
|
@@ -8765,7 +8758,7 @@
|
|
|
8765
8758
|
if (hasRequiredText) return Text;
|
|
8766
8759
|
hasRequiredText = 1;
|
|
8767
8760
|
Object.defineProperty(Text, "__esModule", { value: true });
|
|
8768
|
-
Text.Text =
|
|
8761
|
+
Text.Text = void 0;
|
|
8769
8762
|
Text.stringToArray = stringToArray;
|
|
8770
8763
|
const Util_1 = requireUtil();
|
|
8771
8764
|
const Factory_1 = requireFactory();
|
|
@@ -8775,15 +8768,8 @@
|
|
|
8775
8768
|
const Global_2 = requireGlobal();
|
|
8776
8769
|
function stringToArray(string) {
|
|
8777
8770
|
return [...string].reduce((acc, char, index, array) => {
|
|
8778
|
-
if (/\p{
|
|
8779
|
-
|
|
8780
|
-
if (nextChar && /\p{Emoji_Modifier}|\u200D/u.test(nextChar)) {
|
|
8781
|
-
acc.push(char + nextChar);
|
|
8782
|
-
array[index + 1] = '';
|
|
8783
|
-
}
|
|
8784
|
-
else {
|
|
8785
|
-
acc.push(char);
|
|
8786
|
-
}
|
|
8771
|
+
if (/\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?(?:\u200D\p{Emoji_Presentation})+/u.test(char)) {
|
|
8772
|
+
acc.push(char);
|
|
8787
8773
|
}
|
|
8788
8774
|
else if (/\p{Regional_Indicator}{2}/u.test(char + (array[index + 1] || ''))) {
|
|
8789
8775
|
acc.push(char + array[index + 1]);
|
|
@@ -8791,7 +8777,7 @@
|
|
|
8791
8777
|
else if (index > 0 && /\p{Mn}|\p{Me}|\p{Mc}/u.test(char)) {
|
|
8792
8778
|
acc[acc.length - 1] += char;
|
|
8793
8779
|
}
|
|
8794
|
-
else
|
|
8780
|
+
else {
|
|
8795
8781
|
acc.push(char);
|
|
8796
8782
|
}
|
|
8797
8783
|
return acc;
|
|
@@ -8896,7 +8882,7 @@
|
|
|
8896
8882
|
for (n = 0; n < textArrLen; n++) {
|
|
8897
8883
|
var lineTranslateX = 0;
|
|
8898
8884
|
var lineTranslateY = 0;
|
|
8899
|
-
var obj = textArr[n], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph, spacesNumber, lineWidth;
|
|
8885
|
+
var obj = textArr[n], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph, spacesNumber, oneWord, lineWidth;
|
|
8900
8886
|
context.save();
|
|
8901
8887
|
if (align === RIGHT) {
|
|
8902
8888
|
lineTranslateX += totalWidth - width - padding * 2;
|
|
@@ -8914,6 +8900,7 @@
|
|
|
8914
8900
|
const y = translateY + lineTranslateY + yOffset;
|
|
8915
8901
|
context.moveTo(x, y);
|
|
8916
8902
|
spacesNumber = text.split(' ').length - 1;
|
|
8903
|
+
oneWord = spacesNumber === 0;
|
|
8917
8904
|
lineWidth =
|
|
8918
8905
|
align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
|
|
8919
8906
|
context.lineTo(x + Math.round(lineWidth), y);
|
|
@@ -8929,8 +8916,11 @@
|
|
|
8929
8916
|
const yOffset = Global_1.Konva._fixTextRendering ? -Math.round(fontSize / 4) : 0;
|
|
8930
8917
|
context.moveTo(lineTranslateX, translateY + lineTranslateY + yOffset);
|
|
8931
8918
|
spacesNumber = text.split(' ').length - 1;
|
|
8919
|
+
oneWord = spacesNumber === 0;
|
|
8932
8920
|
lineWidth =
|
|
8933
|
-
align === JUSTIFY &&
|
|
8921
|
+
align === JUSTIFY && lastLine && !oneWord
|
|
8922
|
+
? totalWidth - padding * 2
|
|
8923
|
+
: width;
|
|
8934
8924
|
context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + yOffset);
|
|
8935
8925
|
context.lineWidth = fontSize / 15;
|
|
8936
8926
|
const gradient = this._getLinearGradient();
|
|
@@ -9011,17 +9001,17 @@
|
|
|
9011
9001
|
_context.restore();
|
|
9012
9002
|
const scaleFactor = fontSize / 100;
|
|
9013
9003
|
return {
|
|
9014
|
-
actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !==
|
|
9015
|
-
actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !==
|
|
9016
|
-
actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !==
|
|
9017
|
-
actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !==
|
|
9018
|
-
alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !==
|
|
9019
|
-
emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !==
|
|
9020
|
-
emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !==
|
|
9021
|
-
fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !==
|
|
9022
|
-
fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !==
|
|
9023
|
-
hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !==
|
|
9024
|
-
ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !==
|
|
9004
|
+
actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !== void 0 ? _a : 71.58203125 * scaleFactor,
|
|
9005
|
+
actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !== void 0 ? _b : 0,
|
|
9006
|
+
actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== void 0 ? _c : -7.421875 * scaleFactor,
|
|
9007
|
+
actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== void 0 ? _d : 75.732421875 * scaleFactor,
|
|
9008
|
+
alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !== void 0 ? _e : 0,
|
|
9009
|
+
emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== void 0 ? _f : 100 * scaleFactor,
|
|
9010
|
+
emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== void 0 ? _g : -20 * scaleFactor,
|
|
9011
|
+
fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== void 0 ? _h : 91 * scaleFactor,
|
|
9012
|
+
fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== void 0 ? _j : 21 * scaleFactor,
|
|
9013
|
+
hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== void 0 ? _k : 72.80000305175781 * scaleFactor,
|
|
9014
|
+
ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== void 0 ? _l : -21 * scaleFactor,
|
|
9025
9015
|
width: metrics.width,
|
|
9026
9016
|
height: fontSize,
|
|
9027
9017
|
};
|
|
@@ -9049,23 +9039,22 @@
|
|
|
9049
9039
|
_getTextWidth(text) {
|
|
9050
9040
|
const letterSpacing = this.letterSpacing();
|
|
9051
9041
|
const length = text.length;
|
|
9052
|
-
return getDummyContext().measureText(text).width +
|
|
9042
|
+
return (getDummyContext().measureText(text).width +
|
|
9043
|
+
(length ? letterSpacing * (length - 1) : 0));
|
|
9053
9044
|
}
|
|
9054
9045
|
_setTextData() {
|
|
9055
9046
|
let lines = this.text().split('\n'), fontSize = +this.fontSize(), textWidth = 0, lineHeightPx = this.lineHeight() * fontSize, width = this.attrs.width, height = this.attrs.height, fixedWidth = width !== AUTO && width !== undefined, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxWidth = width - padding * 2, maxHeightPx = height - padding * 2, currentHeightPx = 0, wrap = this.wrap(), shouldWrap = wrap !== NONE, wrapAtWord = wrap !== CHAR && shouldWrap, shouldAddEllipsis = this.ellipsis();
|
|
9056
9047
|
this.textArr = [];
|
|
9057
9048
|
getDummyContext().font = this._getContextFont();
|
|
9058
|
-
const additionalWidth = shouldAddEllipsis
|
|
9059
|
-
? this._getTextWidth(ELLIPSIS)
|
|
9060
|
-
: 0;
|
|
9049
|
+
const additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0;
|
|
9061
9050
|
for (let i = 0, max = lines.length; i < max; ++i) {
|
|
9062
9051
|
let line = lines[i];
|
|
9063
9052
|
let lineWidth = this._getTextWidth(line);
|
|
9064
9053
|
if (fixedWidth && lineWidth > maxWidth) {
|
|
9065
9054
|
while (line.length > 0) {
|
|
9066
|
-
let low = 0, high =
|
|
9055
|
+
let low = 0, high = line.length, match = '', matchWidth = 0;
|
|
9067
9056
|
while (low < high) {
|
|
9068
|
-
const mid = (low + high) >>> 1,
|
|
9057
|
+
const mid = (low + high) >>> 1, substr = line.slice(0, mid + 1), substrWidth = this._getTextWidth(substr) + additionalWidth;
|
|
9069
9058
|
if (substrWidth <= maxWidth) {
|
|
9070
9059
|
low = mid + 1;
|
|
9071
9060
|
match = substr;
|
|
@@ -9077,22 +9066,20 @@
|
|
|
9077
9066
|
}
|
|
9078
9067
|
if (match) {
|
|
9079
9068
|
if (wrapAtWord) {
|
|
9080
|
-
|
|
9081
|
-
const
|
|
9082
|
-
const nextChar = lineArray[matchArray.length];
|
|
9069
|
+
var wrapIndex;
|
|
9070
|
+
const nextChar = line[match.length];
|
|
9083
9071
|
const nextIsSpaceOrDash = nextChar === SPACE || nextChar === DASH;
|
|
9084
|
-
let wrapIndex;
|
|
9085
9072
|
if (nextIsSpaceOrDash && matchWidth <= maxWidth) {
|
|
9086
|
-
wrapIndex =
|
|
9073
|
+
wrapIndex = match.length;
|
|
9087
9074
|
}
|
|
9088
9075
|
else {
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9076
|
+
wrapIndex =
|
|
9077
|
+
Math.max(match.lastIndexOf(SPACE), match.lastIndexOf(DASH)) +
|
|
9078
|
+
1;
|
|
9092
9079
|
}
|
|
9093
9080
|
if (wrapIndex > 0) {
|
|
9094
9081
|
low = wrapIndex;
|
|
9095
|
-
match =
|
|
9082
|
+
match = match.slice(0, low);
|
|
9096
9083
|
matchWidth = this._getTextWidth(match);
|
|
9097
9084
|
}
|
|
9098
9085
|
}
|
|
@@ -9105,8 +9092,8 @@
|
|
|
9105
9092
|
this._tryToAddEllipsisToLastLine();
|
|
9106
9093
|
break;
|
|
9107
9094
|
}
|
|
9108
|
-
|
|
9109
|
-
line =
|
|
9095
|
+
line = line.slice(low);
|
|
9096
|
+
line = line.trimLeft();
|
|
9110
9097
|
if (line.length > 0) {
|
|
9111
9098
|
lineWidth = this._getTextWidth(line);
|
|
9112
9099
|
if (lineWidth <= maxWidth) {
|
|
@@ -9213,7 +9200,7 @@
|
|
|
9213
9200
|
if (hasRequiredTextPath) return TextPath;
|
|
9214
9201
|
hasRequiredTextPath = 1;
|
|
9215
9202
|
Object.defineProperty(TextPath, "__esModule", { value: true });
|
|
9216
|
-
TextPath.TextPath =
|
|
9203
|
+
TextPath.TextPath = void 0;
|
|
9217
9204
|
const Util_1 = requireUtil();
|
|
9218
9205
|
const Factory_1 = requireFactory();
|
|
9219
9206
|
const Shape_1 = requireShape();
|
|
@@ -9450,8 +9437,8 @@
|
|
|
9450
9437
|
Factory_1.Factory.addGetterSetter(TextPath$1, 'textBaseline', 'middle');
|
|
9451
9438
|
Factory_1.Factory.addGetterSetter(TextPath$1, 'fontVariant', NORMAL);
|
|
9452
9439
|
Factory_1.Factory.addGetterSetter(TextPath$1, 'text', EMPTY_STRING);
|
|
9453
|
-
Factory_1.Factory.addGetterSetter(TextPath$1, 'textDecoration',
|
|
9454
|
-
Factory_1.Factory.addGetterSetter(TextPath$1, 'kerningFunc',
|
|
9440
|
+
Factory_1.Factory.addGetterSetter(TextPath$1, 'textDecoration', null);
|
|
9441
|
+
Factory_1.Factory.addGetterSetter(TextPath$1, 'kerningFunc', null);
|
|
9455
9442
|
return TextPath;
|
|
9456
9443
|
}
|
|
9457
9444
|
|
|
@@ -9463,7 +9450,7 @@
|
|
|
9463
9450
|
if (hasRequiredTransformer) return Transformer;
|
|
9464
9451
|
hasRequiredTransformer = 1;
|
|
9465
9452
|
Object.defineProperty(Transformer, "__esModule", { value: true });
|
|
9466
|
-
Transformer.Transformer =
|
|
9453
|
+
Transformer.Transformer = void 0;
|
|
9467
9454
|
const Util_1 = requireUtil();
|
|
9468
9455
|
const Factory_1 = requireFactory();
|
|
9469
9456
|
const Node_1 = requireNode();
|
|
@@ -9563,6 +9550,7 @@
|
|
|
9563
9550
|
'bottom-center',
|
|
9564
9551
|
'bottom-right',
|
|
9565
9552
|
];
|
|
9553
|
+
const MAX_SAFE_INTEGER = 100000000;
|
|
9566
9554
|
function getCenter(shape) {
|
|
9567
9555
|
return {
|
|
9568
9556
|
x: shape.x +
|
|
@@ -9758,8 +9746,8 @@
|
|
|
9758
9746
|
const node = this.getNode();
|
|
9759
9747
|
if (!node) {
|
|
9760
9748
|
return {
|
|
9761
|
-
x: -
|
|
9762
|
-
y: -
|
|
9749
|
+
x: -MAX_SAFE_INTEGER,
|
|
9750
|
+
y: -MAX_SAFE_INTEGER,
|
|
9763
9751
|
width: 0,
|
|
9764
9752
|
height: 0,
|
|
9765
9753
|
rotation: 0,
|
|
@@ -10138,12 +10126,12 @@
|
|
|
10138
10126
|
const node = this.getNode();
|
|
10139
10127
|
activeTransformersCount--;
|
|
10140
10128
|
this._fire('transformend', { evt: e, target: node });
|
|
10141
|
-
(_a = this.getLayer()) === null || _a ===
|
|
10129
|
+
(_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
10142
10130
|
if (node) {
|
|
10143
10131
|
this._nodes.forEach((target) => {
|
|
10144
10132
|
var _a;
|
|
10145
10133
|
target._fire('transformend', { evt: e, target });
|
|
10146
|
-
(_a = target.getLayer()) === null || _a ===
|
|
10134
|
+
(_a = target.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
10147
10135
|
});
|
|
10148
10136
|
}
|
|
10149
10137
|
this._movingAnchorName = null;
|
|
@@ -10256,7 +10244,7 @@
|
|
|
10256
10244
|
.multiply(localTransform);
|
|
10257
10245
|
const attrs = newLocalTransform.decompose();
|
|
10258
10246
|
node.setAttrs(attrs);
|
|
10259
|
-
(_a = node.getLayer()) === null || _a ===
|
|
10247
|
+
(_a = node.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
10260
10248
|
});
|
|
10261
10249
|
this.rotation(Util_1.Util._getRotation(newAttrs.rotation));
|
|
10262
10250
|
this._nodes.forEach((node) => {
|
|
@@ -10371,7 +10359,7 @@
|
|
|
10371
10359
|
styleFunc(node);
|
|
10372
10360
|
});
|
|
10373
10361
|
}
|
|
10374
|
-
(_a = this.getLayer()) === null || _a ===
|
|
10362
|
+
(_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
10375
10363
|
}
|
|
10376
10364
|
isTransforming() {
|
|
10377
10365
|
return this._transforming;
|
|
@@ -10455,8 +10443,8 @@
|
|
|
10455
10443
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'centeredScaling', false);
|
|
10456
10444
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'ignoreStroke', false);
|
|
10457
10445
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'padding', 0, (0, Validators_1.getNumberValidator)());
|
|
10458
|
-
Factory_1.Factory.addGetterSetter(Transformer$1, 'nodes');
|
|
10459
10446
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'node');
|
|
10447
|
+
Factory_1.Factory.addGetterSetter(Transformer$1, 'nodes');
|
|
10460
10448
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'boundBoxFunc');
|
|
10461
10449
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'anchorDragBoundFunc');
|
|
10462
10450
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'anchorStyleFunc');
|
|
@@ -10478,7 +10466,7 @@
|
|
|
10478
10466
|
if (hasRequiredWedge) return Wedge;
|
|
10479
10467
|
hasRequiredWedge = 1;
|
|
10480
10468
|
Object.defineProperty(Wedge, "__esModule", { value: true });
|
|
10481
|
-
Wedge.Wedge =
|
|
10469
|
+
Wedge.Wedge = void 0;
|
|
10482
10470
|
const Factory_1 = requireFactory();
|
|
10483
10471
|
const Shape_1 = requireShape();
|
|
10484
10472
|
const Global_1 = requireGlobal();
|
|
@@ -10529,7 +10517,7 @@
|
|
|
10529
10517
|
if (hasRequiredBlur) return Blur;
|
|
10530
10518
|
hasRequiredBlur = 1;
|
|
10531
10519
|
Object.defineProperty(Blur, "__esModule", { value: true });
|
|
10532
|
-
Blur.Blur =
|
|
10520
|
+
Blur.Blur = void 0;
|
|
10533
10521
|
const Factory_1 = requireFactory();
|
|
10534
10522
|
const Node_1 = requireNode();
|
|
10535
10523
|
const Validators_1 = requireValidators();
|
|
@@ -10578,8 +10566,7 @@
|
|
|
10578
10566
|
function filterGaussBlurRGBA(imageData, radius) {
|
|
10579
10567
|
const pixels = imageData.data, width = imageData.width, height = imageData.height;
|
|
10580
10568
|
let x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, a_sum, r_out_sum, g_out_sum, b_out_sum, a_out_sum, r_in_sum, g_in_sum, b_in_sum, a_in_sum, pr, pg, pb, pa, rbs;
|
|
10581
|
-
|
|
10582
|
-
let stackEnd = null, stack = stackStart, stackIn = null, stackOut = null;
|
|
10569
|
+
let div = radius + radius + 1, widthMinus1 = width - 1, heightMinus1 = height - 1, radiusPlus1 = radius + 1, sumFactor = (radiusPlus1 * (radiusPlus1 + 1)) / 2, stackStart = new BlurStack(), stackEnd = null, stack = stackStart, stackIn = null, stackOut = null, mul_sum = mul_table[radius], shg_sum = shg_table[radius];
|
|
10583
10570
|
for (i = 1; i < div; i++) {
|
|
10584
10571
|
stack = stack.next = new BlurStack();
|
|
10585
10572
|
if (i === radiusPlus1) {
|
|
@@ -10777,13 +10764,13 @@
|
|
|
10777
10764
|
if (hasRequiredBrighten) return Brighten;
|
|
10778
10765
|
hasRequiredBrighten = 1;
|
|
10779
10766
|
Object.defineProperty(Brighten, "__esModule", { value: true });
|
|
10780
|
-
Brighten.Brighten =
|
|
10767
|
+
Brighten.Brighten = void 0;
|
|
10781
10768
|
const Factory_1 = requireFactory();
|
|
10782
10769
|
const Node_1 = requireNode();
|
|
10783
10770
|
const Validators_1 = requireValidators();
|
|
10784
10771
|
const Brighten$1 = function (imageData) {
|
|
10785
|
-
|
|
10786
|
-
for (
|
|
10772
|
+
let brightness = this.brightness() * 255, data = imageData.data, len = data.length, i;
|
|
10773
|
+
for (i = 0; i < len; i += 4) {
|
|
10787
10774
|
data[i] += brightness;
|
|
10788
10775
|
data[i + 1] += brightness;
|
|
10789
10776
|
data[i + 2] += brightness;
|
|
@@ -10802,15 +10789,14 @@
|
|
|
10802
10789
|
if (hasRequiredContrast) return Contrast;
|
|
10803
10790
|
hasRequiredContrast = 1;
|
|
10804
10791
|
Object.defineProperty(Contrast, "__esModule", { value: true });
|
|
10805
|
-
Contrast.Contrast =
|
|
10792
|
+
Contrast.Contrast = void 0;
|
|
10806
10793
|
const Factory_1 = requireFactory();
|
|
10807
10794
|
const Node_1 = requireNode();
|
|
10808
10795
|
const Validators_1 = requireValidators();
|
|
10809
10796
|
const Contrast$1 = function (imageData) {
|
|
10810
10797
|
const adjust = Math.pow((this.contrast() + 100) / 100, 2);
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
for (let i = 0; i < nPixels; i += 4) {
|
|
10798
|
+
let data = imageData.data, nPixels = data.length, red = 150, green = 150, blue = 150, i;
|
|
10799
|
+
for (i = 0; i < nPixels; i += 4) {
|
|
10814
10800
|
red = data[i];
|
|
10815
10801
|
green = data[i + 1];
|
|
10816
10802
|
blue = data[i + 2];
|
|
@@ -10850,14 +10836,13 @@
|
|
|
10850
10836
|
if (hasRequiredEmboss) return Emboss;
|
|
10851
10837
|
hasRequiredEmboss = 1;
|
|
10852
10838
|
Object.defineProperty(Emboss, "__esModule", { value: true });
|
|
10853
|
-
Emboss.Emboss =
|
|
10839
|
+
Emboss.Emboss = void 0;
|
|
10854
10840
|
const Factory_1 = requireFactory();
|
|
10855
10841
|
const Node_1 = requireNode();
|
|
10856
10842
|
const Util_1 = requireUtil();
|
|
10857
10843
|
const Validators_1 = requireValidators();
|
|
10858
10844
|
const Emboss$1 = function (imageData) {
|
|
10859
|
-
|
|
10860
|
-
let dirY = 0, dirX = 0, y = h;
|
|
10845
|
+
let strength = this.embossStrength() * 10, greyLevel = this.embossWhiteLevel() * 255, direction = this.embossDirection(), blend = this.embossBlend(), dirY = 0, dirX = 0, data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h;
|
|
10861
10846
|
switch (direction) {
|
|
10862
10847
|
case 'top-left':
|
|
10863
10848
|
dirY = -1;
|
|
@@ -10953,8 +10938,8 @@
|
|
|
10953
10938
|
Emboss.Emboss = Emboss$1;
|
|
10954
10939
|
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossStrength', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
10955
10940
|
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossWhiteLevel', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
10956
|
-
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossDirection', 'top-left',
|
|
10957
|
-
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossBlend', false,
|
|
10941
|
+
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossDirection', 'top-left', null, Factory_1.Factory.afterSetFilter);
|
|
10942
|
+
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossBlend', false, null, Factory_1.Factory.afterSetFilter);
|
|
10958
10943
|
return Emboss;
|
|
10959
10944
|
}
|
|
10960
10945
|
|
|
@@ -10966,30 +10951,29 @@
|
|
|
10966
10951
|
if (hasRequiredEnhance) return Enhance;
|
|
10967
10952
|
hasRequiredEnhance = 1;
|
|
10968
10953
|
Object.defineProperty(Enhance, "__esModule", { value: true });
|
|
10969
|
-
Enhance.Enhance =
|
|
10954
|
+
Enhance.Enhance = void 0;
|
|
10970
10955
|
const Factory_1 = requireFactory();
|
|
10971
10956
|
const Node_1 = requireNode();
|
|
10972
10957
|
const Validators_1 = requireValidators();
|
|
10973
10958
|
function remap(fromValue, fromMin, fromMax, toMin, toMax) {
|
|
10974
|
-
|
|
10959
|
+
let fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;
|
|
10975
10960
|
if (fromRange === 0) {
|
|
10976
10961
|
return toMin + toRange / 2;
|
|
10977
10962
|
}
|
|
10978
10963
|
if (toRange === 0) {
|
|
10979
10964
|
return toMin;
|
|
10980
10965
|
}
|
|
10981
|
-
|
|
10966
|
+
toValue = (fromValue - fromMin) / fromRange;
|
|
10982
10967
|
toValue = toRange * toValue + toMin;
|
|
10983
10968
|
return toValue;
|
|
10984
10969
|
}
|
|
10985
10970
|
const Enhance$1 = function (imageData) {
|
|
10986
|
-
|
|
10987
|
-
let rMin = data[0], rMax = rMin, r, gMin = data[1], gMax = gMin, g, bMin = data[2], bMax = bMin, b;
|
|
10971
|
+
let data = imageData.data, nSubPixels = data.length, rMin = data[0], rMax = rMin, r, gMin = data[1], gMax = gMin, g, bMin = data[2], bMax = bMin, b, i;
|
|
10988
10972
|
const enhanceAmount = this.enhance();
|
|
10989
10973
|
if (enhanceAmount === 0) {
|
|
10990
10974
|
return;
|
|
10991
10975
|
}
|
|
10992
|
-
for (
|
|
10976
|
+
for (i = 0; i < nSubPixels; i += 4) {
|
|
10993
10977
|
r = data[i + 0];
|
|
10994
10978
|
if (r < rMin) {
|
|
10995
10979
|
rMin = r;
|
|
@@ -11044,7 +11028,7 @@
|
|
|
11044
11028
|
bGoalMax = bMax + enhanceAmount * (bMax - bMid);
|
|
11045
11029
|
bGoalMin = bMin + enhanceAmount * (bMin - bMid);
|
|
11046
11030
|
}
|
|
11047
|
-
for (
|
|
11031
|
+
for (i = 0; i < nSubPixels; i += 4) {
|
|
11048
11032
|
data[i + 0] = remap(data[i + 0], rMin, rMax, rGoalMin, rGoalMax);
|
|
11049
11033
|
data[i + 1] = remap(data[i + 1], gMin, gMax, gGoalMin, gGoalMax);
|
|
11050
11034
|
data[i + 2] = remap(data[i + 2], bMin, bMax, bGoalMin, bGoalMax);
|
|
@@ -11063,11 +11047,11 @@
|
|
|
11063
11047
|
if (hasRequiredGrayscale) return Grayscale;
|
|
11064
11048
|
hasRequiredGrayscale = 1;
|
|
11065
11049
|
Object.defineProperty(Grayscale, "__esModule", { value: true });
|
|
11066
|
-
Grayscale.Grayscale =
|
|
11050
|
+
Grayscale.Grayscale = void 0;
|
|
11067
11051
|
const Grayscale$1 = function (imageData) {
|
|
11068
|
-
|
|
11069
|
-
for (
|
|
11070
|
-
|
|
11052
|
+
let data = imageData.data, len = data.length, i, brightness;
|
|
11053
|
+
for (i = 0; i < len; i += 4) {
|
|
11054
|
+
brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];
|
|
11071
11055
|
data[i] = brightness;
|
|
11072
11056
|
data[i + 1] = brightness;
|
|
11073
11057
|
data[i + 2] = brightness;
|
|
@@ -11085,7 +11069,7 @@
|
|
|
11085
11069
|
if (hasRequiredHSL) return HSL;
|
|
11086
11070
|
hasRequiredHSL = 1;
|
|
11087
11071
|
Object.defineProperty(HSL, "__esModule", { value: true });
|
|
11088
|
-
HSL.HSL =
|
|
11072
|
+
HSL.HSL = void 0;
|
|
11089
11073
|
const Factory_1 = requireFactory();
|
|
11090
11074
|
const Node_1 = requireNode();
|
|
11091
11075
|
const Validators_1 = requireValidators();
|
|
@@ -11093,13 +11077,13 @@
|
|
|
11093
11077
|
Factory_1.Factory.addGetterSetter(Node_1.Node, 'saturation', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
11094
11078
|
Factory_1.Factory.addGetterSetter(Node_1.Node, 'luminance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
11095
11079
|
const HSL$1 = function (imageData) {
|
|
11096
|
-
|
|
11080
|
+
let data = imageData.data, nPixels = data.length, v = 1, s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, l = this.luminance() * 127, i;
|
|
11097
11081
|
const vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);
|
|
11098
11082
|
const rr = 0.299 * v + 0.701 * vsu + 0.167 * vsw, rg = 0.587 * v - 0.587 * vsu + 0.33 * vsw, rb = 0.114 * v - 0.114 * vsu - 0.497 * vsw;
|
|
11099
11083
|
const gr = 0.299 * v - 0.299 * vsu - 0.328 * vsw, gg = 0.587 * v + 0.413 * vsu + 0.035 * vsw, gb = 0.114 * v - 0.114 * vsu + 0.293 * vsw;
|
|
11100
11084
|
const br = 0.299 * v - 0.3 * vsu + 1.25 * vsw, bg = 0.587 * v - 0.586 * vsu - 1.05 * vsw, bb = 0.114 * v + 0.886 * vsu - 0.2 * vsw;
|
|
11101
11085
|
let r, g, b, a;
|
|
11102
|
-
for (
|
|
11086
|
+
for (i = 0; i < nPixels; i += 4) {
|
|
11103
11087
|
r = data[i + 0];
|
|
11104
11088
|
g = data[i + 1];
|
|
11105
11089
|
b = data[i + 2];
|
|
@@ -11122,7 +11106,7 @@
|
|
|
11122
11106
|
if (hasRequiredHSV) return HSV;
|
|
11123
11107
|
hasRequiredHSV = 1;
|
|
11124
11108
|
Object.defineProperty(HSV, "__esModule", { value: true });
|
|
11125
|
-
HSV.HSV =
|
|
11109
|
+
HSV.HSV = void 0;
|
|
11126
11110
|
const Factory_1 = requireFactory();
|
|
11127
11111
|
const Node_1 = requireNode();
|
|
11128
11112
|
const Validators_1 = requireValidators();
|
|
@@ -11159,10 +11143,10 @@
|
|
|
11159
11143
|
if (hasRequiredInvert) return Invert;
|
|
11160
11144
|
hasRequiredInvert = 1;
|
|
11161
11145
|
Object.defineProperty(Invert, "__esModule", { value: true });
|
|
11162
|
-
Invert.Invert =
|
|
11146
|
+
Invert.Invert = void 0;
|
|
11163
11147
|
const Invert$1 = function (imageData) {
|
|
11164
|
-
|
|
11165
|
-
for (
|
|
11148
|
+
let data = imageData.data, len = data.length, i;
|
|
11149
|
+
for (i = 0; i < len; i += 4) {
|
|
11166
11150
|
data[i] = 255 - data[i];
|
|
11167
11151
|
data[i + 1] = 255 - data[i + 1];
|
|
11168
11152
|
data[i + 2] = 255 - data[i + 2];
|
|
@@ -11180,31 +11164,31 @@
|
|
|
11180
11164
|
if (hasRequiredKaleidoscope) return Kaleidoscope;
|
|
11181
11165
|
hasRequiredKaleidoscope = 1;
|
|
11182
11166
|
Object.defineProperty(Kaleidoscope, "__esModule", { value: true });
|
|
11183
|
-
Kaleidoscope.Kaleidoscope =
|
|
11167
|
+
Kaleidoscope.Kaleidoscope = void 0;
|
|
11184
11168
|
const Factory_1 = requireFactory();
|
|
11185
11169
|
const Node_1 = requireNode();
|
|
11186
11170
|
const Util_1 = requireUtil();
|
|
11187
11171
|
const Validators_1 = requireValidators();
|
|
11188
11172
|
const ToPolar = function (src, dst, opt) {
|
|
11189
|
-
|
|
11190
|
-
let rMax = Math.sqrt(xMid * xMid + yMid * yMid);
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11173
|
+
let srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x, y, r = 0, g = 0, b = 0, a = 0;
|
|
11174
|
+
let rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);
|
|
11175
|
+
x = xSize - xMid;
|
|
11176
|
+
y = ySize - yMid;
|
|
11177
|
+
rad = Math.sqrt(x * x + y * y);
|
|
11194
11178
|
rMax = rad > rMax ? rad : rMax;
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
for (
|
|
11198
|
-
|
|
11199
|
-
|
|
11200
|
-
for (
|
|
11179
|
+
let rSize = ySize, tSize = xSize, radius, theta;
|
|
11180
|
+
let conversion = ((360 / tSize) * Math.PI) / 180, sin, cos;
|
|
11181
|
+
for (theta = 0; theta < tSize; theta += 1) {
|
|
11182
|
+
sin = Math.sin(theta * conversion);
|
|
11183
|
+
cos = Math.cos(theta * conversion);
|
|
11184
|
+
for (radius = 0; radius < rSize; radius += 1) {
|
|
11201
11185
|
x = Math.floor(xMid + ((rMax * radius) / rSize) * cos);
|
|
11202
11186
|
y = Math.floor(yMid + ((rMax * radius) / rSize) * sin);
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11187
|
+
i = (y * xSize + x) * 4;
|
|
11188
|
+
r = srcPixels[i + 0];
|
|
11189
|
+
g = srcPixels[i + 1];
|
|
11190
|
+
b = srcPixels[i + 2];
|
|
11191
|
+
a = srcPixels[i + 3];
|
|
11208
11192
|
i = (theta + radius * xSize) * 4;
|
|
11209
11193
|
dstPixels[i + 0] = r;
|
|
11210
11194
|
dstPixels[i + 1] = g;
|
|
@@ -11214,28 +11198,28 @@
|
|
|
11214
11198
|
}
|
|
11215
11199
|
};
|
|
11216
11200
|
const FromPolar = function (src, dst, opt) {
|
|
11217
|
-
|
|
11218
|
-
let rMax = Math.sqrt(xMid * xMid + yMid * yMid);
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11201
|
+
let srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x, y, dx, dy, r = 0, g = 0, b = 0, a = 0;
|
|
11202
|
+
let rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);
|
|
11203
|
+
x = xSize - xMid;
|
|
11204
|
+
y = ySize - yMid;
|
|
11205
|
+
rad = Math.sqrt(x * x + y * y);
|
|
11222
11206
|
rMax = rad > rMax ? rad : rMax;
|
|
11223
|
-
|
|
11207
|
+
let rSize = ySize, tSize = xSize, radius, theta, phaseShift = 0;
|
|
11224
11208
|
let x1, y1;
|
|
11225
11209
|
for (x = 0; x < xSize; x += 1) {
|
|
11226
11210
|
for (y = 0; y < ySize; y += 1) {
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11211
|
+
dx = x - xMid;
|
|
11212
|
+
dy = y - yMid;
|
|
11213
|
+
radius = (Math.sqrt(dx * dx + dy * dy) * rSize) / rMax;
|
|
11214
|
+
theta = ((Math.atan2(dy, dx) * 180) / Math.PI + 360 + phaseShift) % 360;
|
|
11231
11215
|
theta = (theta * tSize) / 360;
|
|
11232
11216
|
x1 = Math.floor(theta);
|
|
11233
11217
|
y1 = Math.floor(radius);
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11218
|
+
i = (y1 * xSize + x1) * 4;
|
|
11219
|
+
r = srcPixels[i + 0];
|
|
11220
|
+
g = srcPixels[i + 1];
|
|
11221
|
+
b = srcPixels[i + 2];
|
|
11222
|
+
a = srcPixels[i + 3];
|
|
11239
11223
|
i = (y * xSize + x) * 4;
|
|
11240
11224
|
dstPixels[i + 0] = r;
|
|
11241
11225
|
dstPixels[i + 1] = g;
|
|
@@ -11310,7 +11294,7 @@
|
|
|
11310
11294
|
sectionSize *= 2;
|
|
11311
11295
|
}
|
|
11312
11296
|
}
|
|
11313
|
-
FromPolar(scratchData, imageData, { });
|
|
11297
|
+
FromPolar(scratchData, imageData, { polarRotation: 0 });
|
|
11314
11298
|
};
|
|
11315
11299
|
Kaleidoscope.Kaleidoscope = Kaleidoscope$1;
|
|
11316
11300
|
Factory_1.Factory.addGetterSetter(Node_1.Node, 'kaleidoscopePower', 2, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
@@ -11326,7 +11310,7 @@
|
|
|
11326
11310
|
if (hasRequiredMask) return Mask;
|
|
11327
11311
|
hasRequiredMask = 1;
|
|
11328
11312
|
Object.defineProperty(Mask, "__esModule", { value: true });
|
|
11329
|
-
Mask.Mask =
|
|
11313
|
+
Mask.Mask = void 0;
|
|
11330
11314
|
const Factory_1 = requireFactory();
|
|
11331
11315
|
const Node_1 = requireNode();
|
|
11332
11316
|
const Validators_1 = requireValidators();
|
|
@@ -11457,8 +11441,7 @@
|
|
|
11457
11441
|
return maskResult;
|
|
11458
11442
|
}
|
|
11459
11443
|
const Mask$1 = function (imageData) {
|
|
11460
|
-
|
|
11461
|
-
let mask = backgroundMask(imageData, threshold);
|
|
11444
|
+
let threshold = this.threshold(), mask = backgroundMask(imageData, threshold);
|
|
11462
11445
|
if (mask) {
|
|
11463
11446
|
mask = erodeMask(mask, imageData.width, imageData.height);
|
|
11464
11447
|
mask = dilateMask(mask, imageData.width, imageData.height);
|
|
@@ -11480,7 +11463,7 @@
|
|
|
11480
11463
|
if (hasRequiredNoise) return Noise;
|
|
11481
11464
|
hasRequiredNoise = 1;
|
|
11482
11465
|
Object.defineProperty(Noise, "__esModule", { value: true });
|
|
11483
|
-
Noise.Noise =
|
|
11466
|
+
Noise.Noise = void 0;
|
|
11484
11467
|
const Factory_1 = requireFactory();
|
|
11485
11468
|
const Node_1 = requireNode();
|
|
11486
11469
|
const Validators_1 = requireValidators();
|
|
@@ -11505,7 +11488,7 @@
|
|
|
11505
11488
|
if (hasRequiredPixelate) return Pixelate;
|
|
11506
11489
|
hasRequiredPixelate = 1;
|
|
11507
11490
|
Object.defineProperty(Pixelate, "__esModule", { value: true });
|
|
11508
|
-
Pixelate.Pixelate =
|
|
11491
|
+
Pixelate.Pixelate = void 0;
|
|
11509
11492
|
const Factory_1 = requireFactory();
|
|
11510
11493
|
const Util_1 = requireUtil();
|
|
11511
11494
|
const Node_1 = requireNode();
|
|
@@ -11578,13 +11561,13 @@
|
|
|
11578
11561
|
if (hasRequiredPosterize) return Posterize;
|
|
11579
11562
|
hasRequiredPosterize = 1;
|
|
11580
11563
|
Object.defineProperty(Posterize, "__esModule", { value: true });
|
|
11581
|
-
Posterize.Posterize =
|
|
11564
|
+
Posterize.Posterize = void 0;
|
|
11582
11565
|
const Factory_1 = requireFactory();
|
|
11583
11566
|
const Node_1 = requireNode();
|
|
11584
11567
|
const Validators_1 = requireValidators();
|
|
11585
11568
|
const Posterize$1 = function (imageData) {
|
|
11586
|
-
|
|
11587
|
-
for (
|
|
11569
|
+
let levels = Math.round(this.levels() * 254) + 1, data = imageData.data, len = data.length, scale = 255 / levels, i;
|
|
11570
|
+
for (i = 0; i < len; i += 1) {
|
|
11588
11571
|
data[i] = Math.floor(data[i] / scale) * scale;
|
|
11589
11572
|
}
|
|
11590
11573
|
};
|
|
@@ -11601,14 +11584,15 @@
|
|
|
11601
11584
|
if (hasRequiredRGB) return RGB;
|
|
11602
11585
|
hasRequiredRGB = 1;
|
|
11603
11586
|
Object.defineProperty(RGB, "__esModule", { value: true });
|
|
11604
|
-
RGB.RGB =
|
|
11587
|
+
RGB.RGB = void 0;
|
|
11605
11588
|
const Factory_1 = requireFactory();
|
|
11606
11589
|
const Node_1 = requireNode();
|
|
11607
11590
|
const Validators_1 = requireValidators();
|
|
11608
11591
|
const RGB$1 = function (imageData) {
|
|
11609
|
-
|
|
11610
|
-
for (
|
|
11611
|
-
|
|
11592
|
+
let data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), i, brightness;
|
|
11593
|
+
for (i = 0; i < nPixels; i += 4) {
|
|
11594
|
+
brightness =
|
|
11595
|
+
(0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]) / 255;
|
|
11612
11596
|
data[i] = brightness * red;
|
|
11613
11597
|
data[i + 1] = brightness * green;
|
|
11614
11598
|
data[i + 2] = brightness * blue;
|
|
@@ -11652,7 +11636,7 @@
|
|
|
11652
11636
|
if (hasRequiredRGBA) return RGBA;
|
|
11653
11637
|
hasRequiredRGBA = 1;
|
|
11654
11638
|
Object.defineProperty(RGBA, "__esModule", { value: true });
|
|
11655
|
-
RGBA.RGBA =
|
|
11639
|
+
RGBA.RGBA = void 0;
|
|
11656
11640
|
const Factory_1 = requireFactory();
|
|
11657
11641
|
const Node_1 = requireNode();
|
|
11658
11642
|
const Validators_1 = requireValidators();
|
|
@@ -11714,13 +11698,13 @@
|
|
|
11714
11698
|
if (hasRequiredSepia) return Sepia;
|
|
11715
11699
|
hasRequiredSepia = 1;
|
|
11716
11700
|
Object.defineProperty(Sepia, "__esModule", { value: true });
|
|
11717
|
-
Sepia.Sepia =
|
|
11701
|
+
Sepia.Sepia = void 0;
|
|
11718
11702
|
const Sepia$1 = function (imageData) {
|
|
11719
|
-
|
|
11720
|
-
for (
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11703
|
+
let data = imageData.data, nPixels = data.length, i, r, g, b;
|
|
11704
|
+
for (i = 0; i < nPixels; i += 4) {
|
|
11705
|
+
r = data[i + 0];
|
|
11706
|
+
g = data[i + 1];
|
|
11707
|
+
b = data[i + 2];
|
|
11724
11708
|
data[i + 0] = Math.min(255, r * 0.393 + g * 0.769 + b * 0.189);
|
|
11725
11709
|
data[i + 1] = Math.min(255, r * 0.349 + g * 0.686 + b * 0.168);
|
|
11726
11710
|
data[i + 2] = Math.min(255, r * 0.272 + g * 0.534 + b * 0.131);
|
|
@@ -11738,7 +11722,7 @@
|
|
|
11738
11722
|
if (hasRequiredSolarize) return Solarize;
|
|
11739
11723
|
hasRequiredSolarize = 1;
|
|
11740
11724
|
Object.defineProperty(Solarize, "__esModule", { value: true });
|
|
11741
|
-
Solarize.Solarize =
|
|
11725
|
+
Solarize.Solarize = void 0;
|
|
11742
11726
|
const Solarize$1 = function (imageData) {
|
|
11743
11727
|
const data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4;
|
|
11744
11728
|
let y = h;
|
|
@@ -11777,7 +11761,7 @@
|
|
|
11777
11761
|
if (hasRequiredThreshold) return Threshold;
|
|
11778
11762
|
hasRequiredThreshold = 1;
|
|
11779
11763
|
Object.defineProperty(Threshold, "__esModule", { value: true });
|
|
11780
|
-
Threshold.Threshold =
|
|
11764
|
+
Threshold.Threshold = void 0;
|
|
11781
11765
|
const Factory_1 = requireFactory();
|
|
11782
11766
|
const Node_1 = requireNode();
|
|
11783
11767
|
const Validators_1 = requireValidators();
|
|
@@ -11798,7 +11782,7 @@
|
|
|
11798
11782
|
if (hasRequired_FullInternals) return _FullInternals;
|
|
11799
11783
|
hasRequired_FullInternals = 1;
|
|
11800
11784
|
Object.defineProperty(_FullInternals, "__esModule", { value: true });
|
|
11801
|
-
_FullInternals.Konva =
|
|
11785
|
+
_FullInternals.Konva = void 0;
|
|
11802
11786
|
const _CoreInternals_1 = require_CoreInternals();
|
|
11803
11787
|
const Arc_1 = requireArc();
|
|
11804
11788
|
const Arrow_1 = requireArrow();
|
|
@@ -11967,8 +11951,8 @@
|
|
|
11967
11951
|
this.setColor(r, g, b);
|
|
11968
11952
|
}
|
|
11969
11953
|
/**
|
|
11970
|
-
* Returns the color as a string in hexadecimal color syntax `#RGB` using its primary color
|
|
11971
|
-
* (red, green, blue) written as hexadecimal numbers.
|
|
11954
|
+
* Returns the color as a string in hexadecimal color syntax `#RGB` using its primary color
|
|
11955
|
+
* components (red, green, blue) written as hexadecimal numbers.
|
|
11972
11956
|
*/
|
|
11973
11957
|
asHex() {
|
|
11974
11958
|
return "#" + this.HEX;
|
|
@@ -12023,8 +12007,8 @@
|
|
|
12023
12007
|
const konvaPoints = [];
|
|
12024
12008
|
params.points.forEach((point) => konvaPoints.push(point.x, point.y));
|
|
12025
12009
|
this._ref = new Konva.Line({
|
|
12026
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
12027
|
-
strokeWidth: (_b = params.width) !== null && _b !==
|
|
12010
|
+
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
12011
|
+
strokeWidth: (_b = params.width) !== null && _b !== void 0 ? _b : 4,
|
|
12028
12012
|
globalCompositeOperation: "source-over",
|
|
12029
12013
|
lineCap: "round",
|
|
12030
12014
|
lineJoin: "round",
|
|
@@ -12131,12 +12115,12 @@
|
|
|
12131
12115
|
x: params.position.x,
|
|
12132
12116
|
y: params.position.y,
|
|
12133
12117
|
text: params.text,
|
|
12134
|
-
fontSize: (_a = params.fontSize) !== null && _a !==
|
|
12118
|
+
fontSize: (_a = params.fontSize) !== null && _a !== void 0 ? _a : 34,
|
|
12135
12119
|
fontFamily: this.TEXT_FONT_FAMILY,
|
|
12136
|
-
fill: (_b = params.color) !== null && _b !==
|
|
12120
|
+
fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
|
|
12137
12121
|
align: "left",
|
|
12138
12122
|
draggable: true,
|
|
12139
|
-
rotation: (_c = params.rotation) !== null && _c !==
|
|
12123
|
+
rotation: (_c = params.rotation) !== null && _c !== void 0 ? _c : 0,
|
|
12140
12124
|
});
|
|
12141
12125
|
this._ref.width(this._ref.getTextWidth());
|
|
12142
12126
|
this._ref.on("transform", (e) => {
|
|
@@ -12232,15 +12216,15 @@
|
|
|
12232
12216
|
if (!params.position)
|
|
12233
12217
|
params.position = { x: 100, y: 100 };
|
|
12234
12218
|
this._ref = new Konva.Rect({
|
|
12235
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
12236
|
-
strokeWidth: (_b = params.lineWidth) !== null && _b !==
|
|
12219
|
+
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
12220
|
+
strokeWidth: (_b = params.lineWidth) !== null && _b !== void 0 ? _b : 4,
|
|
12237
12221
|
globalCompositeOperation: "source-over",
|
|
12238
12222
|
lineCap: "round",
|
|
12239
12223
|
lineJoin: "round",
|
|
12240
12224
|
x: params.position.x,
|
|
12241
12225
|
y: params.position.y,
|
|
12242
|
-
width: (_c = params.width) !== null && _c !==
|
|
12243
|
-
height: (_d = params.height) !== null && _d !==
|
|
12226
|
+
width: (_c = params.width) !== null && _c !== void 0 ? _c : 200,
|
|
12227
|
+
height: (_d = params.height) !== null && _d !== void 0 ? _d : 200,
|
|
12244
12228
|
draggable: true,
|
|
12245
12229
|
strokeScaleEnabled: false,
|
|
12246
12230
|
});
|
|
@@ -12346,8 +12330,8 @@
|
|
|
12346
12330
|
if (!params.radius)
|
|
12347
12331
|
params.radius = { x: 25, y: 25 };
|
|
12348
12332
|
this._ref = new Konva.Ellipse({
|
|
12349
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
12350
|
-
strokeWidth: (_b = params.lineWidth) !== null && _b !==
|
|
12333
|
+
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
12334
|
+
strokeWidth: (_b = params.lineWidth) !== null && _b !== void 0 ? _b : 4,
|
|
12351
12335
|
globalCompositeOperation: "source-over",
|
|
12352
12336
|
lineCap: "round",
|
|
12353
12337
|
lineJoin: "round",
|
|
@@ -12487,8 +12471,8 @@
|
|
|
12487
12471
|
if (!params.end)
|
|
12488
12472
|
params.end = { x: 100, y: 100 };
|
|
12489
12473
|
this._ref = new Konva.Arrow({
|
|
12490
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
12491
|
-
fill: (_b = params.color) !== null && _b !==
|
|
12474
|
+
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
12475
|
+
fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
|
|
12492
12476
|
strokeWidth: 4,
|
|
12493
12477
|
globalCompositeOperation: "source-over",
|
|
12494
12478
|
lineCap: "round",
|
|
@@ -12634,8 +12618,8 @@
|
|
|
12634
12618
|
x: params.position.x,
|
|
12635
12619
|
y: params.position.y,
|
|
12636
12620
|
image: this._canvasImage,
|
|
12637
|
-
width: (_a = params.width) !== null && _a !==
|
|
12638
|
-
height: (_b = params.height) !== null && _b !==
|
|
12621
|
+
width: (_a = params.width) !== null && _a !== void 0 ? _a : 0,
|
|
12622
|
+
height: (_b = params.height) !== null && _b !== void 0 ? _b : 0,
|
|
12639
12623
|
draggable: true,
|
|
12640
12624
|
});
|
|
12641
12625
|
this._ref.on("transform", (e) => {
|
|
@@ -12743,10 +12727,10 @@
|
|
|
12743
12727
|
this._ref = new Konva.Shape({
|
|
12744
12728
|
x: params.position.x,
|
|
12745
12729
|
y: params.position.y,
|
|
12746
|
-
width: (_a = params.width) !== null && _a !==
|
|
12747
|
-
height: (_b = params.height) !== null && _b !==
|
|
12748
|
-
stroke: (_c = params.color) !== null && _c !==
|
|
12749
|
-
strokeWidth: (_d = params.lineWidth) !== null && _d !==
|
|
12730
|
+
width: (_a = params.width) !== null && _a !== void 0 ? _a : 200,
|
|
12731
|
+
height: (_b = params.height) !== null && _b !== void 0 ? _b : 200,
|
|
12732
|
+
stroke: (_c = params.color) !== null && _c !== void 0 ? _c : "#ff0000",
|
|
12733
|
+
strokeWidth: (_d = params.lineWidth) !== null && _d !== void 0 ? _d : 4,
|
|
12750
12734
|
draggable: true,
|
|
12751
12735
|
strokeScaleEnabled: false,
|
|
12752
12736
|
globalCompositeOperation: "source-over",
|
|
@@ -13020,9 +13004,9 @@
|
|
|
13020
13004
|
if (!Konva)
|
|
13021
13005
|
throw new Error('Markup error: Konva is not initialized. Forgot to add <script src="https://unpkg.com/konva@9/konva.min.js"></script> to your page?');
|
|
13022
13006
|
this._viewer = viewer;
|
|
13023
|
-
this._worldTransformer = worldTransformer !== null && worldTransformer !==
|
|
13007
|
+
this._worldTransformer = worldTransformer !== null && worldTransformer !== void 0 ? worldTransformer : new WorldTransform();
|
|
13024
13008
|
this._container = container;
|
|
13025
|
-
this._containerEvents = containerEvents !== null && containerEvents !==
|
|
13009
|
+
this._containerEvents = containerEvents !== null && containerEvents !== void 0 ? containerEvents : [];
|
|
13026
13010
|
this._markupContainer = document.createElement("div");
|
|
13027
13011
|
this._markupContainer.id = "markup-container";
|
|
13028
13012
|
this._markupContainer.style.position = "absolute";
|
|
@@ -13052,9 +13036,9 @@
|
|
|
13052
13036
|
// this._containerEvents.forEach((x) => this._markupContainer.removeEventListener(x, this.redirectToViewer));
|
|
13053
13037
|
}
|
|
13054
13038
|
this.destroyKonva();
|
|
13055
|
-
(_a = this._resizeObserver) === null || _a ===
|
|
13039
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
13056
13040
|
this._resizeObserver = undefined;
|
|
13057
|
-
(_b = this._markupContainer) === null || _b ===
|
|
13041
|
+
(_b = this._markupContainer) === null || _b === void 0 ? void 0 : _b.remove();
|
|
13058
13042
|
this._markupContainer = undefined;
|
|
13059
13043
|
this._container = undefined;
|
|
13060
13044
|
this._viewer = undefined;
|
|
@@ -13077,11 +13061,11 @@
|
|
|
13077
13061
|
}
|
|
13078
13062
|
colorizeAllMarkup(r, g, b) {
|
|
13079
13063
|
const hexColor = new MarkupColor(r, g, b).asHex();
|
|
13080
|
-
this.getObjects().filter((obj) => { var _a; return (_a = obj.setColor) === null || _a ===
|
|
13064
|
+
this.getObjects().filter((obj) => { var _a; return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor); });
|
|
13081
13065
|
}
|
|
13082
13066
|
colorizeSelectedMarkups(r, g, b) {
|
|
13083
13067
|
const hexColor = new MarkupColor(r, g, b).asHex();
|
|
13084
|
-
this.getSelectedObjects().filter((obj) => { var _a; return (_a = obj.setColor) === null || _a ===
|
|
13068
|
+
this.getSelectedObjects().filter((obj) => { var _a; return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor); });
|
|
13085
13069
|
}
|
|
13086
13070
|
setViewpoint(viewpoint) {
|
|
13087
13071
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -13090,9 +13074,9 @@
|
|
|
13090
13074
|
this.removeImageInput();
|
|
13091
13075
|
this._konvaStage.scale({ x: 1, y: 1 });
|
|
13092
13076
|
this._konvaStage.position({ x: 0, y: 0 });
|
|
13093
|
-
const markupColor = ((_a = viewpoint.custom_fields) === null || _a ===
|
|
13077
|
+
const markupColor = ((_a = viewpoint.custom_fields) === null || _a === void 0 ? void 0 : _a.markup_color) || { r: 255, g: 0, b: 0 };
|
|
13094
13078
|
this.setMarkupColor(markupColor.r, markupColor.g, markupColor.b);
|
|
13095
|
-
(_b = viewpoint.lines) === null || _b ===
|
|
13079
|
+
(_b = viewpoint.lines) === null || _b === void 0 ? void 0 : _b.forEach((line) => {
|
|
13096
13080
|
const linePoints = [];
|
|
13097
13081
|
line.points.forEach((point) => {
|
|
13098
13082
|
const screenPoint = this._worldTransformer.worldToScreen(point);
|
|
@@ -13101,28 +13085,28 @@
|
|
|
13101
13085
|
});
|
|
13102
13086
|
this.addLine(linePoints, line.color, line.type, line.width, line.id);
|
|
13103
13087
|
});
|
|
13104
|
-
(_c = viewpoint.texts) === null || _c ===
|
|
13088
|
+
(_c = viewpoint.texts) === null || _c === void 0 ? void 0 : _c.forEach((text) => {
|
|
13105
13089
|
const screenPoint = this._worldTransformer.worldToScreen(text.position);
|
|
13106
13090
|
this.addText(text.text, screenPoint, text.angle, text.color, text.text_size, text.font_size, text.id);
|
|
13107
13091
|
});
|
|
13108
|
-
(_d = viewpoint.rectangles) === null || _d ===
|
|
13092
|
+
(_d = viewpoint.rectangles) === null || _d === void 0 ? void 0 : _d.forEach((rect) => {
|
|
13109
13093
|
const screenPoint = this._worldTransformer.worldToScreen(rect.position);
|
|
13110
13094
|
this.addRectangle(screenPoint, rect.width, rect.height, rect.line_width, rect.color, rect.id);
|
|
13111
13095
|
});
|
|
13112
|
-
(_e = viewpoint.ellipses) === null || _e ===
|
|
13096
|
+
(_e = viewpoint.ellipses) === null || _e === void 0 ? void 0 : _e.forEach((ellipse) => {
|
|
13113
13097
|
const screenPoint = this._worldTransformer.worldToScreen(ellipse.position);
|
|
13114
13098
|
this.addEllipse(screenPoint, ellipse.radius, ellipse.line_width, ellipse.color, ellipse.id);
|
|
13115
13099
|
});
|
|
13116
|
-
(_f = viewpoint.arrows) === null || _f ===
|
|
13100
|
+
(_f = viewpoint.arrows) === null || _f === void 0 ? void 0 : _f.forEach((arrow) => {
|
|
13117
13101
|
const startPoint = this._worldTransformer.worldToScreen(arrow.start);
|
|
13118
13102
|
const endPoint = this._worldTransformer.worldToScreen(arrow.end);
|
|
13119
13103
|
this.addArrow(startPoint, endPoint, arrow.color, arrow.id);
|
|
13120
13104
|
});
|
|
13121
|
-
(_g = viewpoint.clouds) === null || _g ===
|
|
13105
|
+
(_g = viewpoint.clouds) === null || _g === void 0 ? void 0 : _g.forEach((cloud) => {
|
|
13122
13106
|
const screenPoint = this._worldTransformer.worldToScreen(cloud.position);
|
|
13123
13107
|
this.addCloud(screenPoint, cloud.width, cloud.height, cloud.line_width, cloud.color, cloud.id);
|
|
13124
13108
|
});
|
|
13125
|
-
(_h = viewpoint.images) === null || _h ===
|
|
13109
|
+
(_h = viewpoint.images) === null || _h === void 0 ? void 0 : _h.forEach((image) => {
|
|
13126
13110
|
const screenPoint = this._worldTransformer.worldToScreen(image.position);
|
|
13127
13111
|
this.addImage(screenPoint, image.src, image.width, image.height, image.id);
|
|
13128
13112
|
});
|
|
@@ -13439,7 +13423,7 @@
|
|
|
13439
13423
|
this.removeTextInput();
|
|
13440
13424
|
this.removeImageInput();
|
|
13441
13425
|
this.clearOverlay();
|
|
13442
|
-
(_a = this._konvaStage) === null || _a ===
|
|
13426
|
+
(_a = this._konvaStage) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
13443
13427
|
this._groupImages = undefined;
|
|
13444
13428
|
this._groupGeometry = undefined;
|
|
13445
13429
|
this._groupTexts = undefined;
|
|
@@ -13677,7 +13661,7 @@
|
|
|
13677
13661
|
}
|
|
13678
13662
|
removeTextInput() {
|
|
13679
13663
|
var _a;
|
|
13680
|
-
(_a = this._textInputRef) === null || _a ===
|
|
13664
|
+
(_a = this._textInputRef) === null || _a === void 0 ? void 0 : _a.remove();
|
|
13681
13665
|
this._textInputRef = null;
|
|
13682
13666
|
this._textInputPos = null;
|
|
13683
13667
|
this._textInputAngle = 0;
|
|
@@ -13720,7 +13704,7 @@
|
|
|
13720
13704
|
}
|
|
13721
13705
|
removeImageInput() {
|
|
13722
13706
|
var _a;
|
|
13723
|
-
(_a = this._imageInputRef) === null || _a ===
|
|
13707
|
+
(_a = this._imageInputRef) === null || _a === void 0 ? void 0 : _a.remove();
|
|
13724
13708
|
this._imageInputRef = null;
|
|
13725
13709
|
this._imageInputPos = null;
|
|
13726
13710
|
}
|
|
@@ -13729,7 +13713,7 @@
|
|
|
13729
13713
|
if (!text)
|
|
13730
13714
|
return;
|
|
13731
13715
|
// in case of edit - remove old Konva.Text object
|
|
13732
|
-
(_a = this.getSelectedObjects().at(0)) === null || _a ===
|
|
13716
|
+
(_a = this.getSelectedObjects().at(0)) === null || _a === void 0 ? void 0 : _a.delete();
|
|
13733
13717
|
this.clearSelected();
|
|
13734
13718
|
this.removeTextInput();
|
|
13735
13719
|
// in case we have old viewpoint without font_size
|
|
@@ -13808,7 +13792,7 @@
|
|
|
13808
13792
|
if (!position || !src)
|
|
13809
13793
|
return;
|
|
13810
13794
|
// in case of edit - remove old Image placeholder object
|
|
13811
|
-
(_a = this.getSelectedObjects().at(0)) === null || _a ===
|
|
13795
|
+
(_a = this.getSelectedObjects().at(0)) === null || _a === void 0 ? void 0 : _a.delete();
|
|
13812
13796
|
this.clearSelected();
|
|
13813
13797
|
this.removeImageInput();
|
|
13814
13798
|
const konvaImage = new KonvaImage({
|