@micromag/viewer 0.3.12 → 0.3.13

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/es/index.js CHANGED
@@ -110,7 +110,7 @@ function checkClickable(el) {
110
110
  function useScreenInteraction() {
111
111
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
112
112
  screens = _ref.screens,
113
- screenId = _ref.screenId,
113
+ screenIndex = _ref.screenIndex,
114
114
  screenWidth = _ref.screenWidth,
115
115
  _ref$isView = _ref.isView,
116
116
  isView = _ref$isView === void 0 ? false : _ref$isView,
@@ -135,10 +135,10 @@ function useScreenInteraction() {
135
135
  screensInteractionEnabled = _useState2[0],
136
136
  setScreensInteractionEnabled = _useState2[1];
137
137
 
138
- var screenIndex = screens.findIndex(function (_ref3) {
139
- var id = _ref3.id;
140
- return id === screenId;
141
- });
138
+ var _ref3 = screens[screenIndex] || {},
139
+ _ref3$id = _ref3.id,
140
+ screenId = _ref3$id === void 0 ? screenIndex : _ref3$id;
141
+
142
142
  var _screensInteractionEn = screensInteractionEnabled[screenId],
143
143
  currentScreenInteractionEnabled = _screensInteractionEn === void 0 ? true : _screensInteractionEn;
144
144
  var updateInteraction = useCallback(function (newValue) {
@@ -1530,7 +1530,7 @@ var Viewer = function Viewer(_ref) {
1530
1530
 
1531
1531
  var _useScreenInteraction = useScreenInteraction({
1532
1532
  screens: screens,
1533
- screenId: screenId,
1533
+ screenIndex: screenIndex,
1534
1534
  screenWidth: screenWidth,
1535
1535
  isView: isView,
1536
1536
  clickOnSiblings: landscape && withLandscapeSiblingsScreens,
package/lib/index.js CHANGED
@@ -128,7 +128,7 @@ function checkClickable(el) {
128
128
  function useScreenInteraction() {
129
129
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
130
130
  screens = _ref.screens,
131
- screenId = _ref.screenId,
131
+ screenIndex = _ref.screenIndex,
132
132
  screenWidth = _ref.screenWidth,
133
133
  _ref$isView = _ref.isView,
134
134
  isView = _ref$isView === void 0 ? false : _ref$isView,
@@ -153,10 +153,10 @@ function useScreenInteraction() {
153
153
  screensInteractionEnabled = _useState2[0],
154
154
  setScreensInteractionEnabled = _useState2[1];
155
155
 
156
- var screenIndex = screens.findIndex(function (_ref3) {
157
- var id = _ref3.id;
158
- return id === screenId;
159
- });
156
+ var _ref3 = screens[screenIndex] || {},
157
+ _ref3$id = _ref3.id,
158
+ screenId = _ref3$id === void 0 ? screenIndex : _ref3$id;
159
+
160
160
  var _screensInteractionEn = screensInteractionEnabled[screenId],
161
161
  currentScreenInteractionEnabled = _screensInteractionEn === void 0 ? true : _screensInteractionEn;
162
162
  var updateInteraction = React.useCallback(function (newValue) {
@@ -1548,7 +1548,7 @@ var Viewer = function Viewer(_ref) {
1548
1548
 
1549
1549
  var _useScreenInteraction = useScreenInteraction({
1550
1550
  screens: screens,
1551
- screenId: screenId,
1551
+ screenIndex: screenIndex,
1552
1552
  screenWidth: screenWidth,
1553
1553
  isView: isView,
1554
1554
  clickOnSiblings: landscape && withLandscapeSiblingsScreens,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/viewer",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "e9b05223938ff0aa87a34349b82f563f67f725e9"
83
+ "gitHead": "b9ccb6d5997faff44a23539239fb71539c9bd43d"
84
84
  }