@cu-mkp/editioncrafter 1.0.2 → 1.0.4-beta.1

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.
Files changed (57) hide show
  1. package/README.md +7 -7
  2. package/dist/editioncrafter.js +65802 -0
  3. package/dist/editioncrafter.umd.cjs +553 -0
  4. package/dist/es/src/action/DiplomaticActions.js +9 -11
  5. package/dist/es/src/action/DocumentActions.js +164 -154
  6. package/dist/es/src/action/GlossaryActions.js +9 -11
  7. package/dist/es/src/action/initialState/diplomaticInitialState.js +2 -2
  8. package/dist/es/src/action/initialState/documentInitialState.js +9 -12
  9. package/dist/es/src/action/initialState/glossaryInitialState.js +3 -3
  10. package/dist/es/src/action/rootReducer.js +31 -29
  11. package/dist/es/src/component/AlphabetLinks.js +44 -66
  12. package/dist/es/src/component/CustomizedTooltops.js +101 -110
  13. package/dist/es/src/component/DiploMatic.js +64 -91
  14. package/dist/es/src/component/DocumentView.js +442 -366
  15. package/dist/es/src/component/EditorComment.js +51 -75
  16. package/dist/es/src/component/ErrorBoundary.js +37 -61
  17. package/dist/es/src/component/FigureImage.js +56 -67
  18. package/dist/es/src/component/GlossaryView.js +157 -149
  19. package/dist/es/src/component/HelpPopper.js +96 -78
  20. package/dist/es/src/component/ImageGridView.js +184 -249
  21. package/dist/es/src/component/ImageView.js +155 -165
  22. package/dist/es/src/component/ImageZoomControl.js +19 -38
  23. package/dist/es/src/component/JumpToFolio.js +56 -60
  24. package/dist/es/src/component/Navigation.js +374 -328
  25. package/dist/es/src/component/Pagination.js +73 -70
  26. package/dist/es/src/component/Parser.js +11 -32
  27. package/dist/es/src/component/RingSpinner.js +31 -32
  28. package/dist/es/src/component/RouteListener.js +30 -21
  29. package/dist/es/src/component/SeaDragonComponent.js +33 -56
  30. package/dist/es/src/component/SinglePaneView.js +15 -33
  31. package/dist/es/src/component/SplitPaneView.js +151 -170
  32. package/dist/es/src/component/TranscriptionView.js +190 -179
  33. package/dist/es/src/component/Watermark.js +21 -30
  34. package/dist/es/src/component/XMLView.js +60 -82
  35. package/dist/es/src/hooks/useIsWidthUp.js +9 -7
  36. package/dist/es/src/icons/ByIcon.js +16 -16
  37. package/dist/es/src/icons/CcIcon.js +16 -16
  38. package/dist/es/src/icons/NcIcon.js +16 -16
  39. package/dist/es/src/icons/SaIcon.js +16 -16
  40. package/dist/es/src/icons/SideMenuIconLeft.js +30 -38
  41. package/dist/es/src/icons/SideMenuIconRight.js +32 -38
  42. package/dist/es/src/index.js +21 -20
  43. package/dist/es/src/lib/copyObject.js +3 -2
  44. package/dist/es/src/lib/registerServiceWorker.js +77 -54
  45. package/dist/es/src/model/DocumentHelper.js +7 -6
  46. package/dist/es/src/model/Folio.js +64 -86
  47. package/dist/es/src/model/ReduxStore.js +32 -78
  48. package/dist/es/src/model/folioLayout.js +275 -280
  49. package/dist/es/src/saga/RouteListenerSaga.js +89 -193
  50. package/dist/es/src/saga/rootSaga.js +9 -16
  51. package/dist/es/src/scss/_imageView.scss +1 -1
  52. package/dist/es/src/scss/_navigation.scss +1 -1
  53. package/dist/es/src/scss/editioncrafter.scss +1 -1
  54. package/dist/style.css +1 -0
  55. package/package.json +36 -51
  56. package/dist/editioncrafter.min.js +0 -2
  57. package/dist/editioncrafter.min.js.LICENSE.txt +0 -144
@@ -1,356 +1,402 @@
1
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
11
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
- import React, { useState, useRef, useEffect } from 'react';
13
- import { connect } from 'react-redux';
14
- import { FaArrowCircleLeft, FaArrowCircleRight } from 'react-icons/fa';
15
- import Select from '@material-ui/core/Select';
16
- import MenuItem from '@material-ui/core/MenuItem';
17
- import JumpToFolio from './JumpToFolio';
18
- import DocumentHelper from '../model/DocumentHelper';
19
- import HelpPopper from './HelpPopper';
20
- import AlphabetLinks from './AlphabetLinks';
21
- import useIsWidthUp from '../hooks/useIsWidthUp';
22
- var initialPopoverObj = {
23
- anchorEl: null
24
- };
25
- var Navigation = function Navigation(props) {
26
- var _document$folioIndex$;
27
- var _useState = useState(_objectSpread({}, initialPopoverObj)),
28
- _useState2 = _slicedToArray(_useState, 2),
29
- popover = _useState2[0],
30
- setPopover = _useState2[1];
31
- var _useState3 = useState(false),
32
- _useState4 = _slicedToArray(_useState3, 2),
33
- openHelp = _useState4[0],
34
- setOpenHelp = _useState4[1];
35
- var _useState5 = useState(false),
36
- _useState6 = _slicedToArray(_useState5, 2),
37
- openHelpNarrow = _useState6[0],
38
- setOpenHelpNarrow = _useState6[1];
39
- var helpRef = useRef(null);
40
- var helpRefNarrow = useRef(null);
41
- var onJumpBoxBlur = function onJumpBoxBlur(event) {
42
- setPopover({
43
- anchorEl: null
44
- });
45
- };
46
- var changeType = function changeType(event) {
47
- if (event.target.value === undefined || event.target.value === 0) return;
48
- props.documentViewActions.changeTranscriptionType(props.side, event.target.value);
49
- };
50
- var onGoToGrid = function onGoToGrid(event) {
51
- props.documentViewActions.changeTranscriptionType(props.side, 'g');
52
- };
53
- var toggleHelp = function toggleHelp(event) {
54
- setOpenHelp(!openHelp);
55
- };
56
- var toggleHelpNarrow = function toggleHelpNarrow(event) {
57
- setOpenHelpNarrow(!openHelpNarrow);
58
- };
59
- var toggleBookmode = function toggleBookmode(event) {
1
+ import MenuItem from '@material-ui/core/MenuItem'
2
+ import Select from '@material-ui/core/Select'
3
+ import React, { useRef, useState } from 'react'
4
+ import {
5
+ FaArrowCircleLeft,
6
+ FaArrowCircleRight,
7
+ } from 'react-icons/fa'
8
+ import { connect } from 'react-redux'
9
+ import useIsWidthUp from '../hooks/useIsWidthUp'
10
+ import DocumentHelper from '../model/DocumentHelper'
11
+ import AlphabetLinks from './AlphabetLinks'
12
+ import HelpPopper from './HelpPopper'
13
+ import JumpToFolio from './JumpToFolio'
14
+
15
+ const initialPopoverObj = {
16
+ anchorEl: null,
17
+ }
18
+
19
+ function Navigation(props) {
20
+ const [popover, setPopover] = useState({ ...initialPopoverObj })
21
+ const [openHelp, setOpenHelp] = useState(false)
22
+ const [openHelpNarrow, setOpenHelpNarrow] = useState(false)
23
+
24
+ const helpRef = useRef(null)
25
+ const helpRefNarrow = useRef(null)
26
+
27
+ const onJumpBoxBlur = (event) => {
28
+ setPopover({ anchorEl: null })
29
+ }
30
+
31
+ const changeType = (event) => {
32
+ if (event.target.value === undefined || event.target.value === 0)
33
+ return
34
+ props.documentViewActions.changeTranscriptionType(
35
+ props.side,
36
+ event.target.value,
37
+ )
38
+ }
39
+
40
+ const onGoToGrid = (event) => {
41
+ props.documentViewActions.changeTranscriptionType(props.side, 'g')
42
+ }
43
+
44
+ const toggleHelp = (event) => {
45
+ setOpenHelp(!openHelp)
46
+ }
47
+
48
+ const toggleHelpNarrow = (event) => {
49
+ setOpenHelpNarrow(!openHelpNarrow)
50
+ }
51
+
52
+ const toggleBookmode = (event) => {
60
53
  if (!props.documentView.bookMode) {
61
- props.documentViewActions.changeCurrentFolio(props.documentView.left.iiifShortID, 'left', props.documentView.left.transcriptionType);
62
- props.documentViewActions.changeCurrentFolio(props.documentView.left.nextFolioShortID, 'right', props.documentView.left.transcriptionType);
54
+ props.documentViewActions.changeCurrentFolio(
55
+ props.documentView.left.iiifShortID,
56
+ 'left',
57
+ props.documentView.left.transcriptionType,
58
+ )
59
+
60
+ props.documentViewActions.changeCurrentFolio(
61
+ props.documentView.left.nextFolioShortID,
62
+ 'right',
63
+ props.documentView.left.transcriptionType,
64
+ )
63
65
  }
64
- props.documentViewActions.setBookMode(props.documentView.left.iiifShortID, !props.documentView.bookMode);
65
- };
66
- var toggleXMLMode = function toggleXMLMode(event) {
67
- props.documentViewActions.setXMLMode(props.side, !props.documentView[props.side].isXMLMode);
68
- };
69
- var toggleLockmode = function toggleLockmode(event) {
66
+
67
+ props.documentViewActions.setBookMode(
68
+ props.documentView.left.iiifShortID,
69
+ !props.documentView.bookMode,
70
+ )
71
+ }
72
+
73
+ const toggleXMLMode = (event) => {
74
+ props.documentViewActions.setXMLMode(
75
+ props.side,
76
+ !props.documentView[props.side].isXMLMode,
77
+ )
78
+ }
79
+
80
+ const toggleLockmode = (event) => {
70
81
  if (props.documentView.bookMode) {
71
- toggleBookmode();
72
- return;
82
+ toggleBookmode()
83
+ return
73
84
  }
74
85
 
75
86
  // If we are transitioning from unlocked to locked, sync up the panes
76
87
  if (props.documentView.linkedMode === false) {
77
88
  if (props.side === 'left') {
78
- props.documentViewActions.changeCurrentFolio(props.documentView.left.iiifShortID, 'right', props.documentView.right.transcriptionType);
79
- } else {
80
- props.documentViewActions.changeCurrentFolio(props.documentView.right.iiifShortID, 'left', props.documentView.left.transcriptionType);
89
+ props.documentViewActions.changeCurrentFolio(
90
+ props.documentView.left.iiifShortID,
91
+ 'right',
92
+ props.documentView.right.transcriptionType,
93
+ )
94
+ }
95
+ else {
96
+ props.documentViewActions.changeCurrentFolio(
97
+ props.documentView.right.iiifShortID,
98
+ 'left',
99
+ props.documentView.left.transcriptionType,
100
+ )
81
101
  }
82
102
  }
83
103
 
84
104
  // Set lock
85
- props.documentViewActions.setLinkedMode(!props.documentView.linkedMode);
86
- };
87
- var changeCurrentFolio = function changeCurrentFolio(event) {
88
- var documentViewActions = props.documentViewActions,
89
- documentView = props.documentView,
90
- side = props.side;
105
+ props.documentViewActions.setLinkedMode(
106
+ !props.documentView.linkedMode,
107
+ )
108
+ }
109
+
110
+ const changeCurrentFolio = (event) => {
111
+ const {
112
+ documentViewActions,
113
+ documentView,
114
+ side,
115
+ } = props
116
+
91
117
  if (typeof event.currentTarget.dataset.id === 'undefined' || event.currentTarget.dataset.id.length === 0) {
92
- return;
118
+ return
93
119
  }
94
- var folioID = event.currentTarget.dataset.id;
95
- documentViewActions.changeCurrentFolio(folioID, side, documentView[side].transcriptionType);
96
- };
97
- var revealJumpBox = function revealJumpBox(event) {
120
+ const folioID = event.currentTarget.dataset.id
121
+ documentViewActions.changeCurrentFolio(
122
+ folioID,
123
+ side,
124
+ documentView[side].transcriptionType,
125
+ )
126
+ }
127
+
128
+ const revealJumpBox = (event) => {
98
129
  setPopover({
99
- anchorEl: event.currentTarget
100
- });
101
- };
102
- var side = props.side,
103
- document = props.document,
104
- documentView = props.documentView,
105
- documentViewActions = props.documentViewActions,
106
- onFilterChange = props.onFilterChange;
107
- var isWidthUp = useIsWidthUp('md');
130
+ anchorEl: event.currentTarget,
131
+ })
132
+ }
133
+
134
+ const {
135
+ side,
136
+ document,
137
+ documentView,
138
+ documentViewActions,
139
+ onFilterChange,
140
+ } = props
141
+
142
+ const isWidthUp = useIsWidthUp('md')
143
+
108
144
  if (!documentView) {
109
- return /*#__PURE__*/React.createElement("div", null, "Unknown Transcription Type");
145
+ return (
146
+ <div>
147
+ Unknown Transcription Type
148
+ </div>
149
+ )
110
150
  }
111
- var getSelectContainerStyle = function getSelectContainerStyle() {
151
+
152
+ const getSelectContainerStyle = () => {
112
153
  if (isWidthUp) {
113
154
  if (documentView[side].width < 500 && !document.variorum) {
114
- return {
115
- display: 'none'
116
- };
155
+ return { display: 'none' }
117
156
  }
118
- return {
119
- display: 'flex'
120
- };
157
+
158
+ return { display: 'flex' }
121
159
  }
122
- return null;
123
- };
124
- var recommendedWidth = documentView[side].width - 8; // the divder is 16 px wide so each side is minus 8
125
- var widthStyle = {
126
- width: recommendedWidth,
127
- maxWidth: recommendedWidth
128
- };
129
- var selectColorStyle = documentView[side].transcriptionType === 'f' ? {
130
- color: 'white'
131
- } : {
132
- color: 'black'
133
- };
134
- var selectClass = documentView[side].transcriptionType === 'f' ? 'dark' : 'light';
135
- var showButtonsStyle = documentView[side].transcriptionType === 'glossary' ? {
136
- visibility: 'hidden'
137
- } : {
138
- visibility: 'visible'
139
- };
140
- var selectContainerStyle = {
141
- display: 'flex'
142
- }; //what's the reason we want this to be hidden sometimes?
143
- var lockIconClass = documentView.linkedMode ? 'fa fa-lock' : 'fa fa-lock-open';
160
+
161
+ return null
162
+ }
163
+
164
+ const selectColorStyle = documentView[side].transcriptionType === 'f' ? { color: 'white' } : { color: 'black' }
165
+ const selectClass = documentView[side].transcriptionType === 'f' ? 'dark' : 'light'
166
+ const showButtonsStyle = documentView[side].transcriptionType === 'glossary' ? { visibility: 'hidden' } : { visibility: 'visible' }
167
+ const selectContainerStyle = { display: 'flex' } // what's the reason we want this to be hidden sometimes?
168
+ let lockIconClass = (documentView.linkedMode) ? 'fa fa-lock' : 'fa fa-lock-open'
144
169
  if (!documentView.bookMode) {
145
- lockIconClass += ' active';
170
+ lockIconClass += ' active'
146
171
  }
147
- var imageViewActive = documentView[side].transcriptionType === 'f';
148
- var bookIconClass = documentView.bookMode ? 'fa fa-book active' : 'fa fa-book';
149
- var xmlIconClass = documentView[side].isXMLMode ? 'fa fa-code active' : 'fa fa-code';
150
- var folioName = (_document$folioIndex$ = document.folioIndex[documentView[side].iiifShortID]) === null || _document$folioIndex$ === void 0 ? void 0 : _document$folioIndex$.name;
151
- var jumpToIconStyle = imageViewActive ? {
152
- color: 'white'
153
- } : {
154
- color: 'black'
155
- };
172
+ const imageViewActive = documentView[side].transcriptionType === 'f'
173
+ const bookIconClass = (documentView.bookMode) ? 'fa fa-book active' : 'fa fa-book'
174
+ const xmlIconClass = (documentView[side].isXMLMode) ? 'fa fa-code active' : 'fa fa-code'
175
+ const folioName = document.folioIndex[documentView[side].iiifShortID]?.name
176
+ const jumpToIconStyle = (imageViewActive) ? { color: 'white' } : { color: 'black' }
156
177
  // this is messy but faster for the moment then figuring out why the sides dont behave the same
157
- var helpMarginStyle = side === 'left' ? {
158
- marginRight: '55px'
159
- } : {
160
- marginRight: '15px'
161
- };
162
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
163
- className: "navigationComponent"
164
- }, /*#__PURE__*/React.createElement("div", {
165
- id: "navigation-row",
166
- className: "navigationRow"
167
- }, documentView[side].transcriptionType !== 'glossary' ? /*#__PURE__*/React.createElement("div", {
168
- id: "tool-bar-buttons",
169
- className: "breadcrumbs",
170
- style: showButtonsStyle
171
- }, /*#__PURE__*/React.createElement("div", {
172
- style: {
173
- display: 'flex',
174
- alignItems: 'baseline',
175
- gap: '4px'
176
- }
177
- }, /*#__PURE__*/React.createElement("span", {
178
- className: "fas fa-th",
179
- style: {
180
- cursor: documentView[side].transcriptionType !== 'g' ? 'pointer' : 'default',
181
- padding: '0 15px'
182
- },
183
- title: documentView[side].transcriptionType !== 'g' && "Return to Grid View",
184
- onClick: documentView[side].transcriptionType !== 'g' && onGoToGrid
185
- }), /*#__PURE__*/React.createElement("span", {
186
- title: "Toggle coordination of views",
187
- onClick: toggleLockmode,
188
- className: lockIconClass
189
- }), /*#__PURE__*/React.createElement("span", {
190
- title: "Toggle book mode",
191
- onClick: toggleBookmode,
192
- className: bookIconClass
193
- }), /*#__PURE__*/React.createElement("span", {
194
- title: "Toggle XML mode",
195
- onClick: toggleXMLMode,
196
- style: {
197
- paddingRight: '15px'
198
- },
199
- className: imageViewActive ? 'invisible' : xmlIconClass
200
- }), /*#__PURE__*/React.createElement("span", {
201
- title: "Go back",
202
- onClick: changeCurrentFolio,
203
- "data-id": documentView[side].previousFolioShortID,
204
- className: documentView[side].hasPrevious ? 'arrow' : 'arrow disabled'
205
- }, /*#__PURE__*/React.createElement(FaArrowCircleLeft, null)), /*#__PURE__*/React.createElement("span", {
206
- title: "Go forward",
207
- onClick: changeCurrentFolio,
208
- "data-id": documentView[side].nextFolioShortID,
209
- className: documentView[side].hasNext ? 'arrow' : 'arrow disabled'
210
- }, /*#__PURE__*/React.createElement(FaArrowCircleRight, null))), "\xA0\xA0", /*#__PURE__*/React.createElement("div", {
211
- title: "".concat(props.documentName || document.documentName, "/").concat(folioName),
212
- style: {
213
- display: 'flex',
214
- overflowX: 'hidden',
215
- justifyContent: 'flex-end'
216
- }
217
- }, /*#__PURE__*/React.createElement("span", null, props.documentName || document.documentName), /*#__PURE__*/React.createElement("span", null, ' / '), /*#__PURE__*/React.createElement("div", {
218
- onClick: revealJumpBox,
219
- className: "folioName",
220
- style: {
221
- flexShrink: '0',
222
- minWidth: '40px'
223
- }
224
- }, folioName, /*#__PURE__*/React.createElement("span", {
225
- style: jumpToIconStyle,
226
- className: "fa fa-hand-point-right"
227
- }))), /*#__PURE__*/React.createElement(JumpToFolio, {
228
- side: side,
229
- anchorEl: popover.anchorEl,
230
- submitHandler: documentViewActions.jumpToFolio,
231
- blurHandler: onJumpBoxBlur
232
- })) : /*#__PURE__*/React.createElement(AlphabetLinks, {
233
- onFilterChange: onFilterChange,
234
- value: props.value
235
- }), /*#__PURE__*/React.createElement("div", {
236
- id: "doc-type-help",
237
- style: selectContainerStyle,
238
- ref: helpRef
239
- }, /*#__PURE__*/React.createElement(Select, {
240
- className: selectClass,
241
- style: _objectSpread(_objectSpread({}, selectColorStyle), {}, {
242
- marginRight: 15,
243
- fontSize: 'max(16px, 1rem)'
244
- }),
245
- value: documentView[side].transcriptionType,
246
- id: "doc-type",
247
- onClick: changeType
248
- }, Object.keys(props.document.folios.find(function (fol) {
249
- return fol.id == props.documentView[props.side].iiifShortID;
250
- }).annotationURLs).map(function (ttKey) {
251
- return /*#__PURE__*/React.createElement(MenuItem, {
252
- value: ttKey,
253
- key: ttKey
254
- }, props.document.variorum ? props.document.transcriptionTypes[props.document.folios.find(function (fol) {
255
- return fol.id == props.documentView[props.side].iiifShortID;
256
- }).doc_id][ttKey] : props.document.transcriptionTypes[ttKey]);
257
- }), /*#__PURE__*/React.createElement(MenuItem, {
258
- value: "f",
259
- key: "f"
260
- }, DocumentHelper.transcriptionTypeLabels.f), props.glossary && /*#__PURE__*/React.createElement(MenuItem, {
261
- value: "glossary",
262
- key: "glossary"
263
- }, DocumentHelper.transcriptionTypeLabels.glossary)), /*#__PURE__*/React.createElement("span", {
264
- title: "Toggle folio help",
265
- onClick: toggleHelp,
266
- className: "helpIcon"
267
- }, /*#__PURE__*/React.createElement("i", {
268
- className: "fas fa-question-circle"
269
- })), /*#__PURE__*/React.createElement(HelpPopper, {
270
- marginStyle: helpMarginStyle,
271
- anchorEl: helpRef.current,
272
- open: openHelp,
273
- onClose: toggleHelp
274
- })))), /*#__PURE__*/React.createElement("div", {
275
- className: "navigationComponentNarrow"
276
- }, /*#__PURE__*/React.createElement("div", {
277
- id: "navigation-row",
278
- className: "navigationRowNarrow"
279
- }, documentView[side].transcriptionType !== 'glossary' ? /*#__PURE__*/React.createElement("div", {
280
- id: "tool-bar-buttons",
281
- className: "breadcrumbsNarrow",
282
- style: showButtonsStyle
283
- }, /*#__PURE__*/React.createElement("span", {
284
- className: "fas fa-th",
285
- style: {
286
- cursor: documentView[side].transcriptionType !== 'g' ? 'pointer' : 'default',
287
- padding: '0 15px'
288
- },
289
- title: documentView[side].transcriptionType !== 'g' && "Return to Grid View",
290
- onClick: documentView[side].transcriptionType !== 'g' && onGoToGrid
291
- }), "\xA0", /*#__PURE__*/React.createElement("span", {
292
- title: "Toggle XML mode",
293
- onClick: toggleXMLMode,
294
- className: imageViewActive ? 'invisible' : xmlIconClass
295
- }), imageViewActive && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
296
- title: "Go back",
297
- onClick: changeCurrentFolio,
298
- "data-id": documentView[side].previousFolioShortID,
299
- className: documentView[side].hasPrevious ? 'arrow' : 'arrow disabled'
300
- }, ' ', /*#__PURE__*/React.createElement(FaArrowCircleLeft, null), ' '), /*#__PURE__*/React.createElement("span", {
301
- title: "Go forward",
302
- onClick: changeCurrentFolio,
303
- "data-id": documentView[side].nextFolioShortID,
304
- className: documentView[side].hasNext ? 'arrow' : 'arrow disabled'
305
- }, ' ', /*#__PURE__*/React.createElement(FaArrowCircleRight, null)))) : /*#__PURE__*/React.createElement(AlphabetLinks, {
306
- onFilterChange: onFilterChange,
307
- value: props.value
308
- }), /*#__PURE__*/React.createElement("div", {
309
- id: "doc-type-help",
310
- style: selectContainerStyle,
311
- ref: helpRefNarrow
312
- }, /*#__PURE__*/React.createElement(Select, {
313
- className: selectClass,
314
- style: _objectSpread(_objectSpread({}, selectColorStyle), {}, {
315
- marginRight: 15,
316
- fontSize: 'max(16px, 1rem)'
317
- }),
318
- value: documentView[side].transcriptionType,
319
- id: "doc-type",
320
- onClick: changeType
321
- }, Object.keys(props.document.folios.find(function (fol) {
322
- return fol.id == props.documentView[props.side].iiifShortID;
323
- }).annotationURLs).map(function (ttKey) {
324
- return /*#__PURE__*/React.createElement(MenuItem, {
325
- value: ttKey,
326
- key: ttKey,
327
- title: ttKey
328
- }, props.document.variorum ? props.document.transcriptionTypes[props.document.folios.find(function (fol) {
329
- return fol.id == props.documentView[props.side].iiifShortID;
330
- }).doc_id][ttKey] : props.document.transcriptionTypes[ttKey]);
331
- }), /*#__PURE__*/React.createElement(MenuItem, {
332
- value: "f",
333
- key: "f"
334
- }, DocumentHelper.transcriptionTypeLabels.f), props.glossary && /*#__PURE__*/React.createElement(MenuItem, {
335
- value: "glossary",
336
- key: "glossary"
337
- }, DocumentHelper.transcriptionTypeLabels.glossary)), /*#__PURE__*/React.createElement("span", {
338
- title: "Toggle folio help",
339
- onClick: toggleHelpNarrow,
340
- className: "helpIcon"
341
- }, /*#__PURE__*/React.createElement("i", {
342
- className: "fas fa-question-circle"
343
- })), /*#__PURE__*/React.createElement(HelpPopper, {
344
- marginStyle: helpMarginStyle,
345
- anchorEl: helpRefNarrow.current,
346
- open: openHelpNarrow,
347
- onClose: toggleHelpNarrow
348
- })))));
349
- };
178
+ const helpMarginStyle = side === 'left' ? { marginRight: '55px' } : { marginRight: '15px' }
179
+
180
+ return (
181
+ <>
182
+ <div className="navigationComponent">
183
+ <div id="navigation-row" className="navigationRow">
184
+
185
+ { documentView[side].transcriptionType !== 'glossary' ? (
186
+
187
+ <div id="tool-bar-buttons" className="breadcrumbs" style={showButtonsStyle}>
188
+ <div style={{ display: 'flex', alignItems: 'baseline', gap: '4px' }}>
189
+ <span
190
+ className="fas fa-th"
191
+ style={{ cursor: documentView[side].transcriptionType !== 'g' ? 'pointer' : 'default', padding: '0 15px' }}
192
+ title={documentView[side].transcriptionType !== 'g' && 'Return to Grid View'}
193
+ onClick={documentView[side].transcriptionType !== 'g' && onGoToGrid}
194
+ />
195
+
196
+ <span
197
+ title="Toggle coordination of views"
198
+ onClick={toggleLockmode}
199
+ className={lockIconClass}
200
+ />
201
+
202
+ <span
203
+ title="Toggle book mode"
204
+ onClick={toggleBookmode}
205
+ className={bookIconClass}
206
+ />
207
+
208
+ <span
209
+ title="Toggle XML mode"
210
+ onClick={toggleXMLMode}
211
+ style={{ paddingRight: '15px' }}
212
+ className={imageViewActive ? 'invisible' : xmlIconClass}
213
+ />
214
+
215
+ {/* <span title="Toggle single column mode" onClick={this.toggleColumns}
216
+ className={columnIconClass}></span> */}
217
+
218
+ <span
219
+ title="Go back"
220
+ onClick={changeCurrentFolio}
221
+ data-id={documentView[side].previousFolioShortID}
222
+ className={(documentView[side].hasPrevious) ? 'arrow' : 'arrow disabled'}
223
+ >
224
+
225
+ <FaArrowCircleLeft />
226
+
227
+ </span>
228
+
229
+ <span
230
+ title="Go forward"
231
+ onClick={changeCurrentFolio}
232
+ data-id={documentView[side].nextFolioShortID}
233
+ className={(documentView[side].hasNext) ? 'arrow' : 'arrow disabled'}
234
+ >
235
+
236
+ <FaArrowCircleRight />
237
+ </span>
238
+ </div>
239
+ &nbsp;&nbsp;
240
+ <div title={`${props.documentName || document.documentName}/${folioName}`} style={{ display: 'flex', overflowX: 'hidden', justifyContent: 'flex-end' }}>
241
+ <span>{props.documentName || document.documentName}</span>
242
+ <span>{' / '}</span>
243
+ <div
244
+ onClick={revealJumpBox}
245
+ className="folioName"
246
+ style={{ flexShrink: '0', minWidth: '40px' }}
247
+ >
248
+
249
+ {folioName}
250
+
251
+ <span style={jumpToIconStyle} className="fa fa-hand-point-right" />
252
+ </div>
253
+ </div>
254
+
255
+ <JumpToFolio
256
+ side={side}
257
+ anchorEl={popover.anchorEl}
258
+ submitHandler={documentViewActions.jumpToFolio}
259
+ blurHandler={onJumpBoxBlur}
260
+ />
261
+
262
+ </div>
263
+ )
264
+ : (<AlphabetLinks onFilterChange={onFilterChange} value={props.value} />)}
265
+
266
+ <div id="doc-type-help" style={selectContainerStyle} ref={helpRef}>
267
+ <Select
268
+ className={selectClass}
269
+ style={{ ...selectColorStyle, marginRight: 15, fontSize: 'max(16px, 1rem)' }}
270
+ value={documentView[side].transcriptionType}
271
+ id="doc-type"
272
+ onClick={changeType}
273
+ >
274
+ {Object.keys(props.document.folios.find(fol => (fol.id === props.documentView[props.side].iiifShortID)).annotationURLs).map(ttKey => (
275
+ <MenuItem value={ttKey} key={ttKey}>{props.document.variorum ? props.document.transcriptionTypes[props.document.folios.find(fol => (fol.id === props.documentView[props.side].iiifShortID)).doc_id][ttKey] : props.document.transcriptionTypes[ttKey]}</MenuItem>
276
+ ))}
277
+ <MenuItem value="f" key="f">
278
+ {DocumentHelper.transcriptionTypeLabels.f}
279
+ </MenuItem>
280
+ { props.glossary && (
281
+ <MenuItem value="glossary" key="glossary">
282
+ {DocumentHelper.transcriptionTypeLabels.glossary}
283
+ </MenuItem>
284
+ ) }
285
+ </Select>
286
+ <span
287
+ title="Toggle folio help"
288
+ onClick={toggleHelp}
289
+ className="helpIcon"
290
+ >
291
+ <i className="fas fa-question-circle" />
292
+ </span>
293
+ <HelpPopper
294
+ marginStyle={helpMarginStyle}
295
+ anchorEl={helpRef.current}
296
+ open={openHelp}
297
+ onClose={toggleHelp}
298
+ />
299
+ </div>
300
+
301
+ </div>
302
+ </div>
303
+ <div className="navigationComponentNarrow">
304
+ <div id="navigation-row" className="navigationRowNarrow">
305
+
306
+ { documentView[side].transcriptionType !== 'glossary'
307
+ ? (
308
+
309
+ <div id="tool-bar-buttons" className="breadcrumbsNarrow" style={showButtonsStyle}>
310
+
311
+ <span
312
+ className="fas fa-th"
313
+ style={{ cursor: documentView[side].transcriptionType !== 'g' ? 'pointer' : 'default', padding: '0 15px' }}
314
+ title={documentView[side].transcriptionType !== 'g' && 'Return to Grid View'}
315
+ onClick={documentView[side].transcriptionType !== 'g' && onGoToGrid}
316
+ />
317
+ &nbsp;
318
+ <span
319
+ title="Toggle XML mode"
320
+ onClick={toggleXMLMode}
321
+ className={imageViewActive ? 'invisible' : xmlIconClass}
322
+ />
323
+
324
+ { imageViewActive && (
325
+ <>
326
+ <span
327
+ title="Go back"
328
+ onClick={changeCurrentFolio}
329
+ data-id={documentView[side].previousFolioShortID}
330
+ className={(documentView[side].hasPrevious) ? 'arrow' : 'arrow disabled'}
331
+ >
332
+ {' '}
333
+ <FaArrowCircleLeft />
334
+ {' '}
335
+
336
+ </span>
337
+
338
+ <span
339
+ title="Go forward"
340
+ onClick={changeCurrentFolio}
341
+ data-id={documentView[side].nextFolioShortID}
342
+ className={(documentView[side].hasNext) ? 'arrow' : 'arrow disabled'}
343
+ >
344
+ {' '}
345
+ <FaArrowCircleRight />
346
+ </span>
347
+ </>
348
+ )}
349
+
350
+ </div>
351
+ )
352
+ : (<AlphabetLinks onFilterChange={onFilterChange} value={props.value} />)}
353
+
354
+ <div id="doc-type-help" style={selectContainerStyle} ref={helpRefNarrow}>
355
+ <Select
356
+ className={selectClass}
357
+ style={{ ...selectColorStyle, marginRight: 15, fontSize: 'max(16px, 1rem)' }}
358
+ value={documentView[side].transcriptionType}
359
+ id="doc-type"
360
+ onClick={changeType}
361
+ >
362
+ {Object.keys(props.document.folios.find(fol => (fol.id === props.documentView[props.side].iiifShortID)).annotationURLs).map(ttKey => (
363
+ <MenuItem value={ttKey} key={ttKey} title={ttKey}>{props.document.variorum ? props.document.transcriptionTypes[props.document.folios.find(fol => (fol.id === props.documentView[props.side].iiifShortID)).doc_id][ttKey] : props.document.transcriptionTypes[ttKey]}</MenuItem>
364
+ ))}
365
+ <MenuItem value="f" key="f">
366
+ {DocumentHelper.transcriptionTypeLabels.f}
367
+ </MenuItem>
368
+ { props.glossary && (
369
+ <MenuItem value="glossary" key="glossary">
370
+ {DocumentHelper.transcriptionTypeLabels.glossary}
371
+ </MenuItem>
372
+ ) }
373
+ </Select>
374
+ <span
375
+ title="Toggle folio help"
376
+ onClick={toggleHelpNarrow}
377
+ className="helpIcon"
378
+ >
379
+ <i className="fas fa-question-circle" />
380
+ </span>
381
+ <HelpPopper
382
+ marginStyle={helpMarginStyle}
383
+ anchorEl={helpRefNarrow.current}
384
+ open={openHelpNarrow}
385
+ onClose={toggleHelpNarrow}
386
+ />
387
+ </div>
388
+
389
+ </div>
390
+ </div>
391
+ </>
392
+ )
393
+ }
394
+
350
395
  function mapStateToProps(state) {
351
396
  return {
352
397
  document: state.document,
353
- glossary: !!state.glossary.URL
354
- };
398
+ glossary: !!state.glossary.URL,
399
+ }
355
400
  }
356
- export default connect(mapStateToProps)(Navigation);
401
+
402
+ export default (connect(mapStateToProps)(Navigation))