@plattar/plattar-qrcode 1.150.2 → 1.165.1

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.
@@ -3,19 +3,19 @@
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
5
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
9
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
9
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
11
10
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
11
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
12
12
  function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
13
- function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
14
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
15
- function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
13
+ function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
14
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
15
+ function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
16
16
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
17
17
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
18
- function _typeof(obj) { "@babel/helpers - typeof"; 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); }
18
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
19
19
  (function (f) {
20
20
  if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") {
21
21
  module.exports = f();
@@ -67,10 +67,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
67
67
  var hash = require("object-hash");
68
68
  var BaseElement = /*#__PURE__*/function (_HTMLElement) {
69
69
  _inherits(BaseElement, _HTMLElement);
70
- var _super = _createSuper(BaseElement);
71
70
  function BaseElement() {
72
71
  _classCallCheck(this, BaseElement);
73
- return _super.call(this);
72
+ return _callSuper(this, BaseElement);
74
73
  }
75
74
  _createClass(BaseElement, [{
76
75
  key: "connectedCallback",
@@ -214,11 +213,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
214
213
  var shortenURL = this.hasAttribute("shorten") ? this.getAttribute("shorten") : "false";
215
214
  if (shortenURL && shortenURL.toLowerCase() === "true") {
216
215
  this._ShortenURL(url).then(function (newURL) {
217
- _this2._GenerateQRCode(newURL, width, height);
216
+ // make sure by time promise is resolved that the original url hasn't been updated
217
+ var updatedURL = _this2.hasAttribute("url") ? _this2.getAttribute("url") : undefined;
218
+ if (updatedURL === url) {
219
+ _this2._GenerateQRCode(newURL, width, height);
220
+ }
218
221
  })["catch"](function (_err) {
219
222
  console.warn(_err);
220
223
  // ignore error and just generate normal QR Code
221
- _this2._GenerateQRCode(url, width, height);
224
+ // make sure by time promise is resolved that the original url hasn't been updated
225
+ var updatedURL = _this2.hasAttribute("url") ? _this2.getAttribute("url") : undefined;
226
+ if (updatedURL === url) {
227
+ _this2._GenerateQRCode(url, width, height);
228
+ }
222
229
  });
223
230
  } else {
224
231
  this._GenerateQRCode(url, width, height);
@@ -265,7 +272,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
265
272
  this._qrCode = new QRCodeStyling(this._options);
266
273
  this._qrCode.append(div);
267
274
  this._UpdateCanvas(width, height);
268
- div.style.display = "block";
275
+ div.style.display = "flex";
269
276
  return;
270
277
  }
271
278
  var newHash = hash({
@@ -335,10 +342,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
335
342
  var BaseElement = require("./base/base-element.js");
336
343
  var QRCodeElement = /*#__PURE__*/function (_BaseElement) {
337
344
  _inherits(QRCodeElement, _BaseElement);
338
- var _super2 = _createSuper(QRCodeElement);
339
345
  function QRCodeElement() {
340
346
  _classCallCheck(this, QRCodeElement);
341
- return _super2.call(this);
347
+ return _callSuper(this, QRCodeElement);
342
348
  }
343
349
  return _createClass(QRCodeElement);
344
350
  }(BaseElement);
@@ -3490,7 +3496,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3490
3496
  });
3491
3497
  }, {}],
3492
3498
  6: [function (require, module, exports) {
3493
- module.exports = "1.150.2";
3499
+ module.exports = "1.165.1";
3494
3500
  }, {}]
3495
3501
  }, {}, [3])(3);
3496
3502
  });