@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,159 +1,167 @@
1
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
2
- 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); }
3
- 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; }
4
- 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; }
5
- 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; }
6
- 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; }
7
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
11
- 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); }
12
- 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); }
13
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
- 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); }; }
15
- 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); }
16
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
17
- 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; } }
18
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
19
- import React, { Component } from 'react';
20
- import { connect } from 'react-redux';
21
- import { Typography } from '@material-ui/core';
22
- import Parser from 'html-react-parser';
23
- import Navigation from './Navigation';
24
- import { alpha } from './AlphabetLinks';
25
- import Markdown from 'react-markdown';
26
- var GlossaryView = /*#__PURE__*/function (_Component) {
27
- _inherits(GlossaryView, _Component);
28
- var _super = _createSuper(GlossaryView);
29
- function GlossaryView() {
30
- var _this;
31
- _classCallCheck(this, GlossaryView);
32
- _this = _super.call(this);
33
- _this.onFilterChange = function (event) {
34
- var filterTerm = event.target.value;
35
- _this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
36
- filterTerm: filterTerm
37
- }));
38
- };
39
- _this.state = {
40
- filterTerm: ''
41
- };
42
- return _this;
1
+ import { Typography } from '@material-ui/core'
2
+ import Parser from 'html-react-parser'
3
+ import React, { Component } from 'react'
4
+ import Markdown from 'react-markdown'
5
+ import { connect } from 'react-redux'
6
+ import { alpha } from './AlphabetLinks'
7
+ import Navigation from './Navigation'
8
+
9
+ class GlossaryView extends Component {
10
+ constructor() {
11
+ super()
12
+ this.state = { filterTerm: '' }
43
13
  }
44
- _createClass(GlossaryView, [{
45
- key: "renderGlossary",
46
- value: function renderGlossary() {
47
- var glossary = this.props.glossary.glossary;
48
- var filterTerm = this.state.filterTerm.toLowerCase();
49
- var entryList = Object.values(glossary.entries);
50
- var checkHeadwords = function checkHeadwords(headword, term, delimiter) {
51
- var words = headword.split(delimiter);
52
- var _iterator = _createForOfIteratorHelper(words),
53
- _step;
54
- try {
55
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
56
- var word = _step.value;
57
- if (word.startsWith(term)) return true;
58
- }
59
- } catch (err) {
60
- _iterator.e(err);
61
- } finally {
62
- _iterator.f();
63
- }
64
- return false;
65
- };
66
-
67
- // {head-word}, {alternate-spelling}: {meaning-number}. {part-of-speech} {meaning} [{references}]
68
- var glossaryEntries = [];
69
- var alphaIndex = 0;
70
- for (var _i = 0, _entryList = entryList; _i < _entryList.length; _i++) {
71
- var entry = _entryList[_i];
72
- // render alphabetic header if we have started the next letter
73
- if (filterTerm.length === 0 && entry.headWord[0] === alpha[alphaIndex]) {
74
- var alphaHeadingID = "alpha-".concat(alphaIndex);
75
- glossaryEntries.push( /*#__PURE__*/React.createElement(Typography, {
76
- variant: "h4",
77
- key: "gloss-heading-".concat(alpha[alphaIndex]),
78
- id: alphaHeadingID
79
- }, "\u2014", alpha[alphaIndex], ' ', "\u2014"));
80
- alphaIndex++;
81
- }
82
- var lowerCaseHeadword = entry.headWord.toLowerCase();
83
- var lowerCaseAltSpellings = entry.alternateSpellings.toLowerCase();
84
- var lowerCaseModSpellings = entry.modernSpelling.toLowerCase();
85
- if (filterTerm.length === 0 || filterTerm.length !== 0 && checkHeadwords(lowerCaseHeadword, filterTerm, ' ') || filterTerm.length !== 0 && checkHeadwords(lowerCaseModSpellings, filterTerm, ' ') || filterTerm.length !== 0 && checkHeadwords(lowerCaseAltSpellings, filterTerm, ', ')) {
86
- var meanings = renderMeanings(entry);
87
- var meaningsEndWithPeriod = meanings[meanings.length - 1].endsWith('.');
88
- var altString = entry.alternateSpellings ? ", ".concat(entry.alternateSpellings) : '';
89
- var pos = entry.meanings[0].partOfSpeech;
90
- var partOfSpeech = pos ? "".concat(pos, ":") : '';
91
- var modPunctuation = pos ? ',' : ':';
92
- var modString = entry.modernSpelling ? " (mod. ".concat(entry.modernSpelling, ")") : '';
93
- var comma = meaningsEndWithPeriod ? '' : ',';
94
- var seeAlso = entry.seeAlso ? "".concat(comma, " see also <span>&#8594;</span>").concat(entry.seeAlso, " ") : '';
95
- var synonym = entry.synonym ? ", syn. <span>&#8594;</span>".concat(entry.synonym) : '';
96
- var antonym = entry.antonym ? ", ant. <span>&#8594;</span>".concat(entry.antonym) : '';
97
- glossaryEntries.push( /*#__PURE__*/React.createElement(Typography, {
98
- gutterBottom: true,
99
- key: "gloss-".concat(entry.headWord)
100
- }, /*#__PURE__*/React.createElement("u", null, entry.headWord), altString, modString, modPunctuation, ' ', partOfSpeech, ' ', meanings.map(function (meaningful) {
101
- return Parser(meaningful);
102
- }), Parser(seeAlso), Parser(synonym), Parser(antonym)));
103
- }
14
+
15
+ renderGlossary() {
16
+ const { glossary } = this.props.glossary
17
+ const filterTerm = this.state.filterTerm.toLowerCase()
18
+ const entryList = Object.values(glossary.entries)
19
+
20
+ const checkHeadwords = (headword, term, delimiter) => {
21
+ const words = headword.split(delimiter)
22
+ for (const word of words) {
23
+ if (word.startsWith(term))
24
+ return true
104
25
  }
105
- return glossaryEntries;
26
+ return false
106
27
  }
107
- }, {
108
- key: "render",
109
- value: function render() {
110
- if (!this.props.glossary.loaded) return null;
111
- return /*#__PURE__*/React.createElement("div", {
112
- id: "glossaryView",
113
- style: {
114
- position: "relative",
115
- overflow: "auto"
116
- }
117
- }, /*#__PURE__*/React.createElement(Navigation, {
118
- side: this.props.side,
119
- onFilterChange: this.onFilterChange,
120
- value: this.state.filterTerm,
121
- documentView: this.props.documentView,
122
- documentViewActions: this.props.documentViewActions
123
- }), /*#__PURE__*/React.createElement("div", {
124
- id: "glossaryViewInner"
125
- }, /*#__PURE__*/React.createElement("div", {
126
- id: "glossaryContent"
127
- }, /*#__PURE__*/React.createElement(Typography, {
128
- variant: "h2",
129
- className: "title"
130
- }, "Glossary"), this.props.glossary.glossary.title && /*#__PURE__*/React.createElement("div", {
131
- className: "subtitle MuiTypography-root MuiTypography-body1"
132
- }, /*#__PURE__*/React.createElement(Markdown, null, this.props.glossary.glossary.title)), /*#__PURE__*/React.createElement("div", {
133
- className: "cite-instructions"
134
- }, this.props.glossary.glossary.citation && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
135
- className: "cite-header"
136
- }, "How to Cite"), /*#__PURE__*/React.createElement("div", {
137
- className: "MuiTypography-root MuiTypography-body1"
138
- }, /*#__PURE__*/React.createElement(Markdown, null, this.props.glossary.glossary.citation)))), this.renderGlossary())));
28
+
29
+ // {head-word}, {alternate-spelling}: {meaning-number}. {part-of-speech} {meaning} [{references}]
30
+ const glossaryEntries = []
31
+ let alphaIndex = 0
32
+
33
+ for (const entry of entryList) {
34
+ // render alphabetic header if we have started the next letter
35
+ if (filterTerm.length === 0 && entry.headWord[0] === alpha[alphaIndex]) {
36
+ const alphaHeadingID = `alpha-${alphaIndex}`
37
+ glossaryEntries.push(
38
+ <Typography variant="h4" key={`gloss-heading-${alpha[alphaIndex]}`} id={alphaHeadingID}>
39
+ &mdash;
40
+ {alpha[alphaIndex]}
41
+ {' '}
42
+ &mdash;
43
+ </Typography>,
44
+ )
45
+ alphaIndex++
46
+ }
47
+ const lowerCaseHeadword = entry.headWord.toLowerCase()
48
+
49
+ const lowerCaseAltSpellings = entry.alternateSpellings.toLowerCase()
50
+ const lowerCaseModSpellings = entry.modernSpelling.toLowerCase()
51
+ if (filterTerm.length === 0
52
+ || (filterTerm.length !== 0 && checkHeadwords(lowerCaseHeadword, filterTerm, ' '))
53
+ || (filterTerm.length !== 0 && checkHeadwords(lowerCaseModSpellings, filterTerm, ' '))
54
+ || (filterTerm.length !== 0 && checkHeadwords(lowerCaseAltSpellings, filterTerm, ', '))
55
+ ) {
56
+ const meanings = renderMeanings(entry)
57
+ const meaningsEndWithPeriod = meanings[meanings.length - 1].endsWith('.')
58
+ const altString = entry.alternateSpellings ? `, ${entry.alternateSpellings}` : ''
59
+ const pos = entry.meanings[0].partOfSpeech
60
+ const partOfSpeech = pos ? `${pos}:` : ''
61
+ const modPunctuation = pos ? ',' : ':'
62
+ const modString = entry.modernSpelling ? ` (mod. ${entry.modernSpelling})` : ''
63
+ const comma = meaningsEndWithPeriod ? '' : ','
64
+ const seeAlso = entry.seeAlso ? `${comma} see also <span>&#8594;</span>${entry.seeAlso} ` : ''
65
+ const synonym = entry.synonym ? `, syn. <span>&#8594;</span>${entry.synonym}` : ''
66
+ const antonym = entry.antonym ? `, ant. <span>&#8594;</span>${entry.antonym}` : ''
67
+ glossaryEntries.push(
68
+ <Typography gutterBottom key={`gloss-${entry.headWord}`}>
69
+ <u>{entry.headWord}</u>
70
+ {altString}
71
+ {modString}
72
+ {modPunctuation}
73
+ {' '}
74
+ {partOfSpeech}
75
+ {' '}
76
+ {
77
+ meanings.map(meaningful => Parser(meaningful))
78
+ }
79
+ {Parser(seeAlso)}
80
+ {Parser(synonym)}
81
+ {Parser(antonym)}
82
+ </Typography>,
83
+ )
84
+ }
139
85
  }
140
- }]);
141
- return GlossaryView;
142
- }(Component);
86
+
87
+ return glossaryEntries
88
+ }
89
+
90
+ onFilterChange = (event) => {
91
+ const filterTerm = event.target.value
92
+ this.setState({ ...this.state, filterTerm })
93
+ }
94
+
95
+ render() {
96
+ if (!this.props.glossary.loaded)
97
+ return null
98
+
99
+ return (
100
+ <div id="glossaryView" style={{ position: 'relative', overflow: 'auto' }}>
101
+ <Navigation
102
+ side={this.props.side}
103
+ onFilterChange={this.onFilterChange}
104
+ value={this.state.filterTerm}
105
+ documentView={this.props.documentView}
106
+ documentViewActions={this.props.documentViewActions}
107
+ />
108
+
109
+ <div id="glossaryViewInner">
110
+ <div id="glossaryContent">
111
+ <Typography variant="h2" className="title">Glossary</Typography>
112
+ {
113
+ this.props.glossary.glossary.title
114
+ && (
115
+ <div className="subtitle MuiTypography-root MuiTypography-body1">
116
+ <Markdown>
117
+ { this.props.glossary.glossary.title }
118
+ </Markdown>
119
+ </div>
120
+ )
121
+ }
122
+ <div className="cite-instructions">
123
+ {
124
+ this.props.glossary.glossary.citation
125
+ && (
126
+ <>
127
+ <Typography className="cite-header">How to Cite</Typography>
128
+ <div className="MuiTypography-root MuiTypography-body1">
129
+ <Markdown>
130
+ { this.props.glossary.glossary.citation }
131
+ </Markdown>
132
+ </div>
133
+ </>
134
+ )
135
+ }
136
+ </div>
137
+ { this.renderGlossary() }
138
+ </div>
139
+ </div>
140
+
141
+ </div>
142
+ )
143
+ }
144
+ }
145
+
143
146
  function renderMeanings(entry) {
144
- var meaningList = [];
145
- for (var i = 0; i < entry.meanings.length; i++) {
146
- var meaning = entry.meanings[i];
147
- var refString = meaning.references ? " [".concat(meaning.references, "]") : '';
148
- var numString = entry.meanings.length > 1 ? "".concat(i + 1, ". ") : '';
149
- var space = i < entry.meanings.length - 1 ? ' ' : '';
150
- meaningList.push("".concat(numString).concat(meaning.meaning).concat(refString).concat(space));
147
+ const meaningList = []
148
+ for (let i = 0; i < entry.meanings.length; i++) {
149
+ const meaning = entry.meanings[i]
150
+
151
+ const refString = meaning.references ? ` [${meaning.references}]` : ''
152
+ const numString = (entry.meanings.length > 1) ? `${i + 1}. ` : ''
153
+ const space = i < entry.meanings.length - 1 ? ' ' : ''
154
+ meaningList.push(
155
+ `${numString}${meaning.meaning}${refString}${space}`,
156
+ )
151
157
  }
152
- return meaningList;
158
+ return meaningList
153
159
  }
160
+
154
161
  function mapStateToProps(state) {
155
162
  return {
156
- glossary: state.glossary
157
- };
163
+ glossary: state.glossary,
164
+ }
158
165
  }
159
- export default connect(mapStateToProps)(GlossaryView);
166
+
167
+ export default connect(mapStateToProps)(GlossaryView)
@@ -1,78 +1,96 @@
1
- import React from 'react';
2
- import Popper from '@material-ui/core/Popper';
3
- import Typography from '@material-ui/core/Typography';
4
- import Fade from '@material-ui/core/Fade';
5
- import Paper from '@material-ui/core/Paper';
6
- import List from '@material-ui/core/List';
7
- import ListItem from '@material-ui/core/ListItem';
8
- import ListItemText from '@material-ui/core/ListItemText';
9
- import { FaArrowCircleLeft, FaArrowCircleRight } from 'react-icons/fa';
10
- import asterisk from '../icons/howtouse-asterisk.png';
11
- import curly from '../icons/howtouse-curly.png';
12
- import square from '../icons/howtouse-square.png';
13
- import ups from '../icons/howtouse-ups.png';
14
- var HelpPopper = function HelpPopper(props) {
15
- return /*#__PURE__*/React.createElement(Popper, {
16
- anchorEl: props.anchorEl,
17
- open: props.open,
18
- style: props.marginStyle
19
- }, /*#__PURE__*/React.createElement(Fade, {
20
- "in": props.open
21
- }, /*#__PURE__*/React.createElement(Paper, {
22
- className: "helpContainer"
23
- }, /*#__PURE__*/React.createElement("div", {
24
- onClick: props.onClose,
25
- className: "closeX"
26
- }, /*#__PURE__*/React.createElement("span", {
27
- className: "fa fa-window-close"
28
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
29
- variant: "h6",
30
- component: "h2"
31
- }, "Toolbar Buttons"), /*#__PURE__*/React.createElement(List, null, /*#__PURE__*/React.createElement(ListItem, null, /*#__PURE__*/React.createElement("span", {
32
- className: "fa fa-lock"
33
- }), /*#__PURE__*/React.createElement(ListItemText, {
34
- primary: "Toggle Sync Views"
35
- })), /*#__PURE__*/React.createElement(ListItem, null, /*#__PURE__*/React.createElement("span", {
36
- className: "fa fa-book"
37
- }), /*#__PURE__*/React.createElement(ListItemText, {
38
- primary: "Toggle Book Mode"
39
- })), /*#__PURE__*/React.createElement(ListItem, null, /*#__PURE__*/React.createElement("span", {
40
- className: "fa fa-code"
41
- }), /*#__PURE__*/React.createElement(ListItemText, {
42
- primary: "Toggle XML Mode"
43
- })), /*#__PURE__*/React.createElement(ListItem, null, /*#__PURE__*/React.createElement("span", {
44
- className: "horizontal-buttons"
45
- }, /*#__PURE__*/React.createElement(FaArrowCircleLeft, null), /*#__PURE__*/React.createElement(FaArrowCircleRight, null)), /*#__PURE__*/React.createElement(ListItemText, {
46
- primary: "Go Forward / Back"
47
- })), /*#__PURE__*/React.createElement(ListItem, null, /*#__PURE__*/React.createElement("span", {
48
- className: "fa fa-hand-point-right"
49
- }), /*#__PURE__*/React.createElement(ListItemText, {
50
- primary: "Jump to folio"
51
- })), /*#__PURE__*/React.createElement("div", {
52
- className: "readingGuide"
53
- }, /*#__PURE__*/React.createElement(Typography, {
54
- variant: "h6",
55
- component: "h2"
56
- }, "Reading Guide"), /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", null, /*#__PURE__*/React.createElement(Typography, {
57
- variant: "overline",
58
- component: "span"
59
- }, "Syntax")), /*#__PURE__*/React.createElement("th", null, /*#__PURE__*/React.createElement(Typography, {
60
- variant: "overline",
61
- component: "span"
62
- }, "Meaning")))), /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("img", {
63
- src: ups,
64
- alt: "howtouse-ups"
65
- })), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(Typography, null, "Text is under the paper strip"))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("img", {
66
- src: curly,
67
- alt: "howtouse-curly"
68
- })), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(Typography, null, "Expanded version implied by abbreviation marks"))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("img", {
69
- src: square,
70
- alt: "howtouse-square"
71
- })), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(Typography, null, "Editorial interventions and corrections"))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("img", {
72
- src: asterisk,
73
- alt: "howtouse-asterisk"
74
- })), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(Typography, null, "Editorial Comments"))))))), /*#__PURE__*/React.createElement(Typography, null, "See \xA0", /*#__PURE__*/React.createElement("a", {
75
- href: "#/content/how-to-use"
76
- }, "How to Use"), "\xA0 for more information.")))));
77
- };
78
- export default HelpPopper;
1
+ import Fade from '@material-ui/core/Fade'
2
+ import List from '@material-ui/core/List'
3
+ import ListItem from '@material-ui/core/ListItem'
4
+ import ListItemText from '@material-ui/core/ListItemText'
5
+ import Paper from '@material-ui/core/Paper'
6
+ import Popper from '@material-ui/core/Popper'
7
+ import Typography from '@material-ui/core/Typography'
8
+ import React from 'react'
9
+ import {
10
+ FaArrowCircleLeft,
11
+ FaArrowCircleRight,
12
+ } from 'react-icons/fa'
13
+ import asterisk from '../icons/howtouse-asterisk.png'
14
+ import curly from '../icons/howtouse-curly.png'
15
+ import square from '../icons/howtouse-square.png'
16
+ import ups from '../icons/howtouse-ups.png'
17
+
18
+ function HelpPopper(props) {
19
+ return (
20
+ <Popper anchorEl={props.anchorEl} open={props.open} style={props.marginStyle}>
21
+ <Fade in={props.open}>
22
+ <Paper className="helpContainer">
23
+ <div onClick={props.onClose} className="closeX">
24
+ <span className="fa fa-window-close" />
25
+ </div>
26
+ <div>
27
+ <Typography variant="h6" component="h2">Toolbar Buttons</Typography>
28
+ <List>
29
+ <ListItem>
30
+ <span className="fa fa-lock" />
31
+ <ListItemText primary="Toggle Sync Views" />
32
+ </ListItem>
33
+ <ListItem>
34
+ <span className="fa fa-book" />
35
+ <ListItemText primary="Toggle Book Mode" />
36
+ </ListItem>
37
+ <ListItem>
38
+ <span className="fa fa-code" />
39
+ <ListItemText primary="Toggle XML Mode" />
40
+ </ListItem>
41
+ <ListItem>
42
+ <span className="horizontal-buttons">
43
+ <FaArrowCircleLeft />
44
+ <FaArrowCircleRight />
45
+ </span>
46
+ <ListItemText primary="Go Forward / Back" />
47
+ </ListItem>
48
+ <ListItem>
49
+ <span className="fa fa-hand-point-right" />
50
+ <ListItemText primary="Jump to folio" />
51
+ </ListItem>
52
+ <div className="readingGuide">
53
+ <Typography variant="h6" component="h2">Reading Guide</Typography>
54
+ <table>
55
+ <thead>
56
+ <tr>
57
+ <th><Typography variant="overline" component="span">Syntax</Typography></th>
58
+ <th><Typography variant="overline" component="span">Meaning</Typography></th>
59
+ </tr>
60
+ </thead>
61
+ <tbody>
62
+ <tr>
63
+ <td><img src={ups} alt="howtouse-ups" /></td>
64
+ <td><Typography>Text is under the paper strip</Typography></td>
65
+ </tr>
66
+ <tr>
67
+ <td><img src={curly} alt="howtouse-curly" /></td>
68
+ <td><Typography>Expanded version implied by abbreviation marks</Typography></td>
69
+ </tr>
70
+ <tr>
71
+ <td><img src={square} alt="howtouse-square" /></td>
72
+ <td><Typography>Editorial interventions and corrections</Typography></td>
73
+ </tr>
74
+ <tr>
75
+ <td><img src={asterisk} alt="howtouse-asterisk" /></td>
76
+ <td><Typography>Editorial Comments</Typography></td>
77
+ </tr>
78
+ </tbody>
79
+ </table>
80
+ </div>
81
+ </List>
82
+ <Typography>
83
+ See
84
+ &nbsp;
85
+ <a href="#/content/how-to-use">How to Use</a>
86
+ &nbsp;
87
+ for more information.
88
+ </Typography>
89
+ </div>
90
+ </Paper>
91
+ </Fade>
92
+ </Popper>
93
+ )
94
+ }
95
+
96
+ export default HelpPopper