@liquid-js/qr-code-styling 2.2.2 → 2.2.3

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.
@@ -34,7 +34,7 @@ export declare class QRCodeStyling {
34
34
  * const extension = (svg, options) => {
35
35
  * const { width, height } = options;
36
36
  * const size = Math.min(width, height);
37
- * const border = document.createElementNS("http://www.w3.org/2000/svg", "rect");
37
+ * const border = options.document.createElementNS("http://www.w3.org/2000/svg", "rect");
38
38
  * const borderAttributes = {
39
39
  * fill: "none",
40
40
  * x: (width - size + 40) / 2,
@@ -398,7 +398,7 @@ class QRCornerDot {
398
398
  this._rotateFigure({
399
399
  ...args,
400
400
  draw: () => {
401
- this._element = document.createElementNS("http://www.w3.org/2000/svg", "rect");
401
+ this._element = this._document.createElementNS("http://www.w3.org/2000/svg", "rect");
402
402
  this._element.setAttribute("x", String(x));
403
403
  this._element.setAttribute("y", String(y));
404
404
  this._element.setAttribute("width", String(size));
@@ -414,7 +414,7 @@ class QRCornerDot {
414
414
  this._rotateFigure({
415
415
  ...args,
416
416
  draw: () => {
417
- this._element = document.createElementNS("http://www.w3.org/2000/svg", "path");
417
+ this._element = this._document.createElementNS("http://www.w3.org/2000/svg", "path");
418
418
  this._element.setAttribute("clip-rule", "evenodd");
419
419
  this._element.setAttribute("d", `M ${x} ${y + 2.5 * dotSize}` +
420
420
  `v ${2 * dotSize}` +
@@ -434,7 +434,7 @@ class QRCornerDot {
434
434
  this._rotateFigure({
435
435
  ...args,
436
436
  draw: () => {
437
- this._element = document.createElementNS("http://www.w3.org/2000/svg", "path");
437
+ this._element = this._document.createElementNS("http://www.w3.org/2000/svg", "path");
438
438
  this._element.setAttribute("clip-rule", "evenodd");
439
439
  this._element.setAttribute("d", `M ${x} ${y + dotSize / 2}` +
440
440
  `v ${dotSize / 4}` +
@@ -588,7 +588,7 @@ class QRCornerSquare {
588
588
  this._rotateFigure({
589
589
  ...args,
590
590
  draw: () => {
591
- this._element = document.createElementNS("http://www.w3.org/2000/svg", "path");
591
+ this._element = this._document.createElementNS("http://www.w3.org/2000/svg", "path");
592
592
  this._element.setAttribute("clip-rule", "evenodd");
593
593
  this._element.setAttribute("d", `M ${x} ${y + 2.5 * dotSize}` +
594
594
  `v ${2 * dotSize}` +
@@ -616,7 +616,7 @@ class QRCornerSquare {
616
616
  this._rotateFigure({
617
617
  ...args,
618
618
  draw: () => {
619
- this._element = document.createElementNS("http://www.w3.org/2000/svg", "path");
619
+ this._element = this._document.createElementNS("http://www.w3.org/2000/svg", "path");
620
620
  this._element.setAttribute("clip-rule", "evenodd");
621
621
  this._element.setAttribute("d", `M ${x} ${y + 2.5 * dotSize}` +
622
622
  `v ${2 * dotSize}` +
@@ -1636,7 +1636,7 @@ let QRCodeStyling$1 = class QRCodeStyling {
1636
1636
  * const extension = (svg, options) => {
1637
1637
  * const { width, height } = options;
1638
1638
  * const size = Math.min(width, height);
1639
- * const border = document.createElementNS("http://www.w3.org/2000/svg", "rect");
1639
+ * const border = options.document.createElementNS("http://www.w3.org/2000/svg", "rect");
1640
1640
  * const borderAttributes = {
1641
1641
  * fill: "none",
1642
1642
  * x: (width - size + 40) / 2,