diff --git a/package-lock.json b/package-lock.json index 49bee85e6..172e352e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "@babel/core": "^7.17.7", + "@babel/core": "^7.17.8", "@babel/plugin-transform-runtime": "^7.17.0", "@babel/preset-env": "^7.16.11", "@babel/preset-react": "^7.16.7", @@ -23,7 +23,7 @@ "express-async-handler": "^1.2.0", "express-static-gzip": "2.1.5", "fs-extra": "10.0.1", - "googleapis": "97.0.0", + "googleapis": "98.0.0", "js-yaml": "^4.1.0", "jwt-simple": "^0.5.6", "less": "^3.13.1", @@ -32,7 +32,7 @@ "marked-extended-tables": "^1.0.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.29.1", - "mongoose": "^6.2.7", + "mongoose": "^6.2.8", "nanoid": "3.3.1", "nconf": "^0.11.3", "query-string": "7.1.1", @@ -85,17 +85,17 @@ } }, "node_modules/@babel/core": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.7.tgz", - "integrity": "sha512-djHlEfFHnSnTAcPb7dATbiM5HxGOP98+3JLBZtjRb5I7RXrw7kFRoG2dXM8cm3H+o11A8IFH/uprmJpwFynRNQ==", + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.8.tgz", + "integrity": "sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==", "dependencies": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.16.7", "@babel/generator": "^7.17.7", "@babel/helper-compilation-targets": "^7.17.7", "@babel/helper-module-transforms": "^7.17.7", - "@babel/helpers": "^7.17.7", - "@babel/parser": "^7.17.7", + "@babel/helpers": "^7.17.8", + "@babel/parser": "^7.17.8", "@babel/template": "^7.16.7", "@babel/traverse": "^7.17.3", "@babel/types": "^7.17.0", @@ -509,9 +509,9 @@ } }, "node_modules/@babel/helpers": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.7.tgz", - "integrity": "sha512-TKsj9NkjJfTBxM7Phfy7kv6yYc4ZcOo+AaWGqQOKTPDOmcGkIFb5xNA746eKisQkm4yavUYh4InYM9S+VnO01w==", + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.8.tgz", + "integrity": "sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw==", "dependencies": { "@babel/template": "^7.16.7", "@babel/traverse": "^7.17.3", @@ -564,9 +564,9 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/@babel/parser": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.7.tgz", - "integrity": "sha512-bm3AQf45vR4gKggRfvJdYJ0gFLoCbsPxiFLSH6hTVYABptNHY6l9NrhnucVjQ/X+SPtLANT9lc0fFhikj+VBRA==", + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.8.tgz", + "integrity": "sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==", "bin": { "parser": "bin/babel-parser.js" }, @@ -6056,9 +6056,9 @@ } }, "node_modules/googleapis": { - "version": "97.0.0", - "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-97.0.0.tgz", - "integrity": "sha512-npfVjA4unKsyKvlBC7nhKq6ReH/lsSkSl+0AcW9/TrjT4Uc5QUyJCd1vhH54k5SGDpVQ0xMyyC06dVRMsNarRw==", + "version": "98.0.0", + "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-98.0.0.tgz", + "integrity": "sha512-gJS+JF03FXouOpHN7dqxg5wrNCBef3ExBtYdCJoX4wlURuy6pixg7SC8sNAjFIXphMZWQ1Bbcu9aKxNv2xCbuQ==", "dependencies": { "google-auth-library": "^7.0.2", "googleapis-common": "^5.0.2" @@ -9312,9 +9312,9 @@ } }, "node_modules/mongoose": { - "version": "6.2.7", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.2.7.tgz", - "integrity": "sha512-yqTZcM3u0+aLzl6cirtXy6vr24kt+kFyTucCQ3pyncvO1jGn/M1R09qkC/v54QoPXeVJdpcuS5eQWn0NLlDvKA==", + "version": "6.2.8", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.2.8.tgz", + "integrity": "sha512-Wq6HG0sOJEQHp5YqMlxrnf93vBFwdY2zlAwqI97EPPSt69kiVV21pTv4cDanrCNWi4upG8ajQ/p9jpDjcECjkQ==", "dependencies": { "bson": "^4.2.2", "kareem": "2.3.4", @@ -13120,17 +13120,17 @@ "integrity": "sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ==" }, "@babel/core": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.7.tgz", - "integrity": "sha512-djHlEfFHnSnTAcPb7dATbiM5HxGOP98+3JLBZtjRb5I7RXrw7kFRoG2dXM8cm3H+o11A8IFH/uprmJpwFynRNQ==", + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.8.tgz", + "integrity": "sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==", "requires": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.16.7", "@babel/generator": "^7.17.7", "@babel/helper-compilation-targets": "^7.17.7", "@babel/helper-module-transforms": "^7.17.7", - "@babel/helpers": "^7.17.7", - "@babel/parser": "^7.17.7", + "@babel/helpers": "^7.17.8", + "@babel/parser": "^7.17.8", "@babel/template": "^7.16.7", "@babel/traverse": "^7.17.3", "@babel/types": "^7.17.0", @@ -13433,9 +13433,9 @@ } }, "@babel/helpers": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.7.tgz", - "integrity": "sha512-TKsj9NkjJfTBxM7Phfy7kv6yYc4ZcOo+AaWGqQOKTPDOmcGkIFb5xNA746eKisQkm4yavUYh4InYM9S+VnO01w==", + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.8.tgz", + "integrity": "sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw==", "requires": { "@babel/template": "^7.16.7", "@babel/traverse": "^7.17.3", @@ -13478,9 +13478,9 @@ } }, "@babel/parser": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.7.tgz", - "integrity": "sha512-bm3AQf45vR4gKggRfvJdYJ0gFLoCbsPxiFLSH6hTVYABptNHY6l9NrhnucVjQ/X+SPtLANT9lc0fFhikj+VBRA==" + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.8.tgz", + "integrity": "sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==" }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { "version": "7.16.7", @@ -17690,9 +17690,9 @@ } }, "googleapis": { - "version": "97.0.0", - "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-97.0.0.tgz", - "integrity": "sha512-npfVjA4unKsyKvlBC7nhKq6ReH/lsSkSl+0AcW9/TrjT4Uc5QUyJCd1vhH54k5SGDpVQ0xMyyC06dVRMsNarRw==", + "version": "98.0.0", + "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-98.0.0.tgz", + "integrity": "sha512-gJS+JF03FXouOpHN7dqxg5wrNCBef3ExBtYdCJoX4wlURuy6pixg7SC8sNAjFIXphMZWQ1Bbcu9aKxNv2xCbuQ==", "requires": { "google-auth-library": "^7.0.2", "googleapis-common": "^5.0.2" @@ -20160,9 +20160,9 @@ } }, "mongoose": { - "version": "6.2.7", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.2.7.tgz", - "integrity": "sha512-yqTZcM3u0+aLzl6cirtXy6vr24kt+kFyTucCQ3pyncvO1jGn/M1R09qkC/v54QoPXeVJdpcuS5eQWn0NLlDvKA==", + "version": "6.2.8", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.2.8.tgz", + "integrity": "sha512-Wq6HG0sOJEQHp5YqMlxrnf93vBFwdY2zlAwqI97EPPSt69kiVV21pTv4cDanrCNWi4upG8ajQ/p9jpDjcECjkQ==", "requires": { "bson": "^4.2.2", "kareem": "2.3.4", diff --git a/package.json b/package.json index 477cd5b65..88ab6b494 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ ] }, "dependencies": { - "@babel/core": "^7.17.7", + "@babel/core": "^7.17.8", "@babel/plugin-transform-runtime": "^7.17.0", "@babel/preset-env": "^7.16.11", "@babel/preset-react": "^7.16.7", @@ -61,7 +61,7 @@ "express-async-handler": "^1.2.0", "express-static-gzip": "2.1.5", "fs-extra": "10.0.1", - "googleapis": "97.0.0", + "googleapis": "98.0.0", "js-yaml": "^4.1.0", "jwt-simple": "^0.5.6", "less": "^3.13.1", @@ -70,7 +70,7 @@ "marked-extended-tables": "^1.0.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.29.1", - "mongoose": "^6.2.7", + "mongoose": "^6.2.8", "nanoid": "3.3.1", "nconf": "^0.11.3", "query-string": "7.1.1", diff --git a/shared/naturalcrit/splitPane/splitPane.jsx b/shared/naturalcrit/splitPane/splitPane.jsx index 1b4cee5ae..4d138e30b 100644 --- a/shared/naturalcrit/splitPane/splitPane.jsx +++ b/shared/naturalcrit/splitPane/splitPane.jsx @@ -10,43 +10,69 @@ const SplitPane = createClass({ return { storageKey : 'naturalcrit-pane-split', onDragFinish : function(){} //fires when dragging - }; }, + getInitialState : function() { return { - size : null, - isDragging : false + currentDividerPos : null, + windowWidth : 0, + isDragging : false }; }, + componentDidMount : function() { - const paneSize = window.localStorage.getItem(this.props.storageKey); - if(paneSize){ + const dividerPos = window.localStorage.getItem(this.props.storageKey); + if(dividerPos){ this.setState({ - size : paneSize + currentDividerPos : this.limitPosition(dividerPos, 0.1*(window.innerWidth-13), 0.9*(window.innerWidth-13)), + userSetDividerPos : dividerPos, + windowWidth : window.innerWidth }); } + window.addEventListener('resize', this.handleWindowResize); + }, + + componentWillUnmount : function() { + window.removeEventListener('resize', this.handleWindowResize); + }, + + handleWindowResize : function() { + // Allow divider to increase in size to last user-set position + // Limit current position to between 10% and 90% of visible space + const newLoc = this.limitPosition(this.state.userSetDividerPos, 0.1*(window.innerWidth-13), 0.9*(window.innerWidth-13)); + + this.setState({ + currentDividerPos : newLoc, + windowWidth : window.innerWidth + }); + }, + + limitPosition : function(x, min = 1, max = window.innerWidth - 13) { + const result = Math.round(Math.min(max, Math.max(min, x))); + return result; }, handleUp : function(){ if(this.state.isDragging){ - this.props.onDragFinish(this.state.size); - window.localStorage.setItem(this.props.storageKey, this.state.size); + this.props.onDragFinish(this.state.currentDividerPos); + window.localStorage.setItem(this.props.storageKey, this.state.currentDividerPos); } this.setState({ isDragging: false }); }, + handleDown : function(){ this.setState({ isDragging: true }); //this.unFocus() }, + handleMove : function(e){ if(!this.state.isDragging) return; - const minWidth = 1; - const maxWidth = window.innerWidth - 13; - const newSize = Math.min(maxWidth, Math.max(minWidth, e.pageX)); + const newSize = this.limitPosition(e.pageX); this.setState({ - size : newSize + currentDividerPos : newSize, + userSetDividerPos : newSize }); }, /* @@ -70,7 +96,7 @@ const SplitPane = createClass({ render : function(){ return
- {this.props.children[0]} + {this.props.children[0]} {this.renderDivider()} {this.props.children[1]}
; diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index 6b104eadd..0ca89693b 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -658,7 +658,7 @@ body { margin-bottom : 0.3cm; } a{ - display : table; + display : inline; color : inherit; text-decoration : none; &:hover{