bm-core-ui 2.11.1 → 2.11.2
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/build/BMCoreUI.css +8 -6
- package/build/BMView/BMMenu.js +25 -8
- package/build/Core/BMAnimationContext.js +13 -3
- package/lib/BMCoreUI.min.js +1 -1
- package/package.json +1 -1
package/build/BMCoreUI.css
CHANGED
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
background: rgba(245, 245, 245, .8);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
.BMWindow.BMKeyWindow
|
|
195
|
+
.BMWindow.BMKeyWindow, .BMToolWindow {
|
|
196
196
|
backdrop-filter: blur(15px);
|
|
197
197
|
-webkit-backdrop-filter: blur(15px);
|
|
198
198
|
}
|
|
@@ -1169,6 +1169,9 @@ 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);
|
|
1172
1175
|
}
|
|
1173
1176
|
|
|
1174
1177
|
.BMLayoutEditorConstraintPopup::before, .BMMenu::before {
|
|
@@ -1181,11 +1184,6 @@ input:not(:checked) + .BMWindowSwitchGutter > .BMWindowSwitchKnob, .BMWindowSwit
|
|
|
1181
1184
|
bottom: 0;
|
|
1182
1185
|
|
|
1183
1186
|
border-radius: 8px;
|
|
1184
|
-
|
|
1185
|
-
backdrop-filter: blur(25px);
|
|
1186
|
-
-webkit-backdrop-filter: blur(25px);
|
|
1187
|
-
|
|
1188
|
-
z-index: -1;
|
|
1189
1187
|
}
|
|
1190
1188
|
|
|
1191
1189
|
.BMMenuSourceNodeShadow {
|
|
@@ -1332,6 +1330,10 @@ input:not(:checked) + .BMWindowSwitchGutter > .BMWindowSwitchKnob, .BMWindowSwit
|
|
|
1332
1330
|
/* The menu's text element should expand to fill all available space */
|
|
1333
1331
|
.BMMenuItem > span {
|
|
1334
1332
|
flex-grow: 1;
|
|
1333
|
+
|
|
1334
|
+
overflow: hidden;
|
|
1335
|
+
text-overflow: ellipsis;
|
|
1336
|
+
white-space: nowrap;
|
|
1335
1337
|
}
|
|
1336
1338
|
|
|
1337
1339
|
.BMMenuItemHint {
|
package/build/BMView/BMMenu.js
CHANGED
|
@@ -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 >
|
|
1004
|
-
// If the menu doesn't fit towards the right, open it towards the left
|
|
1005
|
-
|
|
1006
|
-
|
|
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
|
+
point.x = rect.origin.x - width;
|
|
1011
|
+
|
|
1012
|
+
menuNode.style.maxWidth = point.x + 'px'
|
|
1013
|
+
}
|
|
1014
|
+
else {
|
|
1015
|
+
menuNode.style.maxWidth = (window.innerWidth - point.x) + 'px';
|
|
1016
|
+
}
|
|
1007
1017
|
}
|
|
1008
|
-
if (height + point.y >
|
|
1009
|
-
// If the menu doesn't fit towards the bottom, open it towards the top
|
|
1010
|
-
|
|
1011
|
-
|
|
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
|
+
point.y = Math.max(rect.bottom + paddingBottom - height, 0);
|
|
1023
|
+
|
|
1024
|
+
menuNode.style.maxHeight = point.y + 'px';
|
|
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
|
}
|