@liquid-js/qr-code-styling 4.0.0-1 → 4.0.0-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.
package/lib/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { FileExtension } from "./tools/browser-utils.js";
4
4
  export { type RecursivePartial } from "./types/helper.js";
5
5
  export { type CanvasOptions } from "./utils/canvas-options.js";
6
6
  export { GradientType, type Gradient } from "./utils/gradient.js";
7
- export { CornerDotType, CornerSquareType, DotType, ShapeType, type Options } from "./utils/options.js";
7
+ export { CornerDotType, CornerSquareType, DotType, ImageMode, ShapeType, type Options } from "./utils/options.js";
8
8
  export { ErrorCorrectionPercents } from "./utils/qrcode.js";
9
9
  import * as _browserUtils from "./tools/browser-utils.js";
10
10
  export declare const browserUtils: typeof _browserUtils | undefined;
package/lib/node.d.ts CHANGED
@@ -8,7 +8,7 @@ export { FileExtension } from "./tools/browser-utils.js";
8
8
  export { type RecursivePartial } from "./types/helper.js";
9
9
  export { type CanvasOptions } from "./utils/canvas-options.js";
10
10
  export { GradientType, type Gradient } from "./utils/gradient.js";
11
- export { CornerDotType, CornerSquareType, DotType, ShapeType, type Options } from "./utils/options.js";
11
+ export { CornerDotType, CornerSquareType, DotType, ImageMode, ShapeType, type Options } from "./utils/options.js";
12
12
  export { ErrorCorrectionPercents } from "./utils/qrcode.js";
13
13
  export declare const browserUtils: typeof _browserUtils | undefined;
14
14
  export declare class QRCodeStyling extends _QRCodeStyling {
@@ -50,7 +50,7 @@ CornerDotType.classy = "classy", CornerDotType.outpoint = "outpoint", CornerDotT
50
50
  CornerSquareType.extraRounded = "extra-rounded", CornerSquareType.classy = "classy",
51
51
  CornerSquareType.outpoint = "outpoint", CornerSquareType.inpoint = "inpoint", (ShapeType = ShapeType || (ShapeType = {})).square = "square",
52
52
  ShapeType.circle = "circle", (ImageMode = ImageMode || (ImageMode = {})).center = "center",
53
- ImageMode.background = "background";
53
+ ImageMode.overlay = "overlay", ImageMode.background = "background";
54
54
 
55
55
  let defaultOptions = {
56
56
  document: void 0,
@@ -878,13 +878,18 @@ class QRSVG {
878
878
  margin: imageOptions.margin
879
879
  });
880
880
  }
881
- this.drawBackground(), this.options.image && 0 < drawImageSize.width && 0 < drawImageSize.height && await this.drawImage({
881
+ this.drawBackground(), this.options.imageOptions.mode != ImageMode.overlay && this.options.image && 0 < drawImageSize.width && 0 < drawImageSize.height && await this.drawImage({
882
882
  width: drawImageSize.width,
883
883
  height: drawImageSize.height,
884
884
  count,
885
885
  dotSize
886
886
  }), this.drawDots(((i, j) => !(this.options.imageOptions.mode == ImageMode.center && i >= (count - drawImageSize.hideXDots) / 2 && i < (count + drawImageSize.hideXDots) / 2 && j >= (count - drawImageSize.hideYDots) / 2 && j < (count + drawImageSize.hideYDots) / 2 || 8 > i && 8 > j || i >= count - 8 && 8 > j || j >= count - 8 && 8 > i))),
887
- this.drawCorners();
887
+ this.options.imageOptions.mode == ImageMode.overlay && this.options.image && 0 < drawImageSize.width && 0 < drawImageSize.height && await this.drawImage({
888
+ width: drawImageSize.width,
889
+ height: drawImageSize.height,
890
+ count,
891
+ dotSize
892
+ }), this.drawCorners();
888
893
  }
889
894
  drawBackground() {
890
895
  let options = this.options;
@@ -1208,5 +1213,5 @@ class QRCodeStyling extends QRCodeStyling$1 {
1208
1213
 
1209
1214
  var browserUtils = void 0;
1210
1215
 
1211
- export { CornerDotType, CornerSquareType, DotType, ErrorCorrectionPercents, FileExtension, GradientType, QRCodeStyling, ShapeType, browserUtils };
1216
+ export { CornerDotType, CornerSquareType, DotType, ErrorCorrectionPercents, FileExtension, GradientType, ImageMode, QRCodeStyling, ShapeType, browserUtils };
1212
1217
  //# sourceMappingURL=qr-code-styling-node.js.map