watermark-js-plus 1.5.3 → 1.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * watermark-js-plus v1.5.3
2
+ * watermark-js-plus v1.5.4
3
3
  * (c) 2022-2024 Michael Sun
4
4
  * Released under the MIT License.
5
5
  */
@@ -322,10 +322,10 @@ var SHARED = '__core-js_shared__';
322
322
  var store$3 = sharedStore.exports = globalThis$d[SHARED] || defineGlobalProperty$2(SHARED, {});
323
323
 
324
324
  (store$3.versions || (store$3.versions = [])).push({
325
- version: '3.38.0',
325
+ version: '3.38.1',
326
326
  mode: 'global',
327
327
  copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
328
- license: 'https://github.com/zloirock/core-js/blob/v3.38.0/LICENSE',
328
+ license: 'https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE',
329
329
  source: 'https://github.com/zloirock/core-js'
330
330
  });
331
331
 
@@ -2045,7 +2045,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
2045
2045
  reactions: new Queue(),
2046
2046
  rejection: false,
2047
2047
  state: PENDING,
2048
- value: undefined
2048
+ value: null
2049
2049
  });
2050
2050
  };
2051
2051
 
@@ -3289,8 +3289,15 @@ var createSVGElement = function (tagName, attrs, namespaceURI) {
3289
3289
  var getMultiLineData = function (ctx, text, maxWidth) {
3290
3290
  var result = [];
3291
3291
  var str = '';
3292
+ var word = '';
3292
3293
  for (var i = 0, len = text.length; i < len; i++) {
3293
- str += text.charAt(i);
3294
+ word = text.charAt(i);
3295
+ if (word === '\n') {
3296
+ result.push(str);
3297
+ str = '';
3298
+ continue;
3299
+ }
3300
+ str += word;
3294
3301
  if (ctx.measureText(str).width > maxWidth) {
3295
3302
  result.push(str.substring(0, str.length - 1));
3296
3303
  str = '';
@@ -3402,7 +3409,10 @@ function convertImgToBase64(bodyElement) {
3402
3409
  });
3403
3410
  }
3404
3411
  var convertSVGToImage = function (svg) {
3405
- var richContent = svg.outerHTML.replace(/<img(.*?)>/g, '<img$1/>').replace(/\n/g, '').replace(/\t/g, '').replace(/#/g, '%23');
3412
+ var richContent = svg.outerHTML
3413
+ .replace(/<(img|br|input|hr|embed)(.*?)>/g, '<$1$2/>')
3414
+ .replace(/\n/g, '').replace(/\t/g, '')
3415
+ .replace(/#/g, '%23');
3406
3416
  return "data:image/svg+xml;charset=utf-8,".concat(richContent);
3407
3417
  };
3408
3418
  var getValue = function (v1, v2) {