@lvce-editor/title-bar-worker 4.8.1 → 4.9.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 +18 -8
- package/package.json +1 -1
|
@@ -1897,6 +1897,7 @@ const TitleBar$2 = 'Title Bar';
|
|
|
1897
1897
|
const MenuBar = 'Menu Bar';
|
|
1898
1898
|
const CommandCenter = 'Command Center';
|
|
1899
1899
|
const CommandPalette = 'Command Palette';
|
|
1900
|
+
const LayoutControls = 'Layout Controls';
|
|
1900
1901
|
const Edit$1 = 'Edit';
|
|
1901
1902
|
const EditorLayout = 'Editor Layout';
|
|
1902
1903
|
const FlipLayout = 'Flip Layout';
|
|
@@ -2005,6 +2006,9 @@ const menuBar = () => {
|
|
|
2005
2006
|
const commandCenter = () => {
|
|
2006
2007
|
return i18nString(CommandCenter);
|
|
2007
2008
|
};
|
|
2009
|
+
const layoutControls = () => {
|
|
2010
|
+
return i18nString(LayoutControls);
|
|
2011
|
+
};
|
|
2008
2012
|
const copy$1 = () => {
|
|
2009
2013
|
return i18nString(Copy$1);
|
|
2010
2014
|
};
|
|
@@ -2121,7 +2125,7 @@ const create3 = (id, uri, x, y, width, height, platform, controlsOverlayEnabled,
|
|
|
2121
2125
|
};
|
|
2122
2126
|
|
|
2123
2127
|
const isEqual$3 = (oldState, newState) => {
|
|
2124
|
-
return oldState.titleBarEntries === newState.titleBarEntries && oldState.width === newState.width && oldState.focusedIndex === newState.focusedIndex && oldState.isMenuOpen === newState.isMenuOpen && oldState.title === newState.title && oldState.workspaceUri === newState.workspaceUri;
|
|
2128
|
+
return oldState.titleBarEntries === newState.titleBarEntries && oldState.titleBarMenuBarEnabled === newState.titleBarMenuBarEnabled && oldState.width === newState.width && oldState.focusedIndex === newState.focusedIndex && oldState.isMenuOpen === newState.isMenuOpen && oldState.title === newState.title && oldState.workspaceUri === newState.workspaceUri;
|
|
2125
2129
|
};
|
|
2126
2130
|
|
|
2127
2131
|
const isEqual$2 = (oldState, newState) => {
|
|
@@ -2171,16 +2175,19 @@ const Ignore = 7;
|
|
|
2171
2175
|
const getMenuEntriesTitleBarContextMenu = async state => {
|
|
2172
2176
|
const {
|
|
2173
2177
|
commandCenterEnabled,
|
|
2174
|
-
titleBarMenuBarEnabled
|
|
2178
|
+
titleBarMenuBarEnabled,
|
|
2179
|
+
uid
|
|
2175
2180
|
} = state;
|
|
2176
2181
|
// TODO checked state should be depending on whether or not that feature is currently visible or not
|
|
2177
2182
|
return [{
|
|
2178
|
-
|
|
2183
|
+
args: [uid, titleBarMenuBarEnabled ? 'hideMenuBar' : 'showMenuBar'],
|
|
2184
|
+
command: 'Viewlet.executeViewletCommand',
|
|
2179
2185
|
flags: titleBarMenuBarEnabled ? Checked : Unchecked,
|
|
2180
2186
|
id: 'MenuBar',
|
|
2181
2187
|
label: menuBar()
|
|
2182
2188
|
}, {
|
|
2183
|
-
|
|
2189
|
+
args: [uid, commandCenterEnabled ? 'hideCommandCenter' : 'showCommandCenter'],
|
|
2190
|
+
command: 'Viewlet.executeViewletCommand',
|
|
2184
2191
|
flags: commandCenterEnabled ? Checked : Unchecked,
|
|
2185
2192
|
id: 'Command center',
|
|
2186
2193
|
label: commandCenter()
|
|
@@ -2188,7 +2195,7 @@ const getMenuEntriesTitleBarContextMenu = async state => {
|
|
|
2188
2195
|
command: '',
|
|
2189
2196
|
flags: Checked,
|
|
2190
2197
|
id: 'layout controls',
|
|
2191
|
-
label:
|
|
2198
|
+
label: layoutControls()
|
|
2192
2199
|
}];
|
|
2193
2200
|
};
|
|
2194
2201
|
|
|
@@ -4282,6 +4289,7 @@ const getTitleBarMenuBarVirtualDom = (menuBarEnabled, visibleItems, focusedIndex
|
|
|
4282
4289
|
ariaActivedescendant: focusedIndex === -1 ? '' : activeId,
|
|
4283
4290
|
childCount: visibleItems.length,
|
|
4284
4291
|
className: mergeClassNames(Viewlet, TitleBarMenuBar),
|
|
4292
|
+
onContextMenu: HandleContextMenu,
|
|
4285
4293
|
onFocusIn: HandleFocusIn,
|
|
4286
4294
|
onFocusOut: HandleFocusOut,
|
|
4287
4295
|
onMouseDown: HandleClick,
|
|
@@ -4329,9 +4337,10 @@ const getTitleBarVirtualDom = state => {
|
|
|
4329
4337
|
}
|
|
4330
4338
|
const iconSrc = getIcon(assetDir);
|
|
4331
4339
|
const visibleEntries = getVisibleTitleBarEntries(titleBarEntries, width, focusedIndex, isMenuOpen);
|
|
4340
|
+
const childCount = Number(titleBarIconEnabled) + Number(titleBarMenuBarEnabled) + Number(titleBarTitleEnabled) + Number(titleBarButtonsEnabled);
|
|
4332
4341
|
return [{
|
|
4333
4342
|
ariaLabel: titleBar(),
|
|
4334
|
-
childCount
|
|
4343
|
+
childCount,
|
|
4335
4344
|
className: mergeClassNames(Viewlet, TitleBar),
|
|
4336
4345
|
id: 'TitleBar',
|
|
4337
4346
|
onContextMenu: HandleTitleBarContextMenu,
|
|
@@ -4383,7 +4392,8 @@ const renderEventListeners = () => {
|
|
|
4383
4392
|
params: ['handleClickMinimize']
|
|
4384
4393
|
}, {
|
|
4385
4394
|
name: HandleContextMenu,
|
|
4386
|
-
params: ['handleContextMenu', Button, ClientX, ClientY]
|
|
4395
|
+
params: ['handleContextMenu', Button, ClientX, ClientY],
|
|
4396
|
+
preventDefault: true
|
|
4387
4397
|
}, {
|
|
4388
4398
|
name: HandleTitleBarContextMenu,
|
|
4389
4399
|
params: ['handleTitleBarContextMenu'],
|
|
@@ -5094,7 +5104,7 @@ const commandMap = {
|
|
|
5094
5104
|
'TitleBar.getCommandIds': getCommandIds,
|
|
5095
5105
|
'TitleBar.getCommands': getCommandIds,
|
|
5096
5106
|
'TitleBar.getKeyBindings': getKeyBindings,
|
|
5097
|
-
'TitleBar.getMenuEntries2': getMenuEntries2,
|
|
5107
|
+
'TitleBar.getMenuEntries2': wrapGetter(getMenuEntries2),
|
|
5098
5108
|
'TitleBar.getMenuIds': getMenuIds,
|
|
5099
5109
|
'TitleBar.handleButtonsClick': handleClick$1,
|
|
5100
5110
|
'TitleBar.handleClick': wrapCommand(handleClick),
|