@cu-mkp/editioncrafter 1.0.3 → 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 +68 -146
- 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 -203
- 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 -50
- package/dist/editioncrafter.min.js +0 -2
- package/dist/editioncrafter.min.js.LICENSE.txt +0 -144
|
@@ -1,67 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _super = _createSuper(AlphabetLinks);
|
|
19
|
-
function AlphabetLinks() {
|
|
20
|
-
_classCallCheck(this, AlphabetLinks);
|
|
21
|
-
return _super.apply(this, arguments);
|
|
22
|
-
}
|
|
23
|
-
_createClass(AlphabetLinks, [{
|
|
24
|
-
key: "renderAlphaLinks",
|
|
25
|
-
value: function renderAlphaLinks() {
|
|
26
|
-
var letterLinks = [];
|
|
27
|
-
for (var i = 0; i < alpha.length; i++) {
|
|
28
|
-
var letter = alpha[i];
|
|
29
|
-
var alphaID = "alpha-".concat(i);
|
|
30
|
-
letterLinks.push( /*#__PURE__*/React.createElement("span", {
|
|
31
|
-
key: "link-".concat(alphaID)
|
|
32
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
|
33
|
-
to: alphaID,
|
|
34
|
-
offset: -120,
|
|
35
|
-
containerId: "glossaryViewInner",
|
|
36
|
-
smooth: "true"
|
|
37
|
-
}, letter), ' '));
|
|
38
|
-
}
|
|
39
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
-
style: {
|
|
41
|
-
display: 'inline'
|
|
42
|
-
}
|
|
43
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
44
|
-
id: "glossary-filter",
|
|
45
|
-
className: "searchBox",
|
|
46
|
-
placeholder: "Filter by Entry",
|
|
47
|
-
onChange: this.props.onFilterChange,
|
|
48
|
-
value: this.props.filterTerm
|
|
49
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
50
|
-
className: "alphaNav"
|
|
51
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
52
|
-
style: {
|
|
53
|
-
color: 'black'
|
|
54
|
-
}
|
|
55
|
-
}, "Go to: "), letterLinks));
|
|
56
|
-
}
|
|
57
|
-
}, {
|
|
58
|
-
key: "render",
|
|
59
|
-
value: function render() {
|
|
60
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
className: "glossaryNav"
|
|
62
|
-
}, this.renderAlphaLinks());
|
|
1
|
+
import React, { Component } from 'react'
|
|
2
|
+
import { Link } from 'react-scroll'
|
|
3
|
+
|
|
4
|
+
export const alpha = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'Z']
|
|
5
|
+
|
|
6
|
+
export default class AlphabetLinks extends Component {
|
|
7
|
+
renderAlphaLinks() {
|
|
8
|
+
const letterLinks = []
|
|
9
|
+
for (let i = 0; i < alpha.length; i++) {
|
|
10
|
+
const letter = alpha[i]
|
|
11
|
+
const alphaID = `alpha-${i}`
|
|
12
|
+
letterLinks.push(
|
|
13
|
+
<span key={`link-${alphaID}`}>
|
|
14
|
+
<Link to={alphaID} offset={-120} containerId="glossaryViewInner" smooth="true">{letter}</Link>
|
|
15
|
+
{' '}
|
|
16
|
+
</span>,
|
|
17
|
+
)
|
|
63
18
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div style={{ display: 'inline' }}>
|
|
22
|
+
<input
|
|
23
|
+
id="glossary-filter"
|
|
24
|
+
className="searchBox"
|
|
25
|
+
placeholder="Filter by Entry"
|
|
26
|
+
onChange={this.props.onFilterChange}
|
|
27
|
+
value={this.props.filterTerm}
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
<div className="alphaNav">
|
|
31
|
+
<span style={{ color: 'black' }}>Go to: </span>
|
|
32
|
+
{ letterLinks }
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
render() {
|
|
39
|
+
return (
|
|
40
|
+
<div className="glossaryNav">
|
|
41
|
+
{ this.renderAlphaLinks() }
|
|
42
|
+
</div>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,165 +1,156 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
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 from 'react';
|
|
14
|
-
import { withStyles } from '@material-ui/core/styles';
|
|
15
|
-
import Tooltip from '@material-ui/core/Tooltip';
|
|
1
|
+
import { withStyles } from '@material-ui/core/styles'
|
|
2
|
+
import Tooltip from '@material-ui/core/Tooltip'
|
|
3
|
+
import PropTypes from 'prop-types'
|
|
4
|
+
import React from 'react'
|
|
5
|
+
|
|
16
6
|
function arrowGenerator(color) {
|
|
17
7
|
return {
|
|
18
8
|
'&[x-placement*="bottom"] $arrow': {
|
|
19
|
-
top: 0,
|
|
20
|
-
left: 0,
|
|
21
|
-
marginTop: '-0.95em',
|
|
22
|
-
width: '3em',
|
|
23
|
-
height: '1em',
|
|
9
|
+
'top': 0,
|
|
10
|
+
'left': 0,
|
|
11
|
+
'marginTop': '-0.95em',
|
|
12
|
+
'width': '3em',
|
|
13
|
+
'height': '1em',
|
|
24
14
|
'&::before': {
|
|
25
15
|
borderWidth: '0 1em 1em 1em',
|
|
26
|
-
borderColor:
|
|
27
|
-
}
|
|
16
|
+
borderColor: `transparent transparent ${color} transparent`,
|
|
17
|
+
},
|
|
28
18
|
},
|
|
29
19
|
'&[x-placement*="top"] $arrow': {
|
|
30
|
-
bottom: 0,
|
|
31
|
-
left: 0,
|
|
32
|
-
marginBottom: '-0.95em',
|
|
33
|
-
width: '3em',
|
|
34
|
-
height: '1em',
|
|
20
|
+
'bottom': 0,
|
|
21
|
+
'left': 0,
|
|
22
|
+
'marginBottom': '-0.95em',
|
|
23
|
+
'width': '3em',
|
|
24
|
+
'height': '1em',
|
|
35
25
|
'&::before': {
|
|
36
26
|
borderWidth: '1em 1em 0 1em',
|
|
37
|
-
borderColor:
|
|
38
|
-
}
|
|
27
|
+
borderColor: `${color} transparent transparent transparent`,
|
|
28
|
+
},
|
|
39
29
|
},
|
|
40
30
|
'&[x-placement*="right"] $arrow': {
|
|
41
|
-
left: 0,
|
|
42
|
-
marginLeft: '-0.95em',
|
|
43
|
-
height: '3em',
|
|
44
|
-
width: '1em',
|
|
31
|
+
'left': 0,
|
|
32
|
+
'marginLeft': '-0.95em',
|
|
33
|
+
'height': '3em',
|
|
34
|
+
'width': '1em',
|
|
45
35
|
'&::before': {
|
|
46
36
|
borderWidth: '1em 1em 1em 0',
|
|
47
|
-
borderColor:
|
|
48
|
-
}
|
|
37
|
+
borderColor: `transparent ${color} transparent transparent`,
|
|
38
|
+
},
|
|
49
39
|
},
|
|
50
40
|
'&[x-placement*="left"] $arrow': {
|
|
51
|
-
right: 0,
|
|
52
|
-
marginRight: '-0.95em',
|
|
53
|
-
height: '3em',
|
|
54
|
-
width: '1em',
|
|
41
|
+
'right': 0,
|
|
42
|
+
'marginRight': '-0.95em',
|
|
43
|
+
'height': '3em',
|
|
44
|
+
'width': '1em',
|
|
55
45
|
'&::before': {
|
|
56
46
|
borderWidth: '1em 0 1em 1em',
|
|
57
|
-
borderColor:
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
47
|
+
borderColor: `transparent transparent transparent ${color}`,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
}
|
|
61
51
|
}
|
|
62
|
-
|
|
52
|
+
|
|
53
|
+
function styles(theme) {
|
|
63
54
|
return {
|
|
64
55
|
button: {
|
|
65
|
-
margin: theme.spacing()
|
|
56
|
+
margin: theme.spacing(),
|
|
66
57
|
},
|
|
67
58
|
lightTooltip: {
|
|
68
59
|
backgroundColor: theme.palette.common.white,
|
|
69
60
|
color: 'rgba(0, 0, 0, 0.87)',
|
|
70
61
|
boxShadow: theme.shadows[1],
|
|
71
|
-
fontSize: 11
|
|
62
|
+
fontSize: 11,
|
|
72
63
|
},
|
|
73
64
|
arrowPopper: arrowGenerator(theme.palette.grey[700]),
|
|
74
65
|
arrow: {
|
|
75
|
-
position: 'absolute',
|
|
76
|
-
fontSize: 6,
|
|
77
|
-
width: '3em',
|
|
78
|
-
height: '3em',
|
|
66
|
+
'position': 'absolute',
|
|
67
|
+
'fontSize': 6,
|
|
68
|
+
'width': '3em',
|
|
69
|
+
'height': '3em',
|
|
79
70
|
'&::before': {
|
|
80
71
|
content: '""',
|
|
81
72
|
margin: 'auto',
|
|
82
73
|
display: 'block',
|
|
83
74
|
width: 0,
|
|
84
75
|
height: 0,
|
|
85
|
-
borderStyle: 'solid'
|
|
86
|
-
}
|
|
76
|
+
borderStyle: 'solid',
|
|
77
|
+
},
|
|
87
78
|
},
|
|
88
79
|
bootstrapPopper: arrowGenerator(theme.palette.common.black),
|
|
89
80
|
bootstrapTooltip: {
|
|
90
|
-
backgroundColor: theme.palette.common.black
|
|
81
|
+
backgroundColor: theme.palette.common.black,
|
|
91
82
|
},
|
|
92
83
|
bootstrapPlacementLeft: {
|
|
93
|
-
margin: '0 8px'
|
|
84
|
+
margin: '0 8px',
|
|
94
85
|
},
|
|
95
86
|
bootstrapPlacementRight: {
|
|
96
|
-
margin: '0 8px'
|
|
87
|
+
margin: '0 8px',
|
|
97
88
|
},
|
|
98
89
|
bootstrapPlacementTop: {
|
|
99
|
-
margin: '8px 0'
|
|
90
|
+
margin: '8px 0',
|
|
100
91
|
},
|
|
101
92
|
bootstrapPlacementBottom: {
|
|
102
|
-
margin: '8px 0'
|
|
93
|
+
margin: '8px 0',
|
|
103
94
|
},
|
|
104
95
|
htmlPopper: arrowGenerator('#dadde9'),
|
|
105
96
|
htmlTooltip: {
|
|
106
|
-
backgroundColor: '#f5f5f9',
|
|
107
|
-
color: 'rgba(0, 0, 0, 0.87)',
|
|
108
|
-
maxWidth: 220,
|
|
109
|
-
fontSize: theme.typography.pxToRem(12),
|
|
110
|
-
border: '1px solid #dadde9',
|
|
97
|
+
'backgroundColor': '#f5f5f9',
|
|
98
|
+
'color': 'rgba(0, 0, 0, 0.87)',
|
|
99
|
+
'maxWidth': 220,
|
|
100
|
+
'fontSize': theme.typography.pxToRem(12),
|
|
101
|
+
'border': '1px solid #dadde9',
|
|
111
102
|
'& b': {
|
|
112
|
-
fontWeight: theme.typography.fontWeightMedium
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
_this.state = {
|
|
128
|
-
arrowRef: null
|
|
129
|
-
};
|
|
130
|
-
_this.handleArrowRef = function (node) {
|
|
131
|
-
_this.setState({
|
|
132
|
-
arrowRef: node
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
return _this;
|
|
103
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
class CustomizedTooltips extends React.Component {
|
|
110
|
+
state = {
|
|
111
|
+
arrowRef: null,
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
handleArrowRef = (node) => {
|
|
115
|
+
this.setState({
|
|
116
|
+
arrowRef: node,
|
|
117
|
+
})
|
|
136
118
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
119
|
+
|
|
120
|
+
render() {
|
|
121
|
+
const { classes } = this.props
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<Tooltip
|
|
125
|
+
classes={{
|
|
143
126
|
popper: classes.htmlPopper,
|
|
144
|
-
tooltip: classes.htmlTooltip
|
|
145
|
-
}
|
|
146
|
-
PopperProps
|
|
127
|
+
tooltip: classes.htmlTooltip,
|
|
128
|
+
}}
|
|
129
|
+
PopperProps={{
|
|
147
130
|
popperOptions: {
|
|
148
131
|
modifiers: {
|
|
149
132
|
arrow: {
|
|
150
133
|
enabled: Boolean(this.state.arrowRef),
|
|
151
|
-
element: this.state.arrowRef
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
title
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
134
|
+
element: this.state.arrowRef,
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
}}
|
|
139
|
+
title={(
|
|
140
|
+
<>
|
|
141
|
+
{ this.props.htmlFragment }
|
|
142
|
+
<span className={classes.arrow} ref={this.handleArrowRef} />
|
|
143
|
+
</>
|
|
144
|
+
)}
|
|
145
|
+
>
|
|
146
|
+
{ this.props.inner }
|
|
147
|
+
</Tooltip>
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
CustomizedTooltips.propTypes = {
|
|
153
|
+
classes: PropTypes.object.isRequired,
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export default withStyles(styles)(CustomizedTooltips)
|
|
@@ -1,98 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import DocumentView from './DocumentView'
|
|
13
|
-
import RouteListener from './RouteListener'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
window.scrollTo(0, 0);
|
|
28
|
-
});
|
|
29
|
-
}, []);
|
|
30
|
-
useEffect(function () {
|
|
1
|
+
import withWidth from '@material-ui/core/withWidth'
|
|
2
|
+
import { createBrowserHistory } from 'history'
|
|
3
|
+
import PropTypes from 'prop-types'
|
|
4
|
+
import React, { useEffect, useRef, useState } from 'react'
|
|
5
|
+
import { connect, Provider } from 'react-redux'
|
|
6
|
+
import {
|
|
7
|
+
HashRouter,
|
|
8
|
+
Navigate,
|
|
9
|
+
Route,
|
|
10
|
+
Routes,
|
|
11
|
+
} from 'react-router-dom'
|
|
12
|
+
import DocumentView from './DocumentView'
|
|
13
|
+
import RouteListener from './RouteListener'
|
|
14
|
+
|
|
15
|
+
function DiploMatic(props) {
|
|
16
|
+
const [containerWidth, setContainerWidth] = useState(0)
|
|
17
|
+
const [containerHeight, setContainerHeight] = useState('min(100%, 100dvh')
|
|
18
|
+
const containerRef = useRef(null)
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const history = createBrowserHistory()
|
|
21
|
+
history.listen(() => {
|
|
22
|
+
window.scrollTo(0, 0)
|
|
23
|
+
})
|
|
24
|
+
}, [])
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
31
27
|
if (containerRef.current) {
|
|
32
|
-
setContainerWidth(containerRef.current.offsetWidth)
|
|
33
|
-
if (containerRef.current.clientHeight
|
|
34
|
-
setContainerHeight('100dvh')
|
|
28
|
+
setContainerWidth(containerRef.current.offsetWidth)
|
|
29
|
+
if (containerRef.current.clientHeight === 0) {
|
|
30
|
+
setContainerHeight('100dvh')
|
|
35
31
|
}
|
|
36
32
|
}
|
|
37
|
-
}, [containerRef])
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
element: /*#__PURE__*/React.createElement(DocumentView, Object.assign({}, props, {
|
|
69
|
-
containerWidth: containerWidth
|
|
70
|
-
})),
|
|
71
|
-
exact: true
|
|
72
|
-
}), /*#__PURE__*/React.createElement(Route, {
|
|
73
|
-
path: "/ec/:folioID",
|
|
74
|
-
element: /*#__PURE__*/React.createElement(DocumentView, Object.assign({}, props, {
|
|
75
|
-
containerWidth: containerWidth
|
|
76
|
-
})),
|
|
77
|
-
exact: true
|
|
78
|
-
}), /*#__PURE__*/React.createElement(Route, {
|
|
79
|
-
path: "/ec",
|
|
80
|
-
element: /*#__PURE__*/React.createElement(DocumentView, Object.assign({}, props, {
|
|
81
|
-
containerWidth: containerWidth
|
|
82
|
-
})),
|
|
83
|
-
exact: true
|
|
84
|
-
}), /*#__PURE__*/React.createElement(Route, {
|
|
85
|
-
path: "/",
|
|
86
|
-
element: /*#__PURE__*/React.createElement(Navigate, {
|
|
87
|
-
to: "/ec"
|
|
88
|
-
}),
|
|
89
|
-
exact: true
|
|
90
|
-
}))))));
|
|
91
|
-
};
|
|
33
|
+
}, [containerRef])
|
|
34
|
+
|
|
35
|
+
const { fixedFrameMode } = props.diplomatic
|
|
36
|
+
const fixedFrameModeClass = fixedFrameMode ? 'editioncrafter' : 'editioncrafter sticky'
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Provider store={props.store}>
|
|
40
|
+
<HashRouter>
|
|
41
|
+
<div id="diplomatic" className={fixedFrameModeClass} ref={containerRef} style={{ height: containerHeight }}>
|
|
42
|
+
<RouteListener />
|
|
43
|
+
<div id="content" style={{ height: '100%' }}>
|
|
44
|
+
<Routes>
|
|
45
|
+
<Route path="/ec/:folioID/:transcriptionType/:folioID2/:transcriptionType2/:folioID3/:transcriptionType3" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
|
|
46
|
+
<Route path="/ec/:folioID/:transcriptionType/:folioID2/:transcriptionType2" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
|
|
47
|
+
<Route path="/ec/:folioID/:transcriptionType" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
|
|
48
|
+
<Route path="/ec/:folioID" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
|
|
49
|
+
<Route path="/ec" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
|
|
50
|
+
<Route path="/" element={<Navigate to="/ec" />} exact />
|
|
51
|
+
</Routes>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</HashRouter>
|
|
55
|
+
</Provider>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
DiploMatic.propTypes = {
|
|
60
|
+
store: PropTypes.isRequired,
|
|
61
|
+
config: PropTypes.isRequired,
|
|
62
|
+
}
|
|
63
|
+
|
|
92
64
|
function mapStateToProps(state) {
|
|
93
65
|
return {
|
|
94
66
|
diplomatic: state.diplomatic,
|
|
95
|
-
documentView: state.documentView
|
|
96
|
-
}
|
|
67
|
+
documentView: state.documentView,
|
|
68
|
+
}
|
|
97
69
|
}
|
|
98
|
-
|
|
70
|
+
|
|
71
|
+
export default withWidth()(connect(mapStateToProps)(DiploMatic))
|