@lvce-editor/title-bar-worker 2.14.0 → 2.16.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/dist/titleBarWorkerMain.js +33 -8
- package/package.json +1 -1
|
@@ -1300,35 +1300,35 @@ const FocusTitleBarMenuBar = 26;
|
|
|
1300
1300
|
const getKeyBindings$1 = () => {
|
|
1301
1301
|
return [{
|
|
1302
1302
|
key: DownArrow$2,
|
|
1303
|
-
command: '
|
|
1303
|
+
command: 'TitleBar.handleKeyArrowDown',
|
|
1304
1304
|
when: FocusTitleBarMenuBar
|
|
1305
1305
|
}, {
|
|
1306
1306
|
key: UpArrow$2,
|
|
1307
|
-
command: '
|
|
1307
|
+
command: 'TitleBar.handleKeyArrowUp',
|
|
1308
1308
|
when: FocusTitleBarMenuBar
|
|
1309
1309
|
}, {
|
|
1310
1310
|
key: RightArrow$2,
|
|
1311
|
-
command: '
|
|
1311
|
+
command: 'TitleBar.handleKeyArrowRight',
|
|
1312
1312
|
when: FocusTitleBarMenuBar
|
|
1313
1313
|
}, {
|
|
1314
1314
|
key: LeftArrow$2,
|
|
1315
|
-
command: '
|
|
1315
|
+
command: 'TitleBar.handleKeyArrowLeft',
|
|
1316
1316
|
when: FocusTitleBarMenuBar
|
|
1317
1317
|
}, {
|
|
1318
1318
|
key: Space$2,
|
|
1319
|
-
command: '
|
|
1319
|
+
command: 'TitleBar.handleKeySpace',
|
|
1320
1320
|
when: FocusTitleBarMenuBar
|
|
1321
1321
|
}, {
|
|
1322
1322
|
key: Home$2,
|
|
1323
|
-
command: '
|
|
1323
|
+
command: 'TitleBar.handleKeyHome',
|
|
1324
1324
|
when: FocusTitleBarMenuBar
|
|
1325
1325
|
}, {
|
|
1326
1326
|
key: End$2,
|
|
1327
|
-
command: '
|
|
1327
|
+
command: 'TitleBar.handleKeyEnd',
|
|
1328
1328
|
when: FocusTitleBarMenuBar
|
|
1329
1329
|
}, {
|
|
1330
1330
|
key: Escape$2,
|
|
1331
|
-
command: '
|
|
1331
|
+
command: 'TitleBar.handleKeyEscape',
|
|
1332
1332
|
when: FocusTitleBarMenuBar
|
|
1333
1333
|
}];
|
|
1334
1334
|
};
|
|
@@ -3527,6 +3527,29 @@ const renderEventListeners = () => {
|
|
|
3527
3527
|
}];
|
|
3528
3528
|
};
|
|
3529
3529
|
|
|
3530
|
+
const getTitleBarMenuBarWidth = (width, menuBarX, titleBarButtonsWidth) => {
|
|
3531
|
+
const remainingWidth = width - menuBarX - titleBarButtonsWidth;
|
|
3532
|
+
return remainingWidth;
|
|
3533
|
+
};
|
|
3534
|
+
const resize = async (state, dimensions) => {
|
|
3535
|
+
const {
|
|
3536
|
+
titleBarIconWidth,
|
|
3537
|
+
titleBarButtonsWidth
|
|
3538
|
+
} = state;
|
|
3539
|
+
const menuBarX = dimensions.x + titleBarIconWidth;
|
|
3540
|
+
const menuBarY = dimensions.y;
|
|
3541
|
+
const menuBarWidth = getTitleBarMenuBarWidth(dimensions.width, menuBarX, titleBarButtonsWidth);
|
|
3542
|
+
const menuBarHeight = dimensions.height;
|
|
3543
|
+
return {
|
|
3544
|
+
...state,
|
|
3545
|
+
...dimensions,
|
|
3546
|
+
x: menuBarX,
|
|
3547
|
+
y: menuBarY,
|
|
3548
|
+
width: menuBarWidth,
|
|
3549
|
+
height: menuBarHeight
|
|
3550
|
+
};
|
|
3551
|
+
};
|
|
3552
|
+
|
|
3530
3553
|
const saveState = uid => {
|
|
3531
3554
|
return {
|
|
3532
3555
|
x: 1
|
|
@@ -4049,6 +4072,7 @@ const commandMap = {
|
|
|
4049
4072
|
'TitleBar.diff2': diff2,
|
|
4050
4073
|
'TitleBar.diff3': diff3,
|
|
4051
4074
|
'TitleBar.focus': wrapCommand(focus),
|
|
4075
|
+
'TitleBar.focusMenuBar': wrapCommand(focus),
|
|
4052
4076
|
'TitleBar.focusFirst': wrapCommand(focusFirst),
|
|
4053
4077
|
'TitleBar.focusIndex': wrapCommand(focusLast),
|
|
4054
4078
|
'TitleBar.focusLast': wrapCommand(focusIndex),
|
|
@@ -4094,6 +4118,7 @@ const commandMap = {
|
|
|
4094
4118
|
'TitleBar.render2': render2,
|
|
4095
4119
|
'TitleBar.render3': render3,
|
|
4096
4120
|
'TitleBar.renderEventListeners': renderEventListeners,
|
|
4121
|
+
'TitleBar.resize': wrapCommand(resize),
|
|
4097
4122
|
'TitleBar.saveState': saveState,
|
|
4098
4123
|
'TitleBar.terminate': terminate,
|
|
4099
4124
|
'TitleBar.toggleIndex': wrapCommand(toggleIndex),
|