lost-sia 1.1.3 → 1.2.0

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/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.2.0] - 2022-05-12
8
+ ### Added
9
+ - Added preventScrolling prop onMouseEnter in canvas
10
+
7
11
  ## [1.1.3] - 2022-05-12
8
12
  ### Changed
9
13
  - Move import of semantic-ui-css into index js
package/dist/index.es.js CHANGED
@@ -6983,6 +6983,7 @@ function _inherits$g(subClass, superClass) { if (typeof superClass !== "function
6983
6983
  * when no label was selected by the annotator. If not set "no label" will be used.
6984
6984
  * If ID is used, it needs to be one of the possible label ids.
6985
6985
  * @param {bool} blocked Block canvas view with loading dimmer.
6986
+ * @param {bool} preventScrolling Prevent scrolling on mouseEnter
6986
6987
  * @param {int} nextAnnoId Id that will be used for the next annotation that
6987
6988
  * will be created. If undefined, the canvas will create its own ids.
6988
6989
  * @param {bool} lockedAnnos A list of AnnoIds of annos that should only be displayed.
@@ -7211,8 +7212,18 @@ var Canvas = function (_Component) {
7211
7212
  }, {
7212
7213
  key: 'onMouseOver',
7213
7214
  value: function onMouseOver() {
7214
- //Prevent scrolling on svg
7215
7215
  this.svg.current.focus();
7216
+ //Prevent scrolling on svg
7217
+ if (this.props.preventScrolling) {
7218
+ document.body.style.overflow = 'hidden';
7219
+ }
7220
+ }
7221
+ }, {
7222
+ key: 'onMouseLeave',
7223
+ value: function onMouseLeave() {
7224
+ if (this.props.preventScrolling) {
7225
+ document.body.style.overflow = '';
7226
+ }
7216
7227
  }
7217
7228
  }, {
7218
7229
  key: 'onWheel',
@@ -8642,6 +8653,9 @@ var Canvas = function (_Component) {
8642
8653
  transform: 'scale(' + this.state.svg.scale + ') translate(' + this.state.svg.translateX + ', ' + this.state.svg.translateY + ')',
8643
8654
  onMouseOver: function onMouseOver() {
8644
8655
  _this10.onMouseOver();
8656
+ },
8657
+ onMouseLeave: function onMouseLeave() {
8658
+ _this10.onMouseLeave();
8645
8659
  }
8646
8660
  // onMouseEnter={() => this.svg.current.focus()}
8647
8661
  , onMouseUp: function onMouseUp(e) {
@@ -9856,6 +9870,7 @@ var _slicedToArray$3 = function () { function sliceIterator(arr, i) { var _arr =
9856
9870
  * when no label was selected by the annotator. If not set "no label" will be used.
9857
9871
  * If ID is used, it needs to be one of the possible label ids.
9858
9872
  * @param {bool} blocked Block canvas view with loading dimmer.
9873
+ * @param {bool} preventScrolling Prevent scrolling on mouseEnter
9859
9874
  * @param {int} nextAnnoId Id that will be used for the next annotation that
9860
9875
  * will be created. If undefined, the canvas will create its own ids.
9861
9876
  * @param {bool} lockedAnnos A list of AnnoIds of annos that should only be displayed.
@@ -10156,7 +10171,8 @@ var Sia = function Sia(props) {
10156
10171
  selectedTool: props.selectedTool,
10157
10172
  isJunk: props.isJunk,
10158
10173
  blocked: props.blockCanvas,
10159
- defaultLabel: props.defaultLabel
10174
+ defaultLabel: props.defaultLabel,
10175
+ preventScrolling: props.preventScrolling
10160
10176
  }),
10161
10177
  React.createElement(ToolBar, {
10162
10178
  onToolBarEvent: function onToolBarEvent(e, data) {