@lvce-editor/process-explorer-worker 3.22.0 → 3.22.1

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 +13 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -3146,8 +3146,18 @@ const getCellDom = (className, value, index, paddingLeft) => {
3146
3146
  type: Td
3147
3147
  }, text(value)];
3148
3148
  };
3149
- const getHeaderDom = () => {
3150
- return [tableHeadNode, headerRowNode, ...['Name', 'PID', 'Memory'].flatMap(label => [headerCellNode, text(label)])];
3149
+ const getNameColumnWidth = visibleProcesses => {
3150
+ const hasWebContentsView = visibleProcesses.some(process => process.name.toLowerCase().includes('webcontentsview'));
3151
+ return hasWebContentsView ? '40%' : undefined;
3152
+ };
3153
+ const getHeaderDom = visibleProcesses => {
3154
+ const nameColumnWidth = getNameColumnWidth(visibleProcesses);
3155
+ return [tableHeadNode, headerRowNode, ...['Name', 'PID', 'Memory'].flatMap((label, index) => [{
3156
+ ...headerCellNode,
3157
+ ...(index === 0 && nameColumnWidth && {
3158
+ width: nameColumnWidth
3159
+ })
3160
+ }, text(label)])];
3151
3161
  };
3152
3162
  const getRowDom = (process, index, focused) => {
3153
3163
  return [{
@@ -3229,7 +3239,7 @@ const getTableDom = state => {
3229
3239
  role: Grid,
3230
3240
  tabIndex: Focusable,
3231
3241
  type: Table$1
3232
- }, ...getHeaderDom(), ...getBodyDom(state)];
3242
+ }, ...getHeaderDom(visibleProcesses), ...getBodyDom(state)];
3233
3243
  };
3234
3244
  const getDom = state => {
3235
3245
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/process-explorer-worker",
3
- "version": "3.22.0",
3
+ "version": "3.22.1",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",