@cu-mkp/editioncrafter 1.1.0 → 1.2.0-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 (118) hide show
  1. package/dist/editioncrafter.js +20709 -18672
  2. package/dist/es/src/{action → EditionCrafter/action}/DocumentActions.js +8 -0
  3. package/dist/es/src/{action → EditionCrafter/action}/initialState/documentInitialState.js +7 -0
  4. package/dist/es/src/{component → EditionCrafter/component}/DiploMatic.js +17 -14
  5. package/dist/es/src/{component → EditionCrafter/component}/DocumentView.js +16 -6
  6. package/dist/es/src/EditionCrafter/component/Navigation.js +446 -0
  7. package/dist/es/src/{component → EditionCrafter/component}/RouteListener.js +3 -3
  8. package/dist/es/src/EditionCrafter/component/TagToolbar.jsx +57 -0
  9. package/dist/es/src/{component → EditionCrafter/component}/TranscriptionView.js +27 -7
  10. package/dist/es/src/EditionCrafter/context/TagFilter.jsx +61 -0
  11. package/dist/es/src/EditionCrafter/context/TagFilterContext.js +8 -0
  12. package/dist/es/src/EditionCrafter/icons/DocumentPagesIcon.jsx +18 -0
  13. package/dist/es/src/{model → EditionCrafter/model}/Folio.js +27 -1
  14. package/dist/es/src/{model → EditionCrafter/model}/folioLayout.js +6 -5
  15. package/dist/es/src/{saga → EditionCrafter/saga}/RouteListenerSaga.js +44 -3
  16. package/dist/es/src/{scss → EditionCrafter/scss}/_base.scss +11 -1
  17. package/dist/es/src/{scss → EditionCrafter/scss}/_diplomatic.scss +15 -24
  18. package/dist/es/src/EditionCrafter/scss/_navigation.scss +468 -0
  19. package/dist/es/src/{scss → EditionCrafter/scss}/_transcriptView.scss +50 -41
  20. package/dist/es/src/{scss → EditionCrafter/scss}/editioncrafter.scss +2 -1
  21. package/dist/es/src/RecordList/component/CollapsibleMenu.jsx +22 -0
  22. package/dist/es/src/RecordList/component/Loading.jsx +12 -0
  23. package/dist/es/src/RecordList/component/Pill.jsx +10 -0
  24. package/dist/es/src/RecordList/component/Record.jsx +82 -0
  25. package/dist/es/src/RecordList/component/RecordListView.jsx +109 -0
  26. package/dist/es/src/RecordList/component/Sidebar.jsx +83 -0
  27. package/dist/es/src/RecordList/component/SidebarTagList.jsx +38 -0
  28. package/dist/es/src/RecordList/context/FilterContext.jsx +8 -0
  29. package/dist/es/src/RecordList/index.jsx +92 -0
  30. package/dist/es/src/RecordList/lib/sql.js +9 -0
  31. package/dist/es/src/RecordList/styles/base.css +78 -0
  32. package/dist/es/src/RecordList/styles/record.css +84 -0
  33. package/dist/es/src/RecordList/styles/sidebar.css +39 -0
  34. package/dist/es/src/{index.js → index.jsx} +6 -3
  35. package/package.json +6 -3
  36. package/dist/es/src/component/Navigation.js +0 -402
  37. package/dist/es/src/hooks/useIsWidthUp.js +0 -9
  38. package/dist/es/src/lib/registerServiceWorker.js +0 -111
  39. package/dist/es/src/scss/_navigation.scss +0 -209
  40. /package/dist/es/src/{action → EditionCrafter/action}/DiplomaticActions.js +0 -0
  41. /package/dist/es/src/{action → EditionCrafter/action}/GlossaryActions.js +0 -0
  42. /package/dist/es/src/{action → EditionCrafter/action}/initialState/diplomaticInitialState.js +0 -0
  43. /package/dist/es/src/{action → EditionCrafter/action}/initialState/glossaryInitialState.js +0 -0
  44. /package/dist/es/src/{action → EditionCrafter/action}/rootReducer.js +0 -0
  45. /package/dist/es/src/{component → EditionCrafter/component}/AlphabetLinks.js +0 -0
  46. /package/dist/es/src/{component → EditionCrafter/component}/CustomizedTooltops.js +0 -0
  47. /package/dist/es/src/{component → EditionCrafter/component}/EditorComment.js +0 -0
  48. /package/dist/es/src/{component → EditionCrafter/component}/ErrorBoundary.js +0 -0
  49. /package/dist/es/src/{component → EditionCrafter/component}/FigureImage.js +0 -0
  50. /package/dist/es/src/{component → EditionCrafter/component}/GlossaryView.js +0 -0
  51. /package/dist/es/src/{component → EditionCrafter/component}/HelpPopper.js +0 -0
  52. /package/dist/es/src/{component → EditionCrafter/component}/ImageGridView.js +0 -0
  53. /package/dist/es/src/{component → EditionCrafter/component}/ImageView.js +0 -0
  54. /package/dist/es/src/{component → EditionCrafter/component}/ImageZoomControl.js +0 -0
  55. /package/dist/es/src/{component → EditionCrafter/component}/JumpToFolio.js +0 -0
  56. /package/dist/es/src/{component → EditionCrafter/component}/Pagination.js +0 -0
  57. /package/dist/es/src/{component → EditionCrafter/component}/Parser.js +0 -0
  58. /package/dist/es/src/{component → EditionCrafter/component}/RingSpinner.js +0 -0
  59. /package/dist/es/src/{component → EditionCrafter/component}/SeaDragonComponent.js +0 -0
  60. /package/dist/es/src/{component → EditionCrafter/component}/SinglePaneView.js +0 -0
  61. /package/dist/es/src/{component → EditionCrafter/component}/SplitPaneView.js +0 -0
  62. /package/dist/es/src/{component → EditionCrafter/component}/Watermark.js +0 -0
  63. /package/dist/es/src/{component → EditionCrafter/component}/XMLView.js +0 -0
  64. /package/dist/es/src/{icons → EditionCrafter/icons}/ByIcon.js +0 -0
  65. /package/dist/es/src/{icons → EditionCrafter/icons}/CcIcon.js +0 -0
  66. /package/dist/es/src/{icons → EditionCrafter/icons}/NcIcon.js +0 -0
  67. /package/dist/es/src/{icons → EditionCrafter/icons}/SaIcon.js +0 -0
  68. /package/dist/es/src/{icons → EditionCrafter/icons}/SideMenuIconLeft.js +0 -0
  69. /package/dist/es/src/{icons → EditionCrafter/icons}/SideMenuIconRight.js +0 -0
  70. /package/dist/es/src/{icons → EditionCrafter/icons}/howtouse-asterisk.png +0 -0
  71. /package/dist/es/src/{icons → EditionCrafter/icons}/howtouse-curly.png +0 -0
  72. /package/dist/es/src/{icons → EditionCrafter/icons}/howtouse-square.png +0 -0
  73. /package/dist/es/src/{icons → EditionCrafter/icons}/howtouse-ups.png +0 -0
  74. /package/dist/es/src/{img → EditionCrafter/img}/banner-about.png +0 -0
  75. /package/dist/es/src/{img → EditionCrafter/img}/banner-essays.jpg +0 -0
  76. /package/dist/es/src/{img → EditionCrafter/img}/banner-essays.png +0 -0
  77. /package/dist/es/src/{img → EditionCrafter/img}/banner-how-to.png +0 -0
  78. /package/dist/es/src/{img → EditionCrafter/img}/banner-resources.png +0 -0
  79. /package/dist/es/src/{img → EditionCrafter/img}/book-open-cropped.png +0 -0
  80. /package/dist/es/src/{img → EditionCrafter/img}/book-open.png +0 -0
  81. /package/dist/es/src/{img → EditionCrafter/img}/book-spine.png +0 -0
  82. /package/dist/es/src/{img → EditionCrafter/img}/bookcover-cropped.png +0 -0
  83. /package/dist/es/src/{img → EditionCrafter/img}/cropped-MKLizardFilled-32x32.jpg +0 -0
  84. /package/dist/es/src/{img → EditionCrafter/img}/editioncrafterlogo.png +0 -0
  85. /package/dist/es/src/{img → EditionCrafter/img}/folio48r-drawing.png +0 -0
  86. /package/dist/es/src/{img → EditionCrafter/img}/howtouse-asterisk.png +0 -0
  87. /package/dist/es/src/{img → EditionCrafter/img}/howtouse-beaker.png +0 -0
  88. /package/dist/es/src/{img → EditionCrafter/img}/howtouse-curly.png +0 -0
  89. /package/dist/es/src/{img → EditionCrafter/img}/howtouse-square.png +0 -0
  90. /package/dist/es/src/{img → EditionCrafter/img}/howtouse-ups.png +0 -0
  91. /package/dist/es/src/{img → EditionCrafter/img}/lizard-no-bg.png +0 -0
  92. /package/dist/es/src/{img → EditionCrafter/img}/logo_center_multi_line.png +0 -0
  93. /package/dist/es/src/{img → EditionCrafter/img}/logo_center_single_line.png +0 -0
  94. /package/dist/es/src/{img → EditionCrafter/img}/logo_columbia.png +0 -0
  95. /package/dist/es/src/{img → EditionCrafter/img}/mk-banner-logo.png +0 -0
  96. /package/dist/es/src/{img → EditionCrafter/img}/mk-homepage-logo.png +0 -0
  97. /package/dist/es/src/{img → EditionCrafter/img}/spinner.gif +0 -0
  98. /package/dist/es/src/{img → EditionCrafter/img}/text-bg.png +0 -0
  99. /package/dist/es/src/{img → EditionCrafter/img}/watermark.png +0 -0
  100. /package/dist/es/src/{lib → EditionCrafter/lib}/copyObject.js +0 -0
  101. /package/dist/es/src/{model → EditionCrafter/model}/DocumentHelper.js +0 -0
  102. /package/dist/es/src/{model → EditionCrafter/model}/ReduxStore.js +0 -0
  103. /package/dist/es/src/{saga → EditionCrafter/saga}/rootSaga.js +0 -0
  104. /package/dist/es/src/{scss → EditionCrafter/scss}/_CETEIcean.scss +0 -0
  105. /package/dist/es/src/{scss → EditionCrafter/scss}/_globalNavigation.scss +0 -0
  106. /package/dist/es/src/{scss → EditionCrafter/scss}/_glossary.scss +0 -0
  107. /package/dist/es/src/{scss → EditionCrafter/scss}/_imageGridView.scss +0 -0
  108. /package/dist/es/src/{scss → EditionCrafter/scss}/_imageView.scss +0 -0
  109. /package/dist/es/src/{scss → EditionCrafter/scss}/_imageZoomControl.scss +0 -0
  110. /package/dist/es/src/{scss → EditionCrafter/scss}/_jumpbox.scss +0 -0
  111. /package/dist/es/src/{scss → EditionCrafter/scss}/_pagination.scss +0 -0
  112. /package/dist/es/src/{scss → EditionCrafter/scss}/_ringSpinner.scss +0 -0
  113. /package/dist/es/src/{scss → EditionCrafter/scss}/_singlePaneView.scss +0 -0
  114. /package/dist/es/src/{scss → EditionCrafter/scss}/_spinner.scss +0 -0
  115. /package/dist/es/src/{scss → EditionCrafter/scss}/_splitPaneView.scss +0 -0
  116. /package/dist/es/src/{scss → EditionCrafter/scss}/_thumbnails.scss +0 -0
  117. /package/dist/es/src/{scss → EditionCrafter/scss}/_watermark.scss +0 -0
  118. /package/dist/es/src/{scss → EditionCrafter/scss}/_xmlView.scss +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cu-mkp/editioncrafter",
3
3
  "type": "module",
4
- "version": "1.1.0",
4
+ "version": "1.2.0-beta.1",
5
5
  "private": false,
6
6
  "description": "A simple digital critical edition publication tool",
7
7
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "html-react-parser": "^4.2.2",
38
38
  "openseadragon": "^4.1.0",
39
39
  "prop-types": "^15.5.10",
40
- "react-icons": "^4.8.0",
40
+ "react-icons": "^4.12.0",
41
41
  "react-infinite-scroller": "^1.1.3",
42
42
  "react-markdown": "^8.0.7",
43
43
  "react-redux": "^8.0.5",
@@ -45,7 +45,8 @@
45
45
  "react-router-dom": "^6.11.0",
46
46
  "react-scroll": "^1.7.10",
47
47
  "redux": "^4.2.1",
48
- "redux-saga": "^1.2.2"
48
+ "redux-saga": "^1.2.2",
49
+ "sql.js": "^1.12.0"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@antfu/eslint-config": "^3.8.0",
@@ -73,6 +74,8 @@
73
74
  "glob": "^7.1.4",
74
75
  "http-server": "^14.1.0",
75
76
  "jsdom": "^19.0.0",
77
+ "react": "^17.0.2",
78
+ "react-dom": "^17.0.2",
76
79
  "react-refresh": "^0.14.0",
77
80
  "redux-mock-store": "^1.5.1",
78
81
  "redux-saga-test-plan": "^4.0.6",
@@ -1,402 +0,0 @@
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) => {
53
- if (!props.documentView.bookMode) {
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
- )
65
- }
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) => {
81
- if (props.documentView.bookMode) {
82
- toggleBookmode()
83
- return
84
- }
85
-
86
- // If we are transitioning from unlocked to locked, sync up the panes
87
- if (props.documentView.linkedMode === false) {
88
- if (props.side === 'left') {
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
- )
101
- }
102
- }
103
-
104
- // Set lock
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
-
117
- if (typeof event.currentTarget.dataset.id === 'undefined' || event.currentTarget.dataset.id.length === 0) {
118
- return
119
- }
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) => {
129
- setPopover({
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
-
144
- if (!documentView) {
145
- return (
146
- <div>
147
- Unknown Transcription Type
148
- </div>
149
- )
150
- }
151
-
152
- const getSelectContainerStyle = () => {
153
- if (isWidthUp) {
154
- if (documentView[side].width < 500 && !document.variorum) {
155
- return { display: 'none' }
156
- }
157
-
158
- return { display: 'flex' }
159
- }
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'
169
- if (!documentView.bookMode) {
170
- lockIconClass += ' active'
171
- }
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' }
177
- // this is messy but faster for the moment then figuring out why the sides dont behave the same
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
-
395
- function mapStateToProps(state) {
396
- return {
397
- document: state.document,
398
- glossary: !!state.glossary.URL,
399
- }
400
- }
401
-
402
- export default (connect(mapStateToProps)(Navigation))
@@ -1,9 +0,0 @@
1
- import { useTheme } from '@material-ui/core/styles'
2
- import useMediaQuery from '@material-ui/core/useMediaQuery'
3
-
4
- function useIsWidthUp(breakpoint) {
5
- const theme = useTheme()
6
- return useMediaQuery(theme.breakpoints.up(breakpoint))
7
- }
8
-
9
- export default useIsWidthUp
@@ -1,111 +0,0 @@
1
- // In production, we register a service worker to serve assets from local cache.
2
-
3
- // This lets the app load faster on subsequent visits in production, and gives
4
- // it offline capabilities. However, it also means that developers (and users)
5
- // will only see deployed updates on the "N+1" visit to a page, since previously
6
- // cached resources are updated in the background.
7
-
8
- // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9
- // This link also includes instructions on opting out of this behavior.
10
-
11
- const isLocalhost = Boolean(
12
- window.location.hostname === 'localhost'
13
- // [::1] is the IPv6 localhost address.
14
- || window.location.hostname === '[::1]'
15
- // 127.0.0.1/8 is considered localhost for IPv4.
16
- || window.location.hostname.match(
17
- /^127(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3}$/,
18
- ),
19
- )
20
-
21
- export default function register() {
22
- if (import.meta.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
23
- // The URL constructor is available in all browsers that support SW.
24
- const publicUrl = new URL(import.meta.env.PUBLIC_URL, window.location)
25
- if (publicUrl.origin !== window.location.origin) {
26
- // Our service worker won't work if PUBLIC_URL is on a different origin
27
- // from what our page is served on. This might happen if a CDN is used to
28
- // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29
- return
30
- }
31
-
32
- window.addEventListener('load', () => {
33
- const swUrl = `${import.meta.env.PUBLIC_URL}/service-worker.js`
34
-
35
- if (isLocalhost) {
36
- // This is running on localhost. Lets check if a service worker still exists or not.
37
- checkValidServiceWorker(swUrl)
38
- }
39
- else {
40
- // Is not local host. Just register service worker
41
- registerValidSW(swUrl)
42
- }
43
- })
44
- }
45
- }
46
-
47
- function registerValidSW(swUrl) {
48
- navigator.serviceWorker
49
- .register(swUrl)
50
- .then((registration) => {
51
- registration.onupdatefound = () => {
52
- const installingWorker = registration.installing
53
- installingWorker.onstatechange = () => {
54
- if (installingWorker.state === 'installed') {
55
- if (navigator.serviceWorker.controller) {
56
- // At this point, the old content will have been purged and
57
- // the fresh content will have been added to the cache.
58
- // It's the perfect time to display a "New content is
59
- // available; please refresh." message in your web app.
60
- console.log('New content is available; please refresh.')
61
- }
62
- else {
63
- // At this point, everything has been precached.
64
- // It's the perfect time to display a
65
- // "Content is cached for offline use." message.
66
- console.log('Content is cached for offline use.')
67
- }
68
- }
69
- }
70
- }
71
- })
72
- .catch((error) => {
73
- console.error('Error during service worker registration:', error)
74
- })
75
- }
76
-
77
- function checkValidServiceWorker(swUrl) {
78
- // Check if the service worker can be found. If it can't reload the page.
79
- fetch(swUrl)
80
- .then((response) => {
81
- // Ensure service worker exists, and that we really are getting a JS file.
82
- if (
83
- response.status === 404
84
- || !response.headers.get('content-type').includes('javascript')
85
- ) {
86
- // No service worker found. Probably a different app. Reload the page.
87
- navigator.serviceWorker.ready.then((registration) => {
88
- registration.unregister().then(() => {
89
- window.location.reload()
90
- })
91
- })
92
- }
93
- else {
94
- // Service worker found. Proceed as normal.
95
- registerValidSW(swUrl)
96
- }
97
- })
98
- .catch(() => {
99
- console.log(
100
- 'No internet connection found. App is running in offline mode.',
101
- )
102
- })
103
- }
104
-
105
- export function unregister() {
106
- if ('serviceWorker' in navigator) {
107
- navigator.serviceWorker.ready.then((registration) => {
108
- registration.unregister()
109
- })
110
- }
111
- }