@lvce-editor/process-explorer-worker 3.12.1 → 3.14.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.
Files changed (2) hide show
  1. package/index.js +25 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1994,8 +1994,25 @@ const launchProcessExplorerElectron = async () => {
1994
1994
  }
1995
1995
  };
1996
1996
 
1997
+ const commandNotFoundRegex = /command not found|not found/i;
1997
1998
  const launchProcessExplorerNode = async onClose => {
1998
1999
  try {
2000
+ try {
2001
+ const {
2002
+ protocols,
2003
+ url
2004
+ } = await invoke$1('WebSocketCapability.create', 'process-explorer');
2005
+ const webSocket = new WebSocket(url, protocols);
2006
+ webSocket.addEventListener('close', onClose);
2007
+ return await create$3({
2008
+ commandMap: {},
2009
+ webSocket
2010
+ });
2011
+ } catch (error) {
2012
+ if (!(error instanceof Error && (error.message.includes('WebSocketCapability.create') || error.message.includes('module WebSocketCapability not found')) && commandNotFoundRegex.test(error.message))) {
2013
+ throw error;
2014
+ }
2015
+ }
1999
2016
  const rpc = await create$1({
2000
2017
  commandMap: {},
2001
2018
  onClose,
@@ -2875,6 +2892,12 @@ const headerCellNode = {
2875
2892
  className: HeaderCell,
2876
2893
  type: Th
2877
2894
  };
2895
+ const processExplorer = {
2896
+ childCount: 1,
2897
+ className: mergeClassNames(Viewlet, ProcessExplorer),
2898
+ role: None,
2899
+ type: Div
2900
+ };
2878
2901
  const getRowClassName = focused => {
2879
2902
  if (focused) {
2880
2903
  return mergeClassNames(Row, RowFocused);
@@ -2966,12 +2989,7 @@ const getErrorDom = state => {
2966
2989
  const codeFrameDom = getErrorSectionDom(errorCodeFrame, Pre);
2967
2990
  const stackDom = getErrorSectionDom(errorStack, Pre);
2968
2991
  const childCount = messageDom.length / 2 + codeFrameDom.length / 2 + stackDom.length / 2;
2969
- return [{
2970
- childCount: 1,
2971
- className: mergeClassNames(Viewlet, ProcessExplorer),
2972
- role: None,
2973
- type: Div
2974
- }, {
2992
+ return [processExplorer, {
2975
2993
  childCount,
2976
2994
  className: Error$1,
2977
2995
  type: Div
@@ -2981,12 +2999,7 @@ const getTableDom = state => {
2981
2999
  const {
2982
3000
  visibleProcesses
2983
3001
  } = state;
2984
- return [{
2985
- childCount: 1,
2986
- className: mergeClassNames(Viewlet, ProcessExplorer),
2987
- role: None,
2988
- type: Div
2989
- }, {
3002
+ return [processExplorer, {
2990
3003
  ariaLabel: 'Process Explorer',
2991
3004
  ariaRowCount: visibleProcesses.length + 1,
2992
3005
  childCount: 2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/process-explorer-worker",
3
- "version": "3.12.1",
3
+ "version": "3.14.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",