@lvce-editor/title-bar-worker 4.3.0 → 4.5.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 +188 -12
- package/package.json +1 -1
|
@@ -1582,6 +1582,8 @@ const CommandCenter = 'Command Center';
|
|
|
1582
1582
|
const CommandPalette = 'Command Palette';
|
|
1583
1583
|
const Edit$1 = 'Edit';
|
|
1584
1584
|
const EditorLayout = 'Editor Layout';
|
|
1585
|
+
const FlipLayout = 'Flip Layout';
|
|
1586
|
+
const GridTwoByTwo = 'Grid (2x2)';
|
|
1585
1587
|
const Explorer = 'Explorer';
|
|
1586
1588
|
const File$2 = 'File';
|
|
1587
1589
|
const Go$1 = 'Go';
|
|
@@ -1609,6 +1611,7 @@ const AddCursorsToLineEnds = 'Add Cursors to Line ends';
|
|
|
1609
1611
|
const AddNextOccurrence = 'Add Next Occurrence';
|
|
1610
1612
|
const AddPreviousOccurrence = 'Add Previous Occurrence';
|
|
1611
1613
|
const Copy$1 = 'Copy';
|
|
1614
|
+
const CopyEditorIntoNewWindow = 'Copy Editor into New Window';
|
|
1612
1615
|
const CopyLineDown = 'Copy Line Down';
|
|
1613
1616
|
const CopyLineUp = 'Copy Line Up';
|
|
1614
1617
|
const Cut$1 = 'Cut';
|
|
@@ -1616,13 +1619,25 @@ const DuplicateSelection = 'Duplicate Selection';
|
|
|
1616
1619
|
const ExpandSelection = 'Expand Selection';
|
|
1617
1620
|
const MoveLineDown = 'Move Line Down';
|
|
1618
1621
|
const MoveLineUp = 'Move Line Up';
|
|
1622
|
+
const MoveEditorIntoNewWindow = 'Move Editor into New Window';
|
|
1619
1623
|
const Paste$1 = 'Paste';
|
|
1620
1624
|
const Redo$1 = 'Redo';
|
|
1621
1625
|
const SelectAll$1 = 'Select All';
|
|
1622
1626
|
const SelectAllOccurrences = 'Select All Occurrences';
|
|
1623
1627
|
const ShrinkSelection = 'Shrink Selection';
|
|
1628
|
+
const Single = 'Single';
|
|
1629
|
+
const SplitDown = 'Split Down';
|
|
1630
|
+
const SplitLeft = 'Split Left';
|
|
1631
|
+
const SplitRight = 'Split Right';
|
|
1632
|
+
const SplitUp = 'Split Up';
|
|
1633
|
+
const ThreeColumns = 'Three Columns';
|
|
1634
|
+
const ThreeRows = 'Three Rows';
|
|
1624
1635
|
const ToggleBlockComment = 'Toggle Block Comment';
|
|
1625
1636
|
const ToggleLineComment = 'Toggle Line Comment';
|
|
1637
|
+
const TwoColumns = 'Two Columns';
|
|
1638
|
+
const TwoColumnsBottom = 'Two Columns Bottom';
|
|
1639
|
+
const TwoRows = 'Two Rows';
|
|
1640
|
+
const TwoRowsRight = 'Two Rows Right';
|
|
1626
1641
|
const Undo$1 = 'Undo';
|
|
1627
1642
|
|
|
1628
1643
|
const file = () => {
|
|
@@ -1857,8 +1872,10 @@ const getMenuEntriesTitleBarContextMenu = async state => {
|
|
|
1857
1872
|
const MenuIdTitleBarContextMenu = 50;
|
|
1858
1873
|
const MenuIdAppearance = 'appearance';
|
|
1859
1874
|
const MenuIdEditorLayout = 'editorLayout';
|
|
1875
|
+
const MenuIdSwitchEditor = 'switchEditor';
|
|
1876
|
+
const MenuIdSwitchGroup = 'switchGroup';
|
|
1860
1877
|
const getMenuIds = () => {
|
|
1861
|
-
return [Edit$2, File$3, Go$2, Help$3, OpenRecent$1, Run$2, Selection$2, Terminal$2, TitleBar$3, View$2, MenuIdTitleBarContextMenu, TitleBarContextMenu];
|
|
1878
|
+
return [Edit$2, File$3, Go$2, Help$3, OpenRecent$1, Run$2, Selection$2, Terminal$2, TitleBar$3, View$2, MenuIdAppearance, MenuIdEditorLayout, MenuIdSwitchEditor, MenuIdSwitchGroup, MenuIdTitleBarContextMenu, TitleBarContextMenu];
|
|
1862
1879
|
};
|
|
1863
1880
|
|
|
1864
1881
|
const hasActiveTextEditor = async mainAreaUid => {
|
|
@@ -1869,8 +1886,38 @@ const hasActiveTextEditor = async mainAreaUid => {
|
|
|
1869
1886
|
}
|
|
1870
1887
|
};
|
|
1871
1888
|
|
|
1889
|
+
const menuEntrySeparator = {
|
|
1890
|
+
command: '',
|
|
1891
|
+
flags: Separator$1,
|
|
1892
|
+
id: 'separator',
|
|
1893
|
+
label: ''
|
|
1894
|
+
};
|
|
1895
|
+
|
|
1896
|
+
const notImplementedArgs$1 = [{
|
|
1897
|
+
message: 'not implemented'
|
|
1898
|
+
}];
|
|
1899
|
+
const entry = (id, label, keyboardShortCut = '') => {
|
|
1900
|
+
return {
|
|
1901
|
+
args: notImplementedArgs$1,
|
|
1902
|
+
command: 'Dialog.showMessage',
|
|
1903
|
+
flags: None,
|
|
1904
|
+
id,
|
|
1905
|
+
keyboardShortCut,
|
|
1906
|
+
label
|
|
1907
|
+
};
|
|
1908
|
+
};
|
|
1909
|
+
const checkedEntry = (id, label, keyboardShortCut = '') => {
|
|
1910
|
+
return {
|
|
1911
|
+
args: notImplementedArgs$1,
|
|
1912
|
+
command: 'Dialog.showMessage',
|
|
1913
|
+
flags: Checked,
|
|
1914
|
+
id,
|
|
1915
|
+
keyboardShortCut,
|
|
1916
|
+
label
|
|
1917
|
+
};
|
|
1918
|
+
};
|
|
1872
1919
|
const getMenuEntries$e = () => {
|
|
1873
|
-
return [];
|
|
1920
|
+
return [entry('fullScreen', 'Full Screen', 'F11'), entry('zenMode', 'Zen Mode', 'Ctrl+K Z'), entry('centeredLayout', 'Centered Layout'), menuEntrySeparator, checkedEntry('menuBar', 'Menu Bar'), entry('primarySideBar', 'Primary Side Bar', 'Ctrl+B'), entry('secondarySideBar', 'Secondary Side Bar', 'Ctrl+Alt+B'), checkedEntry('statusBar', 'Status Bar'), checkedEntry('panel', 'Panel', 'Ctrl+J'), menuEntrySeparator, entry('movePrimarySideBarLeft', 'Move Primary Side Bar Left'), entry('activityBarPosition', 'Activity Bar Position'), entry('panelPosition', 'Panel Position'), entry('alignPanel', 'Align Panel'), entry('tabBar', 'Tab Bar'), entry('editorActionsPosition', 'Editor Actions Position'), menuEntrySeparator, entry('minimap', 'Minimap'), entry('breadcrumbs', 'Breadcrumbs'), entry('stickyScroll', 'Sticky Scroll'), entry('renderWhitespace', 'Render Whitespace'), checkedEntry('renderControlCharacters', 'Render Control Characters'), menuEntrySeparator, entry('zoomIn', 'Zoom In', 'Ctrl+='), entry('zoomOut', 'Zoom Out', 'Ctrl+-'), entry('resetZoom', 'Reset Zoom', 'Ctrl+NumPad0')];
|
|
1874
1921
|
};
|
|
1875
1922
|
|
|
1876
1923
|
const cut = () => {
|
|
@@ -1937,13 +1984,6 @@ const selectAllOccurrences = () => {
|
|
|
1937
1984
|
return i18nString(SelectAllOccurrences);
|
|
1938
1985
|
};
|
|
1939
1986
|
|
|
1940
|
-
const menuEntrySeparator = {
|
|
1941
|
-
command: '',
|
|
1942
|
-
flags: Separator$1,
|
|
1943
|
-
id: 'separator',
|
|
1944
|
-
label: ''
|
|
1945
|
-
};
|
|
1946
|
-
|
|
1947
1987
|
const getMenuEntries$d = () => {
|
|
1948
1988
|
return [{
|
|
1949
1989
|
command: /* TODO */'-1',
|
|
@@ -1984,7 +2024,85 @@ const getMenuEntries$d = () => {
|
|
|
1984
2024
|
};
|
|
1985
2025
|
|
|
1986
2026
|
const getMenuEntries$c = () => {
|
|
1987
|
-
return [
|
|
2027
|
+
return [{
|
|
2028
|
+
command: 'MainArea.splitUp',
|
|
2029
|
+
flags: None,
|
|
2030
|
+
id: 'splitUp',
|
|
2031
|
+
keyboardShortCut: 'Ctrl+K Ctrl+\\',
|
|
2032
|
+
label: i18nString(SplitUp)
|
|
2033
|
+
}, {
|
|
2034
|
+
command: 'MainArea.splitDown',
|
|
2035
|
+
flags: None,
|
|
2036
|
+
id: 'splitDown',
|
|
2037
|
+
label: i18nString(SplitDown)
|
|
2038
|
+
}, {
|
|
2039
|
+
command: 'MainArea.splitLeft',
|
|
2040
|
+
flags: None,
|
|
2041
|
+
id: 'splitLeft',
|
|
2042
|
+
label: i18nString(SplitLeft)
|
|
2043
|
+
}, {
|
|
2044
|
+
command: 'MainArea.splitRight',
|
|
2045
|
+
flags: None,
|
|
2046
|
+
id: 'splitRight',
|
|
2047
|
+
label: i18nString(SplitRight)
|
|
2048
|
+
}, menuEntrySeparator, {
|
|
2049
|
+
command: 'MainArea.moveIntoNewWindow',
|
|
2050
|
+
flags: None,
|
|
2051
|
+
id: 'moveEditorIntoNewWindow',
|
|
2052
|
+
label: i18nString(MoveEditorIntoNewWindow)
|
|
2053
|
+
}, {
|
|
2054
|
+
command: 'MainArea.copyIntoNewWindow',
|
|
2055
|
+
flags: None,
|
|
2056
|
+
id: 'copyEditorIntoNewWindow',
|
|
2057
|
+
keyboardShortCut: 'Ctrl+K O',
|
|
2058
|
+
label: i18nString(CopyEditorIntoNewWindow)
|
|
2059
|
+
}, menuEntrySeparator, {
|
|
2060
|
+
command: 'MainArea.setEditorLayoutSingle',
|
|
2061
|
+
flags: None,
|
|
2062
|
+
id: 'single',
|
|
2063
|
+
label: i18nString(Single)
|
|
2064
|
+
}, {
|
|
2065
|
+
command: 'MainArea.setEditorLayoutTwoColumns',
|
|
2066
|
+
flags: None,
|
|
2067
|
+
id: 'twoColumns',
|
|
2068
|
+
label: i18nString(TwoColumns)
|
|
2069
|
+
}, {
|
|
2070
|
+
command: 'MainArea.setEditorLayoutThreeColumns',
|
|
2071
|
+
flags: None,
|
|
2072
|
+
id: 'threeColumns',
|
|
2073
|
+
label: i18nString(ThreeColumns)
|
|
2074
|
+
}, {
|
|
2075
|
+
command: 'MainArea.setEditorLayoutTwoRows',
|
|
2076
|
+
flags: None,
|
|
2077
|
+
id: 'twoRows',
|
|
2078
|
+
label: i18nString(TwoRows)
|
|
2079
|
+
}, {
|
|
2080
|
+
command: 'MainArea.setEditorLayoutThreeRows',
|
|
2081
|
+
flags: None,
|
|
2082
|
+
id: 'threeRows',
|
|
2083
|
+
label: i18nString(ThreeRows)
|
|
2084
|
+
}, {
|
|
2085
|
+
command: 'MainArea.setEditorLayoutGrid',
|
|
2086
|
+
flags: None,
|
|
2087
|
+
id: 'gridTwoByTwo',
|
|
2088
|
+
label: i18nString(GridTwoByTwo)
|
|
2089
|
+
}, {
|
|
2090
|
+
command: 'MainArea.setEditorLayoutTwoRowsRight',
|
|
2091
|
+
flags: None,
|
|
2092
|
+
id: 'twoRowsRight',
|
|
2093
|
+
label: i18nString(TwoRowsRight)
|
|
2094
|
+
}, {
|
|
2095
|
+
command: 'MainArea.setEditorLayoutTwoColumnsBottom',
|
|
2096
|
+
flags: None,
|
|
2097
|
+
id: 'twoColumnsBottom',
|
|
2098
|
+
label: i18nString(TwoColumnsBottom)
|
|
2099
|
+
}, menuEntrySeparator, {
|
|
2100
|
+
command: 'MainArea.flipEditorLayout',
|
|
2101
|
+
flags: None,
|
|
2102
|
+
id: 'flipLayout',
|
|
2103
|
+
keyboardShortCut: 'Shift+Alt+8',
|
|
2104
|
+
label: i18nString(FlipLayout)
|
|
2105
|
+
}];
|
|
1988
2106
|
};
|
|
1989
2107
|
|
|
1990
2108
|
/**
|
|
@@ -2110,8 +2228,37 @@ const getMenuEntries$b = async (platform, autoSave$1, hasActiveTextEditor = fals
|
|
|
2110
2228
|
return entries;
|
|
2111
2229
|
};
|
|
2112
2230
|
|
|
2231
|
+
const notImplementedMessage = {
|
|
2232
|
+
message: 'Not implemented'
|
|
2233
|
+
};
|
|
2234
|
+
const notImplementedArgs = [notImplementedMessage, ['OK']];
|
|
2235
|
+
const notImplementedEntry = (id, label) => {
|
|
2236
|
+
return {
|
|
2237
|
+
args: notImplementedArgs,
|
|
2238
|
+
command: 'Dialog.showMessage',
|
|
2239
|
+
flags: None,
|
|
2240
|
+
id,
|
|
2241
|
+
label
|
|
2242
|
+
};
|
|
2243
|
+
};
|
|
2113
2244
|
const getMenuEntries$a = () => {
|
|
2114
|
-
return [
|
|
2245
|
+
return [notImplementedEntry('back', 'Back'), notImplementedEntry('forward', 'Forward'), notImplementedEntry('lastEditLocation', 'Last Edit Location'), menuEntrySeparator, {
|
|
2246
|
+
command: '',
|
|
2247
|
+
flags: SubMenu$1,
|
|
2248
|
+
id: MenuIdSwitchEditor,
|
|
2249
|
+
label: 'Switch Editor'
|
|
2250
|
+
}, {
|
|
2251
|
+
command: '',
|
|
2252
|
+
flags: SubMenu$1,
|
|
2253
|
+
id: MenuIdSwitchGroup,
|
|
2254
|
+
label: 'Switch Group'
|
|
2255
|
+
}, menuEntrySeparator, notImplementedEntry('goToFile', 'Go to File...'), notImplementedEntry('goToSymbolInWorkspace', 'Go to Symbol in Workspace...'), menuEntrySeparator, notImplementedEntry('goToSymbolInEditor', 'Go to Symbol in Editor...'), notImplementedEntry('goToDefinition', 'Go to Definition'), notImplementedEntry('goToDeclaration', 'Go to Declaration'), notImplementedEntry('goToTypeDefinition', 'Go to Type Definition'), notImplementedEntry('goToImplementations', 'Go to Implementations'), notImplementedEntry('goToReferences', 'Go to References'), menuEntrySeparator, notImplementedEntry('goToLineColumn', 'Go to Line/Column...'), notImplementedEntry('goToBracket', 'Go to Bracket'), menuEntrySeparator, notImplementedEntry('nextProblem', 'Next Problem'), notImplementedEntry('previousProblem', 'Previous Problem'), menuEntrySeparator, notImplementedEntry('nextChange', 'Next Change'), notImplementedEntry('previousChange', 'Previous Change')];
|
|
2256
|
+
};
|
|
2257
|
+
const getMenuEntriesSwitchEditor = () => {
|
|
2258
|
+
return [notImplementedEntry('firstSideInEditor', 'First Side in Editor'), notImplementedEntry('secondSideInEditor', 'Second Side in Editor'), menuEntrySeparator, notImplementedEntry('nextEditor', 'Next Editor'), notImplementedEntry('previousEditor', 'Previous Editor'), menuEntrySeparator, notImplementedEntry('nextUsedEditor', 'Next Used Editor'), notImplementedEntry('previousUsedEditor', 'Previous Used Editor'), menuEntrySeparator, notImplementedEntry('nextEditorInGroup', 'Next Editor in Group'), notImplementedEntry('previousEditorInGroup', 'Previous Editor in Group'), menuEntrySeparator, notImplementedEntry('nextUsedEditorInGroup', 'Next Used Editor in Group'), notImplementedEntry('previousUsedEditorInGroup', 'Previous Used Editor in Group')];
|
|
2259
|
+
};
|
|
2260
|
+
const getMenuEntriesSwitchGroup = () => {
|
|
2261
|
+
return [notImplementedEntry('nextGroup', 'Next Group'), notImplementedEntry('previousGroup', 'Previous Group'), menuEntrySeparator, notImplementedEntry('groupOne', 'Group 1'), notImplementedEntry('groupTwo', 'Group 2'), notImplementedEntry('groupThree', 'Group 3'), notImplementedEntry('groupFour', 'Group 4'), notImplementedEntry('groupFive', 'Group 5'), notImplementedEntry('lastGroup', 'Last Group')];
|
|
2115
2262
|
};
|
|
2116
2263
|
|
|
2117
2264
|
const toggleDeveloperTools = () => {
|
|
@@ -2548,6 +2695,12 @@ const getMenuEntries2 = async (state, props) => {
|
|
|
2548
2695
|
// @ts-ignore
|
|
2549
2696
|
case MenuIdEditorLayout:
|
|
2550
2697
|
return getMenuEntries$c();
|
|
2698
|
+
// @ts-ignore
|
|
2699
|
+
case MenuIdSwitchEditor:
|
|
2700
|
+
return getMenuEntriesSwitchEditor();
|
|
2701
|
+
// @ts-ignore
|
|
2702
|
+
case MenuIdSwitchGroup:
|
|
2703
|
+
return getMenuEntriesSwitchGroup();
|
|
2551
2704
|
default:
|
|
2552
2705
|
return [];
|
|
2553
2706
|
}
|
|
@@ -3330,6 +3483,25 @@ const loadContent2 = async state => {
|
|
|
3330
3483
|
};
|
|
3331
3484
|
};
|
|
3332
3485
|
|
|
3486
|
+
const loadContent2Command = async uid => {
|
|
3487
|
+
const {
|
|
3488
|
+
newState
|
|
3489
|
+
} = get(uid);
|
|
3490
|
+
const loadedState = await loadContent2(newState);
|
|
3491
|
+
const latest = get(uid);
|
|
3492
|
+
const nextState = latest.newState.workspaceUri === newState.workspaceUri ? {
|
|
3493
|
+
...latest.newState,
|
|
3494
|
+
...loadedState
|
|
3495
|
+
} : {
|
|
3496
|
+
...latest.newState,
|
|
3497
|
+
...loadedState,
|
|
3498
|
+
title: latest.newState.title,
|
|
3499
|
+
titleWidth: latest.newState.titleWidth,
|
|
3500
|
+
workspaceUri: latest.newState.workspaceUri
|
|
3501
|
+
};
|
|
3502
|
+
set(uid, latest.oldState, nextState, nextState);
|
|
3503
|
+
};
|
|
3504
|
+
|
|
3333
3505
|
const renderFocusContext = (oldState, newState) => {
|
|
3334
3506
|
const {
|
|
3335
3507
|
uid
|
|
@@ -4384,6 +4556,8 @@ const handleMenuClick = async (state, level, index) => {
|
|
|
4384
4556
|
return state;
|
|
4385
4557
|
}
|
|
4386
4558
|
switch (item.flags) {
|
|
4559
|
+
case Checked:
|
|
4560
|
+
return selectIndexNone(state, item);
|
|
4387
4561
|
case Ignore:
|
|
4388
4562
|
return selectIndexIgnore(state, item);
|
|
4389
4563
|
case None:
|
|
@@ -4392,6 +4566,8 @@ const handleMenuClick = async (state, level, index) => {
|
|
|
4392
4566
|
return selectIndexRestoreFocus(state, item);
|
|
4393
4567
|
case SubMenu$1:
|
|
4394
4568
|
return selectIndexSubMenu(state, menu, index);
|
|
4569
|
+
case Unchecked:
|
|
4570
|
+
return selectIndexNone(state, item);
|
|
4395
4571
|
default:
|
|
4396
4572
|
return state;
|
|
4397
4573
|
}
|
|
@@ -4544,7 +4720,7 @@ const commandMap = {
|
|
|
4544
4720
|
'TitleBar.hideCommandCenter': wrapCommand(hideCommandCenter),
|
|
4545
4721
|
'TitleBar.hideMenuBar': wrapCommand(hideMenuBar),
|
|
4546
4722
|
'TitleBar.hydrateElectronApplicationMenu': wrapCommand(hydrate),
|
|
4547
|
-
'TitleBar.loadContent2':
|
|
4723
|
+
'TitleBar.loadContent2': loadContent2Command,
|
|
4548
4724
|
'TitleBar.render3': render3,
|
|
4549
4725
|
'TitleBar.renderEventListeners': renderEventListeners,
|
|
4550
4726
|
'TitleBar.resize': wrapCommand(resize),
|