@searpent/react-image-annotate 2.0.6 → 2.0.9

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
  }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Plugin styles
3
+ */
4
+ .ce-header {
5
+ padding: 0.6em 0 3px;
6
+ margin: 0;
7
+ line-height: 1.25em;
8
+ outline: none;
9
+ }
10
+
11
+ .ce-header p,
12
+ .ce-header div {
13
+ padding: 0 !important;
14
+ margin: 0 !important;
15
+ }
16
+
17
+ /**
18
+ * Styles for Plugin icon in Toolbar
19
+ */
20
+ .ce-header__icon {}
21
+
22
+ .ce-header[contentEditable=true][data-placeholder]::before {
23
+ position: absolute;
24
+ content: attr(data-placeholder);
25
+ color: #707684;
26
+ font-weight: normal;
27
+ display: none;
28
+ cursor: text;
29
+ }
30
+
31
+ .ce-header[contentEditable=true][data-placeholder]:empty::before {
32
+ display: block;
33
+ }
34
+
35
+ .ce-header[contentEditable=true][data-placeholder]:empty:focus::before {
36
+ display: none;
37
+ }
38
+
39
+ /* Custom overwrite */
40
+ .cdx-settings-button {
41
+ width: 100% !important;
42
+ }
43
+
44
+ .ce-settings__plugin-zone {
45
+ padding: 0 .25rem;
46
+ }
@@ -300,7 +300,7 @@ export var ImageCanvas = function ImageCanvas(_ref2) {
300
300
  }, React.createElement("div", {
301
301
  style: {
302
302
  width: "100%",
303
- height: "100%",
303
+ height: "100vh",
304
304
  maxHeight: "calc(100vh - 68px)",
305
305
  position: "relative",
306
306
  overflow: "hidden",
@@ -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) {
@@ -0,0 +1,87 @@
1
+ .page-selector {
2
+ height: 100vh;
3
+ overflow-y: scroll;
4
+ width: 10%;
5
+ }
6
+
7
+ .pages {
8
+ list-style: none;
9
+ padding: 1rem;
10
+ }
11
+
12
+ .page-thumbnail {
13
+ margin-bottom: 1rem;
14
+ border-radius: .25rem !important;
15
+ overflow: hidden;
16
+ filter: grayscale(1);
17
+ transition: transform .2s;
18
+ opacity: .5;
19
+ }
20
+
21
+ .page-thumbnail:hover {
22
+ box-shadow: 0 0 2rem 0 #8898aa !important;
23
+ filter: grayscale(0);
24
+ cursor: pointer;
25
+ opacity: 1;
26
+ }
27
+
28
+ .page-thumbnail-is-active {
29
+ filter: grayscale(0);
30
+ opacity: 1;
31
+ }
32
+
33
+ .page-thumbnail img {
34
+ width: 100%;
35
+ }
36
+
37
+ .bottom-buttons {
38
+ background: linear-gradient(#8898aa, rgba(255, 255, 255, 0));
39
+ position: sticky;
40
+ top: 0;
41
+ display: flex;
42
+ flex-direction: column;
43
+ padding: 1rem;
44
+ margin-bottom: 1rem;
45
+ z-index: 100;
46
+ }
47
+
48
+ .bottom-buttons button {
49
+ margin-bottom: 1rem;
50
+ width: 100%;
51
+ }
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
+
71
+ .page-number-wrapper {
72
+ position: absolute;
73
+ bottom: 0;
74
+ width: 100%;
75
+ height: 10%;
76
+ z-index: 100;
77
+ display: flex;
78
+ justify-content: center;
79
+ align-items: center;
80
+ background: linear-gradient(rgba(255, 255, 255, 0), #8898aa);
81
+ padding: .5rem 0;
82
+ }
83
+
84
+ .page-number {
85
+ font-size: 1.5rem;
86
+ font-weight: 800;
87
+ }
@@ -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.6",
3
+ "version": "2.0.9",
4
4
  "dependencies": {
5
5
  "@editorjs/editorjs": "^2.25.0",
6
6
  "@editorjs/paragraph": "^2.8.0",