@cu-mkp/editioncrafter 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editioncrafter.min.js +1 -1
- package/dist/es/src/action/DocumentActions.js +31 -26
- package/dist/es/src/component/DiploMatic.js +1 -1
- package/dist/es/src/component/DocumentView.js +22 -11
- package/dist/es/src/component/ImageGridView.js +9 -7
- package/dist/es/src/component/SplitPaneView.js +5 -5
- package/dist/es/src/scss/_CETEIcean.scss +907 -903
- package/dist/es/src/scss/_base.scss +157 -154
- package/dist/es/src/scss/_diplomatic.scss +4 -4
- package/dist/es/src/scss/_globalNavigation.scss +34 -31
- package/dist/es/src/scss/_glossary.scss +97 -93
- package/dist/es/src/scss/_imageGridView.scss +74 -71
- package/dist/es/src/scss/_imageView.scss +37 -34
- package/dist/es/src/scss/_imageZoomControl.scss +53 -49
- package/dist/es/src/scss/_jumpbox.scss +43 -40
- package/dist/es/src/scss/_navigation.scss +186 -183
- package/dist/es/src/scss/_pagination.scss +44 -41
- package/dist/es/src/scss/_ringSpinner.scss +82 -79
- package/dist/es/src/scss/_singlePaneView.scss +10 -7
- package/dist/es/src/scss/_spinner.scss +56 -52
- package/dist/es/src/scss/_splitPaneView.scss +48 -46
- package/dist/es/src/scss/_thumbnails.scss +16 -12
- package/dist/es/src/scss/_transcriptView.scss +194 -191
- package/dist/es/src/scss/_watermark.scss +26 -23
- package/dist/es/src/scss/_xmlView.scss +31 -28
- package/package.json +1 -1
|
@@ -66,6 +66,9 @@ function parseImageURLs(canvas) {
|
|
|
66
66
|
if (annotation.type !== 'Annotation') throwError("Expected Annotation in items property of ".concat(annotationPage.id));
|
|
67
67
|
if (annotation.motivation === 'painting') {
|
|
68
68
|
if (!annotation.body) throwError("Expected body property in Annotation ".concat(annotation.id));
|
|
69
|
+
if (!annotation.body.id) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
69
72
|
return {
|
|
70
73
|
bodyId: annotation.body.id,
|
|
71
74
|
imageURL: "".concat(annotation.body.id, "/info.json")
|
|
@@ -171,33 +174,35 @@ function parseSingleManifest(manifest, transcriptionTypes, document) {
|
|
|
171
174
|
var canvas = canvases[i];
|
|
172
175
|
if (canvas.type !== 'Canvas') throwError("Expected items[".concat(i, "] to be of type 'Canvas'."));
|
|
173
176
|
if (!canvas.id) throwError("Expected items[".concat(i, "] to have an id property."));
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
177
|
+
if (parseImageURLs(canvas)) {
|
|
178
|
+
var folioID = canvas.id.substr(canvas.id.lastIndexOf('/') + 1);
|
|
179
|
+
var canvasLabel = parseLabel(canvas);
|
|
180
|
+
var _parseImageURLs = parseImageURLs(canvas),
|
|
181
|
+
bodyId = _parseImageURLs.bodyId,
|
|
182
|
+
imageURL = _parseImageURLs.imageURL;
|
|
183
|
+
var annotationURLs = parseAnnotationURLs(canvas, transcriptionTypes);
|
|
184
|
+
var ratio = canvas.width / canvas.height;
|
|
185
|
+
var thumbnailDimensions = [];
|
|
186
|
+
if (ratio > 1) {
|
|
187
|
+
thumbnailDimensions = [MAX_THUMBNAIL_DIMENSION, Math.round(MAX_THUMBNAIL_DIMENSION / ratio)];
|
|
188
|
+
} else {
|
|
189
|
+
thumbnailDimensions = [Math.round(MAX_THUMBNAIL_DIMENSION * ratio), MAX_THUMBNAIL_DIMENSION];
|
|
190
|
+
}
|
|
191
|
+
var thumbnailURL = "".concat(bodyId, "/full/").concat(thumbnailDimensions.join(','), "/0/default.jpg");
|
|
192
|
+
var folio = {
|
|
193
|
+
id: document ? "".concat(document, "_").concat(folioID) : folioID,
|
|
194
|
+
doc_id: document || manifest.id,
|
|
195
|
+
name: canvasLabel,
|
|
196
|
+
pageNumber: i,
|
|
197
|
+
image_zoom_url: imageURL,
|
|
198
|
+
image_thumbnail_url: thumbnailURL,
|
|
199
|
+
annotationURLs: annotationURLs,
|
|
200
|
+
annotations: canvas.annotations ? canvas.annotations.filter(function (a) {
|
|
201
|
+
return a.motivation === 'tagging';
|
|
202
|
+
}) : []
|
|
203
|
+
};
|
|
204
|
+
folios.push(folio);
|
|
186
205
|
}
|
|
187
|
-
var thumbnailURL = "".concat(bodyId, "/full/").concat(thumbnailDimensions.join(','), "/0/default.jpg");
|
|
188
|
-
var folio = {
|
|
189
|
-
id: folioID,
|
|
190
|
-
doc_id: document || manifest.id,
|
|
191
|
-
name: canvasLabel,
|
|
192
|
-
pageNumber: i,
|
|
193
|
-
image_zoom_url: imageURL,
|
|
194
|
-
image_thumbnail_url: thumbnailURL,
|
|
195
|
-
annotationURLs: annotationURLs,
|
|
196
|
-
annotations: canvas.annotations ? canvas.annotations.filter(function (a) {
|
|
197
|
-
return a.motivation === 'tagging';
|
|
198
|
-
}) : []
|
|
199
|
-
};
|
|
200
|
-
folios.push(folio);
|
|
201
206
|
}
|
|
202
207
|
return folios;
|
|
203
208
|
}
|
|
@@ -36,7 +36,7 @@ var DiploMatic = function DiploMatic(props) {
|
|
|
36
36
|
}
|
|
37
37
|
}, [containerRef]);
|
|
38
38
|
var fixedFrameMode = props.diplomatic.fixedFrameMode;
|
|
39
|
-
var fixedFrameModeClass = fixedFrameMode ? '
|
|
39
|
+
var fixedFrameModeClass = fixedFrameMode ? 'editioncrafter' : 'editioncrafter sticky';
|
|
40
40
|
return /*#__PURE__*/React.createElement(Provider, {
|
|
41
41
|
store: props.store
|
|
42
42
|
}, /*#__PURE__*/React.createElement(HashRouter, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -53,6 +53,11 @@ var DocumentView = function DocumentView(props) {
|
|
|
53
53
|
var params = useParams();
|
|
54
54
|
var navigate = useNavigate();
|
|
55
55
|
var location = useLocation();
|
|
56
|
+
|
|
57
|
+
//"reload" the page if the config props change
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
dispatchAction(props, 'RouteListenerSaga.userNavigatation', location);
|
|
60
|
+
}, [props.config]);
|
|
56
61
|
useEffect(function () {
|
|
57
62
|
setSinglePaneMode(props.containerWidth < 960);
|
|
58
63
|
}, [props.containerWidth]);
|
|
@@ -87,7 +92,8 @@ var DocumentView = function DocumentView(props) {
|
|
|
87
92
|
}
|
|
88
93
|
};
|
|
89
94
|
}
|
|
90
|
-
var
|
|
95
|
+
var leftFolioValid = Object.keys(document.folioIndex).includes(folioID);
|
|
96
|
+
var leftFolioID = leftFolioValid ? folioID : '-1';
|
|
91
97
|
var leftTranscriptionType;
|
|
92
98
|
var rightFolioID;
|
|
93
99
|
var rightTranscriptionType;
|
|
@@ -95,13 +101,15 @@ var DocumentView = function DocumentView(props) {
|
|
|
95
101
|
var thirdTranscriptionType;
|
|
96
102
|
if (folioID2) {
|
|
97
103
|
// route /ec/:folioID/:transcriptionType/:folioID2/:transcriptionType2
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
104
|
+
var rightFolioValid = Object.keys(document.folioIndex).includes(folioID2);
|
|
105
|
+
leftTranscriptionType = leftFolioValid ? transcriptionType : 'g';
|
|
106
|
+
rightFolioID = rightFolioValid ? folioID2 : '-1';
|
|
107
|
+
rightTranscriptionType = rightFolioValid ? transcriptionType2 ? transcriptionType2 : firstTranscriptionType : 'g';
|
|
101
108
|
if (folioID3) {
|
|
102
109
|
// route /ec/:folioID/:transcriptionType/:folioID2/:transcriptionType2/:folioID3/:transcriptionType3
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
var thirdFolioValid = Object.keys(document.folioIndex).includes(folioID3);
|
|
111
|
+
thirdFolioID = thirdFolioValid ? folioID3 : '-1';
|
|
112
|
+
thirdTranscriptionType = thirdFolioValid ? transcriptionType3 ? transcriptionType3 : firstTranscriptionType : 'g';
|
|
105
113
|
} else {
|
|
106
114
|
thirdFolioID = '-1';
|
|
107
115
|
thirdTranscriptionType = 'g';
|
|
@@ -110,8 +118,8 @@ var DocumentView = function DocumentView(props) {
|
|
|
110
118
|
// route /ec/:folioID
|
|
111
119
|
// route /ec/:folioID/:transcriptionType
|
|
112
120
|
leftTranscriptionType = 'f';
|
|
113
|
-
rightFolioID = folioID;
|
|
114
|
-
rightTranscriptionType = transcriptionType
|
|
121
|
+
rightFolioID = leftFolioValid ? folioID : '-1';
|
|
122
|
+
rightTranscriptionType = leftFolioValid ? transcriptionType ? transcriptionType : firstTranscriptionType : 'g';
|
|
115
123
|
thirdFolioID = '-1';
|
|
116
124
|
thirdTranscriptionType = 'g';
|
|
117
125
|
}
|
|
@@ -334,7 +342,8 @@ var DocumentView = function DocumentView(props) {
|
|
|
334
342
|
hasPrevious: current_hasPrev,
|
|
335
343
|
hasNext: current_hasNext,
|
|
336
344
|
previousFolioShortID: prevID,
|
|
337
|
-
nextFolioShortID: nextID
|
|
345
|
+
nextFolioShortID: nextID,
|
|
346
|
+
documentID: doc.variorum ? doc.folioIndex[shortID].doc_id : doc.documentName
|
|
338
347
|
});
|
|
339
348
|
};
|
|
340
349
|
var documentViewActions = {
|
|
@@ -349,6 +358,7 @@ var DocumentView = function DocumentView(props) {
|
|
|
349
358
|
var viewType = determineViewType(side);
|
|
350
359
|
var key = viewPaneKey(side);
|
|
351
360
|
var folioID = docView[side].iiifShortID;
|
|
361
|
+
var document = docView[side].documentID;
|
|
352
362
|
var transcriptionType = docView[side].transcriptionType;
|
|
353
363
|
if (viewType === 'ImageView') {
|
|
354
364
|
return /*#__PURE__*/React.createElement(ImageView, {
|
|
@@ -385,7 +395,7 @@ var DocumentView = function DocumentView(props) {
|
|
|
385
395
|
documentView: docView,
|
|
386
396
|
documentViewActions: documentViewActions,
|
|
387
397
|
side: side,
|
|
388
|
-
selectedDoc: props.document.variorum && Object.keys(props.document.derivativeNames)[side === 'left' ? 0 : side === 'right' ? 1 : Object.keys(props.document.derivativeNames).length > 2 ? 2 : 1]
|
|
398
|
+
selectedDoc: document ? document : props.document.variorum && Object.keys(props.document.derivativeNames)[side === 'left' ? 0 : side === 'right' ? 1 : Object.keys(props.document.derivativeNames).length > 2 ? 2 : 1]
|
|
389
399
|
});
|
|
390
400
|
}
|
|
391
401
|
if (viewType === 'GlossaryView') {
|
|
@@ -449,7 +459,8 @@ var DocumentView = function DocumentView(props) {
|
|
|
449
459
|
};
|
|
450
460
|
function mapStateToProps(state) {
|
|
451
461
|
return {
|
|
452
|
-
document: state.document
|
|
462
|
+
document: state.document,
|
|
463
|
+
glossary: state.glossary
|
|
453
464
|
};
|
|
454
465
|
}
|
|
455
466
|
export default withWidth()(connect(mapStateToProps)(DocumentView));
|
|
@@ -184,9 +184,11 @@ var ImageGridView = /*#__PURE__*/function (_React$Component) {
|
|
|
184
184
|
var _this4 = this;
|
|
185
185
|
var documentView = this.props.documentView;
|
|
186
186
|
var folioID = documentView[this.props.side].iiifShortID;
|
|
187
|
-
var thumbs = this.generateThumbs(folioID, this.state.currentDoc ? this.props.document.folios.filter(function (folio) {
|
|
187
|
+
var thumbs = this.generateThumbs(folioID, this.props.document.variorum && this.state.currentDoc ? this.props.document.folios.filter(function (folio) {
|
|
188
188
|
return folio.doc_id === _this4.state.currentDoc;
|
|
189
189
|
}) : this.props.document.folios);
|
|
190
|
+
console.log(thumbs);
|
|
191
|
+
console.log(this.props.document.folios);
|
|
190
192
|
var thumbCount = thumbs.length > this.loadIncrement ? this.loadIncrement : thumbs.length;
|
|
191
193
|
var visibleThumbs = thumbs.slice(0, thumbCount);
|
|
192
194
|
this.setState({
|
|
@@ -205,9 +207,7 @@ var ImageGridView = /*#__PURE__*/function (_React$Component) {
|
|
|
205
207
|
React.createElement("li", {
|
|
206
208
|
key: "thumb-".concat(index),
|
|
207
209
|
className: "thumbnail"
|
|
208
|
-
}, /*#__PURE__*/React.createElement("figure", {
|
|
209
|
-
className: folio.id === currentID ? 'current' : ''
|
|
210
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
210
|
+
}, /*#__PURE__*/React.createElement("figure", null, /*#__PURE__*/React.createElement("a", {
|
|
211
211
|
id: folio.id,
|
|
212
212
|
onClick: _this5.onClickThumb.bind(_this5, folio.id)
|
|
213
213
|
}, /*#__PURE__*/React.createElement("img", {
|
|
@@ -220,11 +220,13 @@ var ImageGridView = /*#__PURE__*/function (_React$Component) {
|
|
|
220
220
|
onError: function onError(_ref) {
|
|
221
221
|
var currentTarget = _ref.currentTarget;
|
|
222
222
|
currentTarget.onerror = null;
|
|
223
|
-
currentTarget.src
|
|
223
|
+
if (folio.image_zoom_url && currentTarget.src !== "".concat(folio.image_zoom_url.slice(0, -9), "full/full/0/default.jpg")) {
|
|
224
|
+
currentTarget.src = "".concat(folio.image_zoom_url.slice(0, -9), "full/full/0/default.jpg");
|
|
225
|
+
}
|
|
224
226
|
}
|
|
225
227
|
}))), /*#__PURE__*/React.createElement("figcaption", {
|
|
226
|
-
className:
|
|
227
|
-
}, folio.
|
|
228
|
+
className: "thumbnail-caption"
|
|
229
|
+
}, folio.name))
|
|
228
230
|
);
|
|
229
231
|
});
|
|
230
232
|
return thumbs;
|
|
@@ -122,8 +122,8 @@ var SplitPaneView = /*#__PURE__*/function (_Component) {
|
|
|
122
122
|
key: "componentDidMount",
|
|
123
123
|
value: function componentDidMount() {
|
|
124
124
|
this.updateUI();
|
|
125
|
-
window.addEventListener('
|
|
126
|
-
window.addEventListener('
|
|
125
|
+
window.addEventListener('pointermove', this.onDrag);
|
|
126
|
+
window.addEventListener('pointerup', this.onEndDrag);
|
|
127
127
|
window.addEventListener('resize', this.onResize);
|
|
128
128
|
console.log(this.props);
|
|
129
129
|
// Set the default width on mount
|
|
@@ -144,8 +144,8 @@ var SplitPaneView = /*#__PURE__*/function (_Component) {
|
|
|
144
144
|
}, {
|
|
145
145
|
key: "componentWillUnmount",
|
|
146
146
|
value: function componentWillUnmount() {
|
|
147
|
-
window.removeEventListener('
|
|
148
|
-
window.removeEventListener('
|
|
147
|
+
window.removeEventListener('pointermove', this.onDrag);
|
|
148
|
+
window.removeEventListener('pointerup', this.onEndDrag);
|
|
149
149
|
window.removeEventListener('resize', this.onResize);
|
|
150
150
|
}
|
|
151
151
|
}, {
|
|
@@ -155,7 +155,7 @@ var SplitPaneView = /*#__PURE__*/function (_Component) {
|
|
|
155
155
|
var drawerIconClass = 'drawer-icon fas fa-caret-left fa-2x';
|
|
156
156
|
return /*#__PURE__*/React.createElement("div", {
|
|
157
157
|
className: "divider ".concat(position, "_divider"),
|
|
158
|
-
|
|
158
|
+
onPointerDown: function onPointerDown() {
|
|
159
159
|
return _this2.onStartDrag(position);
|
|
160
160
|
}
|
|
161
161
|
}, /*#__PURE__*/React.createElement("div", {
|