Changeset 0c6b92a for imaps-frontend/node_modules/konva/lib
- Timestamp:
- 12/12/24 17:06:06 (5 weeks ago)
- Branches:
- main
- Parents:
- d565449
- Location:
- imaps-frontend/node_modules/konva/lib
- Files:
-
- 65 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/konva/lib/Animation.js
rd565449 r0c6b92a 117 117 } 118 118 } 119 for ( let key in layerHash) {119 for (const key in layerHash) { 120 120 if (!layerHash.hasOwnProperty(key)) { 121 121 continue; -
imaps-frontend/node_modules/konva/lib/BezierFunctions.js
rd565449 r0c6b92a 688 688 exports.binomialCoefficients = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]]; 689 689 const getCubicArcLength = (xs, ys, t) => { 690 let z;691 690 let sum; 692 691 let correctedT; 693 692 const n = 20; 694 z = t / 2;693 const z = t / 2; 695 694 sum = 0; 696 695 for (let i = 0; i < n; i++) { -
imaps-frontend/node_modules/konva/lib/Canvas.js
rd565449 r0c6b92a 7 7 const Factory_1 = require("./Factory"); 8 8 const Validators_1 = require("./Validators"); 9 var_pixelRatio;9 let _pixelRatio; 10 10 function getDevicePixelRatio() { 11 11 if (_pixelRatio) { 12 12 return _pixelRatio; 13 13 } 14 varcanvas = Util_1.Util.createCanvasElement();15 varcontext = canvas.getContext('2d');14 const canvas = Util_1.Util.createCanvasElement(); 15 const context = canvas.getContext('2d'); 16 16 _pixelRatio = (function () { 17 vardevicePixelRatio = Global_1.Konva._global.devicePixelRatio || 1, backingStoreRatio = context.webkitBackingStorePixelRatio ||17 const devicePixelRatio = Global_1.Konva._global.devicePixelRatio || 1, backingStoreRatio = context.webkitBackingStorePixelRatio || 18 18 context.mozBackingStorePixelRatio || 19 19 context.msBackingStorePixelRatio || … … 32 32 this.height = 0; 33 33 this.isCache = false; 34 varconf = config || {};35 varpixelRatio = conf.pixelRatio || Global_1.Konva.pixelRatio || getDevicePixelRatio();34 const conf = config || {}; 35 const pixelRatio = conf.pixelRatio || Global_1.Konva.pixelRatio || getDevicePixelRatio(); 36 36 this.pixelRatio = pixelRatio; 37 37 this._canvas = Util_1.Util.createCanvasElement(); … … 51 51 } 52 52 setPixelRatio(pixelRatio) { 53 varpreviousRatio = this.pixelRatio;53 const previousRatio = this.pixelRatio; 54 54 this.pixelRatio = pixelRatio; 55 55 this.setSize(this.getWidth() / previousRatio, this.getHeight() / previousRatio); … … 58 58 this.width = this._canvas.width = width * this.pixelRatio; 59 59 this._canvas.style.width = width + 'px'; 60 varpixelRatio = this.pixelRatio, _context = this.getContext()._context;60 const pixelRatio = this.pixelRatio, _context = this.getContext()._context; 61 61 _context.scale(pixelRatio, pixelRatio); 62 62 } … … 64 64 this.height = this._canvas.height = height * this.pixelRatio; 65 65 this._canvas.style.height = height + 'px'; 66 varpixelRatio = this.pixelRatio, _context = this.getContext()._context;66 const pixelRatio = this.pixelRatio, _context = this.getContext()._context; 67 67 _context.scale(pixelRatio, pixelRatio); 68 68 } -
imaps-frontend/node_modules/konva/lib/Container.d.ts
rd565449 r0c6b92a 29 29 attrs: any; 30 30 className: string; 31 children?: any[] | undefined;31 children?: Array<any>; 32 32 }; 33 33 isAncestorOf(node: Node): boolean; -
imaps-frontend/node_modules/konva/lib/Container.js
rd565449 r0c6b92a 15 15 } 16 16 const children = this.children || []; 17 varresults = [];17 const results = []; 18 18 children.forEach(function (child) { 19 19 if (filterFunc(child)) { … … 51 51 } 52 52 if (children.length > 1) { 53 for ( vari = 0; i < children.length; i++) {53 for (let i = 0; i < children.length; i++) { 54 54 this.add(children[i]); 55 55 } … … 83 83 } 84 84 findOne(selector) { 85 varresult = this._generalFind(selector, true);85 const result = this._generalFind(selector, true); 86 86 return result.length > 0 ? result[0] : undefined; 87 87 } 88 88 _generalFind(selector, findOne) { 89 varretArr = [];89 const retArr = []; 90 90 this._descendants((node) => { 91 91 const valid = node._isMatch(selector); … … 119 119 } 120 120 toObject() { 121 varobj = Node_1.Node.prototype.toObject.call(this);121 const obj = Node_1.Node.prototype.toObject.call(this); 122 122 obj.children = []; 123 123 this.getChildren().forEach((child) => { … … 127 127 } 128 128 isAncestorOf(node) { 129 varparent = node.getParent();129 let parent = node.getParent(); 130 130 while (parent) { 131 131 if (parent._id === this._id) { … … 137 137 } 138 138 clone(obj) { 139 varnode = Node_1.Node.prototype.clone.call(this, obj);139 const node = Node_1.Node.prototype.clone.call(this, obj); 140 140 this.getChildren().forEach(function (no) { 141 141 node.add(no.clone()); … … 144 144 } 145 145 getAllIntersections(pos) { 146 vararr = [];146 const arr = []; 147 147 this.find('Shape').forEach((shape) => { 148 148 if (shape.isVisible() && shape.intersects(pos)) { … … 170 170 } 171 171 drawScene(can, top, bufferCanvas) { 172 varlayer = this.getLayer(), canvas = can || (layer && layer.getCanvas()), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedSceneCanvas = cachedCanvas && cachedCanvas.scene;173 varcaching = canvas && canvas.isCache;172 const layer = this.getLayer(), canvas = can || (layer && layer.getCanvas()), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedSceneCanvas = cachedCanvas && cachedCanvas.scene; 173 const caching = canvas && canvas.isCache; 174 174 if (!this.isVisible() && !caching) { 175 175 return this; … … 177 177 if (cachedSceneCanvas) { 178 178 context.save(); 179 varm = this.getAbsoluteTransform(top).getMatrix();179 const m = this.getAbsoluteTransform(top).getMatrix(); 180 180 context.transform(m[0], m[1], m[2], m[3], m[4], m[5]); 181 181 this._drawCachedSceneCanvas(context); … … 191 191 return this; 192 192 } 193 varlayer = this.getLayer(), canvas = can || (layer && layer.hitCanvas), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;193 const layer = this.getLayer(), canvas = can || (layer && layer.hitCanvas), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit; 194 194 if (cachedHitCanvas) { 195 195 context.save(); 196 varm = this.getAbsoluteTransform(top).getMatrix();196 const m = this.getAbsoluteTransform(top).getMatrix(); 197 197 context.transform(m[0], m[1], m[2], m[3], m[4], m[5]); 198 198 this._drawCachedHitCanvas(context); … … 206 206 _drawChildren(drawMethod, canvas, top, bufferCanvas) { 207 207 var _a; 208 varcontext = canvas && canvas.getContext(), clipWidth = this.clipWidth(), clipHeight = this.clipHeight(), clipFunc = this.clipFunc(), hasClip = (typeof clipWidth === 'number' && typeof clipHeight === 'number') ||208 const context = canvas && canvas.getContext(), clipWidth = this.clipWidth(), clipHeight = this.clipHeight(), clipFunc = this.clipFunc(), hasClip = (typeof clipWidth === 'number' && typeof clipHeight === 'number') || 209 209 clipFunc; 210 210 const selfCache = top === this; 211 211 if (hasClip) { 212 212 context.save(); 213 vartransform = this.getAbsoluteTransform(top);214 varm = transform.getMatrix();213 const transform = this.getAbsoluteTransform(top); 214 let m = transform.getMatrix(); 215 215 context.transform(m[0], m[1], m[2], m[3], m[4], m[5]); 216 216 context.beginPath(); … … 220 220 } 221 221 else { 222 varclipX = this.clipX();223 varclipY = this.clipY();222 const clipX = this.clipX(); 223 const clipY = this.clipY(); 224 224 context.rect(clipX || 0, clipY || 0, clipWidth, clipHeight); 225 225 } … … 228 228 context.transform(m[0], m[1], m[2], m[3], m[4], m[5]); 229 229 } 230 varhasComposition = !selfCache &&230 const hasComposition = !selfCache && 231 231 this.globalCompositeOperation() !== 'source-over' && 232 232 drawMethod === 'drawScene'; … … 247 247 getClientRect(config = {}) { 248 248 var _a; 249 varskipTransform = config.skipTransform;250 varrelativeTo = config.relativeTo;251 varminX, minY, maxX, maxY;252 varselfRect = {249 const skipTransform = config.skipTransform; 250 const relativeTo = config.relativeTo; 251 let minX, minY, maxX, maxY; 252 let selfRect = { 253 253 x: Infinity, 254 254 y: Infinity, … … 256 256 height: 0, 257 257 }; 258 varthat = this;258 const that = this; 259 259 (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { 260 260 if (!child.visible()) { 261 261 return; 262 262 } 263 varrect = child.getClientRect({263 const rect = child.getClientRect({ 264 264 relativeTo: that, 265 265 skipShadow: config.skipShadow, … … 282 282 } 283 283 }); 284 varshapes = this.find('Shape');285 varhasVisible = false;286 for ( vari = 0; i < shapes.length; i++) {287 varshape = shapes[i];284 const shapes = this.find('Shape'); 285 let hasVisible = false; 286 for (let i = 0; i < shapes.length; i++) { 287 const shape = shapes[i]; 288 288 if (shape._isVisible(this)) { 289 289 hasVisible = true; -
imaps-frontend/node_modules/konva/lib/Context.d.ts
rd565449 r0c6b92a 3 3 import { IRect } from './types.js'; 4 4 import type { Node } from './Node.js'; 5 declare varCONTEXT_PROPERTIES: readonly ["fillStyle", "strokeStyle", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY", "letterSpacing", "lineCap", "lineDashOffset", "lineJoin", "lineWidth", "miterLimit", "direction", "font", "textAlign", "textBaseline", "globalAlpha", "globalCompositeOperation", "imageSmoothingEnabled"];5 declare const CONTEXT_PROPERTIES: readonly ["fillStyle", "strokeStyle", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY", "letterSpacing", "lineCap", "lineDashOffset", "lineJoin", "lineWidth", "miterLimit", "direction", "font", "textAlign", "textBaseline", "globalAlpha", "globalCompositeOperation", "imageSmoothingEnabled"]; 6 6 interface ExtendedCanvasRenderingContext2D extends CanvasRenderingContext2D { 7 7 letterSpacing: string; … … 10 10 canvas: Canvas; 11 11 _context: CanvasRenderingContext2D; 12 traceArr: Array< String>;12 traceArr: Array<string>; 13 13 constructor(canvas: Canvas); 14 14 fillShape(shape: Shape): void; -
imaps-frontend/node_modules/konva/lib/Context.js
rd565449 r0c6b92a 5 5 const Global_1 = require("./Global"); 6 6 function simplifyArray(arr) { 7 varretArr = [], len = arr.length, util = Util_1.Util, n, val;7 let retArr = [], len = arr.length, util = Util_1.Util, n, val; 8 8 for (n = 0; n < len; n++) { 9 9 val = arr[n]; … … 18 18 return retArr; 19 19 } 20 varCOMMA = ',', OPEN_PAREN = '(', CLOSE_PAREN = ')', OPEN_PAREN_BRACKET = '([', CLOSE_BRACKET_PAREN = '])', SEMICOLON = ';', DOUBLE_PAREN = '()', EQUALS = '=', CONTEXT_METHODS = [20 const COMMA = ',', OPEN_PAREN = '(', CLOSE_PAREN = ')', OPEN_PAREN_BRACKET = '([', CLOSE_BRACKET_PAREN = '])', SEMICOLON = ';', DOUBLE_PAREN = '()', EQUALS = '=', CONTEXT_METHODS = [ 21 21 'arc', 22 22 'arcTo', … … 52 52 'translate', 53 53 ]; 54 varCONTEXT_PROPERTIES = [54 const CONTEXT_PROPERTIES = [ 55 55 'fillStyle', 56 56 'strokeStyle', … … 107 107 } 108 108 getTrace(relaxed, rounded) { 109 vartraceArr = this.traceArr, len = traceArr.length, str = '', n, trace, method, args;109 let traceArr = this.traceArr, len = traceArr.length, str = '', n, trace, method, args; 110 110 for (n = 0; n < len; n++) { 111 111 trace = traceArr[n]; … … 143 143 } 144 144 _trace(str) { 145 vartraceArr = this.traceArr, len;145 let traceArr = this.traceArr, len; 146 146 traceArr.push(str); 147 147 len = traceArr.length; … … 151 151 } 152 152 reset() { 153 varpixelRatio = this.getCanvas().getPixelRatio();153 const pixelRatio = this.getCanvas().getPixelRatio(); 154 154 this.setTransform(1 * pixelRatio, 0, 0, 1 * pixelRatio, 0, 0); 155 155 } … … 158 158 } 159 159 clear(bounds) { 160 varcanvas = this.getCanvas();160 const canvas = this.getCanvas(); 161 161 if (bounds) { 162 162 this.clearRect(bounds.x || 0, bounds.y || 0, bounds.width || 0, bounds.height || 0); … … 173 173 } 174 174 _applyOpacity(shape) { 175 varabsOpacity = shape.getAbsoluteOpacity();175 const absOpacity = shape.getAbsoluteOpacity(); 176 176 if (absOpacity !== 1) { 177 177 this.setAttr('globalAlpha', absOpacity); … … 209 209 } 210 210 createImageData(width, height) { 211 vara = arguments;211 const a = arguments; 212 212 if (a.length === 2) { 213 213 return this._context.createImageData(width, height); … … 227 227 } 228 228 drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) { 229 vara = arguments, _context = this._context;229 const a = arguments, _context = this._context; 230 230 if (a.length === 3) { 231 231 _context.drawImage(image, sx, sy); … … 335 335 } 336 336 _enableTrace() { 337 varthat = this, len = CONTEXT_METHODS.length, origSetter = this.setAttr, n, args;338 varfunc = function (methodName) {339 varorigMethod = that[methodName], ret;337 let that = this, len = CONTEXT_METHODS.length, origSetter = this.setAttr, n, args; 338 const func = function (methodName) { 339 let origMethod = that[methodName], ret; 340 340 that[methodName] = function () { 341 341 args = simplifyArray(Array.prototype.slice.call(arguments, 0)); … … 353 353 that.setAttr = function () { 354 354 origSetter.apply(that, arguments); 355 varprop = arguments[0];356 varval = arguments[1];355 const prop = arguments[0]; 356 let val = arguments[1]; 357 357 if (prop === 'shadowOffsetX' || 358 358 prop === 'shadowOffsetY' || … … 368 368 _applyGlobalCompositeOperation(node) { 369 369 const op = node.attrs.globalCompositeOperation; 370 vardef = !op || op === 'source-over';370 const def = !op || op === 'source-over'; 371 371 if (!def) { 372 372 this.setAttr('globalCompositeOperation', op); … … 393 393 } 394 394 _fillColor(shape) { 395 varfill = shape.fill();395 const fill = shape.fill(); 396 396 this.setAttr('fillStyle', fill); 397 397 shape._fillFunc(this); … … 402 402 } 403 403 _fillLinearGradient(shape) { 404 vargrd = shape._getLinearGradient();404 const grd = shape._getLinearGradient(); 405 405 if (grd) { 406 406 this.setAttr('fillStyle', grd); … … 452 452 const start = shape.getStrokeLinearGradientStartPoint(), end = shape.getStrokeLinearGradientEndPoint(), colorStops = shape.getStrokeLinearGradientColorStops(), grd = this.createLinearGradient(start.x, start.y, end.x, end.y); 453 453 if (colorStops) { 454 for ( varn = 0; n < colorStops.length; n += 2) {454 for (let n = 0; n < colorStops.length; n += 2) { 455 455 grd.addColorStop(colorStops[n], colorStops[n + 1]); 456 456 } … … 459 459 } 460 460 _stroke(shape) { 461 vardash = shape.dash(), strokeScaleEnabled = shape.getStrokeScaleEnabled();461 const dash = shape.dash(), strokeScaleEnabled = shape.getStrokeScaleEnabled(); 462 462 if (shape.hasStroke()) { 463 463 if (!strokeScaleEnabled) { 464 464 this.save(); 465 varpixelRatio = this.getCanvas().getPixelRatio();465 const pixelRatio = this.getCanvas().getPixelRatio(); 466 466 this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0); 467 467 } … … 475 475 this.setAttr('shadowColor', 'rgba(0,0,0,0)'); 476 476 } 477 varhasLinearGradient = shape.getStrokeLinearGradientColorStops();477 const hasLinearGradient = shape.getStrokeLinearGradientColorStops(); 478 478 if (hasLinearGradient) { 479 479 this._strokeLinearGradient(shape); … … 490 490 _applyShadow(shape) { 491 491 var _a, _b, _c; 492 varcolor = (_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 : {492 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 : { 493 493 x: 0, 494 494 y: 0, … … 524 524 if (!strokeScaleEnabled) { 525 525 this.save(); 526 varpixelRatio = this.getCanvas().getPixelRatio();526 const pixelRatio = this.getCanvas().getPixelRatio(); 527 527 this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0); 528 528 } 529 529 this._applyLineCap(shape); 530 varhitStrokeWidth = shape.hitStrokeWidth();531 varstrokeWidth = hitStrokeWidth === 'auto' ? shape.strokeWidth() : hitStrokeWidth;530 const hitStrokeWidth = shape.hitStrokeWidth(); 531 const strokeWidth = hitStrokeWidth === 'auto' ? shape.strokeWidth() : hitStrokeWidth; 532 532 this.setAttr('lineWidth', strokeWidth); 533 533 this.setAttr('strokeStyle', shape.colorKey); -
imaps-frontend/node_modules/konva/lib/DragAndDrop.d.ts
rd565449 r0c6b92a 9 9 startPointerPos: Vector2d; 10 10 offset: Vector2d; 11 pointerId?: number | undefined;12 dragStatus: 'ready' | 'dragging' | 'stopped';11 pointerId?: number; 12 dragStatus: "ready" | "dragging" | "stopped"; 13 13 }>; 14 14 _drag(evt: any): void; -
imaps-frontend/node_modules/konva/lib/DragAndDrop.js
rd565449 r0c6b92a 6 6 exports.DD = { 7 7 get isDragging() { 8 varflag = false;8 let flag = false; 9 9 exports.DD._dragElements.forEach((elem) => { 10 10 if (elem.dragStatus === 'dragging') { … … 16 16 justDragged: false, 17 17 get node() { 18 varnode;18 let node; 19 19 exports.DD._dragElements.forEach((elem) => { 20 20 node = elem.node; … … 37 37 } 38 38 if (elem.dragStatus !== 'dragging') { 39 vardragDistance = node.dragDistance();40 vardistance = Math.max(Math.abs(pos.x - elem.startPointerPos.x), Math.abs(pos.y - elem.startPointerPos.y));39 const dragDistance = node.dragDistance(); 40 const distance = Math.max(Math.abs(pos.x - elem.startPointerPos.x), Math.abs(pos.y - elem.startPointerPos.y)); 41 41 if (distance < dragDistance) { 42 42 return; … … 105 105 window.addEventListener('mouseup', exports.DD._endDragBefore, true); 106 106 window.addEventListener('touchend', exports.DD._endDragBefore, true); 107 window.addEventListener('touchcancel', exports.DD._endDragBefore, true); 107 108 window.addEventListener('mousemove', exports.DD._drag); 108 109 window.addEventListener('touchmove', exports.DD._drag); 109 110 window.addEventListener('mouseup', exports.DD._endDragAfter, false); 110 111 window.addEventListener('touchend', exports.DD._endDragAfter, false); 112 window.addEventListener('touchcancel', exports.DD._endDragAfter, false); 111 113 } -
imaps-frontend/node_modules/konva/lib/Factory.js
rd565449 r0c6b92a 4 4 const Util_1 = require("./Util"); 5 5 const Validators_1 = require("./Validators"); 6 varGET = 'get', SET = 'set';6 const GET = 'get', SET = 'set'; 7 7 exports.Factory = { 8 8 addGetterSetter(constructor, attr, def, validator, after) { … … 12 12 }, 13 13 addGetter(constructor, attr, def) { 14 varmethod = GET + Util_1.Util._capitalize(attr);14 const method = GET + Util_1.Util._capitalize(attr); 15 15 constructor.prototype[method] = 16 16 constructor.prototype[method] || 17 17 function () { 18 varval = this.attrs[attr];18 const val = this.attrs[attr]; 19 19 return val === undefined ? def : val; 20 20 }; 21 21 }, 22 22 addSetter(constructor, attr, validator, after) { 23 varmethod = SET + Util_1.Util._capitalize(attr);23 const method = SET + Util_1.Util._capitalize(attr); 24 24 if (!constructor.prototype[method]) { 25 25 exports.Factory.overWriteSetter(constructor, attr, validator, after); … … 27 27 }, 28 28 overWriteSetter(constructor, attr, validator, after) { 29 varmethod = SET + Util_1.Util._capitalize(attr);29 const method = SET + Util_1.Util._capitalize(attr); 30 30 constructor.prototype[method] = function (val) { 31 31 if (validator && val !== undefined && val !== null) { … … 40 40 }, 41 41 addComponentsGetterSetter(constructor, attr, components, validator, after) { 42 varlen = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr), n, component;42 let len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr), n, component; 43 43 constructor.prototype[getter] = function () { 44 varret = {};44 const ret = {}; 45 45 for (n = 0; n < len; n++) { 46 46 component = components[n]; … … 49 49 return ret; 50 50 }; 51 varbasicValidator = (0, Validators_1.getComponentValidator)(components);51 const basicValidator = (0, Validators_1.getComponentValidator)(components); 52 52 constructor.prototype[setter] = function (val) { 53 varoldVal = this.attrs[attr], key;53 let oldVal = this.attrs[attr], key; 54 54 if (validator) { 55 55 val = validator.call(this, val); … … 78 78 }, 79 79 addOverloadedGetterSetter(constructor, attr) { 80 varcapitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;80 const capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr; 81 81 constructor.prototype[attr] = function () { 82 82 if (arguments.length) { … … 89 89 addDeprecatedGetterSetter(constructor, attr, def, validator) { 90 90 Util_1.Util.error('Adding deprecated ' + attr); 91 varmethod = GET + Util_1.Util._capitalize(attr);92 varmessage = attr +91 const method = GET + Util_1.Util._capitalize(attr); 92 const message = attr + 93 93 ' property is deprecated and will be removed soon. Look at Konva change log for more information.'; 94 94 constructor.prototype[method] = function () { 95 95 Util_1.Util.error(message); 96 varval = this.attrs[attr];96 const val = this.attrs[attr]; 97 97 return val === undefined ? def : val; 98 98 }; … … 104 104 backCompat(constructor, methods) { 105 105 Util_1.Util.each(methods, function (oldMethodName, newMethodName) { 106 varmethod = constructor.prototype[newMethodName];107 varoldGetter = GET + Util_1.Util._capitalize(oldMethodName);108 varoldSetter = SET + Util_1.Util._capitalize(oldMethodName);106 const method = constructor.prototype[newMethodName]; 107 const oldGetter = GET + Util_1.Util._capitalize(oldMethodName); 108 const oldSetter = SET + Util_1.Util._capitalize(oldMethodName); 109 109 function deprecated() { 110 110 method.apply(this, arguments); -
imaps-frontend/node_modules/konva/lib/Global.js
rd565449 r0c6b92a 17 17 exports.Konva = { 18 18 _global: exports.glob, 19 version: '9.3.1 4',19 version: '9.3.16', 20 20 isBrowser: detectBrowser(), 21 21 isUnminified: /param/.test(function (param) { }.toString()), -
imaps-frontend/node_modules/konva/lib/Group.js
rd565449 r0c6b92a 7 7 class Group extends Container_1.Container { 8 8 _validateAdd(child) { 9 vartype = child.getType();9 const type = child.getType(); 10 10 if (type !== 'Group' && type !== 'Shape') { 11 11 Util_1.Util.throw('You may only add groups and shapes to groups.'); -
imaps-frontend/node_modules/konva/lib/Layer.js
rd565449 r0c6b92a 10 10 const Shape_1 = require("./Shape"); 11 11 const Global_1 = require("./Global"); 12 varHASH = '#', BEFORE_DRAW = 'beforeDraw', DRAW = 'draw', INTERSECTION_OFFSETS = [12 const HASH = '#', BEFORE_DRAW = 'beforeDraw', DRAW = 'draw', INTERSECTION_OFFSETS = [ 13 13 { x: 0, y: 0 }, 14 14 { x: -1, y: -1 }, … … 53 53 setZIndex(index) { 54 54 super.setZIndex(index); 55 varstage = this.getStage();55 const stage = this.getStage(); 56 56 if (stage && stage.content) { 57 57 stage.content.removeChild(this.getNativeCanvasElement()); … … 67 67 moveToTop() { 68 68 Node_1.Node.prototype.moveToTop.call(this); 69 varstage = this.getStage();69 const stage = this.getStage(); 70 70 if (stage && stage.content) { 71 71 stage.content.removeChild(this.getNativeCanvasElement()); … … 75 75 } 76 76 moveUp() { 77 varmoved = Node_1.Node.prototype.moveUp.call(this);77 const moved = Node_1.Node.prototype.moveUp.call(this); 78 78 if (!moved) { 79 79 return false; 80 80 } 81 varstage = this.getStage();81 const stage = this.getStage(); 82 82 if (!stage || !stage.content) { 83 83 return false; … … 94 94 moveDown() { 95 95 if (Node_1.Node.prototype.moveDown.call(this)) { 96 varstage = this.getStage();96 const stage = this.getStage(); 97 97 if (stage) { 98 varchildren = stage.children;98 const children = stage.children; 99 99 if (stage.content) { 100 100 stage.content.removeChild(this.getNativeCanvasElement()); … … 108 108 moveToBottom() { 109 109 if (Node_1.Node.prototype.moveToBottom.call(this)) { 110 varstage = this.getStage();110 const stage = this.getStage(); 111 111 if (stage) { 112 varchildren = stage.children;112 const children = stage.children; 113 113 if (stage.content) { 114 114 stage.content.removeChild(this.getNativeCanvasElement()); … … 124 124 } 125 125 remove() { 126 var_canvas = this.getNativeCanvasElement();126 const _canvas = this.getNativeCanvasElement(); 127 127 Node_1.Node.prototype.remove.call(this); 128 128 if (_canvas && _canvas.parentNode && Util_1.Util._isInDocument(_canvas)) { … … 141 141 } 142 142 _validateAdd(child) { 143 vartype = child.getType();143 const type = child.getType(); 144 144 if (type !== 'Group' && type !== 'Shape') { 145 145 Util_1.Util.throw('You may only add groups and shapes to a layer.'); … … 197 197 return null; 198 198 } 199 varspiralSearchDistance = 1;200 varcontinueSearch = false;199 let spiralSearchDistance = 1; 200 let continueSearch = false; 201 201 while (true) { 202 202 for (let i = 0; i < INTERSECTION_OFFSETS_LEN; i++) { … … 247 247 } 248 248 drawScene(can, top) { 249 varlayer = this.getLayer(), canvas = can || (layer && layer.getCanvas());249 const layer = this.getLayer(), canvas = can || (layer && layer.getCanvas()); 250 250 this._fire(BEFORE_DRAW, { 251 251 node: this, … … 261 261 } 262 262 drawHit(can, top) { 263 varlayer = this.getLayer(), canvas = can || (layer && layer.hitCanvas);263 const layer = this.getLayer(), canvas = can || (layer && layer.hitCanvas); 264 264 if (layer && layer.clearBeforeDraw()) { 265 265 layer.getHitCanvas().getContext().clear(); … … 288 288 return; 289 289 } 290 varparent = this.parent;291 varadded = !!this.hitCanvas._canvas.parentNode;290 const parent = this.parent; 291 const added = !!this.hitCanvas._canvas.parentNode; 292 292 if (added) { 293 293 parent.content.removeChild(this.hitCanvas._canvas); -
imaps-frontend/node_modules/konva/lib/Node.d.ts
rd565449 r0c6b92a 40 40 [index: string]: any; 41 41 }; 42 export interface KonvaEventObject<EventType > {42 export interface KonvaEventObject<EventType, This = Node> { 43 43 type: string; 44 44 target: Shape | Stage; 45 45 evt: EventType; 46 46 pointerId: number; 47 currentTarget: Node;47 currentTarget: This; 48 48 cancelBubble: boolean; 49 49 child?: Node; 50 50 } 51 export type KonvaEventListener<This, EventType> = (this: This, ev: KonvaEventObject<EventType >) => void;51 export type KonvaEventListener<This, EventType> = (this: This, ev: KonvaEventObject<EventType, This>) => void; 52 52 export declare abstract class Node<Config extends NodeConfig = NodeConfig> { 53 53 _id: number; … … 181 181 attrs: Config & Record<string, any>; 182 182 className: string; 183 children?: any[] | undefined;183 children?: Array<any>; 184 184 }; 185 185 toJSON(): string; … … 320 320 transformsEnabled: GetSet<string, this>; 321 321 visible: GetSet<boolean, this>; 322 width: number;322 width: GetSet<number, this>; 323 323 height: GetSet<number, this>; 324 324 x: GetSet<number, this>; -
imaps-frontend/node_modules/konva/lib/Node.js
rd565449 r0c6b92a 8 8 const DragAndDrop_1 = require("./DragAndDrop"); 9 9 const Validators_1 = require("./Validators"); 10 varABSOLUTE_OPACITY = 'absoluteOpacity', ALL_LISTENERS = 'allEventListeners', ABSOLUTE_TRANSFORM = 'absoluteTransform', ABSOLUTE_SCALE = 'absoluteScale', CANVAS = 'canvas', CHANGE = 'Change', CHILDREN = 'children', KONVA = 'konva', LISTENING = 'listening', MOUSEENTER = 'mouseenter', MOUSELEAVE = 'mouseleave', NAME = 'name', SET = 'set', SHAPE = 'Shape', SPACE = ' ', STAGE = 'stage', TRANSFORM = 'transform', UPPER_STAGE = 'Stage', VISIBLE = 'visible', TRANSFORM_CHANGE_STR = [10 const ABSOLUTE_OPACITY = 'absoluteOpacity', ALL_LISTENERS = 'allEventListeners', ABSOLUTE_TRANSFORM = 'absoluteTransform', ABSOLUTE_SCALE = 'absoluteScale', CANVAS = 'canvas', CHANGE = 'Change', CHILDREN = 'children', KONVA = 'konva', LISTENING = 'listening', MOUSEENTER = 'mouseenter', MOUSELEAVE = 'mouseleave', NAME = 'name', SET = 'set', SHAPE = 'Shape', SPACE = ' ', STAGE = 'stage', TRANSFORM = 'transform', UPPER_STAGE = 'Stage', VISIBLE = 'visible', TRANSFORM_CHANGE_STR = [ 11 11 'xChange.konva', 12 12 'yChange.konva', … … 57 57 } 58 58 _getCache(attr, privateGetter) { 59 varcache = this._cache.get(attr);60 varisTransform = attr === TRANSFORM || attr === ABSOLUTE_TRANSFORM;61 varinvalid = cache === undefined || (isTransform && cache.dirty === true);59 let cache = this._cache.get(attr); 60 const isTransform = attr === TRANSFORM || attr === ABSOLUTE_TRANSFORM; 61 const invalid = cache === undefined || (isTransform && cache.dirty === true); 62 62 if (invalid) { 63 63 cache = privateGetter.call(this); … … 96 96 } 97 97 cache(config) { 98 varconf = config || {};99 varrect = {};98 const conf = config || {}; 99 let rect = {}; 100 100 if (conf.x === undefined || 101 101 conf.y === undefined || … … 107 107 }); 108 108 } 109 varwidth = Math.ceil(conf.width || rect.width), height = Math.ceil(conf.height || rect.height), pixelRatio = conf.pixelRatio, x = conf.x === undefined ? Math.floor(rect.x) : conf.x, y = conf.y === undefined ? Math.floor(rect.y) : conf.y, offset = conf.offset || 0, drawBorder = conf.drawBorder || false, hitCanvasPixelRatio = conf.hitCanvasPixelRatio || 1;109 let width = Math.ceil(conf.width || rect.width), height = Math.ceil(conf.height || rect.height), pixelRatio = conf.pixelRatio, x = conf.x === undefined ? Math.floor(rect.x) : conf.x, y = conf.y === undefined ? Math.floor(rect.y) : conf.y, offset = conf.offset || 0, drawBorder = conf.drawBorder || false, hitCanvasPixelRatio = conf.hitCanvasPixelRatio || 1; 110 110 if (!width || !height) { 111 111 Util_1.Util.error('Can not cache the node. Width or height of the node equals 0. Caching is skipped.'); … … 118 118 x -= offset; 119 119 y -= offset; 120 varcachedSceneCanvas = new Canvas_1.SceneCanvas({120 const cachedSceneCanvas = new Canvas_1.SceneCanvas({ 121 121 pixelRatio: pixelRatio, 122 122 width: width, … … 179 179 } 180 180 _transformedRect(rect, top) { 181 varpoints = [181 const points = [ 182 182 { x: rect.x, y: rect.y }, 183 183 { x: rect.x + rect.width, y: rect.y }, … … 185 185 { x: rect.x, y: rect.y + rect.height }, 186 186 ]; 187 varminX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;188 vartrans = this.getAbsoluteTransform(top);187 let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity; 188 const trans = this.getAbsoluteTransform(top); 189 189 points.forEach(function (point) { 190 vartransformed = trans.point(point);190 const transformed = trans.point(point); 191 191 if (minX === undefined) { 192 192 minX = maxX = transformed.x; … … 211 211 const canvasCache = this._getCanvasCache(); 212 212 context.translate(canvasCache.x, canvasCache.y); 213 varcacheCanvas = this._getCachedSceneCanvas();214 varratio = cacheCanvas.pixelRatio;213 const cacheCanvas = this._getCachedSceneCanvas(); 214 const ratio = cacheCanvas.pixelRatio; 215 215 context.drawImage(cacheCanvas._canvas, 0, 0, cacheCanvas.width / ratio, cacheCanvas.height / ratio); 216 216 context.restore(); 217 217 } 218 218 _drawCachedHitCanvas(context) { 219 varcanvasCache = this._getCanvasCache(), hitCanvas = canvasCache.hit;219 const canvasCache = this._getCanvasCache(), hitCanvas = canvasCache.hit; 220 220 context.save(); 221 221 context.translate(canvasCache.x, canvasCache.y); … … 224 224 } 225 225 _getCachedSceneCanvas() { 226 varfilters = this.filters(), cachedCanvas = this._getCanvasCache(), sceneCanvas = cachedCanvas.scene, filterCanvas = cachedCanvas.filter, filterContext = filterCanvas.getContext(), len, imageData, n, filter;226 let filters = this.filters(), cachedCanvas = this._getCanvasCache(), sceneCanvas = cachedCanvas.scene, filterCanvas = cachedCanvas.filter, filterContext = filterCanvas.getContext(), len, imageData, n, filter; 227 227 if (filters) { 228 228 if (!this._filterUpToDate) { 229 varratio = sceneCanvas.pixelRatio;229 const ratio = sceneCanvas.pixelRatio; 230 230 filterCanvas.setSize(sceneCanvas.width / sceneCanvas.pixelRatio, sceneCanvas.height / sceneCanvas.pixelRatio); 231 231 try { … … 262 262 return this._delegate.apply(this, arguments); 263 263 } 264 varevents = evtStr.split(SPACE), len = events.length, n, event, parts, baseEvent, name;264 let events = evtStr.split(SPACE), len = events.length, n, event, parts, baseEvent, name; 265 265 for (n = 0; n < len; n++) { 266 266 event = events[n]; … … 279 279 } 280 280 off(evtStr, callback) { 281 varevents = (evtStr || '').split(SPACE), len = events.length, n, t, event, parts, baseEvent, name;281 let events = (evtStr || '').split(SPACE), len = events.length, n, t, event, parts, baseEvent, name; 282 282 this._cache && this._cache.delete(ALL_LISTENERS); 283 283 if (!evtStr) { … … 305 305 } 306 306 dispatchEvent(evt) { 307 vare = {307 const e = { 308 308 target: this, 309 309 type: evt.type, … … 324 324 } 325 325 _delegate(event, selector, handler) { 326 varstopNode = this;326 const stopNode = this; 327 327 this.on(event, function (evt) { 328 vartargets = evt.target.findAncestors(selector, true, stopNode);329 for ( vari = 0; i < targets.length; i++) {328 const targets = evt.target.findAncestors(selector, true, stopNode); 329 for (let i = 0; i < targets.length; i++) { 330 330 evt = Util_1.Util.cloneObject(evt); 331 331 evt.currentTarget = targets[i]; … … 352 352 _remove() { 353 353 this._clearCaches(); 354 varparent = this.getParent();354 const parent = this.getParent(); 355 355 if (parent && parent.children) { 356 356 parent.children.splice(this.index, 1); … … 365 365 } 366 366 getAttr(attr) { 367 varmethod = 'get' + Util_1.Util._capitalize(attr);367 const method = 'get' + Util_1.Util._capitalize(attr); 368 368 if (Util_1.Util._isFunction(this[method])) { 369 369 return this[method](); … … 372 372 } 373 373 getAncestors() { 374 varparent = this.getParent(), ancestors = [];374 let parent = this.getParent(), ancestors = []; 375 375 while (parent) { 376 376 ancestors.push(parent); … … 384 384 setAttrs(config) { 385 385 this._batchTransformChanges(() => { 386 varkey, method;386 let key, method; 387 387 if (!config) { 388 388 return this; … … 439 439 return this._isVisible(top) && this._isListening(top); 440 440 } 441 varlayer = this.getLayer();442 varlayerUnderDrag = false;441 const layer = this.getLayer(); 442 let layerUnderDrag = false; 443 443 DragAndDrop_1.DD._dragElements.forEach((elem) => { 444 444 if (elem.dragStatus !== 'dragging') { … … 452 452 } 453 453 }); 454 vardragSkip = !skipDragCheck &&454 const dragSkip = !skipDragCheck && 455 455 !Global_1.Konva.hitOnDragEnabled && 456 456 (layerUnderDrag || Global_1.Konva.isTransforming()); … … 469 469 } 470 470 getAbsoluteZIndex() { 471 vardepth = this.getDepth(), that = this, index = 0, nodes, len, n, child;471 let depth = this.getDepth(), that = this, index = 0, nodes, len, n, child; 472 472 function addChildren(children) { 473 473 nodes = []; … … 494 494 } 495 495 getDepth() { 496 vardepth = 0, parent = this.parent;496 let depth = 0, parent = this.parent; 497 497 while (parent) { 498 498 depth++; … … 529 529 return null; 530 530 } 531 varpos = stage.getPointerPosition();531 const pos = stage.getPointerPosition(); 532 532 if (!pos) { 533 533 return null; 534 534 } 535 vartransform = this.getAbsoluteTransform().copy();535 const transform = this.getAbsoluteTransform().copy(); 536 536 transform.invert(); 537 537 return transform.point(pos); … … 550 550 top = true; 551 551 } 552 varabsoluteMatrix = this.getAbsoluteTransform(top).getMatrix(), absoluteTransform = new Util_1.Transform(), offset = this.offset();552 const absoluteMatrix = this.getAbsoluteTransform(top).getMatrix(), absoluteTransform = new Util_1.Transform(), offset = this.offset(); 553 553 absoluteTransform.m = absoluteMatrix.slice(); 554 554 absoluteTransform.translate(offset.x, offset.y); … … 560 560 this.attrs.y = y; 561 561 this._clearCache(TRANSFORM); 562 varit = this._getAbsoluteTransform().copy();562 const it = this._getAbsoluteTransform().copy(); 563 563 it.invert(); 564 564 it.translate(pos.x, pos.y); … … 574 574 } 575 575 _setTransform(trans) { 576 varkey;576 let key; 577 577 for (key in trans) { 578 578 this.attrs[key] = trans[key]; … … 580 580 } 581 581 _clearTransform() { 582 vartrans = {582 const trans = { 583 583 x: this.x(), 584 584 y: this.y(), … … 603 603 } 604 604 move(change) { 605 varchangeX = change.x, changeY = change.y, x = this.x(), y = this.y();605 let changeX = change.x, changeY = change.y, x = this.x(), y = this.y(); 606 606 if (changeX !== undefined) { 607 607 x += changeX; … … 614 614 } 615 615 _eachAncestorReverse(func, top) { 616 varfamily = [], parent = this.getParent(), len, n;616 let family = [], parent = this.getParent(), len, n; 617 617 if (top && top._id === this._id) { 618 618 return; … … 637 637 return false; 638 638 } 639 varindex = this.index, len = this.parent.getChildren().length;639 const index = this.index, len = this.parent.getChildren().length; 640 640 if (index < len - 1) { 641 641 this.parent.children.splice(index, 1); … … 651 651 return false; 652 652 } 653 varindex = this.index, len = this.parent.getChildren().length;653 const index = this.index, len = this.parent.getChildren().length; 654 654 if (index < len - 1) { 655 655 this.parent.children.splice(index, 1); … … 665 665 return false; 666 666 } 667 varindex = this.index;667 const index = this.index; 668 668 if (index > 0) { 669 669 this.parent.children.splice(index, 1); … … 679 679 return false; 680 680 } 681 varindex = this.index;681 const index = this.index; 682 682 if (index > 0) { 683 683 this.parent.children.splice(index, 1); … … 700 700 '.'); 701 701 } 702 varindex = this.index;702 const index = this.index; 703 703 this.parent.children.splice(index, 1); 704 704 this.parent.children.splice(zIndex, 0, this); … … 710 710 } 711 711 _getAbsoluteOpacity() { 712 varabsOpacity = this.opacity();713 varparent = this.getParent();712 let absOpacity = this.opacity(); 713 const parent = this.getParent(); 714 714 if (parent && !parent._isUnderCache) { 715 715 absOpacity *= parent.getAbsoluteOpacity(); … … 725 725 } 726 726 toObject() { 727 varattrs = this.getAttrs(), key, val, getter, defaultValue, nonPlainObject;727 let attrs = this.getAttrs(), key, val, getter, defaultValue, nonPlainObject; 728 728 const obj = { 729 729 attrs: {}, … … 754 754 } 755 755 findAncestors(selector, includeSelf, stopNode) { 756 varres = [];756 const res = []; 757 757 if (includeSelf && this._isMatch(selector)) { 758 758 res.push(this); 759 759 } 760 varancestor = this.parent;760 let ancestor = this.parent; 761 761 while (ancestor) { 762 762 if (ancestor === stopNode) { … … 783 783 return selector(this); 784 784 } 785 varselectorArr = selector.replace(/ /g, '').split(','), len = selectorArr.length, n, sel;785 let selectorArr = selector.replace(/ /g, '').split(','), len = selectorArr.length, n, sel; 786 786 for (n = 0; n < len; n++) { 787 787 sel = selectorArr[n]; … … 810 810 } 811 811 getLayer() { 812 varparent = this.getParent();812 const parent = this.getParent(); 813 813 return parent ? parent.getLayer() : null; 814 814 } … … 817 817 } 818 818 _getStage() { 819 varparent = this.getParent();819 const parent = this.getParent(); 820 820 if (parent) { 821 821 return parent.getStage(); … … 844 844 } 845 845 _getAbsoluteTransform(top) { 846 varat;846 let at; 847 847 if (top) { 848 848 at = new Util_1.Transform(); 849 849 this._eachAncestorReverse(function (node) { 850 vartransformsEnabled = node.transformsEnabled();850 const transformsEnabled = node.transformsEnabled(); 851 851 if (transformsEnabled === 'all') { 852 852 at.multiply(node.getTransform()); … … 866 866 at.reset(); 867 867 } 868 vartransformsEnabled = this.transformsEnabled();868 const transformsEnabled = this.transformsEnabled(); 869 869 if (transformsEnabled === 'all') { 870 870 at.multiply(this.getTransform()); … … 882 882 } 883 883 getAbsoluteScale(top) { 884 varparent = this;884 let parent = this; 885 885 while (parent) { 886 886 if (parent._isUnderCache) { … … 904 904 _getTransform() { 905 905 var _a, _b; 906 varm = this._cache.get(TRANSFORM) || new Util_1.Transform();906 const m = this._cache.get(TRANSFORM) || new Util_1.Transform(); 907 907 m.reset(); 908 varx = 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;908 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; 909 909 if (x !== 0 || y !== 0) { 910 910 m.translate(x, y); … … 926 926 } 927 927 clone(obj) { 928 varattrs = Util_1.Util.cloneObject(this.attrs), key, allListeners, len, n, listener;928 let attrs = Util_1.Util.cloneObject(this.attrs), key, allListeners, len, n, listener; 929 929 for (key in obj) { 930 930 attrs[key] = obj[key]; 931 931 } 932 varnode = new this.constructor(attrs);932 const node = new this.constructor(attrs); 933 933 for (key in this.eventListeners) { 934 934 allListeners = this.eventListeners[key]; … … 948 948 _toKonvaCanvas(config) { 949 949 config = config || {}; 950 varbox = this.getClientRect();951 varstage = this.getStage(), x = config.x !== undefined ? config.x : Math.floor(box.x), y = config.y !== undefined ? config.y : Math.floor(box.y), pixelRatio = config.pixelRatio || 1, canvas = new Canvas_1.SceneCanvas({950 const box = this.getClientRect(); 951 const stage = this.getStage(), x = config.x !== undefined ? config.x : Math.floor(box.x), y = config.y !== undefined ? config.y : Math.floor(box.y), pixelRatio = config.pixelRatio || 1, canvas = new Canvas_1.SceneCanvas({ 952 952 width: config.width || Math.ceil(box.width) || (stage ? stage.width() : 0), 953 953 height: config.height || … … 977 977 toDataURL(config) { 978 978 config = config || {}; 979 varmimeType = config.mimeType || null, quality = config.quality || null;980 varurl = this._toKonvaCanvas(config).toDataURL(mimeType, quality);979 const mimeType = config.mimeType || null, quality = config.quality || null; 980 const url = this._toKonvaCanvas(config).toDataURL(mimeType, quality); 981 981 if (config.callback) { 982 982 config.callback(url); … … 1045 1045 } 1046 1046 _off(type, name, callback) { 1047 varevtListeners = this.eventListeners[type], i, evtName, handler;1047 let evtListeners = this.eventListeners[type], i, evtName, handler; 1048 1048 for (i = 0; i < evtListeners.length; i++) { 1049 1049 evtName = evtListeners[i].name; … … 1069 1069 addName(name) { 1070 1070 if (!this.hasName(name)) { 1071 varoldName = this.name();1072 varnewName = oldName ? oldName + ' ' + name : name;1071 const oldName = this.name(); 1072 const newName = oldName ? oldName + ' ' + name : name; 1073 1073 this.name(newName); 1074 1074 } … … 1083 1083 return false; 1084 1084 } 1085 varnames = (fullName || '').split(/\s/g);1085 const names = (fullName || '').split(/\s/g); 1086 1086 return names.indexOf(name) !== -1; 1087 1087 } 1088 1088 removeName(name) { 1089 varnames = (this.name() || '').split(/\s/g);1090 varindex = names.indexOf(name);1089 const names = (this.name() || '').split(/\s/g); 1090 const index = names.indexOf(name); 1091 1091 if (index !== -1) { 1092 1092 names.splice(index, 1); … … 1096 1096 } 1097 1097 setAttr(attr, val) { 1098 varfunc = this[SET + Util_1.Util._capitalize(attr)];1098 const func = this[SET + Util_1.Util._capitalize(attr)]; 1099 1099 if (Util_1.Util._isFunction(func)) { 1100 1100 func.call(this, val); … … 1112 1112 } 1113 1113 _setAttr(key, val) { 1114 varoldVal = this.attrs[key];1114 const oldVal = this.attrs[key]; 1115 1115 if (oldVal === val && !Util_1.Util.isObject(val)) { 1116 1116 return; … … 1128 1128 } 1129 1129 _setComponentAttr(key, component, val) { 1130 varoldVal;1130 let oldVal; 1131 1131 if (val !== undefined) { 1132 1132 oldVal = this.attrs[key]; … … 1142 1142 evt.target = this; 1143 1143 } 1144 varshouldStop = (eventType === MOUSEENTER || eventType === MOUSELEAVE) &&1144 const shouldStop = (eventType === MOUSEENTER || eventType === MOUSELEAVE) && 1145 1145 ((compareShape && 1146 1146 (this === compareShape || … … 1149 1149 if (!shouldStop) { 1150 1150 this._fire(eventType, evt); 1151 varstopBubble = (eventType === MOUSEENTER || eventType === MOUSELEAVE) &&1151 const stopBubble = (eventType === MOUSEENTER || eventType === MOUSELEAVE) && 1152 1152 compareShape && 1153 1153 compareShape.isAncestorOf && … … 1207 1207 } 1208 1208 _createDragElement(evt) { 1209 varpointerId = evt ? evt.pointerId : undefined;1210 varstage = this.getStage();1211 varap = this.getAbsolutePosition();1209 const pointerId = evt ? evt.pointerId : undefined; 1210 const stage = this.getStage(); 1211 const ap = this.getAbsolutePosition(); 1212 1212 if (!stage) { 1213 1213 return; 1214 1214 } 1215 varpos = stage._getPointerById(pointerId) ||1215 const pos = stage._getPointerById(pointerId) || 1216 1216 stage._changedPointerPositions[0] || 1217 1217 ap; … … 1244 1244 return; 1245 1245 } 1246 varnewNodePos = {1246 let newNodePos = { 1247 1247 x: pos.x - elem.offset.x, 1248 1248 y: pos.y - elem.offset.y, 1249 1249 }; 1250 vardbf = this.dragBoundFunc();1250 const dbf = this.dragBoundFunc(); 1251 1251 if (dbf !== undefined) { 1252 1252 const bounded = dbf.call(this, newNodePos, evt); … … 1285 1285 this._dragCleanup(); 1286 1286 this.on('mousedown.konva touchstart.konva', function (evt) { 1287 varshouldCheckButton = evt.evt['button'] !== undefined;1288 varcanDrag = !shouldCheckButton || Global_1.Konva.dragButtons.indexOf(evt.evt['button']) >= 0;1287 const shouldCheckButton = evt.evt['button'] !== undefined; 1288 const canDrag = !shouldCheckButton || Global_1.Konva.dragButtons.indexOf(evt.evt['button']) >= 0; 1289 1289 if (!canDrag) { 1290 1290 return; … … 1293 1293 return; 1294 1294 } 1295 varhasDraggingChild = false;1295 let hasDraggingChild = false; 1296 1296 DragAndDrop_1.DD._dragElements.forEach((elem) => { 1297 1297 if (this.isAncestorOf(elem.node)) { … … 1310 1310 else { 1311 1311 this._dragCleanup(); 1312 varstage = this.getStage();1312 const stage = this.getStage(); 1313 1313 if (!stage) { 1314 1314 return; … … 1349 1349 } 1350 1350 static _createNode(obj, container) { 1351 varclassName = Node.prototype.getClassName.call(obj), children = obj.children, no, len, n;1351 let className = Node.prototype.getClassName.call(obj), children = obj.children, no, len, n; 1352 1352 if (container) { 1353 1353 obj.attrs.container = container; -
imaps-frontend/node_modules/konva/lib/PointerEvents.js
rd565449 r0c6b92a 1 1 "use strict"; 2 2 Object.defineProperty(exports, "__esModule", { value: true }); 3 exports.releaseCapture = exports.setPointerCapture = exports.hasPointerCapture = exports.createEvent = exports.getCapturedShape = void 0; 3 exports.getCapturedShape = getCapturedShape; 4 exports.createEvent = createEvent; 5 exports.hasPointerCapture = hasPointerCapture; 6 exports.setPointerCapture = setPointerCapture; 7 exports.releaseCapture = releaseCapture; 4 8 const Global_1 = require("./Global"); 5 9 const Captures = new Map(); … … 8 12 return Captures.get(pointerId); 9 13 } 10 exports.getCapturedShape = getCapturedShape;11 14 function createEvent(evt) { 12 15 return { … … 15 18 }; 16 19 } 17 exports.createEvent = createEvent;18 20 function hasPointerCapture(pointerId, shape) { 19 21 return Captures.get(pointerId) === shape; 20 22 } 21 exports.hasPointerCapture = hasPointerCapture;22 23 function setPointerCapture(pointerId, shape) { 23 24 releaseCapture(pointerId); … … 30 31 } 31 32 } 32 exports.setPointerCapture = setPointerCapture;33 33 function releaseCapture(pointerId, target) { 34 34 const shape = Captures.get(pointerId); … … 43 43 } 44 44 } 45 exports.releaseCapture = releaseCapture; -
imaps-frontend/node_modules/konva/lib/Shape.js
rd565449 r0c6b92a 9 9 const Global_2 = require("./Global"); 10 10 const PointerEvents = require("./PointerEvents"); 11 varHAS_SHADOW = 'hasShadow';12 varSHADOW_RGBA = 'shadowRGBA';13 varpatternImage = 'patternImage';14 varlinearGradient = 'linearGradient';15 varradialGradient = 'radialGradient';11 const HAS_SHADOW = 'hasShadow'; 12 const SHADOW_RGBA = 'shadowRGBA'; 13 const patternImage = 'patternImage'; 14 const linearGradient = 'linearGradient'; 15 const radialGradient = 'radialGradient'; 16 16 let dummyContext; 17 17 function getDummyContext() { … … 105 105 __getFillPattern() { 106 106 if (this.fillPatternImage()) { 107 varctx = getDummyContext();107 const ctx = getDummyContext(); 108 108 const pattern = ctx.createPattern(this.fillPatternImage(), this.fillPatternRepeat() || 'repeat'); 109 109 if (pattern && pattern.setTransform) { … … 133 133 } 134 134 __getLinearGradient() { 135 varcolorStops = this.fillLinearGradientColorStops();135 const colorStops = this.fillLinearGradientColorStops(); 136 136 if (colorStops) { 137 varctx = getDummyContext();138 varstart = this.fillLinearGradientStartPoint();139 varend = this.fillLinearGradientEndPoint();140 vargrd = ctx.createLinearGradient(start.x, start.y, end.x, end.y);141 for ( varn = 0; n < colorStops.length; n += 2) {137 const ctx = getDummyContext(); 138 const start = this.fillLinearGradientStartPoint(); 139 const end = this.fillLinearGradientEndPoint(); 140 const grd = ctx.createLinearGradient(start.x, start.y, end.x, end.y); 141 for (let n = 0; n < colorStops.length; n += 2) { 142 142 grd.addColorStop(colorStops[n], colorStops[n + 1]); 143 143 } … … 149 149 } 150 150 __getRadialGradient() { 151 varcolorStops = this.fillRadialGradientColorStops();151 const colorStops = this.fillRadialGradientColorStops(); 152 152 if (colorStops) { 153 varctx = getDummyContext();154 varstart = this.fillRadialGradientStartPoint();155 varend = this.fillRadialGradientEndPoint();156 vargrd = ctx.createRadialGradient(start.x, start.y, this.fillRadialGradientStartRadius(), end.x, end.y, this.fillRadialGradientEndRadius());157 for ( varn = 0; n < colorStops.length; n += 2) {153 const ctx = getDummyContext(); 154 const start = this.fillRadialGradientStartPoint(); 155 const end = this.fillRadialGradientEndPoint(); 156 const grd = ctx.createRadialGradient(start.x, start.y, this.fillRadialGradientStartRadius(), end.x, end.y, this.fillRadialGradientEndRadius()); 157 for (let n = 0; n < colorStops.length; n += 2) { 158 158 grd.addColorStop(colorStops[n], colorStops[n + 1]); 159 159 } … … 168 168 return; 169 169 } 170 varrgba = Util_1.Util.colorToRGBA(this.shadowColor());170 const rgba = Util_1.Util.colorToRGBA(this.shadowColor()); 171 171 if (rgba) { 172 172 return ('rgba(' + … … 216 216 } 217 217 intersects(point) { 218 varstage = this.getStage();218 const stage = this.getStage(); 219 219 if (!stage) { 220 220 return false; … … 269 269 } 270 270 getSelfRect() { 271 varsize = this.size();271 const size = this.size(); 272 272 return { 273 273 x: this._centroid ? -size.width / 2 : 0, … … 318 318 } 319 319 drawScene(can, top, bufferCanvas) { 320 varlayer = this.getLayer();321 varcanvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferContext;322 varskipBuffer = canvas.isCache;323 varcachingSelf = top === this;320 const layer = this.getLayer(); 321 let canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferContext; 322 const skipBuffer = canvas.isCache; 323 const cachingSelf = top === this; 324 324 if (!this.isVisible() && !cachingSelf) { 325 325 return this; … … 327 327 if (cachedCanvas) { 328 328 context.save(); 329 varm = this.getAbsoluteTransform(top).getMatrix();329 const m = this.getAbsoluteTransform(top).getMatrix(); 330 330 context.transform(m[0], m[1], m[2], m[3], m[4], m[5]); 331 331 this._drawCachedSceneCanvas(context); … … 348 348 drawFunc.call(this, bufferContext, this); 349 349 bufferContext.restore(); 350 varratio = bc.pixelRatio;350 const ratio = bc.pixelRatio; 351 351 if (hasShadow) { 352 352 context._applyShadow(this); … … 376 376 return this; 377 377 } 378 varlayer = this.getLayer(), canvas = can || layer.hitCanvas, context = canvas && canvas.getContext(), drawFunc = this.hitFunc() || this.sceneFunc(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;378 const layer = this.getLayer(), canvas = can || layer.hitCanvas, context = canvas && canvas.getContext(), drawFunc = this.hitFunc() || this.sceneFunc(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit; 379 379 if (!this.colorKey) { 380 380 Util_1.Util.warn('Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()'); … … 382 382 if (cachedHitCanvas) { 383 383 context.save(); 384 varm = this.getAbsoluteTransform(top).getMatrix();384 const m = this.getAbsoluteTransform(top).getMatrix(); 385 385 context.transform(m[0], m[1], m[2], m[3], m[4], m[5]); 386 386 this._drawCachedHitCanvas(context); … … 395 395 const selfCache = this === top; 396 396 if (!selfCache) { 397 varo = this.getAbsoluteTransform(top).getMatrix();397 const o = this.getAbsoluteTransform(top).getMatrix(); 398 398 context.transform(o[0], o[1], o[2], o[3], o[4], o[5]); 399 399 } … … 403 403 } 404 404 drawHitFromCache(alphaThreshold = 0) { 405 varcachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha;405 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; 406 406 hitContext.clear(); 407 407 hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight); -
imaps-frontend/node_modules/konva/lib/Stage.d.ts
rd565449 r0c6b92a 5 5 import { Layer } from './Layer.js'; 6 6 export interface StageConfig extends ContainerConfig { 7 container : HTMLDivElement | string;7 container?: HTMLDivElement | string; 8 8 } 9 9 export declare const stages: Stage[]; … … 41 41 getPointerPosition(): Vector2d | null; 42 42 _getPointerById(id?: number): (Vector2d & { 43 id?: number | undefined;43 id?: number; 44 44 }) | undefined; 45 45 getPointersPositions(): (Vector2d & { 46 id?: number | undefined;46 id?: number; 47 47 })[]; 48 48 getStage(): this; -
imaps-frontend/node_modules/konva/lib/Stage.js
rd565449 r0c6b92a 10 10 const Global_2 = require("./Global"); 11 11 const PointerEvents = require("./PointerEvents"); 12 varSTAGE = 'Stage', STRING = 'string', PX = 'px', MOUSEOUT = 'mouseout', MOUSELEAVE = 'mouseleave', MOUSEOVER = 'mouseover', MOUSEENTER = 'mouseenter', MOUSEMOVE = 'mousemove', MOUSEDOWN = 'mousedown', MOUSEUP = 'mouseup', POINTERMOVE = 'pointermove', POINTERDOWN = 'pointerdown', POINTERUP = 'pointerup', POINTERCANCEL = 'pointercancel', LOSTPOINTERCAPTURE = 'lostpointercapture', POINTEROUT = 'pointerout', POINTERLEAVE = 'pointerleave', POINTEROVER = 'pointerover', POINTERENTER = 'pointerenter', CONTEXTMENU = 'contextmenu', TOUCHSTART = 'touchstart', TOUCHEND = 'touchend', TOUCHMOVE = 'touchmove', TOUCHCANCEL = 'touchcancel', WHEEL = 'wheel', MAX_LAYERS_NUMBER = 5, EVENTS = [12 const STAGE = 'Stage', STRING = 'string', PX = 'px', MOUSEOUT = 'mouseout', MOUSELEAVE = 'mouseleave', MOUSEOVER = 'mouseover', MOUSEENTER = 'mouseenter', MOUSEMOVE = 'mousemove', MOUSEDOWN = 'mousedown', MOUSEUP = 'mouseup', POINTERMOVE = 'pointermove', POINTERDOWN = 'pointerdown', POINTERUP = 'pointerup', POINTERCANCEL = 'pointercancel', LOSTPOINTERCAPTURE = 'lostpointercapture', POINTEROUT = 'pointerout', POINTERLEAVE = 'pointerleave', POINTEROVER = 'pointerover', POINTERENTER = 'pointerenter', CONTEXTMENU = 'contextmenu', TOUCHSTART = 'touchstart', TOUCHEND = 'touchend', TOUCHMOVE = 'touchmove', TOUCHCANCEL = 'touchcancel', WHEEL = 'wheel', MAX_LAYERS_NUMBER = 5, EVENTS = [ 13 13 [MOUSEENTER, '_pointerenter'], 14 14 [MOUSEDOWN, '_pointerdown'], … … 129 129 if (typeof container === STRING) { 130 130 if (container.charAt(0) === '.') { 131 varclassName = container.slice(1);131 const className = container.slice(1); 132 132 container = document.getElementsByClassName(className)[0]; 133 133 } … … 159 159 } 160 160 clear() { 161 varlayers = this.children, len = layers.length, n;161 let layers = this.children, len = layers.length, n; 162 162 for (n = 0; n < len; n++) { 163 163 layers[n].clear(); … … 175 175 destroy() { 176 176 super.destroy(); 177 varcontent = this.content;177 const content = this.content; 178 178 if (content && Util_1.Util._isInDocument(content)) { 179 179 this.container().removeChild(content); 180 180 } 181 varindex = exports.stages.indexOf(this);181 const index = exports.stages.indexOf(this); 182 182 if (index > -1) { 183 183 exports.stages.splice(index, 1); … … 215 215 config.width = config.width || this.width(); 216 216 config.height = config.height || this.height(); 217 varcanvas = new Canvas_1.SceneCanvas({217 const canvas = new Canvas_1.SceneCanvas({ 218 218 width: config.width, 219 219 height: config.height, 220 220 pixelRatio: config.pixelRatio || 1, 221 221 }); 222 var_context = canvas.getContext()._context;223 varlayers = this.children;222 const _context = canvas.getContext()._context; 223 const layers = this.children; 224 224 if (config.x || config.y) { 225 225 _context.translate(-1 * config.x, -1 * config.y); … … 229 229 return; 230 230 } 231 varlayerCanvas = layer._toKonvaCanvas(config);231 const layerCanvas = layer._toKonvaCanvas(config); 232 232 _context.drawImage(layerCanvas._canvas, config.x, config.y, layerCanvas.getWidth() / layerCanvas.getPixelRatio(), layerCanvas.getHeight() / layerCanvas.getPixelRatio()); 233 233 }); … … 238 238 return null; 239 239 } 240 varlayers = this.children, len = layers.length, end = len - 1, n;240 let layers = this.children, len = layers.length, end = len - 1, n; 241 241 for (n = end; n >= 0; n--) { 242 242 const shape = layers[n].getIntersection(pos); … … 248 248 } 249 249 _resizeDOM() { 250 varwidth = this.width();251 varheight = this.height();250 const width = this.width(); 251 const height = this.height(); 252 252 if (this.content) { 253 253 this.content.style.width = width + PX; … … 263 263 add(layer, ...rest) { 264 264 if (arguments.length > 1) { 265 for ( vari = 0; i < arguments.length; i++) {265 for (let i = 0; i < arguments.length; i++) { 266 266 this.add(arguments[i]); 267 267 } … … 269 269 } 270 270 super.add(layer); 271 varlength = this.children.length;271 const length = this.children.length; 272 272 if (length > MAX_LAYERS_NUMBER) { 273 273 Util_1.Util.warn('The stage has ' + … … 346 346 } 347 347 this.setPointersPositions(evt); 348 vartargetShape = this._getTargetShape(eventType);349 vareventsEnabled = !(Global_1.Konva.isDragging() || Global_1.Konva.isTransforming()) || Global_1.Konva.hitOnDragEnabled;348 const targetShape = this._getTargetShape(eventType); 349 const eventsEnabled = !(Global_1.Konva.isDragging() || Global_1.Konva.isTransforming()) || Global_1.Konva.hitOnDragEnabled; 350 350 if (targetShape && eventsEnabled) { 351 351 targetShape._fireAndBubble(events.pointerout, { evt: evt }); … … 380 380 } 381 381 this.setPointersPositions(evt); 382 vartriggeredOnShape = false;382 let triggeredOnShape = false; 383 383 this._changedPointerPositions.forEach((pos) => { 384 varshape = this.getIntersection(pos);384 const shape = this.getIntersection(pos); 385 385 DragAndDrop_1.DD.justDragged = false; 386 386 Global_1.Konva['_' + eventType + 'ListenClick'] = true; … … 422 422 } 423 423 this.setPointersPositions(evt); 424 vareventsEnabled = !(Global_1.Konva.isDragging() || Global_1.Konva.isTransforming()) || Global_1.Konva.hitOnDragEnabled;424 const eventsEnabled = !(Global_1.Konva.isDragging() || Global_1.Konva.isTransforming()) || Global_1.Konva.hitOnDragEnabled; 425 425 if (!eventsEnabled) { 426 426 return; 427 427 } 428 varprocessedShapesIds = {};428 const processedShapesIds = {}; 429 429 let triggeredOnShape = false; 430 vartargetShape = this._getTargetShape(eventType);430 const targetShape = this._getTargetShape(eventType); 431 431 this._changedPointerPositions.forEach((pos) => { 432 432 const shape = (PointerEvents.getCapturedShape(pos.id) || … … 434 434 const pointerId = pos.id; 435 435 const event = { evt: evt, pointerId }; 436 vardifferentTarget = targetShape !== shape;436 const differentTarget = targetShape !== shape; 437 437 if (differentTarget && targetShape) { 438 438 targetShape._fireAndBubble(events.pointerout, { ...event }, shape); … … 484 484 const clickStartShape = this[eventType + 'ClickStartShape']; 485 485 const clickEndShape = this[eventType + 'ClickEndShape']; 486 varprocessedShapesIds = {};486 const processedShapesIds = {}; 487 487 let triggeredOnShape = false; 488 488 this._changedPointerPositions.forEach((pos) => { … … 558 558 _contextmenu(evt) { 559 559 this.setPointersPositions(evt); 560 varshape = this.getIntersection(this.getPointerPosition());560 const shape = this.getIntersection(this.getPointerPosition()); 561 561 if (shape && shape.isListening()) { 562 562 shape._fireAndBubble(CONTEXTMENU, { evt: evt }); … … 572 572 _wheel(evt) { 573 573 this.setPointersPositions(evt); 574 varshape = this.getIntersection(this.getPointerPosition());574 const shape = this.getIntersection(this.getPointerPosition()); 575 575 if (shape && shape.isListening()) { 576 576 shape._fireAndBubble(WHEEL, { evt: evt }); … … 597 597 } 598 598 setPointersPositions(evt) { 599 varcontentPosition = this._getContentPosition(), x = null, y = null;599 let contentPosition = this._getContentPosition(), x = null, y = null; 600 600 evt = evt ? evt : window.event; 601 601 if (evt.touches !== undefined) { … … 643 643 }; 644 644 } 645 varrect = this.content.getBoundingClientRect();645 const rect = this.content.getBoundingClientRect(); 646 646 return { 647 647 top: rect.top, … … 664 664 return; 665 665 } 666 varcontainer = this.container();666 const container = this.container(); 667 667 if (!container) { 668 668 throw 'Stage has no container. A container is required.'; -
imaps-frontend/node_modules/konva/lib/Tween.js
rd565449 r0c6b92a 6 6 const Node_1 = require("./Node"); 7 7 const Global_1 = require("./Global"); 8 varblacklist = {8 let blacklist = { 9 9 node: 1, 10 10 duration: 1, … … 32 32 } 33 33 fire(str) { 34 varhandler = this[str];34 const handler = this[str]; 35 35 if (handler) { 36 36 handler(); … … 111 111 } 112 112 onEnterFrame() { 113 vart = this.getTimer() - this._startTime;113 const t = this.getTimer() - this._startTime; 114 114 if (this.state === PLAYING) { 115 115 this.setTime(t); … … 129 129 class Tween { 130 130 constructor(config) { 131 varthat = this, node = config.node, nodeId = node._id, duration, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo, key;131 let that = this, node = config.node, nodeId = node._id, duration, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo, key; 132 132 if (typeof config.duration === 'undefined') { 133 133 duration = 0.3; … … 141 141 this.node = node; 142 142 this._id = idCounter++; 143 varlayers = node.getLayer() ||143 const layers = node.getLayer() || 144 144 (node instanceof Global_1.Konva['Stage'] ? node.getLayers() : null); 145 145 if (!layers) { … … 173 173 } 174 174 _addAttr(key, end) { 175 varnode = this.node, nodeId = node._id, start, diff, tweenId, n, len, trueEnd, trueStart, endRGBA;175 let node = this.node, nodeId = node._id, start, diff, tweenId, n, len, trueEnd, trueStart, endRGBA; 176 176 tweenId = Tween.tweens[nodeId][key]; 177 177 if (tweenId) { … … 198 198 } 199 199 else { 200 varstartRGBA = Util_1.Util.colorToRGBA(start[n]);200 const startRGBA = Util_1.Util.colorToRGBA(start[n]); 201 201 endRGBA = Util_1.Util.colorToRGBA(end[n]); 202 202 start[n] = startRGBA; … … 239 239 } 240 240 _tweenFunc(i) { 241 varnode = this.node, attrs = Tween.attrs[node._id][this._id], key, attr, start, diff, newVal, n, len, end;241 let node = this.node, attrs = Tween.attrs[node._id][this._id], key, attr, start, diff, newVal, n, len, end; 242 242 for (key in attrs) { 243 243 attr = attrs[key]; … … 301 301 }; 302 302 this.tween.onFinish = () => { 303 varnode = this.node;304 varattrs = Tween.attrs[node._id][this._id];303 const node = this.node; 304 const attrs = Tween.attrs[node._id][this._id]; 305 305 if (attrs.points && attrs.points.trueEnd) { 306 306 node.setAttr('points', attrs.points.trueEnd); … … 311 311 }; 312 312 this.tween.onReset = () => { 313 varnode = this.node;314 varattrs = Tween.attrs[node._id][this._id];313 const node = this.node; 314 const attrs = Tween.attrs[node._id][this._id]; 315 315 if (attrs.points && attrs.points.trueStart) { 316 316 node.points(attrs.points.trueStart); … … 351 351 } 352 352 destroy() { 353 varnodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId], key;353 let nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId], key; 354 354 this.pause(); 355 355 for (key in attrs) { … … 363 363 Tween.tweens = {}; 364 364 Node_1.Node.prototype.to = function (params) { 365 varonFinish = params.onFinish;365 const onFinish = params.onFinish; 366 366 params.node = this; 367 367 params.onFinish = function () { … … 371 371 } 372 372 }; 373 vartween = new Tween(params);373 const tween = new Tween(params); 374 374 tween.play(); 375 375 }; 376 376 exports.Easings = { 377 377 BackEaseIn(t, b, c, d) { 378 vars = 1.70158;378 const s = 1.70158; 379 379 return c * (t /= d) * t * ((s + 1) * t - s) + b; 380 380 }, 381 381 BackEaseOut(t, b, c, d) { 382 vars = 1.70158;382 const s = 1.70158; 383 383 return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; 384 384 }, 385 385 BackEaseInOut(t, b, c, d) { 386 vars = 1.70158;386 let s = 1.70158; 387 387 if ((t /= d / 2) < 1) { 388 388 return (c / 2) * (t * t * (((s *= 1.525) + 1) * t - s)) + b; … … 391 391 }, 392 392 ElasticEaseIn(t, b, c, d, a, p) { 393 vars = 0;393 let s = 0; 394 394 if (t === 0) { 395 395 return b; … … 413 413 }, 414 414 ElasticEaseOut(t, b, c, d, a, p) { 415 vars = 0;415 let s = 0; 416 416 if (t === 0) { 417 417 return b; … … 435 435 }, 436 436 ElasticEaseInOut(t, b, c, d, a, p) { 437 vars = 0;437 let s = 0; 438 438 if (t === 0) { 439 439 return b; -
imaps-frontend/node_modules/konva/lib/Util.d.ts
rd565449 r0c6b92a 37 37 _isFunction(obj: any): boolean; 38 38 _isPlainObject(obj: any): boolean; 39 _isArray(obj: any): obj is any[];39 _isArray(obj: any): obj is Array<any>; 40 40 _isNumber(obj: any): obj is number; 41 41 _isString(obj: any): obj is string; 42 42 _isBoolean(obj: any): obj is boolean; 43 isObject(val: any): val is Object;43 isObject(val: any): val is object; 44 44 isValidSelector(selector: any): boolean; 45 45 _sign(number: number): 1 | -1; … … 119 119 error(str: string): void; 120 120 warn(str: string): void; 121 each(obj: Object, func: Function): void;121 each(obj: object, func: Function): void; 122 122 _inRange(val: number, left: number, right: number): boolean; 123 123 _getProjectionToSegment(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): any[]; … … 125 125 _prepareArrayForTween(startArray: any, endArray: any, isClosed: any): number[]; 126 126 _prepareToStringify<T>(obj: any): T | null; 127 _assign<T _1, U>(target: T_1, source: U): T_1& U;127 _assign<T, U>(target: T, source: U): T & U; 128 128 _getFirstPointerId(evt: any): any; 129 129 releaseCanvas(...canvases: HTMLCanvasElement[]): void; -
imaps-frontend/node_modules/konva/lib/Util.js
rd565449 r0c6b92a 28 28 } 29 29 point(point) { 30 varm = this.m;30 const m = this.m; 31 31 return { 32 32 x: m[0] * point.x + m[2] * point.y + m[4], … … 47 47 } 48 48 rotate(rad) { 49 varc = Math.cos(rad);50 vars = Math.sin(rad);51 varm11 = this.m[0] * c + this.m[2] * s;52 varm12 = this.m[1] * c + this.m[3] * s;53 varm21 = this.m[0] * -s + this.m[2] * c;54 varm22 = this.m[1] * -s + this.m[3] * c;49 const c = Math.cos(rad); 50 const s = Math.sin(rad); 51 const m11 = this.m[0] * c + this.m[2] * s; 52 const m12 = this.m[1] * c + this.m[3] * s; 53 const m21 = this.m[0] * -s + this.m[2] * c; 54 const m22 = this.m[1] * -s + this.m[3] * c; 55 55 this.m[0] = m11; 56 56 this.m[1] = m12; … … 66 66 } 67 67 skew(sx, sy) { 68 varm11 = this.m[0] + this.m[2] * sy;69 varm12 = this.m[1] + this.m[3] * sy;70 varm21 = this.m[2] + this.m[0] * sx;71 varm22 = this.m[3] + this.m[1] * sx;68 const m11 = this.m[0] + this.m[2] * sy; 69 const m12 = this.m[1] + this.m[3] * sy; 70 const m21 = this.m[2] + this.m[0] * sx; 71 const m22 = this.m[3] + this.m[1] * sx; 72 72 this.m[0] = m11; 73 73 this.m[1] = m12; … … 77 77 } 78 78 multiply(matrix) { 79 varm11 = this.m[0] * matrix.m[0] + this.m[2] * matrix.m[1];80 varm12 = this.m[1] * matrix.m[0] + this.m[3] * matrix.m[1];81 varm21 = this.m[0] * matrix.m[2] + this.m[2] * matrix.m[3];82 varm22 = this.m[1] * matrix.m[2] + this.m[3] * matrix.m[3];83 vardx = this.m[0] * matrix.m[4] + this.m[2] * matrix.m[5] + this.m[4];84 vardy = this.m[1] * matrix.m[4] + this.m[3] * matrix.m[5] + this.m[5];79 const m11 = this.m[0] * matrix.m[0] + this.m[2] * matrix.m[1]; 80 const m12 = this.m[1] * matrix.m[0] + this.m[3] * matrix.m[1]; 81 const m21 = this.m[0] * matrix.m[2] + this.m[2] * matrix.m[3]; 82 const m22 = this.m[1] * matrix.m[2] + this.m[3] * matrix.m[3]; 83 const dx = this.m[0] * matrix.m[4] + this.m[2] * matrix.m[5] + this.m[4]; 84 const dy = this.m[1] * matrix.m[4] + this.m[3] * matrix.m[5] + this.m[5]; 85 85 this.m[0] = m11; 86 86 this.m[1] = m12; … … 92 92 } 93 93 invert() { 94 vard = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]);95 varm0 = this.m[3] * d;96 varm1 = -this.m[1] * d;97 varm2 = -this.m[2] * d;98 varm3 = this.m[0] * d;99 varm4 = d * (this.m[2] * this.m[5] - this.m[3] * this.m[4]);100 varm5 = d * (this.m[1] * this.m[4] - this.m[0] * this.m[5]);94 const d = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]); 95 const m0 = this.m[3] * d; 96 const m1 = -this.m[1] * d; 97 const m2 = -this.m[2] * d; 98 const m3 = this.m[0] * d; 99 const m4 = d * (this.m[2] * this.m[5] - this.m[3] * this.m[4]); 100 const m5 = d * (this.m[1] * this.m[4] - this.m[0] * this.m[5]); 101 101 this.m[0] = m0; 102 102 this.m[1] = m1; … … 111 111 } 112 112 decompose() { 113 vara = this.m[0];114 varb = this.m[1];115 varc = this.m[2];116 vard = this.m[3];117 vare = this.m[4];118 varf = this.m[5];119 vardelta = a * d - b * c;120 let result = {113 const a = this.m[0]; 114 const b = this.m[1]; 115 const c = this.m[2]; 116 const d = this.m[3]; 117 const e = this.m[4]; 118 const f = this.m[5]; 119 const delta = a * d - b * c; 120 const result = { 121 121 x: e, 122 122 y: f, … … 128 128 }; 129 129 if (a != 0 || b != 0) { 130 varr = Math.sqrt(a * a + b * b);130 const r = Math.sqrt(a * a + b * b); 131 131 result.rotation = b > 0 ? Math.acos(a / r) : -Math.acos(a / r); 132 132 result.scaleX = r; … … 136 136 } 137 137 else if (c != 0 || d != 0) { 138 vars = Math.sqrt(c * c + d * d);138 const s = Math.sqrt(c * c + d * d); 139 139 result.rotation = 140 140 Math.PI / 2 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s)); … … 151 151 } 152 152 exports.Transform = Transform; 153 varOBJECT_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 = {153 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 = { 154 154 aliceblue: [240, 248, 255], 155 155 antiquewhite: [250, 235, 215], … … 337 337 return false; 338 338 } 339 varfirstChar = selector[0];339 const firstChar = selector[0]; 340 340 return (firstChar === '#' || 341 341 firstChar === '.' || … … 366 366 }, 367 367 createCanvasElement() { 368 varcanvas = document.createElement('canvas');368 const canvas = document.createElement('canvas'); 369 369 try { 370 370 canvas.style = canvas.style || {}; … … 385 385 }, 386 386 _urlToImage(url, callback) { 387 varimageObj = exports.Util.createImageElement();387 const imageObj = exports.Util.createImageElement(); 388 388 imageObj.onload = function () { 389 389 callback(imageObj); … … 396 396 _hexToRgb(hex) { 397 397 hex = hex.replace(HASH, EMPTY_STRING); 398 varbigint = parseInt(hex, 16);398 const bigint = parseInt(hex, 16); 399 399 return { 400 400 r: (bigint >> 16) & 255, … … 404 404 }, 405 405 getRandomColor() { 406 varrandColor = ((Math.random() * 0xffffff) << 0).toString(16);406 let randColor = ((Math.random() * 0xffffff) << 0).toString(16); 407 407 while (randColor.length < 6) { 408 408 randColor = ZERO + randColor; … … 411 411 }, 412 412 getRGB(color) { 413 varrgb;413 let rgb; 414 414 if (color in COLORS) { 415 415 rgb = COLORS[color]; … … 451 451 }, 452 452 _namedColorToRBA(str) { 453 varc = COLORS[str.toLowerCase()];453 const c = COLORS[str.toLowerCase()]; 454 454 if (!c) { 455 455 return null; … … 465 465 if (str.indexOf('rgb(') === 0) { 466 466 str = str.match(/rgb\(([^)]+)\)/)[1]; 467 varparts = str.split(/ *, */).map(Number);467 const parts = str.split(/ *, */).map(Number); 468 468 return { 469 469 r: parts[0], … … 477 477 if (str.indexOf('rgba(') === 0) { 478 478 str = str.match(/rgba\(([^)]+)\)/)[1]; 479 varparts = str.split(/ *, */).map((n, index) => {479 const parts = str.split(/ *, */).map((n, index) => { 480 480 if (n.slice(-1) === '%') { 481 481 return index === 3 ? parseInt(n) / 100 : (parseInt(n) / 100) * 255; … … 594 594 }, 595 595 cloneObject(obj) { 596 varretObj = {};597 for ( varkey in obj) {596 const retObj = {}; 597 for (const key in obj) { 598 598 if (this._isPlainObject(obj[key])) { 599 599 retObj[key] = this.cloneObject(obj[key]); … … 644 644 }, 645 645 each(obj, func) { 646 for ( varkey in obj) {646 for (const key in obj) { 647 647 func(key, obj[key]); 648 648 } … … 652 652 }, 653 653 _getProjectionToSegment(x1, y1, x2, y2, x3, y3) { 654 varx, y, dist;655 varpd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);654 let x, y, dist; 655 const pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2); 656 656 if (pd2 == 0) { 657 657 x = x1; … … 660 660 } 661 661 else { 662 varu = ((x3 - x1) * (x2 - x1) + (y3 - y1) * (y2 - y1)) / pd2;662 const u = ((x3 - x1) * (x2 - x1) + (y3 - y1) * (y2 - y1)) / pd2; 663 663 if (u < 0) { 664 664 x = x1; … … 680 680 }, 681 681 _getProjectionToLine(pt, line, isClosed) { 682 varpc = exports.Util.cloneObject(pt);683 vardist = Number.MAX_VALUE;682 const pc = exports.Util.cloneObject(pt); 683 let dist = Number.MAX_VALUE; 684 684 line.forEach(function (p1, i) { 685 685 if (!isClosed && i === line.length - 1) { 686 686 return; 687 687 } 688 varp2 = line[(i + 1) % line.length];689 varproj = exports.Util._getProjectionToSegment(p1.x, p1.y, p2.x, p2.y, pt.x, pt.y);690 varpx = proj[0], py = proj[1], pdist = proj[2];688 const p2 = line[(i + 1) % line.length]; 689 const proj = exports.Util._getProjectionToSegment(p1.x, p1.y, p2.x, p2.y, pt.x, pt.y); 690 const px = proj[0], py = proj[1], pdist = proj[2]; 691 691 if (pdist < dist) { 692 692 pc.x = px; … … 698 698 }, 699 699 _prepareArrayForTween(startArray, endArray, isClosed) { 700 varn, start = [], end = [];700 let n, start = [], end = []; 701 701 if (startArray.length > endArray.length) { 702 vartemp = endArray;702 const temp = endArray; 703 703 endArray = startArray; 704 704 startArray = temp; … … 716 716 }); 717 717 } 718 varnewStart = [];718 const newStart = []; 719 719 end.forEach(function (point) { 720 varpr = exports.Util._getProjectionToLine(point, start, isClosed);720 const pr = exports.Util._getProjectionToLine(point, start, isClosed); 721 721 newStart.push(pr.x); 722 722 newStart.push(pr.y); … … 725 725 }, 726 726 _prepareToStringify(obj) { 727 vardesc;727 let desc; 728 728 obj.visitedByCircularReferenceRemoval = true; 729 for ( varkey in obj) {729 for (const key in obj) { 730 730 if (!(obj.hasOwnProperty(key) && obj[key] && typeof obj[key] == 'object')) { 731 731 continue; … … 754 754 }, 755 755 _assign(target, source) { 756 for ( varkey in source) {756 for (const key in source) { 757 757 target[key] = source[key]; 758 758 } -
imaps-frontend/node_modules/konva/lib/Validators.js
rd565449 r0c6b92a 1 1 "use strict"; 2 2 Object.defineProperty(exports, "__esModule", { value: true }); 3 exports.getComponentValidator = exports.getBooleanValidator = exports.getNumberArrayValidator = exports.getFunctionValidator = exports.getStringOrGradientValidator = exports.getStringValidator = exports.getNumberOrAutoValidator = exports.getNumberOrArrayOfNumbersValidator = exports.getNumberValidator = exports.alphaComponent = exports.RGBComponent = void 0; 3 exports.RGBComponent = RGBComponent; 4 exports.alphaComponent = alphaComponent; 5 exports.getNumberValidator = getNumberValidator; 6 exports.getNumberOrArrayOfNumbersValidator = getNumberOrArrayOfNumbersValidator; 7 exports.getNumberOrAutoValidator = getNumberOrAutoValidator; 8 exports.getStringValidator = getStringValidator; 9 exports.getStringOrGradientValidator = getStringOrGradientValidator; 10 exports.getFunctionValidator = getFunctionValidator; 11 exports.getNumberArrayValidator = getNumberArrayValidator; 12 exports.getBooleanValidator = getBooleanValidator; 13 exports.getComponentValidator = getComponentValidator; 4 14 const Global_1 = require("./Global"); 5 15 const Util_1 = require("./Util"); … … 25 35 return Math.round(val); 26 36 } 27 exports.RGBComponent = RGBComponent;28 37 function alphaComponent(val) { 29 38 if (val > 1) { … … 35 44 return val; 36 45 } 37 exports.alphaComponent = alphaComponent;38 46 function getNumberValidator() { 39 47 if (Global_1.Konva.isUnminified) { … … 49 57 } 50 58 } 51 exports.getNumberValidator = getNumberValidator;52 59 function getNumberOrArrayOfNumbersValidator(noOfElements) { 53 60 if (Global_1.Konva.isUnminified) { 54 61 return function (val, attr) { 55 let isNumber = Util_1.Util._isNumber(val);56 let isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements;62 const isNumber = Util_1.Util._isNumber(val); 63 const isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements; 57 64 if (!isNumber && !isValidArray) { 58 65 Util_1.Util.warn(_formatValue(val) + … … 67 74 } 68 75 } 69 exports.getNumberOrArrayOfNumbersValidator = getNumberOrArrayOfNumbersValidator;70 76 function getNumberOrAutoValidator() { 71 77 if (Global_1.Konva.isUnminified) { 72 78 return function (val, attr) { 73 varisNumber = Util_1.Util._isNumber(val);74 varisAuto = val === 'auto';79 const isNumber = Util_1.Util._isNumber(val); 80 const isAuto = val === 'auto'; 75 81 if (!(isNumber || isAuto)) { 76 82 Util_1.Util.warn(_formatValue(val) + … … 83 89 } 84 90 } 85 exports.getNumberOrAutoValidator = getNumberOrAutoValidator;86 91 function getStringValidator() { 87 92 if (Global_1.Konva.isUnminified) { … … 97 102 } 98 103 } 99 exports.getStringValidator = getStringValidator;100 104 function getStringOrGradientValidator() { 101 105 if (Global_1.Konva.isUnminified) { … … 114 118 } 115 119 } 116 exports.getStringOrGradientValidator = getStringOrGradientValidator;117 120 function getFunctionValidator() { 118 121 if (Global_1.Konva.isUnminified) { … … 128 131 } 129 132 } 130 exports.getFunctionValidator = getFunctionValidator;131 133 function getNumberArrayValidator() { 132 134 if (Global_1.Konva.isUnminified) { … … 157 159 } 158 160 } 159 exports.getNumberArrayValidator = getNumberArrayValidator;160 161 function getBooleanValidator() { 161 162 if (Global_1.Konva.isUnminified) { 162 163 return function (val, attr) { 163 varisBool = val === true || val === false;164 const isBool = val === true || val === false; 164 165 if (!isBool) { 165 166 Util_1.Util.warn(_formatValue(val) + … … 172 173 } 173 174 } 174 exports.getBooleanValidator = getBooleanValidator;175 175 function getComponentValidator(components) { 176 176 if (Global_1.Konva.isUnminified) { … … 190 190 } 191 191 } 192 exports.getComponentValidator = getComponentValidator; -
imaps-frontend/node_modules/konva/lib/_CoreInternals.d.ts
rd565449 r0c6b92a 49 49 _isFunction(obj: any): boolean; 50 50 _isPlainObject(obj: any): boolean; 51 _isArray(obj: any): obj is any[];51 _isArray(obj: any): obj is Array<any>; 52 52 _isNumber(obj: any): obj is number; 53 53 _isString(obj: any): obj is string; 54 54 _isBoolean(obj: any): obj is boolean; 55 isObject(val: any): val is Object;55 isObject(val: any): val is object; 56 56 isValidSelector(selector: any): boolean; 57 57 _sign(number: number): 1 | -1; … … 121 121 haveIntersection(r1: import("./types").IRect, r2: import("./types.js").IRect): boolean; 122 122 cloneObject<Any>(obj: Any): Any; 123 cloneArray(arr: any[]): any[];123 cloneArray(arr: Array<any>): any[]; 124 124 degToRad(deg: number): number; 125 125 radToDeg(rad: number): number; … … 131 131 error(str: string): void; 132 132 warn(str: string): void; 133 each(obj: Object, func: Function): void;133 each(obj: object, func: Function): void; 134 134 _inRange(val: number, left: number, right: number): boolean; 135 135 _getProjectionToSegment(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): any[]; 136 _getProjectionToLine(pt: import("./types").Vector2d, line: import("./types").Vector2d[], isClosed: boolean): import("./types.js").Vector2d;136 _getProjectionToLine(pt: import("./types").Vector2d, line: Array<import("./types").Vector2d>, isClosed: boolean): import("./types.js").Vector2d; 137 137 _prepareArrayForTween(startArray: any, endArray: any, isClosed: any): number[]; 138 138 _prepareToStringify<T>(obj: any): T | null; 139 _assign<T _1, U>(target: T_1, source: U): T_1& U;139 _assign<T, U>(target: T, source: U): T & U; 140 140 _getFirstPointerId(evt: any): any; 141 141 releaseCanvas(...canvases: HTMLCanvasElement[]): void; … … 155 155 readonly node: Node<import("./Node.js").NodeConfig> | undefined; 156 156 _dragElements: Map<number, { 157 node: Node <import("./Node.js").NodeConfig>;157 node: Node; 158 158 startPointerPos: import("./types.js").Vector2d; 159 159 offset: import("./types.js").Vector2d; 160 pointerId?: number | undefined;160 pointerId?: number; 161 161 dragStatus: "ready" | "dragging" | "stopped"; 162 162 }>; -
imaps-frontend/node_modules/konva/lib/_FullInternals.d.ts
rd565449 r0c6b92a 54 54 _isFunction(obj: any): boolean; 55 55 _isPlainObject(obj: any): boolean; 56 _isArray(obj: any): obj is any[];56 _isArray(obj: any): obj is Array<any>; 57 57 _isNumber(obj: any): obj is number; 58 58 _isString(obj: any): obj is string; 59 59 _isBoolean(obj: any): obj is boolean; 60 isObject(val: any): val is Object;60 isObject(val: any): val is object; 61 61 isValidSelector(selector: any): boolean; 62 62 _sign(number: number): 1 | -1; … … 126 126 haveIntersection(r1: import("./types").IRect, r2: import("./types.js").IRect): boolean; 127 127 cloneObject<Any>(obj: Any): Any; 128 cloneArray(arr: any[]): any[];128 cloneArray(arr: Array<any>): any[]; 129 129 degToRad(deg: number): number; 130 130 radToDeg(rad: number): number; … … 136 136 error(str: string): void; 137 137 warn(str: string): void; 138 each(obj: Object, func: Function): void;138 each(obj: object, func: Function): void; 139 139 _inRange(val: number, left: number, right: number): boolean; 140 140 _getProjectionToSegment(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): any[]; 141 _getProjectionToLine(pt: import("./types").Vector2d, line: import("./types").Vector2d[], isClosed: boolean): import("./types.js").Vector2d;141 _getProjectionToLine(pt: import("./types").Vector2d, line: Array<import("./types").Vector2d>, isClosed: boolean): import("./types.js").Vector2d; 142 142 _prepareArrayForTween(startArray: any, endArray: any, isClosed: any): number[]; 143 143 _prepareToStringify<T>(obj: any): T | null; 144 _assign<T _1, U>(target: T_1, source: U): T_1& U;144 _assign<T, U>(target: T, source: U): T & U; 145 145 _getFirstPointerId(evt: any): any; 146 146 releaseCanvas(...canvases: HTMLCanvasElement[]): void; … … 160 160 readonly node: import("./Node").Node<import("./Node.js").NodeConfig> | undefined; 161 161 _dragElements: Map<number, { 162 node: import("./Node ").Node<import("./Node.js").NodeConfig>;162 node: import("./Node.js").Node; 163 163 startPointerPos: import("./types.js").Vector2d; 164 164 offset: import("./types.js").Vector2d; 165 pointerId?: number | undefined;165 pointerId?: number; 166 166 dragStatus: "ready" | "dragging" | "stopped"; 167 167 }>; -
imaps-frontend/node_modules/konva/lib/filters/Blur.js
rd565449 r0c6b92a 12 12 this.next = null; 13 13 } 14 varmul_table = [14 const mul_table = [ 15 15 512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 16 16 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, … … 31 31 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259, 32 32 ]; 33 varshg_table = [33 const shg_table = [ 34 34 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 35 35 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, … … 48 48 ]; 49 49 function filterGaussBlurRGBA(imageData, radius) { 50 varpixels = imageData.data, width = imageData.width, height = imageData.height;51 varx, 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;52 vardiv = 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];50 const pixels = imageData.data, width = imageData.width, height = imageData.height; 51 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; 52 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]; 53 53 for (i = 1; i < div; i++) { 54 54 stack = stack.next = new BlurStack(); … … 230 230 } 231 231 const Blur = function Blur(imageData) { 232 varradius = Math.round(this.blurRadius());232 const radius = Math.round(this.blurRadius()); 233 233 if (radius > 0) { 234 234 filterGaussBlurRGBA(imageData, radius); -
imaps-frontend/node_modules/konva/lib/filters/Brighten.js
rd565449 r0c6b92a 6 6 const Validators_1 = require("../Validators"); 7 7 const Brighten = function (imageData) { 8 varbrightness = this.brightness() * 255, data = imageData.data, len = data.length, i;8 let brightness = this.brightness() * 255, data = imageData.data, len = data.length, i; 9 9 for (i = 0; i < len; i += 4) { 10 10 data[i] += brightness; -
imaps-frontend/node_modules/konva/lib/filters/Contrast.js
rd565449 r0c6b92a 6 6 const Validators_1 = require("../Validators"); 7 7 const Contrast = function (imageData) { 8 varadjust = Math.pow((this.contrast() + 100) / 100, 2);9 vardata = imageData.data, nPixels = data.length, red = 150, green = 150, blue = 150, i;8 const adjust = Math.pow((this.contrast() + 100) / 100, 2); 9 let data = imageData.data, nPixels = data.length, red = 150, green = 150, blue = 150, i; 10 10 for (i = 0; i < nPixels; i += 4) { 11 11 red = data[i]; -
imaps-frontend/node_modules/konva/lib/filters/Emboss.js
rd565449 r0c6b92a 7 7 const Validators_1 = require("../Validators"); 8 8 const Emboss = function (imageData) { 9 varstrength = 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;9 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; 10 10 switch (direction) { 11 11 case 'top-left': … … 45 45 } 46 46 do { 47 varoffsetY = (y - 1) * w4;48 varotherY = dirY;47 const offsetY = (y - 1) * w4; 48 let otherY = dirY; 49 49 if (y + otherY < 1) { 50 50 otherY = 0; … … 53 53 otherY = 0; 54 54 } 55 varoffsetYOther = (y - 1 + otherY) * w * 4;56 varx = w;55 const offsetYOther = (y - 1 + otherY) * w * 4; 56 let x = w; 57 57 do { 58 varoffset = offsetY + (x - 1) * 4;59 varotherX = dirX;58 const offset = offsetY + (x - 1) * 4; 59 let otherX = dirX; 60 60 if (x + otherX < 1) { 61 61 otherX = 0; … … 64 64 otherX = 0; 65 65 } 66 varoffsetOther = offsetYOther + (x - 1 + otherX) * 4;67 vardR = data[offset] - data[offsetOther];68 vardG = data[offset + 1] - data[offsetOther + 1];69 vardB = data[offset + 2] - data[offsetOther + 2];70 vardif = dR;71 varabsDif = dif > 0 ? dif : -dif;72 varabsG = dG > 0 ? dG : -dG;73 varabsB = dB > 0 ? dB : -dB;66 const offsetOther = offsetYOther + (x - 1 + otherX) * 4; 67 const dR = data[offset] - data[offsetOther]; 68 const dG = data[offset + 1] - data[offsetOther + 1]; 69 const dB = data[offset + 2] - data[offsetOther + 2]; 70 let dif = dR; 71 const absDif = dif > 0 ? dif : -dif; 72 const absG = dG > 0 ? dG : -dG; 73 const absB = dB > 0 ? dB : -dB; 74 74 if (absG > absDif) { 75 75 dif = dG; … … 80 80 dif *= strength; 81 81 if (blend) { 82 varr = data[offset] + dif;83 varg = data[offset + 1] + dif;84 varb = data[offset + 2] + dif;82 const r = data[offset] + dif; 83 const g = data[offset + 1] + dif; 84 const b = data[offset + 2] + dif; 85 85 data[offset] = r > 255 ? 255 : r < 0 ? 0 : r; 86 86 data[offset + 1] = g > 255 ? 255 : g < 0 ? 0 : g; … … 88 88 } 89 89 else { 90 vargrey = greyLevel - dif;90 let grey = greyLevel - dif; 91 91 if (grey < 0) { 92 92 grey = 0; -
imaps-frontend/node_modules/konva/lib/filters/Enhance.js
rd565449 r0c6b92a 6 6 const Validators_1 = require("../Validators"); 7 7 function remap(fromValue, fromMin, fromMax, toMin, toMax) { 8 varfromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;8 let fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue; 9 9 if (fromRange === 0) { 10 10 return toMin + toRange / 2; … … 18 18 } 19 19 const Enhance = function (imageData) { 20 vardata = imageData.data, nSubPixels = data.length, rMin = data[0], rMax = rMin, r, gMin = data[1], gMax = gMin, g, bMin = data[2], bMax = bMin, b, i;21 varenhanceAmount = this.enhance();20 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; 21 const enhanceAmount = this.enhance(); 22 22 if (enhanceAmount === 0) { 23 23 return; … … 58 58 bMin = 0; 59 59 } 60 varrMid, rGoalMax, rGoalMin, gMid, gGoalMax, gGoalMin, bMid, bGoalMax, bGoalMin;60 let rMid, rGoalMax, rGoalMin, gMid, gGoalMax, gGoalMin, bMid, bGoalMax, bGoalMin; 61 61 if (enhanceAmount > 0) { 62 62 rGoalMax = rMax + enhanceAmount * (255 - rMax); -
imaps-frontend/node_modules/konva/lib/filters/Grayscale.js
rd565449 r0c6b92a 3 3 exports.Grayscale = void 0; 4 4 const Grayscale = function (imageData) { 5 vardata = imageData.data, len = data.length, i, brightness;5 let data = imageData.data, len = data.length, i, brightness; 6 6 for (i = 0; i < len; i += 4) { 7 7 brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]; -
imaps-frontend/node_modules/konva/lib/filters/HSL.js
rd565449 r0c6b92a 9 9 Factory_1.Factory.addGetterSetter(Node_1.Node, 'luminance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter); 10 10 const HSL = function (imageData) { 11 vardata = 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;12 varvsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);13 varrr = 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;14 vargr = 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;15 varbr = 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;16 varr, g, b, a;11 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; 12 const vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180); 13 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; 14 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; 15 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; 16 let r, g, b, a; 17 17 for (i = 0; i < nPixels; i += 4) { 18 18 r = data[i + 0]; -
imaps-frontend/node_modules/konva/lib/filters/HSV.js
rd565449 r0c6b92a 6 6 const Validators_1 = require("../Validators"); 7 7 const HSV = function (imageData) { 8 var data = imageData.data, nPixels = data.length, v = Math.pow(2, this.value()), s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, i;9 varvsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);10 varrr = 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;11 vargr = 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;12 varbr = 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;13 varr, g, b, a;14 for ( i = 0; i < nPixels; i += 4) {8 const data = imageData.data, nPixels = data.length, v = Math.pow(2, this.value()), s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360; 9 const vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180); 10 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; 11 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; 12 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; 13 let r, g, b, a; 14 for (let i = 0; i < nPixels; i += 4) { 15 15 r = data[i + 0]; 16 16 g = data[i + 1]; -
imaps-frontend/node_modules/konva/lib/filters/Invert.js
rd565449 r0c6b92a 3 3 exports.Invert = void 0; 4 4 const Invert = function (imageData) { 5 vardata = imageData.data, len = data.length, i;5 let data = imageData.data, len = data.length, i; 6 6 for (i = 0; i < len; i += 4) { 7 7 data[i] = 255 - data[i]; -
imaps-frontend/node_modules/konva/lib/filters/Kaleidoscope.js
rd565449 r0c6b92a 6 6 const Util_1 = require("../Util"); 7 7 const Validators_1 = require("../Validators"); 8 varToPolar = function (src, dst, opt) {9 varsrcPixels = 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;10 varrad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);8 const ToPolar = function (src, dst, opt) { 9 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; 10 let rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid); 11 11 x = xSize - xMid; 12 12 y = ySize - yMid; 13 13 rad = Math.sqrt(x * x + y * y); 14 14 rMax = rad > rMax ? rad : rMax; 15 varrSize = ySize, tSize = xSize, radius, theta;16 varconversion = ((360 / tSize) * Math.PI) / 180, sin, cos;15 let rSize = ySize, tSize = xSize, radius, theta; 16 let conversion = ((360 / tSize) * Math.PI) / 180, sin, cos; 17 17 for (theta = 0; theta < tSize; theta += 1) { 18 18 sin = Math.sin(theta * conversion); … … 34 34 } 35 35 }; 36 varFromPolar = function (src, dst, opt) {37 varsrcPixels = 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;38 varrad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);36 const FromPolar = function (src, dst, opt) { 37 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; 38 let rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid); 39 39 x = xSize - xMid; 40 40 y = ySize - yMid; 41 41 rad = Math.sqrt(x * x + y * y); 42 42 rMax = rad > rMax ? rad : rMax; 43 varrSize = ySize, tSize = xSize, radius, theta, phaseShift = opt.polarRotation || 0;44 varx1, y1;43 let rSize = ySize, tSize = xSize, radius, theta, phaseShift = opt.polarRotation || 0; 44 let x1, y1; 45 45 for (x = 0; x < xSize; x += 1) { 46 46 for (y = 0; y < ySize; y += 1) { … … 66 66 }; 67 67 const Kaleidoscope = function (imageData) { 68 varxSize = imageData.width, ySize = imageData.height;69 varx, y, xoff, i, r, g, b, a, srcPos, dstPos;70 varpower = Math.round(this.kaleidoscopePower());71 varangle = Math.round(this.kaleidoscopeAngle());72 varoffset = Math.floor((xSize * (angle % 360)) / 360);68 const xSize = imageData.width, ySize = imageData.height; 69 let x, y, xoff, i, r, g, b, a, srcPos, dstPos; 70 let power = Math.round(this.kaleidoscopePower()); 71 const angle = Math.round(this.kaleidoscopeAngle()); 72 const offset = Math.floor((xSize * (angle % 360)) / 360); 73 73 if (power < 1) { 74 74 return; 75 75 } 76 vartempCanvas = Util_1.Util.createCanvasElement();76 const tempCanvas = Util_1.Util.createCanvasElement(); 77 77 tempCanvas.width = xSize; 78 78 tempCanvas.height = ySize; 79 varscratchData = tempCanvas79 const scratchData = tempCanvas 80 80 .getContext('2d') 81 81 .getImageData(0, 0, xSize, ySize); … … 85 85 polarCenterY: ySize / 2, 86 86 }); 87 varminSectionSize = xSize / Math.pow(2, power);87 let minSectionSize = xSize / Math.pow(2, power); 88 88 while (minSectionSize <= 8) { 89 89 minSectionSize = minSectionSize * 2; … … 91 91 } 92 92 minSectionSize = Math.ceil(minSectionSize); 93 varsectionSize = minSectionSize;94 varxStart = 0, xEnd = sectionSize, xDelta = 1;93 let sectionSize = minSectionSize; 94 let xStart = 0, xEnd = sectionSize, xDelta = 1; 95 95 if (offset + minSectionSize > xSize) { 96 96 xStart = sectionSize; -
imaps-frontend/node_modules/konva/lib/filters/Mask.js
rd565449 r0c6b92a 6 6 const Validators_1 = require("../Validators"); 7 7 function pixelAt(idata, x, y) { 8 varidx = (y * idata.width + x) * 4;9 vard = [];8 let idx = (y * idata.width + x) * 4; 9 const d = []; 10 10 d.push(idata.data[idx++], idata.data[idx++], idata.data[idx++], idata.data[idx++]); 11 11 return d; … … 17 17 } 18 18 function rgbMean(pTab) { 19 varm = [0, 0, 0];20 for ( vari = 0; i < pTab.length; i++) {19 const m = [0, 0, 0]; 20 for (let i = 0; i < pTab.length; i++) { 21 21 m[0] += pTab[i][0]; 22 22 m[1] += pTab[i][1]; … … 29 29 } 30 30 function backgroundMask(idata, threshold) { 31 varrgbv_no = pixelAt(idata, 0, 0);32 varrgbv_ne = pixelAt(idata, idata.width - 1, 0);33 varrgbv_so = pixelAt(idata, 0, idata.height - 1);34 varrgbv_se = pixelAt(idata, idata.width - 1, idata.height - 1);35 varthres = threshold || 10;31 const rgbv_no = pixelAt(idata, 0, 0); 32 const rgbv_ne = pixelAt(idata, idata.width - 1, 0); 33 const rgbv_so = pixelAt(idata, 0, idata.height - 1); 34 const rgbv_se = pixelAt(idata, idata.width - 1, idata.height - 1); 35 const thres = threshold || 10; 36 36 if (rgbDistance(rgbv_no, rgbv_ne) < thres && 37 37 rgbDistance(rgbv_ne, rgbv_se) < thres && 38 38 rgbDistance(rgbv_se, rgbv_so) < thres && 39 39 rgbDistance(rgbv_so, rgbv_no) < thres) { 40 varmean = rgbMean([rgbv_ne, rgbv_no, rgbv_se, rgbv_so]);41 varmask = [];42 for ( vari = 0; i < idata.width * idata.height; i++) {43 vard = rgbDistance(mean, [40 const mean = rgbMean([rgbv_ne, rgbv_no, rgbv_se, rgbv_so]); 41 const mask = []; 42 for (let i = 0; i < idata.width * idata.height; i++) { 43 const d = rgbDistance(mean, [ 44 44 idata.data[i * 4], 45 45 idata.data[i * 4 + 1], … … 52 52 } 53 53 function applyMask(idata, mask) { 54 for ( vari = 0; i < idata.width * idata.height; i++) {54 for (let i = 0; i < idata.width * idata.height; i++) { 55 55 idata.data[4 * i + 3] = mask[i]; 56 56 } 57 57 } 58 58 function erodeMask(mask, sw, sh) { 59 varweights = [1, 1, 1, 1, 0, 1, 1, 1, 1];60 varside = Math.round(Math.sqrt(weights.length));61 varhalfSide = Math.floor(side / 2);62 varmaskResult = [];63 for ( vary = 0; y < sh; y++) {64 for ( varx = 0; x < sw; x++) {65 varso = y * sw + x;66 vara = 0;67 for ( varcy = 0; cy < side; cy++) {68 for ( varcx = 0; cx < side; cx++) {69 varscy = y + cy - halfSide;70 varscx = x + cx - halfSide;59 const weights = [1, 1, 1, 1, 0, 1, 1, 1, 1]; 60 const side = Math.round(Math.sqrt(weights.length)); 61 const halfSide = Math.floor(side / 2); 62 const maskResult = []; 63 for (let y = 0; y < sh; y++) { 64 for (let x = 0; x < sw; x++) { 65 const so = y * sw + x; 66 let a = 0; 67 for (let cy = 0; cy < side; cy++) { 68 for (let cx = 0; cx < side; cx++) { 69 const scy = y + cy - halfSide; 70 const scx = x + cx - halfSide; 71 71 if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) { 72 varsrcOff = scy * sw + scx;73 varwt = weights[cy * side + cx];72 const srcOff = scy * sw + scx; 73 const wt = weights[cy * side + cx]; 74 74 a += mask[srcOff] * wt; 75 75 } … … 82 82 } 83 83 function dilateMask(mask, sw, sh) { 84 varweights = [1, 1, 1, 1, 1, 1, 1, 1, 1];85 varside = Math.round(Math.sqrt(weights.length));86 varhalfSide = Math.floor(side / 2);87 varmaskResult = [];88 for ( vary = 0; y < sh; y++) {89 for ( varx = 0; x < sw; x++) {90 varso = y * sw + x;91 vara = 0;92 for ( varcy = 0; cy < side; cy++) {93 for ( varcx = 0; cx < side; cx++) {94 varscy = y + cy - halfSide;95 varscx = x + cx - halfSide;84 const weights = [1, 1, 1, 1, 1, 1, 1, 1, 1]; 85 const side = Math.round(Math.sqrt(weights.length)); 86 const halfSide = Math.floor(side / 2); 87 const maskResult = []; 88 for (let y = 0; y < sh; y++) { 89 for (let x = 0; x < sw; x++) { 90 const so = y * sw + x; 91 let a = 0; 92 for (let cy = 0; cy < side; cy++) { 93 for (let cx = 0; cx < side; cx++) { 94 const scy = y + cy - halfSide; 95 const scx = x + cx - halfSide; 96 96 if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) { 97 varsrcOff = scy * sw + scx;98 varwt = weights[cy * side + cx];97 const srcOff = scy * sw + scx; 98 const wt = weights[cy * side + cx]; 99 99 a += mask[srcOff] * wt; 100 100 } … … 107 107 } 108 108 function smoothEdgeMask(mask, sw, sh) { 109 varweights = [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9];110 varside = Math.round(Math.sqrt(weights.length));111 varhalfSide = Math.floor(side / 2);112 varmaskResult = [];113 for ( vary = 0; y < sh; y++) {114 for ( varx = 0; x < sw; x++) {115 varso = y * sw + x;116 vara = 0;117 for ( varcy = 0; cy < side; cy++) {118 for ( varcx = 0; cx < side; cx++) {119 varscy = y + cy - halfSide;120 varscx = x + cx - halfSide;109 const weights = [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9]; 110 const side = Math.round(Math.sqrt(weights.length)); 111 const halfSide = Math.floor(side / 2); 112 const maskResult = []; 113 for (let y = 0; y < sh; y++) { 114 for (let x = 0; x < sw; x++) { 115 const so = y * sw + x; 116 let a = 0; 117 for (let cy = 0; cy < side; cy++) { 118 for (let cx = 0; cx < side; cx++) { 119 const scy = y + cy - halfSide; 120 const scx = x + cx - halfSide; 121 121 if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) { 122 varsrcOff = scy * sw + scx;123 varwt = weights[cy * side + cx];122 const srcOff = scy * sw + scx; 123 const wt = weights[cy * side + cx]; 124 124 a += mask[srcOff] * wt; 125 125 } … … 132 132 } 133 133 const Mask = function (imageData) { 134 varthreshold = this.threshold(), mask = backgroundMask(imageData, threshold);134 let threshold = this.threshold(), mask = backgroundMask(imageData, threshold); 135 135 if (mask) { 136 136 mask = erodeMask(mask, imageData.width, imageData.height); -
imaps-frontend/node_modules/konva/lib/filters/Noise.js
rd565449 r0c6b92a 6 6 const Validators_1 = require("../Validators"); 7 7 const Noise = function (imageData) { 8 var amount = this.noise() * 255, data = imageData.data, nPixels = data.length, half = amount / 2, i;9 for ( i = 0; i < nPixels; i += 4) {8 const amount = this.noise() * 255, data = imageData.data, nPixels = data.length, half = amount / 2; 9 for (let i = 0; i < nPixels; i += 4) { 10 10 data[i + 0] += half - 2 * half * Math.random(); 11 11 data[i + 1] += half - 2 * half * Math.random(); -
imaps-frontend/node_modules/konva/lib/filters/Pixelate.js
rd565449 r0c6b92a 7 7 const Validators_1 = require("../Validators"); 8 8 const Pixelate = function (imageData) { 9 varpixelSize = Math.ceil(this.pixelSize()), width = imageData.width, height = imageData.height, x, y, i, red, green, blue, alpha, nBinsX = Math.ceil(width / pixelSize), nBinsY = Math.ceil(height / pixelSize), xBinStart, xBinEnd, yBinStart, yBinEnd, xBin, yBin, pixelsInBin, data = imageData.data;9 let pixelSize = Math.ceil(this.pixelSize()), width = imageData.width, height = imageData.height, x, y, i, red, green, blue, alpha, nBinsX = Math.ceil(width / pixelSize), nBinsY = Math.ceil(height / pixelSize), xBinStart, xBinEnd, yBinStart, yBinEnd, xBin, yBin, pixelsInBin, data = imageData.data; 10 10 if (pixelSize <= 0) { 11 11 Util_1.Util.error('pixelSize value can not be <= 0'); -
imaps-frontend/node_modules/konva/lib/filters/Posterize.js
rd565449 r0c6b92a 6 6 const Validators_1 = require("../Validators"); 7 7 const Posterize = function (imageData) { 8 varlevels = Math.round(this.levels() * 254) + 1, data = imageData.data, len = data.length, scale = 255 / levels, i;8 let levels = Math.round(this.levels() * 254) + 1, data = imageData.data, len = data.length, scale = 255 / levels, i; 9 9 for (i = 0; i < len; i += 1) { 10 10 data[i] = Math.floor(data[i] / scale) * scale; -
imaps-frontend/node_modules/konva/lib/filters/RGB.js
rd565449 r0c6b92a 6 6 const Validators_1 = require("../Validators"); 7 7 const RGB = function (imageData) { 8 vardata = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), i, brightness;8 let data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), i, brightness; 9 9 for (i = 0; i < nPixels; i += 4) { 10 10 brightness = -
imaps-frontend/node_modules/konva/lib/filters/RGBA.js
rd565449 r0c6b92a 6 6 const Validators_1 = require("../Validators"); 7 7 const RGBA = function (imageData) { 8 var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), alpha = this.alpha(), i, ia;9 for ( i = 0; i < nPixels; i += 4) {10 ia = 1 - alpha;8 const data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), alpha = this.alpha(); 9 for (let i = 0; i < nPixels; i += 4) { 10 const ia = 1 - alpha; 11 11 data[i] = red * alpha + data[i] * ia; 12 12 data[i + 1] = green * alpha + data[i + 1] * ia; -
imaps-frontend/node_modules/konva/lib/filters/Sepia.js
rd565449 r0c6b92a 3 3 exports.Sepia = void 0; 4 4 const Sepia = function (imageData) { 5 vardata = imageData.data, nPixels = data.length, i, r, g, b;5 let data = imageData.data, nPixels = data.length, i, r, g, b; 6 6 for (i = 0; i < nPixels; i += 4) { 7 7 r = data[i + 0]; -
imaps-frontend/node_modules/konva/lib/filters/Solarize.js
rd565449 r0c6b92a 3 3 exports.Solarize = void 0; 4 4 const Solarize = function (imageData) { 5 var data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h; 5 const data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4; 6 let y = h; 6 7 do { 7 varoffsetY = (y - 1) * w4;8 varx = w;8 const offsetY = (y - 1) * w4; 9 let x = w; 9 10 do { 10 varoffset = offsetY + (x - 1) * 4;11 varr = data[offset];12 varg = data[offset + 1];13 varb = data[offset + 2];11 const offset = offsetY + (x - 1) * 4; 12 let r = data[offset]; 13 let g = data[offset + 1]; 14 let b = data[offset + 2]; 14 15 if (r > 127) { 15 16 r = 255 - r; -
imaps-frontend/node_modules/konva/lib/filters/Threshold.js
rd565449 r0c6b92a 6 6 const Validators_1 = require("../Validators"); 7 7 const Threshold = function (imageData) { 8 var level = this.threshold() * 255, data = imageData.data, len = data.length, i;9 for ( i = 0; i < len; i += 1) {8 const level = this.threshold() * 255, data = imageData.data, len = data.length; 9 for (let i = 0; i < len; i += 1) { 10 10 data[i] = data[i] < level ? 0 : 255; 11 11 } -
imaps-frontend/node_modules/konva/lib/shapes/Arc.js
rd565449 r0c6b92a 9 9 class Arc extends Shape_1.Shape { 10 10 _sceneFunc(context) { 11 varangle = Global_1.Konva.getAngle(this.angle()), clockwise = this.clockwise();11 const angle = Global_1.Konva.getAngle(this.angle()), clockwise = this.clockwise(); 12 12 context.beginPath(); 13 13 context.arc(0, 0, this.outerRadius(), 0, angle, clockwise); -
imaps-frontend/node_modules/konva/lib/shapes/Arrow.js
rd565449 r0c6b92a 10 10 _sceneFunc(ctx) { 11 11 super._sceneFunc(ctx); 12 varPI2 = Math.PI * 2;13 varpoints = this.points();14 vartp = points;15 varfromTension = this.tension() !== 0 && points.length > 4;12 const PI2 = Math.PI * 2; 13 const points = this.points(); 14 let tp = points; 15 const fromTension = this.tension() !== 0 && points.length > 4; 16 16 if (fromTension) { 17 17 tp = this.getTensionPoints(); 18 18 } 19 varlength = this.pointerLength();20 varn = points.length;21 vardx, dy;19 const length = this.pointerLength(); 20 const n = points.length; 21 let dx, dy; 22 22 if (fromTension) { 23 23 const lp = [ … … 38 38 dy = points[n - 1] - points[n - 3]; 39 39 } 40 varradians = (Math.atan2(dy, dx) + PI2) % PI2;41 varwidth = this.pointerWidth();40 const radians = (Math.atan2(dy, dx) + PI2) % PI2; 41 const width = this.pointerWidth(); 42 42 if (this.pointerAtEnding()) { 43 43 ctx.save(); … … 74 74 } 75 75 __fillStroke(ctx) { 76 varisDashEnabled = this.dashEnabled();76 const isDashEnabled = this.dashEnabled(); 77 77 if (isDashEnabled) { 78 78 this.attrs.dashEnabled = false; -
imaps-frontend/node_modules/konva/lib/shapes/Ellipse.js
rd565449 r0c6b92a 8 8 class Ellipse extends Shape_1.Shape { 9 9 _sceneFunc(context) { 10 varrx = this.radiusX(), ry = this.radiusY();10 const rx = this.radiusX(), ry = this.radiusY(); 11 11 context.beginPath(); 12 12 context.save(); -
imaps-frontend/node_modules/konva/lib/shapes/Image.js
rd565449 r0c6b92a 79 79 } 80 80 _hitFunc(context) { 81 varwidth = this.width(), height = this.height(), cornerRadius = this.cornerRadius();81 const width = this.width(), height = this.height(), cornerRadius = this.cornerRadius(); 82 82 context.beginPath(); 83 83 if (!cornerRadius) { … … 99 99 } 100 100 static fromURL(url, callback, onError = null) { 101 varimg = Util_1.Util.createImageElement();101 const img = Util_1.Util.createImageElement(); 102 102 img.onload = function () { 103 varimage = new Image({103 const image = new Image({ 104 104 image: img, 105 105 }); -
imaps-frontend/node_modules/konva/lib/shapes/Label.d.ts
rd565449 r0c6b92a 30 30 height: number; 31 31 }; 32 pointerDirection: GetSet<'left' | 'top' | 'right' | 'bottom' , this>;32 pointerDirection: GetSet<'left' | 'top' | 'right' | 'bottom' | 'up' | 'down', this>; 33 33 pointerWidth: GetSet<number, this>; 34 34 pointerHeight: GetSet<number, this>; -
imaps-frontend/node_modules/konva/lib/shapes/Label.js
rd565449 r0c6b92a 7 7 const Validators_1 = require("../Validators"); 8 8 const Global_1 = require("../Global"); 9 varATTR_CHANGE_LIST = [9 const ATTR_CHANGE_LIST = [ 10 10 'fontFamily', 11 11 'fontSize', … … 35 35 } 36 36 _addListeners(text) { 37 varthat = this, n;38 varfunc = function () {37 let that = this, n; 38 const func = function () { 39 39 that._sync(); 40 40 }; … … 50 50 } 51 51 _sync() { 52 vartext = this.getText(), tag = this.getTag(), width, height, pointerDirection, pointerWidth, x, y, pointerHeight;52 let text = this.getText(), tag = this.getTag(), width, height, pointerDirection, pointerWidth, x, y, pointerHeight; 53 53 if (text && tag) { 54 54 width = text.width(); … … 95 95 class Tag extends Shape_1.Shape { 96 96 _sceneFunc(context) { 97 varwidth = this.width(), height = this.height(), pointerDirection = this.pointerDirection(), pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), cornerRadius = this.cornerRadius();97 const width = this.width(), height = this.height(), pointerDirection = this.pointerDirection(), pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), cornerRadius = this.cornerRadius(); 98 98 let topLeft = 0; 99 99 let topRight = 0; … … 147 147 } 148 148 getSelfRect() { 149 varx = 0, y = 0, pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), direction = this.pointerDirection(), width = this.width(), height = this.height();149 let x = 0, y = 0, pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), direction = this.pointerDirection(), width = this.width(), height = this.height(); 150 150 if (direction === UP) { 151 151 y -= pointerHeight; -
imaps-frontend/node_modules/konva/lib/shapes/Line.d.ts
rd565449 r0c6b92a 1 1 import { Shape, ShapeConfig } from '../Shape.js'; 2 import { Context } from '../Context.js'; 2 3 import { GetSet } from '../types.js'; 3 import { Context } from '../Context.js';4 4 export interface LineConfig extends ShapeConfig { 5 5 points?: number[] | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; -
imaps-frontend/node_modules/konva/lib/shapes/Line.js
rd565449 r0c6b92a 3 3 exports.Line = void 0; 4 4 const Factory_1 = require("../Factory"); 5 const Global_1 = require("../Global"); 5 6 const Shape_1 = require("../Shape"); 6 7 const Validators_1 = require("../Validators"); 7 const Global_1 = require("../Global");8 8 function getControlPoints(x0, y0, x1, y1, x2, y2, t) { 9 vard01 = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2)), d12 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)), fa = (t * d01) / (d01 + d12), fb = (t * d12) / (d01 + d12), p1x = x1 - fa * (x2 - x0), p1y = y1 - fa * (y2 - y0), p2x = x1 + fb * (x2 - x0), p2y = y1 + fb * (y2 - y0);9 const d01 = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2)), d12 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)), fa = (t * d01) / (d01 + d12), fb = (t * d12) / (d01 + d12), p1x = x1 - fa * (x2 - x0), p1y = y1 - fa * (y2 - y0), p2x = x1 + fb * (x2 - x0), p2y = y1 + fb * (y2 - y0); 10 10 return [p1x, p1y, p2x, p2y]; 11 11 } 12 12 function expandPoints(p, tension) { 13 var len = p.length, allPoints = [], n, cp;14 for ( n = 2; n < len - 2; n += 2) {15 c p = getControlPoints(p[n - 2], p[n - 1], p[n], p[n + 1], p[n + 2], p[n + 3], tension);13 const len = p.length, allPoints = []; 14 for (let n = 2; n < len - 2; n += 2) { 15 const cp = getControlPoints(p[n - 2], p[n - 1], p[n], p[n + 1], p[n + 2], p[n + 3], tension); 16 16 if (isNaN(cp[0])) { 17 17 continue; … … 34 34 } 35 35 _sceneFunc(context) { 36 varpoints = this.points(), length = points.length, tension = this.tension(), closed = this.closed(), bezier = this.bezier(), tp, len, n;36 let points = this.points(), length = points.length, tension = this.tension(), closed = this.closed(), bezier = this.bezier(), tp, len, n; 37 37 if (!length) { 38 38 return; … … 85 85 } 86 86 _getTensionPointsClosed() { 87 varp = this.points(), len = p.length, tension = this.tension(), firstControlPoints = getControlPoints(p[len - 2], p[len - 1], p[0], p[1], p[2], p[3], tension), lastControlPoints = getControlPoints(p[len - 4], p[len - 3], p[len - 2], p[len - 1], p[0], p[1], tension), middle = expandPoints(p, tension), tp = [firstControlPoints[2], firstControlPoints[3]]87 const p = this.points(), len = p.length, tension = this.tension(), firstControlPoints = getControlPoints(p[len - 2], p[len - 1], p[0], p[1], p[2], p[3], tension), lastControlPoints = getControlPoints(p[len - 4], p[len - 3], p[len - 2], p[len - 1], p[0], p[1], tension), middle = expandPoints(p, tension), tp = [firstControlPoints[2], firstControlPoints[3]] 88 88 .concat(middle) 89 89 .concat([ … … 108 108 } 109 109 getSelfRect() { 110 varpoints = this.points();110 let points = this.points(); 111 111 if (points.length < 4) { 112 112 return { … … 129 129 points = this.points(); 130 130 } 131 varminX = points[0];132 varmaxX = points[0];133 varminY = points[1];134 varmaxY = points[1];135 varx, y;136 for ( vari = 0; i < points.length / 2; i++) {131 let minX = points[0]; 132 let maxX = points[0]; 133 let minY = points[1]; 134 let maxY = points[1]; 135 let x, y; 136 for (let i = 0; i < points.length / 2; i++) { 137 137 x = points[i * 2]; 138 138 y = points[i * 2 + 1]; -
imaps-frontend/node_modules/konva/lib/shapes/Path.d.ts
rd565449 r0c6b92a 18 18 getLength(): number; 19 19 getPointAtLength(length: any): { 20 x: any;21 y: any;20 x: number; 21 y: number; 22 22 } | null; 23 23 data: GetSet<string, this>; 24 24 static getLineLength(x1: any, y1: any, x2: any, y2: any): number; 25 25 static getPathLength(dataArray: PathSegment[]): number; 26 static getPointAtLengthOfDataArray(length: number, dataArray: any): {27 x: any;28 y: any;26 static getPointAtLengthOfDataArray(length: number, dataArray: PathSegment[]): { 27 x: number; 28 y: number; 29 29 } | null; 30 static getPointOnLine(dist: any, P1x: any, P1y: any, P2x: any, P2y: any, fromX?: any, fromY?: any): {31 x: any;32 y: any;30 static getPointOnLine(dist: number, P1x: number, P1y: number, P2x: number, P2y: number, fromX?: number, fromY?: number): { 31 x: number; 32 y: number; 33 33 }; 34 34 static getPointOnCubicBezier(pct: any, P1x: any, P1y: any, P2x: any, P2y: any, P3x: any, P3y: any, P4x: any, P4y: any): { -
imaps-frontend/node_modules/konva/lib/shapes/Path.js
rd565449 r0c6b92a 21 21 } 22 22 _sceneFunc(context) { 23 varca = this.dataArray;23 const ca = this.dataArray; 24 24 context.beginPath(); 25 varisClosed = false;26 for ( varn = 0; n < ca.length; n++) {27 varc = ca[n].command;28 varp = ca[n].points;25 let isClosed = false; 26 for (let n = 0; n < ca.length; n++) { 27 const c = ca[n].command; 28 const p = ca[n].points; 29 29 switch (c) { 30 30 case 'L': … … 67 67 } 68 68 getSelfRect() { 69 varpoints = [];69 let points = []; 70 70 this.dataArray.forEach(function (data) { 71 71 if (data.command === 'A') { 72 varstart = data.points[4];73 vardTheta = data.points[5];74 varend = data.points[4] + dTheta;75 varinc = Math.PI / 180.0;72 const start = data.points[4]; 73 const dTheta = data.points[5]; 74 const end = data.points[4] + dTheta; 75 let inc = Math.PI / 180.0; 76 76 if (Math.abs(start - end) < inc) { 77 77 inc = Math.abs(start - end); … … 100 100 } 101 101 }); 102 varminX = points[0];103 varmaxX = points[0];104 varminY = points[1];105 varmaxY = points[1];106 varx, y;107 for ( vari = 0; i < points.length / 2; i++) {102 let minX = points[0]; 103 let maxX = points[0]; 104 let minY = points[1]; 105 let maxY = points[1]; 106 let x, y; 107 for (let i = 0; i < points.length / 2; i++) { 108 108 x = points[i * 2]; 109 109 y = points[i * 2 + 1]; … … 135 135 static getPathLength(dataArray) { 136 136 let pathLength = 0; 137 for ( vari = 0; i < dataArray.length; ++i) {137 for (let i = 0; i < dataArray.length; ++i) { 138 138 pathLength += dataArray[i].pathLength; 139 139 } … … 141 141 } 142 142 static getPointAtLengthOfDataArray(length, dataArray) { 143 var point, i = 0, ii = dataArray.length;143 let points, i = 0, ii = dataArray.length; 144 144 if (!ii) { 145 145 return null; … … 150 150 } 151 151 if (i === ii) { 152 point = dataArray[i - 1].points.slice(-2);152 points = dataArray[i - 1].points.slice(-2); 153 153 return { 154 x: point [0],155 y: point [1],154 x: points[0], 155 y: points[1], 156 156 }; 157 157 } 158 158 if (length < 0.01) { 159 point = dataArray[i].points.slice(0, 2);159 points = dataArray[i].points.slice(0, 2); 160 160 return { 161 x: point [0],162 y: point [1],161 x: points[0], 162 y: points[1], 163 163 }; 164 164 } 165 varcp = dataArray[i];166 varp = cp.points;165 const cp = dataArray[i]; 166 const p = cp.points; 167 167 switch (cp.command) { 168 168 case 'L': … … 221 221 return (1 - t) * (1 - t) * (1 - t); 222 222 } 223 varx = P4x * CB1(pct) + P3x * CB2(pct) + P2x * CB3(pct) + P1x * CB4(pct);224 vary = P4y * CB1(pct) + P3y * CB2(pct) + P2y * CB3(pct) + P1y * CB4(pct);223 const x = P4x * CB1(pct) + P3x * CB2(pct) + P2x * CB3(pct) + P1x * CB4(pct); 224 const y = P4y * CB1(pct) + P3y * CB2(pct) + P2y * CB3(pct) + P1y * CB4(pct); 225 225 return { 226 226 x: x, … … 238 238 return (1 - t) * (1 - t); 239 239 } 240 varx = P3x * QB1(pct) + P2x * QB2(pct) + P1x * QB3(pct);241 vary = P3y * QB1(pct) + P2y * QB2(pct) + P1y * QB3(pct);240 const x = P3x * QB1(pct) + P2x * QB2(pct) + P1x * QB3(pct); 241 const y = P3y * QB1(pct) + P2y * QB2(pct) + P1y * QB3(pct); 242 242 return { 243 243 x: x, … … 246 246 } 247 247 static getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) { 248 varcosPsi = Math.cos(psi), sinPsi = Math.sin(psi);249 varpt = {248 const cosPsi = Math.cos(psi), sinPsi = Math.sin(psi); 249 const pt = { 250 250 x: rx * Math.cos(theta), 251 251 y: ry * Math.sin(theta), … … 260 260 return []; 261 261 } 262 varcs = data;263 varcc = [262 let cs = data; 263 const cc = [ 264 264 'm', 265 265 'M', … … 287 287 cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); 288 288 } 289 vararr = cs.split('|');290 varca = [];291 varcoords = [];292 varcpx = 0;293 varcpy = 0;294 varre = /([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;295 varmatch;289 const arr = cs.split('|'); 290 const ca = []; 291 const coords = []; 292 let cpx = 0; 293 let cpy = 0; 294 const re = /([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi; 295 let match; 296 296 for (n = 1; n < arr.length; n++) { 297 varstr = arr[n];298 varc = str.charAt(0);297 let str = arr[n]; 298 let c = str.charAt(0); 299 299 str = str.slice(1); 300 300 coords.length = 0; … … 302 302 coords.push(match[0]); 303 303 } 304 varp = [];305 for ( varj = 0, jlen = coords.length; j < jlen; j++) {304 const p = []; 305 for (let j = 0, jlen = coords.length; j < jlen; j++) { 306 306 if (coords[j] === '00') { 307 307 p.push(0, 0); 308 308 continue; 309 309 } 310 varparsed = parseFloat(coords[j]);310 const parsed = parseFloat(coords[j]); 311 311 if (!isNaN(parsed)) { 312 312 p.push(parsed); … … 320 320 break; 321 321 } 322 varcmd = '';323 varpoints = [];324 varstartX = cpx, startY = cpy;322 let cmd = ''; 323 let points = []; 324 const startX = cpx, startY = cpy; 325 325 var prevCmd, ctlPtx, ctlPty; 326 326 var rx, ry, psi, fa, fs, x1, y1; … … 344 344 cmd = 'M'; 345 345 if (ca.length > 2 && ca[ca.length - 1].command === 'z') { 346 for ( varidx = ca.length - 2; idx >= 0; idx--) {346 for (let idx = ca.length - 2; idx >= 0; idx--) { 347 347 if (ca[idx].command === 'M') { 348 348 cpx = ca[idx].points[0] + dx; … … 511 511 } 512 512 static calcLength(x, y, cmd, points) { 513 varlen, p1, p2, t;514 varpath = Path;513 let len, p1, p2, t; 514 const path = Path; 515 515 switch (cmd) { 516 516 case 'L': … … 551 551 } 552 552 static convertEndpointToCenterParameterization(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) { 553 varpsi = psiDeg * (Math.PI / 180.0);554 varxp = (Math.cos(psi) * (x1 - x2)) / 2.0 + (Math.sin(psi) * (y1 - y2)) / 2.0;555 varyp = (-1 * Math.sin(psi) * (x1 - x2)) / 2.0 +553 const psi = psiDeg * (Math.PI / 180.0); 554 const xp = (Math.cos(psi) * (x1 - x2)) / 2.0 + (Math.sin(psi) * (y1 - y2)) / 2.0; 555 const yp = (-1 * Math.sin(psi) * (x1 - x2)) / 2.0 + 556 556 (Math.cos(psi) * (y1 - y2)) / 2.0; 557 varlambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);557 const lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry); 558 558 if (lambda > 1) { 559 559 rx *= Math.sqrt(lambda); 560 560 ry *= Math.sqrt(lambda); 561 561 } 562 varf = Math.sqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) /562 let f = Math.sqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) / 563 563 (rx * rx * (yp * yp) + ry * ry * (xp * xp))); 564 564 if (fa === fs) { … … 568 568 f = 0; 569 569 } 570 varcxp = (f * rx * yp) / ry;571 varcyp = (f * -ry * xp) / rx;572 varcx = (x1 + x2) / 2.0 + Math.cos(psi) * cxp - Math.sin(psi) * cyp;573 varcy = (y1 + y2) / 2.0 + Math.sin(psi) * cxp + Math.cos(psi) * cyp;574 varvMag = function (v) {570 const cxp = (f * rx * yp) / ry; 571 const cyp = (f * -ry * xp) / rx; 572 const cx = (x1 + x2) / 2.0 + Math.cos(psi) * cxp - Math.sin(psi) * cyp; 573 const cy = (y1 + y2) / 2.0 + Math.sin(psi) * cxp + Math.cos(psi) * cyp; 574 const vMag = function (v) { 575 575 return Math.sqrt(v[0] * v[0] + v[1] * v[1]); 576 576 }; 577 varvRatio = function (u, v) {577 const vRatio = function (u, v) { 578 578 return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); 579 579 }; 580 varvAngle = function (u, v) {580 const vAngle = function (u, v) { 581 581 return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v)); 582 582 }; 583 vartheta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);584 varu = [(xp - cxp) / rx, (yp - cyp) / ry];585 varv = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];586 vardTheta = vAngle(u, v);583 const theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]); 584 const u = [(xp - cxp) / rx, (yp - cyp) / ry]; 585 const v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry]; 586 let dTheta = vAngle(u, v); 587 587 if (vRatio(u, v) <= -1) { 588 588 dTheta = Math.PI; -
imaps-frontend/node_modules/konva/lib/shapes/Rect.js
rd565449 r0c6b92a 9 9 class Rect extends Shape_1.Shape { 10 10 _sceneFunc(context) { 11 varcornerRadius = this.cornerRadius(), width = this.width(), height = this.height();11 const cornerRadius = this.cornerRadius(), width = this.width(), height = this.height(); 12 12 context.beginPath(); 13 13 if (!cornerRadius) { -
imaps-frontend/node_modules/konva/lib/shapes/RegularPolygon.js
rd565449 r0c6b92a 11 11 context.beginPath(); 12 12 context.moveTo(points[0].x, points[0].y); 13 for ( varn = 1; n < points.length; n++) {13 for (let n = 1; n < points.length; n++) { 14 14 context.lineTo(points[n].x, points[n].y); 15 15 } … … 21 21 const radius = this.attrs.radius || 0; 22 22 const points = []; 23 for ( varn = 0; n < sides; n++) {23 for (let n = 0; n < sides; n++) { 24 24 points.push({ 25 25 x: radius * Math.sin((n * 2 * Math.PI) / sides), … … 31 31 getSelfRect() { 32 32 const points = this._getPoints(); 33 varminX = points[0].x;34 varmaxX = points[0].y;35 varminY = points[0].x;36 varmaxY = points[0].y;33 let minX = points[0].x; 34 let maxX = points[0].y; 35 let minY = points[0].x; 36 let maxY = points[0].y; 37 37 points.forEach((point) => { 38 38 minX = Math.min(minX, point.x); -
imaps-frontend/node_modules/konva/lib/shapes/Ring.js
rd565449 r0c6b92a 6 6 const Validators_1 = require("../Validators"); 7 7 const Global_1 = require("../Global"); 8 varPIx2 = Math.PI * 2;8 const PIx2 = Math.PI * 2; 9 9 class Ring extends Shape_1.Shape { 10 10 _sceneFunc(context) { -
imaps-frontend/node_modules/konva/lib/shapes/Sprite.js
rd565449 r0c6b92a 12 12 this._updated = true; 13 13 this.anim = new Animation_1.Animation(() => { 14 varupdated = this._updated;14 const updated = this._updated; 15 15 this._updated = false; 16 16 return updated; … … 31 31 } 32 32 _sceneFunc(context) { 33 varanim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), x = set[ix4 + 0], y = set[ix4 + 1], width = set[ix4 + 2], height = set[ix4 + 3], image = this.image();33 const anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), x = set[ix4 + 0], y = set[ix4 + 1], width = set[ix4 + 2], height = set[ix4 + 3], image = this.image(); 34 34 if (this.hasFill() || this.hasStroke()) { 35 35 context.beginPath(); … … 40 40 if (image) { 41 41 if (offsets) { 42 varoffset = offsets[anim], ix2 = index * 2;42 const offset = offsets[anim], ix2 = index * 2; 43 43 context.drawImage(image, x, y, width, height, offset[ix2 + 0], offset[ix2 + 1], width, height); 44 44 } … … 49 49 } 50 50 _hitFunc(context) { 51 varanim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), width = set[ix4 + 2], height = set[ix4 + 3];51 const anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), width = set[ix4 + 2], height = set[ix4 + 3]; 52 52 context.beginPath(); 53 53 if (offsets) { 54 varoffset = offsets[anim];55 varix2 = index * 2;54 const offset = offsets[anim]; 55 const ix2 = index * 2; 56 56 context.rect(offset[ix2 + 0], offset[ix2 + 1], width, height); 57 57 } … … 66 66 } 67 67 _setInterval() { 68 varthat = this;68 const that = this; 69 69 this.interval = setInterval(function () { 70 70 that._updateIndex(); … … 75 75 return; 76 76 } 77 varlayer = this.getLayer();77 const layer = this.getLayer(); 78 78 this.anim.setLayers(layer); 79 79 this._setInterval(); … … 88 88 } 89 89 _updateIndex() { 90 varindex = this.frameIndex(), animation = this.animation(), animations = this.animations(), anim = animations[animation], len = anim.length / 4;90 const index = this.frameIndex(), animation = this.animation(), animations = this.animations(), anim = animations[animation], len = anim.length / 4; 91 91 if (index < len - 1) { 92 92 this.frameIndex(index + 1); -
imaps-frontend/node_modules/konva/lib/shapes/Star.js
rd565449 r0c6b92a 8 8 class Star extends Shape_1.Shape { 9 9 _sceneFunc(context) { 10 varinnerRadius = this.innerRadius(), outerRadius = this.outerRadius(), numPoints = this.numPoints();10 const innerRadius = this.innerRadius(), outerRadius = this.outerRadius(), numPoints = this.numPoints(); 11 11 context.beginPath(); 12 12 context.moveTo(0, 0 - outerRadius); 13 for ( varn = 1; n < numPoints * 2; n++) {14 varradius = n % 2 === 0 ? outerRadius : innerRadius;15 varx = radius * Math.sin((n * Math.PI) / numPoints);16 vary = -1 * radius * Math.cos((n * Math.PI) / numPoints);13 for (let n = 1; n < numPoints * 2; n++) { 14 const radius = n % 2 === 0 ? outerRadius : innerRadius; 15 const x = radius * Math.sin((n * Math.PI) / numPoints); 16 const y = -1 * radius * Math.cos((n * Math.PI) / numPoints); 17 17 context.lineTo(x, y); 18 18 } -
imaps-frontend/node_modules/konva/lib/shapes/Text.d.ts
rd565449 r0c6b92a 38 38 getTextWidth(): number; 39 39 getTextHeight(): number; 40 measureSize(text: any): {41 actualBoundingBoxAscent: any;42 actualBoundingBoxDescent: any;43 actualBoundingBoxLeft: any;44 actualBoundingBoxRight: any;45 alphabeticBaseline: any;46 emHeightAscent: any;47 emHeightDescent: any;48 fontBoundingBoxAscent: any;49 fontBoundingBoxDescent: any;50 hangingBaseline: any;51 ideographicBaseline: any;52 width: any;40 measureSize(text: string): { 41 actualBoundingBoxAscent: number; 42 actualBoundingBoxDescent: number; 43 actualBoundingBoxLeft: number; 44 actualBoundingBoxRight: number; 45 alphabeticBaseline: number; 46 emHeightAscent: number; 47 emHeightDescent: number; 48 fontBoundingBoxAscent: number; 49 fontBoundingBoxDescent: number; 50 hangingBaseline: number; 51 ideographicBaseline: number; 52 width: number; 53 53 height: number; 54 54 }; -
imaps-frontend/node_modules/konva/lib/shapes/Text.js
rd565449 r0c6b92a 1 1 "use strict"; 2 2 Object.defineProperty(exports, "__esModule", { value: true }); 3 exports.Text = exports.stringToArray = void 0; 3 exports.Text = void 0; 4 exports.stringToArray = stringToArray; 4 5 const Util_1 = require("../Util"); 5 6 const Factory_1 = require("../Factory"); … … 9 10 const Global_2 = require("../Global"); 10 11 function stringToArray(string) { 11 return Array.from(string); 12 } 13 exports.stringToArray = stringToArray; 14 var AUTO = 'auto', CENTER = 'center', INHERIT = 'inherit', JUSTIFY = 'justify', CHANGE_KONVA = 'Change.konva', CONTEXT_2D = '2d', DASH = '-', LEFT = 'left', LTR = 'ltr', TEXT = 'text', TEXT_UPPER = 'Text', TOP = 'top', BOTTOM = 'bottom', MIDDLE = 'middle', NORMAL = 'normal', PX_SPACE = 'px ', SPACE = ' ', RIGHT = 'right', RTL = 'rtl', WORD = 'word', CHAR = 'char', NONE = 'none', ELLIPSIS = '…', ATTR_CHANGE_LIST = [ 12 return [...string].reduce((acc, char, index, array) => { 13 if (/\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?(?:\u200D\p{Emoji_Presentation})+/u.test(char)) { 14 acc.push(char); 15 } 16 else if (/\p{Regional_Indicator}{2}/u.test(char + (array[index + 1] || ''))) { 17 acc.push(char + array[index + 1]); 18 } 19 else if (index > 0 && /\p{Mn}|\p{Me}|\p{Mc}/u.test(char)) { 20 acc[acc.length - 1] += char; 21 } 22 else { 23 acc.push(char); 24 } 25 return acc; 26 }, []); 27 } 28 const AUTO = 'auto', CENTER = 'center', INHERIT = 'inherit', JUSTIFY = 'justify', CHANGE_KONVA = 'Change.konva', CONTEXT_2D = '2d', DASH = '-', LEFT = 'left', TEXT = 'text', TEXT_UPPER = 'Text', TOP = 'top', BOTTOM = 'bottom', MIDDLE = 'middle', NORMAL = 'normal', PX_SPACE = 'px ', SPACE = ' ', RIGHT = 'right', RTL = 'rtl', WORD = 'word', CHAR = 'char', NONE = 'none', ELLIPSIS = '…', ATTR_CHANGE_LIST = [ 15 29 'direction', 16 30 'fontFamily', … … 43 57 .join(', '); 44 58 } 45 vardummyContext;59 let dummyContext; 46 60 function getDummyContext() { 47 61 if (dummyContext) { … … 72 86 this._partialTextX = 0; 73 87 this._partialTextY = 0; 74 for ( varn = 0; n < attrChangeListLen; n++) {88 for (let n = 0; n < attrChangeListLen; n++) { 75 89 this.on(ATTR_CHANGE_LIST[n] + CHANGE_KONVA, this._setTextData); 76 90 } … … 78 92 } 79 93 _sceneFunc(context) { 80 vartextArr = this.textArr, textArrLen = textArr.length;94 const textArr = this.textArr, textArrLen = textArr.length; 81 95 if (!this.text()) { 82 96 return; 83 97 } 84 varpadding = this.padding(), fontSize = this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, verticalAlign = this.verticalAlign(), direction = this.direction(), alignY = 0, align = this.align(), totalWidth = this.getWidth(), letterSpacing = this.letterSpacing(), fill = this.fill(), textDecoration = this.textDecoration(), shouldUnderline = textDecoration.indexOf('underline') !== -1, shouldLineThrough = textDecoration.indexOf('line-through') !== -1, n;98 let padding = this.padding(), fontSize = this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, verticalAlign = this.verticalAlign(), direction = this.direction(), alignY = 0, align = this.align(), totalWidth = this.getWidth(), letterSpacing = this.letterSpacing(), fill = this.fill(), textDecoration = this.textDecoration(), shouldUnderline = textDecoration.indexOf('underline') !== -1, shouldLineThrough = textDecoration.indexOf('line-through') !== -1, n; 85 99 direction = direction === INHERIT ? context.direction : direction; 86 vartranslateY = lineHeightPx / 2;87 varbaseline = MIDDLE;100 let translateY = lineHeightPx / 2; 101 let baseline = MIDDLE; 88 102 if (Global_1.Konva._fixTextRendering) { 89 varmetrics = this.measureSize('M');103 const metrics = this.measureSize('M'); 90 104 baseline = 'alphabetic'; 91 105 translateY = … … 122 136 context.save(); 123 137 context.beginPath(); 124 let yOffset = Global_1.Konva._fixTextRendering138 const yOffset = Global_1.Konva._fixTextRendering 125 139 ? Math.round(fontSize / 4) 126 140 : Math.round(fontSize / 2); … … 142 156 context.save(); 143 157 context.beginPath(); 144 let yOffset = Global_1.Konva._fixTextRendering ? -Math.round(fontSize / 4) : 0;158 const yOffset = Global_1.Konva._fixTextRendering ? -Math.round(fontSize / 4) : 0; 145 159 context.moveTo(lineTranslateX, translateY + lineTranslateY + yOffset); 146 160 spacesNumber = text.split(' ').length - 1; … … 159 173 if (direction !== RTL && (letterSpacing !== 0 || align === JUSTIFY)) { 160 174 spacesNumber = text.split(' ').length - 1; 161 vararray = stringToArray(text);162 for ( varli = 0; li < array.length; li++) {163 varletter = array[li];175 const array = stringToArray(text); 176 for (let li = 0; li < array.length; li++) { 177 const letter = array[li]; 164 178 if (letter === ' ' && !lastLine && align === JUSTIFY) { 165 179 lineTranslateX += (totalWidth - padding * 2 - width) / spacesNumber; … … 188 202 } 189 203 _hitFunc(context) { 190 varwidth = this.getWidth(), height = this.getHeight();204 const width = this.getWidth(), height = this.getHeight(); 191 205 context.beginPath(); 192 206 context.rect(0, 0, width, height); … … 195 209 } 196 210 setText(text) { 197 varstr = Util_1.Util._isString(text)211 const str = Util_1.Util._isString(text) 198 212 ? text 199 213 : text === null || text === undefined … … 204 218 } 205 219 getWidth() { 206 varisAuto = this.attrs.width === AUTO || this.attrs.width === undefined;220 const isAuto = this.attrs.width === AUTO || this.attrs.width === undefined; 207 221 return isAuto ? this.getTextWidth() + this.padding() * 2 : this.attrs.width; 208 222 } 209 223 getHeight() { 210 varisAuto = this.attrs.height === AUTO || this.attrs.height === undefined;224 const isAuto = this.attrs.height === AUTO || this.attrs.height === undefined; 211 225 return isAuto 212 226 ? this.fontSize() * this.textArr.length * this.lineHeight() + … … 223 237 measureSize(text) { 224 238 var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; 225 var_context = getDummyContext(), fontSize = this.fontSize(), metrics;239 let _context = getDummyContext(), fontSize = this.fontSize(), metrics; 226 240 _context.save(); 227 241 _context.font = this._getContextFont(); … … 258 272 line = line.trim(); 259 273 } 260 varwidth = this._getTextWidth(line);274 const width = this._getTextWidth(line); 261 275 return this.textArr.push({ 262 276 text: line, … … 266 280 } 267 281 _getTextWidth(text) { 268 varletterSpacing = this.letterSpacing();269 varlength = text.length;282 const letterSpacing = this.letterSpacing(); 283 const length = text.length; 270 284 return (getDummyContext().measureText(text).width + 271 285 (length ? letterSpacing * (length - 1) : 0)); 272 286 } 273 287 _setTextData() { 274 varlines = 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();288 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(); 275 289 this.textArr = []; 276 290 getDummyContext().font = this._getContextFont(); 277 varadditionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0;278 for ( vari = 0, max = lines.length; i < max; ++i) {279 varline = lines[i];280 varlineWidth = this._getTextWidth(line);291 const additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0; 292 for (let i = 0, max = lines.length; i < max; ++i) { 293 let line = lines[i]; 294 let lineWidth = this._getTextWidth(line); 281 295 if (fixedWidth && lineWidth > maxWidth) { 282 296 while (line.length > 0) { 283 varlow = 0, high = line.length, match = '', matchWidth = 0;297 let low = 0, high = line.length, match = '', matchWidth = 0; 284 298 while (low < high) { 285 varmid = (low + high) >>> 1, substr = line.slice(0, mid + 1), substrWidth = this._getTextWidth(substr) + additionalWidth;299 const mid = (low + high) >>> 1, substr = line.slice(0, mid + 1), substrWidth = this._getTextWidth(substr) + additionalWidth; 286 300 if (substrWidth <= maxWidth) { 287 301 low = mid + 1; … … 296 310 if (wrapAtWord) { 297 311 var wrapIndex; 298 varnextChar = line[match.length];299 varnextIsSpaceOrDash = nextChar === SPACE || nextChar === DASH;312 const nextChar = line[match.length]; 313 const nextIsSpaceOrDash = nextChar === SPACE || nextChar === DASH; 300 314 if (nextIsSpaceOrDash && matchWidth <= maxWidth) { 301 315 wrapIndex = match.length; … … 316 330 textWidth = Math.max(textWidth, matchWidth); 317 331 currentHeightPx += lineHeightPx; 318 varshouldHandleEllipsis = this._shouldHandleEllipsis(currentHeightPx);332 const shouldHandleEllipsis = this._shouldHandleEllipsis(currentHeightPx); 319 333 if (shouldHandleEllipsis) { 320 334 this._tryToAddEllipsisToLastLine(); … … 357 371 } 358 372 _shouldHandleEllipsis(currentHeightPx) { 359 varfontSize = +this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, height = this.attrs.height, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxHeightPx = height - padding * 2, wrap = this.wrap(), shouldWrap = wrap !== NONE;373 const fontSize = +this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, height = this.attrs.height, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxHeightPx = height - padding * 2, wrap = this.wrap(), shouldWrap = wrap !== NONE; 360 374 return (!shouldWrap || 361 375 (fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx)); 362 376 } 363 377 _tryToAddEllipsisToLastLine() { 364 varwidth = this.attrs.width, fixedWidth = width !== AUTO && width !== undefined, padding = this.padding(), maxWidth = width - padding * 2, shouldAddEllipsis = this.ellipsis();365 varlastLine = this.textArr[this.textArr.length - 1];378 const width = this.attrs.width, fixedWidth = width !== AUTO && width !== undefined, padding = this.padding(), maxWidth = width - padding * 2, shouldAddEllipsis = this.ellipsis(); 379 const lastLine = this.textArr[this.textArr.length - 1]; 366 380 if (!lastLine || !shouldAddEllipsis) { 367 381 return; 368 382 } 369 383 if (fixedWidth) { 370 varhaveSpace = this._getTextWidth(lastLine.text + ELLIPSIS) < maxWidth;384 const haveSpace = this._getTextWidth(lastLine.text + ELLIPSIS) < maxWidth; 371 385 if (!haveSpace) { 372 386 lastLine.text = lastLine.text.slice(0, lastLine.text.length - 3); -
imaps-frontend/node_modules/konva/lib/shapes/TextPath.d.ts
rd565449 r0c6b92a 29 29 _getTextPathLength(): number; 30 30 _getPointAtLength(length: number): { 31 x: any;32 y: any;31 x: number; 32 y: number; 33 33 } | null; 34 34 _readDataAttribute(): void; -
imaps-frontend/node_modules/konva/lib/shapes/TextPath.js
rd565449 r0c6b92a 9 9 const Validators_1 = require("../Validators"); 10 10 const Global_1 = require("../Global"); 11 varEMPTY_STRING = '', NORMAL = 'normal';11 const EMPTY_STRING = '', NORMAL = 'normal'; 12 12 function _fillFunc(context) { 13 13 context.fillText(this.partialText, 0, 0); … … 51 51 context.setAttr('textAlign', 'left'); 52 52 context.save(); 53 vartextDecoration = this.textDecoration();54 varfill = this.fill();55 varfontSize = this.fontSize();56 varglyphInfo = this.glyphInfo;53 const textDecoration = this.textDecoration(); 54 const fill = this.fill(); 55 const fontSize = this.fontSize(); 56 const glyphInfo = this.glyphInfo; 57 57 if (textDecoration === 'underline') { 58 58 context.beginPath(); 59 59 } 60 for ( vari = 0; i < glyphInfo.length; i++) {60 for (let i = 0; i < glyphInfo.length; i++) { 61 61 context.save(); 62 varp0 = glyphInfo[i].p0;62 const p0 = glyphInfo[i].p0; 63 63 context.translate(p0.x, p0.y); 64 64 context.rotate(glyphInfo[i].rotation); … … 82 82 _hitFunc(context) { 83 83 context.beginPath(); 84 varglyphInfo = this.glyphInfo;84 const glyphInfo = this.glyphInfo; 85 85 if (glyphInfo.length >= 1) { 86 varp0 = glyphInfo[0].p0;86 const p0 = glyphInfo[0].p0; 87 87 context.moveTo(p0.x, p0.y); 88 88 } 89 for ( vari = 0; i < glyphInfo.length; i++) {90 varp1 = glyphInfo[i].p1;89 for (let i = 0; i < glyphInfo.length; i++) { 90 const p1 = glyphInfo[i].p1; 91 91 context.lineTo(p1.x, p1.y); 92 92 } … … 109 109 } 110 110 _getTextSize(text) { 111 vardummyCanvas = this.dummyCanvas;112 var_context = dummyCanvas.getContext('2d');111 const dummyCanvas = this.dummyCanvas; 112 const _context = dummyCanvas.getContext('2d'); 113 113 _context.save(); 114 114 _context.font = this._getContextFont(); 115 varmetrics = _context.measureText(text);115 const metrics = _context.measureText(text); 116 116 _context.restore(); 117 117 return { … … 141 141 const charArr = (0, Text_1.stringToArray)(this.text()); 142 142 let offsetToGlyph = offset; 143 for ( vari = 0; i < charArr.length; i++) {143 for (let i = 0; i < charArr.length; i++) { 144 144 const charStartPoint = this._getPointAtLength(offsetToGlyph); 145 145 if (!charStartPoint) … … 188 188 }; 189 189 } 190 varpoints = [];190 const points = []; 191 191 this.glyphInfo.forEach(function (info) { 192 192 points.push(info.p0.x); … … 195 195 points.push(info.p1.y); 196 196 }); 197 varminX = points[0] || 0;198 varmaxX = points[0] || 0;199 varminY = points[1] || 0;200 varmaxY = points[1] || 0;201 varx, y;202 for ( vari = 0; i < points.length / 2; i++) {197 let minX = points[0] || 0; 198 let maxX = points[0] || 0; 199 let minY = points[1] || 0; 200 let maxY = points[1] || 0; 201 let x, y; 202 for (let i = 0; i < points.length / 2; i++) { 203 203 x = points[i * 2]; 204 204 y = points[i * 2 + 1]; … … 208 208 maxY = Math.max(maxY, y); 209 209 } 210 varfontSize = this.fontSize();210 const fontSize = this.fontSize(); 211 211 return { 212 212 x: minX - fontSize / 2, -
imaps-frontend/node_modules/konva/lib/shapes/Transformer.d.ts
rd565449 r0c6b92a 95 95 attrs: any; 96 96 className: string; 97 children?: any[] | undefined;97 children?: Array<any>; 98 98 }; 99 99 clone(obj?: any): this; -
imaps-frontend/node_modules/konva/lib/shapes/Transformer.js
rd565449 r0c6b92a 11 11 const Validators_1 = require("../Validators"); 12 12 const Global_2 = require("../Global"); 13 varEVENTS_NAME = 'tr-konva';14 varATTR_CHANGE_LIST = [13 const EVENTS_NAME = 'tr-konva'; 14 const ATTR_CHANGE_LIST = [ 15 15 'resizeEnabledChange', 16 16 'rotateAnchorOffsetChange', … … 31 31 .map((e) => e + `.${EVENTS_NAME}`) 32 32 .join(' '); 33 varNODES_RECT = 'nodesRect';34 varTRANSFORM_CHANGE_STR = [33 const NODES_RECT = 'nodesRect'; 34 const TRANSFORM_CHANGE_STR = [ 35 35 'widthChange', 36 36 'heightChange', … … 45 45 'strokeWidthChange', 46 46 ]; 47 varANGLES = {47 const ANGLES = { 48 48 'top-left': -45, 49 49 'top-center': 0, … … 61 61 } 62 62 rad += Util_1.Util.degToRad(ANGLES[anchorName] || 0); 63 varangle = ((Util_1.Util.radToDeg(rad) % 360) + 360) % 360;63 const angle = ((Util_1.Util.radToDeg(rad) % 360) + 360) % 360; 64 64 if (Util_1.Util._inRange(angle, 315 + 22.5, 360) || Util_1.Util._inRange(angle, 0, 22.5)) { 65 65 return 'ns-resize'; … … 91 91 } 92 92 } 93 varANCHORS_NAMES = [93 const ANCHORS_NAMES = [ 94 94 'top-left', 95 95 'top-center', … … 101 101 'bottom-right', 102 102 ]; 103 varMAX_SAFE_INTEGER = 100000000;103 const MAX_SAFE_INTEGER = 100000000; 104 104 function getCenter(shape) { 105 105 return { … … 208 208 }); 209 209 this._resetTransformCache(); 210 varelementsCreated = !!this.findOne('.top-left');210 const elementsCreated = !!this.findOne('.top-left'); 211 211 if (elementsCreated) { 212 212 this.update(); … … 270 270 } 271 271 __getNodeShape(node, rot = this.rotation(), relative) { 272 varrect = node.getClientRect({272 const rect = node.getClientRect({ 273 273 skipTransform: true, 274 274 skipShadow: true, 275 275 skipStroke: this.ignoreStroke(), 276 276 }); 277 varabsScale = node.getAbsoluteScale(relative);278 varabsPos = node.getAbsolutePosition(relative);279 vardx = rect.x * absScale.x - node.offsetX() * absScale.x;280 vardy = rect.y * absScale.y - node.offsetY() * absScale.y;277 const absScale = node.getAbsoluteScale(relative); 278 const absPos = node.getAbsolutePosition(relative); 279 const dx = rect.x * absScale.x - node.offsetX() * absScale.x; 280 const dy = rect.y * absScale.y - node.offsetY() * absScale.y; 281 281 const rotation = (Global_1.Konva.getAngle(node.getAbsoluteRotation()) + Math.PI * 2) % 282 282 (Math.PI * 2); … … 294 294 } 295 295 __getNodeRect() { 296 varnode = this.getNode();296 const node = this.getNode(); 297 297 if (!node) { 298 298 return { … … 311 311 skipStroke: this.ignoreStroke(), 312 312 }); 313 varpoints = [313 const points = [ 314 314 { x: box.x, y: box.y }, 315 315 { x: box.x + box.width, y: box.y }, … … 317 317 { x: box.x, y: box.y + box.height }, 318 318 ]; 319 vartrans = node.getAbsoluteTransform();319 const trans = node.getAbsoluteTransform(); 320 320 points.forEach(function (point) { 321 vartransformed = trans.point(point);321 const transformed = trans.point(point); 322 322 totalPoints.push(transformed); 323 323 }); … … 325 325 const tr = new Util_1.Transform(); 326 326 tr.rotate(-Global_1.Konva.getAngle(this.rotation())); 327 varminX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;327 let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity; 328 328 totalPoints.forEach(function (point) { 329 vartransformed = tr.point(point);329 const transformed = tr.point(point); 330 330 if (minX === undefined) { 331 331 minX = maxX = transformed.x; … … 367 367 } 368 368 _createAnchor(name) { 369 varanchor = new Rect_1.Rect({369 const anchor = new Rect_1.Rect({ 370 370 stroke: 'rgb(0, 161, 255)', 371 371 fill: 'white', … … 376 376 hitStrokeWidth: TOUCH_DEVICE ? 10 : 'auto', 377 377 }); 378 varself = this;378 const self = this; 379 379 anchor.on('mousedown touchstart', function (e) { 380 380 self._handleMouseDown(e); … … 388 388 }); 389 389 anchor.on('mouseenter', () => { 390 varrad = Global_1.Konva.getAngle(this.rotation());391 varrotateCursor = this.rotateAnchorCursor();392 varcursor = getCursor(name, rad, rotateCursor);390 const rad = Global_1.Konva.getAngle(this.rotation()); 391 const rotateCursor = this.rotateAnchorCursor(); 392 const cursor = getCursor(name, rad, rotateCursor); 393 393 anchor.getStage().content && 394 394 (anchor.getStage().content.style.cursor = cursor); … … 403 403 } 404 404 _createBack() { 405 varback = new Shape_1.Shape({405 const back = new Shape_1.Shape({ 406 406 name: 'back', 407 407 width: 0, … … 409 409 draggable: true, 410 410 sceneFunc(ctx, shape) { 411 vartr = shape.getParent();412 varpadding = tr.padding();411 const tr = shape.getParent(); 412 const padding = tr.padding(); 413 413 ctx.beginPath(); 414 414 ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2); … … 423 423 return; 424 424 } 425 varpadding = this.padding();425 const padding = this.padding(); 426 426 ctx.beginPath(); 427 427 ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2); … … 449 449 } 450 450 this._movingAnchorName = e.target.name().split(' ')[0]; 451 varattrs = this._getNodeRect();452 varwidth = attrs.width;453 varheight = attrs.height;454 varhypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));451 const attrs = this._getNodeRect(); 452 const width = attrs.width; 453 const height = attrs.height; 454 const hypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)); 455 455 this.sin = Math.abs(height / hypotenuse); 456 456 this.cos = Math.abs(width / hypotenuse); … … 462 462 } 463 463 this._transforming = true; 464 varap = e.target.getAbsolutePosition();465 varpos = e.target.getStage().getPointerPosition();464 const ap = e.target.getAbsolutePosition(); 465 const pos = e.target.getStage().getPointerPosition(); 466 466 this._anchorDragOffset = { 467 467 x: pos.x - ap.x, … … 475 475 } 476 476 _handleMouseMove(e) { 477 varx, y, newHypotenuse;478 varanchorNode = this.findOne('.' + this._movingAnchorName);479 varstage = anchorNode.getStage();477 let x, y, newHypotenuse; 478 const anchorNode = this.findOne('.' + this._movingAnchorName); 479 const stage = anchorNode.getStage(); 480 480 stage.setPointersPositions(e); 481 481 const pp = stage.getPointerPosition(); … … 494 494 } 495 495 if (this._movingAnchorName === 'rotater') { 496 varattrs = this._getNodeRect();496 const attrs = this._getNodeRect(); 497 497 x = anchorNode.x() - attrs.width / 2; 498 498 y = -anchorNode.y() + attrs.height / 2; … … 501 501 delta -= Math.PI; 502 502 } 503 varoldRotation = Global_1.Konva.getAngle(this.rotation());503 const oldRotation = Global_1.Konva.getAngle(this.rotation()); 504 504 const newRotation = oldRotation + delta; 505 505 const tol = Global_1.Konva.getAngle(this.rotationSnapTolerance()); … … 510 510 return; 511 511 } 512 varshiftBehavior = this.shiftBehavior();513 varkeepProportion;512 const shiftBehavior = this.shiftBehavior(); 513 let keepProportion; 514 514 if (shiftBehavior === 'inverted') { 515 515 keepProportion = this.keepRatio() && !e.shiftKey; … … 630 630 var centeredScaling = this.centeredScaling() || e.altKey; 631 631 if (centeredScaling) { 632 vartopLeft = this.findOne('.top-left');633 varbottomRight = this.findOne('.bottom-right');634 vartopOffsetX = topLeft.x();635 vartopOffsetY = topLeft.y();636 varbottomOffsetX = this.getWidth() - bottomRight.x();637 varbottomOffsetY = this.getHeight() - bottomRight.y();632 const topLeft = this.findOne('.top-left'); 633 const bottomRight = this.findOne('.bottom-right'); 634 const topOffsetX = topLeft.x(); 635 const topOffsetY = topLeft.y(); 636 const bottomOffsetX = this.getWidth() - bottomRight.x(); 637 const bottomOffsetY = this.getHeight() - bottomRight.y(); 638 638 bottomRight.move({ 639 639 x: -topOffsetX, … … 645 645 }); 646 646 } 647 varabsPos = this.findOne('.top-left').getAbsolutePosition();647 const absPos = this.findOne('.top-left').getAbsolutePosition(); 648 648 x = absPos.x; 649 649 y = absPos.y; 650 varwidth = this.findOne('.bottom-right').x() - this.findOne('.top-left').x();651 varheight = this.findOne('.bottom-right').y() - this.findOne('.top-left').y();650 const width = this.findOne('.bottom-right').x() - this.findOne('.top-left').x(); 651 const height = this.findOne('.bottom-right').y() - this.findOne('.top-left').y(); 652 652 this._fitNodesInto({ 653 653 x: x, … … 674 674 window.removeEventListener('touchend', this._handleMouseUp, true); 675 675 } 676 varnode = this.getNode();676 const node = this.getNode(); 677 677 activeTransformersCount--; 678 678 this._fire('transformend', { evt: e, target: node }); … … 689 689 } 690 690 _fitNodesInto(newAttrs, evt) { 691 varoldAttrs = this._getNodeRect();691 const oldAttrs = this._getNodeRect(); 692 692 const minSize = 1; 693 693 if (Util_1.Util._inRange(newAttrs.width, -this.padding() * 2 - minSize, minSize)) { … … 699 699 return; 700 700 } 701 vart = new Util_1.Transform();701 const t = new Util_1.Transform(); 702 702 t.rotate(Global_1.Konva.getAngle(this.rotation())); 703 703 if (this._movingAnchorName && … … 816 816 update() { 817 817 var _a; 818 varattrs = this._getNodeRect();818 const attrs = this._getNodeRect(); 819 819 this.rotation(Util_1.Util._getRotation(attrs.rotation)); 820 varwidth = attrs.width;821 varheight = attrs.height;822 varenabledAnchors = this.enabledAnchors();823 varresizeEnabled = this.resizeEnabled();824 varpadding = this.padding();825 varanchorSize = this.anchorSize();820 const width = attrs.width; 821 const height = attrs.height; 822 const enabledAnchors = this.enabledAnchors(); 823 const resizeEnabled = this.resizeEnabled(); 824 const padding = this.padding(); 825 const anchorSize = this.anchorSize(); 826 826 const anchors = this.find('._anchor'); 827 827 anchors.forEach((node) => { … … 918 918 if (this._transforming) { 919 919 this._removeEvents(); 920 varanchorNode = this.findOne('.' + this._movingAnchorName);920 const anchorNode = this.findOne('.' + this._movingAnchorName); 921 921 if (anchorNode) { 922 922 anchorNode.stopDrag(); … … 937 937 } 938 938 clone(obj) { 939 varnode = Node_1.Node.prototype.clone.call(this, obj);939 const node = Node_1.Node.prototype.clone.call(this, obj); 940 940 return node; 941 941 }
Note:
See TracChangeset
for help on using the changeset viewer.