@searpent/react-image-annotate 2.3.4 → 2.3.6
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/Annotator/examplePhotos.js +28 -28
- package/Annotator/examplePhotos_repr.js +28 -28
- package/Annotator/index.js +40 -31
- package/Annotator/index.story_bugdemo_15_1.js +895 -773
- package/Annotator/index.story_repr.js +1048 -933
- package/Annotator/reducers/convert-expanding-line-to-polygon.js +15 -16
- package/ClassSelectionMenu/index.js +55 -35
- package/Crosshairs/index.js +30 -23
- package/DebugSidebarBox/index.js +40 -9
- package/DemoSite/Editor.js +124 -79
- package/DemoSite/ErrorBoundaryDialog.js +19 -6
- package/DemoSite/index.js +26 -17
- package/Editor/index.js +70 -36
- package/Editor/index_bugdemo_15_1.js +68 -35
- package/Editor/readOnly.js +178 -127
- package/Errorer/index.js +8 -3
- package/FullImageSegmentationAnnotator/index.js +6 -3
- package/GroupSelectorSidebarBox/index.js +48 -32
- package/GroupsEditorSidebarBox/index.js +75 -40
- package/HelpSidebarBox/index.js +24 -13
- package/HighlightBox/index.js +37 -30
- package/HistorySidebarBox/index.js +51 -29
- package/ImageCanvas/index.js +165 -130
- package/ImageMask/index.js +9 -6
- package/ImageSelectorSidebarBox/index.js +44 -26
- package/KeyframeTimeline/index.js +65 -45
- package/KeyframesSelectorSidebarBox/index.js +76 -54
- package/LandingPage/index.js +76 -38
- package/Locker/index.js +8 -3
- package/MainLayout/RightSidebarItemsWrapper.js +7 -4
- package/MainLayout/icon-dictionary.js +99 -66
- package/MainLayout/index.js +258 -196
- package/MainLayout/index_bugdemo_15_1.js +253 -195
- package/MetadataEditorSidebarBox/index.js +152 -102
- package/MetadataEditorSidebarBox/index_14_01_25.js +152 -102
- package/MetadataEditorSidebarBox/index_repr.js +183 -128
- package/PageSelector/UpdatedBySemaphore.js +95 -0
- package/PageSelector/index.js +181 -97
- package/PageSelector/page-selector.css +118 -2
- package/PointDistances/index.js +45 -33
- package/PreventScrollToParents/index.js +16 -9
- package/RegionLabel/index.js +217 -165
- package/RegionSelectAndTransformBoxes/index.js +131 -105
- package/RegionSelectorSidebarBox/index.js +243 -165
- package/RegionShapes/index.js +213 -153
- package/RegionTags/index.js +83 -69
- package/SettingsDialog/index.js +50 -37
- package/SettingsProvider/index.js +8 -5
- package/Shortcuts/ShortcutField.js +21 -14
- package/Shortcuts/index.js +18 -12
- package/ShortcutsManager/index.js +7 -4
- package/Sidebar/index.js +46 -29
- package/SidebarBoxContainer/index.js +14 -7
- package/SmallToolButton/index.js +23 -16
- package/TagsSidebarBox/index.js +41 -28
- package/TaskDescriptionSidebarBox/index.js +24 -13
- package/Theme/index.js +8 -3
- package/VideoOrImageCanvasBackground/index.js +30 -17
- package/package.json +1 -1
- package/utils/spellcheck-nspell.js +2 -2
|
@@ -24,228 +24,240 @@ var middlewares = [function (store) {
|
|
|
24
24
|
};
|
|
25
25
|
}];
|
|
26
26
|
storiesOf("Annotator", module).add("Basic", function () {
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
name: "Frame 0036"
|
|
42
|
-
}, {
|
|
43
|
-
src: "https://loremflickr.com/100/100/cars?lock=2",
|
|
44
|
-
name: "Frame 0037"
|
|
45
|
-
}, {
|
|
46
|
-
src: "https://loremflickr.com/100/100/cars?lock=3",
|
|
47
|
-
name: "Frame 0038"
|
|
48
|
-
}]
|
|
49
|
-
});
|
|
50
|
-
}).add("Basic with onImagesChange", function () {
|
|
51
|
-
return React.createElement(HotKeys, {
|
|
52
|
-
keyMap: defaultKeyMap
|
|
53
|
-
}, React.createElement("div", null, React.createElement("div", null, React.createElement(Annotator, {
|
|
54
|
-
middlewares: middlewares,
|
|
55
|
-
labelImages: true,
|
|
56
|
-
regionClsList: ["author", "appendix", "photo_author", "photo_caption", "advertisement", "other_graphics", "unknown", "title", "about_author", "image", "subtitle", "interview", "table", "text", "continuation_ref", "cover_clip", "page_id", "continuation_mark", "follow_up_mark", "article_termination_mark", "page_splitting_stripe", "column_id_stripe", "prev_page_reference", "section_subcategory"],
|
|
57
|
-
help: "# Tools\n\n**E** - select tool\n\n**D** - frame tool\n\n**Ctrl** + **click frame** - edit frame\n\n**1**- **9** - change class",
|
|
58
|
-
onImagesChange: function onImagesChange(images) {
|
|
59
|
-
return console.log("[images changed to]:", images);
|
|
60
|
-
},
|
|
61
|
-
images: photosToImages([examplePhotos[0]]),
|
|
62
|
-
clsColors: {
|
|
63
|
-
title: "#f70202",
|
|
64
|
-
subtitle: "#ffb405",
|
|
65
|
-
text: "#14deef",
|
|
66
|
-
author: "#f8d51e",
|
|
67
|
-
appendix: "#bfede2",
|
|
68
|
-
photo_author: "#9a17bb",
|
|
69
|
-
photo_caption: "#ff84f6",
|
|
70
|
-
advertisement: "#ffb201",
|
|
71
|
-
other_graphics: "#ff5400",
|
|
72
|
-
unknown: "#bfede2",
|
|
73
|
-
about_author: "#9a17bb",
|
|
74
|
-
image: "#14deef",
|
|
75
|
-
interview: "#23b20f",
|
|
76
|
-
table: "#02b4ba",
|
|
77
|
-
continuation_ref: '#FF33CC',
|
|
78
|
-
cover_clip: '#669966',
|
|
79
|
-
page_id: '#4433AA',
|
|
80
|
-
continuation_mark: '#660066',
|
|
81
|
-
follow_up_mark: '#873e23',
|
|
82
|
-
article_termination_mark: '#873e23',
|
|
83
|
-
page_splitting_stripe: '#873e23',
|
|
84
|
-
column_id_stripe: '#873e23',
|
|
85
|
-
prev_page_reference: '#f3a864',
|
|
86
|
-
section_subcategory: '#442c55'
|
|
87
|
-
} // groupColors={[
|
|
88
|
-
// "#3853F1",
|
|
89
|
-
// "#F6E54C",
|
|
90
|
-
// "#39D33C",
|
|
91
|
-
// "#CF24CF",
|
|
92
|
-
// "#22E3ED",
|
|
93
|
-
// "#EF3029",
|
|
94
|
-
// ]}
|
|
95
|
-
,
|
|
96
|
-
enabledTools: [],
|
|
97
|
-
groupColors: ['#343434', '#989898', '#dcdcdc'],
|
|
98
|
-
onGroupSelect: function onGroupSelect(groupId) {
|
|
99
|
-
return console.log('selected groupid:', groupId);
|
|
100
|
-
},
|
|
101
|
-
hideHeader: true,
|
|
102
|
-
hideHistory: true,
|
|
103
|
-
hideNotEditingLabel: true,
|
|
104
|
-
showEditor: true,
|
|
105
|
-
showPageSelector: true,
|
|
106
|
-
albumMetadata: [{
|
|
107
|
-
key: "issueNumber",
|
|
108
|
-
value: "12"
|
|
109
|
-
}, {
|
|
110
|
-
key: "issueType",
|
|
111
|
-
value: "news"
|
|
112
|
-
}],
|
|
113
|
-
metadataConfigs: [{
|
|
114
|
-
key: "issueNumber",
|
|
115
|
-
level: "album",
|
|
116
|
-
options: []
|
|
117
|
-
}, {
|
|
118
|
-
key: "issueType",
|
|
119
|
-
level: "album",
|
|
120
|
-
options: ['news', 'magazine', 'q&a']
|
|
121
|
-
}, {
|
|
122
|
-
key: "mutation",
|
|
123
|
-
level: "photo",
|
|
124
|
-
options: ['Morava', 'Slezsko', 'Cechy']
|
|
125
|
-
}, {
|
|
126
|
-
key: "previousArticleId",
|
|
127
|
-
level: "photo_metadata-engine",
|
|
128
|
-
options: [{
|
|
129
|
-
value: "alpha",
|
|
130
|
-
label: "0 - alpha"
|
|
131
|
-
}, {
|
|
132
|
-
value: "beta",
|
|
133
|
-
label: "1 - beta"
|
|
27
|
+
return (
|
|
28
|
+
/*#__PURE__*/
|
|
29
|
+
React.createElement(Annotator, {
|
|
30
|
+
onExit: actionAddon("onExit"),
|
|
31
|
+
middlewares: middlewares,
|
|
32
|
+
labelImages: true,
|
|
33
|
+
regionClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
34
|
+
regionTagList: ["tag1", "tag2", "tag3"],
|
|
35
|
+
imageClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
36
|
+
imageTagList: ["tag1", "tag2", "tag3"],
|
|
37
|
+
images: [{
|
|
38
|
+
src: exampleImage,
|
|
39
|
+
name: "Seve's Desk",
|
|
40
|
+
regions: testRegions
|
|
134
41
|
}, {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}]
|
|
138
|
-
}, {
|
|
139
|
-
key: "pageNumber",
|
|
140
|
-
level: "photo",
|
|
141
|
-
options: []
|
|
142
|
-
}, {
|
|
143
|
-
key: "articleType",
|
|
144
|
-
level: "photo_metadata-engine",
|
|
145
|
-
selectable: true,
|
|
146
|
-
options: [{
|
|
147
|
-
value: "alpha",
|
|
148
|
-
label: "0 - alpha"
|
|
42
|
+
src: "https://loremflickr.com/100/100/cars?lock=1",
|
|
43
|
+
name: "Frame 0036"
|
|
149
44
|
}, {
|
|
150
|
-
|
|
151
|
-
|
|
45
|
+
src: "https://loremflickr.com/100/100/cars?lock=2",
|
|
46
|
+
name: "Frame 0037"
|
|
152
47
|
}, {
|
|
153
|
-
|
|
154
|
-
|
|
48
|
+
src: "https://loremflickr.com/100/100/cars?lock=3",
|
|
49
|
+
name: "Frame 0038"
|
|
155
50
|
}]
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
onExit: function onExit(s) {
|
|
165
|
-
return console.log('[onExit] triggered:', s);
|
|
51
|
+
})
|
|
52
|
+
);
|
|
53
|
+
}).add("Basic with onImagesChange", function () {
|
|
54
|
+
return (
|
|
55
|
+
/*#__PURE__*/
|
|
56
|
+
React.createElement(HotKeys, {
|
|
57
|
+
keyMap: defaultKeyMap
|
|
166
58
|
},
|
|
167
|
-
save:
|
|
168
59
|
/*#__PURE__*/
|
|
169
|
-
|
|
170
|
-
|
|
60
|
+
React.createElement("div", null,
|
|
61
|
+
/*#__PURE__*/
|
|
62
|
+
React.createElement("div", null,
|
|
63
|
+
/*#__PURE__*/
|
|
64
|
+
React.createElement(Annotator, {
|
|
65
|
+
middlewares: middlewares,
|
|
66
|
+
labelImages: true,
|
|
67
|
+
regionClsList: ["author", "appendix", "photo_author", "photo_caption", "advertisement", "other_graphics", "unknown", "title", "about_author", "image", "subtitle", "interview", "table", "text", "continuation_ref", "cover_clip", "page_id", "continuation_mark", "follow_up_mark", "article_termination_mark", "page_splitting_stripe", "column_id_stripe", "prev_page_reference", "section_subcategory"],
|
|
68
|
+
help: "# Tools\n\n**E** - select tool\n\n**D** - frame tool\n\n**Ctrl** + **click frame** - edit frame\n\n**1**- **9** - change class",
|
|
69
|
+
onImagesChange: function onImagesChange(images) {
|
|
70
|
+
return console.log("[images changed to]:", images);
|
|
71
|
+
},
|
|
72
|
+
images: photosToImages([examplePhotos[0]]),
|
|
73
|
+
clsColors: {
|
|
74
|
+
title: "#f70202",
|
|
75
|
+
subtitle: "#ffb405",
|
|
76
|
+
text: "#14deef",
|
|
77
|
+
author: "#f8d51e",
|
|
78
|
+
appendix: "#bfede2",
|
|
79
|
+
photo_author: "#9a17bb",
|
|
80
|
+
photo_caption: "#ff84f6",
|
|
81
|
+
advertisement: "#ffb201",
|
|
82
|
+
other_graphics: "#ff5400",
|
|
83
|
+
unknown: "#bfede2",
|
|
84
|
+
about_author: "#9a17bb",
|
|
85
|
+
image: "#14deef",
|
|
86
|
+
interview: "#23b20f",
|
|
87
|
+
table: "#02b4ba",
|
|
88
|
+
continuation_ref: '#FF33CC',
|
|
89
|
+
cover_clip: '#669966',
|
|
90
|
+
page_id: '#4433AA',
|
|
91
|
+
continuation_mark: '#660066',
|
|
92
|
+
follow_up_mark: '#873e23',
|
|
93
|
+
article_termination_mark: '#873e23',
|
|
94
|
+
page_splitting_stripe: '#873e23',
|
|
95
|
+
column_id_stripe: '#873e23',
|
|
96
|
+
prev_page_reference: '#f3a864',
|
|
97
|
+
section_subcategory: '#442c55'
|
|
98
|
+
} // groupColors={[
|
|
99
|
+
// "#3853F1",
|
|
100
|
+
// "#F6E54C",
|
|
101
|
+
// "#39D33C",
|
|
102
|
+
// "#CF24CF",
|
|
103
|
+
// "#22E3ED",
|
|
104
|
+
// "#EF3029",
|
|
105
|
+
// ]}
|
|
106
|
+
,
|
|
107
|
+
enabledTools: [],
|
|
108
|
+
groupColors: ['#343434', '#989898', '#dcdcdc'],
|
|
109
|
+
onGroupSelect: function onGroupSelect(groupId) {
|
|
110
|
+
return console.log('selected groupid:', groupId);
|
|
111
|
+
},
|
|
112
|
+
hideHeader: true,
|
|
113
|
+
hideHistory: true,
|
|
114
|
+
hideNotEditingLabel: true,
|
|
115
|
+
showEditor: true,
|
|
116
|
+
showPageSelector: true,
|
|
117
|
+
albumMetadata: [{
|
|
118
|
+
key: "issueNumber",
|
|
119
|
+
value: "12"
|
|
120
|
+
}, {
|
|
121
|
+
key: "issueType",
|
|
122
|
+
value: "news"
|
|
123
|
+
}],
|
|
124
|
+
metadataConfigs: [{
|
|
125
|
+
key: "issueNumber",
|
|
126
|
+
level: "album",
|
|
127
|
+
options: []
|
|
128
|
+
}, {
|
|
129
|
+
key: "issueType",
|
|
130
|
+
level: "album",
|
|
131
|
+
options: ['news', 'magazine', 'q&a']
|
|
132
|
+
}, {
|
|
133
|
+
key: "mutation",
|
|
134
|
+
level: "photo",
|
|
135
|
+
options: ['Morava', 'Slezsko', 'Cechy']
|
|
136
|
+
}, {
|
|
137
|
+
key: "previousArticleId",
|
|
138
|
+
level: "photo_metadata-engine",
|
|
139
|
+
options: [{
|
|
140
|
+
value: "alpha",
|
|
141
|
+
label: "0 - alpha"
|
|
142
|
+
}, {
|
|
143
|
+
value: "beta",
|
|
144
|
+
label: "1 - beta"
|
|
145
|
+
}, {
|
|
146
|
+
value: "gamma",
|
|
147
|
+
label: "2 - gamma"
|
|
148
|
+
}]
|
|
149
|
+
}, {
|
|
150
|
+
key: "pageNumber",
|
|
151
|
+
level: "photo",
|
|
152
|
+
options: []
|
|
153
|
+
}, {
|
|
154
|
+
key: "articleType",
|
|
155
|
+
level: "photo_metadata-engine",
|
|
156
|
+
selectable: true,
|
|
157
|
+
options: [{
|
|
158
|
+
value: "alpha",
|
|
159
|
+
label: "0 - alpha"
|
|
160
|
+
}, {
|
|
161
|
+
value: "beta",
|
|
162
|
+
label: "1 - beta"
|
|
163
|
+
}, {
|
|
164
|
+
value: "gamma",
|
|
165
|
+
label: "2 - gamma"
|
|
166
|
+
}]
|
|
167
|
+
}, {
|
|
168
|
+
key: "section",
|
|
169
|
+
level: "photo_metadata-engine",
|
|
170
|
+
options: ['editorial', 'article', 'last page']
|
|
171
|
+
}],
|
|
172
|
+
onSelectedImageChange: function onSelectedImageChange(d) {
|
|
173
|
+
return console.log("[onSelectedImageChange] triggered:", d);
|
|
174
|
+
},
|
|
175
|
+
onExit: function onExit(s) {
|
|
176
|
+
return console.log('[onExit] triggered:', s);
|
|
177
|
+
},
|
|
178
|
+
save:
|
|
171
179
|
/*#__PURE__*/
|
|
172
|
-
|
|
173
|
-
var
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
function () {
|
|
181
|
+
var _ref2 = _asyncToGenerator(
|
|
182
|
+
/*#__PURE__*/
|
|
183
|
+
_regeneratorRuntime.mark(function _callee(_ref) {
|
|
184
|
+
var image, triggerRecalc, albumMetadata;
|
|
185
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
186
|
+
while (1) {
|
|
187
|
+
switch (_context.prev = _context.next) {
|
|
188
|
+
case 0:
|
|
189
|
+
image = _ref.image, triggerRecalc = _ref.triggerRecalc, albumMetadata = _ref.albumMetadata;
|
|
190
|
+
console.log("[SYNC] image ".concat(image.id, " saving... recalc: ").concat(triggerRecalc, " albumMetadata: ").concat(albumMetadata.length));
|
|
191
|
+
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
|
192
|
+
setTimeout(function () {
|
|
193
|
+
var lockedUntil = null;
|
|
183
194
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
195
|
+
if (triggerRecalc) {
|
|
196
|
+
var now = new Date();
|
|
197
|
+
now.setSeconds(now.getSeconds() + 60);
|
|
198
|
+
lockedUntil = now;
|
|
199
|
+
}
|
|
189
200
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
201
|
+
resolve({
|
|
202
|
+
lockedUntil: lockedUntil
|
|
203
|
+
});
|
|
204
|
+
}, 3000);
|
|
205
|
+
}));
|
|
195
206
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
207
|
+
case 3:
|
|
208
|
+
case "end":
|
|
209
|
+
return _context.stop();
|
|
210
|
+
}
|
|
199
211
|
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}));
|
|
212
|
+
}, _callee);
|
|
213
|
+
}));
|
|
203
214
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
/*#__PURE__*/
|
|
210
|
-
function () {
|
|
211
|
-
var _ref4 = _asyncToGenerator(
|
|
215
|
+
return function (_x) {
|
|
216
|
+
return _ref2.apply(this, arguments);
|
|
217
|
+
};
|
|
218
|
+
}(),
|
|
219
|
+
fetchImage:
|
|
212
220
|
/*#__PURE__*/
|
|
213
|
-
|
|
214
|
-
var
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
221
|
+
function () {
|
|
222
|
+
var _ref4 = _asyncToGenerator(
|
|
223
|
+
/*#__PURE__*/
|
|
224
|
+
_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
225
|
+
var imageId;
|
|
226
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
227
|
+
while (1) {
|
|
228
|
+
switch (_context2.prev = _context2.next) {
|
|
229
|
+
case 0:
|
|
230
|
+
imageId = _ref3.imageId;
|
|
231
|
+
console.log("[SYNC] image ".concat(imageId, " fetching..."));
|
|
232
|
+
return _context2.abrupt("return", new Promise(function (resolve, reject) {
|
|
233
|
+
setTimeout(function () {
|
|
234
|
+
console.log("[SYNC] image ".concat(imageId, " fetched")); // resolve({
|
|
235
|
+
// image: { ...exampleImages[0], lockedUntil: new Date().toISOString(), id: imageId }
|
|
236
|
+
// })
|
|
226
237
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
238
|
+
resolve({
|
|
239
|
+
image: _objectSpread({}, exampleImages[0], {
|
|
240
|
+
lockedUntil: null,
|
|
241
|
+
id: imageId
|
|
242
|
+
})
|
|
243
|
+
});
|
|
244
|
+
}, 5000);
|
|
245
|
+
}));
|
|
235
246
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
247
|
+
case 3:
|
|
248
|
+
case "end":
|
|
249
|
+
return _context2.stop();
|
|
250
|
+
}
|
|
239
251
|
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}));
|
|
252
|
+
}, _callee2);
|
|
253
|
+
}));
|
|
243
254
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
255
|
+
return function (_x2) {
|
|
256
|
+
return _ref4.apply(this, arguments);
|
|
257
|
+
};
|
|
258
|
+
}()
|
|
259
|
+
}))))
|
|
260
|
+
);
|
|
249
261
|
}).add("Basic with onImagesChange (missing articleType value -> reproduce hang)", function () {
|
|
250
262
|
var _storyPhoto$modelResu, _storyPhoto$modelResu2, _metadataEngine$resul;
|
|
251
263
|
|
|
@@ -292,613 +304,674 @@ storiesOf("Annotator", module).add("Basic", function () {
|
|
|
292
304
|
return children;
|
|
293
305
|
};
|
|
294
306
|
|
|
295
|
-
return
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
labelImages: true,
|
|
300
|
-
regionClsList: ["author", "appendix", "photo_author", "photo_caption", "advertisement", "other_graphics", "unknown", "title", "about_author", "image", "subtitle", "interview", "table", "text", "continuation_ref", "cover_clip", "page_id", "continuation_mark", "follow_up_mark", "article_termination_mark", "page_splitting_stripe", "column_id_stripe", "prev_page_reference", "section_subcategory"],
|
|
301
|
-
help: "# Tools\n\n**E** - select tool\n\n**D** - frame tool\n\n**Ctrl** + **click frame** - edit frame\n\n**1**- **9** - change class",
|
|
302
|
-
onImagesChange: function onImagesChange(images) {
|
|
303
|
-
return console.log("[images changed to]:", images);
|
|
304
|
-
},
|
|
305
|
-
images: photosToImages([storyPhoto]),
|
|
306
|
-
clsColors: {
|
|
307
|
-
title: "#f70202",
|
|
308
|
-
subtitle: "#ffb405",
|
|
309
|
-
text: "#14deef",
|
|
310
|
-
author: "#f8d51e",
|
|
311
|
-
appendix: "#bfede2",
|
|
312
|
-
photo_author: "#9a17bb",
|
|
313
|
-
photo_caption: "#ff84f6",
|
|
314
|
-
advertisement: "#ffb201",
|
|
315
|
-
other_graphics: "#ff5400",
|
|
316
|
-
unknown: "#bfede2",
|
|
317
|
-
about_author: "#9a17bb",
|
|
318
|
-
image: "#14deef",
|
|
319
|
-
interview: "#23b20f",
|
|
320
|
-
table: "#02b4ba",
|
|
321
|
-
continuation_ref: "#FF33CC",
|
|
322
|
-
cover_clip: "#669966",
|
|
323
|
-
page_id: "#4433AA",
|
|
324
|
-
continuation_mark: "#660066",
|
|
325
|
-
follow_up_mark: "#873e23",
|
|
326
|
-
article_termination_mark: "#873e23",
|
|
327
|
-
page_splitting_stripe: "#873e23",
|
|
328
|
-
column_id_stripe: "#873e23",
|
|
329
|
-
prev_page_reference: "#f3a864",
|
|
330
|
-
section_subcategory: "#442c55"
|
|
331
|
-
},
|
|
332
|
-
enabledTools: [],
|
|
333
|
-
groupColors: ["#343434", "#989898", "#dcdcdc"],
|
|
334
|
-
onGroupSelect: function onGroupSelect(groupId) {
|
|
335
|
-
return console.log("selected groupid:", groupId);
|
|
307
|
+
return (
|
|
308
|
+
/*#__PURE__*/
|
|
309
|
+
React.createElement(HotKeys, {
|
|
310
|
+
keyMap: defaultKeyMap
|
|
336
311
|
},
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
312
|
+
/*#__PURE__*/
|
|
313
|
+
React.createElement(EnableBuggyMetadataInputMode, null,
|
|
314
|
+
/*#__PURE__*/
|
|
315
|
+
React.createElement("div", null,
|
|
316
|
+
/*#__PURE__*/
|
|
317
|
+
React.createElement("div", null,
|
|
318
|
+
/*#__PURE__*/
|
|
319
|
+
React.createElement(Annotator, {
|
|
320
|
+
middlewares: middlewares,
|
|
321
|
+
labelImages: true,
|
|
322
|
+
regionClsList: ["author", "appendix", "photo_author", "photo_caption", "advertisement", "other_graphics", "unknown", "title", "about_author", "image", "subtitle", "interview", "table", "text", "continuation_ref", "cover_clip", "page_id", "continuation_mark", "follow_up_mark", "article_termination_mark", "page_splitting_stripe", "column_id_stripe", "prev_page_reference", "section_subcategory"],
|
|
323
|
+
help: "# Tools\n\n**E** - select tool\n\n**D** - frame tool\n\n**Ctrl** + **click frame** - edit frame\n\n**1**- **9** - change class",
|
|
324
|
+
onImagesChange: function onImagesChange(images) {
|
|
325
|
+
return console.log("[images changed to]:", images);
|
|
326
|
+
},
|
|
327
|
+
images: photosToImages([storyPhoto]),
|
|
328
|
+
clsColors: {
|
|
329
|
+
title: "#f70202",
|
|
330
|
+
subtitle: "#ffb405",
|
|
331
|
+
text: "#14deef",
|
|
332
|
+
author: "#f8d51e",
|
|
333
|
+
appendix: "#bfede2",
|
|
334
|
+
photo_author: "#9a17bb",
|
|
335
|
+
photo_caption: "#ff84f6",
|
|
336
|
+
advertisement: "#ffb201",
|
|
337
|
+
other_graphics: "#ff5400",
|
|
338
|
+
unknown: "#bfede2",
|
|
339
|
+
about_author: "#9a17bb",
|
|
340
|
+
image: "#14deef",
|
|
341
|
+
interview: "#23b20f",
|
|
342
|
+
table: "#02b4ba",
|
|
343
|
+
continuation_ref: "#FF33CC",
|
|
344
|
+
cover_clip: "#669966",
|
|
345
|
+
page_id: "#4433AA",
|
|
346
|
+
continuation_mark: "#660066",
|
|
347
|
+
follow_up_mark: "#873e23",
|
|
348
|
+
article_termination_mark: "#873e23",
|
|
349
|
+
page_splitting_stripe: "#873e23",
|
|
350
|
+
column_id_stripe: "#873e23",
|
|
351
|
+
prev_page_reference: "#f3a864",
|
|
352
|
+
section_subcategory: "#442c55"
|
|
353
|
+
},
|
|
354
|
+
enabledTools: [],
|
|
355
|
+
groupColors: ["#343434", "#989898", "#dcdcdc"],
|
|
356
|
+
onGroupSelect: function onGroupSelect(groupId) {
|
|
357
|
+
return console.log("selected groupid:", groupId);
|
|
358
|
+
},
|
|
359
|
+
hideHeader: true,
|
|
360
|
+
hideHistory: true,
|
|
361
|
+
hideNotEditingLabel: true,
|
|
362
|
+
showEditor: true,
|
|
363
|
+
showPageSelector: true,
|
|
364
|
+
albumMetadata: [{
|
|
365
|
+
key: "issueNumber",
|
|
366
|
+
value: "12"
|
|
368
367
|
}, {
|
|
369
|
-
|
|
370
|
-
|
|
368
|
+
key: "issueType",
|
|
369
|
+
value: "news"
|
|
370
|
+
}],
|
|
371
|
+
metadataConfigs: [{
|
|
372
|
+
key: "issueNumber",
|
|
373
|
+
level: "album",
|
|
374
|
+
options: []
|
|
371
375
|
}, {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
376
|
+
key: "issueType",
|
|
377
|
+
level: "album",
|
|
378
|
+
options: ["news", "magazine", "q&a"]
|
|
379
|
+
}, {
|
|
380
|
+
key: "mutation",
|
|
381
|
+
level: "photo",
|
|
382
|
+
options: ["Morava", "Slezsko", "Cechy"]
|
|
383
|
+
}, {
|
|
384
|
+
key: "previousArticleId",
|
|
385
|
+
level: "photo_metadata-engine",
|
|
386
|
+
selectable: true,
|
|
387
|
+
options: [{
|
|
388
|
+
value: "alpha",
|
|
389
|
+
label: "0 - alpha"
|
|
390
|
+
}, {
|
|
391
|
+
value: "beta",
|
|
392
|
+
label: "1 - beta"
|
|
393
|
+
}, {
|
|
394
|
+
value: "gamma",
|
|
395
|
+
label: "2 - gamma"
|
|
396
|
+
}]
|
|
397
|
+
}, {
|
|
398
|
+
key: "pageNumber",
|
|
399
|
+
level: "photo",
|
|
400
|
+
options: []
|
|
401
|
+
}, // IMPORTANT: articleType is a text input here (not selectable),
|
|
402
|
+
// to match production (`<input type="text" ...>`).
|
|
403
|
+
{
|
|
404
|
+
key: "articleType",
|
|
405
|
+
level: "photo_metadata-engine",
|
|
406
|
+
options: ["alpha", "beta", "gamma"]
|
|
407
|
+
}, {
|
|
408
|
+
key: "section",
|
|
409
|
+
level: "photo_metadata-engine",
|
|
410
|
+
options: ["editorial", "article", "last page"]
|
|
411
|
+
}],
|
|
412
|
+
onSelectedImageChange: function onSelectedImageChange(d) {
|
|
413
|
+
return console.log("[onSelectedImageChange] triggered:", d);
|
|
414
|
+
},
|
|
415
|
+
onExit: function onExit(s) {
|
|
416
|
+
return console.log("[onExit] triggered:", s);
|
|
417
|
+
},
|
|
418
|
+
save:
|
|
400
419
|
/*#__PURE__*/
|
|
401
|
-
|
|
402
|
-
var
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
420
|
+
function () {
|
|
421
|
+
var _ref7 = _asyncToGenerator(
|
|
422
|
+
/*#__PURE__*/
|
|
423
|
+
_regeneratorRuntime.mark(function _callee3(_ref6) {
|
|
424
|
+
var image, triggerRecalc, albumMetadata;
|
|
425
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
426
|
+
while (1) {
|
|
427
|
+
switch (_context3.prev = _context3.next) {
|
|
428
|
+
case 0:
|
|
429
|
+
image = _ref6.image, triggerRecalc = _ref6.triggerRecalc, albumMetadata = _ref6.albumMetadata;
|
|
430
|
+
console.log("[SYNC] image ".concat(image.id, " saving... recalc: ").concat(triggerRecalc, " albumMetadata: ").concat(albumMetadata.length));
|
|
431
|
+
return _context3.abrupt("return", new Promise(function (resolve) {
|
|
432
|
+
setTimeout(function () {
|
|
433
|
+
var lockedUntil = null;
|
|
412
434
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
435
|
+
if (triggerRecalc) {
|
|
436
|
+
var now = new Date();
|
|
437
|
+
now.setSeconds(now.getSeconds() + 60);
|
|
438
|
+
lockedUntil = now;
|
|
439
|
+
}
|
|
418
440
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
441
|
+
resolve({
|
|
442
|
+
lockedUntil: lockedUntil
|
|
443
|
+
});
|
|
444
|
+
}, 3000);
|
|
445
|
+
}));
|
|
424
446
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
447
|
+
case 3:
|
|
448
|
+
case "end":
|
|
449
|
+
return _context3.stop();
|
|
450
|
+
}
|
|
428
451
|
}
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
}));
|
|
452
|
+
}, _callee3);
|
|
453
|
+
}));
|
|
432
454
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
/*#__PURE__*/
|
|
439
|
-
function () {
|
|
440
|
-
var _ref9 = _asyncToGenerator(
|
|
455
|
+
return function (_x3) {
|
|
456
|
+
return _ref7.apply(this, arguments);
|
|
457
|
+
};
|
|
458
|
+
}(),
|
|
459
|
+
fetchImage:
|
|
441
460
|
/*#__PURE__*/
|
|
442
|
-
|
|
443
|
-
var
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
+
function () {
|
|
462
|
+
var _ref9 = _asyncToGenerator(
|
|
463
|
+
/*#__PURE__*/
|
|
464
|
+
_regeneratorRuntime.mark(function _callee4(_ref8) {
|
|
465
|
+
var imageId;
|
|
466
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
467
|
+
while (1) {
|
|
468
|
+
switch (_context4.prev = _context4.next) {
|
|
469
|
+
case 0:
|
|
470
|
+
imageId = _ref8.imageId;
|
|
471
|
+
console.log("[SYNC] image ".concat(imageId, " fetching..."));
|
|
472
|
+
return _context4.abrupt("return", new Promise(function (resolve) {
|
|
473
|
+
setTimeout(function () {
|
|
474
|
+
console.log("[SYNC] image ".concat(imageId, " fetched"));
|
|
475
|
+
resolve({
|
|
476
|
+
image: _objectSpread({}, exampleImages[0], {
|
|
477
|
+
lockedUntil: null,
|
|
478
|
+
id: imageId
|
|
479
|
+
})
|
|
480
|
+
});
|
|
481
|
+
}, 5000);
|
|
482
|
+
}));
|
|
461
483
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
484
|
+
case 3:
|
|
485
|
+
case "end":
|
|
486
|
+
return _context4.stop();
|
|
487
|
+
}
|
|
465
488
|
}
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}));
|
|
489
|
+
}, _callee4);
|
|
490
|
+
}));
|
|
469
491
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
492
|
+
return function (_x4) {
|
|
493
|
+
return _ref9.apply(this, arguments);
|
|
494
|
+
};
|
|
495
|
+
}()
|
|
496
|
+
})))))
|
|
497
|
+
);
|
|
475
498
|
}).add("Basic - Allow Comments", function () {
|
|
476
|
-
return
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
499
|
+
return (
|
|
500
|
+
/*#__PURE__*/
|
|
501
|
+
React.createElement(Annotator, {
|
|
502
|
+
onExit: actionAddon("onExit"),
|
|
503
|
+
middlewares: middlewares,
|
|
504
|
+
labelImages: true,
|
|
505
|
+
regionClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
506
|
+
regionTagList: ["tag1", "tag2", "tag3"],
|
|
507
|
+
imageClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
508
|
+
imageTagList: ["tag1", "tag2", "tag3"],
|
|
509
|
+
images: [{
|
|
510
|
+
src: exampleImage,
|
|
511
|
+
name: "Seve's Desk",
|
|
512
|
+
regions: testRegions
|
|
513
|
+
}, {
|
|
514
|
+
src: "https://loremflickr.com/100/100/cars?lock=1",
|
|
515
|
+
name: "Frame 0036"
|
|
516
|
+
}, {
|
|
517
|
+
src: "https://loremflickr.com/100/100/cars?lock=2",
|
|
518
|
+
name: "Frame 0037"
|
|
519
|
+
}, {
|
|
520
|
+
src: "https://loremflickr.com/100/100/cars?lock=3",
|
|
521
|
+
name: "Frame 0038"
|
|
522
|
+
}],
|
|
523
|
+
allowComments: true
|
|
524
|
+
})
|
|
525
|
+
);
|
|
500
526
|
}).add("Fixed Size Container", function () {
|
|
501
|
-
return
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
527
|
+
return (
|
|
528
|
+
/*#__PURE__*/
|
|
529
|
+
React.createElement("div", {
|
|
530
|
+
style: {
|
|
531
|
+
width: 500,
|
|
532
|
+
height: 500
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
/*#__PURE__*/
|
|
536
|
+
React.createElement(Annotator, {
|
|
537
|
+
onExit: actionAddon("onExit"),
|
|
538
|
+
middlewares: [function (store) {
|
|
539
|
+
return function (next) {
|
|
540
|
+
return function (action) {
|
|
541
|
+
actionAddon(action.type)(action);
|
|
542
|
+
return next(action);
|
|
543
|
+
};
|
|
513
544
|
};
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
}
|
|
535
|
-
|
|
545
|
+
}],
|
|
546
|
+
labelImages: true,
|
|
547
|
+
regionClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
548
|
+
regionTagList: ["tag1", "tag2", "tag3"],
|
|
549
|
+
imageClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
550
|
+
imageTagList: ["tag1", "tag2", "tag3"],
|
|
551
|
+
images: [{
|
|
552
|
+
src: exampleImage,
|
|
553
|
+
name: "Seve's Desk",
|
|
554
|
+
regions: testRegions
|
|
555
|
+
}, {
|
|
556
|
+
src: "https://loremflickr.com/100/100/cars?lock=1",
|
|
557
|
+
name: "Frame 0036"
|
|
558
|
+
}, {
|
|
559
|
+
src: "https://loremflickr.com/100/100/cars?lock=2",
|
|
560
|
+
name: "Frame 0037"
|
|
561
|
+
}, {
|
|
562
|
+
src: "https://loremflickr.com/100/100/cars?lock=3",
|
|
563
|
+
name: "Frame 0038"
|
|
564
|
+
}]
|
|
565
|
+
}))
|
|
566
|
+
);
|
|
536
567
|
}).add("Shrunk Annotator (Test Fullscreen)", function () {
|
|
537
|
-
return
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
568
|
+
return (
|
|
569
|
+
/*#__PURE__*/
|
|
570
|
+
React.createElement("div", {
|
|
571
|
+
style: {
|
|
572
|
+
padding: 100
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
/*#__PURE__*/
|
|
576
|
+
React.createElement(Annotator, {
|
|
577
|
+
onExit: actionAddon("onExit"),
|
|
578
|
+
regionClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
579
|
+
regionTagList: ["tag1", "tag2", "tag3"],
|
|
580
|
+
middlewares: [function (store) {
|
|
581
|
+
return function (next) {
|
|
582
|
+
return function (action) {
|
|
583
|
+
actionAddon(action.type)(action);
|
|
584
|
+
return next(action);
|
|
585
|
+
};
|
|
550
586
|
};
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
}
|
|
558
|
-
|
|
587
|
+
}],
|
|
588
|
+
images: [{
|
|
589
|
+
src: exampleImage,
|
|
590
|
+
name: "Seve's Desk",
|
|
591
|
+
regions: testRegions
|
|
592
|
+
}]
|
|
593
|
+
}))
|
|
594
|
+
);
|
|
559
595
|
}).add("Annotator w/o No Region Labels or Image Labels", function () {
|
|
560
|
-
return
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
596
|
+
return (
|
|
597
|
+
/*#__PURE__*/
|
|
598
|
+
React.createElement(Annotator, {
|
|
599
|
+
onExit: actionAddon("onExit"),
|
|
600
|
+
middlewares: middlewares,
|
|
601
|
+
images: [{
|
|
602
|
+
src: exampleImage,
|
|
603
|
+
name: "Seve's Desk",
|
|
604
|
+
regions: testRegions
|
|
605
|
+
}]
|
|
606
|
+
})
|
|
607
|
+
);
|
|
569
608
|
}).add("Annotator with no enabled tools", function () {
|
|
570
|
-
return
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
609
|
+
return (
|
|
610
|
+
/*#__PURE__*/
|
|
611
|
+
React.createElement(Annotator, {
|
|
612
|
+
onExit: actionAddon("onExit"),
|
|
613
|
+
enabledTools: [],
|
|
614
|
+
showTags: false,
|
|
615
|
+
middlewares: middlewares,
|
|
616
|
+
images: [{
|
|
617
|
+
src: exampleImage,
|
|
618
|
+
name: "Seve's Desk",
|
|
619
|
+
regions: testRegions
|
|
620
|
+
}]
|
|
621
|
+
})
|
|
622
|
+
);
|
|
581
623
|
}).add("Bounding Box Annotator with output to console.log", function () {
|
|
582
|
-
return
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
name: "Bounding Box Test",
|
|
599
|
-
regions: []
|
|
600
|
-
}]
|
|
601
|
-
});
|
|
602
|
-
}).add("Bounding Box Annotator with allowed area", function () {
|
|
603
|
-
return React.createElement(Annotator, {
|
|
604
|
-
taskDescription: "## Annotate Hands\nDraw a bounding box around each hand.",
|
|
605
|
-
enabledTools: ["select", "create-box"],
|
|
606
|
-
regionClsList: ["Hand", "Face"],
|
|
607
|
-
regionTagList: ["Open Pinch", "Closed Pinch", "In Frame"],
|
|
608
|
-
showTags: false,
|
|
609
|
-
allowedArea: {
|
|
610
|
-
x: 0,
|
|
611
|
-
y: 0.6,
|
|
612
|
-
w: 0.3,
|
|
613
|
-
h: 0.3
|
|
614
|
-
},
|
|
615
|
-
images: [{
|
|
616
|
-
src: "https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame017.png",
|
|
617
|
-
name: "Bounding Box Test",
|
|
618
|
-
regions: []
|
|
619
|
-
}]
|
|
620
|
-
});
|
|
621
|
-
}).add("Car Annotation", function () {
|
|
622
|
-
return React.createElement(Annotator, {
|
|
623
|
-
middlewares: middlewares,
|
|
624
|
-
labelImages: true,
|
|
625
|
-
regionClsList: ["Car", "Sign", "Construction Barrier"],
|
|
626
|
-
regionTagList: ["Moving", "Stopped", "Obstacle"],
|
|
627
|
-
imageClsList: ["On Street", "Sidewalk", "Other"] // imageTagList={["tag1", "tag2", "tag3"]}
|
|
628
|
-
,
|
|
629
|
-
images: [{
|
|
630
|
-
src: bikeImg1,
|
|
631
|
-
name: "Frame 03021",
|
|
632
|
-
regions: [{
|
|
633
|
-
cls: "Car",
|
|
634
|
-
color: "hsl(82,100%,50%)",
|
|
635
|
-
h: 0.45921666772960146,
|
|
636
|
-
w: 0.3932156342484836,
|
|
637
|
-
x: 0.6302148980776354,
|
|
638
|
-
y: 0.5559504689545722,
|
|
639
|
-
type: "box",
|
|
640
|
-
id: "8776160642957009",
|
|
641
|
-
tags: ["Stopped"],
|
|
642
|
-
highlighted: false,
|
|
643
|
-
editingLabels: false
|
|
644
|
-
}, {
|
|
645
|
-
cls: "Car",
|
|
646
|
-
color: "hsl(264,100%,50%)",
|
|
647
|
-
type: "box",
|
|
648
|
-
id: "885140028730734",
|
|
649
|
-
tags: ["Moving"],
|
|
650
|
-
w: 0.2627711048576583,
|
|
651
|
-
x: 0.20751775748638238,
|
|
652
|
-
y: 0.5566583219431673,
|
|
653
|
-
h: 0.268717618171478,
|
|
654
|
-
highlighted: false,
|
|
655
|
-
editingLabels: false
|
|
656
|
-
}, {
|
|
657
|
-
cls: "Car",
|
|
658
|
-
color: "hsl(127,100%,50%)",
|
|
659
|
-
w: 0.033016094117647055,
|
|
660
|
-
x: 0.5051247779336334,
|
|
661
|
-
y: 0.5396378545840628,
|
|
662
|
-
h: 0.03423999999999994,
|
|
663
|
-
type: "box",
|
|
664
|
-
id: "5952553512262024",
|
|
665
|
-
tags: ["Stopped"],
|
|
666
|
-
highlighted: false,
|
|
667
|
-
editingLabels: false
|
|
624
|
+
return (
|
|
625
|
+
/*#__PURE__*/
|
|
626
|
+
React.createElement(Annotator, {
|
|
627
|
+
onExit: function onExit(out) {
|
|
628
|
+
window.lastOutput = out;
|
|
629
|
+
console.log(out);
|
|
630
|
+
},
|
|
631
|
+
taskDescription: "## Annotate Hands\nDraw a bounding box around each hand.",
|
|
632
|
+
enabledTools: ["select", "create-box"],
|
|
633
|
+
regionClsList: ["Hand", "Face"],
|
|
634
|
+
regionTagList: ["Open Pinch", "Closed Pinch", "In Frame"],
|
|
635
|
+
showTags: false,
|
|
636
|
+
images: [{
|
|
637
|
+
src: "https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame017.png",
|
|
638
|
+
name: "Bounding Box Test",
|
|
639
|
+
regions: []
|
|
668
640
|
}, {
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
w: 0.04871147880041349,
|
|
673
|
-
h: 0.10995961095800888,
|
|
674
|
-
highlighted: true,
|
|
675
|
-
editingLabels: false,
|
|
676
|
-
color: "hsl(268,100%,50%)",
|
|
677
|
-
id: "5647593040225252",
|
|
678
|
-
cls: "Sign"
|
|
641
|
+
src: "https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame001.png",
|
|
642
|
+
name: "Bounding Box Test",
|
|
643
|
+
regions: []
|
|
679
644
|
}]
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
highlighted: false,
|
|
702
|
-
editingLabels: false,
|
|
703
|
-
color: "hsl(17,100%,50%)",
|
|
704
|
-
id: "02954614542034717",
|
|
705
|
-
cls: "Car",
|
|
706
|
-
tags: ["Moving"]
|
|
707
|
-
}, {
|
|
708
|
-
type: "box",
|
|
709
|
-
x: 0.6483083881082046,
|
|
710
|
-
y: 0.6217109311709718,
|
|
711
|
-
w: 0.08786544324705947,
|
|
712
|
-
h: 0.20450608002345438,
|
|
713
|
-
highlighted: true,
|
|
714
|
-
editingLabels: true,
|
|
715
|
-
color: "hsl(337,100%,50%)",
|
|
716
|
-
id: "9124138360972984",
|
|
717
|
-
cls: "Construction Barrier",
|
|
718
|
-
tags: ["Obstacle"]
|
|
719
|
-
}, {
|
|
720
|
-
type: "box",
|
|
721
|
-
x: 0.7628671305695606,
|
|
722
|
-
y: 0.6299511028935285,
|
|
723
|
-
w: 0.12734928166820647,
|
|
724
|
-
h: 0.2689292407634438,
|
|
725
|
-
highlighted: false,
|
|
726
|
-
editingLabels: false,
|
|
727
|
-
color: "hsl(89,100%,50%)",
|
|
728
|
-
id: "5960600741979638",
|
|
729
|
-
cls: "Construction Barrier"
|
|
730
|
-
}, {
|
|
731
|
-
type: "box",
|
|
732
|
-
x: 0.5871362440754417,
|
|
733
|
-
y: 0.6232091442114366,
|
|
734
|
-
w: 0.06562102723514573,
|
|
735
|
-
h: 0.15281773012741662,
|
|
736
|
-
highlighted: false,
|
|
737
|
-
editingLabels: false,
|
|
738
|
-
color: "hsl(326,100%,50%)",
|
|
739
|
-
id: "7955287536996538",
|
|
740
|
-
cls: "Construction Barrier"
|
|
741
|
-
}, {
|
|
742
|
-
type: "box",
|
|
743
|
-
x: 0.42943330004934643,
|
|
744
|
-
y: 0.6054718359824862,
|
|
745
|
-
w: 0.053210066743122564,
|
|
746
|
-
h: 0.054984658299147116,
|
|
747
|
-
highlighted: false,
|
|
748
|
-
editingLabels: false,
|
|
749
|
-
color: "hsl(66,100%,50%)",
|
|
750
|
-
id: "49573139861381166",
|
|
751
|
-
cls: "Car",
|
|
752
|
-
tags: ["Stopped"]
|
|
645
|
+
})
|
|
646
|
+
);
|
|
647
|
+
}).add("Bounding Box Annotator with allowed area", function () {
|
|
648
|
+
return (
|
|
649
|
+
/*#__PURE__*/
|
|
650
|
+
React.createElement(Annotator, {
|
|
651
|
+
taskDescription: "## Annotate Hands\nDraw a bounding box around each hand.",
|
|
652
|
+
enabledTools: ["select", "create-box"],
|
|
653
|
+
regionClsList: ["Hand", "Face"],
|
|
654
|
+
regionTagList: ["Open Pinch", "Closed Pinch", "In Frame"],
|
|
655
|
+
showTags: false,
|
|
656
|
+
allowedArea: {
|
|
657
|
+
x: 0,
|
|
658
|
+
y: 0.6,
|
|
659
|
+
w: 0.3,
|
|
660
|
+
h: 0.3
|
|
661
|
+
},
|
|
662
|
+
images: [{
|
|
663
|
+
src: "https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame017.png",
|
|
664
|
+
name: "Bounding Box Test",
|
|
665
|
+
regions: []
|
|
753
666
|
}]
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
return function (next) {
|
|
770
|
-
return function (action) {
|
|
771
|
-
actionAddon(action.type)(action);
|
|
772
|
-
return next(action);
|
|
773
|
-
};
|
|
774
|
-
};
|
|
775
|
-
}],
|
|
776
|
-
images: [{
|
|
777
|
-
src: exampleImage,
|
|
778
|
-
name: "Seve's Desk",
|
|
779
|
-
regions: testRegions
|
|
780
|
-
}]
|
|
781
|
-
}), React.createElement("div", {
|
|
782
|
-
style: {
|
|
783
|
-
color: "red"
|
|
784
|
-
}
|
|
785
|
-
}, "You shouldn't be able to see this"));
|
|
786
|
-
}).add("Annotator should not expand beyond parent", function () {
|
|
787
|
-
return React.createElement("div", {
|
|
788
|
-
style: {
|
|
789
|
-
width: "100vw",
|
|
790
|
-
height: "100vh",
|
|
791
|
-
padding: 100,
|
|
792
|
-
boxSizing: "border-box"
|
|
793
|
-
}
|
|
794
|
-
}, React.createElement(Annotator, {
|
|
795
|
-
onExit: actionAddon("onExit"),
|
|
796
|
-
showTags: false,
|
|
797
|
-
middlewares: [function (store) {
|
|
798
|
-
return function (next) {
|
|
799
|
-
return function (action) {
|
|
800
|
-
actionAddon(action.type)(action);
|
|
801
|
-
return next(action);
|
|
802
|
-
};
|
|
803
|
-
};
|
|
804
|
-
}],
|
|
805
|
-
images: [{
|
|
806
|
-
src: exampleImage,
|
|
807
|
-
name: "Seve's Desk",
|
|
808
|
-
regions: testRegions
|
|
809
|
-
}]
|
|
810
|
-
}));
|
|
811
|
-
}).add("Video with frames as each image", function () {
|
|
812
|
-
return React.createElement("div", {
|
|
813
|
-
style: {
|
|
814
|
-
width: "100vw",
|
|
815
|
-
height: "100vh",
|
|
816
|
-
boxSizing: "border-box"
|
|
817
|
-
}
|
|
818
|
-
}, React.createElement(Annotator, {
|
|
819
|
-
onExit: actionAddon("onExit"),
|
|
820
|
-
showTags: false,
|
|
821
|
-
middlewares: [function (store) {
|
|
822
|
-
return function (next) {
|
|
823
|
-
return function (action) {
|
|
824
|
-
actionAddon(action.type)(action);
|
|
825
|
-
return next(action);
|
|
826
|
-
};
|
|
827
|
-
};
|
|
828
|
-
}],
|
|
829
|
-
images: [{
|
|
830
|
-
src: "https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4",
|
|
831
|
-
frameTime: 0,
|
|
832
|
-
name: "Frame 1"
|
|
833
|
-
}, {
|
|
834
|
-
src: "https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4",
|
|
835
|
-
frameTime: 4500,
|
|
836
|
-
name: "Frame 2"
|
|
837
|
-
}]
|
|
838
|
-
}));
|
|
839
|
-
}).add("Keyframe video", function () {
|
|
840
|
-
return React.createElement("div", {
|
|
841
|
-
style: {
|
|
842
|
-
width: "100vw",
|
|
843
|
-
height: "100vh",
|
|
844
|
-
boxSizing: "border-box"
|
|
845
|
-
}
|
|
846
|
-
}, React.createElement(Annotator, {
|
|
847
|
-
onExit: function onExit() {
|
|
848
|
-
var _console;
|
|
849
|
-
|
|
850
|
-
(_console = console).log.apply(_console, arguments);
|
|
851
|
-
|
|
852
|
-
actionAddon("onExit").apply(void 0, arguments);
|
|
853
|
-
},
|
|
854
|
-
showTags: true,
|
|
855
|
-
videoSrc: "https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4",
|
|
856
|
-
videoTime: 1000,
|
|
857
|
-
keyframes: {
|
|
858
|
-
0: {
|
|
667
|
+
})
|
|
668
|
+
);
|
|
669
|
+
}).add("Car Annotation", function () {
|
|
670
|
+
return (
|
|
671
|
+
/*#__PURE__*/
|
|
672
|
+
React.createElement(Annotator, {
|
|
673
|
+
middlewares: middlewares,
|
|
674
|
+
labelImages: true,
|
|
675
|
+
regionClsList: ["Car", "Sign", "Construction Barrier"],
|
|
676
|
+
regionTagList: ["Moving", "Stopped", "Obstacle"],
|
|
677
|
+
imageClsList: ["On Street", "Sidewalk", "Other"] // imageTagList={["tag1", "tag2", "tag3"]}
|
|
678
|
+
,
|
|
679
|
+
images: [{
|
|
680
|
+
src: bikeImg1,
|
|
681
|
+
name: "Frame 03021",
|
|
859
682
|
regions: [{
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
683
|
+
cls: "Car",
|
|
684
|
+
color: "hsl(82,100%,50%)",
|
|
685
|
+
h: 0.45921666772960146,
|
|
686
|
+
w: 0.3932156342484836,
|
|
687
|
+
x: 0.6302148980776354,
|
|
688
|
+
y: 0.5559504689545722,
|
|
689
|
+
type: "box",
|
|
690
|
+
id: "8776160642957009",
|
|
691
|
+
tags: ["Stopped"],
|
|
692
|
+
highlighted: false,
|
|
693
|
+
editingLabels: false
|
|
867
694
|
}, {
|
|
695
|
+
cls: "Car",
|
|
696
|
+
color: "hsl(264,100%,50%)",
|
|
868
697
|
type: "box",
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
w: 0.
|
|
872
|
-
|
|
698
|
+
id: "885140028730734",
|
|
699
|
+
tags: ["Moving"],
|
|
700
|
+
w: 0.2627711048576583,
|
|
701
|
+
x: 0.20751775748638238,
|
|
702
|
+
y: 0.5566583219431673,
|
|
703
|
+
h: 0.268717618171478,
|
|
704
|
+
highlighted: false,
|
|
705
|
+
editingLabels: false
|
|
706
|
+
}, {
|
|
707
|
+
cls: "Car",
|
|
708
|
+
color: "hsl(127,100%,50%)",
|
|
709
|
+
w: 0.033016094117647055,
|
|
710
|
+
x: 0.5051247779336334,
|
|
711
|
+
y: 0.5396378545840628,
|
|
712
|
+
h: 0.03423999999999994,
|
|
713
|
+
type: "box",
|
|
714
|
+
id: "5952553512262024",
|
|
715
|
+
tags: ["Stopped"],
|
|
716
|
+
highlighted: false,
|
|
717
|
+
editingLabels: false
|
|
718
|
+
}, {
|
|
719
|
+
type: "box",
|
|
720
|
+
x: 0.7847296794208894,
|
|
721
|
+
y: 0.3635007199404308,
|
|
722
|
+
w: 0.04871147880041349,
|
|
723
|
+
h: 0.10995961095800888,
|
|
873
724
|
highlighted: true,
|
|
874
725
|
editingLabels: false,
|
|
875
|
-
color: "hsl(
|
|
876
|
-
id: "
|
|
726
|
+
color: "hsl(268,100%,50%)",
|
|
727
|
+
id: "5647593040225252",
|
|
728
|
+
cls: "Sign"
|
|
877
729
|
}]
|
|
878
|
-
},
|
|
879
|
-
|
|
730
|
+
}, {
|
|
731
|
+
src: bikeImg2,
|
|
732
|
+
name: "Frame 03022",
|
|
880
733
|
regions: [{
|
|
881
|
-
type: "
|
|
882
|
-
x: 0.
|
|
883
|
-
y: 0.
|
|
884
|
-
|
|
734
|
+
type: "box",
|
|
735
|
+
x: 0.12226982552783494,
|
|
736
|
+
y: 0.5578947368421052,
|
|
737
|
+
w: 0.3301518695958121,
|
|
738
|
+
h: 0.33562583001232194,
|
|
739
|
+
highlighted: false,
|
|
885
740
|
editingLabels: false,
|
|
886
|
-
color: "hsl(
|
|
887
|
-
id: "
|
|
741
|
+
color: "hsl(171,100%,50%)",
|
|
742
|
+
id: "014393439034159128",
|
|
743
|
+
cls: "Car",
|
|
744
|
+
tags: ["Stopped"]
|
|
888
745
|
}, {
|
|
889
746
|
type: "box",
|
|
890
|
-
x: 0.
|
|
891
|
-
y: 0.
|
|
892
|
-
w: 0.
|
|
893
|
-
h: 0.
|
|
747
|
+
x: 0.5018477698901193,
|
|
748
|
+
y: 0.5954194079501558,
|
|
749
|
+
w: 0.07194249496837657,
|
|
750
|
+
h: 0.06826906557009338,
|
|
751
|
+
highlighted: false,
|
|
752
|
+
editingLabels: false,
|
|
753
|
+
color: "hsl(17,100%,50%)",
|
|
754
|
+
id: "02954614542034717",
|
|
755
|
+
cls: "Car",
|
|
756
|
+
tags: ["Moving"]
|
|
757
|
+
}, {
|
|
758
|
+
type: "box",
|
|
759
|
+
x: 0.6483083881082046,
|
|
760
|
+
y: 0.6217109311709718,
|
|
761
|
+
w: 0.08786544324705947,
|
|
762
|
+
h: 0.20450608002345438,
|
|
894
763
|
highlighted: true,
|
|
764
|
+
editingLabels: true,
|
|
765
|
+
color: "hsl(337,100%,50%)",
|
|
766
|
+
id: "9124138360972984",
|
|
767
|
+
cls: "Construction Barrier",
|
|
768
|
+
tags: ["Obstacle"]
|
|
769
|
+
}, {
|
|
770
|
+
type: "box",
|
|
771
|
+
x: 0.7628671305695606,
|
|
772
|
+
y: 0.6299511028935285,
|
|
773
|
+
w: 0.12734928166820647,
|
|
774
|
+
h: 0.2689292407634438,
|
|
775
|
+
highlighted: false,
|
|
776
|
+
editingLabels: false,
|
|
777
|
+
color: "hsl(89,100%,50%)",
|
|
778
|
+
id: "5960600741979638",
|
|
779
|
+
cls: "Construction Barrier"
|
|
780
|
+
}, {
|
|
781
|
+
type: "box",
|
|
782
|
+
x: 0.5871362440754417,
|
|
783
|
+
y: 0.6232091442114366,
|
|
784
|
+
w: 0.06562102723514573,
|
|
785
|
+
h: 0.15281773012741662,
|
|
786
|
+
highlighted: false,
|
|
895
787
|
editingLabels: false,
|
|
896
|
-
color: "hsl(
|
|
897
|
-
id: "
|
|
788
|
+
color: "hsl(326,100%,50%)",
|
|
789
|
+
id: "7955287536996538",
|
|
790
|
+
cls: "Construction Barrier"
|
|
791
|
+
}, {
|
|
792
|
+
type: "box",
|
|
793
|
+
x: 0.42943330004934643,
|
|
794
|
+
y: 0.6054718359824862,
|
|
795
|
+
w: 0.053210066743122564,
|
|
796
|
+
h: 0.054984658299147116,
|
|
797
|
+
highlighted: false,
|
|
798
|
+
editingLabels: false,
|
|
799
|
+
color: "hsl(66,100%,50%)",
|
|
800
|
+
id: "49573139861381166",
|
|
801
|
+
cls: "Car",
|
|
802
|
+
tags: ["Stopped"]
|
|
898
803
|
}]
|
|
804
|
+
}],
|
|
805
|
+
onExit: function onExit(out) {
|
|
806
|
+
window.lastOutput = out;
|
|
807
|
+
console.log(JSON.stringify(out.images));
|
|
808
|
+
}
|
|
809
|
+
})
|
|
810
|
+
);
|
|
811
|
+
}).add("Annotator blocks scroll from propagating", function () {
|
|
812
|
+
return (
|
|
813
|
+
/*#__PURE__*/
|
|
814
|
+
React.createElement("div", {
|
|
815
|
+
style: {
|
|
816
|
+
height: "200vh"
|
|
899
817
|
}
|
|
900
|
-
}
|
|
901
|
-
|
|
818
|
+
},
|
|
819
|
+
/*#__PURE__*/
|
|
820
|
+
React.createElement(Annotator, {
|
|
821
|
+
onExit: actionAddon("onExit"),
|
|
822
|
+
showTags: false,
|
|
823
|
+
middlewares: [function (store) {
|
|
824
|
+
return function (next) {
|
|
825
|
+
return function (action) {
|
|
826
|
+
actionAddon(action.type)(action);
|
|
827
|
+
return next(action);
|
|
828
|
+
};
|
|
829
|
+
};
|
|
830
|
+
}],
|
|
831
|
+
images: [{
|
|
832
|
+
src: exampleImage,
|
|
833
|
+
name: "Seve's Desk",
|
|
834
|
+
regions: testRegions
|
|
835
|
+
}]
|
|
836
|
+
}),
|
|
837
|
+
/*#__PURE__*/
|
|
838
|
+
React.createElement("div", {
|
|
839
|
+
style: {
|
|
840
|
+
color: "red"
|
|
841
|
+
}
|
|
842
|
+
}, "You shouldn't be able to see this"))
|
|
843
|
+
);
|
|
844
|
+
}).add("Annotator should not expand beyond parent", function () {
|
|
845
|
+
return (
|
|
846
|
+
/*#__PURE__*/
|
|
847
|
+
React.createElement("div", {
|
|
848
|
+
style: {
|
|
849
|
+
width: "100vw",
|
|
850
|
+
height: "100vh",
|
|
851
|
+
padding: 100,
|
|
852
|
+
boxSizing: "border-box"
|
|
853
|
+
}
|
|
854
|
+
},
|
|
855
|
+
/*#__PURE__*/
|
|
856
|
+
React.createElement(Annotator, {
|
|
857
|
+
onExit: actionAddon("onExit"),
|
|
858
|
+
showTags: false,
|
|
859
|
+
middlewares: [function (store) {
|
|
860
|
+
return function (next) {
|
|
861
|
+
return function (action) {
|
|
862
|
+
actionAddon(action.type)(action);
|
|
863
|
+
return next(action);
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
}],
|
|
867
|
+
images: [{
|
|
868
|
+
src: exampleImage,
|
|
869
|
+
name: "Seve's Desk",
|
|
870
|
+
regions: testRegions
|
|
871
|
+
}]
|
|
872
|
+
}))
|
|
873
|
+
);
|
|
874
|
+
}).add("Video with frames as each image", function () {
|
|
875
|
+
return (
|
|
876
|
+
/*#__PURE__*/
|
|
877
|
+
React.createElement("div", {
|
|
878
|
+
style: {
|
|
879
|
+
width: "100vw",
|
|
880
|
+
height: "100vh",
|
|
881
|
+
boxSizing: "border-box"
|
|
882
|
+
}
|
|
883
|
+
},
|
|
884
|
+
/*#__PURE__*/
|
|
885
|
+
React.createElement(Annotator, {
|
|
886
|
+
onExit: actionAddon("onExit"),
|
|
887
|
+
showTags: false,
|
|
888
|
+
middlewares: [function (store) {
|
|
889
|
+
return function (next) {
|
|
890
|
+
return function (action) {
|
|
891
|
+
actionAddon(action.type)(action);
|
|
892
|
+
return next(action);
|
|
893
|
+
};
|
|
894
|
+
};
|
|
895
|
+
}],
|
|
896
|
+
images: [{
|
|
897
|
+
src: "https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4",
|
|
898
|
+
frameTime: 0,
|
|
899
|
+
name: "Frame 1"
|
|
900
|
+
}, {
|
|
901
|
+
src: "https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4",
|
|
902
|
+
frameTime: 4500,
|
|
903
|
+
name: "Frame 2"
|
|
904
|
+
}]
|
|
905
|
+
}))
|
|
906
|
+
);
|
|
907
|
+
}).add("Keyframe video", function () {
|
|
908
|
+
return (
|
|
909
|
+
/*#__PURE__*/
|
|
910
|
+
React.createElement("div", {
|
|
911
|
+
style: {
|
|
912
|
+
width: "100vw",
|
|
913
|
+
height: "100vh",
|
|
914
|
+
boxSizing: "border-box"
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
/*#__PURE__*/
|
|
918
|
+
React.createElement(Annotator, {
|
|
919
|
+
onExit: function onExit() {
|
|
920
|
+
var _console;
|
|
921
|
+
|
|
922
|
+
(_console = console).log.apply(_console, arguments);
|
|
923
|
+
|
|
924
|
+
actionAddon("onExit").apply(void 0, arguments);
|
|
925
|
+
},
|
|
926
|
+
showTags: true,
|
|
927
|
+
videoSrc: "https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4",
|
|
928
|
+
videoTime: 1000,
|
|
929
|
+
keyframes: {
|
|
930
|
+
0: {
|
|
931
|
+
regions: [{
|
|
932
|
+
type: "point",
|
|
933
|
+
x: 0.1608187134502924,
|
|
934
|
+
y: 0.5769980506822612,
|
|
935
|
+
highlighted: true,
|
|
936
|
+
editingLabels: false,
|
|
937
|
+
color: "hsl(238,100%,50%)",
|
|
938
|
+
id: "9995495728521284"
|
|
939
|
+
}, {
|
|
940
|
+
type: "box",
|
|
941
|
+
x: 0.089171974522293,
|
|
942
|
+
y: 0.36801132342533616,
|
|
943
|
+
w: 0.30573248407643316,
|
|
944
|
+
h: 0.4170794998820476,
|
|
945
|
+
highlighted: true,
|
|
946
|
+
editingLabels: false,
|
|
947
|
+
color: "hsl(263,100%,50%)",
|
|
948
|
+
id: "04858393322065635"
|
|
949
|
+
}]
|
|
950
|
+
},
|
|
951
|
+
3333: {
|
|
952
|
+
regions: [{
|
|
953
|
+
type: "point",
|
|
954
|
+
x: 0.1608187134502924,
|
|
955
|
+
y: 0.5769980506822612,
|
|
956
|
+
highlighted: true,
|
|
957
|
+
editingLabels: false,
|
|
958
|
+
color: "hsl(238,100%,50%)",
|
|
959
|
+
id: "9995495728521284"
|
|
960
|
+
}, {
|
|
961
|
+
type: "box",
|
|
962
|
+
x: 0.14861995753715496,
|
|
963
|
+
y: 0.0934182590233546,
|
|
964
|
+
w: 0.3163481953290871,
|
|
965
|
+
h: 0.7596131163010142,
|
|
966
|
+
highlighted: true,
|
|
967
|
+
editingLabels: false,
|
|
968
|
+
color: "hsl(263,100%,50%)",
|
|
969
|
+
id: "04858393322065635"
|
|
970
|
+
}]
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
}))
|
|
974
|
+
);
|
|
902
975
|
}).add("Override Next/Prev Button Handling", function () {
|
|
903
976
|
var images = [exampleImage, "https://loremflickr.com/100/100/cars?lock=1", "https://loremflickr.com/100/100/cars?lock=2"];
|
|
904
977
|
|
|
@@ -907,31 +980,34 @@ storiesOf("Annotator", module).add("Basic", function () {
|
|
|
907
980
|
selectedImageIndex = _useState2[0],
|
|
908
981
|
changeSelectedImageIndex = _useState2[1];
|
|
909
982
|
|
|
910
|
-
return
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
actionAddon("
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
983
|
+
return (
|
|
984
|
+
/*#__PURE__*/
|
|
985
|
+
React.createElement(Annotator, {
|
|
986
|
+
onExit: actionAddon("onExit"),
|
|
987
|
+
onNextImage: function onNextImage() {
|
|
988
|
+
actionAddon("onNextImage")();
|
|
989
|
+
changeSelectedImageIndex((selectedImageIndex + 1) % 3);
|
|
990
|
+
},
|
|
991
|
+
onPrevImage: function onPrevImage() {
|
|
992
|
+
actionAddon("onPrevImage")();
|
|
993
|
+
changeSelectedImageIndex((selectedImageIndex - 1 + 3) % 3);
|
|
994
|
+
},
|
|
995
|
+
labelImages: true,
|
|
996
|
+
selectedImage: images[selectedImageIndex],
|
|
997
|
+
regionClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
998
|
+
imageClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
999
|
+
images: [{
|
|
1000
|
+
src: exampleImage,
|
|
1001
|
+
name: "Seve's Desk"
|
|
1002
|
+
}, {
|
|
1003
|
+
src: images[1],
|
|
1004
|
+
name: "Frame 0036"
|
|
1005
|
+
}, {
|
|
1006
|
+
src: images[2],
|
|
1007
|
+
name: "Frame 0037"
|
|
1008
|
+
}]
|
|
1009
|
+
})
|
|
1010
|
+
);
|
|
935
1011
|
}).add("Override RegionEditLabel", function () {
|
|
936
1012
|
var images = [exampleImage, "https://loremflickr.com/100/100/cars?lock=1", "https://loremflickr.com/100/100/cars?lock=2"];
|
|
937
1013
|
|
|
@@ -942,147 +1018,186 @@ storiesOf("Annotator", module).add("Basic", function () {
|
|
|
942
1018
|
onChange = _ref10.onChange,
|
|
943
1019
|
onClose = _ref10.onClose,
|
|
944
1020
|
onOpen = _ref10.onOpen;
|
|
945
|
-
return
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1021
|
+
return (
|
|
1022
|
+
/*#__PURE__*/
|
|
1023
|
+
React.createElement("div", {
|
|
1024
|
+
style: {
|
|
1025
|
+
backgroundColor: "white"
|
|
1026
|
+
}
|
|
1027
|
+
}, "I'm the closed part",
|
|
1028
|
+
/*#__PURE__*/
|
|
1029
|
+
React.createElement("div", {
|
|
1030
|
+
style: {
|
|
1031
|
+
display: editing ? "block" : "none"
|
|
1032
|
+
}
|
|
1033
|
+
}, "I'm the part that shows when it's being edited!",
|
|
1034
|
+
/*#__PURE__*/
|
|
1035
|
+
React.createElement("button", {
|
|
1036
|
+
onClick: function onClick() {
|
|
1037
|
+
return onDelete(region);
|
|
1038
|
+
}
|
|
1039
|
+
}, "Delete This Region"),
|
|
1040
|
+
/*#__PURE__*/
|
|
1041
|
+
React.createElement("button", {
|
|
1042
|
+
onClick: function onClick() {
|
|
1043
|
+
return onChange(_objectSpread({}, region, {
|
|
1044
|
+
cls: "awesome-value"
|
|
1045
|
+
}));
|
|
1046
|
+
}
|
|
1047
|
+
}, "Set Classification to \"awesome-value\""),
|
|
1048
|
+
/*#__PURE__*/
|
|
1049
|
+
React.createElement("button", {
|
|
1050
|
+
onClick: function onClick() {
|
|
1051
|
+
return onClose(region);
|
|
1052
|
+
}
|
|
1053
|
+
}, "Close the edit mode")))
|
|
1054
|
+
);
|
|
968
1055
|
};
|
|
969
1056
|
|
|
970
|
-
return
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
1057
|
+
return (
|
|
1058
|
+
/*#__PURE__*/
|
|
1059
|
+
React.createElement(Annotator, {
|
|
1060
|
+
onExit: actionAddon("onExit"),
|
|
1061
|
+
labelImages: true,
|
|
1062
|
+
selectedImage: images[0],
|
|
1063
|
+
RegionEditLabel: NewRegionEditLabel,
|
|
1064
|
+
images: [{
|
|
1065
|
+
src: exampleImage,
|
|
1066
|
+
name: "Seve's Desk"
|
|
1067
|
+
}, {
|
|
1068
|
+
src: images[1],
|
|
1069
|
+
name: "Frame 0036"
|
|
1070
|
+
}, {
|
|
1071
|
+
src: images[2],
|
|
1072
|
+
name: "Frame 0037"
|
|
1073
|
+
}]
|
|
1074
|
+
})
|
|
1075
|
+
);
|
|
986
1076
|
}).add("Two on sample page w/ hotkeys", function () {
|
|
987
|
-
return
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1077
|
+
return (
|
|
1078
|
+
/*#__PURE__*/
|
|
1079
|
+
React.createElement(HotKeys, {
|
|
1080
|
+
keyMap: defaultKeyMap
|
|
1081
|
+
},
|
|
1082
|
+
/*#__PURE__*/
|
|
1083
|
+
React.createElement("div", null,
|
|
1084
|
+
/*#__PURE__*/
|
|
1085
|
+
React.createElement("div", {
|
|
1086
|
+
style: {
|
|
1087
|
+
height: 600
|
|
1088
|
+
}
|
|
1089
|
+
},
|
|
1090
|
+
/*#__PURE__*/
|
|
1091
|
+
React.createElement(Annotator, {
|
|
1092
|
+
onExit: actionAddon("onExit"),
|
|
1093
|
+
regionClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
1094
|
+
imageClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
1095
|
+
middlewares: [function (store) {
|
|
1096
|
+
return function (next) {
|
|
1097
|
+
return function (action) {
|
|
1098
|
+
actionAddon(action.type)(action);
|
|
1099
|
+
return next(action);
|
|
1100
|
+
};
|
|
1002
1101
|
};
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1102
|
+
}],
|
|
1103
|
+
images: [{
|
|
1104
|
+
src: exampleImage,
|
|
1105
|
+
name: "Seve's Desk",
|
|
1106
|
+
regions: testRegions
|
|
1107
|
+
}]
|
|
1108
|
+
})),
|
|
1109
|
+
/*#__PURE__*/
|
|
1110
|
+
React.createElement("div", {
|
|
1111
|
+
style: {
|
|
1112
|
+
height: 600
|
|
1113
|
+
}
|
|
1114
|
+
},
|
|
1115
|
+
/*#__PURE__*/
|
|
1116
|
+
React.createElement(Annotator, {
|
|
1117
|
+
onExit: actionAddon("onExit"),
|
|
1118
|
+
middlewares: [function (store) {
|
|
1119
|
+
return function (next) {
|
|
1120
|
+
return function (action) {
|
|
1121
|
+
actionAddon(action.type)(action);
|
|
1122
|
+
return next(action);
|
|
1123
|
+
};
|
|
1021
1124
|
};
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1125
|
+
}],
|
|
1126
|
+
images: [{
|
|
1127
|
+
src: exampleImage,
|
|
1128
|
+
name: "Seve's Desk",
|
|
1129
|
+
regions: testRegions
|
|
1130
|
+
}]
|
|
1131
|
+
}))))
|
|
1132
|
+
);
|
|
1030
1133
|
}).add("CORs Error (Pixel Segmentation)", function () {
|
|
1031
|
-
return
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1134
|
+
return (
|
|
1135
|
+
/*#__PURE__*/
|
|
1136
|
+
React.createElement(Annotator, {
|
|
1137
|
+
onExit: actionAddon("onExit"),
|
|
1138
|
+
middlewares: middlewares,
|
|
1139
|
+
labelImages: true,
|
|
1140
|
+
fullImageSegmentationMode: true,
|
|
1141
|
+
regionClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
1142
|
+
images: [{
|
|
1143
|
+
src: "https://placebear.com/200/300",
|
|
1144
|
+
name: "Frame 0036"
|
|
1145
|
+
}]
|
|
1146
|
+
})
|
|
1147
|
+
);
|
|
1042
1148
|
}).add("Modify Allowed Area", function () {
|
|
1043
|
-
return
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1149
|
+
return (
|
|
1150
|
+
/*#__PURE__*/
|
|
1151
|
+
React.createElement(Annotator, {
|
|
1152
|
+
onExit: actionAddon("onExit"),
|
|
1153
|
+
middlewares: middlewares,
|
|
1154
|
+
labelImages: true,
|
|
1155
|
+
fullImageSegmentationMode: true,
|
|
1156
|
+
allowedArea: {
|
|
1157
|
+
x: 0,
|
|
1158
|
+
y: 0.6,
|
|
1159
|
+
w: 0.3,
|
|
1160
|
+
h: 0.3
|
|
1161
|
+
},
|
|
1162
|
+
enabledTools: ["modify-allowed-area"],
|
|
1163
|
+
regionClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
1164
|
+
images: [{
|
|
1165
|
+
src: exampleImage,
|
|
1166
|
+
name: "Frame 0036"
|
|
1167
|
+
}]
|
|
1168
|
+
})
|
|
1169
|
+
);
|
|
1061
1170
|
}).add("Hide Next, Hide Header Text", function () {
|
|
1062
|
-
return
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1171
|
+
return (
|
|
1172
|
+
/*#__PURE__*/
|
|
1173
|
+
React.createElement(Annotator, {
|
|
1174
|
+
onExit: actionAddon("onExit"),
|
|
1175
|
+
labelImages: true,
|
|
1176
|
+
hideNext: true,
|
|
1177
|
+
hideHeaderText: true,
|
|
1178
|
+
fullImageSegmentationMode: true,
|
|
1179
|
+
enabledTools: ["modify-allowed-area"],
|
|
1180
|
+
regionClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
1181
|
+
images: [{
|
|
1182
|
+
src: exampleImage,
|
|
1183
|
+
name: "Frame 0036"
|
|
1184
|
+
}]
|
|
1185
|
+
})
|
|
1186
|
+
);
|
|
1075
1187
|
}).add("Hide Header", function () {
|
|
1076
|
-
return
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1188
|
+
return (
|
|
1189
|
+
/*#__PURE__*/
|
|
1190
|
+
React.createElement(Annotator, {
|
|
1191
|
+
onExit: actionAddon("onExit"),
|
|
1192
|
+
labelImages: true,
|
|
1193
|
+
hideHeader: true,
|
|
1194
|
+
fullImageSegmentationMode: true,
|
|
1195
|
+
enabledTools: ["modify-allowed-area"],
|
|
1196
|
+
regionClsList: ["Alpha", "Beta", "Charlie", "Delta"],
|
|
1197
|
+
images: [{
|
|
1198
|
+
src: exampleImage,
|
|
1199
|
+
name: "Frame 0036"
|
|
1200
|
+
}]
|
|
1201
|
+
})
|
|
1202
|
+
);
|
|
1088
1203
|
});
|