@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,75 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
53
|
-
className: "fa fa-window-close"
|
|
54
|
-
})), /*#__PURE__*/React.createElement(Typography, {
|
|
55
|
-
style: style
|
|
56
|
-
}, content))));
|
|
57
|
-
};
|
|
58
|
-
var style = {
|
|
59
|
-
display: 'inline'
|
|
60
|
-
};
|
|
61
|
-
var asteriskStyle = {
|
|
62
|
-
fontStyle: 'bold',
|
|
63
|
-
fontSize: '18pt',
|
|
64
|
-
color: 'red'
|
|
65
|
-
};
|
|
66
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
67
|
-
style: style
|
|
68
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
69
|
-
onClick: function onClick(e) {
|
|
70
|
-
return onOpen(e);
|
|
71
|
-
},
|
|
72
|
-
style: asteriskStyle
|
|
73
|
-
}, "*"), renderPopper());
|
|
74
|
-
};
|
|
75
|
-
export default EditorComment;
|
|
1
|
+
import Fade from '@material-ui/core/Fade'
|
|
2
|
+
import Paper from '@material-ui/core/Paper'
|
|
3
|
+
import Popper from '@material-ui/core/Popper'
|
|
4
|
+
import Typography from '@material-ui/core/Typography'
|
|
5
|
+
import Parser from 'html-react-parser'
|
|
6
|
+
import React, { useState } from 'react'
|
|
7
|
+
|
|
8
|
+
function EditorComment(props) {
|
|
9
|
+
const [anchorRef, setAnchorRef] = useState(null)
|
|
10
|
+
const [open, setOpen] = useState(false)
|
|
11
|
+
|
|
12
|
+
const onOpen = (event) => {
|
|
13
|
+
setAnchorRef(event.currentTarget)
|
|
14
|
+
setOpen(true)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const onClose = (event) => {
|
|
18
|
+
setOpen(false)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const renderPopper = () => {
|
|
22
|
+
const interpreted = Parser(props.text)
|
|
23
|
+
const content = interpreted || `ERROR: Could not find comment for id: ${props.commentID}.`
|
|
24
|
+
const style = { maxWidth: 200, padding: '25px 15px 15px 15px' }
|
|
25
|
+
const closeXStyle = { float: 'right', padding: 5, fontStyle: 'bold' }
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Popper id={props.commentID} open={open} anchorEl={anchorRef}>
|
|
29
|
+
<Fade in={open}>
|
|
30
|
+
<Paper className="editor-comment-content">
|
|
31
|
+
<div onClick={onClose} style={closeXStyle}>
|
|
32
|
+
<span className="fa fa-window-close" />
|
|
33
|
+
</div>
|
|
34
|
+
<Typography style={style}>{content}</Typography>
|
|
35
|
+
</Paper>
|
|
36
|
+
</Fade>
|
|
37
|
+
</Popper>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const style = { display: 'inline' }
|
|
42
|
+
const asteriskStyle = { fontStyle: 'bold', fontSize: '18pt', color: 'red' }
|
|
43
|
+
return (
|
|
44
|
+
<div style={style}>
|
|
45
|
+
<span onClick={e => onOpen(e)} style={asteriskStyle}>*</span>
|
|
46
|
+
{renderPopper()}
|
|
47
|
+
</div>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default EditorComment
|
|
@@ -1,63 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
8
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
10
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
13
|
-
import React, { Component } from 'react';
|
|
14
|
-
var CommentErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
15
|
-
_inherits(CommentErrorBoundary, _Component);
|
|
16
|
-
var _super = _createSuper(CommentErrorBoundary);
|
|
17
|
-
function CommentErrorBoundary(props) {
|
|
18
|
-
var _this;
|
|
19
|
-
_classCallCheck(this, CommentErrorBoundary);
|
|
20
|
-
_this = _super.call(this, props);
|
|
21
|
-
_this.state = {
|
|
22
|
-
error: null,
|
|
23
|
-
errorInfo: null
|
|
24
|
-
};
|
|
25
|
-
return _this;
|
|
1
|
+
import React, { Component } from 'react'
|
|
2
|
+
|
|
3
|
+
export default class CommentErrorBoundary extends Component {
|
|
4
|
+
constructor(props) {
|
|
5
|
+
super(props)
|
|
6
|
+
this.state = { error: null, errorInfo: null }
|
|
26
7
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
style:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// Update state so the next render will show the fallback UI.
|
|
56
|
-
return {
|
|
57
|
-
error: true
|
|
58
|
-
};
|
|
8
|
+
|
|
9
|
+
static getDerivedStateFromError(error) {
|
|
10
|
+
// Update state so the next render will show the fallback UI.
|
|
11
|
+
return { error: true }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
componentDidCatch(error, errorInfo) {
|
|
15
|
+
this.setState({
|
|
16
|
+
error,
|
|
17
|
+
errorInfo,
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
render() {
|
|
22
|
+
if (this.state.errorInfo) {
|
|
23
|
+
return (
|
|
24
|
+
<div style={{ height: '350px', overflowY: 'scroll' }}>
|
|
25
|
+
<h2>Something went wrong.</h2>
|
|
26
|
+
<details style={{ whiteSpace: 'pre-wrap' }}>
|
|
27
|
+
There has been an error rendering a comment
|
|
28
|
+
<br />
|
|
29
|
+
|
|
30
|
+
{this.state.error && this.state.error.toString()}
|
|
31
|
+
<br />
|
|
32
|
+
{this.state.errorInfo.componentStack}
|
|
33
|
+
</details>
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
59
36
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
export { CommentErrorBoundary as default };
|
|
37
|
+
return this.props.children
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var img = _ref.img,
|
|
13
|
-
onClose = _ref.onClose,
|
|
14
|
-
open = _ref.open;
|
|
15
|
-
var handleClose = function handleClose() {
|
|
16
|
-
onClose();
|
|
17
|
-
};
|
|
18
|
-
var closeButtonBackground = {
|
|
1
|
+
import Dialog from '@material-ui/core/Dialog'
|
|
2
|
+
import IconButton from '@material-ui/core/IconButton'
|
|
3
|
+
import CloseIcon from '@material-ui/icons/Cancel'
|
|
4
|
+
import React from 'react'
|
|
5
|
+
|
|
6
|
+
function FigureDialog({ img, onClose, open }) {
|
|
7
|
+
const handleClose = () => {
|
|
8
|
+
onClose()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const closeButtonBackground = {
|
|
19
12
|
position: 'absolute',
|
|
20
13
|
right: 0,
|
|
21
14
|
width: 50,
|
|
@@ -23,52 +16,48 @@ var FigureDialog = function FigureDialog(_ref) {
|
|
|
23
16
|
display: 'flex',
|
|
24
17
|
justifyContent: 'center',
|
|
25
18
|
backgroundColor: 'rgb(0,0,0,0.2)',
|
|
26
|
-
borderRadius: '0 0 0 50%'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
setOpen
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
img: img
|
|
72
|
-
}));
|
|
73
|
-
};
|
|
74
|
-
export default FigureImage;
|
|
19
|
+
borderRadius: '0 0 0 50%',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Dialog
|
|
24
|
+
onClose={handleClose}
|
|
25
|
+
open={open}
|
|
26
|
+
PaperProps={{ style: { maxWidth: '90%', maxHeight: '80%' } }}
|
|
27
|
+
>
|
|
28
|
+
<div className="figure-dialog-img-container" style={{ overflowY: 'scroll' }}>
|
|
29
|
+
{img}
|
|
30
|
+
</div>
|
|
31
|
+
<div style={closeButtonBackground}>
|
|
32
|
+
<IconButton style={{ color: 'white', position: 'absolute' }} onClick={handleClose}>
|
|
33
|
+
<CloseIcon />
|
|
34
|
+
</IconButton>
|
|
35
|
+
</div>
|
|
36
|
+
</Dialog>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
FigureDialog.propTypes = {
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function FigureImage({ img }) {
|
|
44
|
+
const [open, setOpen] = React.useState(false)
|
|
45
|
+
|
|
46
|
+
const handleClickOpen = () => {
|
|
47
|
+
setOpen(true)
|
|
48
|
+
}
|
|
49
|
+
const handleClose = (value) => {
|
|
50
|
+
setOpen(false)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className="figure-image-container">
|
|
55
|
+
<div onClick={handleClickOpen}>
|
|
56
|
+
{img}
|
|
57
|
+
</div>
|
|
58
|
+
<FigureDialog open={open} onClose={handleClose} img={img} />
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default FigureImage
|