@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.
- package/README.md +7 -7
- package/dist/editioncrafter.js +65802 -0
- package/dist/editioncrafter.umd.cjs +553 -0
- package/dist/es/src/action/DiplomaticActions.js +9 -11
- package/dist/es/src/action/DocumentActions.js +164 -154
- package/dist/es/src/action/GlossaryActions.js +9 -11
- package/dist/es/src/action/initialState/diplomaticInitialState.js +2 -2
- package/dist/es/src/action/initialState/documentInitialState.js +9 -12
- package/dist/es/src/action/initialState/glossaryInitialState.js +3 -3
- package/dist/es/src/action/rootReducer.js +31 -29
- package/dist/es/src/component/AlphabetLinks.js +44 -66
- package/dist/es/src/component/CustomizedTooltops.js +101 -110
- package/dist/es/src/component/DiploMatic.js +64 -91
- package/dist/es/src/component/DocumentView.js +442 -366
- package/dist/es/src/component/EditorComment.js +51 -75
- package/dist/es/src/component/ErrorBoundary.js +37 -61
- package/dist/es/src/component/FigureImage.js +56 -67
- package/dist/es/src/component/GlossaryView.js +157 -149
- package/dist/es/src/component/HelpPopper.js +96 -78
- package/dist/es/src/component/ImageGridView.js +184 -249
- package/dist/es/src/component/ImageView.js +155 -165
- package/dist/es/src/component/ImageZoomControl.js +19 -38
- package/dist/es/src/component/JumpToFolio.js +56 -60
- package/dist/es/src/component/Navigation.js +374 -328
- package/dist/es/src/component/Pagination.js +73 -70
- package/dist/es/src/component/Parser.js +11 -32
- package/dist/es/src/component/RingSpinner.js +31 -32
- package/dist/es/src/component/RouteListener.js +30 -21
- package/dist/es/src/component/SeaDragonComponent.js +33 -56
- package/dist/es/src/component/SinglePaneView.js +15 -33
- package/dist/es/src/component/SplitPaneView.js +151 -170
- package/dist/es/src/component/TranscriptionView.js +190 -179
- package/dist/es/src/component/Watermark.js +21 -30
- package/dist/es/src/component/XMLView.js +60 -82
- package/dist/es/src/hooks/useIsWidthUp.js +9 -7
- package/dist/es/src/icons/ByIcon.js +16 -16
- package/dist/es/src/icons/CcIcon.js +16 -16
- package/dist/es/src/icons/NcIcon.js +16 -16
- package/dist/es/src/icons/SaIcon.js +16 -16
- package/dist/es/src/icons/SideMenuIconLeft.js +30 -38
- package/dist/es/src/icons/SideMenuIconRight.js +32 -38
- package/dist/es/src/index.js +21 -20
- package/dist/es/src/lib/copyObject.js +3 -2
- package/dist/es/src/lib/registerServiceWorker.js +77 -54
- package/dist/es/src/model/DocumentHelper.js +7 -6
- package/dist/es/src/model/Folio.js +64 -86
- package/dist/es/src/model/ReduxStore.js +32 -78
- package/dist/es/src/model/folioLayout.js +275 -280
- package/dist/es/src/saga/RouteListenerSaga.js +89 -193
- package/dist/es/src/saga/rootSaga.js +9 -16
- package/dist/es/src/scss/_imageView.scss +1 -1
- package/dist/es/src/scss/_navigation.scss +1 -1
- package/dist/es/src/scss/editioncrafter.scss +1 -1
- package/dist/style.css +1 -0
- package/package.json +36 -51
- package/dist/editioncrafter.min.js +0 -2
- package/dist/editioncrafter.min.js.LICENSE.txt +0 -144
|
@@ -1,194 +1,184 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
setAnno = _useState4[1];
|
|
31
|
-
|
|
32
|
-
// const [onZoomFixed_1, setOnZoomFixed_1] = useState(() => null);
|
|
33
|
-
// const [onZoomFixed_2, setOnZoomFixed_2] = useState(() => null);
|
|
34
|
-
// const [onZoomFixed_3, setOnZoomFixed_3] = useState(() => null);
|
|
35
|
-
// const [onZoomOut, setOnZoomOut] = useState(() => null);
|
|
36
|
-
// const [onZoomIn, setOnZoomIn] = useState(() => null);
|
|
37
|
-
|
|
38
|
-
var location = useLocation();
|
|
39
|
-
var navigate = useNavigate();
|
|
40
|
-
var _useSearchParams = useSearchParams(),
|
|
41
|
-
_useSearchParams2 = _slicedToArray(_useSearchParams, 1),
|
|
42
|
-
searchParams = _useSearchParams2[0];
|
|
43
|
-
var _useState5 = useState(false),
|
|
44
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
45
|
-
loading = _useState6[0],
|
|
46
|
-
setLoading = _useState6[1];
|
|
47
|
-
useEffect(function () {
|
|
1
|
+
import Annotorious from '@recogito/annotorious-openseadragon'
|
|
2
|
+
import OpenSeadragon from 'openseadragon'
|
|
3
|
+
import React, { useEffect, useState } from 'react'
|
|
4
|
+
import { connect } from 'react-redux'
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
createSearchParams,
|
|
8
|
+
useLocation,
|
|
9
|
+
useNavigate,
|
|
10
|
+
useSearchParams,
|
|
11
|
+
} from 'react-router-dom'
|
|
12
|
+
import ImageZoomControl from './ImageZoomControl'
|
|
13
|
+
import Navigation from './Navigation'
|
|
14
|
+
import { BigRingSpinner } from './RingSpinner'
|
|
15
|
+
|
|
16
|
+
import SeaDragonComponent from './SeaDragonComponent'
|
|
17
|
+
import '@recogito/annotorious-openseadragon/dist/annotorious.min.css'
|
|
18
|
+
|
|
19
|
+
function ImageView(props) {
|
|
20
|
+
const [viewer, setViewer] = useState(null)
|
|
21
|
+
const [anno, setAnno] = useState(null)
|
|
22
|
+
|
|
23
|
+
const location = useLocation()
|
|
24
|
+
const navigate = useNavigate()
|
|
25
|
+
|
|
26
|
+
const [searchParams] = useSearchParams()
|
|
27
|
+
const [loading, setLoading] = useState(false)
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
48
30
|
if (anno && searchParams.get('zone')) {
|
|
49
31
|
// TODO: Figure out why annotations are an empty list
|
|
50
32
|
// unless I wait for > 20 ms.
|
|
51
|
-
setTimeout(
|
|
52
|
-
return anno.selectAnnotation(searchParams.get('zone'));
|
|
53
|
-
}, 50);
|
|
33
|
+
setTimeout(() => anno.selectAnnotation(searchParams.get('zone')), 50)
|
|
54
34
|
}
|
|
55
|
-
}, [anno])
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
viewer.viewport.
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
viewer.viewport.
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
35
|
+
}, [anno])
|
|
36
|
+
|
|
37
|
+
const onZoomGrid = (e) => {
|
|
38
|
+
props.documentViewActions.changeTranscriptionType(props.side, 'g')
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const onZoomFixed_1 = (e) => {
|
|
42
|
+
viewer.viewport.zoomTo(viewer.viewport.getMaxZoom())
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const onZoomFixed_2 = (e) => {
|
|
46
|
+
viewer.viewport.zoomTo((viewer.viewport.getMaxZoom() / 2))
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const onZoomFixed_3 = (e) => {
|
|
50
|
+
viewer.viewport.fitVertically()
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const onZoomIn = (e) => {
|
|
54
|
+
viewer.viewport.zoomBy(2)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const onZoomOut = (e) => {
|
|
58
|
+
viewer.viewport.zoomBy(0.5)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
76
62
|
if (anno) {
|
|
77
63
|
// Note: The `on` method does NOT overwrite any previous handlers,
|
|
78
64
|
// it just adds more! Debugging this took forever. Please do not
|
|
79
65
|
// remove the `off` calls because otherwise the `on` callbacks
|
|
80
66
|
// will just stack up forever!
|
|
81
|
-
anno.off('selectAnnotation')
|
|
82
|
-
anno.off('cancelSelected')
|
|
67
|
+
anno.off('selectAnnotation')
|
|
68
|
+
anno.off('cancelSelected')
|
|
83
69
|
|
|
84
70
|
// Another note for future developers: `location.pathname` is CACHED
|
|
85
71
|
// when these callbacks are created. So if you create the callback,
|
|
86
72
|
// changed the route, and then run the callback, it'll run with the
|
|
87
73
|
// old path. So we need to watch the pathname and reset the callbacks
|
|
88
74
|
// every time it changes!
|
|
89
|
-
anno.on('selectAnnotation',
|
|
90
|
-
searchParams.set('zone', annotation.id)
|
|
91
|
-
navigate(
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
75
|
+
anno.on('selectAnnotation', (annotation) => {
|
|
76
|
+
searchParams.set('zone', annotation.id)
|
|
77
|
+
navigate(`${location.pathname}?${createSearchParams(searchParams.toString())}`)
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
anno.on('cancelSelected', () => {
|
|
81
|
+
navigate(location.pathname)
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
}, [location.pathname, anno])
|
|
85
|
+
|
|
86
|
+
const initViewer = async (el, tileSource) => {
|
|
87
|
+
if (!el) {
|
|
88
|
+
setViewer(null)
|
|
89
|
+
setAnno(null)
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
const newViewer = OpenSeadragon({
|
|
93
|
+
element: el,
|
|
94
|
+
showNavigationControl: false,
|
|
95
|
+
zoomPerClick: 2,
|
|
96
|
+
gestureSettingsMouse: {
|
|
97
|
+
clickToZoom: false,
|
|
98
|
+
},
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
setViewer(newViewer)
|
|
102
|
+
|
|
103
|
+
const newAnno = Annotorious(newViewer, {})
|
|
104
|
+
newAnno.disableEditor = true
|
|
105
|
+
newAnno.readOnly = true
|
|
106
|
+
|
|
107
|
+
setAnno(newAnno)
|
|
108
|
+
|
|
109
|
+
newViewer.addTiledImage({
|
|
110
|
+
tileSource,
|
|
111
|
+
})
|
|
96
112
|
}
|
|
97
|
-
}
|
|
98
|
-
var initViewer = function initViewer(_x, _x2) {
|
|
99
|
-
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(el, tileSource) {
|
|
100
|
-
var newViewer, newAnno;
|
|
101
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
102
|
-
while (1) switch (_context.prev = _context.next) {
|
|
103
|
-
case 0:
|
|
104
|
-
if (!el) {
|
|
105
|
-
setViewer(null);
|
|
106
|
-
setAnno(null);
|
|
107
|
-
} else {
|
|
108
|
-
newViewer = OpenSeadragon({
|
|
109
|
-
element: el,
|
|
110
|
-
showNavigationControl: false,
|
|
111
|
-
zoomPerClick: 2,
|
|
112
|
-
gestureSettingsMouse: {
|
|
113
|
-
clickToZoom: false
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
setViewer(newViewer);
|
|
117
|
-
newAnno = Annotorious(newViewer, {});
|
|
118
|
-
newAnno.disableEditor = true;
|
|
119
|
-
newAnno.readOnly = true;
|
|
120
|
-
setAnno(newAnno);
|
|
121
|
-
newViewer.addTiledImage({
|
|
122
|
-
tileSource: tileSource
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
case 1:
|
|
126
|
-
case "end":
|
|
127
|
-
return _context.stop();
|
|
128
|
-
}
|
|
129
|
-
}, _callee);
|
|
130
|
-
}))).apply(this, arguments);
|
|
131
|
-
};
|
|
113
|
+
}
|
|
132
114
|
|
|
133
115
|
// Cleanup callback to destroy the viewer on unmount
|
|
134
|
-
useEffect(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
var folio = props.document.folioIndex[props.folioID];
|
|
116
|
+
useEffect(() => () => {
|
|
117
|
+
if (viewer) {
|
|
118
|
+
viewer.destroy()
|
|
119
|
+
}
|
|
120
|
+
}, [])
|
|
121
|
+
|
|
122
|
+
const { tileSource } = props.document.folioIndex[props.folioID]
|
|
123
|
+
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
const folio = props.document.folioIndex[props.folioID]
|
|
145
126
|
if (folio.loading) {
|
|
146
|
-
setLoading(true)
|
|
127
|
+
setLoading(true)
|
|
147
128
|
}
|
|
148
129
|
if (folio.tileSource && viewer) {
|
|
149
|
-
viewer.open(folio.tileSource)
|
|
130
|
+
viewer.open(folio.tileSource)
|
|
150
131
|
if (folio.annotations && anno) {
|
|
151
|
-
anno.setAnnotations(folio.annotations)
|
|
132
|
+
anno.setAnnotations(folio.annotations)
|
|
152
133
|
}
|
|
153
134
|
}
|
|
154
135
|
if (!folio.loading) {
|
|
155
|
-
setLoading(false)
|
|
136
|
+
setLoading(false)
|
|
156
137
|
}
|
|
157
|
-
}, [anno, viewer, props.folioID, props.document.folioIndex])
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
138
|
+
}, [anno, viewer, props.folioID, props.document.folioIndex])
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<div>
|
|
142
|
+
{ tileSource
|
|
143
|
+
? (
|
|
144
|
+
<div className={`image-view imageViewComponent ${props.side}`} style={{ position: 'relative' }}>
|
|
145
|
+
<Navigation
|
|
146
|
+
side={props.side}
|
|
147
|
+
documentView={props.documentView}
|
|
148
|
+
documentViewActions={props.documentViewActions}
|
|
149
|
+
documentName={props.document.variorum && props.document.folioIndex[props.folioID].doc_id}
|
|
150
|
+
/>
|
|
151
|
+
<ImageZoomControl
|
|
152
|
+
side={props.side}
|
|
153
|
+
documentView={props.documentView}
|
|
154
|
+
onZoomFixed_1={onZoomFixed_1}
|
|
155
|
+
onZoomFixed_2={onZoomFixed_2}
|
|
156
|
+
onZoomFixed_3={onZoomFixed_3}
|
|
157
|
+
onZoomGrid={onZoomGrid}
|
|
158
|
+
onZoomIn={onZoomIn}
|
|
159
|
+
onZoomOut={onZoomOut}
|
|
160
|
+
viewer={viewer}
|
|
161
|
+
/>
|
|
162
|
+
<SeaDragonComponent
|
|
163
|
+
key={props.folioID}
|
|
164
|
+
side={props.side}
|
|
165
|
+
tileSource={tileSource}
|
|
166
|
+
initViewer={initViewer}
|
|
167
|
+
loading={loading}
|
|
168
|
+
/>
|
|
169
|
+
</div>
|
|
170
|
+
)
|
|
171
|
+
: (
|
|
172
|
+
<BigRingSpinner color="dark" delay={300} />
|
|
173
|
+
)}
|
|
174
|
+
</div>
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
|
|
189
178
|
function mapStateToProps(state) {
|
|
190
179
|
return {
|
|
191
|
-
document: state.document
|
|
192
|
-
}
|
|
180
|
+
document: state.document,
|
|
181
|
+
}
|
|
193
182
|
}
|
|
194
|
-
|
|
183
|
+
|
|
184
|
+
export default connect(mapStateToProps)(ImageView)
|
|
@@ -1,38 +1,19 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
className: "zoom-2 fas fa-circle fa-lg"
|
|
21
|
-
})), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("i", {
|
|
22
|
-
title: "Fixed Zoom 3",
|
|
23
|
-
onClick: props.onZoomFixed_3,
|
|
24
|
-
className: "zoom-1 fas fa-circle"
|
|
25
|
-
})), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("i", {
|
|
26
|
-
title: "Zoom Out",
|
|
27
|
-
id: out_id,
|
|
28
|
-
onClick: props.onZoomOut,
|
|
29
|
-
className: "zoom-out fas fa-minus-circle fa-2x"
|
|
30
|
-
})), /*#__PURE__*/React.createElement("li", {
|
|
31
|
-
className: props.documentView.bookMode ? 'disabled' : ''
|
|
32
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
33
|
-
title: "Return to grid mode (not available in book mode)",
|
|
34
|
-
onClick: onZoomGrid,
|
|
35
|
-
className: "zoom-grid fas fa-th fa-2x"
|
|
36
|
-
})));
|
|
37
|
-
};
|
|
38
|
-
export default ImageZoomControl;
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
function ImageZoomControl(props) {
|
|
4
|
+
const in_id = `os-zoom-in ${props.side}`
|
|
5
|
+
const out_id = `os-zoom-out ${props.side}`
|
|
6
|
+
const onZoomGrid = (props.documentView.bookMode ? null : props.onZoomGrid)
|
|
7
|
+
return (
|
|
8
|
+
<ul className="ImageZoomControl">
|
|
9
|
+
<li><i title="Zoom In" id={in_id} onClick={props.onZoomIn} className="zoom-in fas fa-plus-circle fa-2x" /></li>
|
|
10
|
+
<li><i title="Fixed Zoom 1" onClick={props.onZoomFixed_1} className="zoom-3 fas fa-circle fa-2x" /></li>
|
|
11
|
+
<li><i title="Fixed Zoom 2" onClick={props.onZoomFixed_2} className="zoom-2 fas fa-circle fa-lg" /></li>
|
|
12
|
+
<li><i title="Fixed Zoom 3" onClick={props.onZoomFixed_3} className="zoom-1 fas fa-circle" /></li>
|
|
13
|
+
<li><i title="Zoom Out" id={out_id} onClick={props.onZoomOut} className="zoom-out fas fa-minus-circle fa-2x" /></li>
|
|
14
|
+
<li className={props.documentView.bookMode ? 'disabled' : ''}><i title="Return to grid mode (not available in book mode)" onClick={onZoomGrid} className="zoom-grid fas fa-th fa-2x" /></li>
|
|
15
|
+
</ul>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default ImageZoomControl
|
|
@@ -1,69 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
12
|
-
textInput = _useState2[0],
|
|
13
|
-
setTextInput = _useState2[1];
|
|
14
|
-
var open = Boolean(props.anchorEl);
|
|
15
|
-
var id = open ? "".concat(props.side, "_jumpInput") : undefined;
|
|
16
|
-
var handleSubmit = function handleSubmit(event) {
|
|
1
|
+
import { Popover } from '@material-ui/core'
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react'
|
|
3
|
+
|
|
4
|
+
function JumpToFolio(props) {
|
|
5
|
+
const [textInput, setTextInput] = useState('')
|
|
6
|
+
|
|
7
|
+
const open = Boolean(props.anchorEl)
|
|
8
|
+
const id = open ? `${props.side}_jumpInput` : undefined
|
|
9
|
+
|
|
10
|
+
const handleSubmit = (event) => {
|
|
17
11
|
// Consume the event
|
|
18
|
-
event.preventDefault()
|
|
12
|
+
event.preventDefault()
|
|
19
13
|
|
|
20
14
|
// Parse out the target
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const data = new FormData(event.target)
|
|
16
|
+
const folioID = data.get('folioID')
|
|
23
17
|
|
|
24
18
|
// Submit the request
|
|
25
|
-
props.submitHandler(folioID, props.side)
|
|
19
|
+
props.submitHandler(folioID, props.side)
|
|
26
20
|
|
|
27
21
|
// Hide and clear
|
|
28
|
-
props.blurHandler()
|
|
29
|
-
setTextInput('')
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
props.blurHandler()
|
|
23
|
+
setTextInput('')
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const handleChange = (event) => {
|
|
27
|
+
setTextInput(event.target.value)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const inputRef = useRef(null)
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
36
33
|
if (inputRef.current) {
|
|
37
|
-
inputRef.current.focus()
|
|
38
|
-
}
|
|
39
|
-
}, [inputRef, open]);
|
|
40
|
-
var divStyle = {
|
|
41
|
-
position: 'fixed',
|
|
42
|
-
zIndex: 1,
|
|
43
|
-
top: props.positionY,
|
|
44
|
-
left: props.positionX,
|
|
45
|
-
display: open ? 'inline' : 'none'
|
|
46
|
-
};
|
|
47
|
-
return /*#__PURE__*/React.createElement(Popover, {
|
|
48
|
-
id: id,
|
|
49
|
-
open: open,
|
|
50
|
-
anchorEl: props.anchorEl,
|
|
51
|
-
onClose: props.blurHandler,
|
|
52
|
-
anchorOrigin: {
|
|
53
|
-
vertical: 'bottom',
|
|
54
|
-
horizontal: 'right'
|
|
34
|
+
inputRef.current.focus()
|
|
55
35
|
}
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
36
|
+
}, [inputRef, open])
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Popover
|
|
40
|
+
id={id}
|
|
41
|
+
open={open}
|
|
42
|
+
anchorEl={props.anchorEl}
|
|
43
|
+
onClose={props.blurHandler}
|
|
44
|
+
anchorOrigin={{
|
|
45
|
+
vertical: 'bottom',
|
|
46
|
+
horizontal: 'right',
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<form onSubmit={handleSubmit}>
|
|
50
|
+
<input
|
|
51
|
+
id={id}
|
|
52
|
+
name="folioID"
|
|
53
|
+
onBlur={props.blurHandler}
|
|
54
|
+
onChange={handleChange}
|
|
55
|
+
placeholder="Page Name (e.g. '3r')"
|
|
56
|
+
ref={inputRef}
|
|
57
|
+
type="text"
|
|
58
|
+
value={textInput}
|
|
59
|
+
/>
|
|
60
|
+
</form>
|
|
61
|
+
</Popover>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export default JumpToFolio
|