@lvce-editor/status-bar-worker 2.0.0 → 2.1.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.
@@ -1261,6 +1261,10 @@ const handleClick = async (state, name) => {
1261
1261
  return state;
1262
1262
  };
1263
1263
 
1264
+ const handleContextMenu = async state => {
1265
+ return state;
1266
+ };
1267
+
1264
1268
  const id = 7201;
1265
1269
  const sendMessagePortToExtensionHostWorker = async port => {
1266
1270
  await sendMessagePortToExtensionHostWorker$1(port, id);
@@ -1813,6 +1817,7 @@ const diffTree = (oldNodes, newNodes) => {
1813
1817
  return removeTrailingNavigationPatches(patches);
1814
1818
  };
1815
1819
 
1820
+ const HandleContextMenu = 2;
1816
1821
  const HandleClick = 11;
1817
1822
 
1818
1823
  const getTextVirtualDom = element => {
@@ -1871,6 +1876,14 @@ const getStatusBarItemsVirtualDom = (items, className) => {
1871
1876
  }, ...items.flatMap(getStatusBarItemVirtualDom)];
1872
1877
  };
1873
1878
 
1879
+ const getStatusBarItemsLeftDom = statusBarItemsLeft => {
1880
+ return getStatusBarItemsVirtualDom(statusBarItemsLeft, StatusBarItemsLeft);
1881
+ };
1882
+
1883
+ const getStatusBarItemsRightDom = statusBarItemsRight => {
1884
+ return getStatusBarItemsVirtualDom(statusBarItemsRight, StatusBarItemsRight);
1885
+ };
1886
+
1874
1887
  const getChildCount = (leftCount, rightCount) => {
1875
1888
  let count = 0;
1876
1889
  if (leftCount > 0) {
@@ -1886,9 +1899,10 @@ const getStatusBarVirtualDom = (statusBarItemsLeft, statusBarItemsRight) => {
1886
1899
  childCount: getChildCount(statusBarItemsLeft.length, statusBarItemsRight.length),
1887
1900
  className: 'StatusBar',
1888
1901
  onClick: HandleClick,
1902
+ onContextMenu: HandleContextMenu,
1889
1903
  role: Status,
1890
1904
  type: Div
1891
- }, ...getStatusBarItemsVirtualDom(statusBarItemsLeft, StatusBarItemsLeft), ...getStatusBarItemsVirtualDom(statusBarItemsRight, StatusBarItemsRight)];
1905
+ }, ...getStatusBarItemsLeftDom(statusBarItemsLeft), ...getStatusBarItemsRightDom(statusBarItemsRight)];
1892
1906
  return dom;
1893
1907
  };
1894
1908
 
@@ -1906,7 +1920,7 @@ const renderItems = (oldState, newState) => {
1906
1920
  return [SetDom2, uid, dom];
1907
1921
  };
1908
1922
 
1909
- const renderIcremental = (oldState, newState) => {
1923
+ const renderIncremental = (oldState, newState) => {
1910
1924
  const oldDom = renderItems(oldState, oldState)[2];
1911
1925
  const newDom = renderItems(newState, newState)[2];
1912
1926
  const patches = diffTree(oldDom, newDom);
@@ -1916,7 +1930,7 @@ const renderIcremental = (oldState, newState) => {
1916
1930
  const getRenderer = diffType => {
1917
1931
  switch (diffType) {
1918
1932
  case RenderIncremental:
1919
- return renderIcremental;
1933
+ return renderIncremental;
1920
1934
  case RenderItems:
1921
1935
  return renderItems;
1922
1936
  default:
@@ -1948,6 +1962,10 @@ const render2 = (uid, diffResult) => {
1948
1962
 
1949
1963
  const renderEventListeners = () => {
1950
1964
  return [{
1965
+ name: HandleContextMenu,
1966
+ params: ['handleContextMenu'],
1967
+ preventDefault: true
1968
+ }, {
1951
1969
  name: HandleClick,
1952
1970
  params: ['handleClick', TargetName]
1953
1971
  }];
@@ -1976,6 +1994,7 @@ const commandMap = {
1976
1994
  'StatusBar.diff2': diff2,
1977
1995
  'StatusBar.getCommandIds': getCommandIds,
1978
1996
  'StatusBar.handleClick': wrapCommand(handleClick),
1997
+ 'StatusBar.handleContextMenu': wrapCommand(handleContextMenu),
1979
1998
  'StatusBar.initialize': initialize,
1980
1999
  'StatusBar.itemLeftUpdate': wrapCommand(itemLeftUpdate),
1981
2000
  'StatusBar.itemRightCreate': wrapCommand(itemRightCreate),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/status-bar-worker",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Status Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,8 +9,5 @@
9
9
  "license": "MIT",
10
10
  "author": "Lvce Editor",
11
11
  "type": "module",
12
- "main": "dist/statusBarWorkerMain.js",
13
- "dependencies": {
14
- "@lvce-editor/virtual-dom-worker": "^6.8.0"
15
- }
12
+ "main": "dist/statusBarWorkerMain.js"
16
13
  }