@micromag/core 0.2.384 → 0.2.386

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/hooks.js CHANGED
@@ -1125,21 +1125,30 @@ var useScreenSizeFromElement = function useScreenSizeFromElement() {
1125
1125
  var fullWidth = width !== null ? width : calculatedWidth;
1126
1126
  var fullHeight = height !== null ? height : calculatedHeight;
1127
1127
  var landscape = fullHeight > 0 && fullWidth > fullHeight;
1128
- var _opts$withoutMaxSize = opts.withoutMaxSize,
1129
- withoutMaxSize = _opts$withoutMaxSize === void 0 ? false : _opts$withoutMaxSize;
1128
+
1129
+ var _ref6 = opts || {},
1130
+ _ref6$withoutMaxSize = _ref6.withoutMaxSize,
1131
+ withoutMaxSize = _ref6$withoutMaxSize === void 0 ? false : _ref6$withoutMaxSize,
1132
+ _ref6$desktopHeightTh = _ref6.desktopHeightThreshold,
1133
+ desktopHeightThreshold = _ref6$desktopHeightTh === void 0 ? 600 : _ref6$desktopHeightTh,
1134
+ _ref6$desktopHeightRa = _ref6.desktopHeightRatio,
1135
+ desktopHeightRatio = _ref6$desktopHeightRa === void 0 ? 3 / 4 : _ref6$desktopHeightRa,
1136
+ _ref6$screenRatio = _ref6.screenRatio,
1137
+ screenRatio = _ref6$screenRatio === void 0 ? 2 / 3 : _ref6$screenRatio;
1138
+
1130
1139
  var landscapeWithMaxSize = landscape && !withoutMaxSize;
1131
1140
  var finalWidth = fullWidth;
1132
1141
  var finalHeight = fullHeight;
1133
1142
  var menuOverScreen = !landscape;
1134
1143
 
1135
1144
  if (landscapeWithMaxSize) {
1136
- if (fullHeight < 600) {
1145
+ if (fullHeight < desktopHeightThreshold) {
1137
1146
  menuOverScreen = true;
1138
1147
  } else {
1139
- finalHeight = Math.round(fullHeight * 3 / 4);
1148
+ finalHeight = Math.round(fullHeight * desktopHeightRatio);
1140
1149
  }
1141
1150
 
1142
- finalWidth = Math.round(finalHeight * 2 / 3);
1151
+ finalWidth = Math.round(finalHeight * screenRatio);
1143
1152
  }
1144
1153
 
1145
1154
  if (finalWidth % 2 === 1) {
package/lib/hooks.js CHANGED
@@ -1161,21 +1161,30 @@ var useScreenSizeFromElement = function useScreenSizeFromElement() {
1161
1161
  var fullWidth = width !== null ? width : calculatedWidth;
1162
1162
  var fullHeight = height !== null ? height : calculatedHeight;
1163
1163
  var landscape = fullHeight > 0 && fullWidth > fullHeight;
1164
- var _opts$withoutMaxSize = opts.withoutMaxSize,
1165
- withoutMaxSize = _opts$withoutMaxSize === void 0 ? false : _opts$withoutMaxSize;
1164
+
1165
+ var _ref6 = opts || {},
1166
+ _ref6$withoutMaxSize = _ref6.withoutMaxSize,
1167
+ withoutMaxSize = _ref6$withoutMaxSize === void 0 ? false : _ref6$withoutMaxSize,
1168
+ _ref6$desktopHeightTh = _ref6.desktopHeightThreshold,
1169
+ desktopHeightThreshold = _ref6$desktopHeightTh === void 0 ? 600 : _ref6$desktopHeightTh,
1170
+ _ref6$desktopHeightRa = _ref6.desktopHeightRatio,
1171
+ desktopHeightRatio = _ref6$desktopHeightRa === void 0 ? 3 / 4 : _ref6$desktopHeightRa,
1172
+ _ref6$screenRatio = _ref6.screenRatio,
1173
+ screenRatio = _ref6$screenRatio === void 0 ? 2 / 3 : _ref6$screenRatio;
1174
+
1166
1175
  var landscapeWithMaxSize = landscape && !withoutMaxSize;
1167
1176
  var finalWidth = fullWidth;
1168
1177
  var finalHeight = fullHeight;
1169
1178
  var menuOverScreen = !landscape;
1170
1179
 
1171
1180
  if (landscapeWithMaxSize) {
1172
- if (fullHeight < 600) {
1181
+ if (fullHeight < desktopHeightThreshold) {
1173
1182
  menuOverScreen = true;
1174
1183
  } else {
1175
- finalHeight = Math.round(fullHeight * 3 / 4);
1184
+ finalHeight = Math.round(fullHeight * desktopHeightRatio);
1176
1185
  }
1177
1186
 
1178
- finalWidth = Math.round(finalHeight * 2 / 3);
1187
+ finalWidth = Math.round(finalHeight * screenRatio);
1179
1188
  }
1180
1189
 
1181
1190
  if (finalWidth % 2 === 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/core",
3
- "version": "0.2.384",
3
+ "version": "0.2.386",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -125,5 +125,5 @@
125
125
  "publishConfig": {
126
126
  "access": "public"
127
127
  },
128
- "gitHead": "cfe309fba4ad374b6cd483e588d90ab3b76d2f5b"
128
+ "gitHead": "ea1fb37b6e8b421e8df78c50d392187420cadc70"
129
129
  }