@searpent/react-image-annotate 2.0.7 → 2.0.8

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.
@@ -156,15 +156,21 @@ export var Annotator = function Annotator(_ref) {
156
156
  case 0:
157
157
  e.preventDefault();
158
158
 
159
- if (onSave) {
160
- onSave();
161
- dispatchToReducer({
162
- type: "IMAGES_SAVED",
163
- savedAt: new Date()
164
- });
159
+ if (!onSave) {
160
+ _context.next = 5;
161
+ break;
165
162
  }
166
163
 
167
- case 2:
164
+ _context.next = 4;
165
+ return onSave(state.images);
166
+
167
+ case 4:
168
+ dispatchToReducer({
169
+ type: "IMAGES_SAVED",
170
+ savedAt: new Date()
171
+ });
172
+
173
+ case 5:
168
174
  case "end":
169
175
  return _context.stop();
170
176
  }
@@ -38,10 +38,12 @@ function PagesSelector(_ref2) {
38
38
  className: "bottom-buttons"
39
39
  }, React.createElement("button", {
40
40
  onClick: onRecalc,
41
- disabled: !recalcActive
41
+ disabled: !recalcActive,
42
+ className: "info"
42
43
  }, "Recalc"), React.createElement("button", {
43
44
  onClick: onSave,
44
- disabled: !saveActive
45
+ disabled: !saveActive,
46
+ className: "success"
45
47
  }, "Save")), React.createElement("div", {
46
48
  className: "pages"
47
49
  }, pages.map(function (page, idx) {
@@ -50,6 +50,24 @@
50
50
  width: 100%;
51
51
  }
52
52
 
53
+ .bottom-buttons button.info {
54
+ background-color: transparent;
55
+ border-radius: 0.5rem;
56
+ background-image: linear-gradient(310deg, #627594, #a8b8d8);
57
+ color: white;
58
+ border: none;
59
+ padding: 0.5rem 0;
60
+ }
61
+
62
+ .bottom-buttons button.success {
63
+ color: white;
64
+ background-image: linear-gradient(310deg, #2dce89, #2dcecc);
65
+ border-radius: 0.5rem;
66
+ border: none;
67
+ padding: 0.5rem 0;
68
+ }
69
+
70
+
53
71
  .page-number-wrapper {
54
72
  position: absolute;
55
73
  bottom: 0;
@@ -56,7 +56,7 @@ var RegionComponents = {
56
56
  width: Math.max(region.w * iw, 0),
57
57
  height: Math.max(region.h * ih, 0),
58
58
  stroke: colorAlpha(clsColor(region.cls), 0.85),
59
- fill: region.groupHighlighted ? colorAlpha(groupColor(region.groupId), 0.5) : colorAlpha(groupColor(region.groupId), 0.25)
59
+ fill: region.groupHighlighted ? colorAlpha(groupColor(region.groupId), 0.85) : colorAlpha(groupColor(region.groupId), 0.5)
60
60
  }));
61
61
  } else {
62
62
  return React.createElement("g", {
@@ -68,7 +68,7 @@ var RegionComponents = {
68
68
  width: Math.max(region.w * iw, 0),
69
69
  height: Math.max(region.h * ih, 0),
70
70
  stroke: colorAlpha(clsColor(region.cls), 0.85),
71
- fill: colorAlpha(clsColor(region.cls), 0.25)
71
+ fill: colorAlpha(clsColor(region.cls), 0.85)
72
72
  }));
73
73
  }
74
74
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searpent/react-image-annotate",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "dependencies": {
5
5
  "@editorjs/editorjs": "^2.25.0",
6
6
  "@editorjs/paragraph": "^2.8.0",