New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@idraw/board

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@idraw/board - npm Package Compare versions

Comparing version 0.2.0-alpha.6 to 0.2.0-alpha.7

130

dist/index.cjs.js

@@ -146,18 +146,42 @@ 'use strict';

};
var Image = window.Image, Blob = window.Blob, FileReader = window.FileReader;
function loadImage(src) {
return new Promise(function (resolve, reject) {
var img = new Image;
img.onload = function () {
resolve(img);
};
img.onabort = reject;
img.onerror = reject;
img.src = src;
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function loadSVG(svg) {
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
function parseHTMLToDataURL(html, opts) {
var width = opts.width, height = opts.height;
return new Promise(function (resolve, reject) {
var _svg = svg;
var image = new Image();
var _svg = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + (width || '') + "\" height = \"" + (height || '') + "\">\n <foreignObject width=\"100%\" height=\"100%\">\n <div xmlns = \"http://www.w3.org/1999/xhtml\">\n " + html + "\n </div>\n </foreignObject>\n </svg>\n ";
var blob = new Blob([_svg], { type: 'image/svg+xml;charset=utf-8' });

@@ -169,6 +193,3 @@ var reader = new FileReader();

var base64 = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.result;
image.onload = function () {
resolve(image);
};
image.src = base64;
resolve(base64);
};

@@ -180,7 +201,5 @@ reader.onerror = function (err) {

}
function loadHTML(html, opts) {
var width = opts.width, height = opts.height;
function parseSVGToDataURL(svg) {
return new Promise(function (resolve, reject) {
var _svg = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + (width || '') + "\" height = \"" + (height || '') + "\">\n <foreignObject width=\"100%\" height=\"100%\">\n <div xmlns = \"http://www.w3.org/1999/xhtml\">\n " + html + "\n </div>\n </foreignObject>\n </svg>\n ";
var image = new Image();
var _svg = svg;
var blob = new Blob([_svg], { type: 'image/svg+xml;charset=utf-8' });

@@ -192,6 +211,3 @@ var reader = new FileReader();

var base64 = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.result;
image.onload = function () {
resolve(image);
};
image.src = base64;
resolve(base64);
};

@@ -203,2 +219,46 @@ reader.onerror = function (err) {

}
var Image = window.Image;
function loadImage(src) {
return new Promise(function (resolve, reject) {
var img = new Image;
img.onload = function () {
resolve(img);
};
img.onabort = reject;
img.onerror = reject;
img.src = src;
});
}
function loadSVG(svg) {
return __awaiter(this, void 0, void 0, function () {
var dataURL, image;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, parseSVGToDataURL(svg)];
case 1:
dataURL = _a.sent();
return [4, loadImage(dataURL)];
case 2:
image = _a.sent();
return [2, image];
}
});
});
}
function loadHTML(html, opts) {
return __awaiter(this, void 0, void 0, function () {
var dataURL, image;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, parseHTMLToDataURL(html, opts)];
case 1:
dataURL = _a.sent();
return [4, loadImage(dataURL)];
case 2:
image = _a.sent();
return [2, image];
}
});
});
}
var index = {

@@ -595,2 +655,10 @@ time: {

};
Context.prototype.strokeText = function (text, x, y, maxWidth) {
if (maxWidth !== undefined) {
return this._ctx.strokeText(text, this._doSize(x), this._doSize(y), this._doSize(maxWidth));
}
else {
return this._ctx.strokeText(text, this._doSize(x), this._doSize(y));
}
};
Context.prototype.setFont = function (opts) {

@@ -620,2 +688,14 @@ var strList = [];

};
Context.prototype.setShadowColor = function (color) {
this._ctx.shadowColor = color;
};
Context.prototype.setShadowOffsetX = function (offsetX) {
this._ctx.shadowOffsetX = this._doSize(offsetX);
};
Context.prototype.setShadowOffsetY = function (offsetY) {
this._ctx.shadowOffsetY = this._doSize(offsetY);
};
Context.prototype.setShadowBlur = function (blur) {
this._ctx.shadowBlur = this._doSize(blur);
};
Context.prototype._doSize = function (num) {

@@ -622,0 +702,0 @@ return this._opts.devicePixelRatio * num;

@@ -112,2 +112,3 @@ import { TypeBoardOptions } from '@idraw/types';

fillText(text: string, x: number, y: number, maxWidth?: number | undefined): void;
strokeText(text: string, x: number, y: number, maxWidth?: number | undefined): void;
setFont(opts: {

@@ -123,2 +124,6 @@ fontSize: number;

scale(ratioX: number, ratioY: number): void;
setShadowColor(color: string): void;
setShadowOffsetX(offsetX: number): void;
setShadowOffsetY(offsetY: number): void;
setShadowBlur(blur: number): void;
private _doSize;

@@ -125,0 +130,0 @@ private _doX;

@@ -144,18 +144,42 @@ var __assign = function() {

};
var Image = window.Image, Blob = window.Blob, FileReader = window.FileReader;
function loadImage(src) {
return new Promise(function (resolve, reject) {
var img = new Image;
img.onload = function () {
resolve(img);
};
img.onabort = reject;
img.onerror = reject;
img.src = src;
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function loadSVG(svg) {
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
function parseHTMLToDataURL(html, opts) {
var width = opts.width, height = opts.height;
return new Promise(function (resolve, reject) {
var _svg = svg;
var image = new Image();
var _svg = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + (width || '') + "\" height = \"" + (height || '') + "\">\n <foreignObject width=\"100%\" height=\"100%\">\n <div xmlns = \"http://www.w3.org/1999/xhtml\">\n " + html + "\n </div>\n </foreignObject>\n </svg>\n ";
var blob = new Blob([_svg], { type: 'image/svg+xml;charset=utf-8' });

@@ -167,6 +191,3 @@ var reader = new FileReader();

var base64 = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.result;
image.onload = function () {
resolve(image);
};
image.src = base64;
resolve(base64);
};

@@ -178,7 +199,5 @@ reader.onerror = function (err) {

}
function loadHTML(html, opts) {
var width = opts.width, height = opts.height;
function parseSVGToDataURL(svg) {
return new Promise(function (resolve, reject) {
var _svg = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + (width || '') + "\" height = \"" + (height || '') + "\">\n <foreignObject width=\"100%\" height=\"100%\">\n <div xmlns = \"http://www.w3.org/1999/xhtml\">\n " + html + "\n </div>\n </foreignObject>\n </svg>\n ";
var image = new Image();
var _svg = svg;
var blob = new Blob([_svg], { type: 'image/svg+xml;charset=utf-8' });

@@ -190,6 +209,3 @@ var reader = new FileReader();

var base64 = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.result;
image.onload = function () {
resolve(image);
};
image.src = base64;
resolve(base64);
};

@@ -201,2 +217,46 @@ reader.onerror = function (err) {

}
var Image = window.Image;
function loadImage(src) {
return new Promise(function (resolve, reject) {
var img = new Image;
img.onload = function () {
resolve(img);
};
img.onabort = reject;
img.onerror = reject;
img.src = src;
});
}
function loadSVG(svg) {
return __awaiter(this, void 0, void 0, function () {
var dataURL, image;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, parseSVGToDataURL(svg)];
case 1:
dataURL = _a.sent();
return [4, loadImage(dataURL)];
case 2:
image = _a.sent();
return [2, image];
}
});
});
}
function loadHTML(html, opts) {
return __awaiter(this, void 0, void 0, function () {
var dataURL, image;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, parseHTMLToDataURL(html, opts)];
case 1:
dataURL = _a.sent();
return [4, loadImage(dataURL)];
case 2:
image = _a.sent();
return [2, image];
}
});
});
}
var index = {

@@ -593,2 +653,10 @@ time: {

};
Context.prototype.strokeText = function (text, x, y, maxWidth) {
if (maxWidth !== undefined) {
return this._ctx.strokeText(text, this._doSize(x), this._doSize(y), this._doSize(maxWidth));
}
else {
return this._ctx.strokeText(text, this._doSize(x), this._doSize(y));
}
};
Context.prototype.setFont = function (opts) {

@@ -618,2 +686,14 @@ var strList = [];

};
Context.prototype.setShadowColor = function (color) {
this._ctx.shadowColor = color;
};
Context.prototype.setShadowOffsetX = function (offsetX) {
this._ctx.shadowOffsetX = this._doSize(offsetX);
};
Context.prototype.setShadowOffsetY = function (offsetY) {
this._ctx.shadowOffsetY = this._doSize(offsetY);
};
Context.prototype.setShadowBlur = function (blur) {
this._ctx.shadowBlur = this._doSize(blur);
};
Context.prototype._doSize = function (num) {

@@ -620,0 +700,0 @@ return this._opts.devicePixelRatio * num;

@@ -147,18 +147,42 @@ var iDrawBoard = (function () {

};
var Image = window.Image, Blob = window.Blob, FileReader = window.FileReader;
function loadImage(src) {
return new Promise(function (resolve, reject) {
var img = new Image;
img.onload = function () {
resolve(img);
};
img.onabort = reject;
img.onerror = reject;
img.src = src;
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function loadSVG(svg) {
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
function parseHTMLToDataURL(html, opts) {
var width = opts.width, height = opts.height;
return new Promise(function (resolve, reject) {
var _svg = svg;
var image = new Image();
var _svg = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + (width || '') + "\" height = \"" + (height || '') + "\">\n <foreignObject width=\"100%\" height=\"100%\">\n <div xmlns = \"http://www.w3.org/1999/xhtml\">\n " + html + "\n </div>\n </foreignObject>\n </svg>\n ";
var blob = new Blob([_svg], { type: 'image/svg+xml;charset=utf-8' });

@@ -170,6 +194,3 @@ var reader = new FileReader();

var base64 = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.result;
image.onload = function () {
resolve(image);
};
image.src = base64;
resolve(base64);
};

@@ -181,7 +202,5 @@ reader.onerror = function (err) {

}
function loadHTML(html, opts) {
var width = opts.width, height = opts.height;
function parseSVGToDataURL(svg) {
return new Promise(function (resolve, reject) {
var _svg = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + (width || '') + "\" height = \"" + (height || '') + "\">\n <foreignObject width=\"100%\" height=\"100%\">\n <div xmlns = \"http://www.w3.org/1999/xhtml\">\n " + html + "\n </div>\n </foreignObject>\n </svg>\n ";
var image = new Image();
var _svg = svg;
var blob = new Blob([_svg], { type: 'image/svg+xml;charset=utf-8' });

@@ -193,6 +212,3 @@ var reader = new FileReader();

var base64 = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.result;
image.onload = function () {
resolve(image);
};
image.src = base64;
resolve(base64);
};

@@ -204,2 +220,46 @@ reader.onerror = function (err) {

}
var Image = window.Image;
function loadImage(src) {
return new Promise(function (resolve, reject) {
var img = new Image;
img.onload = function () {
resolve(img);
};
img.onabort = reject;
img.onerror = reject;
img.src = src;
});
}
function loadSVG(svg) {
return __awaiter(this, void 0, void 0, function () {
var dataURL, image;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, parseSVGToDataURL(svg)];
case 1:
dataURL = _a.sent();
return [4, loadImage(dataURL)];
case 2:
image = _a.sent();
return [2, image];
}
});
});
}
function loadHTML(html, opts) {
return __awaiter(this, void 0, void 0, function () {
var dataURL, image;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, parseHTMLToDataURL(html, opts)];
case 1:
dataURL = _a.sent();
return [4, loadImage(dataURL)];
case 2:
image = _a.sent();
return [2, image];
}
});
});
}
var index = {

@@ -596,2 +656,10 @@ time: {

};
Context.prototype.strokeText = function (text, x, y, maxWidth) {
if (maxWidth !== undefined) {
return this._ctx.strokeText(text, this._doSize(x), this._doSize(y), this._doSize(maxWidth));
}
else {
return this._ctx.strokeText(text, this._doSize(x), this._doSize(y));
}
};
Context.prototype.setFont = function (opts) {

@@ -621,2 +689,14 @@ var strList = [];

};
Context.prototype.setShadowColor = function (color) {
this._ctx.shadowColor = color;
};
Context.prototype.setShadowOffsetX = function (offsetX) {
this._ctx.shadowOffsetX = this._doSize(offsetX);
};
Context.prototype.setShadowOffsetY = function (offsetY) {
this._ctx.shadowOffsetY = this._doSize(offsetY);
};
Context.prototype.setShadowBlur = function (blur) {
this._ctx.shadowBlur = this._doSize(blur);
};
Context.prototype._doSize = function (num) {

@@ -1109,2 +1189,2 @@ return this._opts.devicePixelRatio * num;

}());
})();

8

package.json
{
"name": "@idraw/board",
"version": "0.2.0-alpha.6",
"version": "0.2.0-alpha.7",
"description": "",

@@ -26,6 +26,6 @@ "main": "dist/index.cjs.js",

"devDependencies": {
"@idraw/types": "^0.2.0-alpha.6"
"@idraw/types": "^0.2.0-alpha.7"
},
"dependencies": {
"@idraw/util": "^0.2.0-alpha.6"
"@idraw/util": "^0.2.0-alpha.7"
},

@@ -35,3 +35,3 @@ "publishConfig": {

},
"gitHead": "bce30da0e5c5f6757299eeb50d064e793a90b3af"
"gitHead": "e7cd2ccd51400b8b6d9e47f6d272341880a18e0e"
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc