@searpent/react-image-annotate 2.1.2 → 2.3.0-cand
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/Editor/index.js +11 -33
- package/Editor/readOnly.js +25 -373
- package/MainLayout/index.js +2 -4
- package/package.json +7 -4
package/Editor/index.js
CHANGED
|
@@ -6,8 +6,7 @@ import { createReactEditorJS } from 'react-editor-js';
|
|
|
6
6
|
import blocksToArticle from '../utils/blocks-to-article';
|
|
7
7
|
import { EDITOR_JS_TOOLS } from './tools';
|
|
8
8
|
import ReadOnly from './readOnly';
|
|
9
|
-
import
|
|
10
|
-
import './editor.css';
|
|
9
|
+
import '../PageSelector/page-selector.css';
|
|
11
10
|
var ReactEditorJS = createReactEditorJS();
|
|
12
11
|
|
|
13
12
|
function Editor(_ref) {
|
|
@@ -22,11 +21,6 @@ function Editor(_ref) {
|
|
|
22
21
|
editMode = _useState2[0],
|
|
23
22
|
setEditMode = _useState2[1];
|
|
24
23
|
|
|
25
|
-
var _useState3 = useState(isSpellcheckEnabled()),
|
|
26
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
27
|
-
autoSpellcheck = _useState4[0],
|
|
28
|
-
setAutoSpellcheck = _useState4[1];
|
|
29
|
-
|
|
30
24
|
var handleChange = /*#__PURE__*/function () {
|
|
31
25
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(instance) {
|
|
32
26
|
var data;
|
|
@@ -63,39 +57,24 @@ function Editor(_ref) {
|
|
|
63
57
|
});
|
|
64
58
|
};
|
|
65
59
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
});
|
|
72
|
-
};
|
|
60
|
+
if (blocks.length < 1) {
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
className: "instructions"
|
|
63
|
+
}, /*#__PURE__*/React.createElement("h1", null, "Click article to display text."));
|
|
64
|
+
}
|
|
73
65
|
|
|
74
66
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
75
|
-
className: "show-metadata-wrapper
|
|
76
|
-
}, /*#__PURE__*/React.createElement("
|
|
77
|
-
className: "switch mr-2
|
|
78
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
79
|
-
id: "automatic-spellcheck",
|
|
80
|
-
type: "checkbox",
|
|
81
|
-
checked: autoSpellcheck,
|
|
82
|
-
onChange: toggleAutoSpellcheck
|
|
83
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
84
|
-
className: "slider round"
|
|
85
|
-
})), /*#__PURE__*/React.createElement("label", {
|
|
86
|
-
className: "mr-4"
|
|
87
|
-
}, "Spellcheck")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", {
|
|
88
|
-
className: "switch mr-2 editor-switch"
|
|
67
|
+
className: "show-metadata-wrapper"
|
|
68
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
69
|
+
className: "switch mr-2"
|
|
89
70
|
}, /*#__PURE__*/React.createElement("input", {
|
|
90
71
|
id: "show-metadata",
|
|
91
72
|
type: "checkbox",
|
|
92
|
-
|
|
73
|
+
value: editMode,
|
|
93
74
|
onChange: toggleEditMode
|
|
94
75
|
}), /*#__PURE__*/React.createElement("span", {
|
|
95
76
|
className: "slider round"
|
|
96
|
-
})), /*#__PURE__*/React.createElement("label", null, "Edit mode"))
|
|
97
|
-
className: "instructions"
|
|
98
|
-
}, /*#__PURE__*/React.createElement("h1", null, "Click article to display text.")) : !editMode ? /*#__PURE__*/React.createElement(ReadOnly, {
|
|
77
|
+
})), /*#__PURE__*/React.createElement("label", null, "Edit mode")), !editMode ? /*#__PURE__*/React.createElement(ReadOnly, {
|
|
99
78
|
article: blocksToArticle(blocks)
|
|
100
79
|
}) : /*#__PURE__*/React.createElement(ReactEditorJS, {
|
|
101
80
|
defaultValue: {
|
|
@@ -103,7 +82,6 @@ function Editor(_ref) {
|
|
|
103
82
|
},
|
|
104
83
|
tools: EDITOR_JS_TOOLS,
|
|
105
84
|
onChange: handleChange,
|
|
106
|
-
onInitialize: function onInitialize() {},
|
|
107
85
|
enableReInitialize: true,
|
|
108
86
|
key: selectedFrame
|
|
109
87
|
}));
|
package/Editor/readOnly.js
CHANGED
|
@@ -1,469 +1,121 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
5
|
-
import { highlightMisspellingsInHtml } from '../utils/spellcheck-nspell';
|
|
1
|
+
import React from 'react';
|
|
6
2
|
|
|
7
3
|
function ReadOnly(_ref) {
|
|
8
4
|
var article = _ref.article;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
useEffect(function () {
|
|
12
|
-
var run = /*#__PURE__*/function () {
|
|
13
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
14
|
-
var combinedHtml;
|
|
15
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
|
-
while (1) {
|
|
17
|
-
switch (_context.prev = _context.next) {
|
|
18
|
-
case 0:
|
|
19
|
-
combinedHtml = [article.title, article.subtitle, article.text, article.author, article.about_author, article.appendix, article.photo_author, article.photo_caption, article.advertisement, article.other_graphics, article.unknown, article.table, article.section, article.continuation_ref, article.cover_clip, article.page_id, article.continuation_mark, article.follow_up_mark, article.article_termination_mark, article.page_splitting_stripe, article.column_id_stripe, article.prev_page_reference, article.section_subcategory].filter(Boolean).join(' '); // warm up dictionary once with auto-detection
|
|
20
|
-
|
|
21
|
-
_context.next = 3;
|
|
22
|
-
return highlightMisspellingsInHtml(combinedHtml, 'auto');
|
|
23
|
-
|
|
24
|
-
case 3:
|
|
25
|
-
case "end":
|
|
26
|
-
return _context.stop();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}, _callee);
|
|
30
|
-
}));
|
|
31
|
-
|
|
32
|
-
return function run() {
|
|
33
|
-
return _ref2.apply(this, arguments);
|
|
34
|
-
};
|
|
35
|
-
}();
|
|
36
|
-
|
|
37
|
-
run();
|
|
38
|
-
}, [article]);
|
|
39
|
-
|
|
40
|
-
var _useState = useState(article.title),
|
|
41
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
-
titleHTML = _useState2[0],
|
|
43
|
-
setTitleHTML = _useState2[1];
|
|
44
|
-
|
|
45
|
-
var _useState3 = useState(article.subtitle),
|
|
46
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
47
|
-
subtitleHTML = _useState4[0],
|
|
48
|
-
setSubtitleHTML = _useState4[1];
|
|
49
|
-
|
|
50
|
-
var _useState5 = useState(article.text),
|
|
51
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
52
|
-
textHTML = _useState6[0],
|
|
53
|
-
setTextHTML = _useState6[1];
|
|
54
|
-
|
|
55
|
-
var _useState7 = useState(article.author),
|
|
56
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
57
|
-
authorHTML = _useState8[0],
|
|
58
|
-
setAuthorHTML = _useState8[1];
|
|
59
|
-
|
|
60
|
-
var _useState9 = useState(article.about_author),
|
|
61
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
62
|
-
aboutHTML = _useState10[0],
|
|
63
|
-
setAboutHTML = _useState10[1];
|
|
64
|
-
|
|
65
|
-
var _useState11 = useState(article.appendix),
|
|
66
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
67
|
-
appendixHTML = _useState12[0],
|
|
68
|
-
setAppendixHTML = _useState12[1];
|
|
69
|
-
|
|
70
|
-
var _useState13 = useState(article.photo_author),
|
|
71
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
72
|
-
photoAuthorHTML = _useState14[0],
|
|
73
|
-
setPhotoAuthorHTML = _useState14[1];
|
|
74
|
-
|
|
75
|
-
var _useState15 = useState(article.photo_caption),
|
|
76
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
77
|
-
photoCaptionHTML = _useState16[0],
|
|
78
|
-
setPhotoCaptionHTML = _useState16[1];
|
|
79
|
-
|
|
80
|
-
var _useState17 = useState(article.advertisement),
|
|
81
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
82
|
-
adHTML = _useState18[0],
|
|
83
|
-
setAdHTML = _useState18[1];
|
|
84
|
-
|
|
85
|
-
var _useState19 = useState(article.other_graphics),
|
|
86
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
87
|
-
otherGraphicsHTML = _useState20[0],
|
|
88
|
-
setOtherGraphicsHTML = _useState20[1];
|
|
89
|
-
|
|
90
|
-
var _useState21 = useState(article.unknown),
|
|
91
|
-
_useState22 = _slicedToArray(_useState21, 2),
|
|
92
|
-
unknownHTML = _useState22[0],
|
|
93
|
-
setUnknownHTML = _useState22[1];
|
|
94
|
-
|
|
95
|
-
var _useState23 = useState(article.table),
|
|
96
|
-
_useState24 = _slicedToArray(_useState23, 2),
|
|
97
|
-
tableHTML = _useState24[0],
|
|
98
|
-
setTableHTML = _useState24[1];
|
|
99
|
-
|
|
100
|
-
var _useState25 = useState(article.section),
|
|
101
|
-
_useState26 = _slicedToArray(_useState25, 2),
|
|
102
|
-
sectionHTML = _useState26[0],
|
|
103
|
-
setSectionHTML = _useState26[1];
|
|
104
|
-
|
|
105
|
-
var _useState27 = useState(article.continuation_ref),
|
|
106
|
-
_useState28 = _slicedToArray(_useState27, 2),
|
|
107
|
-
continuationRefHTML = _useState28[0],
|
|
108
|
-
setContinuationRefHTML = _useState28[1];
|
|
109
|
-
|
|
110
|
-
var _useState29 = useState(article.cover_clip),
|
|
111
|
-
_useState30 = _slicedToArray(_useState29, 2),
|
|
112
|
-
coverClipHTML = _useState30[0],
|
|
113
|
-
setCoverClipHTML = _useState30[1];
|
|
114
|
-
|
|
115
|
-
var _useState31 = useState(article.page_id),
|
|
116
|
-
_useState32 = _slicedToArray(_useState31, 2),
|
|
117
|
-
pageIdHTML = _useState32[0],
|
|
118
|
-
setPageIdHTML = _useState32[1];
|
|
119
|
-
|
|
120
|
-
var _useState33 = useState(article.continuation_mark),
|
|
121
|
-
_useState34 = _slicedToArray(_useState33, 2),
|
|
122
|
-
continuationMarkHTML = _useState34[0],
|
|
123
|
-
setContinuationMarkHTML = _useState34[1];
|
|
124
|
-
|
|
125
|
-
var _useState35 = useState(article.follow_up_mark),
|
|
126
|
-
_useState36 = _slicedToArray(_useState35, 2),
|
|
127
|
-
followUpMarkHTML = _useState36[0],
|
|
128
|
-
setFollowUpMarkHTML = _useState36[1];
|
|
129
|
-
|
|
130
|
-
var _useState37 = useState(article.article_termination_mark),
|
|
131
|
-
_useState38 = _slicedToArray(_useState37, 2),
|
|
132
|
-
articleTerminationMarkHTML = _useState38[0],
|
|
133
|
-
setArticleTerminationMarkHTML = _useState38[1];
|
|
134
|
-
|
|
135
|
-
var _useState39 = useState(article.page_splitting_stripe),
|
|
136
|
-
_useState40 = _slicedToArray(_useState39, 2),
|
|
137
|
-
pageSplittingStripeHTML = _useState40[0],
|
|
138
|
-
setPageSplittingStripeHTML = _useState40[1];
|
|
139
|
-
|
|
140
|
-
var _useState41 = useState(article.column_id_stripe),
|
|
141
|
-
_useState42 = _slicedToArray(_useState41, 2),
|
|
142
|
-
columnIdStripeHTML = _useState42[0],
|
|
143
|
-
setColumnIdStripeHTML = _useState42[1];
|
|
144
|
-
|
|
145
|
-
var _useState43 = useState(article.prev_page_reference),
|
|
146
|
-
_useState44 = _slicedToArray(_useState43, 2),
|
|
147
|
-
prevPageReferenceHTML = _useState44[0],
|
|
148
|
-
setPrevPageReferenceHTML = _useState44[1];
|
|
149
|
-
|
|
150
|
-
var _useState45 = useState(article.section_subcategory),
|
|
151
|
-
_useState46 = _slicedToArray(_useState45, 2),
|
|
152
|
-
sectionSubcategoryHTML = _useState46[0],
|
|
153
|
-
setSectionSubcategoryHTML = _useState46[1];
|
|
154
|
-
|
|
155
|
-
useEffect(function () {
|
|
156
|
-
var cancelled = false;
|
|
157
|
-
|
|
158
|
-
var apply = /*#__PURE__*/function () {
|
|
159
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
160
|
-
var h1, h2, t, a, ab, ap, pa, pc, adv, og, unk, tbl, sec, contRef, coverClip, pageId, contMark, followUp, articleTerm, pageStripe, columnStripe, prevPageRef, sectionSubcat;
|
|
161
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
162
|
-
while (1) {
|
|
163
|
-
switch (_context2.prev = _context2.next) {
|
|
164
|
-
case 0:
|
|
165
|
-
_context2.prev = 0;
|
|
166
|
-
_context2.next = 3;
|
|
167
|
-
return highlightMisspellingsInHtml(article.title || '', 'auto');
|
|
168
|
-
|
|
169
|
-
case 3:
|
|
170
|
-
h1 = _context2.sent;
|
|
171
|
-
_context2.next = 6;
|
|
172
|
-
return highlightMisspellingsInHtml(article.subtitle || '', 'auto');
|
|
173
|
-
|
|
174
|
-
case 6:
|
|
175
|
-
h2 = _context2.sent;
|
|
176
|
-
_context2.next = 9;
|
|
177
|
-
return highlightMisspellingsInHtml(article.text || '', 'auto');
|
|
178
|
-
|
|
179
|
-
case 9:
|
|
180
|
-
t = _context2.sent;
|
|
181
|
-
_context2.next = 12;
|
|
182
|
-
return highlightMisspellingsInHtml(article.author || '', 'auto');
|
|
183
|
-
|
|
184
|
-
case 12:
|
|
185
|
-
a = _context2.sent;
|
|
186
|
-
_context2.next = 15;
|
|
187
|
-
return highlightMisspellingsInHtml(article.about_author || '', 'auto');
|
|
188
|
-
|
|
189
|
-
case 15:
|
|
190
|
-
ab = _context2.sent;
|
|
191
|
-
_context2.next = 18;
|
|
192
|
-
return highlightMisspellingsInHtml(article.appendix || '', 'auto');
|
|
193
|
-
|
|
194
|
-
case 18:
|
|
195
|
-
ap = _context2.sent;
|
|
196
|
-
_context2.next = 21;
|
|
197
|
-
return highlightMisspellingsInHtml(article.photo_author || '', 'auto');
|
|
198
|
-
|
|
199
|
-
case 21:
|
|
200
|
-
pa = _context2.sent;
|
|
201
|
-
_context2.next = 24;
|
|
202
|
-
return highlightMisspellingsInHtml(article.photo_caption || '', 'auto');
|
|
203
|
-
|
|
204
|
-
case 24:
|
|
205
|
-
pc = _context2.sent;
|
|
206
|
-
_context2.next = 27;
|
|
207
|
-
return highlightMisspellingsInHtml(article.advertisement || '', 'auto');
|
|
208
|
-
|
|
209
|
-
case 27:
|
|
210
|
-
adv = _context2.sent;
|
|
211
|
-
_context2.next = 30;
|
|
212
|
-
return highlightMisspellingsInHtml(article.other_graphics || '', 'auto');
|
|
213
|
-
|
|
214
|
-
case 30:
|
|
215
|
-
og = _context2.sent;
|
|
216
|
-
_context2.next = 33;
|
|
217
|
-
return highlightMisspellingsInHtml(article.unknown || '', 'auto');
|
|
218
|
-
|
|
219
|
-
case 33:
|
|
220
|
-
unk = _context2.sent;
|
|
221
|
-
_context2.next = 36;
|
|
222
|
-
return highlightMisspellingsInHtml(article.table || '', 'auto');
|
|
223
|
-
|
|
224
|
-
case 36:
|
|
225
|
-
tbl = _context2.sent;
|
|
226
|
-
_context2.next = 39;
|
|
227
|
-
return highlightMisspellingsInHtml(article.section || '', 'auto');
|
|
228
|
-
|
|
229
|
-
case 39:
|
|
230
|
-
sec = _context2.sent;
|
|
231
|
-
_context2.next = 42;
|
|
232
|
-
return highlightMisspellingsInHtml(article.continuation_ref || '', 'auto');
|
|
233
|
-
|
|
234
|
-
case 42:
|
|
235
|
-
contRef = _context2.sent;
|
|
236
|
-
_context2.next = 45;
|
|
237
|
-
return highlightMisspellingsInHtml(article.cover_clip || '', 'auto');
|
|
238
|
-
|
|
239
|
-
case 45:
|
|
240
|
-
coverClip = _context2.sent;
|
|
241
|
-
_context2.next = 48;
|
|
242
|
-
return highlightMisspellingsInHtml(article.page_id || '', 'auto');
|
|
243
|
-
|
|
244
|
-
case 48:
|
|
245
|
-
pageId = _context2.sent;
|
|
246
|
-
_context2.next = 51;
|
|
247
|
-
return highlightMisspellingsInHtml(article.continuation_mark || '', 'auto');
|
|
248
|
-
|
|
249
|
-
case 51:
|
|
250
|
-
contMark = _context2.sent;
|
|
251
|
-
_context2.next = 54;
|
|
252
|
-
return highlightMisspellingsInHtml(article.follow_up_mark || '', 'auto');
|
|
253
|
-
|
|
254
|
-
case 54:
|
|
255
|
-
followUp = _context2.sent;
|
|
256
|
-
_context2.next = 57;
|
|
257
|
-
return highlightMisspellingsInHtml(article.article_termination_mark || '', 'auto');
|
|
258
|
-
|
|
259
|
-
case 57:
|
|
260
|
-
articleTerm = _context2.sent;
|
|
261
|
-
_context2.next = 60;
|
|
262
|
-
return highlightMisspellingsInHtml(article.page_splitting_stripe || '', 'auto');
|
|
263
|
-
|
|
264
|
-
case 60:
|
|
265
|
-
pageStripe = _context2.sent;
|
|
266
|
-
_context2.next = 63;
|
|
267
|
-
return highlightMisspellingsInHtml(article.column_id_stripe || '', 'auto');
|
|
268
|
-
|
|
269
|
-
case 63:
|
|
270
|
-
columnStripe = _context2.sent;
|
|
271
|
-
_context2.next = 66;
|
|
272
|
-
return highlightMisspellingsInHtml(article.prev_page_reference || '', 'auto');
|
|
273
|
-
|
|
274
|
-
case 66:
|
|
275
|
-
prevPageRef = _context2.sent;
|
|
276
|
-
_context2.next = 69;
|
|
277
|
-
return highlightMisspellingsInHtml(article.section_subcategory || '', 'auto');
|
|
278
|
-
|
|
279
|
-
case 69:
|
|
280
|
-
sectionSubcat = _context2.sent;
|
|
281
|
-
|
|
282
|
-
if (!cancelled) {
|
|
283
|
-
_context2.next = 72;
|
|
284
|
-
break;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
return _context2.abrupt("return");
|
|
288
|
-
|
|
289
|
-
case 72:
|
|
290
|
-
setTitleHTML(h1);
|
|
291
|
-
setSubtitleHTML(h2);
|
|
292
|
-
setTextHTML(t);
|
|
293
|
-
setAuthorHTML(a);
|
|
294
|
-
setAboutHTML(ab);
|
|
295
|
-
setAppendixHTML(ap);
|
|
296
|
-
setPhotoAuthorHTML(pa);
|
|
297
|
-
setPhotoCaptionHTML(pc);
|
|
298
|
-
setAdHTML(adv);
|
|
299
|
-
setOtherGraphicsHTML(og);
|
|
300
|
-
setUnknownHTML(unk);
|
|
301
|
-
setTableHTML(tbl);
|
|
302
|
-
setSectionHTML(sec);
|
|
303
|
-
setContinuationRefHTML(contRef);
|
|
304
|
-
setCoverClipHTML(coverClip);
|
|
305
|
-
setPageIdHTML(pageId);
|
|
306
|
-
setContinuationMarkHTML(contMark);
|
|
307
|
-
setFollowUpMarkHTML(followUp);
|
|
308
|
-
setArticleTerminationMarkHTML(articleTerm);
|
|
309
|
-
setPageSplittingStripeHTML(pageStripe);
|
|
310
|
-
setColumnIdStripeHTML(columnStripe);
|
|
311
|
-
setPrevPageReferenceHTML(prevPageRef);
|
|
312
|
-
setSectionSubcategoryHTML(sectionSubcat);
|
|
313
|
-
_context2.next = 100;
|
|
314
|
-
break;
|
|
315
|
-
|
|
316
|
-
case 97:
|
|
317
|
-
_context2.prev = 97;
|
|
318
|
-
_context2.t0 = _context2["catch"](0);
|
|
319
|
-
|
|
320
|
-
if (!cancelled) {
|
|
321
|
-
console.warn('Spellcheck error:', _context2.t0);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
case 100:
|
|
325
|
-
case "end":
|
|
326
|
-
return _context2.stop();
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
}, _callee2, null, [[0, 97]]);
|
|
330
|
-
}));
|
|
331
|
-
|
|
332
|
-
return function apply() {
|
|
333
|
-
return _ref3.apply(this, arguments);
|
|
334
|
-
};
|
|
335
|
-
}();
|
|
336
|
-
|
|
337
|
-
apply();
|
|
338
|
-
return function () {
|
|
339
|
-
cancelled = true;
|
|
340
|
-
};
|
|
341
|
-
}, [article]);
|
|
342
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
343
|
-
ref: containerRef,
|
|
344
|
-
contentEditable: false,
|
|
345
|
-
suppressContentEditableWarning: true,
|
|
346
|
-
spellCheck: false,
|
|
347
|
-
lang: "en-US",
|
|
348
|
-
style: {
|
|
349
|
-
outline: 'none',
|
|
350
|
-
userSelect: 'text',
|
|
351
|
-
minHeight: '100px'
|
|
352
|
-
}
|
|
353
|
-
}, /*#__PURE__*/React.createElement("style", null, ".spell-error { text-decoration: wavy underline red; text-decoration-skip-ink: auto; }"), /*#__PURE__*/React.createElement("h1", {
|
|
5
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h1", {
|
|
354
6
|
className: "ro-title",
|
|
355
7
|
dangerouslySetInnerHTML: {
|
|
356
|
-
__html:
|
|
8
|
+
__html: article.title
|
|
357
9
|
}
|
|
358
10
|
}), /*#__PURE__*/React.createElement("h2", {
|
|
359
11
|
className: "ro-subtitle",
|
|
360
12
|
dangerouslySetInnerHTML: {
|
|
361
|
-
__html:
|
|
13
|
+
__html: article.subtitle
|
|
362
14
|
}
|
|
363
15
|
}), /*#__PURE__*/React.createElement("p", {
|
|
364
16
|
className: "ro-text",
|
|
365
17
|
dangerouslySetInnerHTML: {
|
|
366
|
-
__html:
|
|
18
|
+
__html: article.text
|
|
367
19
|
}
|
|
368
20
|
}), /*#__PURE__*/React.createElement("p", {
|
|
369
21
|
className: "ro-author",
|
|
370
22
|
dangerouslySetInnerHTML: {
|
|
371
|
-
__html:
|
|
23
|
+
__html: article.author
|
|
372
24
|
}
|
|
373
25
|
}), /*#__PURE__*/React.createElement("p", {
|
|
374
26
|
className: "ro-about-author",
|
|
375
27
|
dangerouslySetInnerHTML: {
|
|
376
|
-
__html:
|
|
28
|
+
__html: article.about_author
|
|
377
29
|
}
|
|
378
30
|
}), /*#__PURE__*/React.createElement("p", {
|
|
379
31
|
className: "ro-appendix",
|
|
380
32
|
dangerouslySetInnerHTML: {
|
|
381
|
-
__html:
|
|
33
|
+
__html: article.appendix
|
|
382
34
|
}
|
|
383
35
|
}), /*#__PURE__*/React.createElement("p", {
|
|
384
36
|
className: "ro-photo-author",
|
|
385
37
|
dangerouslySetInnerHTML: {
|
|
386
|
-
__html:
|
|
38
|
+
__html: article.photo_author
|
|
387
39
|
}
|
|
388
40
|
}), /*#__PURE__*/React.createElement("p", {
|
|
389
41
|
className: "ro-photo-caption",
|
|
390
42
|
dangerouslySetInnerHTML: {
|
|
391
|
-
__html:
|
|
43
|
+
__html: article.photo_caption
|
|
392
44
|
}
|
|
393
45
|
}), /*#__PURE__*/React.createElement("p", {
|
|
394
46
|
className: "ro-advertisment",
|
|
395
47
|
dangerouslySetInnerHTML: {
|
|
396
|
-
__html:
|
|
48
|
+
__html: article.advertisement
|
|
397
49
|
}
|
|
398
50
|
}), /*#__PURE__*/React.createElement("p", {
|
|
399
51
|
className: "ro-other-graphics",
|
|
400
52
|
dangerouslySetInnerHTML: {
|
|
401
|
-
__html:
|
|
53
|
+
__html: article.other_graphics
|
|
402
54
|
}
|
|
403
55
|
}), /*#__PURE__*/React.createElement("p", {
|
|
404
56
|
className: "ro-unknown",
|
|
405
57
|
dangerouslySetInnerHTML: {
|
|
406
|
-
__html:
|
|
58
|
+
__html: article.unknown
|
|
407
59
|
}
|
|
408
60
|
}), /*#__PURE__*/React.createElement("p", {
|
|
409
61
|
className: "ro-table",
|
|
410
62
|
dangerouslySetInnerHTML: {
|
|
411
|
-
__html:
|
|
63
|
+
__html: article.table
|
|
412
64
|
}
|
|
413
65
|
}), /*#__PURE__*/React.createElement("p", {
|
|
414
66
|
className: "ro-section",
|
|
415
67
|
dangerouslySetInnerHTML: {
|
|
416
|
-
__html:
|
|
68
|
+
__html: article.section
|
|
417
69
|
}
|
|
418
70
|
}), /*#__PURE__*/React.createElement("p", {
|
|
419
71
|
className: "ro-continuation_ref",
|
|
420
72
|
dangerouslySetInnerHTML: {
|
|
421
|
-
__html:
|
|
73
|
+
__html: article.continuation_ref
|
|
422
74
|
}
|
|
423
75
|
}), /*#__PURE__*/React.createElement("p", {
|
|
424
76
|
className: "ro-cover_clip",
|
|
425
77
|
dangerouslySetInnerHTML: {
|
|
426
|
-
__html:
|
|
78
|
+
__html: article.cover_clip
|
|
427
79
|
}
|
|
428
80
|
}), /*#__PURE__*/React.createElement("p", {
|
|
429
81
|
className: "ro-page_id",
|
|
430
82
|
dangerouslySetInnerHTML: {
|
|
431
|
-
__html:
|
|
83
|
+
__html: article.page_id
|
|
432
84
|
}
|
|
433
85
|
}), /*#__PURE__*/React.createElement("p", {
|
|
434
86
|
className: "ro-continuation_mark",
|
|
435
87
|
dangerouslySetInnerHTML: {
|
|
436
|
-
__html:
|
|
88
|
+
__html: article.continuation_mark
|
|
437
89
|
}
|
|
438
90
|
}), /*#__PURE__*/React.createElement("p", {
|
|
439
91
|
className: "ro-follow_up_mark",
|
|
440
92
|
dangerouslySetInnerHTML: {
|
|
441
|
-
__html:
|
|
93
|
+
__html: article.follow_up_mark
|
|
442
94
|
}
|
|
443
95
|
}), /*#__PURE__*/React.createElement("p", {
|
|
444
96
|
className: "ro-article_termination_mark",
|
|
445
97
|
dangerouslySetInnerHTML: {
|
|
446
|
-
__html:
|
|
98
|
+
__html: article.article_termination_mark
|
|
447
99
|
}
|
|
448
100
|
}), /*#__PURE__*/React.createElement("p", {
|
|
449
101
|
className: "ro-page_splitting_stripe",
|
|
450
102
|
dangerouslySetInnerHTML: {
|
|
451
|
-
__html:
|
|
103
|
+
__html: article.page_splitting_stripe
|
|
452
104
|
}
|
|
453
105
|
}), /*#__PURE__*/React.createElement("p", {
|
|
454
106
|
className: "ro-column_id_stripe",
|
|
455
107
|
dangerouslySetInnerHTML: {
|
|
456
|
-
__html:
|
|
108
|
+
__html: article.column_id_stripe
|
|
457
109
|
}
|
|
458
110
|
}), /*#__PURE__*/React.createElement("p", {
|
|
459
111
|
className: "ro-prev_page_reference",
|
|
460
112
|
dangerouslySetInnerHTML: {
|
|
461
|
-
__html:
|
|
113
|
+
__html: article.prev_page_reference
|
|
462
114
|
}
|
|
463
115
|
}), /*#__PURE__*/React.createElement("p", {
|
|
464
116
|
className: "ro-section_subcategory",
|
|
465
117
|
dangerouslySetInnerHTML: {
|
|
466
|
-
__html:
|
|
118
|
+
__html: article.section_subcategory
|
|
467
119
|
}
|
|
468
120
|
}));
|
|
469
121
|
}
|
package/MainLayout/index.js
CHANGED
|
@@ -278,10 +278,8 @@ export var MainLayout = function MainLayout(_ref5) {
|
|
|
278
278
|
var extractionEngineRegions = (((_state$images$state$s2 = state.images[state.selectedImage]) === null || _state$images$state$s2 === void 0 ? void 0 : _state$images$state$s2.regions) || []).filter(function (r) {
|
|
279
279
|
return r.cls !== 'metadata';
|
|
280
280
|
});
|
|
281
|
-
var editorBlocks = regionsToBlocks(extractionEngineRegions, clsColor);
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
var blocks = selectedGroupId === null ? editorBlocks : editorBlocks.filter(function (i) {
|
|
281
|
+
var editorBlocks = regionsToBlocks(extractionEngineRegions, clsColor);
|
|
282
|
+
var blocks = editorBlocks.filter(function (i) {
|
|
285
283
|
var _i$data;
|
|
286
284
|
|
|
287
285
|
return (i === null || i === void 0 ? void 0 : (_i$data = i.data) === null || _i$data === void 0 ? void 0 : _i$data.groupId) === selectedGroupId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@searpent/react-image-annotate",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-cand",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@editorjs/editorjs": "^2.25.0",
|
|
6
6
|
"@editorjs/paragraph": "^2.8.0",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@emotion/styled": "^11.6.0",
|
|
9
9
|
"@fortawesome/fontawesome-svg-core": "^1.2.12",
|
|
10
10
|
"@fortawesome/free-solid-svg-icons": "^5.6.3",
|
|
11
|
-
"@fortawesome/react-fontawesome": "^0.
|
|
11
|
+
"@fortawesome/react-fontawesome": "^0.1.3",
|
|
12
12
|
"@mui/icons-material": "^5.2.1",
|
|
13
13
|
"@mui/material": "^5.2.3",
|
|
14
14
|
"@mui/styles": "^5.2.3",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"material-survey": "^2.1.0",
|
|
21
21
|
"mmgc1-cpp": "^1.0.50",
|
|
22
22
|
"moment": "^2.23.0",
|
|
23
|
-
"nspell": "^2.1.5",
|
|
24
23
|
"react": "^17.0.0",
|
|
25
24
|
"react-dom": "^17.0.0",
|
|
26
25
|
"react-editor-js": "^2.0.6",
|
|
@@ -48,6 +47,10 @@
|
|
|
48
47
|
"react": "^17.0.0",
|
|
49
48
|
"react-dom": "^17.0.0"
|
|
50
49
|
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=14.0.0 <18.0.0",
|
|
52
|
+
"yarn": ">=1.22.0"
|
|
53
|
+
},
|
|
51
54
|
"homepage": "/react-image-annotate",
|
|
52
55
|
"repository": {
|
|
53
56
|
"type": "git",
|
|
@@ -60,7 +63,7 @@
|
|
|
60
63
|
"storybook": "start-storybook -p 9090 -s public",
|
|
61
64
|
"build": "npm run build:babel && cp ./package.json ./dist/package.json && cp ./README.md ./dist/README.md",
|
|
62
65
|
"dist": "npm run build && cd dist && npm publish",
|
|
63
|
-
"build:babel": "NODE_ENV=production babel ./src --ignore \"src/**/*.story.js\" --out-dir=./dist && rm dist/index.js && cp dist/lib.js dist/index.js && cp src/PageSelector/page-selector.css dist/PageSelector/ && cp src/Locker/locker.css dist/Locker/ && cp src/Errorer/errorer.css dist/Errorer/ && cp src/Editor/
|
|
66
|
+
"build:babel": "NODE_ENV=production babel ./src --ignore \"src/**/*.story.js\" --out-dir=./dist && rm dist/index.js && cp dist/lib.js dist/index.js && cp src/PageSelector/page-selector.css dist/PageSelector/ && cp src/Locker/locker.css dist/Locker/ && cp src/Errorer/errorer.css dist/Errorer/ && cp src/Editor/annotation-plugin/annotation.css dist/Editor/annotation-plugin",
|
|
64
67
|
"build-storybook": "build-storybook",
|
|
65
68
|
"build:gh-pages": "CI=false react-scripts build && mkdir build/demo && cp build/index.html build/demo/index.html",
|
|
66
69
|
"gh-pages": "npm run build:gh-pages && gh-pages -d build",
|