Socket
Socket
Sign inDemoInstall

tui-image-editor

Package Overview
Dependencies
159
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.7.2 to 3.7.3

dist/tui-image-editor.min.css.map

2

index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for TOAST UI Image Editor v3.7.2
// Type definitions for TOAST UI Image Editor v3.7.3
// TypeScript Version: 3.2.2

@@ -3,0 +3,0 @@

{
"name": "tui-image-editor",
"author": "NHN FE Development Lab <dl_javascript@nhn.com>",
"version": "3.7.2",
"version": "3.7.3",
"license": "MIT",

@@ -28,7 +28,7 @@ "repository": {

"devDependencies": {
"babel-core": "^6.18.2",
"babel-eslint": "^7.1.0",
"babel-loader": "^6.2.7",
"babel-preset-es2015": "^6.18.0",
"css-loader": "^0.28.11",
"babel-core": "^6.26.3",
"babel-eslint": "^10.0.3",
"babel-loader": "^7.1.2",
"babel-preset-es2015": "^6.24.1",
"css-loader": "^3.4.1",
"dtslint": "^0.4.2",

@@ -38,4 +38,3 @@ "es5-shim": "^4.5.9",

"eslint-config-tui": "^1.0.1",
"eslint-loader": "^1.6.1",
"extract-text-webpack-plugin": "^1.0.1",
"eslint-loader": "^2.0.0",
"file-saver": "^1.3.3",

@@ -47,15 +46,20 @@ "istanbul-instrumenter-loader": "^1.0.0",

"jsdoc": "^3.5.4",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma": "^4.4.1",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^2.0.1",
"karma-edge-launcher": "^0.4.2",
"karma-es5-shim": "0.0.4",
"karma-firefox-launcher": "^1.1.0",
"karma-jasmine": "^1.0.2",
"karma-ie-launcher": "^1.0.0",
"karma-jasmine": "^1.1.1",
"karma-jasmine-jquery-2": "^0.1.1",
"karma-jquery": "^0.2.4",
"karma-junit-reporter": "^1.2.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webdriver-launcher": "git+https://github.com/nhn/karma-webdriver-launcher.git#v1.1.0",
"karma-webpack": "^1.8.0",
"karma-webdriver-launcher": "git+https://github.com/nhn/karma-webdriver-launcher.git#v1.2.0",
"karma-webpack": "^4.0.2",
"mini-css-extract-plugin": "^0.9.0",
"mkdirp": "^0.5.1",
"safe-umd-webpack-plugin": "0.0.2",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"safe-umd-webpack-plugin": "^4.0.0",
"simulant": "^0.2.2",

@@ -68,4 +72,6 @@ "stylus": "^0.54.5",

"typescript": "^3.2.2",
"webpack": "^1.13.3",
"webpack-dev-server": "^1.11.0"
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.10.1"
},

@@ -78,10 +84,10 @@ "scripts": {

"bundle:svg": "node makesvg.js",
"serve": "webpack-dev-server --inline --hot -d",
"serve": "webpack-dev-server",
"doc:dev": "tuidoc --dev",
"doc": "tuidoc",
"tslint": "tslint index.d.ts",
"postinstall": "npm install --no-save --no-optional fabric@^3.3.2"
"tslint": "tslint index.d.ts"
},
"dependencies": {
"core-js": "2.4.1",
"fabric": "3.6.0",
"tui-code-snippet": "^1.5.0",

@@ -88,0 +94,0 @@ "tui-color-picker": "^2.2.0"

@@ -194,19 +194,6 @@ # ![Toast UI ImageEditor](https://user-images.githubusercontent.com/35218826/40895380-0b9f4cd6-67ea-11e8-982f-18121daa3a04.png)

##### 2. `fabric.js` installation
And you should add **postInstall** script to your `package.json`.
_This process will be removed when `fabric.js` updated to v2.7.0 and bundled with TOAST UI ImageEditor together._
##### 2. If the installation of the `fabric.js` dependency module does not go smoothly
```js
{
// ...
"scripts": {
// ...
"postInstall": "npm install --no-save --no-optional fabric@^1.6.7"
}
// ...
}
```
To solve the problem, you need to refer to [Some Steps](https://github.com/fabricjs/fabric.js#install-with-npm) to solve the problem.
Or you can add `fabric` as dependency. **But** there is [some steps](https://github.com/fabricjs/fabric.js#install-with-npm) to be installed well.
#### bower

@@ -366,3 +353,3 @@

## 🔩 Dependency
* [fabric.js](https://github.com/fabricjs/fabric.js/releases) >=3.0.0 && <= 3.3.2
* [fabric.js](https://github.com/fabricjs/fabric.js/releases) =3.6.0
* [tui.code-snippet](https://github.com/nhn/tui.code-snippet/releases/tag/v1.3.0) >=1.3.0

@@ -369,0 +356,0 @@ * [tui.color-picker](https://github.com/nhn/tui.color-picker/releases/tag/v2.2.0) >=2.2.0

@@ -27,3 +27,3 @@ /**

* @param {string} [options.styles.textAlign] Type of text align (left / center / right)
* @param {string} [options.styles.textDecoraiton] Type of line (underline / line-throgh / overline)
* @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)
* @param {{x: number, y: number}} [options.position] - Initial position

@@ -30,0 +30,0 @@ * @returns {Promise}

@@ -27,3 +27,3 @@ /**

* @param {string} [styles.textAlign] Type of text align (left / center / right)
* @param {string} [styles.textDecoraiton] Type of line (underline / line-throgh / overline)
* @param {string} [styles.textDecoration] Type of line (underline / line-through / overline)
* @returns {Promise}

@@ -30,0 +30,0 @@ */

@@ -26,3 +26,3 @@ /**

* @param {string} [props.textAlign] Type of text align (left / center / right)
* @param {string} [props.textDecoraiton] Type of line (underline / line-throgh / overline)
* @param {string} [props.textDecoration] Type of line (underline / line-through / overline)
* @returns {Promise}

@@ -29,0 +29,0 @@ */

@@ -10,3 +10,3 @@ /**

import {keyCodes, componentNames} from '../consts';
import {clamp} from '../util';
import {clamp, fixFloatingPoint} from '../util';

@@ -137,2 +137,12 @@ const MOUSE_MOVE_THRESHOLD = 10;

/**
* Change cropzone visible
* @param {boolean} visible - cropzone visible state
*/
changeVisibility(visible) {
if (this._cropzone) {
this._cropzone.set({visible});
}
}
/**
* onMousedown handler in fabric canvas

@@ -333,3 +343,3 @@ * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event

const scaleHeight = getScale(height, originalHeight);
[width, height] = snippet.map([width, height], sizeValue => sizeValue * scaleHeight);
[width, height] = snippet.map([width, height], sizeValue => fixFloatingPoint(sizeValue * scaleHeight));

@@ -336,0 +346,0 @@ return {

@@ -362,2 +362,3 @@ /**

});
resizeHelper.resize(shape, pointer);

@@ -364,0 +365,0 @@ canvas.renderAll();

@@ -24,3 +24,4 @@ /**

textAlign: 'left',
textDecoraiton: ''
textDecoration: '',
underline: false
};

@@ -213,3 +214,3 @@ const {browser} = snippet;

* @param {string} [options.styles.textAlign] Type of text align (left / center / right)
* @param {string} [options.styles.textDecoraiton] Type of line (underline / line-throgh / overline)
* @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)
* @param {{x: number, y: number}} [options.position] - Initial position

@@ -282,3 +283,3 @@ * @returns {Promise}

* @param {string} [styleObj.textAlign] Type of text align (left / center / right)
* @param {string} [styleObj.textDecoraiton] Type of line (underline / line-throgh / overline)
* @param {string} [styleObj.textDecoration] Type of line (underline / line-through / overline)
* @returns {Promise}

@@ -285,0 +286,0 @@ */

@@ -49,3 +49,3 @@ /**

_renderCropzone() {
_renderCropzone(ctx) {
const cropzoneDashLineWidth = 7;

@@ -61,3 +61,2 @@ const cropzoneDashLineOffset = 7;

// Set original scale
const ctx = this.canvas.getContext();
ctx.scale(originalScaleX, originalScaleY);

@@ -95,8 +94,6 @@

*/
_render() {
const ctx = this.canvas.getContext();
_render(ctx) {
this.callSuper('_render', ctx);
this._renderCropzone();
this._renderCropzone(ctx);
},

@@ -290,4 +287,5 @@

_onScaling(fEvent) {
const selectedCorner = fEvent.transform.corner;
const pointer = this.canvas.getPointer(fEvent.e);
const settings = this._calcScalingSizeFromPointer(pointer);
const settings = this._calcScalingSizeFromPointer(pointer, selectedCorner);

@@ -302,6 +300,7 @@ // On scaling cropzone,

* @param {{x: number, y: number}} pointer - Mouse position
* @param {string} selectedCorner - selected corner type
* @returns {Object} Having left or(and) top or(and) width or(and) height.
* @private
*/
_calcScalingSizeFromPointer(pointer) {
_calcScalingSizeFromPointer(pointer, selectedCorner) {
const pointerX = pointer.x,

@@ -316,3 +315,3 @@ pointerY = pointer.y,

*/
return this._makeScalingSettings(tlScalingSize, brScalingSize);
return this._makeScalingSettings(tlScalingSize, brScalingSize, selectedCorner);
},

@@ -366,6 +365,7 @@

* @param {{width: number, height: number}} br - Bottom-Right setting
* @param {string} selectedCorner - selected corner type
* @returns {{width: ?number, height: ?number, left: ?number, top: ?number}} Position setting
* @private
*/
_makeScalingSettings(tl, br) {
_makeScalingSettings(tl, br, selectedCorner) {
const tlWidth = tl.width;

@@ -379,3 +379,3 @@ const tlHeight = tl.height;

switch (this.__corner) {
switch (selectedCorner) {
case CORNER_TYPE_TOP_LEFT:

@@ -382,0 +382,0 @@ settings = tl;

@@ -406,3 +406,9 @@ /**

toDataURL(options) {
return this._canvas && this._canvas.toDataURL(options);
const cropper = this.getComponent(components.CROPPER);
cropper.changeVisibility(false);
const dataUrl = this._canvas && this._canvas.toDataURL(options);
cropper.changeVisibility(true);
return dataUrl;
}

@@ -661,3 +667,3 @@

* @param {string} [props.textAlign] Type of text align (left / center / right)
* @param {string} [props.textDecoraiton] Type of line (underline / line-throgh / overline)
* @param {string} [props.textDecoration] Type of line (underline / line-through / overline)
* @returns {Object} applied properties

@@ -664,0 +670,0 @@ */

@@ -84,3 +84,3 @@ /**

const left = shape.left - (centerPoint.x - origin.x);
const top = shape.top - (centerPoint.x - origin.y);
const top = shape.top - (centerPoint.y - origin.y);

@@ -110,2 +110,3 @@ shape.set({

shape.setPositionByOrigin(origin, originX, originY);
shape.setCoords();
}

@@ -112,0 +113,0 @@

@@ -212,3 +212,3 @@ /**

* @property {string} textAlign - Type of text align (left / center / right)
* @property {string} textDecoraiton - Type of line (underline / line-throgh / overline)
* @property {string} textDecoration - Type of line (underline / line-through / overline)
*/

@@ -988,3 +988,3 @@

* @param {string} [options.styles.textAlign] Type of text align (left / center / right)
* @param {string} [options.styles.textDecoraiton] Type of line (underline / line-throgh / overline)
* @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)
* @param {{x: number, y: number}} [options.position] - Initial position

@@ -1040,3 +1040,3 @@ * @returns {Promise}

* @param {string} [styleObj.textAlign] Type of text align (left / center / right)
* @param {string} [styleObj.textDecoraiton] Type of line (underline / line-throgh / overline)
* @param {string} [styleObj.textDecoration] Type of line (underline / line-through / overline)
* @returns {Promise}

@@ -1043,0 +1043,0 @@ * @example

@@ -105,3 +105,6 @@ import Range from './tools/range';

'italic': {fontStyle: 'italic'},
'underline': {textDecoration: 'underline'}
'underline': {
underline: true,
textDecoration: 'underline'
}
}[styleType];

@@ -108,0 +111,0 @@

@@ -6,2 +6,3 @@ /**

import {forEach, sendHostname} from 'tui-code-snippet';
const FLOATING_POINT_DIGIT = 2;
const {min, max} = Math;

@@ -11,3 +12,2 @@ let hostnameSent = false;

module.exports = {
/**

@@ -191,3 +191,11 @@ * Clamp value

return new Blob([uInt8Array], {type: mimeString});
},
/**
* Fix floating point diff.
* @param {number} value - original value
* @returns {number} fixed value
*/
fixFloatingPoint(value) {
return Number(value.toFixed(FLOATING_POINT_DIGIT));
}
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc