mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 14:47:56 +01:00
Revert "Move lint"
This reverts commit cc8dc0c9bdbfe73bd66fed325aa7ba13efd1d3e1.
This commit is contained in:
parent
0195ea54d1
commit
ce03021308
1
.eslintcache
Normal file
1
.eslintcache
Normal file
@ -0,0 +1 @@
|
|||||||
|
[{"/Users/pveiga/repos/wisemapping-react/src/Footer.js":"1","/Users/pveiga/repos/wisemapping-react/src/Header.js":"2","/Users/pveiga/repos/wisemapping-react/src/index.js":"3","/Users/pveiga/repos/wisemapping-react/src/LoginPage.js":"4","/Users/pveiga/repos/wisemapping-react/src/RegistrationPage.js":"5"},{"size":1609,"mtime":1607011308675,"results":"6","hashOfConfig":"7"},{"size":1924,"mtime":1607015196109,"results":"8","hashOfConfig":"7"},{"size":1385,"mtime":1607144319143,"results":"9","hashOfConfig":"7"},{"size":3345,"mtime":1607147386381,"results":"10","hashOfConfig":"7"},{"size":4573,"mtime":1607143971378,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xegajf",{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/pveiga/repos/wisemapping-react/src/Footer.js",[],"/Users/pveiga/repos/wisemapping-react/src/Header.js",[],"/Users/pveiga/repos/wisemapping-react/src/index.js",[],"/Users/pveiga/repos/wisemapping-react/src/LoginPage.js",[],"/Users/pveiga/repos/wisemapping-react/src/RegistrationPage.js",[]]
|
@ -1,15 +1,29 @@
|
|||||||
{
|
{
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true,
|
"browser": true,
|
||||||
"commonjs": true,
|
|
||||||
"es2021": true
|
"es2021": true
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
"airbnb-base"
|
"eslint:recommended",
|
||||||
|
"prettier",
|
||||||
|
"plugin:react/recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended"
|
||||||
],
|
],
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 12
|
"ecmaFeatures": {
|
||||||
|
"jsx": true
|
||||||
},
|
},
|
||||||
|
"ecmaVersion": 12,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"react",
|
||||||
|
"@typescript-eslint"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"@typescript-eslint/no-explicit-any": "error",
|
||||||
|
"@typescript-eslint/explicit-module-boundary-types": "error",
|
||||||
|
"@typescript-eslint/no-unused-vars": "error"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
package.json
12
package.json
@ -40,5 +40,15 @@
|
|||||||
},
|
},
|
||||||
"homepage": "http://localhost:8080/react",
|
"homepage": "http://localhost:8080/react",
|
||||||
"license": "https://wisemapping.atlassian.net/wiki/spaces/WS/pages/524357/WiseMapping+Public+License+Version+1.0+WPL",
|
"license": "https://wisemapping.atlassian.net/wiki/spaces/WS/pages/524357/WiseMapping+Public+License+Version+1.0+WPL",
|
||||||
|
"husky": {
|
||||||
|
"hooks": {
|
||||||
|
"pre-commit": "lint-staged",
|
||||||
|
"pre-push": "yarn lint && yarn test"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"**/*.{ts,tsx}": [
|
||||||
|
"prettier --write"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"browser": true,
|
|
||||||
"commonjs": true,
|
|
||||||
"es2021": true
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"airbnb-base"
|
|
||||||
],
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 12
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"max-len": [0, 200],
|
|
||||||
"no-underscore-dangle": "off",
|
|
||||||
"no-restricted-syntax": "off",
|
|
||||||
"guard-for-in": "off",
|
|
||||||
"no-plusplus": "off"
|
|
||||||
},
|
|
||||||
"plugins": ["only-warn"]
|
|
||||||
|
|
||||||
}
|
|
@ -21,43 +21,43 @@ const Toolkit = require('./Toolkit').default;
|
|||||||
|
|
||||||
const Arrow = new Class({
|
const Arrow = new Class({
|
||||||
Extends: Element,
|
Extends: Element,
|
||||||
initialize(attributes) {
|
initialize: function (attributes) {
|
||||||
const peer = Toolkit.createArrow();
|
var peer = Toolkit.createArrow();
|
||||||
const defaultAttributes = {
|
var defaultAttributes = {
|
||||||
strokeColor: 'black',
|
strokeColor: 'black',
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
strokeStyle: 'solid',
|
strokeStyle: 'solid',
|
||||||
strokeOpacity: 1,
|
strokeOpacity: 1,
|
||||||
};
|
};
|
||||||
for (const key in attributes) {
|
for (var key in attributes) {
|
||||||
defaultAttributes[key] = attributes[key];
|
defaultAttributes[key] = attributes[key];
|
||||||
}
|
}
|
||||||
this.parent(peer, defaultAttributes);
|
this.parent(peer, defaultAttributes);
|
||||||
},
|
},
|
||||||
|
|
||||||
getType() {
|
getType: function () {
|
||||||
return 'Arrow';
|
return 'Arrow';
|
||||||
},
|
},
|
||||||
|
|
||||||
setFrom(x, y) {
|
setFrom: function (x, y) {
|
||||||
this._peer.setFrom(x, y);
|
this._peer.setFrom(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
setControlPoint(point) {
|
setControlPoint: function (point) {
|
||||||
this._peer.setControlPoint(point);
|
this._peer.setControlPoint(point);
|
||||||
},
|
},
|
||||||
|
|
||||||
setStrokeColor(color) {
|
setStrokeColor: function (color) {
|
||||||
this._peer.setStrokeColor(color);
|
this._peer.setStrokeColor(color);
|
||||||
},
|
},
|
||||||
|
|
||||||
setStrokeWidth(width) {
|
setStrokeWidth: function (width) {
|
||||||
this._peer.setStrokeWidth(width);
|
this._peer.setStrokeWidth(width);
|
||||||
},
|
},
|
||||||
|
|
||||||
setDashed(isDashed, length, spacing) {
|
setDashed: function (isDashed, length, spacing) {
|
||||||
this._peer.setDashed(isDashed, length, spacing);
|
this._peer.setDashed(isDashed, length, spacing);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Arrow;
|
export default Arrow
|
||||||
|
@ -20,102 +20,101 @@ const Toolkit = require('./Toolkit').default;
|
|||||||
|
|
||||||
const CurvedLine = new Class({
|
const CurvedLine = new Class({
|
||||||
Extends: Element,
|
Extends: Element,
|
||||||
initialize(attributes) {
|
initialize: function(attributes) {
|
||||||
const peer = Toolkit.createCurvedLine();
|
var peer = Toolkit.createCurvedLine();
|
||||||
const defaultAttributes = {
|
var defaultAttributes = {strokeColor:'blue',strokeWidth:1,strokeStyle:'solid',strokeOpacity:1};
|
||||||
strokeColor: 'blue', strokeWidth: 1, strokeStyle: 'solid', strokeOpacity: 1,
|
for (var key in attributes) {
|
||||||
};
|
|
||||||
for (const key in attributes) {
|
|
||||||
defaultAttributes[key] = attributes[key];
|
defaultAttributes[key] = attributes[key];
|
||||||
}
|
}
|
||||||
this.parent(peer, defaultAttributes);
|
this.parent(peer, defaultAttributes);
|
||||||
},
|
},
|
||||||
|
|
||||||
getType() {
|
getType : function() {
|
||||||
return 'CurvedLine';
|
return "CurvedLine";
|
||||||
},
|
},
|
||||||
|
|
||||||
setFrom(x, y) {
|
setFrom : function(x, y) {
|
||||||
$assert(!isNaN(x), 'x must be defined');
|
$assert(!isNaN(x), "x must be defined");
|
||||||
$assert(!isNaN(y), 'y must be defined');
|
$assert(!isNaN(y), "y must be defined");
|
||||||
|
|
||||||
this._peer.setFrom(x, y);
|
this._peer.setFrom(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
setTo(x, y) {
|
setTo : function(x, y) {
|
||||||
$assert(!isNaN(x), 'x must be defined');
|
$assert(!isNaN(x), "x must be defined");
|
||||||
$assert(!isNaN(y), 'y must be defined');
|
$assert(!isNaN(y), "y must be defined");
|
||||||
|
|
||||||
this._peer.setTo(x, y);
|
this._peer.setTo(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
getFrom() {
|
getFrom : function() {
|
||||||
return this._peer.getFrom();
|
return this._peer.getFrom();
|
||||||
},
|
},
|
||||||
|
|
||||||
getTo() {
|
getTo : function() {
|
||||||
return this._peer.getTo();
|
return this._peer.getTo();
|
||||||
},
|
},
|
||||||
|
|
||||||
setShowEndArrow(visible) {
|
setShowEndArrow : function(visible) {
|
||||||
this._peer.setShowEndArrow(visible);
|
this._peer.setShowEndArrow(visible);
|
||||||
},
|
},
|
||||||
|
|
||||||
isShowEndArrow() {
|
isShowEndArrow : function() {
|
||||||
return this._peer.isShowEndArrow();
|
return this._peer.isShowEndArrow();
|
||||||
},
|
},
|
||||||
|
|
||||||
setShowStartArrow(visible) {
|
setShowStartArrow : function(visible) {
|
||||||
this._peer.setShowStartArrow(visible);
|
this._peer.setShowStartArrow(visible);
|
||||||
},
|
},
|
||||||
|
|
||||||
isShowStartArrow() {
|
isShowStartArrow : function() {
|
||||||
return this._peer.isShowStartArrow();
|
return this._peer.isShowStartArrow();
|
||||||
},
|
},
|
||||||
|
|
||||||
setSrcControlPoint(control) {
|
setSrcControlPoint : function(control) {
|
||||||
this._peer.setSrcControlPoint(control);
|
this._peer.setSrcControlPoint(control);
|
||||||
},
|
},
|
||||||
|
|
||||||
setDestControlPoint(control) {
|
setDestControlPoint : function(control) {
|
||||||
this._peer.setDestControlPoint(control);
|
this._peer.setDestControlPoint(control);
|
||||||
},
|
},
|
||||||
|
|
||||||
getControlPoints() {
|
getControlPoints : function() {
|
||||||
return this._peer.getControlPoints();
|
return this._peer.getControlPoints();
|
||||||
},
|
},
|
||||||
|
|
||||||
isSrcControlPointCustom() {
|
isSrcControlPointCustom : function() {
|
||||||
return this._peer.isSrcControlPointCustom();
|
return this._peer.isSrcControlPointCustom();
|
||||||
},
|
},
|
||||||
|
|
||||||
isDestControlPointCustom() {
|
isDestControlPointCustom : function() {
|
||||||
return this._peer.isDestControlPointCustom();
|
return this._peer.isDestControlPointCustom();
|
||||||
},
|
},
|
||||||
|
|
||||||
setIsSrcControlPointCustom(isCustom) {
|
setIsSrcControlPointCustom : function(isCustom) {
|
||||||
this._peer.setIsSrcControlPointCustom(isCustom);
|
this._peer.setIsSrcControlPointCustom(isCustom);
|
||||||
},
|
},
|
||||||
|
|
||||||
setIsDestControlPointCustom(isCustom) {
|
setIsDestControlPointCustom : function(isCustom) {
|
||||||
this._peer.setIsDestControlPointCustom(isCustom);
|
this._peer.setIsDestControlPointCustom(isCustom);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateLine(avoidControlPointFix) {
|
updateLine : function(avoidControlPointFix) {
|
||||||
return this._peer.updateLine(avoidControlPointFix);
|
return this._peer.updateLine(avoidControlPointFix);
|
||||||
},
|
},
|
||||||
|
|
||||||
setStyle(style) {
|
setStyle : function(style) {
|
||||||
this._peer.setLineStyle(style);
|
this._peer.setLineStyle(style);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getStyle() {
|
getStyle : function() {
|
||||||
return this._peer.getLineStyle();
|
return this._peer.getLineStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
setDashed(length, spacing) {
|
setDashed : function(length, spacing) {
|
||||||
this._peer.setDashed(length, spacing);
|
this._peer.setDashed(length, spacing);
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
CurvedLine.SIMPLE_LINE = false;
|
CurvedLine.SIMPLE_LINE = false;
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const Element = new Class({ //eslint-disable-line no-undef
|
const Element = new Class({ //eslint-disable-line no-undef
|
||||||
initialize(peer, attributes) {
|
initialize: function (peer, attributes) {
|
||||||
this._peer = peer;
|
this._peer = peer;
|
||||||
if (peer == null) {
|
if (peer == null) {
|
||||||
throw new Error('Element peer can not be null');
|
throw new Error('Element peer can not be null');
|
||||||
@ -28,19 +28,19 @@ const Element = new Class({ // eslint-disable-line no-undef
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_initialize(attributes) {
|
_initialize: function (attributes) {
|
||||||
const batchExecute = {};
|
var batchExecute = {};
|
||||||
|
|
||||||
// Collect arguments ...
|
// Collect arguments ...
|
||||||
for (var key in attributes) {
|
for (var key in attributes) {
|
||||||
const funcName = this._attributeNameToFuncName(key, 'set');
|
var funcName = this._attributeNameToFuncName(key, 'set');
|
||||||
let funcArgs = batchExecute[funcName];
|
var funcArgs = batchExecute[funcName];
|
||||||
if (!$defined(funcArgs)) { //eslint-disable-line no-undef
|
if (!$defined(funcArgs)) { //eslint-disable-line no-undef
|
||||||
funcArgs = [];
|
funcArgs = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const signature = Element._propertyNameToSignature[key];
|
var signature = Element._propertyNameToSignature[key];
|
||||||
const argPositions = signature[1];
|
var argPositions = signature[1];
|
||||||
if (argPositions != Element._SIGNATURE_MULTIPLE_ARGUMENTS) {
|
if (argPositions != Element._SIGNATURE_MULTIPLE_ARGUMENTS) {
|
||||||
funcArgs[argPositions] = attributes[key];
|
funcArgs[argPositions] = attributes[key];
|
||||||
} else {
|
} else {
|
||||||
@ -51,19 +51,19 @@ const Element = new Class({ // eslint-disable-line no-undef
|
|||||||
|
|
||||||
// Call functions ...
|
// Call functions ...
|
||||||
for (var key in batchExecute) { //eslint-disable-line no-redeclare
|
for (var key in batchExecute) { //eslint-disable-line no-redeclare
|
||||||
const func = this[key];
|
var func = this[key];
|
||||||
if (!$defined(func)) { //eslint-disable-line no-undef
|
if (!$defined(func)) { //eslint-disable-line no-undef
|
||||||
throw new Error(`Could not find function: ${key}`);
|
throw new Error('Could not find function: ' + key);
|
||||||
}
|
}
|
||||||
func.apply(this, batchExecute[key]);
|
func.apply(this, batchExecute[key]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setSize(width, height) {
|
setSize: function (width, height) {
|
||||||
this._peer.setSize(width, height);
|
this._peer.setSize(width, height);
|
||||||
},
|
},
|
||||||
|
|
||||||
setPosition(cx, cy) {
|
setPosition: function (cx, cy) {
|
||||||
this._peer.setPosition(cx, cy);
|
this._peer.setPosition(cx, cy);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -77,15 +77,15 @@ const Element = new Class({ // eslint-disable-line no-undef
|
|||||||
* The following events types are supported:
|
* The following events types are supported:
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
addEvent(type, listener) {
|
addEvent: function (type, listener) {
|
||||||
this._peer.addEvent(type, listener);
|
this._peer.addEvent(type, listener);
|
||||||
},
|
},
|
||||||
|
|
||||||
trigger(type, event) {
|
trigger: function (type, event) {
|
||||||
this._peer.trigger(type, event);
|
this._peer.trigger(type, event);
|
||||||
},
|
},
|
||||||
|
|
||||||
cloneEvents(from) {
|
cloneEvents: function (from) {
|
||||||
this._peer.cloneEvents(from);
|
this._peer.cloneEvents(from);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -99,7 +99,7 @@ const Element = new Class({ // eslint-disable-line no-undef
|
|||||||
* The listener parameter takes an interface implemented by the user which contains the methods to be called when the event occurs.
|
* The listener parameter takes an interface implemented by the user which contains the methods to be called when the event occurs.
|
||||||
* This interace will be invoked passing an event as argument and the 'this' referece in the function will be the element.
|
* This interace will be invoked passing an event as argument and the 'this' referece in the function will be the element.
|
||||||
*/
|
*/
|
||||||
removeEvent(type, listener) {
|
removeEvent: function (type, listener) {
|
||||||
this._peer.removeEvent(type, listener);
|
this._peer.removeEvent(type, listener);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -107,16 +107,16 @@ const Element = new Class({ // eslint-disable-line no-undef
|
|||||||
* /*
|
* /*
|
||||||
* Returns element type name.
|
* Returns element type name.
|
||||||
*/
|
*/
|
||||||
getType() {
|
getType: function () {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'Not implemeneted yet. This method must be implemented by all the inherited objects.',
|
'Not implemeneted yet. This method must be implemented by all the inherited objects.'
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Todo: Doc
|
* Todo: Doc
|
||||||
*/
|
*/
|
||||||
getFill() {
|
getFill: function () {
|
||||||
return this._peer.getFill();
|
return this._peer.getFill();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -125,15 +125,15 @@ const Element = new Class({ // eslint-disable-line no-undef
|
|||||||
* color: Fill color
|
* color: Fill color
|
||||||
* opacity: Opacity of the fill. It must be less than 1.
|
* opacity: Opacity of the fill. It must be less than 1.
|
||||||
*/
|
*/
|
||||||
setFill(color, opacity) {
|
setFill: function (color, opacity) {
|
||||||
this._peer.setFill(color, opacity);
|
this._peer.setFill(color, opacity);
|
||||||
},
|
},
|
||||||
|
|
||||||
getPosition() {
|
getPosition: function () {
|
||||||
return this._peer.getPosition();
|
return this._peer.getPosition();
|
||||||
},
|
},
|
||||||
|
|
||||||
getNativePosition() {
|
getNativePosition: function () {
|
||||||
return this._peer.getNativePosition();
|
return this._peer.getNativePosition();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -144,28 +144,28 @@ const Element = new Class({ // eslint-disable-line no-undef
|
|||||||
* color: stroke color
|
* color: stroke color
|
||||||
* opacity: stroke visibility
|
* opacity: stroke visibility
|
||||||
*/
|
*/
|
||||||
setStroke(width, style, color, opacity) {
|
setStroke: function (width, style, color, opacity) {
|
||||||
if (
|
if (
|
||||||
style != null
|
style != null &&
|
||||||
&& style != undefined
|
style != undefined &&
|
||||||
&& style != 'dash'
|
style != 'dash' &&
|
||||||
&& style != 'dot'
|
style != 'dot' &&
|
||||||
&& style != 'solid'
|
style != 'solid' &&
|
||||||
&& style != 'longdash'
|
style != 'longdash' &&
|
||||||
&& style != 'dashdot'
|
style != 'dashdot'
|
||||||
) {
|
) {
|
||||||
throw new Error(`Unsupported stroke style: '${style}'`);
|
throw new Error("Unsupported stroke style: '" + style + "'");
|
||||||
}
|
}
|
||||||
this._peer.setStroke(width, style, color, opacity);
|
this._peer.setStroke(width, style, color, opacity);
|
||||||
},
|
},
|
||||||
|
|
||||||
_attributeNameToFuncName(attributeKey, prefix) {
|
_attributeNameToFuncName: function (attributeKey, prefix) {
|
||||||
const signature = Element._propertyNameToSignature[attributeKey];
|
var signature = Element._propertyNameToSignature[attributeKey];
|
||||||
if (!$defined(signature)) { //eslint-disable-line no-undef
|
if (!$defined(signature)) { //eslint-disable-line no-undef
|
||||||
throw `Unsupported attribute: ${attributeKey}`;
|
throw 'Unsupported attribute: ' + attributeKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
const firstLetter = signature[0].charAt(0);
|
var firstLetter = signature[0].charAt(0);
|
||||||
return prefix + firstLetter.toUpperCase() + signature[0].substring(1);
|
return prefix + firstLetter.toUpperCase() + signature[0].substring(1);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -174,56 +174,56 @@ const Element = new Class({ // eslint-disable-line no-undef
|
|||||||
* key: size, width, height, position, x, y, stroke, strokeWidth, strokeStyle, strokeColor, strokeOpacity,
|
* key: size, width, height, position, x, y, stroke, strokeWidth, strokeStyle, strokeColor, strokeOpacity,
|
||||||
* fill, fillColor, fillOpacity, coordSize, coordSizeWidth, coordSizeHeight, coordOrigin, coordOriginX, coordOrigiY
|
* fill, fillColor, fillOpacity, coordSize, coordSizeWidth, coordSizeHeight, coordOrigin, coordOriginX, coordOrigiY
|
||||||
*/
|
*/
|
||||||
setAttribute(key, value) {
|
setAttribute: function (key, value) {
|
||||||
const funcName = this._attributeNameToFuncName(key, 'set');
|
var funcName = this._attributeNameToFuncName(key, 'set');
|
||||||
|
|
||||||
const signature = Element._propertyNameToSignature[key];
|
var signature = Element._propertyNameToSignature[key];
|
||||||
if (signature == null) {
|
if (signature == null) {
|
||||||
throw `Could not find the signature for:${key}`;
|
throw 'Could not find the signature for:' + key;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse arguments ..
|
// Parse arguments ..
|
||||||
const argPositions = signature[1];
|
var argPositions = signature[1];
|
||||||
let args = [];
|
var args = [];
|
||||||
if (argPositions !== this._SIGNATURE_MULTIPLE_ARGUMENTS) {
|
if (argPositions !== this._SIGNATURE_MULTIPLE_ARGUMENTS) {
|
||||||
args[argPositions] = value;
|
args[argPositions] = value;
|
||||||
} else if (typeof value === 'array') { // eslint-disable-line valid-typeof
|
} else if (typeof value == 'array') { //eslint-disable-line valid-typeof
|
||||||
args = value;
|
args = value;
|
||||||
} else {
|
} else {
|
||||||
const strValue = String(value);
|
var strValue = String(value);
|
||||||
args = strValue.split(' ');
|
args = strValue.split(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look up method ...
|
// Look up method ...
|
||||||
const setter = this[funcName];
|
var setter = this[funcName];
|
||||||
if (setter == null) {
|
if (setter == null) {
|
||||||
throw `Could not find the function name:${funcName}`;
|
throw 'Could not find the function name:' + funcName;
|
||||||
}
|
}
|
||||||
setter.apply(this, args);
|
setter.apply(this, args);
|
||||||
},
|
},
|
||||||
|
|
||||||
getAttribute(key) {
|
getAttribute: function (key) {
|
||||||
const funcName = this._attributeNameToFuncName(key, 'get');
|
var funcName = this._attributeNameToFuncName(key, 'get');
|
||||||
|
|
||||||
const signature = Element._propertyNameToSignature[key];
|
var signature = Element._propertyNameToSignature[key];
|
||||||
if (signature == null) {
|
if (signature == null) {
|
||||||
throw `Could not find the signature for:${key}`;
|
throw 'Could not find the signature for:' + key;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getter = this[funcName];
|
var getter = this[funcName];
|
||||||
if (getter == null) {
|
if (getter == null) {
|
||||||
throw `Could not find the function name:${funcName}`;
|
throw 'Could not find the function name:' + funcName;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getterResult = getter.apply(this, []);
|
var getterResult = getter.apply(this, []);
|
||||||
const attibuteName = signature[2];
|
var attibuteName = signature[2];
|
||||||
if (!$defined(attibuteName)) { //eslint-disable-line no-undef
|
if (!$defined(attibuteName)) { //eslint-disable-line no-undef
|
||||||
throw `Could not find attribute mapping for:${key}`;
|
throw 'Could not find attribute mapping for:' + key;
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = getterResult[attibuteName];
|
var result = getterResult[attibuteName];
|
||||||
if (!$defined(result)) { //eslint-disable-line no-undef
|
if (!$defined(result)) { //eslint-disable-line no-undef
|
||||||
throw `Could not find attribute with name:${attibuteName}`;
|
throw 'Could not find attribute with name:' + attibuteName;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -234,42 +234,42 @@ const Element = new Class({ // eslint-disable-line no-undef
|
|||||||
* Parameters:
|
* Parameters:
|
||||||
* opacity: A value between 0 and 1.
|
* opacity: A value between 0 and 1.
|
||||||
*/
|
*/
|
||||||
setOpacity(opacity) {
|
setOpacity: function (opacity) {
|
||||||
this._peer.setStroke(null, null, null, opacity);
|
this._peer.setStroke(null, null, null, opacity);
|
||||||
this._peer.setFill(null, opacity);
|
this._peer.setFill(null, opacity);
|
||||||
},
|
},
|
||||||
|
|
||||||
setVisibility(isVisible) {
|
setVisibility: function (isVisible) {
|
||||||
this._peer.setVisibility(isVisible);
|
this._peer.setVisibility(isVisible);
|
||||||
},
|
},
|
||||||
|
|
||||||
isVisible() {
|
isVisible: function () {
|
||||||
return this._peer.isVisible();
|
return this._peer.isVisible();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move the element to the front
|
* Move the element to the front
|
||||||
*/
|
*/
|
||||||
moveToFront() {
|
moveToFront: function () {
|
||||||
this._peer.moveToFront();
|
this._peer.moveToFront();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move the element to the back
|
* Move the element to the back
|
||||||
*/
|
*/
|
||||||
moveToBack() {
|
moveToBack: function () {
|
||||||
this._peer.moveToBack();
|
this._peer.moveToBack();
|
||||||
},
|
},
|
||||||
|
|
||||||
getStroke() {
|
getStroke: function () {
|
||||||
return this._peer.getStroke();
|
return this._peer.getStroke();
|
||||||
},
|
},
|
||||||
|
|
||||||
setCursor(type) {
|
setCursor: function (type) {
|
||||||
this._peer.setCursor(type);
|
this._peer.setCursor(type);
|
||||||
},
|
},
|
||||||
|
|
||||||
getParent() {
|
getParent: function () {
|
||||||
return this._peer.getParent();
|
return this._peer.getParent();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -20,24 +20,22 @@ const Toolkit = require('./Toolkit').default;
|
|||||||
|
|
||||||
const Elipse = new Class({
|
const Elipse = new Class({
|
||||||
Extends: Element,
|
Extends: Element,
|
||||||
initialize(attributes) {
|
initialize: function(attributes) {
|
||||||
const peer = Toolkit.createElipse();
|
var peer = Toolkit.createElipse();
|
||||||
const defaultAttributes = {
|
var defaultAttributes = {width:40, height:40, x:5, y:5,stroke:'1 solid black',fillColor:'blue'};
|
||||||
width: 40, height: 40, x: 5, y: 5, stroke: '1 solid black', fillColor: 'blue',
|
for (var key in attributes) {
|
||||||
};
|
|
||||||
for (const key in attributes) {
|
|
||||||
defaultAttributes[key] = attributes[key];
|
defaultAttributes[key] = attributes[key];
|
||||||
}
|
}
|
||||||
this.parent(peer, defaultAttributes);
|
this.parent(peer, defaultAttributes);
|
||||||
},
|
},
|
||||||
|
|
||||||
getType() {
|
getType : function() {
|
||||||
return 'Elipse';
|
return "Elipse";
|
||||||
},
|
},
|
||||||
|
|
||||||
getSize() {
|
getSize : function() {
|
||||||
return this._peer.getSize();
|
return this._peer.getSize();
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Elipse;
|
export default Elipse;
|
||||||
|
@ -19,59 +19,59 @@ const Toolkit = require('./Toolkit');
|
|||||||
const TransformUtil = require('./peer/utils/TransformUtils').default;
|
const TransformUtil = require('./peer/utils/TransformUtils').default;
|
||||||
|
|
||||||
const Font = new Class({
|
const Font = new Class({
|
||||||
initialize(fontFamily, textPeer) {
|
initialize: function (fontFamily, textPeer) {
|
||||||
const font = `Toolkit.default.create${fontFamily}Font();`;
|
var font = 'Toolkit.default.create' + fontFamily + 'Font();';
|
||||||
this._peer = eval(font);
|
this._peer = eval(font);
|
||||||
this._textPeer = textPeer;
|
this._textPeer = textPeer;
|
||||||
},
|
},
|
||||||
|
|
||||||
getHtmlSize() {
|
getHtmlSize: function () {
|
||||||
const scale = TransformUtil.workoutScale(this._textPeer);
|
var scale = TransformUtil.workoutScale(this._textPeer);
|
||||||
return this._peer.getHtmlSize(scale);
|
return this._peer.getHtmlSize(scale);
|
||||||
},
|
},
|
||||||
|
|
||||||
getGraphSize() {
|
getGraphSize: function () {
|
||||||
const scale = TransformUtil.workoutScale(this._textPeer);
|
var scale = TransformUtil.workoutScale(this._textPeer);
|
||||||
return this._peer.getGraphSize(scale);
|
return this._peer.getGraphSize(scale);
|
||||||
},
|
},
|
||||||
|
|
||||||
getFontScale() {
|
getFontScale: function () {
|
||||||
return TransformUtil.workoutScale(this._textPeer).height;
|
return TransformUtil.workoutScale(this._textPeer).height;
|
||||||
},
|
},
|
||||||
|
|
||||||
getSize() {
|
getSize: function () {
|
||||||
return this._peer.getSize();
|
return this._peer.getSize();
|
||||||
},
|
},
|
||||||
|
|
||||||
getStyle() {
|
getStyle: function () {
|
||||||
return this._peer.getStyle();
|
return this._peer.getStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
getWeight() {
|
getWeight: function () {
|
||||||
return this._peer.getWeight();
|
return this._peer.getWeight();
|
||||||
},
|
},
|
||||||
|
|
||||||
getFontFamily() {
|
getFontFamily: function () {
|
||||||
return this._peer.getFontFamily();
|
return this._peer.getFontFamily();
|
||||||
},
|
},
|
||||||
|
|
||||||
setSize(size) {
|
setSize: function (size) {
|
||||||
return this._peer.setSize(size);
|
return this._peer.setSize(size);
|
||||||
},
|
},
|
||||||
|
|
||||||
setStyle(style) {
|
setStyle: function (style) {
|
||||||
return this._peer.setStyle(style);
|
return this._peer.setStyle(style);
|
||||||
},
|
},
|
||||||
|
|
||||||
setWeight(weight) {
|
setWeight: function (weight) {
|
||||||
return this._peer.setWeight(weight);
|
return this._peer.setWeight(weight);
|
||||||
},
|
},
|
||||||
|
|
||||||
getFont() {
|
getFont: function () {
|
||||||
return this._peer.getFont();
|
return this._peer.getFont();
|
||||||
},
|
},
|
||||||
|
|
||||||
getWidthMargin() {
|
getWidthMargin: function () {
|
||||||
return this._peer.getWidthMargin();
|
return this._peer.getWidthMargin();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -23,12 +23,10 @@ const Toolkit = require('./Toolkit').default;
|
|||||||
*/
|
*/
|
||||||
const Group = new Class({
|
const Group = new Class({
|
||||||
Extends: Element,
|
Extends: Element,
|
||||||
initialize(attributes) {
|
initialize: function (attributes) {
|
||||||
const peer = Toolkit.createGroup();
|
var peer = Toolkit.createGroup();
|
||||||
const defaultAttributes = {
|
var defaultAttributes = {width: 50, height: 50, x: 50, y: 50, coordOrigin: '0 0', coordSize: '50 50'};
|
||||||
width: 50, height: 50, x: 50, y: 50, coordOrigin: '0 0', coordSize: '50 50',
|
for (var key in attributes) {
|
||||||
};
|
|
||||||
for (const key in attributes) {
|
|
||||||
defaultAttributes[key] = attributes[key];
|
defaultAttributes[key] = attributes[key];
|
||||||
}
|
}
|
||||||
this.parent(peer, defaultAttributes);
|
this.parent(peer, defaultAttributes);
|
||||||
@ -37,18 +35,18 @@ const Group = new Class({
|
|||||||
/**
|
/**
|
||||||
* Remove an element as a child to the object.
|
* Remove an element as a child to the object.
|
||||||
*/
|
*/
|
||||||
removeChild(element) {
|
removeChild: function (element) {
|
||||||
if (!$defined(element)) {
|
if (!$defined(element)) {
|
||||||
throw 'Child element can not be null';
|
throw "Child element can not be null";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element == this) {
|
if (element == this) {
|
||||||
throw "It's not possible to add the group as a child of itself";
|
throw "It's not possible to add the group as a child of itself";
|
||||||
}
|
}
|
||||||
|
|
||||||
const elementType = element.getType();
|
var elementType = element.getType();
|
||||||
if (elementType == null) {
|
if (elementType == null) {
|
||||||
throw `It seems not to be an element ->${element}`;
|
throw "It seems not to be an element ->" + element;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._peer.removeChild(element._peer);
|
this._peer.removeChild(element._peer);
|
||||||
@ -57,29 +55,30 @@ const Group = new Class({
|
|||||||
/**
|
/**
|
||||||
* Appends an element as a child to the object.
|
* Appends an element as a child to the object.
|
||||||
*/
|
*/
|
||||||
append(element) {
|
append: function (element) {
|
||||||
if (!$defined(element)) {
|
if (!$defined(element)) {
|
||||||
throw 'Child element can not be null';
|
throw "Child element can not be null";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element == this) {
|
if (element == this) {
|
||||||
throw "It's not posible to add the group as a child of itself";
|
throw "It's not posible to add the group as a child of itself";
|
||||||
}
|
}
|
||||||
|
|
||||||
const elementType = element.getType();
|
var elementType = element.getType();
|
||||||
if (elementType == null) {
|
if (elementType == null) {
|
||||||
throw `It seems not to be an element ->${element}`;
|
throw "It seems not to be an element ->" + element;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elementType == 'Workspace') {
|
if (elementType == "Workspace") {
|
||||||
throw 'A group can not have a workspace as a child';
|
throw "A group can not have a workspace as a child";
|
||||||
}
|
}
|
||||||
|
|
||||||
this._peer.append(element._peer);
|
this._peer.append(element._peer);
|
||||||
},
|
},
|
||||||
|
|
||||||
getType() {
|
|
||||||
return 'Group';
|
getType: function () {
|
||||||
|
return "Group";
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -89,36 +88,36 @@ const Group = new Class({
|
|||||||
* Consequently CSS2 position attributes (left, top, width, height and so on) have no unit specifier -
|
* Consequently CSS2 position attributes (left, top, width, height and so on) have no unit specifier -
|
||||||
* they are simple numbers, not CSS length quantities.
|
* they are simple numbers, not CSS length quantities.
|
||||||
*/
|
*/
|
||||||
setCoordSize(width, height) {
|
setCoordSize: function (width, height) {
|
||||||
this._peer.setCoordSize(width, height);
|
this._peer.setCoordSize(width, height);
|
||||||
},
|
},
|
||||||
|
|
||||||
setCoordOrigin(x, y) {
|
setCoordOrigin: function (x, y) {
|
||||||
this._peer.setCoordOrigin(x, y);
|
this._peer.setCoordOrigin(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
getCoordOrigin() {
|
getCoordOrigin: function () {
|
||||||
return this._peer.getCoordOrigin();
|
return this._peer.getCoordOrigin();
|
||||||
},
|
},
|
||||||
getSize() {
|
getSize: function () {
|
||||||
return this._peer.getSize();
|
return this._peer.getSize();
|
||||||
},
|
},
|
||||||
|
|
||||||
setFill(color, opacity) {
|
setFill: function (color, opacity) {
|
||||||
throw 'Unsupported operation. Fill can not be set to a group';
|
throw "Unsupported operation. Fill can not be set to a group";
|
||||||
},
|
},
|
||||||
|
|
||||||
setStroke(width, style, color, opacity) {
|
setStroke: function (width, style, color, opacity) {
|
||||||
throw 'Unsupported operation. Stroke can not be set to a group';
|
throw "Unsupported operation. Stroke can not be set to a group";
|
||||||
},
|
},
|
||||||
|
|
||||||
getCoordSize() {
|
getCoordSize: function () {
|
||||||
return this._peer.getCoordSize();
|
return this._peer.getCoordSize();
|
||||||
},
|
},
|
||||||
|
|
||||||
appendDomChild(DomElement) {
|
appendDomChild: function (DomElement) {
|
||||||
if (!$defined(DomElement)) {
|
if (!$defined(DomElement)) {
|
||||||
throw 'Child element can not be null';
|
throw "Child element can not be null";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DomElement == this) {
|
if (DomElement == this) {
|
||||||
@ -128,9 +127,9 @@ const Group = new Class({
|
|||||||
this._peer._native.append(DomElement);
|
this._peer._native.append(DomElement);
|
||||||
},
|
},
|
||||||
|
|
||||||
setOpacity(value) {
|
setOpacity: function (value) {
|
||||||
this._peer.setOpacity(value);
|
this._peer.setOpacity(value);
|
||||||
},
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -20,26 +20,26 @@ const Toolkit = require('./Toolkit').default;
|
|||||||
|
|
||||||
const Image = new Class({
|
const Image = new Class({
|
||||||
Extends: Element,
|
Extends: Element,
|
||||||
initialize(attributes) {
|
initialize : function(attributes) {
|
||||||
const peer = Toolkit.createImage();
|
var peer = Toolkit.createImage();
|
||||||
this.parent(peer, attributes);
|
this.parent(peer, attributes);
|
||||||
},
|
},
|
||||||
|
|
||||||
getType() {
|
getType : function() {
|
||||||
return 'Image';
|
return "Image";
|
||||||
},
|
},
|
||||||
|
|
||||||
setHref(href) {
|
setHref : function(href) {
|
||||||
this._peer.setHref(href);
|
this._peer.setHref(href);
|
||||||
},
|
},
|
||||||
|
|
||||||
getHref() {
|
getHref : function() {
|
||||||
return this._peer.getHref();
|
return this._peer.getHref();
|
||||||
},
|
},
|
||||||
|
|
||||||
getSize() {
|
getSize : function() {
|
||||||
return this._peer.getSize();
|
return this._peer.getSize();
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Image;
|
export default Image;
|
||||||
|
@ -20,32 +20,32 @@ const Toolkit = require('./Toolkit').default;
|
|||||||
|
|
||||||
const Line = new Class({
|
const Line = new Class({
|
||||||
Extends: Element,
|
Extends: Element,
|
||||||
initialize(attributes) {
|
initialize: function(attributes) {
|
||||||
const peer = Toolkit.createLine();
|
var peer = Toolkit.createLine();
|
||||||
const defaultAttributes = { strokeColor: '#495879', strokeWidth: 1, strokeOpacity: 1 };
|
var defaultAttributes = {strokeColor:'#495879',strokeWidth:1, strokeOpacity:1};
|
||||||
for (const key in attributes) {
|
for (var key in attributes) {
|
||||||
defaultAttributes[key] = attributes[key];
|
defaultAttributes[key] = attributes[key];
|
||||||
}
|
}
|
||||||
this.parent(peer, defaultAttributes);
|
this.parent(peer, defaultAttributes);
|
||||||
},
|
},
|
||||||
|
|
||||||
getType() {
|
getType : function() {
|
||||||
return 'Line';
|
return "Line";
|
||||||
},
|
},
|
||||||
|
|
||||||
setFrom(x, y) {
|
setFrom : function(x, y) {
|
||||||
this._peer.setFrom(x, y);
|
this._peer.setFrom(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
setTo(x, y) {
|
setTo : function(x, y) {
|
||||||
this._peer.setTo(x, y);
|
this._peer.setTo(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
getFrom() {
|
getFrom : function() {
|
||||||
return this._peer.getFrom();
|
return this._peer.getFrom();
|
||||||
},
|
},
|
||||||
|
|
||||||
getTo() {
|
getTo : function() {
|
||||||
return this._peer.getTo();
|
return this._peer.getTo();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -53,21 +53,21 @@ const Line = new Class({
|
|||||||
* Defines the start and the end line arrow style.
|
* Defines the start and the end line arrow style.
|
||||||
* Can have values "none | block | classic | diamond | oval | open | chevron | doublechevron"
|
* Can have values "none | block | classic | diamond | oval | open | chevron | doublechevron"
|
||||||
**/
|
**/
|
||||||
setArrowStyle(startStyle, endStyle) {
|
setArrowStyle : function(startStyle, endStyle) {
|
||||||
this._peer.setArrowStyle(startStyle, endStyle);
|
this._peer.setArrowStyle(startStyle, endStyle);
|
||||||
},
|
},
|
||||||
|
|
||||||
setPosition(cx, cy) {
|
setPosition : function(cx, cy) {
|
||||||
throw 'Unsupported operation';
|
throw "Unsupported operation";
|
||||||
},
|
},
|
||||||
|
|
||||||
setSize(width, height) {
|
setSize : function(width, height) {
|
||||||
throw 'Unsupported operation';
|
throw "Unsupported operation";
|
||||||
},
|
},
|
||||||
|
|
||||||
setFill(color, opacity) {
|
setFill : function(color, opacity) {
|
||||||
throw 'Unsupported operation';
|
throw "Unsupported operation";
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Line;
|
export default Line;
|
||||||
|
@ -22,7 +22,7 @@ core.Point = new Class({
|
|||||||
* @param {Number} x coordinate
|
* @param {Number} x coordinate
|
||||||
* @param {Number} y coordinate
|
* @param {Number} y coordinate
|
||||||
*/
|
*/
|
||||||
initialize(x, y) {
|
initialize: function (x, y) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
},
|
},
|
||||||
@ -31,22 +31,23 @@ core.Point = new Class({
|
|||||||
* @param {Number} x coordinate
|
* @param {Number} x coordinate
|
||||||
* @param {Number} y coordinate
|
* @param {Number} y coordinate
|
||||||
*/
|
*/
|
||||||
setValue(x, y) {
|
setValue: function (x, y) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
},
|
},
|
||||||
|
|
||||||
inspect() {
|
inspect: function () {
|
||||||
return `{x:${this.x},y:${this.y}}`;
|
return "{x:" + this.x + ",y:" + this.y + "}";
|
||||||
},
|
},
|
||||||
|
|
||||||
clone() {
|
clone: function () {
|
||||||
return new core.Point(this.x, this.y);
|
return new core.Point(this.x, this.y);
|
||||||
},
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
core.Point.fromString = function (point) {
|
core.Point.fromString = function (point) {
|
||||||
const values = point.split(',');
|
var values = point.split(',');
|
||||||
return new core.Point(values[0], values[1]);
|
return new core.Point(values[0], values[1]);
|
||||||
|
|
||||||
};
|
};
|
@ -20,40 +20,38 @@ const Toolkit = require('./Toolkit');
|
|||||||
|
|
||||||
const PolyLine = new Class({
|
const PolyLine = new Class({
|
||||||
Extends: Element,
|
Extends: Element,
|
||||||
initialize(attributes) {
|
initialize:function(attributes) {
|
||||||
const peer = Toolkit.default.createPolyLine();
|
var peer = Toolkit.default.createPolyLine();
|
||||||
const defaultAttributes = {
|
var defaultAttributes = {strokeColor:'blue',strokeWidth:1,strokeStyle:'solid',strokeOpacity:1};
|
||||||
strokeColor: 'blue', strokeWidth: 1, strokeStyle: 'solid', strokeOpacity: 1,
|
for (var key in attributes) {
|
||||||
};
|
|
||||||
for (const key in attributes) {
|
|
||||||
defaultAttributes[key] = attributes[key];
|
defaultAttributes[key] = attributes[key];
|
||||||
}
|
}
|
||||||
this.parent(peer, defaultAttributes);
|
this.parent(peer, defaultAttributes);
|
||||||
},
|
},
|
||||||
|
|
||||||
getType() {
|
getType : function() {
|
||||||
return 'PolyLine';
|
return "PolyLine";
|
||||||
},
|
},
|
||||||
|
|
||||||
setFrom(x, y) {
|
setFrom : function(x, y) {
|
||||||
this._peer.setFrom(x, y);
|
this._peer.setFrom(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
setTo(x, y) {
|
setTo : function(x, y) {
|
||||||
this._peer.setTo(x, y);
|
this._peer.setTo(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
setStyle(style) {
|
setStyle : function(style) {
|
||||||
this._peer.setStyle(style);
|
this._peer.setStyle(style);
|
||||||
},
|
},
|
||||||
|
|
||||||
getStyle() {
|
getStyle : function() {
|
||||||
return this._peer.getStyle();
|
return this._peer.getStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
buildCurvedPath(dist, x1, y1, x2, y2) {
|
buildCurvedPath : function(dist, x1, y1, x2, y2) {
|
||||||
let signx = 1;
|
var signx = 1;
|
||||||
let signy = 1;
|
var signy = 1;
|
||||||
if (x2 < x1) {
|
if (x2 < x1) {
|
||||||
signx = -1;
|
signx = -1;
|
||||||
}
|
}
|
||||||
@ -61,21 +59,21 @@ const PolyLine = new Class({
|
|||||||
signy = -1;
|
signy = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
let path;
|
var path;
|
||||||
if (Math.abs(y1 - y2) > 2) {
|
if (Math.abs(y1 - y2) > 2) {
|
||||||
const middlex = x1 + ((x2 - x1 > 0) ? dist : -dist);
|
var middlex = x1 + ((x2 - x1 > 0) ? dist : -dist);
|
||||||
path = `${x1.toFixed(1)}, ${y1.toFixed(1)} ${middlex.toFixed(1)}, ${y1.toFixed(1)} ${middlex.toFixed(1)}, ${(y2 - 5 * signy).toFixed(1)} ${(middlex + 5 * signx).toFixed(1)}, ${y2.toFixed(1)} ${x2.toFixed(1)}, ${y2.toFixed(1)}`;
|
path = x1.toFixed(1) + ", " + y1.toFixed(1) + " " + middlex.toFixed(1) + ", " + y1.toFixed(1) + " " + middlex.toFixed(1) + ", " + (y2 - 5 * signy).toFixed(1) + " " + (middlex + 5 * signx).toFixed(1) + ", " + y2.toFixed(1) + " " + x2.toFixed(1) + ", " + y2.toFixed(1);
|
||||||
} else {
|
} else {
|
||||||
path = `${x1.toFixed(1)}, ${y1.toFixed(1)} ${x2.toFixed(1)}, ${y2.toFixed(1)}`;
|
path = x1.toFixed(1) + ", " + y1.toFixed(1) + " " + x2.toFixed(1) + ", " + y2.toFixed(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
},
|
},
|
||||||
|
|
||||||
buildStraightPath(dist, x1, y1, x2, y2) {
|
buildStraightPath : function(dist, x1, y1, x2, y2) {
|
||||||
const middlex = x1 + ((x2 - x1 > 0) ? dist : -dist);
|
var middlex = x1 + ((x2 - x1 > 0) ? dist : -dist);
|
||||||
return `${x1}, ${y1} ${middlex}, ${y1} ${middlex}, ${y2} ${x2}, ${y2}`;
|
return x1 + ", " + y1 + " " + middlex + ", " + y1 + " " + middlex + ", " + y2 + " " + x2 + ", " + y2;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default PolyLine;
|
export default PolyLine;
|
||||||
|
@ -26,32 +26,30 @@ const Toolkit = require('./Toolkit').default;
|
|||||||
*/
|
*/
|
||||||
const Rect = new Class({
|
const Rect = new Class({
|
||||||
Extends: Element,
|
Extends: Element,
|
||||||
initialize(arc, attributes) {
|
initialize : function(arc, attributes) {
|
||||||
if (arc && arc > 1) {
|
if (arc && arc > 1) {
|
||||||
throw 'Arc must be 0<=arc<=1';
|
throw "Arc must be 0<=arc<=1";
|
||||||
}
|
}
|
||||||
if (arguments.length <= 0) {
|
if (arguments.length <= 0) {
|
||||||
const rx = 0;
|
var rx = 0;
|
||||||
const ry = 0;
|
var ry = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const peer = Toolkit.createRect(arc);
|
var peer = Toolkit.createRect(arc);
|
||||||
const defaultAttributes = {
|
var defaultAttributes = {width:40, height:40, x:5, y:5,stroke:'1 solid black',fillColor:'green'};
|
||||||
width: 40, height: 40, x: 5, y: 5, stroke: '1 solid black', fillColor: 'green',
|
for (var key in attributes) {
|
||||||
};
|
|
||||||
for (const key in attributes) {
|
|
||||||
defaultAttributes[key] = attributes[key];
|
defaultAttributes[key] = attributes[key];
|
||||||
}
|
}
|
||||||
this.parent(peer, defaultAttributes);
|
this.parent(peer, defaultAttributes);
|
||||||
},
|
},
|
||||||
|
|
||||||
getType() {
|
getType : function() {
|
||||||
return 'Rect';
|
return "Rect";
|
||||||
},
|
},
|
||||||
|
|
||||||
getSize() {
|
getSize : function() {
|
||||||
return this._peer.getSize();
|
return this._peer.getSize();
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Rect;
|
export default Rect;
|
||||||
|
@ -20,80 +20,80 @@ const Toolkit = require('./Toolkit');
|
|||||||
|
|
||||||
const Text = new Class({
|
const Text = new Class({
|
||||||
Extends: Element,
|
Extends: Element,
|
||||||
initialize(attributes) {
|
initialize:function(attributes) {
|
||||||
const peer = Toolkit.default.createText();
|
var peer = Toolkit.default.createText();
|
||||||
this.parent(peer, attributes);
|
this.parent(peer, attributes);
|
||||||
},
|
},
|
||||||
|
|
||||||
getType() {
|
getType : function() {
|
||||||
return 'Text';
|
return "Text";
|
||||||
},
|
},
|
||||||
|
|
||||||
setText(text) {
|
setText : function(text) {
|
||||||
this._peer.setText(text);
|
this._peer.setText(text);
|
||||||
},
|
},
|
||||||
|
|
||||||
setTextAlignment(align) {
|
setTextAlignment : function(align) {
|
||||||
$assert(align, 'align can not be null');
|
$assert(align, "align can not be null");
|
||||||
this._peer.setTextAlignment(align);
|
this._peer.setTextAlignment(align);
|
||||||
},
|
},
|
||||||
|
|
||||||
setTextSize(width, height) {
|
setTextSize : function(width, height) {
|
||||||
this._peer.setContentSize(width, height);
|
this._peer.setContentSize(width, height);
|
||||||
},
|
},
|
||||||
|
|
||||||
getText() {
|
getText : function() {
|
||||||
return this._peer.getText();
|
return this._peer.getText();
|
||||||
},
|
},
|
||||||
|
|
||||||
setFont(font, size, style, weight) {
|
setFont : function(font, size, style, weight) {
|
||||||
this._peer.setFont(font, size, style, weight);
|
this._peer.setFont(font, size, style, weight);
|
||||||
},
|
},
|
||||||
|
|
||||||
setColor(color) {
|
setColor : function(color) {
|
||||||
this._peer.setColor(color);
|
this._peer.setColor(color);
|
||||||
},
|
},
|
||||||
|
|
||||||
getColor() {
|
getColor : function() {
|
||||||
return this._peer.getColor();
|
return this._peer.getColor();
|
||||||
},
|
},
|
||||||
|
|
||||||
setStyle(style) {
|
setStyle : function(style) {
|
||||||
this._peer.setStyle(style);
|
this._peer.setStyle(style);
|
||||||
},
|
},
|
||||||
|
|
||||||
setWeight(weight) {
|
setWeight : function(weight) {
|
||||||
this._peer.setWeight(weight);
|
this._peer.setWeight(weight);
|
||||||
},
|
},
|
||||||
|
|
||||||
setFontFamily(family) {
|
setFontFamily : function(family) {
|
||||||
this._peer.setFontFamily(family);
|
this._peer.setFontFamily(family);
|
||||||
},
|
},
|
||||||
|
|
||||||
getFont() {
|
getFont : function() {
|
||||||
return this._peer.getFont();
|
return this._peer.getFont();
|
||||||
},
|
},
|
||||||
|
|
||||||
setSize(size) {
|
setSize : function(size) {
|
||||||
this._peer.setSize(size);
|
this._peer.setSize(size);
|
||||||
},
|
},
|
||||||
|
|
||||||
getHtmlFontSize() {
|
getHtmlFontSize : function() {
|
||||||
return this._peer.getHtmlFontSize();
|
return this._peer.getHtmlFontSize();
|
||||||
},
|
},
|
||||||
|
|
||||||
getWidth() {
|
getWidth : function() {
|
||||||
return this._peer.getWidth();
|
return this._peer.getWidth();
|
||||||
},
|
},
|
||||||
|
|
||||||
getHeight() {
|
getHeight : function() {
|
||||||
return parseInt(this._peer.getHeight());
|
return parseInt(this._peer.getHeight());
|
||||||
},
|
},
|
||||||
|
|
||||||
getFontHeight() {
|
getFontHeight : function() {
|
||||||
const lines = this._peer.getText().split('\n').length;
|
var lines = this._peer.getText().split('\n').length;
|
||||||
return Math.round(this.getHeight() / lines);
|
return Math.round(this.getHeight() / lines);
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Text;
|
export default Text;
|
||||||
|
@ -15,66 +15,82 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
const WorkspacePeer = require('./peer/svg/WorkspacePeer').default;
|
const WorkspacePeer = require('./peer/svg/WorkspacePeer').default
|
||||||
const GroupPeer = require('./peer/svg/GroupPeer').default;
|
const GroupPeer = require('./peer/svg/GroupPeer').default
|
||||||
const ElipsePeer = require('./peer/svg/ElipsePeer').default;
|
const ElipsePeer = require('./peer/svg/ElipsePeer').default
|
||||||
const LinePeer = require('./peer/svg/LinePeer').default;
|
const LinePeer = require('./peer/svg/LinePeer').default
|
||||||
const PolyLinePeer = require('./peer/svg/PolyLinePeer').default;
|
const PolyLinePeer = require('./peer/svg/PolyLinePeer').default
|
||||||
const CurvedLinePeer = require('./peer/svg/CurvedLinePeer').default;
|
const CurvedLinePeer = require('./peer/svg/CurvedLinePeer').default
|
||||||
const ArrowPeer = require('./peer/svg/ArrowPeer').default;
|
const ArrowPeer = require('./peer/svg/ArrowPeer').default
|
||||||
const TextPeer = require('./peer/svg/TextPeer').default;
|
const TextPeer = require('./peer/svg/TextPeer').default
|
||||||
const ImagePeer = require('./peer/svg/ImagePeer').default;
|
const ImagePeer = require('./peer/svg/ImagePeer').default
|
||||||
const RectPeer = require('./peer/svg/RectPeer').default;
|
const RectPeer = require('./peer/svg/RectPeer').default
|
||||||
const ArialFont = require('./peer/svg/ArialFont').default;
|
const ArialFont = require('./peer/svg/ArialFont').default
|
||||||
const TimesFont = require('./peer/svg/TimesFont').default;
|
const TimesFont = require('./peer/svg/TimesFont').default
|
||||||
const VerdanaFont = require('./peer/svg/VerdanaFont').default;
|
const VerdanaFont = require('./peer/svg/VerdanaFont').default
|
||||||
const TahomaFont = require('./peer/svg/TahomaFont').default;
|
const TahomaFont = require('./peer/svg/TahomaFont').default
|
||||||
|
|
||||||
const ToolkitSVG = {
|
const ToolkitSVG =
|
||||||
init() {
|
{
|
||||||
|
init: function()
|
||||||
|
{
|
||||||
},
|
},
|
||||||
createWorkspace(element) {
|
createWorkspace: function(element)
|
||||||
|
{
|
||||||
return new WorkspacePeer(element);
|
return new WorkspacePeer(element);
|
||||||
},
|
},
|
||||||
createGroup(element) {
|
createGroup: function(element)
|
||||||
|
{
|
||||||
return new GroupPeer();
|
return new GroupPeer();
|
||||||
},
|
},
|
||||||
createElipse() {
|
createElipse: function()
|
||||||
|
{
|
||||||
return new ElipsePeer();
|
return new ElipsePeer();
|
||||||
},
|
},
|
||||||
createLine() {
|
createLine: function()
|
||||||
|
{
|
||||||
return new LinePeer();
|
return new LinePeer();
|
||||||
},
|
},
|
||||||
createPolyLine() {
|
createPolyLine: function()
|
||||||
|
{
|
||||||
return new PolyLinePeer();
|
return new PolyLinePeer();
|
||||||
},
|
},
|
||||||
createCurvedLine() {
|
createCurvedLine: function()
|
||||||
|
{
|
||||||
return new CurvedLinePeer();
|
return new CurvedLinePeer();
|
||||||
},
|
},
|
||||||
createArrow() {
|
createArrow: function()
|
||||||
|
{
|
||||||
return new ArrowPeer();
|
return new ArrowPeer();
|
||||||
},
|
},
|
||||||
createText() {
|
createText: function ()
|
||||||
|
{
|
||||||
return new TextPeer();
|
return new TextPeer();
|
||||||
},
|
},
|
||||||
createImage() {
|
createImage: function ()
|
||||||
|
{
|
||||||
return new ImagePeer();
|
return new ImagePeer();
|
||||||
},
|
},
|
||||||
createRect(arc) {
|
createRect: function(arc)
|
||||||
|
{
|
||||||
return new RectPeer(arc);
|
return new RectPeer(arc);
|
||||||
},
|
},
|
||||||
createArialFont() {
|
createArialFont: function()
|
||||||
|
{
|
||||||
return new ArialFont();
|
return new ArialFont();
|
||||||
},
|
},
|
||||||
createTimesFont() {
|
createTimesFont: function()
|
||||||
|
{
|
||||||
return new TimesFont();
|
return new TimesFont();
|
||||||
},
|
},
|
||||||
createVerdanaFont() {
|
createVerdanaFont: function()
|
||||||
|
{
|
||||||
return new VerdanaFont();
|
return new VerdanaFont();
|
||||||
},
|
},
|
||||||
createTahomaFont() {
|
createTahomaFont: function()
|
||||||
|
{
|
||||||
return new TahomaFont();
|
return new TahomaFont();
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const Toolkit = ToolkitSVG;
|
const Toolkit = ToolkitSVG;
|
||||||
|
@ -20,11 +20,11 @@ const Toolkit = require('./Toolkit').default;
|
|||||||
|
|
||||||
const Workspace = new Class({
|
const Workspace = new Class({
|
||||||
Extends: Element,
|
Extends: Element,
|
||||||
initialize(attributes) {
|
initialize: function (attributes) {
|
||||||
this._htmlContainer = this._createDivContainer();
|
this._htmlContainer = this._createDivContainer();
|
||||||
|
|
||||||
const peer = Toolkit.createWorkspace(this._htmlContainer);
|
var peer = Toolkit.createWorkspace(this._htmlContainer);
|
||||||
const defaultAttributes = {
|
var defaultAttributes = {
|
||||||
width: '200px',
|
width: '200px',
|
||||||
height: '200px',
|
height: '200px',
|
||||||
stroke: '1px solid #edf1be',
|
stroke: '1px solid #edf1be',
|
||||||
@ -32,27 +32,27 @@ const Workspace = new Class({
|
|||||||
coordOrigin: '0 0',
|
coordOrigin: '0 0',
|
||||||
coordSize: '200 200',
|
coordSize: '200 200',
|
||||||
};
|
};
|
||||||
for (const key in attributes) {
|
for (var key in attributes) {
|
||||||
defaultAttributes[key] = attributes[key];
|
defaultAttributes[key] = attributes[key];
|
||||||
}
|
}
|
||||||
this.parent(peer, defaultAttributes);
|
this.parent(peer, defaultAttributes);
|
||||||
this._htmlContainer.append(this._peer._native);
|
this._htmlContainer.append(this._peer._native);
|
||||||
},
|
},
|
||||||
|
|
||||||
getType() {
|
getType: function () {
|
||||||
return 'Workspace';
|
return 'Workspace';
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Appends an element as a child to the object.
|
* Appends an element as a child to the object.
|
||||||
*/
|
*/
|
||||||
append(element) {
|
append: function (element) {
|
||||||
if (!$defined(element)) {
|
if (!$defined(element)) {
|
||||||
throw 'Child element can not be null';
|
throw 'Child element can not be null';
|
||||||
}
|
}
|
||||||
const elementType = element.getType();
|
var elementType = element.getType();
|
||||||
if (elementType == null) {
|
if (elementType == null) {
|
||||||
throw `It seems not to be an element ->${element}`;
|
throw 'It seems not to be an element ->' + element;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elementType == 'Workspace') {
|
if (elementType == 'Workspace') {
|
||||||
@ -62,7 +62,7 @@ const Workspace = new Class({
|
|||||||
this._peer.append(element._peer);
|
this._peer.append(element._peer);
|
||||||
},
|
},
|
||||||
|
|
||||||
addItAsChildTo(element) {
|
addItAsChildTo: function (element) {
|
||||||
if (!$defined(element)) {
|
if (!$defined(element)) {
|
||||||
throw 'Workspace div container can not be null';
|
throw 'Workspace div container can not be null';
|
||||||
}
|
}
|
||||||
@ -72,8 +72,8 @@ const Workspace = new Class({
|
|||||||
/**
|
/**
|
||||||
* Create a new div element that will be responsible for containing the workspace elements.
|
* Create a new div element that will be responsible for containing the workspace elements.
|
||||||
*/
|
*/
|
||||||
_createDivContainer() {
|
_createDivContainer: function () {
|
||||||
const container = window.document.createElement('div');
|
var container = window.document.createElement('div');
|
||||||
container.id = 'workspaceContainer';
|
container.id = 'workspaceContainer';
|
||||||
// container.style.overflow = "hidden";
|
// container.style.overflow = "hidden";
|
||||||
container.style.position = 'relative';
|
container.style.position = 'relative';
|
||||||
@ -93,7 +93,7 @@ const Workspace = new Class({
|
|||||||
* pt (points; 1pt=1/72in)
|
* pt (points; 1pt=1/72in)
|
||||||
* pc (picas; 1pc=12pt)
|
* pc (picas; 1pc=12pt)
|
||||||
*/
|
*/
|
||||||
setSize(width, height) {
|
setSize: function (width, height) {
|
||||||
// HTML container must have the size of the group element.
|
// HTML container must have the size of the group element.
|
||||||
if ($defined(width)) {
|
if ($defined(width)) {
|
||||||
this._htmlContainer.css('width', width);
|
this._htmlContainer.css('width', width);
|
||||||
@ -112,21 +112,21 @@ const Workspace = new Class({
|
|||||||
* Consequently CSS2 position attributes (left, top, width, height and so on) have no unit specifier -
|
* Consequently CSS2 position attributes (left, top, width, height and so on) have no unit specifier -
|
||||||
* they are simple numbers, not CSS length quantities.
|
* they are simple numbers, not CSS length quantities.
|
||||||
*/
|
*/
|
||||||
setCoordSize(width, height) {
|
setCoordSize: function (width, height) {
|
||||||
this._peer.setCoordSize(width, height);
|
this._peer.setCoordSize(width, height);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Todo: Complete Doc
|
* @Todo: Complete Doc
|
||||||
*/
|
*/
|
||||||
setCoordOrigin(x, y) {
|
setCoordOrigin: function (x, y) {
|
||||||
this._peer.setCoordOrigin(x, y);
|
this._peer.setCoordOrigin(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Todo: Complete Doc
|
* @Todo: Complete Doc
|
||||||
*/
|
*/
|
||||||
getCoordOrigin() {
|
getCoordOrigin: function () {
|
||||||
return this._peer.getCoordOrigin();
|
return this._peer.getCoordOrigin();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -134,47 +134,47 @@ const Workspace = new Class({
|
|||||||
/**
|
/**
|
||||||
* All the SVG elements will be children of this HTML element.
|
* All the SVG elements will be children of this HTML element.
|
||||||
*/
|
*/
|
||||||
_getHtmlContainer() {
|
_getHtmlContainer: function () {
|
||||||
return this._htmlContainer;
|
return this._htmlContainer;
|
||||||
},
|
},
|
||||||
|
|
||||||
setFill(color, opacity) {
|
setFill: function (color, opacity) {
|
||||||
this._htmlContainer.css('background-color', color);
|
this._htmlContainer.css('background-color', color);
|
||||||
if (opacity || opacity === 0) {
|
if (opacity || opacity === 0) {
|
||||||
throw 'Unsupported operation. Opacity not supported.';
|
throw 'Unsupported operation. Opacity not supported.';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getFill() {
|
getFill: function () {
|
||||||
const color = this._htmlContainer.css('background-color');
|
var color = this._htmlContainer.css('background-color');
|
||||||
return { color };
|
return { color: color };
|
||||||
},
|
},
|
||||||
|
|
||||||
getSize() {
|
getSize: function () {
|
||||||
const width = this._htmlContainer.css('width');
|
var width = this._htmlContainer.css('width');
|
||||||
const height = this._htmlContainer.css('height');
|
var height = this._htmlContainer.css('height');
|
||||||
return { width, height };
|
return { width: width, height: height };
|
||||||
},
|
},
|
||||||
|
|
||||||
setStroke(width, style, color, opacity) {
|
setStroke: function (width, style, color, opacity) {
|
||||||
if (style != 'solid') {
|
if (style != 'solid') {
|
||||||
throw `Not supported style stroke style:${style}`;
|
throw 'Not supported style stroke style:' + style;
|
||||||
}
|
}
|
||||||
this._htmlContainer.css('border', `${width} ${style} ${color}`);
|
this._htmlContainer.css('border', width + ' ' + style + ' ' + color);
|
||||||
|
|
||||||
if (opacity || opacity === 0) {
|
if (opacity || opacity === 0) {
|
||||||
throw 'Unsupported operation. Opacity not supported.';
|
throw 'Unsupported operation. Opacity not supported.';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getCoordSize() {
|
getCoordSize: function () {
|
||||||
return this._peer.getCoordSize();
|
return this._peer.getCoordSize();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove an element as a child to the object.
|
* Remove an element as a child to the object.
|
||||||
*/
|
*/
|
||||||
removeChild(element) {
|
removeChild: function (element) {
|
||||||
if (!$defined(element)) {
|
if (!$defined(element)) {
|
||||||
throw 'Child element can not be null';
|
throw 'Child element can not be null';
|
||||||
}
|
}
|
||||||
@ -183,16 +183,16 @@ const Workspace = new Class({
|
|||||||
throw "It's not possible to add the group as a child of itself";
|
throw "It's not possible to add the group as a child of itself";
|
||||||
}
|
}
|
||||||
|
|
||||||
const elementType = element.getType();
|
var elementType = element.getType();
|
||||||
if (elementType == null) {
|
if (elementType == null) {
|
||||||
throw `It seems not to be an element ->${element}`;
|
throw 'It seems not to be an element ->' + element;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._peer.removeChild(element._peer);
|
this._peer.removeChild(element._peer);
|
||||||
},
|
},
|
||||||
|
|
||||||
dumpNativeChart() {
|
dumpNativeChart: function () {
|
||||||
const elem = this._htmlContainer;
|
var elem = this._htmlContainer;
|
||||||
return elem.innerHTML;
|
return elem.innerHTML;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
24
packages/web2d/lib/components/header.js
Normal file
24
packages/web2d/lib/components/header.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright [2015] [wisemapping]
|
||||||
|
*
|
||||||
|
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||||
|
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||||
|
* "powered by wisemapping" text requirement on every single page;
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the license at
|
||||||
|
*
|
||||||
|
* http://www.wisemapping.org/license
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var web2d = {};
|
||||||
|
web2d.peer =
|
||||||
|
{
|
||||||
|
svg: {}
|
||||||
|
};
|
||||||
|
web2d.peer.utils = {};
|
@ -15,22 +15,22 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
const Font = require('./Font').default;
|
const Font = require('./Font').default
|
||||||
|
|
||||||
const ArialFont = new Class({
|
const ArialFont = new Class({
|
||||||
Extends: Font,
|
Extends: Font,
|
||||||
initialize() {
|
initialize :function() {
|
||||||
this.parent();
|
this.parent();
|
||||||
this._fontFamily = 'Arial';
|
this._fontFamily = "Arial";
|
||||||
},
|
},
|
||||||
|
|
||||||
getFontFamily() {
|
getFontFamily : function () {
|
||||||
return this._fontFamily;
|
return this._fontFamily;
|
||||||
},
|
},
|
||||||
|
|
||||||
getFont() {
|
getFont : function () {
|
||||||
return Font.ARIAL;
|
return Font.ARIAL;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default ArialFont;
|
export default ArialFont
|
||||||
|
@ -16,69 +16,70 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ElementPeer = require('./ElementPeer').default;
|
const ElementPeer = require('./ElementPeer').default
|
||||||
|
|
||||||
const ArrowPeer = new Class({
|
const ArrowPeer = new Class({
|
||||||
Extends: ElementPeer,
|
Extends: ElementPeer,
|
||||||
initialize() {
|
initialize : function() {
|
||||||
const svgElement = window.document.createElementNS(this.svgNamespace, 'path');
|
var svgElement = window.document.createElementNS(this.svgNamespace, 'path');
|
||||||
this.parent(svgElement);
|
this.parent(svgElement);
|
||||||
this._style = {};
|
this._style = {};
|
||||||
this._controlPoint = new core.Point();
|
this._controlPoint = new core.Point();
|
||||||
this._fromPoint = new core.Point();
|
this._fromPoint = new core.Point();
|
||||||
},
|
},
|
||||||
|
|
||||||
setFrom(x, y) {
|
setFrom : function(x, y) {
|
||||||
this._fromPoint.x = x;
|
this._fromPoint.x = x;
|
||||||
this._fromPoint.y = y;
|
this._fromPoint.y = y;
|
||||||
this._redraw();
|
this._redraw();
|
||||||
},
|
},
|
||||||
|
|
||||||
setControlPoint(point) {
|
setControlPoint : function (point) {
|
||||||
this._controlPoint = point;
|
this._controlPoint = point;
|
||||||
this._redraw();
|
this._redraw();
|
||||||
},
|
},
|
||||||
|
|
||||||
setStrokeColor(color) {
|
setStrokeColor : function (color) {
|
||||||
this.setStroke(null, null, color, null);
|
this.setStroke(null, null, color, null);
|
||||||
},
|
},
|
||||||
|
|
||||||
setStrokeWidth(width) {
|
setStrokeWidth : function(width) {
|
||||||
this.setStroke(width);
|
this.setStroke(width);
|
||||||
},
|
},
|
||||||
|
|
||||||
setDashed(isDashed, length, spacing) {
|
setDashed : function(isDashed, length, spacing) {
|
||||||
if ($defined(isDashed) && isDashed && $defined(length) && $defined(spacing)) {
|
if ($defined(isDashed) && isDashed && $defined(length) && $defined(spacing)) {
|
||||||
this._native.setAttribute('stroke-dasharray', `${length},${spacing}`);
|
this._native.setAttribute("stroke-dasharray", length + "," + spacing);
|
||||||
} else {
|
} else {
|
||||||
this._native.setAttribute('stroke-dasharray', '');
|
this._native.setAttribute("stroke-dasharray", "");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateStyle() {
|
_updateStyle : function() {
|
||||||
let style = '';
|
var style = "";
|
||||||
for (const key in this._style) {
|
for (var key in this._style) {
|
||||||
style += `${key}:${this._style[key]} `;
|
style += key + ":" + this._style[key] + " ";
|
||||||
}
|
}
|
||||||
this._native.setAttribute('style', style);
|
this._native.setAttribute("style", style);
|
||||||
},
|
},
|
||||||
|
|
||||||
_redraw() {
|
_redraw : function() {
|
||||||
let x; let y; let xp; let
|
var x,y, xp, yp;
|
||||||
yp;
|
|
||||||
if ($defined(this._fromPoint.x) && $defined(this._fromPoint.y) && $defined(this._controlPoint.x) && $defined(this._controlPoint.y)) {
|
if ($defined(this._fromPoint.x) && $defined(this._fromPoint.y) && $defined(this._controlPoint.x) && $defined(this._controlPoint.y)) {
|
||||||
if (this._controlPoint.y == 0) this._controlPoint.y = 1;
|
|
||||||
|
|
||||||
const y0 = this._controlPoint.y;
|
if (this._controlPoint.y == 0)
|
||||||
const x0 = this._controlPoint.x;
|
this._controlPoint.y = 1;
|
||||||
const x2 = x0 + y0;
|
|
||||||
const y2 = y0 - x0;
|
var y0 = this._controlPoint.y;
|
||||||
const x3 = x0 - y0;
|
var x0 = this._controlPoint.x;
|
||||||
const y3 = y0 + x0;
|
var x2 = x0 + y0;
|
||||||
const m = y2 / x2;
|
var y2 = y0 - x0;
|
||||||
const mp = y3 / x3;
|
var x3 = x0 - y0;
|
||||||
const l = 6;
|
var y3 = y0 + x0;
|
||||||
const { pow } = Math;
|
var m = y2 / x2;
|
||||||
|
var mp = y3 / x3;
|
||||||
|
var l = 6;
|
||||||
|
var pow = Math.pow;
|
||||||
x = (x2 == 0 ? 0 : Math.sqrt(pow(l, 2) / (1 + pow(m, 2))));
|
x = (x2 == 0 ? 0 : Math.sqrt(pow(l, 2) / (1 + pow(m, 2))));
|
||||||
x *= Math.sign(x2);
|
x *= Math.sign(x2);
|
||||||
y = (x2 == 0 ? l * Math.sign(y2) : m * x);
|
y = (x2 == 0 ? l * Math.sign(y2) : m * x);
|
||||||
@ -86,13 +87,14 @@ const ArrowPeer = new Class({
|
|||||||
xp *= Math.sign(x3);
|
xp *= Math.sign(x3);
|
||||||
yp = (x3 == 0 ? l * Math.sign(y3) : mp * xp);
|
yp = (x3 == 0 ? l * Math.sign(y3) : mp * xp);
|
||||||
|
|
||||||
const path = `M${this._fromPoint.x},${this._fromPoint.y} `
|
var path = "M" + this._fromPoint.x + "," + this._fromPoint.y + " "
|
||||||
+ `L${x + this._fromPoint.x},${y + this._fromPoint.y
|
+ "L" + (x + this._fromPoint.x) + "," + (y + this._fromPoint.y)
|
||||||
}M${this._fromPoint.x},${this._fromPoint.y} `
|
+ "M" + this._fromPoint.x + "," + this._fromPoint.y + " "
|
||||||
+ `L${xp + this._fromPoint.x},${yp + this._fromPoint.y}`;
|
+ "L" + (xp + this._fromPoint.x) + "," + (yp + this._fromPoint.y)
|
||||||
this._native.setAttribute('d', path);
|
;
|
||||||
|
this._native.setAttribute("d", path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default ArrowPeer;
|
export default ArrowPeer;
|
||||||
|
@ -20,8 +20,8 @@ const ElementPeer = require('./ElementPeer').default;
|
|||||||
|
|
||||||
const CurvedLinePeer = new Class({
|
const CurvedLinePeer = new Class({
|
||||||
Extends: ElementPeer,
|
Extends: ElementPeer,
|
||||||
initialize() {
|
initialize :function() {
|
||||||
const svgElement = window.document.createElementNS(this.svgNamespace, 'path');
|
var svgElement = window.document.createElementNS(this.svgNamespace, 'path');
|
||||||
this.parent(svgElement);
|
this.parent(svgElement);
|
||||||
this._style = {fill:'#495879'};
|
this._style = {fill:'#495879'};
|
||||||
this._updateStyle();
|
this._updateStyle();
|
||||||
@ -32,146 +32,155 @@ const CurvedLinePeer = new Class({
|
|||||||
this._lineStyle = true;
|
this._lineStyle = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
setSrcControlPoint(control) {
|
|
||||||
|
setSrcControlPoint : function(control) {
|
||||||
this._customControlPoint_1 = true;
|
this._customControlPoint_1 = true;
|
||||||
const change = this._control1.x != control.x || this._control1.y != control.y;
|
var change = this._control1.x != control.x || this._control1.y != control.y;
|
||||||
if ($defined(control.x)) {
|
if ($defined(control.x)) {
|
||||||
this._control1 = control;
|
this._control1 = control;
|
||||||
this._control1.x = parseInt(this._control1.x);
|
this._control1.x = parseInt(this._control1.x);
|
||||||
this._control1.y = parseInt(this._control1.y);
|
this._control1.y = parseInt(this._control1.y)
|
||||||
}
|
}
|
||||||
if (change) this._updatePath();
|
if (change)
|
||||||
|
this._updatePath();
|
||||||
},
|
},
|
||||||
|
|
||||||
setDestControlPoint(control) {
|
setDestControlPoint : function(control) {
|
||||||
this._customControlPoint_2 = true;
|
this._customControlPoint_2 = true;
|
||||||
const change = this._control2.x != control.x || this._control2.y != control.y;
|
var change = this._control2.x != control.x || this._control2.y != control.y;
|
||||||
if ($defined(control.x)) {
|
if ($defined(control.x)) {
|
||||||
this._control2 = control;
|
this._control2 = control;
|
||||||
this._control2.x = parseInt(this._control2.x);
|
this._control2.x = parseInt(this._control2.x);
|
||||||
this._control2.y = parseInt(this._control2.y);
|
this._control2.y = parseInt(this._control2.y)
|
||||||
}
|
}
|
||||||
if (change) this._updatePath();
|
if (change)
|
||||||
|
this._updatePath();
|
||||||
},
|
},
|
||||||
|
|
||||||
isSrcControlPointCustom() {
|
isSrcControlPointCustom : function() {
|
||||||
return this._customControlPoint_1;
|
return this._customControlPoint_1;
|
||||||
},
|
},
|
||||||
|
|
||||||
isDestControlPointCustom() {
|
isDestControlPointCustom : function() {
|
||||||
return this._customControlPoint_2;
|
return this._customControlPoint_2;
|
||||||
},
|
},
|
||||||
|
|
||||||
setIsSrcControlPointCustom(isCustom) {
|
setIsSrcControlPointCustom : function(isCustom) {
|
||||||
this._customControlPoint_1 = isCustom;
|
this._customControlPoint_1 = isCustom;
|
||||||
},
|
},
|
||||||
|
|
||||||
setIsDestControlPointCustom(isCustom) {
|
setIsDestControlPointCustom : function(isCustom) {
|
||||||
this._customControlPoint_2 = isCustom;
|
this._customControlPoint_2 = isCustom;
|
||||||
},
|
},
|
||||||
|
|
||||||
getControlPoints() {
|
|
||||||
|
getControlPoints : function() {
|
||||||
return [this._control1, this._control2];
|
return [this._control1, this._control2];
|
||||||
},
|
},
|
||||||
|
|
||||||
setFrom(x1, y1) {
|
setFrom : function(x1, y1) {
|
||||||
const change = this._x1 != parseInt(x1) || this._y1 != parseInt(y1);
|
var change = this._x1 != parseInt(x1) || this._y1 != parseInt(y1);
|
||||||
this._x1 = parseInt(x1);
|
this._x1 = parseInt(x1);
|
||||||
this._y1 = parseInt(y1);
|
this._y1 = parseInt(y1);
|
||||||
if (change) this._updatePath();
|
if (change)
|
||||||
|
this._updatePath();
|
||||||
},
|
},
|
||||||
|
|
||||||
setTo(x2, y2) {
|
setTo : function(x2, y2) {
|
||||||
const change = this._x2 != parseInt(x2) || this._y2 != parseInt(y2);
|
var change = this._x2 != parseInt(x2) || this._y2 != parseInt(y2);
|
||||||
this._x2 = parseInt(x2);
|
this._x2 = parseInt(x2);
|
||||||
this._y2 = parseInt(y2);
|
this._y2 = parseInt(y2);
|
||||||
if (change) this._updatePath();
|
if (change)
|
||||||
|
this._updatePath();
|
||||||
},
|
},
|
||||||
|
|
||||||
getFrom() {
|
getFrom : function() {
|
||||||
return new core.Point(this._x1, this._y1);
|
return new core.Point(this._x1, this._y1);
|
||||||
},
|
},
|
||||||
|
|
||||||
getTo() {
|
getTo : function() {
|
||||||
return new core.Point(this._x2, this._y2);
|
return new core.Point(this._x2, this._y2);
|
||||||
},
|
},
|
||||||
|
|
||||||
setStrokeWidth(width) {
|
setStrokeWidth : function(width) {
|
||||||
this._style['stroke-width'] = width;
|
this._style['stroke-width'] = width;
|
||||||
this._updateStyle();
|
this._updateStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
setColor(color) {
|
setColor : function(color) {
|
||||||
this._style.stroke = color;
|
this._style['stroke'] = color;
|
||||||
this._style.fill = color;
|
this._style['fill'] = color;
|
||||||
this._updateStyle();
|
this._updateStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
updateLine(avoidControlPointFix) {
|
updateLine : function(avoidControlPointFix) {
|
||||||
this._updatePath(avoidControlPointFix);
|
this._updatePath(avoidControlPointFix);
|
||||||
},
|
},
|
||||||
|
|
||||||
setLineStyle(style) {
|
setLineStyle : function (style) {
|
||||||
this._lineStyle = style;
|
this._lineStyle = style;
|
||||||
if (this._lineStyle) {
|
if (this._lineStyle) {
|
||||||
this._style.fill = this._fill;
|
this._style['fill'] = this._fill;
|
||||||
} else {
|
} else {
|
||||||
this._fill = this._style.fill;
|
this._fill = this._style['fill'];
|
||||||
this._style.fill = 'none';
|
this._style['fill'] = 'none';
|
||||||
}
|
}
|
||||||
this._updateStyle();
|
this._updateStyle();
|
||||||
this.updateLine();
|
this.updateLine();
|
||||||
},
|
},
|
||||||
|
|
||||||
getLineStyle() {
|
getLineStyle : function () {
|
||||||
return this._lineStyle;
|
return this._lineStyle;
|
||||||
},
|
},
|
||||||
|
|
||||||
setShowEndArrow(visible) {
|
|
||||||
|
setShowEndArrow : function(visible) {
|
||||||
this._showEndArrow = visible;
|
this._showEndArrow = visible;
|
||||||
this.updateLine();
|
this.updateLine();
|
||||||
},
|
},
|
||||||
|
|
||||||
isShowEndArrow() {
|
isShowEndArrow : function() {
|
||||||
return this._showEndArrow;
|
return this._showEndArrow;
|
||||||
},
|
},
|
||||||
|
|
||||||
setShowStartArrow(visible) {
|
setShowStartArrow : function(visible) {
|
||||||
this._showStartArrow = visible;
|
this._showStartArrow = visible;
|
||||||
this.updateLine();
|
this.updateLine();
|
||||||
},
|
},
|
||||||
|
|
||||||
isShowStartArrow() {
|
isShowStartArrow : function() {
|
||||||
return this._showStartArrow;
|
return this._showStartArrow;
|
||||||
},
|
},
|
||||||
|
|
||||||
_updatePath(avoidControlPointFix) {
|
|
||||||
|
_updatePath : function(avoidControlPointFix) {
|
||||||
if ($defined(this._x1) && $defined(this._y1) && $defined(this._x2) && $defined(this._y2)) {
|
if ($defined(this._x1) && $defined(this._y1) && $defined(this._x2) && $defined(this._y2)) {
|
||||||
this._calculateAutoControlPoints(avoidControlPointFix);
|
this._calculateAutoControlPoints(avoidControlPointFix);
|
||||||
const path = `M${this._x1},${this._y1
|
var path = "M" + this._x1 + "," + this._y1
|
||||||
} C${this._control1.x + this._x1},${this._control1.y + this._y1} ${
|
+ " C" + (this._control1.x + this._x1) + "," + (this._control1.y + this._y1) + " "
|
||||||
this._control2.x + this._x2},${this._control2.y + this._y2} ${
|
+ (this._control2.x + this._x2) + "," + (this._control2.y + this._y2) + " "
|
||||||
this._x2},${this._y2
|
+ this._x2 + "," + this._y2 +
|
||||||
}${this._lineStyle ? ` ${
|
(this._lineStyle ? " "
|
||||||
this._control2.x + this._x2},${this._control2.y + this._y2 + 3} ${
|
+ (this._control2.x + this._x2) + "," + (this._control2.y + this._y2 + 3) + " "
|
||||||
this._control1.x + this._x1},${this._control1.y + this._y1 + 5} ${
|
+ (this._control1.x + this._x1) + "," + (this._control1.y + this._y1 + 5) + " "
|
||||||
this._x1},${this._y1 + 7} Z`
|
+ this._x1 + "," + (this._y1 + 7) + " Z"
|
||||||
: ''}`;
|
: ""
|
||||||
this._native.setAttribute('d', path);
|
);
|
||||||
|
this._native.setAttribute("d", path);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateStyle() {
|
_updateStyle : function() {
|
||||||
let style = '';
|
var style = "";
|
||||||
for (const key in this._style) {
|
for (var key in this._style) {
|
||||||
style += `${key}:${this._style[key]} `;
|
style += key + ":" + this._style[key] + " ";
|
||||||
}
|
}
|
||||||
this._native.setAttribute('style', style);
|
this._native.setAttribute("style", style);
|
||||||
},
|
},
|
||||||
|
|
||||||
_calculateAutoControlPoints(avoidControlPointFix) {
|
_calculateAutoControlPoints : function(avoidControlPointFix) {
|
||||||
//Both points available, calculate real points
|
//Both points available, calculate real points
|
||||||
const defaultpoints = Shape.calculateDefaultControlPoints(new core.Point(this._x1, this._y1), new core.Point(this._x2, this._y2));
|
var defaultpoints = Shape.calculateDefaultControlPoints(new core.Point(this._x1, this._y1), new core.Point(this._x2, this._y2));
|
||||||
if (!this._customControlPoint_1 && !($defined(avoidControlPointFix) && avoidControlPointFix == 0)) {
|
if (!this._customControlPoint_1 && !($defined(avoidControlPointFix) && avoidControlPointFix == 0)) {
|
||||||
this._control1.x = defaultpoints[0].x;
|
this._control1.x = defaultpoints[0].x;
|
||||||
this._control1.y = defaultpoints[0].y;
|
this._control1.y = defaultpoints[0].y;
|
||||||
@ -182,13 +191,14 @@ const CurvedLinePeer = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setDashed(length, spacing) {
|
setDashed : function(length, spacing) {
|
||||||
if ($defined(length) && $defined(spacing)) {
|
if ($defined(length) && $defined(spacing)) {
|
||||||
this._native.setAttribute('stroke-dasharray', `${length},${spacing}`);
|
this._native.setAttribute("stroke-dasharray", length + "," + spacing);
|
||||||
} else {
|
} else {
|
||||||
this._native.setAttribute('stroke-dasharray', '');
|
this._native.setAttribute("stroke-dasharray", "");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default CurvedLinePeer;
|
export default CurvedLinePeer;
|
||||||
|
@ -20,11 +20,11 @@ const TransformUtil = require('../utils/TransformUtils').default; //eslint-disab
|
|||||||
const Element = require('../../Element').default; //eslint-disable-line
|
const Element = require('../../Element').default; //eslint-disable-line
|
||||||
|
|
||||||
const ElementPeer = new Class({ //eslint-disable-line
|
const ElementPeer = new Class({ //eslint-disable-line
|
||||||
initialize(svgElement) {
|
initialize: function (svgElement) {
|
||||||
this._native = svgElement;
|
this._native = svgElement;
|
||||||
if (!this._native.addEvent) {
|
if (!this._native.addEvent) {
|
||||||
// Hack bug: https://bugzilla.mozilla.org/show_bug.cgi?id=740811
|
// Hack bug: https://bugzilla.mozilla.org/show_bug.cgi?id=740811
|
||||||
for (const key in Element) {
|
for (var key in Element) {
|
||||||
this._native[key] = Element.prototype[key];
|
this._native[key] = Element.prototype[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -34,12 +34,12 @@ const ElementPeer = new Class({ //eslint-disable-line
|
|||||||
// http://support.adobe.com/devsup/devsup.nsf/docs/50493.htm
|
// http://support.adobe.com/devsup/devsup.nsf/docs/50493.htm
|
||||||
},
|
},
|
||||||
|
|
||||||
setChildren(children) {
|
setChildren: function (children) {
|
||||||
this._children = children;
|
this._children = children;
|
||||||
},
|
},
|
||||||
|
|
||||||
getChildren() {
|
getChildren: function () {
|
||||||
let result = this._children;
|
var result = this._children;
|
||||||
if (!$defined(result)) { //eslint-disable-line
|
if (!$defined(result)) { //eslint-disable-line
|
||||||
result = [];
|
result = [];
|
||||||
this._children = result;
|
this._children = result;
|
||||||
@ -47,18 +47,18 @@ const ElementPeer = new Class({ //eslint-disable-line
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
getParent() {
|
getParent: function () {
|
||||||
return this._parent;
|
return this._parent;
|
||||||
},
|
},
|
||||||
|
|
||||||
setParent(parent) {
|
setParent: function (parent) {
|
||||||
this._parent = parent;
|
this._parent = parent;
|
||||||
},
|
},
|
||||||
|
|
||||||
append(elementPeer) {
|
append: function (elementPeer) {
|
||||||
// Store parent and child relationship.
|
// Store parent and child relationship.
|
||||||
elementPeer.setParent(this);
|
elementPeer.setParent(this);
|
||||||
const children = this.getChildren();
|
var children = this.getChildren();
|
||||||
children.include(elementPeer);
|
children.include(elementPeer);
|
||||||
|
|
||||||
// Append element as a child.
|
// Append element as a child.
|
||||||
@ -68,13 +68,13 @@ const ElementPeer = new Class({ //eslint-disable-line
|
|||||||
EventUtils.broadcastChangeEvent(this, 'strokeStyle');
|
EventUtils.broadcastChangeEvent(this, 'strokeStyle');
|
||||||
},
|
},
|
||||||
|
|
||||||
removeChild(elementPeer) {
|
removeChild: function (elementPeer) {
|
||||||
// Store parent and child relationship.
|
// Store parent and child relationship.
|
||||||
elementPeer.setParent(null);
|
elementPeer.setParent(null);
|
||||||
const children = this.getChildren();
|
var children = this.getChildren();
|
||||||
|
|
||||||
// Remove from children array ...
|
// Remove from children array ...
|
||||||
const oldLength = children.length;
|
var oldLength = children.length;
|
||||||
|
|
||||||
children.erase(elementPeer);
|
children.erase(elementPeer);
|
||||||
$assert(children.length < oldLength, 'element could not be removed:' + elementPeer); //eslint-disable-line
|
$assert(children.length < oldLength, 'element could not be removed:' + elementPeer); //eslint-disable-line
|
||||||
@ -87,23 +87,23 @@ const ElementPeer = new Class({ //eslint-disable-line
|
|||||||
* http://www.w3.org/TR/DOM-Level-3-Events/events.html
|
* http://www.w3.org/TR/DOM-Level-3-Events/events.html
|
||||||
* http://developer.mozilla.org/en/docs/addEvent
|
* http://developer.mozilla.org/en/docs/addEvent
|
||||||
*/
|
*/
|
||||||
addEvent(type, listener) {
|
addEvent: function (type, listener) {
|
||||||
$(this._native).bind(type, listener); //eslint-disable-line
|
$(this._native).bind(type, listener); //eslint-disable-line
|
||||||
},
|
},
|
||||||
|
|
||||||
trigger(type, event) {
|
trigger: function (type, event) {
|
||||||
$(this._native).trigger(type, event); //eslint-disable-line
|
$(this._native).trigger(type, event); //eslint-disable-line
|
||||||
},
|
},
|
||||||
|
|
||||||
cloneEvents(from) {
|
cloneEvents: function (from) {
|
||||||
this._native.cloneEvents(from);
|
this._native.cloneEvents(from);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeEvent(type, listener) {
|
removeEvent: function (type, listener) {
|
||||||
$(this._native).unbind(type, listener); //eslint-disable-line
|
$(this._native).unbind(type, listener); //eslint-disable-line
|
||||||
},
|
},
|
||||||
|
|
||||||
setSize(width, height) {
|
setSize: function (width, height) {
|
||||||
if ($defined(width) && this._size.width != parseInt(width)) { //eslint-disable-line
|
if ($defined(width) && this._size.width != parseInt(width)) { //eslint-disable-line
|
||||||
this._size.width = parseInt(width);
|
this._size.width = parseInt(width);
|
||||||
this._native.setAttribute('width', parseInt(width));
|
this._native.setAttribute('width', parseInt(width));
|
||||||
@ -117,11 +117,11 @@ const ElementPeer = new Class({ //eslint-disable-line
|
|||||||
EventUtils.broadcastChangeEvent(this, 'strokeStyle');
|
EventUtils.broadcastChangeEvent(this, 'strokeStyle');
|
||||||
},
|
},
|
||||||
|
|
||||||
getSize() {
|
getSize: function () {
|
||||||
return { width: this._size.width, height: this._size.height };
|
return { width: this._size.width, height: this._size.height };
|
||||||
},
|
},
|
||||||
|
|
||||||
setFill(color, opacity) {
|
setFill: function (color, opacity) {
|
||||||
if ($defined(color)) { //eslint-disable-line
|
if ($defined(color)) { //eslint-disable-line
|
||||||
this._native.setAttribute('fill', color);
|
this._native.setAttribute('fill', color);
|
||||||
}
|
}
|
||||||
@ -130,45 +130,43 @@ const ElementPeer = new Class({ //eslint-disable-line
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getFill() {
|
getFill: function () {
|
||||||
const color = this._native.getAttribute('fill');
|
var color = this._native.getAttribute('fill');
|
||||||
const opacity = this._native.getAttribute('fill-opacity');
|
var opacity = this._native.getAttribute('fill-opacity');
|
||||||
return { color, opacity: Number(opacity) };
|
return { color: color, opacity: Number(opacity) };
|
||||||
},
|
},
|
||||||
|
|
||||||
getStroke() {
|
getStroke: function () {
|
||||||
const vmlStroke = this._native;
|
var vmlStroke = this._native;
|
||||||
const color = vmlStroke.getAttribute('stroke');
|
var color = vmlStroke.getAttribute('stroke');
|
||||||
const dashstyle = this._stokeStyle;
|
var dashstyle = this._stokeStyle;
|
||||||
const opacity = vmlStroke.getAttribute('stroke-opacity');
|
var opacity = vmlStroke.getAttribute('stroke-opacity');
|
||||||
const width = vmlStroke.getAttribute('stroke-width');
|
var width = vmlStroke.getAttribute('stroke-width');
|
||||||
return {
|
return { color: color, style: dashstyle, opacity: opacity, width: width };
|
||||||
color, style: dashstyle, opacity, width,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setStroke(width, style, color, opacity) {
|
setStroke: function (width, style, color, opacity) {
|
||||||
if ($defined(width)) { //eslint-disable-line
|
if ($defined(width)) { //eslint-disable-line
|
||||||
this._native.setAttribute('stroke-width', `${width}px`);
|
this._native.setAttribute('stroke-width', width + 'px');
|
||||||
}
|
}
|
||||||
if ($defined(color)) { //eslint-disable-line
|
if ($defined(color)) { //eslint-disable-line
|
||||||
this._native.setAttribute('stroke', color);
|
this._native.setAttribute('stroke', color);
|
||||||
}
|
}
|
||||||
if ($defined(style)) { //eslint-disable-line
|
if ($defined(style)) { //eslint-disable-line
|
||||||
// Scale the dash array in order to be equal to VML. In VML, stroke style doesn't scale.
|
// Scale the dash array in order to be equal to VML. In VML, stroke style doesn't scale.
|
||||||
const dashArrayPoints = this.__stokeStyleToStrokDasharray[style];
|
var dashArrayPoints = this.__stokeStyleToStrokDasharray[style];
|
||||||
const scale = 1 / TransformUtil.workoutScale(this).width;
|
var scale = 1 / TransformUtil.workoutScale(this).width;
|
||||||
|
|
||||||
let strokeWidth = this._native.getAttribute('stroke-width');
|
var strokeWidth = this._native.getAttribute('stroke-width');
|
||||||
strokeWidth = parseFloat(strokeWidth);
|
strokeWidth = parseFloat(strokeWidth);
|
||||||
|
|
||||||
const scaledPoints = [];
|
var scaledPoints = [];
|
||||||
for (let i = 0; i < dashArrayPoints.length; i++) {
|
for (var i = 0; i < dashArrayPoints.length; i++) {
|
||||||
// VML scale the stroke based on the stroke width.
|
// VML scale the stroke based on the stroke width.
|
||||||
scaledPoints[i] = dashArrayPoints[i] * strokeWidth;
|
scaledPoints[i] = dashArrayPoints[i] * strokeWidth;
|
||||||
|
|
||||||
// Scale the points based on the scale.
|
// Scale the points based on the scale.
|
||||||
scaledPoints[i] = `${scaledPoints[i] * scale}px`;
|
scaledPoints[i] = scaledPoints[i] * scale + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
// this._native.setAttribute('stroke-dasharray', scaledPoints);
|
// this._native.setAttribute('stroke-dasharray', scaledPoints);
|
||||||
@ -183,17 +181,17 @@ const ElementPeer = new Class({ //eslint-disable-line
|
|||||||
/*
|
/*
|
||||||
* style='visibility: visible'
|
* style='visibility: visible'
|
||||||
*/
|
*/
|
||||||
setVisibility(isVisible) {
|
setVisibility: function (isVisible) {
|
||||||
this._native.setAttribute('visibility', isVisible ? 'visible' : 'hidden');
|
this._native.setAttribute('visibility', isVisible ? 'visible' : 'hidden');
|
||||||
},
|
},
|
||||||
|
|
||||||
isVisible() {
|
isVisible: function () {
|
||||||
const visibility = this._native.getAttribute('visibility');
|
var visibility = this._native.getAttribute('visibility');
|
||||||
return !(visibility == 'hidden');
|
return !(visibility == 'hidden');
|
||||||
},
|
},
|
||||||
|
|
||||||
updateStrokeStyle() {
|
updateStrokeStyle: function () {
|
||||||
const strokeStyle = this._stokeStyle;
|
var strokeStyle = this._stokeStyle;
|
||||||
if (this.getParent()) {
|
if (this.getParent()) {
|
||||||
if (strokeStyle && strokeStyle != 'solid') {
|
if (strokeStyle && strokeStyle != 'solid') {
|
||||||
this.setStroke(null, strokeStyle);
|
this.setStroke(null, strokeStyle);
|
||||||
@ -201,16 +199,16 @@ const ElementPeer = new Class({ //eslint-disable-line
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
attachChangeEventListener(type, listener) {
|
attachChangeEventListener: function (type, listener) {
|
||||||
const listeners = this.getChangeEventListeners(type);
|
var listeners = this.getChangeEventListeners(type);
|
||||||
if (!$defined(listener)) { //eslint-disable-line
|
if (!$defined(listener)) { //eslint-disable-line
|
||||||
throw 'Listener can not be null';
|
throw 'Listener can not be null';
|
||||||
}
|
}
|
||||||
listeners.push(listener);
|
listeners.push(listener);
|
||||||
},
|
},
|
||||||
|
|
||||||
getChangeEventListeners(type) {
|
getChangeEventListeners: function (type) {
|
||||||
let listeners = this._changeListeners[type];
|
var listeners = this._changeListeners[type];
|
||||||
if (!$defined(listeners)) { //eslint-disable-line
|
if (!$defined(listeners)) { //eslint-disable-line
|
||||||
listeners = [];
|
listeners = [];
|
||||||
this._changeListeners[type] = listeners;
|
this._changeListeners[type] = listeners;
|
||||||
@ -221,18 +219,18 @@ const ElementPeer = new Class({ //eslint-disable-line
|
|||||||
/**
|
/**
|
||||||
* Move element to the front
|
* Move element to the front
|
||||||
*/
|
*/
|
||||||
moveToFront() {
|
moveToFront: function () {
|
||||||
this._native.parentNode.appendChild(this._native);
|
this._native.parentNode.appendChild(this._native);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move element to the back
|
* Move element to the back
|
||||||
*/
|
*/
|
||||||
moveToBack() {
|
moveToBack: function () {
|
||||||
this._native.parentNode.insertBefore(this._native, this._native.parentNode.firstChild);
|
this._native.parentNode.insertBefore(this._native, this._native.parentNode.firstChild);
|
||||||
},
|
},
|
||||||
|
|
||||||
setCursor(type) {
|
setCursor: function (type) {
|
||||||
this._native.style.cursor = type;
|
this._native.style.cursor = type;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -15,18 +15,18 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
const ElementPeer = require('./ElementPeer').default;
|
const ElementPeer = require('./ElementPeer').default
|
||||||
|
|
||||||
const ElipsePeer = new Class({
|
const ElipsePeer = new Class({
|
||||||
Extends: ElementPeer,
|
Extends: ElementPeer,
|
||||||
initialize() {
|
initialize : function() {
|
||||||
const svgElement = window.document.createElementNS(this.svgNamespace, 'ellipse');
|
var svgElement = window.document.createElementNS(this.svgNamespace, 'ellipse');
|
||||||
this.parent(svgElement);
|
this.parent(svgElement);
|
||||||
this.attachChangeEventListener('strokeStyle', ElementPeer.prototype.updateStrokeStyle);
|
this.attachChangeEventListener("strokeStyle", ElementPeer.prototype.updateStrokeStyle);
|
||||||
this._position = {x:0, y:0};
|
this._position = {x:0, y:0};
|
||||||
},
|
},
|
||||||
|
|
||||||
setSize(width, height) {
|
setSize : function(width, height) {
|
||||||
this.parent(width, height);
|
this.parent(width, height);
|
||||||
if ($defined(width)) {
|
if ($defined(width)) {
|
||||||
this._native.setAttribute('rx', width / 2);
|
this._native.setAttribute('rx', width / 2);
|
||||||
@ -36,14 +36,14 @@ const ElipsePeer = new Class({
|
|||||||
this._native.setAttribute('ry', height / 2);
|
this._native.setAttribute('ry', height / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pos = this.getPosition();
|
var pos = this.getPosition();
|
||||||
this.setPosition(pos.x, pos.y);
|
this.setPosition(pos.x, pos.y);
|
||||||
},
|
},
|
||||||
|
|
||||||
setPosition(cx, cy) {
|
setPosition : function(cx, cy) {
|
||||||
const size = this.getSize();
|
var size = this.getSize();
|
||||||
cx += size.width / 2;
|
cx = cx + size.width / 2;
|
||||||
cy += size.height / 2;
|
cy = cy + size.height / 2;
|
||||||
if ($defined(cx)) {
|
if ($defined(cx)) {
|
||||||
this._native.setAttribute('cx', cx);
|
this._native.setAttribute('cx', cx);
|
||||||
}
|
}
|
||||||
@ -53,9 +53,9 @@ const ElipsePeer = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getPosition() {
|
getPosition : function() {
|
||||||
return this._position;
|
return this._position;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default ElipsePeer;
|
export default ElipsePeer;
|
||||||
|
@ -17,13 +17,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const Font = new Class({
|
const Font = new Class({
|
||||||
initialize() {
|
initialize : function() {
|
||||||
this._size = 10;
|
this._size = 10;
|
||||||
this._style = 'normal';
|
this._style = "normal";
|
||||||
this._weight = 'normal';
|
this._weight = "normal";
|
||||||
},
|
},
|
||||||
|
|
||||||
init(args) {
|
init : function(args) {
|
||||||
if ($defined(args.size)) {
|
if ($defined(args.size)) {
|
||||||
this._size = parseInt(args.size);
|
this._size = parseInt(args.size);
|
||||||
}
|
}
|
||||||
@ -35,57 +35,59 @@ const Font = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getHtmlSize(scale) {
|
getHtmlSize : function (scale) {
|
||||||
let result = 0;
|
var result = 0;
|
||||||
if (this._size == 6) {
|
if (this._size == 6) {
|
||||||
result = this._size * scale.height * 43 / 32;
|
result = this._size * scale.height * 43 / 32;
|
||||||
}
|
}
|
||||||
if (this._size == 8) {
|
if (this._size == 8) {
|
||||||
result = this._size * scale.height * 42 / 32;
|
result = this._size * scale.height * 42 / 32;
|
||||||
} else if (this._size == 10) {
|
}
|
||||||
|
else if (this._size == 10) {
|
||||||
result = this._size * scale.height * 42 / 32;
|
result = this._size * scale.height * 42 / 32;
|
||||||
} else if (this._size == 15) {
|
}
|
||||||
|
else if (this._size == 15) {
|
||||||
result = this._size * scale.height * 42 / 32;
|
result = this._size * scale.height * 42 / 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
getGraphSize() {
|
getGraphSize : function () {
|
||||||
return this._size * 43 / 32;
|
return this._size * 43 / 32;
|
||||||
},
|
},
|
||||||
|
|
||||||
getSize() {
|
getSize : function () {
|
||||||
return parseInt(this._size);
|
return parseInt(this._size);
|
||||||
},
|
},
|
||||||
|
|
||||||
getStyle() {
|
getStyle : function () {
|
||||||
return this._style;
|
return this._style;
|
||||||
},
|
},
|
||||||
|
|
||||||
getWeight() {
|
getWeight : function () {
|
||||||
return this._weight;
|
return this._weight;
|
||||||
},
|
},
|
||||||
|
|
||||||
setSize(size) {
|
setSize : function (size) {
|
||||||
this._size = size;
|
this._size = size;
|
||||||
},
|
},
|
||||||
|
|
||||||
setStyle(style) {
|
setStyle : function (style) {
|
||||||
this._style = style;
|
this._style = style;
|
||||||
},
|
},
|
||||||
|
|
||||||
setWeight(weight) {
|
setWeight : function (weight) {
|
||||||
this._weight = weight;
|
this._weight = weight;
|
||||||
},
|
},
|
||||||
|
|
||||||
getWidthMargin() {
|
getWidthMargin : function () {
|
||||||
let result = 0;
|
var result = 0;
|
||||||
if (this._size == 10 || this._size == 6) {
|
if (this._size == 10 || this._size == 6) {
|
||||||
result = 4;
|
result = 4;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Font;
|
export default Font;
|
||||||
|
@ -20,26 +20,27 @@ const EventUtils = require('../utils/EventUtils').default;
|
|||||||
|
|
||||||
const GroupPeer = new Class({
|
const GroupPeer = new Class({
|
||||||
Extends: ElementPeer,
|
Extends: ElementPeer,
|
||||||
initialize() {
|
initialize: function () {
|
||||||
const svgElement = window.document.createElementNS(this.svgNamespace, 'g');
|
var svgElement = window.document.createElementNS(this.svgNamespace, 'g');
|
||||||
this.parent(svgElement);
|
this.parent(svgElement);
|
||||||
this._native.setAttribute('preserveAspectRatio', 'none');
|
this._native.setAttribute("preserveAspectRatio", "none");
|
||||||
this._coordSize = {width: 1, height: 1};
|
this._coordSize = {width: 1, height: 1};
|
||||||
this._native.setAttribute('focusable', 'true');
|
this._native.setAttribute("focusable", "true");
|
||||||
this._position = {x: 0, y: 0};
|
this._position = {x: 0, y: 0};
|
||||||
this._coordOrigin = {x: 0, y: 0};
|
this._coordOrigin = {x: 0, y: 0};
|
||||||
},
|
},
|
||||||
|
|
||||||
setCoordSize(width, height) {
|
setCoordSize: function (width, height) {
|
||||||
const change = this._coordSize.width != width || this._coordSize.height != height;
|
var change = this._coordSize.width != width || this._coordSize.height != height;
|
||||||
this._coordSize.width = width;
|
this._coordSize.width = width;
|
||||||
this._coordSize.height = height;
|
this._coordSize.height = height;
|
||||||
|
|
||||||
if (change) { this.updateTransform(); }
|
if (change)
|
||||||
EventUtils.broadcastChangeEvent(this, 'strokeStyle');
|
this.updateTransform();
|
||||||
|
EventUtils.broadcastChangeEvent(this, "strokeStyle");
|
||||||
},
|
},
|
||||||
|
|
||||||
getCoordSize() {
|
getCoordSize: function () {
|
||||||
return {width: this._coordSize.width, height: this._coordSize.height};
|
return {width: this._coordSize.width, height: this._coordSize.height};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -64,12 +65,12 @@ const GroupPeer = new Class({
|
|||||||
* * skewY(<skew-angle>), which specifies a skew transformation along the y-axis.
|
* * skewY(<skew-angle>), which specifies a skew transformation along the y-axis.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
updateTransform() {
|
updateTransform: function () {
|
||||||
let sx = this._size.width / this._coordSize.width;
|
var sx = this._size.width / this._coordSize.width;
|
||||||
let sy = this._size.height / this._coordSize.height;
|
var sy = this._size.height / this._coordSize.height;
|
||||||
|
|
||||||
let cx = this._position.x - this._coordOrigin.x * sx;
|
var cx = this._position.x - this._coordOrigin.x * sx;
|
||||||
let cy = this._position.y - this._coordOrigin.y * sy;
|
var cy = this._position.y - this._coordOrigin.y * sy;
|
||||||
|
|
||||||
//FIXME: are we sure of this values?
|
//FIXME: are we sure of this values?
|
||||||
cx = isNaN(cx) ? 0 : cx;
|
cx = isNaN(cx) ? 0 : cx;
|
||||||
@ -77,15 +78,15 @@ const GroupPeer = new Class({
|
|||||||
sx = isNaN(sx) ? 0 : sx;
|
sx = isNaN(sx) ? 0 : sx;
|
||||||
sy = isNaN(sy) ? 0 : sy;
|
sy = isNaN(sy) ? 0 : sy;
|
||||||
|
|
||||||
this._native.setAttribute('transform', `translate(${cx},${cy}) scale(${sx},${sy})`);
|
this._native.setAttribute("transform", "translate(" + cx + "," + cy + ") scale(" + sx + "," + sy + ")");
|
||||||
},
|
},
|
||||||
|
|
||||||
setOpacity(value) {
|
setOpacity: function (value) {
|
||||||
this._native.setAttribute('opacity', value);
|
this._native.setAttribute("opacity", value);
|
||||||
},
|
},
|
||||||
|
|
||||||
setCoordOrigin(x, y) {
|
setCoordOrigin: function (x, y) {
|
||||||
const change = x != this._coordOrigin.x || y != this._coordOrigin.y;
|
var change = x != this._coordOrigin.x || y != this._coordOrigin.y;
|
||||||
if ($defined(x)) {
|
if ($defined(x)) {
|
||||||
this._coordOrigin.x = x;
|
this._coordOrigin.x = x;
|
||||||
}
|
}
|
||||||
@ -93,17 +94,19 @@ const GroupPeer = new Class({
|
|||||||
if ($defined(y)) {
|
if ($defined(y)) {
|
||||||
this._coordOrigin.y = y;
|
this._coordOrigin.y = y;
|
||||||
}
|
}
|
||||||
if (change) { this.updateTransform(); }
|
if (change)
|
||||||
|
this.updateTransform();
|
||||||
},
|
},
|
||||||
|
|
||||||
setSize(width, height) {
|
setSize: function (width, height) {
|
||||||
const change = width != this._size.width || height != this._size.height;
|
var change = width != this._size.width || height != this._size.height;
|
||||||
this.parent(width, height);
|
this.parent(width, height);
|
||||||
if (change) { this.updateTransform(); }
|
if (change)
|
||||||
|
this.updateTransform();
|
||||||
},
|
},
|
||||||
|
|
||||||
setPosition(x, y) {
|
setPosition: function (x, y) {
|
||||||
const change = x != this._position.x || y != this._position.y;
|
var change = x != this._position.x || y != this._position.y;
|
||||||
if ($defined(x)) {
|
if ($defined(x)) {
|
||||||
this._position.x = parseInt(x);
|
this._position.x = parseInt(x);
|
||||||
}
|
}
|
||||||
@ -111,21 +114,22 @@ const GroupPeer = new Class({
|
|||||||
if ($defined(y)) {
|
if ($defined(y)) {
|
||||||
this._position.y = parseInt(y);
|
this._position.y = parseInt(y);
|
||||||
}
|
}
|
||||||
if (change) { this.updateTransform(); }
|
if (change)
|
||||||
|
this.updateTransform();
|
||||||
},
|
},
|
||||||
|
|
||||||
getPosition() {
|
getPosition: function () {
|
||||||
return {x: this._position.x, y: this._position.y};
|
return {x: this._position.x, y: this._position.y};
|
||||||
},
|
},
|
||||||
|
|
||||||
append(child) {
|
append: function (child) {
|
||||||
this.parent(child);
|
this.parent(child);
|
||||||
EventUtils.broadcastChangeEvent(child, 'onChangeCoordSize');
|
EventUtils.broadcastChangeEvent(child, "onChangeCoordSize");
|
||||||
},
|
},
|
||||||
|
|
||||||
getCoordOrigin() {
|
getCoordOrigin: function () {
|
||||||
return {x: this._coordOrigin.x, y: this._coordOrigin.y};
|
return {x: this._coordOrigin.x, y: this._coordOrigin.y};
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default GroupPeer;
|
export default GroupPeer;
|
||||||
|
@ -15,36 +15,36 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
const ElementPeer = require('./ElementPeer').default;
|
const ElementPeer = require('./ElementPeer').default
|
||||||
|
|
||||||
const ImagePeer = new Class({
|
const ImagePeer = new Class({
|
||||||
Extends: ElementPeer,
|
Extends: ElementPeer,
|
||||||
initialize() {
|
initialize : function() {
|
||||||
const svgElement = window.document.createElementNS(this.svgNamespace, 'image');
|
var svgElement = window.document.createElementNS(this.svgNamespace, 'image');
|
||||||
this.parent(svgElement);
|
this.parent(svgElement);
|
||||||
this._position = {x:0,y:0};
|
this._position = {x:0,y:0};
|
||||||
this._href = '';
|
this._href = "";
|
||||||
this._native.setAttribute('preserveAspectRatio', 'none');
|
this._native.setAttribute("preserveAspectRatio", "none");
|
||||||
},
|
},
|
||||||
|
|
||||||
setPosition(x, y) {
|
setPosition : function(x, y) {
|
||||||
this._position = { x, y };
|
this._position = {x:x, y:y};
|
||||||
this._native.setAttribute('y', y);
|
this._native.setAttribute('y', y);
|
||||||
this._native.setAttribute('x', x);
|
this._native.setAttribute('x', x);
|
||||||
},
|
},
|
||||||
|
|
||||||
getPosition() {
|
getPosition : function() {
|
||||||
return this._position;
|
return this._position;
|
||||||
},
|
},
|
||||||
|
|
||||||
setHref(url) {
|
setHref : function(url) {
|
||||||
this._native.setAttributeNS(this.linkNamespace, 'href', url);
|
this._native.setAttributeNS(this.linkNamespace, "href", url);
|
||||||
this._href = url;
|
this._href = url;
|
||||||
},
|
},
|
||||||
|
|
||||||
getHref() {
|
getHref : function() {
|
||||||
return this._href;
|
return this._href;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default ImagePeer;
|
export default ImagePeer;
|
||||||
|
@ -15,42 +15,42 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
const ElementPeer = require('./ElementPeer').default;
|
const ElementPeer = require('./ElementPeer').default
|
||||||
|
|
||||||
const LinePeer = new Class({
|
const LinePeer = new Class({
|
||||||
Extends: ElementPeer,
|
Extends: ElementPeer,
|
||||||
initialize() {
|
initialize : function() {
|
||||||
const svgElement = window.document.createElementNS(this.svgNamespace, 'line');
|
var svgElement = window.document.createElementNS(this.svgNamespace, 'line');
|
||||||
this.parent(svgElement);
|
this.parent(svgElement);
|
||||||
this.attachChangeEventListener('strokeStyle', ElementPeer.prototype.updateStrokeStyle);
|
this.attachChangeEventListener("strokeStyle", ElementPeer.prototype.updateStrokeStyle);
|
||||||
},
|
},
|
||||||
|
|
||||||
setFrom(x1, y1) {
|
setFrom : function(x1, y1) {
|
||||||
this._x1 = x1;
|
this._x1 = x1;
|
||||||
this._y1 = y1;
|
this._y1 = y1;
|
||||||
this._native.setAttribute('x1', x1);
|
this._native.setAttribute('x1', x1);
|
||||||
this._native.setAttribute('y1', y1);
|
this._native.setAttribute('y1', y1);
|
||||||
},
|
},
|
||||||
|
|
||||||
setTo(x2, y2) {
|
setTo : function(x2, y2) {
|
||||||
this._x2 = x2;
|
this._x2 = x2;
|
||||||
this._y2 = y2;
|
this._y2 = y2;
|
||||||
this._native.setAttribute('x2', x2);
|
this._native.setAttribute('x2', x2);
|
||||||
this._native.setAttribute('y2', y2);
|
this._native.setAttribute('y2', y2);
|
||||||
},
|
},
|
||||||
|
|
||||||
getFrom() {
|
getFrom : function() {
|
||||||
return new core.Point(this._x1, this._y1);
|
return new core.Point(this._x1, this._y1);
|
||||||
},
|
},
|
||||||
|
|
||||||
getTo() {
|
getTo : function() {
|
||||||
return new core.Point(this._x2, this._y2);
|
return new core.Point(this._x2, this._y2);
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* http://www.zvon.org/HowTo/Output/howto_jj_svg_27.html?at=marker-end
|
* http://www.zvon.org/HowTo/Output/howto_jj_svg_27.html?at=marker-end
|
||||||
*/
|
*/
|
||||||
setArrowStyle(startStyle, endStyle) {
|
setArrowStyle : function(startStyle, endStyle) {
|
||||||
if ($defined(startStyle)) {
|
if ($defined(startStyle)) {
|
||||||
// Todo: This must be implemented ...
|
// Todo: This must be implemented ...
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ const LinePeer = new Class({
|
|||||||
if ($defined(endStyle)) {
|
if ($defined(endStyle)) {
|
||||||
// Todo: This must be implemented ...
|
// Todo: This must be implemented ...
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default LinePeer;
|
export default LinePeer;
|
||||||
|
@ -20,86 +20,88 @@ const PolyLine = require('../../PolyLine');
|
|||||||
|
|
||||||
const PolyLinePeer = new Class({
|
const PolyLinePeer = new Class({
|
||||||
Extends: ElementPeer,
|
Extends: ElementPeer,
|
||||||
initialize() {
|
initialize : function() {
|
||||||
const svgElement = window.document.createElementNS(this.svgNamespace, 'polyline');
|
var svgElement = window.document.createElementNS(this.svgNamespace, 'polyline');
|
||||||
this.parent(svgElement);
|
this.parent(svgElement);
|
||||||
this.setFill('none');
|
this.setFill("none");
|
||||||
this.breakDistance = 10;
|
this.breakDistance = 10;
|
||||||
},
|
},
|
||||||
|
|
||||||
setFrom(x1, y1) {
|
setFrom : function(x1, y1) {
|
||||||
this._x1 = x1;
|
this._x1 = x1;
|
||||||
this._y1 = y1;
|
this._y1 = y1;
|
||||||
this._updatePath();
|
this._updatePath();
|
||||||
},
|
},
|
||||||
|
|
||||||
setTo(x2, y2) {
|
setTo : function(x2, y2) {
|
||||||
this._x2 = x2;
|
this._x2 = x2;
|
||||||
this._y2 = y2;
|
this._y2 = y2;
|
||||||
this._updatePath();
|
this._updatePath();
|
||||||
},
|
},
|
||||||
|
|
||||||
setStrokeWidth(width) {
|
setStrokeWidth : function(width) {
|
||||||
this._native.setAttribute('stroke-width', width);
|
this._native.setAttribute('stroke-width', width);
|
||||||
},
|
},
|
||||||
|
|
||||||
setColor(color) {
|
setColor : function(color) {
|
||||||
this._native.setAttribute('stroke', color);
|
this._native.setAttribute('stroke', color);
|
||||||
},
|
},
|
||||||
|
|
||||||
setStyle(style) {
|
setStyle : function(style) {
|
||||||
this._style = style;
|
this._style = style;
|
||||||
this._updatePath();
|
this._updatePath();
|
||||||
},
|
},
|
||||||
|
|
||||||
getStyle() {
|
getStyle : function() {
|
||||||
return this._style;
|
return this._style;
|
||||||
},
|
},
|
||||||
|
|
||||||
_updatePath() {
|
_updatePath : function() {
|
||||||
if (this._style == 'Curved') {
|
if (this._style == "Curved") {
|
||||||
this._updateMiddleCurvePath();
|
this._updateMiddleCurvePath();
|
||||||
} else if (this._style == 'Straight') {
|
}
|
||||||
|
else if (this._style == "Straight") {
|
||||||
this._updateStraightPath();
|
this._updateStraightPath();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
this._updateCurvePath();
|
this._updateCurvePath();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateStraightPath() {
|
_updateStraightPath : function() {
|
||||||
if ($defined(this._x1) && $defined(this._x2) && $defined(this._y1) && $defined(this._y2)) {
|
if ($defined(this._x1) && $defined(this._x2) && $defined(this._y1) && $defined(this._y2)) {
|
||||||
const path = PolyLine.default.prototype.buildStraightPath(this.breakDistance, this._x1, this._y1, this._x2, this._y2);
|
var path = PolyLine.default.prototype.buildStraightPath(this.breakDistance, this._x1, this._y1, this._x2, this._y2);
|
||||||
this._native.setAttribute('points', path);
|
this._native.setAttribute('points', path);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateMiddleCurvePath() {
|
_updateMiddleCurvePath : function() {
|
||||||
const x1 = this._x1;
|
var x1 = this._x1;
|
||||||
const y1 = this._y1;
|
var y1 = this._y1;
|
||||||
const x2 = this._x2;
|
var x2 = this._x2;
|
||||||
const y2 = this._y2;
|
var y2 = this._y2;
|
||||||
if ($defined(x1) && $defined(x2) && $defined(y1) && $defined(y2)) {
|
if ($defined(x1) && $defined(x2) && $defined(y1) && $defined(y2)) {
|
||||||
const diff = x2 - x1;
|
var diff = x2 - x1;
|
||||||
const middlex = (diff / 2) + x1;
|
var middlex = (diff / 2) + x1;
|
||||||
let signx = 1;
|
var signx = 1;
|
||||||
let signy = 1;
|
var signy = 1;
|
||||||
if (diff < 0) {
|
if (diff < 0) {
|
||||||
signx = -1;
|
signx = -1;
|
||||||
}
|
}
|
||||||
if (y2 < y1) {
|
if (y2 < y1) {
|
||||||
signy = -1;
|
signy = -1;
|
||||||
}
|
}
|
||||||
const path = `${x1}, ${y1} ${middlex - 10 * signx}, ${y1} ${middlex}, ${y1 + 10 * signy} ${middlex}, ${y2 - 10 * signy} ${middlex + 10 * signx}, ${y2} ${x2}, ${y2}`;
|
var path = x1 + ", " + y1 + " " + (middlex - 10 * signx) + ", " + y1 + " " + middlex + ", " + (y1 + 10 * signy) + " " + middlex + ", " + (y2 - 10 * signy) + " " + (middlex + 10 * signx) + ", " + y2 + " " + x2 + ", " + y2;
|
||||||
this._native.setAttribute('points', path);
|
this._native.setAttribute('points', path);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateCurvePath() {
|
_updateCurvePath : function() {
|
||||||
if ($defined(this._x1) && $defined(this._x2) && $defined(this._y1) && $defined(this._y2)) {
|
if ($defined(this._x1) && $defined(this._x2) && $defined(this._y1) && $defined(this._y2)) {
|
||||||
const path = PolyLine.default.prototype.buildCurvedPath(this.breakDistance, this._x1, this._y1, this._x2, this._y2);
|
var path = PolyLine.default.prototype.buildCurvedPath(this.breakDistance, this._x1, this._y1, this._x2, this._y2);
|
||||||
this._native.setAttribute('points', path);
|
this._native.setAttribute('points', path);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default PolyLinePeer;
|
export default PolyLinePeer;
|
||||||
|
@ -15,21 +15,21 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
const ElementPeer = require('./ElementPeer').default;
|
const ElementPeer = require('./ElementPeer').default
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* http://www.w3.org/TR/SVG/shapes.html#RectElement
|
* http://www.w3.org/TR/SVG/shapes.html#RectElement
|
||||||
*/
|
*/
|
||||||
const RectPeer = new Class({
|
const RectPeer = new Class({
|
||||||
Extends: ElementPeer,
|
Extends: ElementPeer,
|
||||||
initialize(arc) {
|
initialize : function(arc) {
|
||||||
const svgElement = window.document.createElementNS(this.svgNamespace, 'rect');
|
var svgElement = window.document.createElementNS(this.svgNamespace, 'rect');
|
||||||
this.parent(svgElement);
|
this.parent(svgElement);
|
||||||
this._arc = arc;
|
this._arc = arc;
|
||||||
this.attachChangeEventListener('strokeStyle', ElementPeer.prototype.updateStrokeStyle);
|
this.attachChangeEventListener("strokeStyle", ElementPeer.prototype.updateStrokeStyle);
|
||||||
},
|
},
|
||||||
|
|
||||||
setPosition(x, y) {
|
setPosition :function(x, y) {
|
||||||
if ($defined(x)) {
|
if ($defined(x)) {
|
||||||
this._native.setAttribute('x', parseInt(x));
|
this._native.setAttribute('x', parseInt(x));
|
||||||
}
|
}
|
||||||
@ -38,23 +38,23 @@ const RectPeer = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getPosition() {
|
getPosition :function() {
|
||||||
const x = this._native.getAttribute('x');
|
var x = this._native.getAttribute('x');
|
||||||
const y = this._native.getAttribute('y');
|
var y = this._native.getAttribute('y');
|
||||||
return {x:parseInt(x),y:parseInt(y)};
|
return {x:parseInt(x),y:parseInt(y)};
|
||||||
},
|
},
|
||||||
|
|
||||||
setSize(width, height) {
|
setSize :function(width, height) {
|
||||||
this.parent(width, height);
|
this.parent(width, height);
|
||||||
|
|
||||||
const min = width < height ? width : height;
|
var min = width < height ? width : height;
|
||||||
if ($defined(this._arc)) {
|
if ($defined(this._arc)) {
|
||||||
// Transform percentages to SVG format.
|
// Transform percentages to SVG format.
|
||||||
const arc = (min / 2) * this._arc;
|
var arc = (min / 2) * this._arc;
|
||||||
this._native.setAttribute('rx', arc);
|
this._native.setAttribute('rx', arc);
|
||||||
this._native.setAttribute('ry', arc);
|
this._native.setAttribute('ry', arc);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default RectPeer;
|
export default RectPeer;
|
||||||
|
@ -15,22 +15,22 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
const Font = require('./Font').default;
|
const Font = require('./Font').default
|
||||||
|
|
||||||
const TahomaFont = new Class({
|
const TahomaFont = new Class({
|
||||||
Extends: Font,
|
Extends: Font,
|
||||||
initialize() {
|
initialize : function() {
|
||||||
this.parent();
|
this.parent();
|
||||||
this._fontFamily = 'tahoma';
|
this._fontFamily = "tahoma";
|
||||||
},
|
},
|
||||||
|
|
||||||
getFontFamily() {
|
getFontFamily : function () {
|
||||||
return this._fontFamily;
|
return this._fontFamily;
|
||||||
},
|
},
|
||||||
|
|
||||||
getFont() {
|
getFont : function () {
|
||||||
return Font.TAHOMA;
|
return Font.TAHOMA;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default TahomaFont;
|
export default TahomaFont;
|
||||||
|
@ -15,31 +15,32 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
const ElementPeer = require('./ElementPeer').default;
|
const ElementPeer = require('./ElementPeer').default
|
||||||
const Font = require('../../Font').default;
|
const Font = require('../../Font').default
|
||||||
|
|
||||||
const TextPeer = new Class({
|
const TextPeer = new Class({
|
||||||
Extends: ElementPeer,
|
Extends: ElementPeer,
|
||||||
initialize() {
|
initialize: function () {
|
||||||
const svgElement = window.document.createElementNS(this.svgNamespace, 'text');
|
var svgElement = window.document.createElementNS(this.svgNamespace, 'text');
|
||||||
this.parent(svgElement);
|
this.parent(svgElement);
|
||||||
this._position = {x: 0, y: 0};
|
this._position = {x: 0, y: 0};
|
||||||
this._font = new Font('Arial', this);
|
this._font = new Font("Arial", this);
|
||||||
},
|
},
|
||||||
|
|
||||||
append(element) {
|
append: function (element) {
|
||||||
this._native.appendChild(element._native);
|
this._native.appendChild(element._native);
|
||||||
},
|
},
|
||||||
|
|
||||||
setTextAlignment(align) {
|
setTextAlignment: function (align) {
|
||||||
this._textAlign = align;
|
this._textAlign = align;
|
||||||
},
|
},
|
||||||
|
|
||||||
getTextAlignment() {
|
|
||||||
|
getTextAlignment: function () {
|
||||||
return $defined(this._textAlign) ? this._textAlign : 'left';
|
return $defined(this._textAlign) ? this._textAlign : 'left';
|
||||||
},
|
},
|
||||||
|
|
||||||
setText(text) {
|
setText: function (text) {
|
||||||
// Remove all previous nodes ...
|
// Remove all previous nodes ...
|
||||||
while (this._native.firstChild) {
|
while (this._native.firstChild) {
|
||||||
this._native.removeChild(this._native.firstChild);
|
this._native.removeChild(this._native.firstChild);
|
||||||
@ -47,26 +48,26 @@ const TextPeer = new Class({
|
|||||||
|
|
||||||
this._text = text;
|
this._text = text;
|
||||||
if (text) {
|
if (text) {
|
||||||
const lines = text.split('\n');
|
var lines = text.split('\n');
|
||||||
const me = this;
|
var me = this;
|
||||||
//FIXME: we could use underscorejs here
|
//FIXME: we could use underscorejs here
|
||||||
lines.forEach((line) => {
|
lines.forEach(function (line) {
|
||||||
const tspan = window.document.createElementNS(me.svgNamespace, 'tspan');
|
var tspan = window.document.createElementNS(me.svgNamespace, 'tspan');
|
||||||
tspan.setAttribute('dy', '1em');
|
tspan.setAttribute('dy', '1em');
|
||||||
tspan.setAttribute('x', me.getPosition().x);
|
tspan.setAttribute('x', me.getPosition().x);
|
||||||
|
|
||||||
tspan.textContent = line.length == 0 ? ' ' : line;
|
tspan.textContent = line.length == 0 ? " " : line;
|
||||||
me._native.appendChild(tspan);
|
me._native.appendChild(tspan);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getText() {
|
getText: function () {
|
||||||
return this._text;
|
return this._text;
|
||||||
},
|
},
|
||||||
|
|
||||||
setPosition(x, y) {
|
setPosition: function (x, y) {
|
||||||
this._position = { x, y };
|
this._position = {x: x, y: y};
|
||||||
this._native.setAttribute('y', y);
|
this._native.setAttribute('y', y);
|
||||||
this._native.setAttribute('x', x);
|
this._native.setAttribute('x', x);
|
||||||
|
|
||||||
@ -74,15 +75,15 @@ const TextPeer = new Class({
|
|||||||
$(this._native).children('tspan').attr('x', x);
|
$(this._native).children('tspan').attr('x', x);
|
||||||
},
|
},
|
||||||
|
|
||||||
getPosition() {
|
getPosition: function () {
|
||||||
return this._position;
|
return this._position;
|
||||||
},
|
},
|
||||||
|
|
||||||
getNativePosition() {
|
getNativePosition: function() {
|
||||||
return $(this._native).position();
|
return $(this._native).position();
|
||||||
},
|
},
|
||||||
|
|
||||||
setFont(font, size, style, weight) {
|
setFont: function (font, size, style, weight) {
|
||||||
if ($defined(font)) {
|
if ($defined(font)) {
|
||||||
this._font = new Font(font, this);
|
this._font = new Font(font, this);
|
||||||
}
|
}
|
||||||
@ -98,42 +99,42 @@ const TextPeer = new Class({
|
|||||||
this._updateFontStyle();
|
this._updateFontStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateFontStyle() {
|
_updateFontStyle: function () {
|
||||||
this._native.setAttribute('font-family', this._font.getFontFamily());
|
this._native.setAttribute('font-family', this._font.getFontFamily());
|
||||||
this._native.setAttribute('font-size', this._font.getGraphSize());
|
this._native.setAttribute('font-size', this._font.getGraphSize());
|
||||||
this._native.setAttribute('font-style', this._font.getStyle());
|
this._native.setAttribute('font-style', this._font.getStyle());
|
||||||
this._native.setAttribute('font-weight', this._font.getWeight());
|
this._native.setAttribute('font-weight', this._font.getWeight());
|
||||||
},
|
},
|
||||||
|
|
||||||
setColor(color) {
|
setColor: function (color) {
|
||||||
this._native.setAttribute('fill', color);
|
this._native.setAttribute('fill', color);
|
||||||
},
|
},
|
||||||
|
|
||||||
getColor() {
|
getColor: function () {
|
||||||
return this._native.getAttribute('fill');
|
return this._native.getAttribute('fill');
|
||||||
},
|
},
|
||||||
|
|
||||||
setTextSize(size) {
|
setTextSize: function (size) {
|
||||||
this._font.setSize(size);
|
this._font.setSize(size);
|
||||||
this._updateFontStyle();
|
this._updateFontStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
setContentSize(width, height) {
|
setContentSize: function (width, height) {
|
||||||
this._native.xTextSize = `${width.toFixed(1)},${height.toFixed(1)}`;
|
this._native.xTextSize = width.toFixed(1) + "," + height.toFixed(1);
|
||||||
},
|
},
|
||||||
|
|
||||||
setStyle(style) {
|
setStyle: function (style) {
|
||||||
this._font.setStyle(style);
|
this._font.setStyle(style);
|
||||||
this._updateFontStyle();
|
this._updateFontStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
setWeight(weight) {
|
setWeight: function (weight) {
|
||||||
this._font.setWeight(weight);
|
this._font.setWeight(weight);
|
||||||
this._updateFontStyle();
|
this._updateFontStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
setFontFamily(family) {
|
setFontFamily: function (family) {
|
||||||
const oldFont = this._font;
|
var oldFont = this._font;
|
||||||
this._font = new Font(family, this);
|
this._font = new Font(family, this);
|
||||||
this._font.setSize(oldFont.getSize());
|
this._font.setSize(oldFont.getSize());
|
||||||
this._font.setStyle(oldFont.getStyle());
|
this._font.setStyle(oldFont.getStyle());
|
||||||
@ -141,41 +142,44 @@ const TextPeer = new Class({
|
|||||||
this._updateFontStyle();
|
this._updateFontStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
getFont() {
|
getFont: function () {
|
||||||
return {
|
return {
|
||||||
font: this._font.getFont(),
|
font: this._font.getFont(),
|
||||||
size: parseInt(this._font.getSize()),
|
size: parseInt(this._font.getSize()),
|
||||||
style: this._font.getStyle(),
|
style: this._font.getStyle(),
|
||||||
weight: this._font.getWeight(),
|
weight: this._font.getWeight()
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setSize(size) {
|
setSize: function (size) {
|
||||||
this._font.setSize(size);
|
this._font.setSize(size);
|
||||||
this._updateFontStyle();
|
this._updateFontStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
getWidth() {
|
getWidth: function () {
|
||||||
let computedWidth;
|
var computedWidth;
|
||||||
// Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround
|
// Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround
|
||||||
try {
|
try {
|
||||||
|
|
||||||
computedWidth = this._native.getBBox().width;
|
computedWidth = this._native.getBBox().width;
|
||||||
// Chrome bug is producing this error, oly during page loading. Remove the hack if it works. The issue seems to be
|
// Chrome bug is producing this error, oly during page loading. Remove the hack if it works. The issue seems to be
|
||||||
// caused when the element is hidden. I don't know why, but it works ...
|
// caused when the element is hidden. I don't know why, but it works ...
|
||||||
if (computedWidth == 0) {
|
if (computedWidth == 0) {
|
||||||
const bbox = this._native.getBBox();
|
var bbox = this._native.getBBox();
|
||||||
computedWidth = bbox.width;
|
computedWidth = bbox.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
computedWidth = 10;
|
computedWidth = 10;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let width = parseInt(computedWidth);
|
var width = parseInt(computedWidth);
|
||||||
width += this._font.getWidthMargin();
|
width = width + this._font.getWidthMargin();
|
||||||
return width;
|
return width;
|
||||||
},
|
},
|
||||||
|
|
||||||
getHeight() {
|
getHeight: function () {
|
||||||
// Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround
|
// Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround
|
||||||
try {
|
try {
|
||||||
var computedHeight = this._native.getBBox().height;
|
var computedHeight = this._native.getBBox().height;
|
||||||
@ -185,9 +189,9 @@ const TextPeer = new Class({
|
|||||||
return parseInt(computedHeight);
|
return parseInt(computedHeight);
|
||||||
},
|
},
|
||||||
|
|
||||||
getHtmlFontSize() {
|
getHtmlFontSize: function () {
|
||||||
return this._font.getHtmlSize();
|
return this._font.getHtmlSize();
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default TextPeer;
|
export default TextPeer;
|
||||||
|
@ -15,22 +15,22 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
const Font = require('./Font').default;
|
const Font = require('./Font').default
|
||||||
|
|
||||||
const TimesFont = new Class({
|
const TimesFont = new Class({
|
||||||
Extends: Font,
|
Extends: Font,
|
||||||
initialize() {
|
initialize : function() {
|
||||||
this.parent();
|
this.parent();
|
||||||
this._fontFamily = 'times';
|
this._fontFamily = "times";
|
||||||
},
|
},
|
||||||
|
|
||||||
getFontFamily() {
|
getFontFamily :function () {
|
||||||
return this._fontFamily;
|
return this._fontFamily;
|
||||||
},
|
},
|
||||||
|
|
||||||
getFont() {
|
getFont : function () {
|
||||||
return TIMES;
|
return TIMES;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default TimesFont;
|
export default TimesFont;
|
||||||
|
@ -15,22 +15,22 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
const Font = require('./Font').default;
|
const Font = require('./Font').default
|
||||||
|
|
||||||
const VerdanaFont = new Class({
|
const VerdanaFont = new Class({
|
||||||
Extends: Font,
|
Extends: Font,
|
||||||
initialize() {
|
initialize : function() {
|
||||||
this.parent();
|
this.parent();
|
||||||
this._fontFamily = 'verdana';
|
this._fontFamily = "verdana";
|
||||||
},
|
},
|
||||||
|
|
||||||
getFontFamily() {
|
getFontFamily : function () {
|
||||||
return this._fontFamily;
|
return this._fontFamily;
|
||||||
},
|
},
|
||||||
|
|
||||||
getFont() {
|
getFont : function () {
|
||||||
return Font.VERDANA;
|
return Font.VERDANA;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default VerdanaFont;
|
export default VerdanaFont;
|
||||||
|
@ -15,18 +15,19 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
const ElementPeer = require('./ElementPeer').default;
|
const ElementPeer = require('./ElementPeer').default
|
||||||
const EventUtils = require('../utils/EventUtils').default;
|
const EventUtils = require('../utils/EventUtils').default;
|
||||||
|
|
||||||
const WorkspacePeer = new Class({
|
const WorkspacePeer = new Class({
|
||||||
Extends: ElementPeer,
|
Extends: ElementPeer,
|
||||||
initialize(element) {
|
initialize: function (element) {
|
||||||
this._element = element;
|
this._element = element;
|
||||||
const svgElement = window.document.createElementNS(this.svgNamespace, 'svg');
|
var svgElement = window.document.createElementNS(this.svgNamespace, 'svg');
|
||||||
this.parent(svgElement);
|
this.parent(svgElement);
|
||||||
this._native.setAttribute('focusable', 'true');
|
this._native.setAttribute("focusable", "true");
|
||||||
this._native.setAttribute('id', 'workspace');
|
this._native.setAttribute("id", "workspace");
|
||||||
this._native.setAttribute('preserveAspectRatio', 'none');
|
this._native.setAttribute("preserveAspectRatio", "none");
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -39,9 +40,9 @@ const WorkspacePeer = new Class({
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
setCoordSize(width, height) {
|
setCoordSize: function (width, height) {
|
||||||
const viewBox = this._native.getAttribute('viewBox');
|
var viewBox = this._native.getAttribute('viewBox');
|
||||||
let coords = [0, 0, 0, 0];
|
var coords = [0, 0, 0, 0];
|
||||||
if (viewBox != null) {
|
if (viewBox != null) {
|
||||||
coords = viewBox.split(/ /);
|
coords = viewBox.split(/ /);
|
||||||
}
|
}
|
||||||
@ -53,25 +54,25 @@ const WorkspacePeer = new Class({
|
|||||||
coords[3] = height;
|
coords[3] = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._native.setAttribute('viewBox', coords.join(' '));
|
this._native.setAttribute('viewBox', coords.join(" "));
|
||||||
this._native.setAttribute('preserveAspectRatio', 'none');
|
this._native.setAttribute("preserveAspectRatio", "none");
|
||||||
EventUtils.broadcastChangeEvent(this, 'strokeStyle');
|
EventUtils.broadcastChangeEvent(this, "strokeStyle");
|
||||||
},
|
},
|
||||||
|
|
||||||
getCoordSize() {
|
getCoordSize: function () {
|
||||||
const viewBox = this._native.getAttribute('viewBox');
|
var viewBox = this._native.getAttribute('viewBox');
|
||||||
let coords = [1, 1, 1, 1];
|
var coords = [1, 1, 1, 1];
|
||||||
if (viewBox != null) {
|
if (viewBox != null) {
|
||||||
coords = viewBox.split(/ /);
|
coords = viewBox.split(/ /);
|
||||||
}
|
}
|
||||||
return {width: coords[2], height: coords[3]};
|
return {width: coords[2], height: coords[3]};
|
||||||
},
|
},
|
||||||
|
|
||||||
setCoordOrigin(x, y) {
|
setCoordOrigin: function (x, y) {
|
||||||
const viewBox = this._native.getAttribute('viewBox');
|
var viewBox = this._native.getAttribute('viewBox');
|
||||||
|
|
||||||
// ViewBox min-x ,min-y by default initializated with 0 and 0.
|
// ViewBox min-x ,min-y by default initializated with 0 and 0.
|
||||||
let coords = [0, 0, 0, 0];
|
var coords = [0, 0, 0, 0];
|
||||||
if (viewBox != null) {
|
if (viewBox != null) {
|
||||||
coords = viewBox.split(/ /);
|
coords = viewBox.split(/ /);
|
||||||
}
|
}
|
||||||
@ -84,28 +85,28 @@ const WorkspacePeer = new Class({
|
|||||||
coords[1] = y;
|
coords[1] = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._native.setAttribute('viewBox', coords.join(' '));
|
this._native.setAttribute('viewBox', coords.join(" "));
|
||||||
},
|
},
|
||||||
|
|
||||||
append(child) {
|
append: function (child) {
|
||||||
this.parent(child);
|
this.parent(child);
|
||||||
EventUtils.broadcastChangeEvent(child, 'onChangeCoordSize');
|
EventUtils.broadcastChangeEvent(child, "onChangeCoordSize");
|
||||||
},
|
},
|
||||||
|
|
||||||
getCoordOrigin(child) {
|
getCoordOrigin: function (child) {
|
||||||
const viewBox = this._native.getAttribute('viewBox');
|
var viewBox = this._native.getAttribute('viewBox');
|
||||||
let coords = [1, 1, 1, 1];
|
var coords = [1, 1, 1, 1];
|
||||||
if (viewBox != null) {
|
if (viewBox != null) {
|
||||||
coords = viewBox.split(/ /);
|
coords = viewBox.split(/ /);
|
||||||
}
|
}
|
||||||
const x = parseFloat(coords[0]);
|
var x = parseFloat(coords[0]);
|
||||||
const y = parseFloat(coords[1]);
|
var y = parseFloat(coords[1]);
|
||||||
return { x, y };
|
return {x: x, y: y};
|
||||||
},
|
},
|
||||||
|
|
||||||
getPosition() {
|
getPosition: function () {
|
||||||
return {x: 0, y: 0};
|
return {x: 0, y: 0};
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default WorkspacePeer;
|
export default WorkspacePeer;
|
||||||
|
@ -18,17 +18,17 @@
|
|||||||
|
|
||||||
const EventUtils = {
|
const EventUtils = {
|
||||||
broadcastChangeEvent: function (elementPeer, type) { //eslint-disable-line
|
broadcastChangeEvent: function (elementPeer, type) { //eslint-disable-line
|
||||||
const listeners = elementPeer.getChangeEventListeners(type);
|
var listeners = elementPeer.getChangeEventListeners(type);
|
||||||
if ($defined(listeners)) { //eslint-disable-line
|
if ($defined(listeners)) { //eslint-disable-line
|
||||||
for (let i = 0; i < listeners.length; i++) {
|
for (var i = 0; i < listeners.length; i++) {
|
||||||
const listener = listeners[i];
|
var listener = listeners[i];
|
||||||
listener.call(elementPeer, null);
|
listener.call(elementPeer, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const children = elementPeer.getChildren();
|
var children = elementPeer.getChildren();
|
||||||
for (let j = 0; j < children.length; j++) {
|
for (var j = 0; j < children.length; j++) {
|
||||||
const child = children[j];
|
var child = children[j];
|
||||||
EventUtils.broadcastChangeEvent(child, type);
|
EventUtils.broadcastChangeEvent(child, type);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -20,19 +20,20 @@ const TransformUtil = {
|
|||||||
|
|
||||||
workoutScale: function(elementPeer) //eslint-disable-line
|
workoutScale: function(elementPeer) //eslint-disable-line
|
||||||
{
|
{
|
||||||
let current = elementPeer.getParent();
|
var current = elementPeer.getParent();
|
||||||
let width = 1;
|
var width = 1;
|
||||||
let height = 1;
|
var height = 1;
|
||||||
while (current) {
|
while (current)
|
||||||
const coordSize = current.getCoordSize();
|
{
|
||||||
const size = current.getSize();
|
var coordSize = current.getCoordSize();
|
||||||
|
var size = current.getSize();
|
||||||
|
|
||||||
width *= (parseInt(size.width) / coordSize.width);
|
width = width * (parseInt(size.width) / coordSize.width);
|
||||||
height *= (parseInt(size.height) / coordSize.height);
|
height = height * (parseInt(size.height) / coordSize.height);
|
||||||
current = current.getParent();
|
current = current.getParent();
|
||||||
}
|
}
|
||||||
return { width, height };
|
return {width:width,height:height};
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default TransformUtil;
|
export default TransformUtil;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
function web2D() {
|
function web2D() {
|
||||||
global.$ = require('jquery');
|
global.$ = require('jquery');
|
||||||
require('mootools');
|
require('mootools');
|
||||||
|
2418
packages/web2d/package-lock.json
generated
2418
packages/web2d/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,6 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
"type": "commonjs",
|
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"registry": "https://registry.yarnpkg.com"
|
"registry": "https://registry.yarnpkg.com"
|
||||||
},
|
},
|
||||||
@ -29,20 +28,9 @@
|
|||||||
"@babel/core": "^7.14.6",
|
"@babel/core": "^7.14.6",
|
||||||
"@babel/plugin-transform-modules-commonjs": "^7.14.5",
|
"@babel/plugin-transform-modules-commonjs": "^7.14.5",
|
||||||
"@babel/preset-env": "^7.14.7",
|
"@babel/preset-env": "^7.14.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.32.0",
|
|
||||||
"@typescript-eslint/parser": "^4.32.0",
|
|
||||||
"babel-loader": "^8.2.2",
|
"babel-loader": "^8.2.2",
|
||||||
"clean-webpack-plugin": "^4.0.0-alpha.0",
|
"clean-webpack-plugin": "^4.0.0-alpha.0",
|
||||||
"core-js": "^3.15.2",
|
"core-js": "^3.15.2",
|
||||||
"eslint": "^7.32.0",
|
|
||||||
"eslint-config-airbnb": "^18.2.1",
|
|
||||||
"eslint-config-airbnb-base": "^14.2.1",
|
|
||||||
"eslint-loader": "^4.0.2",
|
|
||||||
"eslint-plugin-import": "^2.24.2",
|
|
||||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
|
||||||
"eslint-plugin-only-warn": "^1.0.3",
|
|
||||||
"eslint-plugin-react": "^7.26.1",
|
|
||||||
"eslint-plugin-react-hooks": "^4.2.0",
|
|
||||||
"html-webpack-plugin": "^5.3.2",
|
"html-webpack-plugin": "^5.3.2",
|
||||||
"nodemon": "^2.0.12",
|
"nodemon": "^2.0.12",
|
||||||
"webpack": "^5.44.0",
|
"webpack": "^5.44.0",
|
||||||
@ -53,7 +41,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wisemapping/mindplot": "^0.0.1",
|
"@wisemapping/mindplot": "^0.0.1",
|
||||||
"@wismapping/core-js": "^0.0.1",
|
"@wismapping/core-js": "^0.0.1",
|
||||||
"babel-eslint": "^10.1.0",
|
|
||||||
"jquery": "2.1.0",
|
"jquery": "2.1.0",
|
||||||
"mootools": "1.4.5"
|
"mootools": "1.4.5"
|
||||||
}
|
}
|
||||||
|
@ -12,15 +12,19 @@ module.exports = {
|
|||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
use: ["babel-loader", "eslint-loader"],
|
use: 'babel-loader',
|
||||||
test: /.js$/,
|
test: /.(js|jsx)$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
type: 'asset',
|
||||||
|
test: /\.(png|svg|jpg|jpeg|gif)$/i,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
target: 'web',
|
target: 'web',
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.js', '.json'],
|
extensions: ['.js', '.jsx', '.json'],
|
||||||
},
|
},
|
||||||
plugins: [new CleanWebpackPlugin()],
|
plugins: [new CleanWebpackPlugin()],
|
||||||
};
|
};
|
||||||
|
225
yarn.lock
225
yarn.lock
@ -228,7 +228,7 @@
|
|||||||
chalk "^2.0.0"
|
chalk "^2.0.0"
|
||||||
js-tokens "^4.0.0"
|
js-tokens "^4.0.0"
|
||||||
|
|
||||||
"@babel/parser@^7.15.0", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5", "@babel/parser@^7.7.0":
|
"@babel/parser@^7.15.0", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5":
|
||||||
version "7.15.7"
|
version "7.15.7"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae"
|
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae"
|
||||||
|
|
||||||
@ -748,7 +748,7 @@
|
|||||||
core-js-pure "^3.16.0"
|
core-js-pure "^3.16.0"
|
||||||
regenerator-runtime "^0.13.4"
|
regenerator-runtime "^0.13.4"
|
||||||
|
|
||||||
"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
|
"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
|
||||||
version "7.15.4"
|
version "7.15.4"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a"
|
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -762,7 +762,7 @@
|
|||||||
"@babel/parser" "^7.15.4"
|
"@babel/parser" "^7.15.4"
|
||||||
"@babel/types" "^7.15.4"
|
"@babel/types" "^7.15.4"
|
||||||
|
|
||||||
"@babel/traverse@^7.13.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.4.5", "@babel/traverse@^7.7.0":
|
"@babel/traverse@^7.13.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.4.5":
|
||||||
version "7.15.4"
|
version "7.15.4"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d"
|
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -776,7 +776,7 @@
|
|||||||
debug "^4.1.0"
|
debug "^4.1.0"
|
||||||
globals "^11.1.0"
|
globals "^11.1.0"
|
||||||
|
|
||||||
"@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.4.4", "@babel/types@^7.7.0":
|
"@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.4.4":
|
||||||
version "7.15.6"
|
version "7.15.6"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f"
|
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -1989,10 +1989,6 @@
|
|||||||
version "1.0.33"
|
version "1.0.33"
|
||||||
resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.0.33.tgz#099b0712d824d15e2660c20e1c16e6a8381f308c"
|
resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.0.33.tgz#099b0712d824d15e2660c20e1c16e6a8381f308c"
|
||||||
|
|
||||||
"@types/json5@^0.0.29":
|
|
||||||
version "0.0.29"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
|
|
||||||
|
|
||||||
"@types/lodash@^4.14.150":
|
"@types/lodash@^4.14.150":
|
||||||
version "4.14.175"
|
version "4.14.175"
|
||||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.175.tgz#b78dfa959192b01fae0ad90e166478769b215f45"
|
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.175.tgz#b78dfa959192b01fae0ad90e166478769b215f45"
|
||||||
@ -2140,7 +2136,7 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
"@typescript-eslint/eslint-plugin@^4.31.0", "@typescript-eslint/eslint-plugin@^4.32.0", "@typescript-eslint/eslint-plugin@^4.8.1":
|
"@typescript-eslint/eslint-plugin@^4.31.0", "@typescript-eslint/eslint-plugin@^4.8.1":
|
||||||
version "4.32.0"
|
version "4.32.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.32.0.tgz#46d2370ae9311092f2a6f7246d28357daf2d4e89"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.32.0.tgz#46d2370ae9311092f2a6f7246d28357daf2d4e89"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -2164,7 +2160,7 @@
|
|||||||
eslint-scope "^5.1.1"
|
eslint-scope "^5.1.1"
|
||||||
eslint-utils "^3.0.0"
|
eslint-utils "^3.0.0"
|
||||||
|
|
||||||
"@typescript-eslint/parser@^4.31.0", "@typescript-eslint/parser@^4.32.0", "@typescript-eslint/parser@^4.8.1":
|
"@typescript-eslint/parser@^4.31.0", "@typescript-eslint/parser@^4.8.1":
|
||||||
version "4.32.0"
|
version "4.32.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.32.0.tgz#751ecca0e2fecd3d44484a9b3049ffc1871616e5"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.32.0.tgz#751ecca0e2fecd3d44484a9b3049ffc1871616e5"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -2634,7 +2630,7 @@ array-ify@^1.0.0:
|
|||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece"
|
resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece"
|
||||||
|
|
||||||
array-includes@^3.1.1, array-includes@^3.1.3:
|
array-includes@^3.1.3:
|
||||||
version "3.1.3"
|
version "3.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a"
|
resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -2662,14 +2658,6 @@ array-unique@^0.3.2:
|
|||||||
version "0.3.2"
|
version "0.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
|
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
|
||||||
|
|
||||||
array.prototype.flat@^1.2.4:
|
|
||||||
version "1.2.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz#07e0975d84bbc7c48cd1879d609e682598d33e13"
|
|
||||||
dependencies:
|
|
||||||
call-bind "^1.0.2"
|
|
||||||
define-properties "^1.1.3"
|
|
||||||
es-abstract "^1.19.0"
|
|
||||||
|
|
||||||
array.prototype.flatmap@^1.2.4:
|
array.prototype.flatmap@^1.2.4:
|
||||||
version "1.2.5"
|
version "1.2.5"
|
||||||
resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.5.tgz#908dc82d8a406930fdf38598d51e7411d18d4446"
|
resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.5.tgz#908dc82d8a406930fdf38598d51e7411d18d4446"
|
||||||
@ -2700,10 +2688,6 @@ assign-symbols@^1.0.0:
|
|||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
|
resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
|
||||||
|
|
||||||
ast-types-flow@^0.0.7:
|
|
||||||
version "0.0.7"
|
|
||||||
resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
|
|
||||||
|
|
||||||
astral-regex@^2.0.0:
|
astral-regex@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31"
|
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31"
|
||||||
@ -2754,31 +2738,12 @@ aws4@^1.8.0:
|
|||||||
version "1.11.0"
|
version "1.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59"
|
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59"
|
||||||
|
|
||||||
axe-core@^4.0.2:
|
|
||||||
version "4.3.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.3.3.tgz#b55cd8e8ddf659fe89b064680e1c6a4dceab0325"
|
|
||||||
|
|
||||||
axios@^0.21.0, axios@^0.21.1:
|
axios@^0.21.0, axios@^0.21.1:
|
||||||
version "0.21.4"
|
version "0.21.4"
|
||||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
|
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
|
||||||
dependencies:
|
dependencies:
|
||||||
follow-redirects "^1.14.0"
|
follow-redirects "^1.14.0"
|
||||||
|
|
||||||
axobject-query@^2.2.0:
|
|
||||||
version "2.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be"
|
|
||||||
|
|
||||||
babel-eslint@^10.1.0:
|
|
||||||
version "10.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"
|
|
||||||
dependencies:
|
|
||||||
"@babel/code-frame" "^7.0.0"
|
|
||||||
"@babel/parser" "^7.7.0"
|
|
||||||
"@babel/traverse" "^7.7.0"
|
|
||||||
"@babel/types" "^7.7.0"
|
|
||||||
eslint-visitor-keys "^1.0.0"
|
|
||||||
resolve "^1.12.0"
|
|
||||||
|
|
||||||
babel-loader@^8.2.2:
|
babel-loader@^8.2.2:
|
||||||
version "8.2.2"
|
version "8.2.2"
|
||||||
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.2.tgz#9363ce84c10c9a40e6c753748e1441b60c8a0b81"
|
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.2.tgz#9363ce84c10c9a40e6c753748e1441b60c8a0b81"
|
||||||
@ -3611,10 +3576,6 @@ configstore@^5.0.1:
|
|||||||
write-file-atomic "^3.0.0"
|
write-file-atomic "^3.0.0"
|
||||||
xdg-basedir "^4.0.0"
|
xdg-basedir "^4.0.0"
|
||||||
|
|
||||||
confusing-browser-globals@^1.0.10:
|
|
||||||
version "1.0.10"
|
|
||||||
resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz#30d1e7f3d1b882b25ec4933d1d1adac353d20a59"
|
|
||||||
|
|
||||||
connect-history-api-fallback@^1.6.0:
|
connect-history-api-fallback@^1.6.0:
|
||||||
version "1.6.0"
|
version "1.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc"
|
resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc"
|
||||||
@ -4040,10 +4001,6 @@ cypress@^6.5.0:
|
|||||||
url "^0.11.0"
|
url "^0.11.0"
|
||||||
yauzl "^2.10.0"
|
yauzl "^2.10.0"
|
||||||
|
|
||||||
damerau-levenshtein@^1.0.6:
|
|
||||||
version "1.0.7"
|
|
||||||
resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.7.tgz#64368003512a1a6992593741a09a9d31a836f55d"
|
|
||||||
|
|
||||||
dargs@^4.0.1:
|
dargs@^4.0.1:
|
||||||
version "4.1.0"
|
version "4.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17"
|
resolved "https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17"
|
||||||
@ -4098,7 +4055,7 @@ debug@3.1.0:
|
|||||||
version "0.8.1"
|
version "0.8.1"
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-0.8.1.tgz#20ff4d26f5e422cb68a1bacbbb61039ad8c1c130"
|
resolved "https://registry.yarnpkg.com/debug/-/debug-0.8.1.tgz#20ff4d26f5e422cb68a1bacbbb61039ad8c1c130"
|
||||||
|
|
||||||
debug@^3.1.0, debug@^3.1.1, debug@^3.2.6, debug@^3.2.7:
|
debug@^3.1.0, debug@^3.1.1, debug@^3.2.6:
|
||||||
version "3.2.7"
|
version "3.2.7"
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
|
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -4402,10 +4359,6 @@ emoji-regex@^8.0.0:
|
|||||||
version "8.0.0"
|
version "8.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
|
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
|
||||||
|
|
||||||
emoji-regex@^9.0.0:
|
|
||||||
version "9.2.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72"
|
|
||||||
|
|
||||||
emojis-list@^3.0.0:
|
emojis-list@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
|
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
|
||||||
@ -4504,31 +4457,6 @@ es-abstract@^1.18.0-next.2, es-abstract@^1.18.1, es-abstract@^1.18.2, es-abstrac
|
|||||||
string.prototype.trimstart "^1.0.4"
|
string.prototype.trimstart "^1.0.4"
|
||||||
unbox-primitive "^1.0.1"
|
unbox-primitive "^1.0.1"
|
||||||
|
|
||||||
es-abstract@^1.19.1:
|
|
||||||
version "1.19.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3"
|
|
||||||
dependencies:
|
|
||||||
call-bind "^1.0.2"
|
|
||||||
es-to-primitive "^1.2.1"
|
|
||||||
function-bind "^1.1.1"
|
|
||||||
get-intrinsic "^1.1.1"
|
|
||||||
get-symbol-description "^1.0.0"
|
|
||||||
has "^1.0.3"
|
|
||||||
has-symbols "^1.0.2"
|
|
||||||
internal-slot "^1.0.3"
|
|
||||||
is-callable "^1.2.4"
|
|
||||||
is-negative-zero "^2.0.1"
|
|
||||||
is-regex "^1.1.4"
|
|
||||||
is-shared-array-buffer "^1.0.1"
|
|
||||||
is-string "^1.0.7"
|
|
||||||
is-weakref "^1.0.1"
|
|
||||||
object-inspect "^1.11.0"
|
|
||||||
object-keys "^1.1.1"
|
|
||||||
object.assign "^4.1.2"
|
|
||||||
string.prototype.trimend "^1.0.4"
|
|
||||||
string.prototype.trimstart "^1.0.4"
|
|
||||||
unbox-primitive "^1.0.1"
|
|
||||||
|
|
||||||
es-module-lexer@^0.9.0:
|
es-module-lexer@^0.9.0:
|
||||||
version "0.9.2"
|
version "0.9.2"
|
||||||
resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.2.tgz#d0a8c72c5d904014111fac7fab4c92b9ac545564"
|
resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.2.tgz#d0a8c72c5d904014111fac7fab4c92b9ac545564"
|
||||||
@ -4575,95 +4503,15 @@ escape-string-regexp@^4.0.0:
|
|||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
|
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
|
||||||
|
|
||||||
eslint-config-airbnb-base@^14.2.1:
|
|
||||||
version "14.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz#8a2eb38455dc5a312550193b319cdaeef042cd1e"
|
|
||||||
dependencies:
|
|
||||||
confusing-browser-globals "^1.0.10"
|
|
||||||
object.assign "^4.1.2"
|
|
||||||
object.entries "^1.1.2"
|
|
||||||
|
|
||||||
eslint-config-airbnb@^18.2.1:
|
|
||||||
version "18.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.2.1.tgz#b7fe2b42f9f8173e825b73c8014b592e449c98d9"
|
|
||||||
dependencies:
|
|
||||||
eslint-config-airbnb-base "^14.2.1"
|
|
||||||
object.assign "^4.1.2"
|
|
||||||
object.entries "^1.1.2"
|
|
||||||
|
|
||||||
eslint-config-prettier@^8.0.0:
|
eslint-config-prettier@^8.0.0:
|
||||||
version "8.3.0"
|
version "8.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a"
|
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a"
|
||||||
|
|
||||||
eslint-import-resolver-node@^0.3.6:
|
|
||||||
version "0.3.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd"
|
|
||||||
dependencies:
|
|
||||||
debug "^3.2.7"
|
|
||||||
resolve "^1.20.0"
|
|
||||||
|
|
||||||
eslint-loader@^4.0.2:
|
|
||||||
version "4.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/eslint-loader/-/eslint-loader-4.0.2.tgz#386a1e21bcb613b3cf2d252a3b708023ccfb41ec"
|
|
||||||
dependencies:
|
|
||||||
find-cache-dir "^3.3.1"
|
|
||||||
fs-extra "^8.1.0"
|
|
||||||
loader-utils "^2.0.0"
|
|
||||||
object-hash "^2.0.3"
|
|
||||||
schema-utils "^2.6.5"
|
|
||||||
|
|
||||||
eslint-module-utils@^2.6.2:
|
|
||||||
version "2.6.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.2.tgz#94e5540dd15fe1522e8ffa3ec8db3b7fa7e7a534"
|
|
||||||
dependencies:
|
|
||||||
debug "^3.2.7"
|
|
||||||
pkg-dir "^2.0.0"
|
|
||||||
|
|
||||||
eslint-plugin-import@^2.24.2:
|
|
||||||
version "2.24.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.24.2.tgz#2c8cd2e341f3885918ee27d18479910ade7bb4da"
|
|
||||||
dependencies:
|
|
||||||
array-includes "^3.1.3"
|
|
||||||
array.prototype.flat "^1.2.4"
|
|
||||||
debug "^2.6.9"
|
|
||||||
doctrine "^2.1.0"
|
|
||||||
eslint-import-resolver-node "^0.3.6"
|
|
||||||
eslint-module-utils "^2.6.2"
|
|
||||||
find-up "^2.0.0"
|
|
||||||
has "^1.0.3"
|
|
||||||
is-core-module "^2.6.0"
|
|
||||||
minimatch "^3.0.4"
|
|
||||||
object.values "^1.1.4"
|
|
||||||
pkg-up "^2.0.0"
|
|
||||||
read-pkg-up "^3.0.0"
|
|
||||||
resolve "^1.20.0"
|
|
||||||
tsconfig-paths "^3.11.0"
|
|
||||||
|
|
||||||
eslint-plugin-jsx-a11y@^6.4.1:
|
|
||||||
version "6.4.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.4.1.tgz#a2d84caa49756942f42f1ffab9002436391718fd"
|
|
||||||
dependencies:
|
|
||||||
"@babel/runtime" "^7.11.2"
|
|
||||||
aria-query "^4.2.2"
|
|
||||||
array-includes "^3.1.1"
|
|
||||||
ast-types-flow "^0.0.7"
|
|
||||||
axe-core "^4.0.2"
|
|
||||||
axobject-query "^2.2.0"
|
|
||||||
damerau-levenshtein "^1.0.6"
|
|
||||||
emoji-regex "^9.0.0"
|
|
||||||
has "^1.0.3"
|
|
||||||
jsx-ast-utils "^3.1.0"
|
|
||||||
language-tags "^1.0.5"
|
|
||||||
|
|
||||||
eslint-plugin-only-warn@^1.0.3:
|
|
||||||
version "1.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-only-warn/-/eslint-plugin-only-warn-1.0.3.tgz#a75f3a9ded7f03e9808e75ec27f22b644084506e"
|
|
||||||
|
|
||||||
eslint-plugin-react-hooks@^4.2.0:
|
eslint-plugin-react-hooks@^4.2.0:
|
||||||
version "4.2.0"
|
version "4.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556"
|
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556"
|
||||||
|
|
||||||
eslint-plugin-react@^7.21.5, eslint-plugin-react@^7.26.1:
|
eslint-plugin-react@^7.21.5:
|
||||||
version "7.26.1"
|
version "7.26.1"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.26.1.tgz#41bcfe3e39e6a5ac040971c1af94437c80daa40e"
|
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.26.1.tgz#41bcfe3e39e6a5ac040971c1af94437c80daa40e"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -4701,7 +4549,7 @@ eslint-utils@^3.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
eslint-visitor-keys "^2.0.0"
|
eslint-visitor-keys "^2.0.0"
|
||||||
|
|
||||||
eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0:
|
eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0:
|
||||||
version "1.3.0"
|
version "1.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e"
|
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e"
|
||||||
|
|
||||||
@ -4709,7 +4557,7 @@ eslint-visitor-keys@^2.0.0:
|
|||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
|
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
|
||||||
|
|
||||||
eslint@^7.14.0, eslint@^7.32.0:
|
eslint@^7.14.0:
|
||||||
version "7.32.0"
|
version "7.32.0"
|
||||||
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d"
|
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -5177,7 +5025,7 @@ find-up@^1.0.0:
|
|||||||
path-exists "^2.0.0"
|
path-exists "^2.0.0"
|
||||||
pinkie-promise "^2.0.0"
|
pinkie-promise "^2.0.0"
|
||||||
|
|
||||||
find-up@^2.0.0, find-up@^2.1.0:
|
find-up@^2.0.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
|
resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -6195,7 +6043,7 @@ is-ci@^3.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
ci-info "^3.1.1"
|
ci-info "^3.1.1"
|
||||||
|
|
||||||
is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.6.0:
|
is-core-module@^2.2.0, is-core-module@^2.5.0:
|
||||||
version "2.7.0"
|
version "2.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3"
|
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -6676,7 +6524,7 @@ jss@10.8.0, jss@^10.5.1:
|
|||||||
is-in-browser "^1.1.3"
|
is-in-browser "^1.1.3"
|
||||||
tiny-warning "^1.0.2"
|
tiny-warning "^1.0.2"
|
||||||
|
|
||||||
"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.1.0:
|
"jsx-ast-utils@^2.4.1 || ^3.0.0":
|
||||||
version "3.2.1"
|
version "3.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz#720b97bfe7d901b927d87c3773637ae8ea48781b"
|
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz#720b97bfe7d901b927d87c3773637ae8ea48781b"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -6721,16 +6569,6 @@ klona@^2.0.4:
|
|||||||
version "2.0.4"
|
version "2.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.4.tgz#7bb1e3affb0cb8624547ef7e8f6708ea2e39dfc0"
|
resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.4.tgz#7bb1e3affb0cb8624547ef7e8f6708ea2e39dfc0"
|
||||||
|
|
||||||
language-subtag-registry@~0.3.2:
|
|
||||||
version "0.3.21"
|
|
||||||
resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.21.tgz#04ac218bea46f04cb039084602c6da9e788dd45a"
|
|
||||||
|
|
||||||
language-tags@^1.0.5:
|
|
||||||
version "1.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.5.tgz#d321dbc4da30ba8bf3024e040fa5c14661f9193a"
|
|
||||||
dependencies:
|
|
||||||
language-subtag-registry "~0.3.2"
|
|
||||||
|
|
||||||
latest-version@^5.1.0:
|
latest-version@^5.1.0:
|
||||||
version "5.1.0"
|
version "5.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face"
|
resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face"
|
||||||
@ -7788,10 +7626,6 @@ object-copy@^0.1.0:
|
|||||||
define-property "^0.2.5"
|
define-property "^0.2.5"
|
||||||
kind-of "^3.0.3"
|
kind-of "^3.0.3"
|
||||||
|
|
||||||
object-hash@^2.0.3:
|
|
||||||
version "2.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5"
|
|
||||||
|
|
||||||
object-inspect@^1.11.0, object-inspect@^1.9.0:
|
object-inspect@^1.11.0, object-inspect@^1.9.0:
|
||||||
version "1.11.0"
|
version "1.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1"
|
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1"
|
||||||
@ -7822,14 +7656,6 @@ object.assign@^4.1.0, object.assign@^4.1.2:
|
|||||||
has-symbols "^1.0.1"
|
has-symbols "^1.0.1"
|
||||||
object-keys "^1.1.1"
|
object-keys "^1.1.1"
|
||||||
|
|
||||||
object.entries@^1.1.2:
|
|
||||||
version "1.1.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861"
|
|
||||||
dependencies:
|
|
||||||
call-bind "^1.0.2"
|
|
||||||
define-properties "^1.1.3"
|
|
||||||
es-abstract "^1.19.1"
|
|
||||||
|
|
||||||
object.entries@^1.1.4:
|
object.entries@^1.1.4:
|
||||||
version "1.1.4"
|
version "1.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.4.tgz#43ccf9a50bc5fd5b649d45ab1a579f24e088cafd"
|
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.4.tgz#43ccf9a50bc5fd5b649d45ab1a579f24e088cafd"
|
||||||
@ -8296,12 +8122,6 @@ pinkie@^2.0.0:
|
|||||||
version "2.0.4"
|
version "2.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
|
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
|
||||||
|
|
||||||
pkg-dir@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b"
|
|
||||||
dependencies:
|
|
||||||
find-up "^2.1.0"
|
|
||||||
|
|
||||||
pkg-dir@^3.0.0:
|
pkg-dir@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3"
|
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3"
|
||||||
@ -8320,12 +8140,6 @@ pkg-dir@^5.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
find-up "^5.0.0"
|
find-up "^5.0.0"
|
||||||
|
|
||||||
pkg-up@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f"
|
|
||||||
dependencies:
|
|
||||||
find-up "^2.1.0"
|
|
||||||
|
|
||||||
please-upgrade-node@^3.2.0:
|
please-upgrade-node@^3.2.0:
|
||||||
version "3.2.0"
|
version "3.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942"
|
resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942"
|
||||||
@ -9130,7 +8944,7 @@ resolve-url@^0.2.1:
|
|||||||
version "0.2.1"
|
version "0.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
|
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
|
||||||
|
|
||||||
resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.9.0:
|
resolve@^1.10.0, resolve@^1.14.2, resolve@^1.9.0:
|
||||||
version "1.20.0"
|
version "1.20.0"
|
||||||
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
|
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -10297,15 +10111,6 @@ ts-node@^9.0.0:
|
|||||||
source-map-support "^0.5.17"
|
source-map-support "^0.5.17"
|
||||||
yn "3.1.1"
|
yn "3.1.1"
|
||||||
|
|
||||||
tsconfig-paths@^3.11.0:
|
|
||||||
version "3.11.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz#954c1fe973da6339c78e06b03ce2e48810b65f36"
|
|
||||||
dependencies:
|
|
||||||
"@types/json5" "^0.0.29"
|
|
||||||
json5 "^1.0.1"
|
|
||||||
minimist "^1.2.0"
|
|
||||||
strip-bom "^3.0.0"
|
|
||||||
|
|
||||||
tslib@^1.8.1, tslib@^1.9.0:
|
tslib@^1.8.1, tslib@^1.9.0:
|
||||||
version "1.14.1"
|
version "1.14.1"
|
||||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
|
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
|
||||||
|
Loading…
Reference in New Issue
Block a user