@lvce-editor/running-extensions-view 1.6.0 → 1.8.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/runningExtensionsViewMain.js +207 -54
- package/package.json +1 -1
|
@@ -63,7 +63,7 @@ class AssertionError extends Error {
|
|
|
63
63
|
const Object$1 = 1;
|
|
64
64
|
const Number$1 = 2;
|
|
65
65
|
const Array$1 = 3;
|
|
66
|
-
const String = 4;
|
|
66
|
+
const String$1 = 4;
|
|
67
67
|
const Boolean$1 = 5;
|
|
68
68
|
const Function = 6;
|
|
69
69
|
const Null = 7;
|
|
@@ -75,7 +75,7 @@ const getType = value => {
|
|
|
75
75
|
case 'function':
|
|
76
76
|
return Function;
|
|
77
77
|
case 'string':
|
|
78
|
-
return String;
|
|
78
|
+
return String$1;
|
|
79
79
|
case 'object':
|
|
80
80
|
if (value === null) {
|
|
81
81
|
return Null;
|
|
@@ -586,7 +586,10 @@ const constructError = (message, type, name) => {
|
|
|
586
586
|
if (ErrorConstructor === Error) {
|
|
587
587
|
const error = new Error(message);
|
|
588
588
|
if (name && name !== 'VError') {
|
|
589
|
-
error
|
|
589
|
+
Object.defineProperty(error, 'name', {
|
|
590
|
+
configurable: true,
|
|
591
|
+
value: name
|
|
592
|
+
});
|
|
590
593
|
}
|
|
591
594
|
return error;
|
|
592
595
|
}
|
|
@@ -617,31 +620,45 @@ const getParentStack = error => {
|
|
|
617
620
|
};
|
|
618
621
|
const MethodNotFound = -32601;
|
|
619
622
|
const Custom = -32001;
|
|
623
|
+
const setStack = (error, stack) => {
|
|
624
|
+
const descriptor = Object.getOwnPropertyDescriptor(error, 'stack');
|
|
625
|
+
if (descriptor) {
|
|
626
|
+
if (!descriptor.configurable && !descriptor.writable) {
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
if (!descriptor.configurable && descriptor.writable) {
|
|
630
|
+
error.stack = stack;
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
Object.defineProperty(error, 'stack', {
|
|
635
|
+
configurable: true,
|
|
636
|
+
value: stack,
|
|
637
|
+
writable: true
|
|
638
|
+
});
|
|
639
|
+
};
|
|
620
640
|
const restoreExistingError = (error, currentStack) => {
|
|
621
641
|
if (typeof error.stack === 'string') {
|
|
622
|
-
error
|
|
642
|
+
setStack(error, `${error.stack}${NewLine}${currentStack}`);
|
|
623
643
|
}
|
|
624
644
|
return error;
|
|
625
645
|
};
|
|
626
646
|
const restoreMethodNotFoundError = (error, currentStack) => {
|
|
627
647
|
const restoredError = new JsonRpcError(error.message);
|
|
628
648
|
const parentStack = getParentStack(error);
|
|
629
|
-
restoredError
|
|
649
|
+
setStack(restoredError, `${parentStack}${NewLine}${currentStack}`);
|
|
630
650
|
return restoredError;
|
|
631
651
|
};
|
|
632
652
|
const restoreStackFromData = (restoredError, error, currentStack) => {
|
|
633
653
|
if (error.data.stack && error.data.type && error.message) {
|
|
634
|
-
restoredError
|
|
654
|
+
setStack(restoredError, `${error.data.type}: ${error.message}${NewLine}${error.data.stack}${NewLine}${currentStack}`);
|
|
635
655
|
return;
|
|
636
656
|
}
|
|
637
657
|
if (error.data.stack) {
|
|
638
|
-
restoredError
|
|
658
|
+
setStack(restoredError, error.data.stack);
|
|
639
659
|
}
|
|
640
660
|
};
|
|
641
661
|
const applyDataProperties = (restoredError, error) => {
|
|
642
|
-
if (!error.data) {
|
|
643
|
-
return;
|
|
644
|
-
}
|
|
645
662
|
restoreStackFromData(restoredError, error, getCurrentStack());
|
|
646
663
|
if (error.data.codeFrame) {
|
|
647
664
|
// @ts-ignore
|
|
@@ -662,7 +679,7 @@ const applyDirectProperties = (restoredError, error) => {
|
|
|
662
679
|
const indexNewLine = getNewLineIndex(lowerStack);
|
|
663
680
|
const parentStack = getParentStack(error);
|
|
664
681
|
// @ts-ignore
|
|
665
|
-
restoredError
|
|
682
|
+
setStack(restoredError, `${parentStack}${lowerStack.slice(indexNewLine)}`);
|
|
666
683
|
}
|
|
667
684
|
if (error.codeFrame) {
|
|
668
685
|
// @ts-ignore
|
|
@@ -1372,7 +1389,7 @@ const getWindowId = async () => {
|
|
|
1372
1389
|
return invoke('GetWindowId.getWindowId');
|
|
1373
1390
|
};
|
|
1374
1391
|
|
|
1375
|
-
const copyId = async (state, index) => {
|
|
1392
|
+
const copyId$1 = async (state, index) => {
|
|
1376
1393
|
const {
|
|
1377
1394
|
extensions
|
|
1378
1395
|
} = state;
|
|
@@ -1654,7 +1671,7 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
|
|
|
1654
1671
|
};
|
|
1655
1672
|
|
|
1656
1673
|
const isDomEqual = (oldState, newState) => {
|
|
1657
|
-
return oldState.extensions === newState.extensions && oldState.loaded === newState.loaded;
|
|
1674
|
+
return oldState.extensions === newState.extensions && oldState.focusedIndex === newState.focusedIndex && oldState.loaded === newState.loaded;
|
|
1658
1675
|
};
|
|
1659
1676
|
const isCssEqual = (oldState, newState) => {
|
|
1660
1677
|
return oldState.width === newState.width && oldState.height === newState.height;
|
|
@@ -1667,7 +1684,7 @@ const diff2 = uid => {
|
|
|
1667
1684
|
return diff(uid, [isDomEqual, isCssEqual], [RenderDom, RenderCss]);
|
|
1668
1685
|
};
|
|
1669
1686
|
|
|
1670
|
-
const disable = async (state, index) => {
|
|
1687
|
+
const disable$1 = async (state, index) => {
|
|
1671
1688
|
const {
|
|
1672
1689
|
extensions,
|
|
1673
1690
|
platform
|
|
@@ -1679,7 +1696,7 @@ const disable = async (state, index) => {
|
|
|
1679
1696
|
return state;
|
|
1680
1697
|
};
|
|
1681
1698
|
|
|
1682
|
-
const disableWorkspace = async (state, index) => {
|
|
1699
|
+
const disableWorkspace$1 = async (state, index) => {
|
|
1683
1700
|
const {
|
|
1684
1701
|
extensions
|
|
1685
1702
|
} = state;
|
|
@@ -1690,6 +1707,86 @@ const disableWorkspace = async (state, index) => {
|
|
|
1690
1707
|
return state;
|
|
1691
1708
|
};
|
|
1692
1709
|
|
|
1710
|
+
const emptyObject = {};
|
|
1711
|
+
const i18nString = (key, placeholders = emptyObject) => {
|
|
1712
|
+
if (placeholders === emptyObject) {
|
|
1713
|
+
return key;
|
|
1714
|
+
}
|
|
1715
|
+
let result = key;
|
|
1716
|
+
for (const [placeholder, replacement] of Object.entries(placeholders)) {
|
|
1717
|
+
result = result.split(`{${placeholder}}`).join(String(replacement));
|
|
1718
|
+
}
|
|
1719
|
+
return result;
|
|
1720
|
+
};
|
|
1721
|
+
|
|
1722
|
+
const ActivationReason = 'Activation reason: {PH1}';
|
|
1723
|
+
const ActivationTime = 'Activation: {PH1}ms';
|
|
1724
|
+
const CopyId = 'Copy id ({PH1})';
|
|
1725
|
+
const Disable = 'Disable';
|
|
1726
|
+
const DisableWorkspace = 'Disable (Workspace)';
|
|
1727
|
+
const ExtensionApiElectron = 'Extension API (Electron): {PH1}';
|
|
1728
|
+
const ExtensionHostProfilingNotAvailable = 'Extension host profiling is not available yet.';
|
|
1729
|
+
const LoadingRunningExtensions = 'Loading running extensions…';
|
|
1730
|
+
const NoRunningExtensions = 'No running extensions';
|
|
1731
|
+
const ReportIssue = 'Report Issue';
|
|
1732
|
+
const ReportingIssuesForRunningExtensionsNotAvailable = 'Reporting issues for running extensions is not available yet.';
|
|
1733
|
+
const Ssh = 'SSH: {PH1}';
|
|
1734
|
+
const StartExtensionHostProfile = 'Start Extension Host Profile';
|
|
1735
|
+
const TakeHeapSnapshot = 'Take Heap Snapshot';
|
|
1736
|
+
|
|
1737
|
+
const activationReason = reason => {
|
|
1738
|
+
return i18nString(ActivationReason, {
|
|
1739
|
+
PH1: reason
|
|
1740
|
+
});
|
|
1741
|
+
};
|
|
1742
|
+
const activationTime = milliseconds => {
|
|
1743
|
+
return i18nString(ActivationTime, {
|
|
1744
|
+
PH1: milliseconds
|
|
1745
|
+
});
|
|
1746
|
+
};
|
|
1747
|
+
const copyId = id => {
|
|
1748
|
+
return i18nString(CopyId, {
|
|
1749
|
+
PH1: id
|
|
1750
|
+
});
|
|
1751
|
+
};
|
|
1752
|
+
const disable = () => {
|
|
1753
|
+
return i18nString(Disable);
|
|
1754
|
+
};
|
|
1755
|
+
const disableWorkspace = () => {
|
|
1756
|
+
return i18nString(DisableWorkspace);
|
|
1757
|
+
};
|
|
1758
|
+
const extensionApiElectron = id => {
|
|
1759
|
+
return i18nString(ExtensionApiElectron, {
|
|
1760
|
+
PH1: id
|
|
1761
|
+
});
|
|
1762
|
+
};
|
|
1763
|
+
const extensionHostProfilingNotAvailable = () => {
|
|
1764
|
+
return i18nString(ExtensionHostProfilingNotAvailable);
|
|
1765
|
+
};
|
|
1766
|
+
const loadingRunningExtensions = () => {
|
|
1767
|
+
return i18nString(LoadingRunningExtensions);
|
|
1768
|
+
};
|
|
1769
|
+
const noRunningExtensions = () => {
|
|
1770
|
+
return i18nString(NoRunningExtensions);
|
|
1771
|
+
};
|
|
1772
|
+
const reportIssue$1 = () => {
|
|
1773
|
+
return i18nString(ReportIssue);
|
|
1774
|
+
};
|
|
1775
|
+
const reportingIssuesForRunningExtensionsNotAvailable = () => {
|
|
1776
|
+
return i18nString(ReportingIssuesForRunningExtensionsNotAvailable);
|
|
1777
|
+
};
|
|
1778
|
+
const ssh = host => {
|
|
1779
|
+
return i18nString(Ssh, {
|
|
1780
|
+
PH1: host
|
|
1781
|
+
});
|
|
1782
|
+
};
|
|
1783
|
+
const startExtensionHostProfile = () => {
|
|
1784
|
+
return i18nString(StartExtensionHostProfile);
|
|
1785
|
+
};
|
|
1786
|
+
const takeHeapSnapshot$1 = () => {
|
|
1787
|
+
return i18nString(TakeHeapSnapshot);
|
|
1788
|
+
};
|
|
1789
|
+
|
|
1693
1790
|
const getMenuEntries = state => {
|
|
1694
1791
|
const {
|
|
1695
1792
|
extensions,
|
|
@@ -1706,13 +1803,13 @@ const getMenuEntries = state => {
|
|
|
1706
1803
|
command: 'RunningExtensions.copyId',
|
|
1707
1804
|
flags: None$1,
|
|
1708
1805
|
id: 'copyId',
|
|
1709
|
-
label:
|
|
1806
|
+
label: copyId(extension.id)
|
|
1710
1807
|
}, {
|
|
1711
1808
|
args,
|
|
1712
1809
|
command: 'RunningExtensions.reportIssue',
|
|
1713
1810
|
flags: None$1,
|
|
1714
1811
|
id: 'reportIssue',
|
|
1715
|
-
label:
|
|
1812
|
+
label: reportIssue$1()
|
|
1716
1813
|
}, {
|
|
1717
1814
|
command: '',
|
|
1718
1815
|
flags: Separator,
|
|
@@ -1723,13 +1820,13 @@ const getMenuEntries = state => {
|
|
|
1723
1820
|
command: 'RunningExtensions.disableWorkspace',
|
|
1724
1821
|
flags: None$1,
|
|
1725
1822
|
id: 'disableWorkspace',
|
|
1726
|
-
label:
|
|
1823
|
+
label: disableWorkspace()
|
|
1727
1824
|
}, {
|
|
1728
1825
|
args,
|
|
1729
1826
|
command: 'RunningExtensions.disable',
|
|
1730
1827
|
flags: None$1,
|
|
1731
1828
|
id: 'disable',
|
|
1732
|
-
label:
|
|
1829
|
+
label: disable()
|
|
1733
1830
|
}, {
|
|
1734
1831
|
command: '',
|
|
1735
1832
|
flags: Separator,
|
|
@@ -1739,7 +1836,7 @@ const getMenuEntries = state => {
|
|
|
1739
1836
|
command: 'RunningExtensions.startProfile',
|
|
1740
1837
|
flags: None$1,
|
|
1741
1838
|
id: 'startProfile',
|
|
1742
|
-
label:
|
|
1839
|
+
label: startExtensionHostProfile()
|
|
1743
1840
|
}];
|
|
1744
1841
|
if (platform === Electron && extension.isolated) {
|
|
1745
1842
|
menuEntries.push({
|
|
@@ -1747,16 +1844,16 @@ const getMenuEntries = state => {
|
|
|
1747
1844
|
command: 'RunningExtensions.takeHeapSnapshot',
|
|
1748
1845
|
flags: None$1,
|
|
1749
1846
|
id: 'takeHeapSnapshot',
|
|
1750
|
-
label:
|
|
1847
|
+
label: takeHeapSnapshot$1()
|
|
1751
1848
|
});
|
|
1752
1849
|
}
|
|
1753
1850
|
return menuEntries;
|
|
1754
1851
|
};
|
|
1755
1852
|
|
|
1756
|
-
const RunningExtensions = 32;
|
|
1853
|
+
const RunningExtensions$1 = 32;
|
|
1757
1854
|
|
|
1758
1855
|
const getMenuEntryIds = () => {
|
|
1759
|
-
return [RunningExtensions];
|
|
1856
|
+
return [RunningExtensions$1];
|
|
1760
1857
|
};
|
|
1761
1858
|
|
|
1762
1859
|
const show = async (uid, menuId, x, y, args) => {
|
|
@@ -1777,8 +1874,8 @@ const handleContextMenu = async (state, index, x = 0, y = 0) => {
|
|
|
1777
1874
|
focusedIndex
|
|
1778
1875
|
};
|
|
1779
1876
|
set(uid, state, newState);
|
|
1780
|
-
await show(uid, RunningExtensions, x, y, {
|
|
1781
|
-
menuId: RunningExtensions
|
|
1877
|
+
await show(uid, RunningExtensions$1, x, y, {
|
|
1878
|
+
menuId: RunningExtensions$1
|
|
1782
1879
|
});
|
|
1783
1880
|
return newState;
|
|
1784
1881
|
};
|
|
@@ -1801,12 +1898,17 @@ const loadContent = async state => {
|
|
|
1801
1898
|
};
|
|
1802
1899
|
|
|
1803
1900
|
const getCss = (width, height) => {
|
|
1804
|
-
return `width: ${width}px; height: ${height}px;`;
|
|
1901
|
+
return `width: ${width}px; height: ${height}px; flex: 1;`;
|
|
1805
1902
|
};
|
|
1806
1903
|
|
|
1807
1904
|
const renderCss = (oldState, newState) => {
|
|
1808
|
-
const
|
|
1809
|
-
|
|
1905
|
+
const {
|
|
1906
|
+
height,
|
|
1907
|
+
uid,
|
|
1908
|
+
width
|
|
1909
|
+
} = newState;
|
|
1910
|
+
const css = getCss(width, height);
|
|
1911
|
+
return [SetCss, uid, css];
|
|
1810
1912
|
};
|
|
1811
1913
|
|
|
1812
1914
|
const mergeClassNames = (...classNames) => {
|
|
@@ -1827,13 +1929,31 @@ const List = 'list';
|
|
|
1827
1929
|
const ListItem = 'listitem';
|
|
1828
1930
|
const None = 'none';
|
|
1829
1931
|
|
|
1932
|
+
const FocusOutline = 'FocusOutline';
|
|
1933
|
+
const MaskIcon = 'MaskIcon';
|
|
1934
|
+
const MaskIconExtensions = 'MaskIconExtensions';
|
|
1935
|
+
const RunningExtension = 'RunningExtension';
|
|
1936
|
+
const RunningExtensionActivationDetails = 'RunningExtensionActivationDetails';
|
|
1937
|
+
const RunningExtensionActivationReason = 'RunningExtensionActivationReason';
|
|
1938
|
+
const RunningExtensionActivationTime = 'RunningExtensionActivationTime';
|
|
1939
|
+
const RunningExtensionDefaultIcon = 'RunningExtensionDefaultIcon';
|
|
1940
|
+
const RunningExtensionDetails = 'RunningExtensionDetails';
|
|
1941
|
+
const RunningExtensionIcon = 'RunningExtensionIcon';
|
|
1942
|
+
const RunningExtensionId = 'RunningExtensionId';
|
|
1943
|
+
const RunningExtensionName = 'RunningExtensionName';
|
|
1944
|
+
const RunningExtensionRemoteAuthority = 'RunningExtensionRemoteAuthority';
|
|
1945
|
+
const RunningExtensions = 'RunningExtensions';
|
|
1946
|
+
const RunningExtensionsEmpty = 'RunningExtensionsEmpty';
|
|
1947
|
+
const RunningExtensionTitle = 'RunningExtensionTitle';
|
|
1948
|
+
const RunningExtensionVersion = 'RunningExtensionVersion';
|
|
1949
|
+
|
|
1830
1950
|
const HandleContextMenu = 3;
|
|
1831
1951
|
|
|
1832
1952
|
const getIconVirtualDom = (extension, index) => {
|
|
1833
1953
|
if (extension.icon) {
|
|
1834
1954
|
return [{
|
|
1835
1955
|
childCount: 0,
|
|
1836
|
-
className:
|
|
1956
|
+
className: RunningExtensionIcon,
|
|
1837
1957
|
'data-index': index,
|
|
1838
1958
|
src: extension.icon,
|
|
1839
1959
|
type: Img
|
|
@@ -1841,76 +1961,109 @@ const getIconVirtualDom = (extension, index) => {
|
|
|
1841
1961
|
}
|
|
1842
1962
|
return [{
|
|
1843
1963
|
childCount: 0,
|
|
1844
|
-
className: mergeClassNames(
|
|
1964
|
+
className: mergeClassNames(RunningExtensionIcon, RunningExtensionDefaultIcon, MaskIcon, MaskIconExtensions),
|
|
1845
1965
|
'data-index': index,
|
|
1846
1966
|
role: None,
|
|
1847
1967
|
type: Div
|
|
1848
1968
|
}];
|
|
1849
1969
|
};
|
|
1850
1970
|
|
|
1851
|
-
const
|
|
1971
|
+
const sshRemotePrefix = 'ssh-remote+';
|
|
1972
|
+
const getActivationReasonVirtualDom = (activationEvent, index) => {
|
|
1973
|
+
if (!activationEvent) {
|
|
1974
|
+
return [];
|
|
1975
|
+
}
|
|
1976
|
+
return [{
|
|
1977
|
+
childCount: 1,
|
|
1978
|
+
className: RunningExtensionActivationReason,
|
|
1979
|
+
'data-index': index,
|
|
1980
|
+
type: Div
|
|
1981
|
+
}, text(activationReason(activationEvent))];
|
|
1982
|
+
};
|
|
1983
|
+
const getRemoteAuthorityVirtualDom = (remoteAuthority, index) => {
|
|
1984
|
+
if (!remoteAuthority) {
|
|
1985
|
+
return [];
|
|
1986
|
+
}
|
|
1987
|
+
const host = remoteAuthority.startsWith(sshRemotePrefix) ? remoteAuthority.slice(sshRemotePrefix.length) : remoteAuthority;
|
|
1988
|
+
return [{
|
|
1989
|
+
childCount: 1,
|
|
1990
|
+
className: mergeClassNames(RunningExtensionId, RunningExtensionRemoteAuthority),
|
|
1991
|
+
'data-index': index,
|
|
1992
|
+
type: Div
|
|
1993
|
+
}, text(ssh(host))];
|
|
1994
|
+
};
|
|
1995
|
+
const getExtensionVirtualDom = (extension, index, focused = false) => {
|
|
1852
1996
|
const displayName = extension.name || extension.id;
|
|
1997
|
+
const activationReasonDom = getActivationReasonVirtualDom(extension.activationEvent, index);
|
|
1998
|
+
const remoteAuthorityDom = getRemoteAuthorityVirtualDom(extension.remoteAuthority, index);
|
|
1999
|
+
const className = focused ? mergeClassNames(RunningExtension, FocusOutline) : RunningExtension;
|
|
1853
2000
|
return [{
|
|
1854
2001
|
childCount: 3,
|
|
1855
|
-
className
|
|
2002
|
+
className,
|
|
1856
2003
|
'data-index': index,
|
|
1857
2004
|
role: ListItem,
|
|
1858
2005
|
type: Div
|
|
1859
2006
|
}, ...getIconVirtualDom(extension, index), {
|
|
1860
|
-
childCount: 2,
|
|
1861
|
-
className:
|
|
2007
|
+
childCount: remoteAuthorityDom.length > 0 ? 3 : 2,
|
|
2008
|
+
className: RunningExtensionDetails,
|
|
1862
2009
|
'data-index': index,
|
|
1863
2010
|
type: Div
|
|
1864
2011
|
}, {
|
|
1865
2012
|
childCount: 2,
|
|
1866
|
-
className:
|
|
2013
|
+
className: RunningExtensionTitle,
|
|
1867
2014
|
'data-index': index,
|
|
1868
2015
|
type: Div
|
|
1869
2016
|
}, {
|
|
1870
2017
|
childCount: 1,
|
|
1871
|
-
className:
|
|
2018
|
+
className: RunningExtensionName,
|
|
1872
2019
|
'data-index': index,
|
|
1873
2020
|
type: Strong
|
|
1874
2021
|
}, text(displayName), {
|
|
1875
2022
|
childCount: 1,
|
|
1876
|
-
className:
|
|
2023
|
+
className: RunningExtensionVersion,
|
|
1877
2024
|
'data-index': index,
|
|
1878
2025
|
type: Span
|
|
1879
|
-
}, text(extension.version), {
|
|
2026
|
+
}, text(extension.version), ...remoteAuthorityDom, {
|
|
1880
2027
|
childCount: 1,
|
|
1881
|
-
className:
|
|
2028
|
+
className: RunningExtensionId,
|
|
1882
2029
|
'data-index': index,
|
|
1883
2030
|
type: Div
|
|
1884
2031
|
}, text(extension.id), {
|
|
2032
|
+
childCount: activationReasonDom.length > 0 ? 2 : 1,
|
|
2033
|
+
className: RunningExtensionActivationDetails,
|
|
2034
|
+
'data-index': index,
|
|
2035
|
+
type: Div
|
|
2036
|
+
}, {
|
|
1885
2037
|
childCount: 1,
|
|
1886
|
-
className:
|
|
2038
|
+
className: RunningExtensionActivationTime,
|
|
1887
2039
|
'data-index': index,
|
|
1888
2040
|
type: Div
|
|
1889
|
-
}, text(
|
|
2041
|
+
}, text(activationTime(Math.round(extension.activationTime))), ...activationReasonDom];
|
|
1890
2042
|
};
|
|
1891
2043
|
|
|
1892
2044
|
const getRunningExtensionsEmptyDom = loaded => {
|
|
1893
|
-
const message = loaded ?
|
|
2045
|
+
const message = loaded ? noRunningExtensions() : loadingRunningExtensions();
|
|
1894
2046
|
return [{
|
|
1895
2047
|
childCount: 1,
|
|
1896
|
-
className:
|
|
2048
|
+
className: RunningExtensions,
|
|
1897
2049
|
onContextMenu: HandleContextMenu,
|
|
1898
2050
|
role: List,
|
|
1899
2051
|
type: Div
|
|
1900
2052
|
}, {
|
|
1901
2053
|
childCount: 1,
|
|
1902
|
-
className:
|
|
2054
|
+
className: RunningExtensionsEmpty,
|
|
1903
2055
|
type: Div
|
|
1904
2056
|
}, text(message)];
|
|
1905
2057
|
};
|
|
1906
|
-
|
|
2058
|
+
|
|
2059
|
+
const getRunningExtensionsVirtualDom = (extensions, loaded, focusedIndex = -1) => {
|
|
1907
2060
|
if (extensions.length === 0) {
|
|
1908
2061
|
return getRunningExtensionsEmptyDom(loaded);
|
|
1909
2062
|
}
|
|
1910
|
-
const children = extensions.flatMap(getExtensionVirtualDom);
|
|
2063
|
+
const children = extensions.flatMap((extension, index) => getExtensionVirtualDom(extension, index, index === focusedIndex));
|
|
1911
2064
|
return [{
|
|
1912
2065
|
childCount: extensions.length,
|
|
1913
|
-
className:
|
|
2066
|
+
className: RunningExtensions,
|
|
1914
2067
|
onContextMenu: HandleContextMenu,
|
|
1915
2068
|
role: List,
|
|
1916
2069
|
type: Div
|
|
@@ -1918,7 +2071,7 @@ const getRunningExtensionsVirtualDom = (extensions, loaded) => {
|
|
|
1918
2071
|
};
|
|
1919
2072
|
|
|
1920
2073
|
const renderDom = (oldState, newState) => {
|
|
1921
|
-
return [SetDom2, newState.uid, getRunningExtensionsVirtualDom(newState.extensions, newState.loaded)];
|
|
2074
|
+
return [SetDom2, newState.uid, getRunningExtensionsVirtualDom(newState.extensions, newState.loaded, newState.focusedIndex)];
|
|
1922
2075
|
};
|
|
1923
2076
|
|
|
1924
2077
|
const getRenderer = diffType => {
|
|
@@ -1949,7 +2102,7 @@ const renderEventListeners = () => {
|
|
|
1949
2102
|
};
|
|
1950
2103
|
|
|
1951
2104
|
const reportIssue = async state => {
|
|
1952
|
-
await confirm(
|
|
2105
|
+
await confirm(reportingIssuesForRunningExtensionsNotAvailable());
|
|
1953
2106
|
return state;
|
|
1954
2107
|
};
|
|
1955
2108
|
|
|
@@ -1968,7 +2121,7 @@ const setExtensions = (state, extensions) => {
|
|
|
1968
2121
|
};
|
|
1969
2122
|
|
|
1970
2123
|
const startProfile = async state => {
|
|
1971
|
-
await confirm(
|
|
2124
|
+
await confirm(extensionHostProfilingNotAvailable());
|
|
1972
2125
|
return state;
|
|
1973
2126
|
};
|
|
1974
2127
|
|
|
@@ -1981,17 +2134,17 @@ const takeHeapSnapshot = async (state, index) => {
|
|
|
1981
2134
|
return state;
|
|
1982
2135
|
}
|
|
1983
2136
|
const windowId = await getWindowId();
|
|
1984
|
-
const workerName = extension.workerName ||
|
|
2137
|
+
const workerName = extension.workerName || extensionApiElectron(extension.id);
|
|
1985
2138
|
await invoke('Developer.takeWorkerHeapSnapshot', windowId, workerName);
|
|
1986
2139
|
return state;
|
|
1987
2140
|
};
|
|
1988
2141
|
|
|
1989
2142
|
const commandMap = {
|
|
1990
|
-
'RunningExtensions.copyId': wrapCommand(copyId),
|
|
2143
|
+
'RunningExtensions.copyId': wrapCommand(copyId$1),
|
|
1991
2144
|
'RunningExtensions.create': create,
|
|
1992
2145
|
'RunningExtensions.diff2': diff2,
|
|
1993
|
-
'RunningExtensions.disable': wrapCommand(disable),
|
|
1994
|
-
'RunningExtensions.disableWorkspace': wrapCommand(disableWorkspace),
|
|
2146
|
+
'RunningExtensions.disable': wrapCommand(disable$1),
|
|
2147
|
+
'RunningExtensions.disableWorkspace': wrapCommand(disableWorkspace$1),
|
|
1995
2148
|
'RunningExtensions.dispose': dispose,
|
|
1996
2149
|
'RunningExtensions.getCommandIds': getCommandIds,
|
|
1997
2150
|
'RunningExtensions.getMenuEntries': wrapGetter(getMenuEntries),
|