Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove replicated helper function ga #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 67 additions & 52 deletions dist/jspdf.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 2.1.1 Built on 2019-10-11T08:56:17.234Z
* CommitID 0dd01f177e
* Version 1.5.3 Built on 2022-08-17T11:03:43.941Z
* CommitID b3ccdf139d
*
* Copyright (c) 2010-2018 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
* 2015-2018 yWorks GmbH, http://www.yworks.com
Expand Down Expand Up @@ -37,17 +37,13 @@
*/

function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
"@babel/helpers - typeof";

return _typeof(obj);
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, _typeof(obj);
}

/**
Expand Down Expand Up @@ -1420,6 +1416,10 @@
*/

var Matrix = function Matrix(sx, shy, shx, sy, tx, ty) {
if (!(this instanceof Matrix)) {
return new Matrix(sx, shy, shx, sy, tx, ty);
}

var _matrix = [];
/**
* @name sx
Expand Down Expand Up @@ -1827,8 +1827,13 @@
*/


API.ShadingPattern = function (type, coords, colors, gState, matrix) {
advancedApiModeTrap("ShadingPattern"); // see putPattern() for information how they are realized
API.ShadingPattern = function ShadingPattern(type, coords, colors, gState, matrix) {
advancedApiModeTrap("ShadingPattern");

if (!(this instanceof ShadingPattern)) {
return new ShadingPattern(type, coords, colors, gState, matrix);
} // see putPattern() for information how they are realized


this.type = type === "axial" ? 2 : 3;
this.coords = coords;
Expand All @@ -1851,8 +1856,13 @@
*/


API.TilingPattern = function (boundingBox, xStep, yStep, gState, matrix) {
API.TilingPattern = function TilingPattern(boundingBox, xStep, yStep, gState, matrix) {
advancedApiModeTrap("TilingPattern");

if (!(this instanceof TilingPattern)) {
return new TilingPattern(boundingBox, xStep, yStep, gState, matrix);
}

this.boundingBox = boundingBox;
this.xStep = xStep;
this.yStep = yStep;
Expand Down Expand Up @@ -2627,8 +2637,8 @@
for (var patternKey in patterns) {
if (patterns.hasOwnProperty(patternKey) && patterns[patternKey] instanceof API.TilingPattern && patterns[patternKey].objectNumber >= 0 && patterns[patternKey].objectNumber < objectOid // prevent cyclic dependencies
) {
out("/" + patternKey + " " + patterns[patternKey].objectNumber + " 0 R");
}
out("/" + patternKey + " " + patterns[patternKey].objectNumber + " 0 R");
}
}

events.publish("putTilingPatternDict");
Expand Down Expand Up @@ -3480,7 +3490,7 @@
*
* @memberof jsPDF#
* @name setPage
* @param {number} page Switch the active page to the page number specified.
* @param {number} page Switch the active page to the page number specified (indexed starting at 1).
* @example
* doc = jsPDF()
* doc.addPage()
Expand Down Expand Up @@ -3877,7 +3887,6 @@


var lang = options.lang;
//renderingMode


var renderingMode = -1;
Expand Down Expand Up @@ -5500,7 +5509,10 @@
*/


API.GState = function (parameters) {
API.GState = function GState(parameters) {
if (!(this instanceof GState)) {
return new GState(parameters);
}
/**
* @name GState#opacity
* @type {any}
Expand All @@ -5510,6 +5522,8 @@
* @name GState#stroke-opacity
* @type {any}
*/


var supported = "opacity,stroke-opacity".split(",");

for (var p in parameters) {
Expand Down Expand Up @@ -5935,8 +5949,7 @@
* @instance
* @param {string} filename The filename including extension.
* @param {Object} options An Object with additional options, possible options: 'returnPromise'.
* @returns {jsPDF} jsPDF-instance
*/
* @returns {jsPDF} jsPDF-instance */


API.save = function (filename, options) {
Expand Down Expand Up @@ -6146,7 +6159,7 @@
* @memberof jsPDF#
*/

jsPDF.version = '2.1.1';
jsPDF.version = '1.5.3';

if (typeof define === "function" && define.amd) {
define(function () {
Expand Down Expand Up @@ -8994,9 +9007,6 @@
globalObj["AcroForm"] = {
Appearance: AcroFormAppearance
};
} else {
// eslint-disable-next-line no-console
console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already. This avoids conflicts with the already used framework.");
}

jsPDFAPI.AcroFormChoiceField = AcroFormChoiceField;
Expand Down Expand Up @@ -11125,7 +11135,7 @@
* @param {Integer} [y] top-position for top-left corner of table
* @param {Object[]} [data] An array of objects containing key-value pairs corresponding to a row of data.
* @param {String[]} [headers] Omit or null to auto-generate headers at a performance cost
* @param {Object} [config.printHeaders] True to print column headers at the top of every page
* @param {Object} [config.printHeaders] True to print column headers at the top of every page
* @param {Object} [config.autoSize] True to dynamically set the column widths to match the widest cell value
* @param {Object} [config.margins] margin values for left, top, bottom, and width
* @param {Object} [config.fontSize] Integer fontSize to use (optional)
Expand Down Expand Up @@ -11289,10 +11299,16 @@
var padding = this.internal.__cell__.padding;
var fontSize = this.internal.__cell__.table_font_size;
var scaleFactor = this.internal.scaleFactor;
return Object.keys(model).map(function (value) {
return _typeof(value) === "object" ? value.text : value;
}).map(function (value) {
return this.splitTextToSize(value, columnWidths[value] - padding - padding);
return Object.keys(model).map(function (key) {
return [key, model[key]];
}).map(function (item) {
var key = item[0];
var value = item[1];
return _typeof(value) === "object" ? [key, value.text] : [key, value];
}).map(function (item) {
var key = item[0];
var value = item[1];
return this.splitTextToSize(value, columnWidths[key] - padding - padding);
}, this).map(function (value) {
return this.getLineHeightFactor() * value.length * fontSize / scaleFactor + padding + padding;
}, this).reduce(function (pv, cv) {
Expand Down Expand Up @@ -13828,7 +13844,8 @@
x: 0,
y: 0,
html2canvas: {},
jsPDF: {}
jsPDF: {},
backgroundColor: "transparent"
}
};
/* ----- FROM / TO ----- */
Expand Down Expand Up @@ -13925,7 +13942,7 @@
right: 0,
top: 0,
margin: "auto",
backgroundColor: "white"
backgroundColor: this.opt.backgroundColor
}; // Set the overlay to hidden (could be changed in the future to provide a print preview).

var source = cloneNode(this.prop.src, this.opt.html2canvas.javascriptEnabled);
Expand Down Expand Up @@ -14972,13 +14989,13 @@
*
Color Allowed Interpretation
Type Bit Depths
0 1,2,4,8,16 Each pixel is a grayscale sample.
2 8,16 Each pixel is an R,G,B triple.
3 1,2,4,8 Each pixel is a palette index;
0 1,2,4,8,16 Each pixel is a grayscale sample.
2 8,16 Each pixel is an R,G,B triple.
3 1,2,4,8 Each pixel is a palette index;
a PLTE chunk must appear.
4 8,16 Each pixel is a grayscale sample,
4 8,16 Each pixel is a grayscale sample,
followed by an alpha sample.
6 8,16 Each pixel is an R,G,B triple,
6 8,16 Each pixel is an R,G,B triple,
followed by an alpha sample.
*/

Expand Down Expand Up @@ -15823,6 +15840,8 @@
} else {
if (doKerning && _typeof(kerning[char_code]) === "object" && !isNaN(parseInt(kerning[char_code][prior_char_code], 10))) {
kerningValue = kerning[char_code][prior_char_code] / kerningFractionOf;
} else {
kerningValue = 0;
}

output.push((widths[char_code] || default_char_width) / widthsFractionOf + kerningValue);
Expand Down Expand Up @@ -16555,10 +16574,10 @@
} // if only one is set, that value is set as max and SVG
// is scaled proportionately.
else if (w) {
scale = [w / svgw, w / svgw];
} else if (h) {
scale = [h / svgh, h / svgh];
}
scale = [w / svgw, w / svgw];
} else if (h) {
scale = [h / svgh, h / svgh];
}
}

var i,
Expand Down Expand Up @@ -19055,13 +19074,13 @@
utf8.push(0xe0 | charcode >> 12, 0x80 | charcode >> 6 & 0x3f, 0x80 | charcode & 0x3f);
} // surrogate pair
else {
i++; // UTF-16 encodes 0x10000-0x10FFFF by
// subtracting 0x10000 and splitting the
// 20 bits of 0x0-0xFFFFF into two halves
i++; // UTF-16 encodes 0x10000-0x10FFFF by
// subtracting 0x10000 and splitting the
// 20 bits of 0x0-0xFFFFF into two halves

charcode = 0x10000 + ((charcode & 0x3ff) << 10 | str.charCodeAt(i) & 0x3ff);
utf8.push(0xf0 | charcode >> 18, 0x80 | charcode >> 12 & 0x3f, 0x80 | charcode >> 6 & 0x3f, 0x80 | charcode & 0x3f);
}
charcode = 0x10000 + ((charcode & 0x3ff) << 10 | str.charCodeAt(i) & 0x3ff);
utf8.push(0xf0 | charcode >> 18, 0x80 | charcode >> 12 & 0x3f, 0x80 | charcode >> 6 & 0x3f, 0x80 | charcode & 0x3f);
}
}

return utf8;
Expand Down Expand Up @@ -25461,10 +25480,6 @@
d[e + 3] = 255;
}

function ga(a, b) {
return 0 > a ? 0 : a > b ? b : a;
}

function la(a, b, c) {
self[a] = function (a, e, f, g, h, k, l, m, n) {
for (var d = m + (n & -2) * c; m != d;) {
Expand Down
Loading