bm-core-ui 2.11.1 → 2.11.3

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.
@@ -192,7 +192,7 @@
192
192
  background: rgba(245, 245, 245, .8);
193
193
  }
194
194
 
195
- .BMWindow.BMKeyWindow::before, .BMToolWindow::before {
195
+ .BMWindow.BMKeyWindow, .BMToolWindow {
196
196
  backdrop-filter: blur(15px);
197
197
  -webkit-backdrop-filter: blur(15px);
198
198
  }
@@ -1169,6 +1169,11 @@ input:not(:checked) + .BMWindowSwitchGutter > .BMWindowSwitchKnob, .BMWindowSwit
1169
1169
  color: rgba(0, 0, 0, .8);
1170
1170
 
1171
1171
  border-radius: 8px;
1172
+
1173
+ backdrop-filter: blur(25px);
1174
+ -webkit-backdrop-filter: blur(25px);
1175
+
1176
+ overflow-y: auto;
1172
1177
  }
1173
1178
 
1174
1179
  .BMLayoutEditorConstraintPopup::before, .BMMenu::before {
@@ -1181,11 +1186,6 @@ input:not(:checked) + .BMWindowSwitchGutter > .BMWindowSwitchKnob, .BMWindowSwit
1181
1186
  bottom: 0;
1182
1187
 
1183
1188
  border-radius: 8px;
1184
-
1185
- backdrop-filter: blur(25px);
1186
- -webkit-backdrop-filter: blur(25px);
1187
-
1188
- z-index: -1;
1189
1189
  }
1190
1190
 
1191
1191
  .BMMenuSourceNodeShadow {
@@ -1332,6 +1332,10 @@ input:not(:checked) + .BMWindowSwitchGutter > .BMWindowSwitchKnob, .BMWindowSwit
1332
1332
  /* The menu's text element should expand to fill all available space */
1333
1333
  .BMMenuItem > span {
1334
1334
  flex-grow: 1;
1335
+
1336
+ overflow: hidden;
1337
+ text-overflow: ellipsis;
1338
+ white-space: nowrap;
1335
1339
  }
1336
1340
 
1337
1341
  .BMMenuItemHint {
@@ -1417,8 +1421,8 @@ input:not(:checked) + .BMWindowSwitchGutter > .BMWindowSwitchKnob, .BMWindowSwit
1417
1421
  background: transparent;
1418
1422
  color: rgba(0, 0, 0, .8);
1419
1423
 
1420
- backdrop-filter: brightness(90%);
1421
- -webkit-backdrop-filter: brightness(90%);
1424
+ backdrop-filter: brightness(80%);
1425
+ -webkit-backdrop-filter: brightness(80%);
1422
1426
  }
1423
1427
 
1424
1428
  .BMLayoutEditorConstraintPopupOptionHighlighted, .BMMenuItemHighlighted {
@@ -995,20 +995,37 @@ BMMenu.prototype = {
995
995
  // that the first menu item appears directly on the pointer's position
996
996
  const point = BMPointMake(rect.right, rect.origin.y - paddingTop);
997
997
 
998
+ const windowWidth = window.innerWidth;
999
+ const windowHeight = window.innerHeight;
1000
+
998
1001
  // Determine where to place the menu based on where it fits best, preferring towards
999
1002
  // the bottom-right of the origin point
1000
1003
  if (kind == BMMenuKind.PullDownMenu) {
1001
1004
  transformOriginX = '50%';
1002
1005
  }
1003
- else if (width + point.x > document.documentElement.clientWidth) {
1004
- // If the menu doesn't fit towards the right, open it towards the left
1005
- transformOriginX = '100%';
1006
- point.x = rect.origin.x - width;
1006
+ else if (width + point.x > windowWidth) {
1007
+ // If the menu doesn't fit towards the right, open it towards the left, if it has more space
1008
+ if (point.x > windowWidth / 2) {
1009
+ transformOriginX = '100%';
1010
+
1011
+ menuNode.style.maxWidth = point.x + 'px';
1012
+ point.x = rect.origin.x - width;
1013
+ }
1014
+ else {
1015
+ menuNode.style.maxWidth = (window.innerWidth - point.x) + 'px';
1016
+ }
1007
1017
  }
1008
- if (height + point.y > document.documentElement.clientHeight) {
1009
- // If the menu doesn't fit towards the bottom, open it towards the top
1010
- transformOriginY = ' 100%';
1011
- point.y = rect.bottom + paddingBottom - height;
1018
+ if (height + point.y > windowHeight) {
1019
+ // If the menu doesn't fit towards the bottom, open it towards the top, if it has more space
1020
+ if (point.y > windowHeight / 2) {
1021
+ transformOriginY = ' 100%';
1022
+
1023
+ menuNode.style.maxHeight = point.y + 'px';
1024
+ point.y = Math.max(rect.bottom + paddingBottom - height, 0);
1025
+ }
1026
+ else {
1027
+ menuNode.style.maxHeight = (windowHeight - point.y) + 'px';
1028
+ }
1012
1029
  }
1013
1030
  menuNode.style.transformOrigin = transformOriginX + transformOriginY;
1014
1031
 
@@ -499,7 +499,7 @@ export function __BMVelocityAnimate(node, properties, options, useWebAnimations)
499
499
  export function BMHook(element, properties) {
500
500
  if (BM_USE_VELOCITY2) {
501
501
  let node = element;
502
- if (element instanceof window.$) {
502
+ if (window.$ && element instanceof window.$) {
503
503
  node = element[0];
504
504
  }
505
505
 
@@ -969,7 +969,7 @@ export function BMAnimationApplyBlocking(blocking) {
969
969
 
970
970
  // Set up the animation
971
971
  let node = element;
972
- if (element instanceof window.$) {
972
+ if (window.$ && element instanceof window.$) {
973
973
  node = element[0];
974
974
  }
975
975
 
@@ -1071,7 +1071,7 @@ export function BMAnimationApplyBlocking(blocking) {
1071
1071
 
1072
1072
  }
1073
1073
  else if (BM_USE_VELOCITY2) {
1074
- if (element instanceof window.$) {
1074
+ if (window.$ && element instanceof window.$) {
1075
1075
  promises.push(element[0].velocity(animationTargets[i].properties, options));
1076
1076
  }
1077
1077
  else {
@@ -1091,6 +1091,11 @@ export function BMAnimationApplyBlocking(blocking) {
1091
1091
  const properties = animationTargets[i].properties;
1092
1092
  const animationOptions = options;
1093
1093
 
1094
+ // If there are no properties specified for this element, add a dummy tween property
1095
+ if (!Object.keys(properties).length) {
1096
+ properties.tween = [1, 0];
1097
+ }
1098
+
1094
1099
  promises.push(new Promise(async resolve => {
1095
1100
  const delay = options.delay;
1096
1101
  options.delay = undefined;
@@ -1122,6 +1127,11 @@ export function BMAnimationApplyBlocking(blocking) {
1122
1127
  }));
1123
1128
  }
1124
1129
  else {
1130
+ // If there are no properties specified for this element, add a dummy tween property
1131
+ if (!Object.keys(animationTargets[i].properties).length) {
1132
+ animationTargets[i].properties.tween = [1, 0];
1133
+ }
1134
+
1125
1135
  promises.push(velocity.animate(element, animationTargets[i].properties, options));
1126
1136
  }
1127
1137
  }