dytools-capture-engine 1.2.0 → 1.2.2

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/dist/index.cjs CHANGED
@@ -505,7 +505,7 @@ var SimpleZone = class extends CaptureZoneBase {
505
505
  for (const match of ocrMatches) {
506
506
  if (match.templateZoneId != this.id) continue;
507
507
  if (!this.hidden) {
508
- this.ocrOverlayIds.push(this.canvasManager?.addPolygon(match.polygonAbsolute.points, "rgba(0, 255, 255, 0.25)", false));
508
+ this.ocrOverlayIds.push(this.canvasManager?.addPolygon(match.polygonAbsolute.points, "rgba(0, 255, 0, 0.25)", false));
509
509
  }
510
510
  break;
511
511
  }
@@ -606,7 +606,7 @@ var AnchorZone = class extends CaptureZoneBase {
606
606
  super(name, rect, hidden, filterRegex, outputRegex, outputReplacement, required, dataType, excludeFromOutput, defaultValueIfEmpty);
607
607
  this.type = "anchor";
608
608
  //private primaryCanvasRectangleId: string | null = null;
609
- this._anchorLocation = "TopLeft";
609
+ this._anchorLocation = "MiddleLeft";
610
610
  this._groupChildren = true;
611
611
  this.children = [];
612
612
  //canvasEngineIds: string[] = [];
@@ -729,7 +729,7 @@ var AnchorZone = class extends CaptureZoneBase {
729
729
  for (const match of ocrMatches) {
730
730
  if (match.templateZoneId != this.id) continue;
731
731
  if (!this.hidden) {
732
- this.ocrOverlayIds.push(this.canvasManager?.addPolygon(match.polygonAbsolute.points, "rgba(0, 255, 0, 0.25)", false));
732
+ this.ocrOverlayIds.push(this.canvasManager?.addPolygon(match.polygonAbsolute.points, "rgba(0, 255, 255, 0.25)", false));
733
733
  }
734
734
  if (match.anchorPointAbsolute) {
735
735
  if (!this.hidden) {
@@ -1112,10 +1112,12 @@ var CaptureEngine = class {
1112
1112
  if (type === CaptureToEngineEventType.ZoneChildZoneAdded) {
1113
1113
  const zoneChildZoneAddedPayload = payload;
1114
1114
  this.onZoneAdded(zoneChildZoneAddedPayload.newChildZone, zoneChildZoneAddedPayload.parentZone);
1115
+ this.emitExternal(CapturePublicEventType.TemplateChanged, {});
1115
1116
  }
1116
1117
  if (type === CaptureToEngineEventType.ZoneChildZoneRemoved) {
1117
1118
  const zoneChildZoneRemovedPayload = payload;
1118
1119
  this.onZoneRemoved(zoneChildZoneRemovedPayload.removedChildZone, zoneChildZoneRemovedPayload.parentZone);
1120
+ this.emitExternal(CapturePublicEventType.TemplateChanged, {});
1119
1121
  }
1120
1122
  if (type === CaptureToEngineEventType.ZoneNameChanged) {
1121
1123
  const zoneNameChangedPayload = payload;
package/dist/index.d.cts CHANGED
@@ -394,7 +394,7 @@ interface CaptureToEngineEventPayloads {
394
394
  };
395
395
  }
396
396
  type ZoneKind = "simple" | "anchor" | "anchor-child";
397
- type AnchorLocation = "TopLeft" | "TopRight" | "BottomLeft" | "BottomRight" | "Center";
397
+ type AnchorLocation = "TopLeft" | "TopRight" | "BottomLeft" | "BottomRight" | "CenterMiddle" | "CenterTop" | "CenterBottom" | "MiddleLeft" | "MiddleRight";
398
398
  interface TemplateZoneBase {
399
399
  id: string;
400
400
  name: string;
package/dist/index.d.ts CHANGED
@@ -394,7 +394,7 @@ interface CaptureToEngineEventPayloads {
394
394
  };
395
395
  }
396
396
  type ZoneKind = "simple" | "anchor" | "anchor-child";
397
- type AnchorLocation = "TopLeft" | "TopRight" | "BottomLeft" | "BottomRight" | "Center";
397
+ type AnchorLocation = "TopLeft" | "TopRight" | "BottomLeft" | "BottomRight" | "CenterMiddle" | "CenterTop" | "CenterBottom" | "MiddleLeft" | "MiddleRight";
398
398
  interface TemplateZoneBase {
399
399
  id: string;
400
400
  name: string;
package/dist/index.js CHANGED
@@ -489,7 +489,7 @@ var SimpleZone = class extends CaptureZoneBase {
489
489
  for (const match of ocrMatches) {
490
490
  if (match.templateZoneId != this.id) continue;
491
491
  if (!this.hidden) {
492
- this.ocrOverlayIds.push(this.canvasManager?.addPolygon(match.polygonAbsolute.points, "rgba(0, 255, 255, 0.25)", false));
492
+ this.ocrOverlayIds.push(this.canvasManager?.addPolygon(match.polygonAbsolute.points, "rgba(0, 255, 0, 0.25)", false));
493
493
  }
494
494
  break;
495
495
  }
@@ -590,7 +590,7 @@ var AnchorZone = class extends CaptureZoneBase {
590
590
  super(name, rect, hidden, filterRegex, outputRegex, outputReplacement, required, dataType, excludeFromOutput, defaultValueIfEmpty);
591
591
  this.type = "anchor";
592
592
  //private primaryCanvasRectangleId: string | null = null;
593
- this._anchorLocation = "TopLeft";
593
+ this._anchorLocation = "MiddleLeft";
594
594
  this._groupChildren = true;
595
595
  this.children = [];
596
596
  //canvasEngineIds: string[] = [];
@@ -713,7 +713,7 @@ var AnchorZone = class extends CaptureZoneBase {
713
713
  for (const match of ocrMatches) {
714
714
  if (match.templateZoneId != this.id) continue;
715
715
  if (!this.hidden) {
716
- this.ocrOverlayIds.push(this.canvasManager?.addPolygon(match.polygonAbsolute.points, "rgba(0, 255, 0, 0.25)", false));
716
+ this.ocrOverlayIds.push(this.canvasManager?.addPolygon(match.polygonAbsolute.points, "rgba(0, 255, 255, 0.25)", false));
717
717
  }
718
718
  if (match.anchorPointAbsolute) {
719
719
  if (!this.hidden) {
@@ -1096,10 +1096,12 @@ var CaptureEngine = class {
1096
1096
  if (type === CaptureToEngineEventType.ZoneChildZoneAdded) {
1097
1097
  const zoneChildZoneAddedPayload = payload;
1098
1098
  this.onZoneAdded(zoneChildZoneAddedPayload.newChildZone, zoneChildZoneAddedPayload.parentZone);
1099
+ this.emitExternal(CapturePublicEventType.TemplateChanged, {});
1099
1100
  }
1100
1101
  if (type === CaptureToEngineEventType.ZoneChildZoneRemoved) {
1101
1102
  const zoneChildZoneRemovedPayload = payload;
1102
1103
  this.onZoneRemoved(zoneChildZoneRemovedPayload.removedChildZone, zoneChildZoneRemovedPayload.parentZone);
1104
+ this.emitExternal(CapturePublicEventType.TemplateChanged, {});
1103
1105
  }
1104
1106
  if (type === CaptureToEngineEventType.ZoneNameChanged) {
1105
1107
  const zoneNameChangedPayload = payload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dytools-capture-engine",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "An editor allowing the creation of templates for ocr capture.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",