@cu-mkp/editioncrafter 0.0.5 → 0.0.6
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/package.json +3 -4
- package/dist/cjs/src/action/CommentActions.js +0 -20
- package/dist/cjs/src/action/DiplomaticActions.js +0 -19
- package/dist/cjs/src/action/DocumentActions.js +0 -188
- package/dist/cjs/src/action/GlossaryActions.js +0 -20
- package/dist/cjs/src/action/initialState/commentInitialState.js +0 -13
- package/dist/cjs/src/action/initialState/diplomaticInitialState.js +0 -10
- package/dist/cjs/src/action/initialState/documentInitialState.js +0 -17
- package/dist/cjs/src/action/initialState/glossaryInitialState.js +0 -13
- package/dist/cjs/src/action/rootReducer.js +0 -30
- package/dist/cjs/src/component/AlphabetLinks.js +0 -76
- package/dist/cjs/src/component/CustomizedTooltops.js +0 -173
- package/dist/cjs/src/component/DiploMatic.js +0 -90
- package/dist/cjs/src/component/DocumentView.js +0 -427
- package/dist/cjs/src/component/EditorComment.js +0 -124
- package/dist/cjs/src/component/ErrorBoundary.js +0 -71
- package/dist/cjs/src/component/FigureImage.js +0 -82
- package/dist/cjs/src/component/GlossaryView.js +0 -166
- package/dist/cjs/src/component/HelpPopper.js +0 -90
- package/dist/cjs/src/component/ImageGridView.js +0 -191
- package/dist/cjs/src/component/ImageView.js +0 -120
- package/dist/cjs/src/component/ImageZoomControl.js +0 -67
- package/dist/cjs/src/component/JumpToFolio.js +0 -103
- package/dist/cjs/src/component/Navigation.js +0 -266
- package/dist/cjs/src/component/Pagination.js +0 -81
- package/dist/cjs/src/component/RouteListener.js +0 -66
- package/dist/cjs/src/component/SeaDragonComponent.js +0 -51
- package/dist/cjs/src/component/SinglePaneView.js +0 -46
- package/dist/cjs/src/component/SplitPaneView.js +0 -164
- package/dist/cjs/src/component/TranscriptionView.js +0 -138
- package/dist/cjs/src/component/Watermark.js +0 -33
- package/dist/cjs/src/component/XMLView.js +0 -92
- package/dist/cjs/src/globals.d.ts +0 -1
- package/dist/cjs/src/hocs/withRouter.js +0 -29
- package/dist/cjs/src/icons/ByIcon.js +0 -27
- package/dist/cjs/src/icons/CcIcon.js +0 -27
- package/dist/cjs/src/icons/NcIcon.js +0 -27
- package/dist/cjs/src/icons/SaIcon.js +0 -27
- package/dist/cjs/src/icons/SideMenuIconLeft.js +0 -49
- package/dist/cjs/src/icons/SideMenuIconRight.js +0 -49
- package/dist/cjs/src/icons/howtouse-asterisk.png +0 -0
- package/dist/cjs/src/icons/howtouse-beaker.png +0 -0
- package/dist/cjs/src/icons/howtouse-curly.png +0 -0
- package/dist/cjs/src/icons/howtouse-square.png +0 -0
- package/dist/cjs/src/icons/howtouse-ups.png +0 -0
- package/dist/cjs/src/img/banner-about.png +0 -0
- package/dist/cjs/src/img/banner-essays.jpg +0 -0
- package/dist/cjs/src/img/banner-essays.png +0 -0
- package/dist/cjs/src/img/banner-how-to.png +0 -0
- package/dist/cjs/src/img/banner-resources.png +0 -0
- package/dist/cjs/src/img/book-open-cropped.png +0 -0
- package/dist/cjs/src/img/book-open.png +0 -0
- package/dist/cjs/src/img/book-spine.png +0 -0
- package/dist/cjs/src/img/bookcover-cropped.png +0 -0
- package/dist/cjs/src/img/cropped-MKLizardFilled-32x32.jpg +0 -0
- package/dist/cjs/src/img/folio48r-drawing.png +0 -0
- package/dist/cjs/src/img/howtouse-asterisk.png +0 -0
- package/dist/cjs/src/img/howtouse-beaker.png +0 -0
- package/dist/cjs/src/img/howtouse-curly.png +0 -0
- package/dist/cjs/src/img/howtouse-square.png +0 -0
- package/dist/cjs/src/img/howtouse-ups.png +0 -0
- package/dist/cjs/src/img/lizard-no-bg.png +0 -0
- package/dist/cjs/src/img/logo_center_multi_line.png +0 -0
- package/dist/cjs/src/img/logo_center_single_line.png +0 -0
- package/dist/cjs/src/img/logo_columbia.png +0 -0
- package/dist/cjs/src/img/mk-banner-logo.png +0 -0
- package/dist/cjs/src/img/mk-homepage-logo.png +0 -0
- package/dist/cjs/src/img/openseadragon/button_grouphover.png +0 -0
- package/dist/cjs/src/img/openseadragon/button_hover.png +0 -0
- package/dist/cjs/src/img/openseadragon/button_pressed.png +0 -0
- package/dist/cjs/src/img/openseadragon/button_rest.png +0 -0
- package/dist/cjs/src/img/openseadragon/fullpage_grouphover.png +0 -0
- package/dist/cjs/src/img/openseadragon/fullpage_hover.png +0 -0
- package/dist/cjs/src/img/openseadragon/fullpage_pressed.png +0 -0
- package/dist/cjs/src/img/openseadragon/fullpage_rest.png +0 -0
- package/dist/cjs/src/img/openseadragon/home_grouphover.png +0 -0
- package/dist/cjs/src/img/openseadragon/home_hover.png +0 -0
- package/dist/cjs/src/img/openseadragon/home_pressed.png +0 -0
- package/dist/cjs/src/img/openseadragon/home_rest.png +0 -0
- package/dist/cjs/src/img/openseadragon/next_grouphover.png +0 -0
- package/dist/cjs/src/img/openseadragon/next_hover.png +0 -0
- package/dist/cjs/src/img/openseadragon/next_pressed.png +0 -0
- package/dist/cjs/src/img/openseadragon/next_rest.png +0 -0
- package/dist/cjs/src/img/openseadragon/previous_grouphover.png +0 -0
- package/dist/cjs/src/img/openseadragon/previous_hover.png +0 -0
- package/dist/cjs/src/img/openseadragon/previous_pressed.png +0 -0
- package/dist/cjs/src/img/openseadragon/previous_rest.png +0 -0
- package/dist/cjs/src/img/openseadragon/rotateleft_grouphover.png +0 -0
- package/dist/cjs/src/img/openseadragon/rotateleft_hover.png +0 -0
- package/dist/cjs/src/img/openseadragon/rotateleft_pressed.png +0 -0
- package/dist/cjs/src/img/openseadragon/rotateleft_rest.png +0 -0
- package/dist/cjs/src/img/openseadragon/rotateright_grouphover.png +0 -0
- package/dist/cjs/src/img/openseadragon/rotateright_hover.png +0 -0
- package/dist/cjs/src/img/openseadragon/rotateright_pressed.png +0 -0
- package/dist/cjs/src/img/openseadragon/rotateright_rest.png +0 -0
- package/dist/cjs/src/img/openseadragon/zoomin_grouphover.png +0 -0
- package/dist/cjs/src/img/openseadragon/zoomin_hover.png +0 -0
- package/dist/cjs/src/img/openseadragon/zoomin_pressed.png +0 -0
- package/dist/cjs/src/img/openseadragon/zoomin_rest.png +0 -0
- package/dist/cjs/src/img/openseadragon/zoomout_grouphover.png +0 -0
- package/dist/cjs/src/img/openseadragon/zoomout_hover.png +0 -0
- package/dist/cjs/src/img/openseadragon/zoomout_pressed.png +0 -0
- package/dist/cjs/src/img/openseadragon/zoomout_rest.png +0 -0
- package/dist/cjs/src/img/spinner.gif +0 -0
- package/dist/cjs/src/img/text-bg.png +0 -0
- package/dist/cjs/src/img/watermark.png +0 -0
- package/dist/cjs/src/index.js +0 -35
- package/dist/cjs/src/lib/copyObject.js +0 -11
- package/dist/cjs/src/lib/registerServiceWorker.js +0 -95
- package/dist/cjs/src/model/DocumentHelper.js +0 -17
- package/dist/cjs/src/model/Folio.js +0 -92
- package/dist/cjs/src/model/ReduxStore.js +0 -110
- package/dist/cjs/src/model/folioLayout.js +0 -416
- package/dist/cjs/src/saga/RouteListenerSaga.js +0 -198
- package/dist/cjs/src/saga/rootSaga.js +0 -23
- package/dist/cjs/src/scss/_CETEIcean.scss +0 -914
- package/dist/cjs/src/scss/_base.scss +0 -174
- package/dist/cjs/src/scss/_diplomatic.scss +0 -332
- package/dist/cjs/src/scss/_globalNavigation.scss +0 -34
- package/dist/cjs/src/scss/_glossary.scss +0 -105
- package/dist/cjs/src/scss/_imageGridView.scss +0 -60
- package/dist/cjs/src/scss/_imageView.scss +0 -16
- package/dist/cjs/src/scss/_imageZoomControl.scss +0 -51
- package/dist/cjs/src/scss/_jumpbox.scss +0 -42
- package/dist/cjs/src/scss/_navigation.scss +0 -143
- package/dist/cjs/src/scss/_pagination.scss +0 -36
- package/dist/cjs/src/scss/_spinner.scss +0 -60
- package/dist/cjs/src/scss/_splitPaneView.scss +0 -35
- package/dist/cjs/src/scss/_thumbnails.scss +0 -17
- package/dist/cjs/src/scss/_transcriptView.scss +0 -178
- package/dist/cjs/src/scss/_watermark.scss +0 -19
- package/dist/cjs/src/scss/_xmlView.scss +0 -29
- package/dist/cjs/src/scss/editioncrafter.scss +0 -109
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _withWidth = _interopRequireDefault(require("@material-ui/core/withWidth"));
|
|
8
|
-
var _history = require("history");
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactRedux = require("react-redux");
|
|
11
|
-
var _reactRouterDom = require("react-router-dom");
|
|
12
|
-
var _DocumentView = _interopRequireDefault(require("./DocumentView"));
|
|
13
|
-
var _RouteListener = _interopRequireDefault(require("./RouteListener"));
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18
|
-
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); } }
|
|
19
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
20
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
21
|
-
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); }
|
|
22
|
-
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); }
|
|
23
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
24
|
-
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); }; }
|
|
25
|
-
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); }
|
|
26
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
27
|
-
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; } }
|
|
28
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
29
|
-
var DiploMatic = /*#__PURE__*/function (_Component) {
|
|
30
|
-
_inherits(DiploMatic, _Component);
|
|
31
|
-
var _super = _createSuper(DiploMatic);
|
|
32
|
-
function DiploMatic() {
|
|
33
|
-
_classCallCheck(this, DiploMatic);
|
|
34
|
-
return _super.apply(this, arguments);
|
|
35
|
-
}
|
|
36
|
-
_createClass(DiploMatic, [{
|
|
37
|
-
key: "componentDidMount",
|
|
38
|
-
value: function componentDidMount() {
|
|
39
|
-
var history = (0, _history.createBrowserHistory)();
|
|
40
|
-
history.listen(function () {
|
|
41
|
-
window.scrollTo(0, 0);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}, {
|
|
45
|
-
key: "render",
|
|
46
|
-
value: function render() {
|
|
47
|
-
var fixedFrameMode = this.props.diplomatic.fixedFrameMode;
|
|
48
|
-
var fixedFrameModeClass = fixedFrameMode ? 'fixed' : 'sticky';
|
|
49
|
-
return /*#__PURE__*/_react["default"].createElement(_reactRedux.Provider, {
|
|
50
|
-
store: this.props.store
|
|
51
|
-
}, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.HashRouter, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
52
|
-
id: "diplomatic",
|
|
53
|
-
className: fixedFrameModeClass
|
|
54
|
-
}, /*#__PURE__*/_react["default"].createElement(_RouteListener["default"], null), /*#__PURE__*/_react["default"].createElement("div", {
|
|
55
|
-
id: "content"
|
|
56
|
-
}, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Routes, null, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Route, {
|
|
57
|
-
path: "/ec/:folioID/:transcriptionType/:folioID2/:transcriptionType2",
|
|
58
|
-
element: /*#__PURE__*/_react["default"].createElement(_DocumentView["default"], this.props),
|
|
59
|
-
exact: true
|
|
60
|
-
}), /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Route, {
|
|
61
|
-
path: "/ec/:folioID/:transcriptionType",
|
|
62
|
-
element: /*#__PURE__*/_react["default"].createElement(_DocumentView["default"], this.props),
|
|
63
|
-
exact: true
|
|
64
|
-
}), /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Route, {
|
|
65
|
-
path: "/ec/:folioID",
|
|
66
|
-
element: /*#__PURE__*/_react["default"].createElement(_DocumentView["default"], this.props),
|
|
67
|
-
exact: true
|
|
68
|
-
}), /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Route, {
|
|
69
|
-
path: "/ec",
|
|
70
|
-
element: /*#__PURE__*/_react["default"].createElement(_DocumentView["default"], this.props),
|
|
71
|
-
exact: true
|
|
72
|
-
}), /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Route, {
|
|
73
|
-
path: "/",
|
|
74
|
-
element: /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Navigate, {
|
|
75
|
-
to: "/ec"
|
|
76
|
-
}),
|
|
77
|
-
exact: true
|
|
78
|
-
}))))));
|
|
79
|
-
}
|
|
80
|
-
}]);
|
|
81
|
-
return DiploMatic;
|
|
82
|
-
}(_react.Component);
|
|
83
|
-
function mapStateToProps(state) {
|
|
84
|
-
return {
|
|
85
|
-
diplomatic: state.diplomatic,
|
|
86
|
-
documentView: state.documentView
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
var _default = (0, _withWidth["default"])()((0, _reactRedux.connect)(mapStateToProps)(DiploMatic));
|
|
90
|
-
exports["default"] = _default;
|
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactRedux = require("react-redux");
|
|
9
|
-
var _withWidth = _interopRequireWildcard(require("@material-ui/core/withWidth"));
|
|
10
|
-
var _SplitPaneView = _interopRequireDefault(require("./SplitPaneView"));
|
|
11
|
-
var _ReduxStore = require("../model/ReduxStore");
|
|
12
|
-
var _ImageView = _interopRequireDefault(require("./ImageView"));
|
|
13
|
-
var _ImageGridView = _interopRequireDefault(require("./ImageGridView"));
|
|
14
|
-
var _TranscriptionView = _interopRequireDefault(require("./TranscriptionView"));
|
|
15
|
-
var _XMLView = _interopRequireDefault(require("./XMLView"));
|
|
16
|
-
var _GlossaryView = _interopRequireDefault(require("./GlossaryView"));
|
|
17
|
-
var _SinglePaneView = _interopRequireDefault(require("./SinglePaneView"));
|
|
18
|
-
var _withRouter = _interopRequireDefault(require("../hocs/withRouter"));
|
|
19
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
24
|
-
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); }
|
|
25
|
-
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; }
|
|
26
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
27
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
28
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
30
|
-
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; }
|
|
31
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
32
|
-
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); } }
|
|
33
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
34
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
35
|
-
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); }
|
|
36
|
-
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); }
|
|
37
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
38
|
-
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); }; }
|
|
39
|
-
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); }
|
|
40
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
-
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; } }
|
|
42
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
|
-
var DocumentView = /*#__PURE__*/function (_Component) {
|
|
44
|
-
_inherits(DocumentView, _Component);
|
|
45
|
-
var _super = _createSuper(DocumentView);
|
|
46
|
-
function DocumentView(props) {
|
|
47
|
-
var _this;
|
|
48
|
-
_classCallCheck(this, DocumentView);
|
|
49
|
-
_this = _super.call(this, props);
|
|
50
|
-
_this.onWidth = function (left, right) {
|
|
51
|
-
_this.setState(function (state) {
|
|
52
|
-
var nextState = _objectSpread({}, state);
|
|
53
|
-
nextState.left.width = left;
|
|
54
|
-
nextState.right.width = right;
|
|
55
|
-
return nextState;
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
_this.getViewports = function () {
|
|
59
|
-
var _this$props$router$pa = _this.props.router.params,
|
|
60
|
-
folioID = _this$props$router$pa.folioID,
|
|
61
|
-
transcriptionType = _this$props$router$pa.transcriptionType,
|
|
62
|
-
folioID2 = _this$props$router$pa.folioID2,
|
|
63
|
-
transcriptionType2 = _this$props$router$pa.transcriptionType2;
|
|
64
|
-
var viewports;
|
|
65
|
-
if (!folioID) {
|
|
66
|
-
// route /folios
|
|
67
|
-
viewports = {
|
|
68
|
-
left: {
|
|
69
|
-
folioID: '-1',
|
|
70
|
-
transcriptionType: 'g'
|
|
71
|
-
},
|
|
72
|
-
right: {
|
|
73
|
-
folioID: '-1',
|
|
74
|
-
transcriptionType: 'tl'
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
} else {
|
|
78
|
-
var leftFolioID = folioID;
|
|
79
|
-
var leftTranscriptionType;
|
|
80
|
-
var rightFolioID;
|
|
81
|
-
var rightTranscriptionType;
|
|
82
|
-
if (folioID2) {
|
|
83
|
-
// route /ec/:folioID/:transcriptionType/:folioID2/:transcriptionType2
|
|
84
|
-
leftTranscriptionType = transcriptionType;
|
|
85
|
-
rightFolioID = folioID2;
|
|
86
|
-
rightTranscriptionType = transcriptionType2 || 'tl';
|
|
87
|
-
} else {
|
|
88
|
-
// route /ec/:folioID
|
|
89
|
-
// route /ec/:folioID/:transcriptionType
|
|
90
|
-
leftTranscriptionType = 'f';
|
|
91
|
-
rightFolioID = folioID;
|
|
92
|
-
rightTranscriptionType = transcriptionType || 'tl';
|
|
93
|
-
}
|
|
94
|
-
viewports = {
|
|
95
|
-
left: {
|
|
96
|
-
folioID: leftFolioID,
|
|
97
|
-
transcriptionType: leftTranscriptionType
|
|
98
|
-
},
|
|
99
|
-
right: {
|
|
100
|
-
folioID: rightFolioID,
|
|
101
|
-
transcriptionType: rightTranscriptionType
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
return viewports;
|
|
106
|
-
};
|
|
107
|
-
var paneDefaults = {
|
|
108
|
-
isXMLMode: false,
|
|
109
|
-
width: 0
|
|
110
|
-
};
|
|
111
|
-
_this.state = {
|
|
112
|
-
linkedMode: true,
|
|
113
|
-
bookMode: false,
|
|
114
|
-
left: _objectSpread({}, paneDefaults),
|
|
115
|
-
right: _objectSpread({}, paneDefaults),
|
|
116
|
-
viewports: _this.getViewports()
|
|
117
|
-
};
|
|
118
|
-
_this.documentViewActions = {
|
|
119
|
-
setXMLMode: _this.setXMLMode.bind(_assertThisInitialized(_this)),
|
|
120
|
-
setLinkedMode: _this.setLinkedMode.bind(_assertThisInitialized(_this)),
|
|
121
|
-
setBookMode: _this.setBookMode.bind(_assertThisInitialized(_this)),
|
|
122
|
-
changeTranscriptionType: _this.changeTranscriptionType.bind(_assertThisInitialized(_this)),
|
|
123
|
-
changeCurrentFolio: _this.changeCurrentFolio.bind(_assertThisInitialized(_this)),
|
|
124
|
-
jumpToFolio: _this.jumpToFolio.bind(_assertThisInitialized(_this))
|
|
125
|
-
};
|
|
126
|
-
return _this;
|
|
127
|
-
}
|
|
128
|
-
_createClass(DocumentView, [{
|
|
129
|
-
key: "componentDidMount",
|
|
130
|
-
value: function componentDidMount() {
|
|
131
|
-
(0, _ReduxStore.dispatchAction)(this.props, 'DiplomaticActions.setFixedFrameMode', true);
|
|
132
|
-
}
|
|
133
|
-
}, {
|
|
134
|
-
key: "setXMLMode",
|
|
135
|
-
value: function setXMLMode(side, xmlMode) {
|
|
136
|
-
this.setState(function (state) {
|
|
137
|
-
var nextState = _objectSpread({}, state);
|
|
138
|
-
nextState[side].isXMLMode = xmlMode;
|
|
139
|
-
return nextState;
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
}, {
|
|
143
|
-
key: "setLinkedMode",
|
|
144
|
-
value: function setLinkedMode(linkedMode) {
|
|
145
|
-
this.setState(function (state) {
|
|
146
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
147
|
-
linkedMode: linkedMode
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
}, {
|
|
152
|
-
key: "setBookMode",
|
|
153
|
-
value: function setBookMode(shortid, bookMode) {
|
|
154
|
-
this.setState(function (state) {
|
|
155
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
156
|
-
bookMode: bookMode
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
if (bookMode) {
|
|
160
|
-
var _this$findBookFolios = this.findBookFolios(shortid),
|
|
161
|
-
_this$findBookFolios2 = _slicedToArray(_this$findBookFolios, 2),
|
|
162
|
-
versoID = _this$findBookFolios2[0],
|
|
163
|
-
rectoID = _this$findBookFolios2[1];
|
|
164
|
-
this.navigateFolios(versoID, 'f', rectoID, 'f');
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}, {
|
|
168
|
-
key: "jumpToFolio",
|
|
169
|
-
value: function jumpToFolio(folioName, side) {
|
|
170
|
-
var document = this.props.document;
|
|
171
|
-
// Convert folioName to ID (and confirm it exists)
|
|
172
|
-
if (document.folioByName[folioName]) {
|
|
173
|
-
var _document$folioByName;
|
|
174
|
-
var folioID = (_document$folioByName = document.folioByName[folioName]) === null || _document$folioByName === void 0 ? void 0 : _document$folioByName.id;
|
|
175
|
-
this.changeCurrentFolio(folioID, side, this.getViewports()[side].transcriptionType);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}, {
|
|
179
|
-
key: "findBookFolios",
|
|
180
|
-
value: function findBookFolios(folioID) {
|
|
181
|
-
var document = this.props.document;
|
|
182
|
-
var versoFolio = document.folioIndex[folioID];
|
|
183
|
-
var name = versoFolio.name,
|
|
184
|
-
pageNumber = versoFolio.pageNumber;
|
|
185
|
-
if (!name.endsWith('v')) {
|
|
186
|
-
if (name.endsWith('r')) {
|
|
187
|
-
return [document.folios[pageNumber - 1].id, document.folios[pageNumber].id];
|
|
188
|
-
}
|
|
189
|
-
return [null, null];
|
|
190
|
-
}
|
|
191
|
-
return [document.folios[pageNumber].id, document.folios[pageNumber + 1].id];
|
|
192
|
-
}
|
|
193
|
-
}, {
|
|
194
|
-
key: "changeTranscriptionType",
|
|
195
|
-
value: function changeTranscriptionType(side, transcriptionType) {
|
|
196
|
-
var viewports = this.getViewports();
|
|
197
|
-
if (side === 'left') {
|
|
198
|
-
var folioID = viewports.left.folioID;
|
|
199
|
-
var otherSide = viewports.right;
|
|
200
|
-
this.navigateFolios(folioID, transcriptionType, otherSide.folioID, otherSide.transcriptionType);
|
|
201
|
-
} else {
|
|
202
|
-
var _folioID = viewports.right.folioID;
|
|
203
|
-
var _otherSide = viewports.left;
|
|
204
|
-
this.navigateFolios(_otherSide.folioID, _otherSide.transcriptionType, _folioID, transcriptionType);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}, {
|
|
208
|
-
key: "navigateFolios",
|
|
209
|
-
value: function navigateFolios(folioID, transcriptionType, folioID2, transcriptionType2) {
|
|
210
|
-
if (!folioID) {
|
|
211
|
-
// goto grid view
|
|
212
|
-
this.props.router.navigate('/ec');
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
if (!transcriptionType) {
|
|
216
|
-
// goto folioID, tc
|
|
217
|
-
this.props.router.navigate("/ec/".concat(folioID));
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
if (!folioID2) {
|
|
221
|
-
// goto folioID, transcriptionType
|
|
222
|
-
this.props.router.navigate("/ec/".concat(folioID, "/").concat(transcriptionType));
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
if (!transcriptionType2) {
|
|
226
|
-
// goto folioID, transcriptionType, folioID2, tc
|
|
227
|
-
this.props.router.navigate("/ec/".concat(folioID, "/").concat(transcriptionType, "/").concat(folioID2, "/tc"));
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
// goto folioID, transcriptionType, folioID2, transcriptionType2
|
|
231
|
-
this.props.router.navigate("/ec/".concat(folioID, "/").concat(transcriptionType, "/").concat(folioID2, "/").concat(transcriptionType2));
|
|
232
|
-
}
|
|
233
|
-
}, {
|
|
234
|
-
key: "changeCurrentFolio",
|
|
235
|
-
value: function changeCurrentFolio(folioID, side, transcriptionType) {
|
|
236
|
-
// Lookup prev/next
|
|
237
|
-
var viewports = this.getViewports();
|
|
238
|
-
if (this.state.bookMode) {
|
|
239
|
-
var _this$findBookFolios3 = this.findBookFolios(folioID),
|
|
240
|
-
_this$findBookFolios4 = _slicedToArray(_this$findBookFolios3, 2),
|
|
241
|
-
versoID = _this$findBookFolios4[0],
|
|
242
|
-
rectoID = _this$findBookFolios4[1];
|
|
243
|
-
if (versoID) {
|
|
244
|
-
this.navigateFolios(versoID, 'f', rectoID, 'f');
|
|
245
|
-
}
|
|
246
|
-
} else if (this.state.linkedMode) {
|
|
247
|
-
if (side === 'left') {
|
|
248
|
-
var otherSide = viewports.right;
|
|
249
|
-
this.navigateFolios(folioID, transcriptionType, folioID, otherSide.transcriptionType);
|
|
250
|
-
} else {
|
|
251
|
-
var _otherSide2 = viewports.left;
|
|
252
|
-
this.navigateFolios(folioID, _otherSide2.transcriptionType, folioID, transcriptionType);
|
|
253
|
-
}
|
|
254
|
-
} else if (side === 'left') {
|
|
255
|
-
var _otherSide3 = viewports.right;
|
|
256
|
-
this.navigateFolios(folioID, transcriptionType, _otherSide3.folioID, _otherSide3.transcriptionType);
|
|
257
|
-
} else {
|
|
258
|
-
var _otherSide4 = viewports.left;
|
|
259
|
-
this.navigateFolios(_otherSide4.folioID, _otherSide4.transcriptionType, folioID, transcriptionType);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}, {
|
|
263
|
-
key: "determineViewType",
|
|
264
|
-
value: function determineViewType(side) {
|
|
265
|
-
var transcriptionType = this.getViewports()[side].transcriptionType;
|
|
266
|
-
var xmlMode = this.state[side].isXMLMode;
|
|
267
|
-
if (transcriptionType === 'g') {
|
|
268
|
-
return 'ImageGridView';
|
|
269
|
-
}
|
|
270
|
-
if (transcriptionType === 'f') {
|
|
271
|
-
return 'ImageView';
|
|
272
|
-
}
|
|
273
|
-
if (transcriptionType === 'glossary') {
|
|
274
|
-
return 'GlossaryView';
|
|
275
|
-
}
|
|
276
|
-
return xmlMode ? 'XMLView' : 'TranscriptionView';
|
|
277
|
-
}
|
|
278
|
-
}, {
|
|
279
|
-
key: "viewportState",
|
|
280
|
-
value: function viewportState(side) {
|
|
281
|
-
var doc = this.props.document;
|
|
282
|
-
var viewport = this.getViewports()[side];
|
|
283
|
-
|
|
284
|
-
// blank folio ID
|
|
285
|
-
if (viewport.folioID === '-1') {
|
|
286
|
-
return _objectSpread(_objectSpread({}, this.state[side]), {}, {
|
|
287
|
-
iiifShortID: viewport.folioID,
|
|
288
|
-
transcriptionType: viewport.transcriptionType
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
var shortID = viewport.folioID;
|
|
292
|
-
var folioCount = doc.folios.length;
|
|
293
|
-
var nextID = '';
|
|
294
|
-
var prevID = '';
|
|
295
|
-
var current_hasPrev = false;
|
|
296
|
-
var current_hasNext = false;
|
|
297
|
-
if (this.state.bookMode) {
|
|
298
|
-
var _this$findBookFolios5 = this.findBookFolios(shortID),
|
|
299
|
-
_this$findBookFolios6 = _slicedToArray(_this$findBookFolios5, 1),
|
|
300
|
-
versoID = _this$findBookFolios6[0];
|
|
301
|
-
var current_idx = doc.folioIndex[versoID].pageNumber;
|
|
302
|
-
if (current_idx > -1) {
|
|
303
|
-
current_hasNext = current_idx < folioCount - 2;
|
|
304
|
-
nextID = current_hasNext ? doc.folios[current_idx + 2].id : '';
|
|
305
|
-
current_hasPrev = current_idx > 1 && folioCount > 1;
|
|
306
|
-
prevID = current_hasPrev ? doc.folios[current_idx - 2].id : '';
|
|
307
|
-
}
|
|
308
|
-
} else {
|
|
309
|
-
var _current_idx = doc.folioIndex[shortID].pageNumber;
|
|
310
|
-
if (_current_idx > -1) {
|
|
311
|
-
current_hasNext = _current_idx < folioCount - 1;
|
|
312
|
-
nextID = current_hasNext ? doc.folios[_current_idx + 1].id : '';
|
|
313
|
-
current_hasPrev = _current_idx > 0 && folioCount > 1;
|
|
314
|
-
prevID = current_hasPrev ? doc.folios[_current_idx - 1].id : '';
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
return _objectSpread(_objectSpread({}, this.state[side]), {}, {
|
|
318
|
-
iiifShortID: shortID,
|
|
319
|
-
transcriptionType: viewport.transcriptionType,
|
|
320
|
-
hasPrevious: current_hasPrev,
|
|
321
|
-
hasNext: current_hasNext,
|
|
322
|
-
previousFolioShortID: prevID,
|
|
323
|
-
nextFolioShortID: nextID
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
}, {
|
|
327
|
-
key: "renderPane",
|
|
328
|
-
value: function renderPane(side, docView) {
|
|
329
|
-
var viewType = this.determineViewType(side);
|
|
330
|
-
var key = this.viewPaneKey(side);
|
|
331
|
-
var folioID = docView[side].iiifShortID;
|
|
332
|
-
var transcriptionType = docView[side].transcriptionType;
|
|
333
|
-
if (viewType === 'ImageView') {
|
|
334
|
-
return /*#__PURE__*/_react["default"].createElement(_ImageView["default"], {
|
|
335
|
-
key: key,
|
|
336
|
-
folioID: folioID,
|
|
337
|
-
documentView: docView,
|
|
338
|
-
documentViewActions: this.documentViewActions,
|
|
339
|
-
side: side
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
if (viewType === 'TranscriptionView') {
|
|
343
|
-
return /*#__PURE__*/_react["default"].createElement(_TranscriptionView["default"], {
|
|
344
|
-
key: key,
|
|
345
|
-
documentView: docView,
|
|
346
|
-
documentViewActions: this.documentViewActions,
|
|
347
|
-
side: side,
|
|
348
|
-
folioID: folioID,
|
|
349
|
-
transcriptionType: transcriptionType
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
if (viewType === 'XMLView') {
|
|
353
|
-
return /*#__PURE__*/_react["default"].createElement(_XMLView["default"], {
|
|
354
|
-
key: key,
|
|
355
|
-
folioID: folioID,
|
|
356
|
-
transcriptionType: transcriptionType,
|
|
357
|
-
documentView: docView,
|
|
358
|
-
documentViewActions: this.documentViewActions,
|
|
359
|
-
side: side
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
if (viewType === 'ImageGridView') {
|
|
363
|
-
return /*#__PURE__*/_react["default"].createElement(_ImageGridView["default"], {
|
|
364
|
-
key: key,
|
|
365
|
-
documentView: docView,
|
|
366
|
-
documentViewActions: this.documentViewActions,
|
|
367
|
-
side: side
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
if (viewType === 'GlossaryView') {
|
|
371
|
-
return /*#__PURE__*/_react["default"].createElement(_GlossaryView["default"], {
|
|
372
|
-
key: key,
|
|
373
|
-
documentView: docView,
|
|
374
|
-
documentViewActions: this.documentViewActions,
|
|
375
|
-
side: side
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, "ERROR: Unrecognized viewType.");
|
|
379
|
-
}
|
|
380
|
-
}, {
|
|
381
|
-
key: "viewPaneKey",
|
|
382
|
-
value: function viewPaneKey(side) {
|
|
383
|
-
var pane = this.state[side];
|
|
384
|
-
if (pane.viewType === 'ImageGridView') {
|
|
385
|
-
return "".concat(side, "-").concat(pane.viewType);
|
|
386
|
-
}
|
|
387
|
-
if (typeof pane.folio !== 'undefined') {
|
|
388
|
-
return "".concat(side, "-").concat(pane.viewType, "-").concat(pane.folio.id);
|
|
389
|
-
}
|
|
390
|
-
return "".concat(side, "-").concat(pane.viewType);
|
|
391
|
-
}
|
|
392
|
-
}, {
|
|
393
|
-
key: "render",
|
|
394
|
-
value: function render() {
|
|
395
|
-
if (!this.props.document.loaded) {
|
|
396
|
-
return null;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
// combine component state with state from props
|
|
400
|
-
var docView = _objectSpread(_objectSpread({}, this.state), {}, {
|
|
401
|
-
left: this.viewportState('left'),
|
|
402
|
-
right: this.viewportState('right')
|
|
403
|
-
});
|
|
404
|
-
var mobileDocView = _objectSpread(_objectSpread({}, this.state), {}, {
|
|
405
|
-
right: _objectSpread({}, this.viewportState('right'))
|
|
406
|
-
});
|
|
407
|
-
if ((0, _withWidth.isWidthUp)('md', this.props.width)) {
|
|
408
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_SplitPaneView["default"], {
|
|
409
|
-
leftPane: this.renderPane('left', docView),
|
|
410
|
-
rightPane: this.renderPane('right', docView),
|
|
411
|
-
onWidth: this.onWidth
|
|
412
|
-
}));
|
|
413
|
-
}
|
|
414
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_SinglePaneView["default"], {
|
|
415
|
-
singlePane: this.renderPane('right', mobileDocView)
|
|
416
|
-
}));
|
|
417
|
-
}
|
|
418
|
-
}]);
|
|
419
|
-
return DocumentView;
|
|
420
|
-
}(_react.Component);
|
|
421
|
-
function mapStateToProps(state) {
|
|
422
|
-
return {
|
|
423
|
-
document: state.document
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
var _default = (0, _withWidth["default"])()((0, _reactRedux.connect)(mapStateToProps)((0, _withRouter["default"])(DocumentView)));
|
|
427
|
-
exports["default"] = _default;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactRedux = require("react-redux");
|
|
9
|
-
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
10
|
-
var _Popper = _interopRequireDefault(require("@material-ui/core/Popper"));
|
|
11
|
-
var _Fade = _interopRequireDefault(require("@material-ui/core/Fade"));
|
|
12
|
-
var _Paper = _interopRequireDefault(require("@material-ui/core/Paper"));
|
|
13
|
-
var _htmlReactParser = _interopRequireDefault(require("html-react-parser"));
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
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; }
|
|
20
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
-
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); } }
|
|
22
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
23
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
24
|
-
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); }
|
|
25
|
-
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); }
|
|
26
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
-
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); }; }
|
|
28
|
-
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); }
|
|
29
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
30
|
-
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; } }
|
|
31
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
32
|
-
var EditorComment = /*#__PURE__*/function (_Component) {
|
|
33
|
-
_inherits(EditorComment, _Component);
|
|
34
|
-
var _super = _createSuper(EditorComment);
|
|
35
|
-
function EditorComment(props) {
|
|
36
|
-
var _this;
|
|
37
|
-
_classCallCheck(this, EditorComment);
|
|
38
|
-
_this = _super.call(this, props);
|
|
39
|
-
_this.onOpen = function (event) {
|
|
40
|
-
_this.setState({
|
|
41
|
-
anchorRef: event.currentTarget,
|
|
42
|
-
open: true
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
_this.onClose = function (event) {
|
|
46
|
-
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
47
|
-
open: false
|
|
48
|
-
}));
|
|
49
|
-
};
|
|
50
|
-
_this.state = {
|
|
51
|
-
anchorRef: null,
|
|
52
|
-
open: false
|
|
53
|
-
};
|
|
54
|
-
return _this;
|
|
55
|
-
}
|
|
56
|
-
_createClass(EditorComment, [{
|
|
57
|
-
key: "renderPopper",
|
|
58
|
-
value: function renderPopper() {
|
|
59
|
-
var _this$state = this.state,
|
|
60
|
-
anchorRef = _this$state.anchorRef,
|
|
61
|
-
open = _this$state.open;
|
|
62
|
-
var id = "comment-".concat(this.props.commentID);
|
|
63
|
-
var comments = this.props.comments.comments;
|
|
64
|
-
var comment = comments[this.props.commentID] ? comments[this.props.commentID].comment : null;
|
|
65
|
-
var interpreted;
|
|
66
|
-
if (comment) interpreted = (0, _htmlReactParser["default"])(comment);
|
|
67
|
-
var content = interpreted || comment || "ERROR: Could not find comment for id: ".concat(this.props.commentID, ".");
|
|
68
|
-
var style = {
|
|
69
|
-
maxWidth: 200,
|
|
70
|
-
padding: '25px 15px 15px 15px'
|
|
71
|
-
};
|
|
72
|
-
var closeXStyle = {
|
|
73
|
-
"float": 'right',
|
|
74
|
-
padding: 5,
|
|
75
|
-
fontStyle: 'bold'
|
|
76
|
-
};
|
|
77
|
-
return /*#__PURE__*/_react["default"].createElement(_Popper["default"], {
|
|
78
|
-
id: id,
|
|
79
|
-
open: open,
|
|
80
|
-
anchorEl: anchorRef
|
|
81
|
-
}, /*#__PURE__*/_react["default"].createElement(_Fade["default"], {
|
|
82
|
-
"in": open
|
|
83
|
-
}, /*#__PURE__*/_react["default"].createElement(_Paper["default"], {
|
|
84
|
-
className: "editor-comment-content"
|
|
85
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
86
|
-
onClick: this.onClose,
|
|
87
|
-
style: closeXStyle
|
|
88
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
89
|
-
className: "fa fa-window-close"
|
|
90
|
-
})), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
91
|
-
style: style
|
|
92
|
-
}, content))));
|
|
93
|
-
}
|
|
94
|
-
}, {
|
|
95
|
-
key: "render",
|
|
96
|
-
value: function render() {
|
|
97
|
-
var _this2 = this;
|
|
98
|
-
var style = {
|
|
99
|
-
display: 'inline'
|
|
100
|
-
};
|
|
101
|
-
var asteriskStyle = {
|
|
102
|
-
fontStyle: 'bold',
|
|
103
|
-
fontSize: '18pt',
|
|
104
|
-
color: 'red'
|
|
105
|
-
};
|
|
106
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
107
|
-
style: style
|
|
108
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
109
|
-
onClick: function onClick(e) {
|
|
110
|
-
return _this2.onOpen(e);
|
|
111
|
-
},
|
|
112
|
-
style: asteriskStyle
|
|
113
|
-
}, "*"), this.renderPopper());
|
|
114
|
-
}
|
|
115
|
-
}]);
|
|
116
|
-
return EditorComment;
|
|
117
|
-
}(_react.Component);
|
|
118
|
-
function mapStateToProps(state) {
|
|
119
|
-
return {
|
|
120
|
-
comments: state.comments
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
var _default = (0, _reactRedux.connect)(mapStateToProps)(EditorComment);
|
|
124
|
-
exports["default"] = _default;
|