@lvce-editor/title-bar-worker 2.15.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.
@@ -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
@@ -4095,6 +4118,7 @@ const commandMap = {
4095
4118
  'TitleBar.render2': render2,
4096
4119
  'TitleBar.render3': render3,
4097
4120
  'TitleBar.renderEventListeners': renderEventListeners,
4121
+ 'TitleBar.resize': wrapCommand(resize),
4098
4122
  'TitleBar.saveState': saveState,
4099
4123
  'TitleBar.terminate': terminate,
4100
4124
  'TitleBar.toggleIndex': wrapCommand(toggleIndex),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/title-bar-worker",
3
- "version": "2.15.0",
3
+ "version": "2.16.0",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",