@lvce-editor/panel-worker 1.11.0 → 2.2.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.
@@ -145,7 +145,6 @@ const walkValue = (value, transferrables, isTransferrable) => {
145
145
  for (const property of Object.values(value)) {
146
146
  walkValue(property, transferrables, isTransferrable);
147
147
  }
148
- return;
149
148
  }
150
149
  };
151
150
  const getTransferrables = value => {
@@ -299,7 +298,14 @@ class IpcError extends VError {
299
298
  const cause = new Error(message);
300
299
  // @ts-ignore
301
300
  cause.code = code;
302
- cause.stack = stack;
301
+ if (stack) {
302
+ Object.defineProperty(cause, 'stack', {
303
+ configurable: true,
304
+ enumerable: false,
305
+ value: stack,
306
+ writable: true
307
+ });
308
+ }
303
309
  super(cause, betterMessage);
304
310
  } else {
305
311
  super(betterMessage);
@@ -492,7 +498,10 @@ const constructError = (message, type, name) => {
492
498
  if (ErrorConstructor === Error) {
493
499
  const error = new Error(message);
494
500
  if (name && name !== 'VError') {
495
- error.name = name;
501
+ Object.defineProperty(error, 'name', {
502
+ configurable: true,
503
+ value: name
504
+ });
496
505
  }
497
506
  return error;
498
507
  }
@@ -509,8 +518,10 @@ const getCurrentStack = () => {
509
518
  const currentStack = joinLines(splitLines(new Error().stack || '').slice(stackLinesToSkip));
510
519
  return currentStack;
511
520
  };
512
- const getNewLineIndex = (string, startIndex = undefined) => {
513
- return string.indexOf(NewLine, startIndex);
521
+ const getNewLineIndex = (string, startIndex) => {
522
+ {
523
+ return string.indexOf(NewLine);
524
+ }
514
525
  };
515
526
  const getParentStack = error => {
516
527
  let parentStack = error.stack || error.data || error.message || '';
@@ -521,55 +532,91 @@ const getParentStack = error => {
521
532
  };
522
533
  const MethodNotFound = -32601;
523
534
  const Custom = -32001;
535
+ const setStack = (error, stack) => {
536
+ const descriptor = Object.getOwnPropertyDescriptor(error, 'stack');
537
+ if (descriptor) {
538
+ if (!descriptor.configurable && !descriptor.writable) {
539
+ return;
540
+ }
541
+ if (!descriptor.configurable && descriptor.writable) {
542
+ error.stack = stack;
543
+ return;
544
+ }
545
+ }
546
+ Object.defineProperty(error, 'stack', {
547
+ configurable: true,
548
+ value: stack,
549
+ writable: true
550
+ });
551
+ };
552
+ const restoreExistingError = (error, currentStack) => {
553
+ if (typeof error.stack === 'string') {
554
+ setStack(error, `${error.stack}${NewLine}${currentStack}`);
555
+ }
556
+ return error;
557
+ };
558
+ const restoreMethodNotFoundError = (error, currentStack) => {
559
+ const restoredError = new JsonRpcError(error.message);
560
+ const parentStack = getParentStack(error);
561
+ setStack(restoredError, `${parentStack}${NewLine}${currentStack}`);
562
+ return restoredError;
563
+ };
564
+ const restoreStackFromData = (restoredError, error, currentStack) => {
565
+ if (error.data.stack && error.data.type && error.message) {
566
+ setStack(restoredError, `${error.data.type}: ${error.message}${NewLine}${error.data.stack}${NewLine}${currentStack}`);
567
+ return;
568
+ }
569
+ if (error.data.stack) {
570
+ setStack(restoredError, error.data.stack);
571
+ }
572
+ };
573
+ const applyDataProperties = (restoredError, error) => {
574
+ restoreStackFromData(restoredError, error, getCurrentStack());
575
+ if (error.data.codeFrame) {
576
+ // @ts-ignore
577
+ restoredError.codeFrame = error.data.codeFrame;
578
+ }
579
+ if (error.data.code) {
580
+ // @ts-ignore
581
+ restoredError.code = error.data.code;
582
+ }
583
+ if (error.data.type) {
584
+ // @ts-ignore
585
+ restoredError.name = error.data.type;
586
+ }
587
+ };
588
+ const applyDirectProperties = (restoredError, error) => {
589
+ if (error.stack) {
590
+ const lowerStack = restoredError.stack || '';
591
+ const indexNewLine = getNewLineIndex(lowerStack);
592
+ const parentStack = getParentStack(error);
593
+ // @ts-ignore
594
+ setStack(restoredError, `${parentStack}${lowerStack.slice(indexNewLine)}`);
595
+ }
596
+ if (error.codeFrame) {
597
+ // @ts-ignore
598
+ restoredError.codeFrame = error.codeFrame;
599
+ }
600
+ };
601
+ const restoreMessageError = (error, _currentStack) => {
602
+ const restoredError = constructError(error.message, error.type, error.name);
603
+ if (error.data) {
604
+ applyDataProperties(restoredError, error);
605
+ } else {
606
+ applyDirectProperties(restoredError, error);
607
+ }
608
+ return restoredError;
609
+ };
524
610
  const restoreJsonRpcError = error => {
525
611
  const currentStack = getCurrentStack();
526
612
  if (error && error instanceof Error) {
527
- if (typeof error.stack === 'string') {
528
- error.stack = error.stack + NewLine + currentStack;
529
- }
530
- return error;
613
+ return restoreExistingError(error, currentStack);
531
614
  }
532
615
  if (error && error.code && error.code === MethodNotFound) {
533
- const restoredError = new JsonRpcError(error.message);
534
- const parentStack = getParentStack(error);
535
- restoredError.stack = parentStack + NewLine + currentStack;
536
- return restoredError;
616
+ return restoreMethodNotFoundError(error, currentStack);
537
617
  }
538
618
  if (error && error.message) {
539
- const restoredError = constructError(error.message, error.type, error.name);
540
- if (error.data) {
541
- if (error.data.stack && error.data.type && error.message) {
542
- restoredError.stack = error.data.type + ': ' + error.message + NewLine + error.data.stack + NewLine + currentStack;
543
- } else if (error.data.stack) {
544
- restoredError.stack = error.data.stack;
545
- }
546
- if (error.data.codeFrame) {
547
- // @ts-ignore
548
- restoredError.codeFrame = error.data.codeFrame;
549
- }
550
- if (error.data.code) {
551
- // @ts-ignore
552
- restoredError.code = error.data.code;
553
- }
554
- if (error.data.type) {
555
- // @ts-ignore
556
- restoredError.name = error.data.type;
557
- }
558
- } else {
559
- if (error.stack) {
560
- const lowerStack = restoredError.stack || '';
561
- // @ts-ignore
562
- const indexNewLine = getNewLineIndex(lowerStack);
563
- const parentStack = getParentStack(error);
564
- // @ts-ignore
565
- restoredError.stack = parentStack + lowerStack.slice(indexNewLine);
566
- }
567
- if (error.codeFrame) {
568
- // @ts-ignore
569
- restoredError.codeFrame = error.codeFrame;
570
- }
571
- }
572
- return restoredError;
619
+ return restoreMessageError(error);
573
620
  }
574
621
  if (typeof error === 'string') {
575
622
  return new Error(`JsonRpc Error: ${error}`);
@@ -884,21 +931,6 @@ const create$3 = async ({
884
931
  return rpc;
885
932
  };
886
933
 
887
- const Tab = 'tab';
888
- const TabList = 'tablist';
889
- const ToolBar = 'toolbar';
890
-
891
- const Button = 1;
892
- const Div = 4;
893
- const Text = 12;
894
- const Reference = 100;
895
-
896
- const TargetName = 'event.target.name';
897
-
898
- const RendererWorker = 1;
899
-
900
- const SetPatches = 'Viewlet.setPatches';
901
-
902
934
  const createMockRpc = ({
903
935
  commandMap
904
936
  }) => {
@@ -967,6 +999,21 @@ const create$2 = rpcId => {
967
999
  };
968
1000
  };
969
1001
 
1002
+ const Tab = 'tab';
1003
+ const TabList = 'tablist';
1004
+ const ToolBar = 'toolbar';
1005
+
1006
+ const Button = 1;
1007
+ const Div = 4;
1008
+ const Text = 12;
1009
+ const Reference = 100;
1010
+
1011
+ const TargetName = 'event.target.name';
1012
+
1013
+ const RendererWorker = 1;
1014
+
1015
+ const SetPatches = 'Viewlet.setPatches';
1016
+
970
1017
  const {
971
1018
  invoke,
972
1019
  set: set$1
@@ -1012,7 +1059,7 @@ const create$1 = () => {
1012
1059
  },
1013
1060
  getKeys() {
1014
1061
  return Object.keys(states).map(key => {
1015
- return Number.parseInt(key);
1062
+ return Number.parseFloat(key);
1016
1063
  });
1017
1064
  },
1018
1065
  registerCommands(commandMap) {
@@ -1054,6 +1101,37 @@ const create$1 = () => {
1054
1101
  return fn(newState, ...args);
1055
1102
  };
1056
1103
  return wrapped;
1104
+ },
1105
+ wrapLoadContent(fn) {
1106
+ const wrapped = async (uid, ...args) => {
1107
+ const {
1108
+ newState,
1109
+ oldState
1110
+ } = states[uid];
1111
+ const result = await fn(newState, ...args);
1112
+ const {
1113
+ error,
1114
+ state
1115
+ } = result;
1116
+ if (oldState === state || newState === state) {
1117
+ return {
1118
+ error
1119
+ };
1120
+ }
1121
+ const latestOld = states[uid];
1122
+ const latestNew = {
1123
+ ...latestOld.newState,
1124
+ ...state
1125
+ };
1126
+ states[uid] = {
1127
+ newState: latestNew,
1128
+ oldState: latestOld.oldState
1129
+ };
1130
+ return {
1131
+ error
1132
+ };
1133
+ };
1134
+ return wrapped;
1057
1135
  }
1058
1136
  };
1059
1137
  };
@@ -1078,8 +1156,10 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
1078
1156
  childUid: 0,
1079
1157
  currentViewletId: '',
1080
1158
  errorCount: 0,
1159
+ headerHeight: 35,
1081
1160
  height: 0,
1082
1161
  initial: true,
1162
+ maximized: false,
1083
1163
  platform,
1084
1164
  selectedIndex: -1,
1085
1165
  tabs: [],
@@ -1093,20 +1173,25 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
1093
1173
  set(uid, state, state);
1094
1174
  };
1095
1175
 
1176
+ const isEqual$2 = (oldState, newState) => {
1177
+ return oldState.actionsUid === newState.actionsUid;
1178
+ };
1179
+
1096
1180
  const isEqual$1 = (oldState, newState) => {
1097
1181
  return oldState.childUid === newState.childUid;
1098
1182
  };
1099
1183
 
1100
1184
  const isEqual = (oldState, newState) => {
1101
- return oldState.assetDir === newState.assetDir && oldState.initial === newState.initial && oldState.currentViewletId === newState.currentViewletId && oldState.selectedIndex === newState.selectedIndex && oldState.views === newState.views && oldState.childUid === newState.childUid && oldState.actionsUid === newState.actionsUid;
1185
+ return oldState.assetDir === newState.assetDir && oldState.initial === newState.initial && oldState.currentViewletId === newState.currentViewletId && oldState.maximized === newState.maximized && oldState.selectedIndex === newState.selectedIndex && oldState.views === newState.views && oldState.childUid === newState.childUid && oldState.actionsUid === newState.actionsUid;
1102
1186
  };
1103
1187
 
1104
1188
  const RenderItems = 4;
1105
1189
  const RenderIncremental = 11;
1106
1190
  const RenderChildUid = 12;
1191
+ const RenderActionsUid = 13;
1107
1192
 
1108
- const modules = [isEqual, isEqual$1];
1109
- const numbers = [RenderIncremental, RenderChildUid];
1193
+ const modules = [isEqual, isEqual$1, isEqual$2];
1194
+ const numbers = [RenderIncremental, RenderChildUid, RenderActionsUid];
1110
1195
 
1111
1196
  const diff = (oldState, newState) => {
1112
1197
  const diffResult = [];
@@ -1137,6 +1222,26 @@ const handleClickMaximize = async state => {
1137
1222
  await invoke('Layout.maximizePanel');
1138
1223
  return state;
1139
1224
  };
1225
+ const handleClickUnmaximize = async state => {
1226
+ await invoke('Layout.unmaximizePanel');
1227
+ return state;
1228
+ };
1229
+
1230
+ const handlePanelLayoutChanged = (state, change) => {
1231
+ const {
1232
+ maximized: currentMaximized
1233
+ } = state;
1234
+ const {
1235
+ maximized
1236
+ } = change;
1237
+ if (currentMaximized === maximized) {
1238
+ return state;
1239
+ }
1240
+ return {
1241
+ ...state,
1242
+ maximized
1243
+ };
1244
+ };
1140
1245
 
1141
1246
  const handleBlur = async state => {
1142
1247
  return state;
@@ -1170,26 +1275,33 @@ const getSavedViewletId = savedState => {
1170
1275
  return Problems;
1171
1276
  };
1172
1277
 
1173
- const createViewlet = async (viewletModuleId, editorUid, tabId, bounds, uri) => {
1174
- await invoke('Layout.createViewlet', viewletModuleId, editorUid, tabId, bounds, uri);
1278
+ const createViewlet = async (viewletModuleId, editorUid, tabId, actionsUid, bounds, uri) => {
1279
+ await invoke('Layout.createPanelViewlet', viewletModuleId, editorUid, tabId, actionsUid, bounds, uri);
1175
1280
  };
1176
1281
 
1177
1282
  const getContentDimensions = dimensions => {
1178
1283
  return {
1179
- height: dimensions.height - 35,
1284
+ height: dimensions.height - dimensions.headerHeight,
1180
1285
  width: dimensions.width,
1181
1286
  x: dimensions.x,
1182
- y: dimensions.y + 35
1287
+ y: dimensions.y + dimensions.headerHeight
1183
1288
  };
1184
1289
  };
1185
1290
 
1291
+ const getUid = () => {
1292
+ return Math.random();
1293
+ };
1294
+
1186
1295
  const openViewlet = async (state, id, focus = false) => {
1296
+ const {
1297
+ views
1298
+ } = state;
1187
1299
  const childDimensions = getContentDimensions(state);
1188
- const childUid = Math.random();
1189
- const tabId = Math.random();
1190
- const actionsUid = Math.random();
1191
- const index = state.views.indexOf(id);
1192
- await createViewlet(id, childUid, tabId, childDimensions, '');
1300
+ const childUid = getUid();
1301
+ const tabId = getUid();
1302
+ const actionsUid = getUid();
1303
+ const index = views.indexOf(id);
1304
+ await createViewlet(id, childUid, tabId, actionsUid, childDimensions, '');
1193
1305
  return {
1194
1306
  ...state,
1195
1307
  actionsUid,
@@ -1219,7 +1331,7 @@ const selectIndex = async (state, index) => {
1219
1331
  };
1220
1332
 
1221
1333
  const selectRaw = async (state, rawIndex) => {
1222
- return selectIndex(state, Number.parseInt(rawIndex, 10));
1334
+ return selectIndex(state, Number(rawIndex));
1223
1335
  };
1224
1336
 
1225
1337
  const setBadgeCount = (state, id, count) => {
@@ -1236,16 +1348,28 @@ const setBadgeCount = (state, id, count) => {
1236
1348
  };
1237
1349
 
1238
1350
  const toggleView = async (state, name) => {
1239
- const index = state.views.indexOf(name);
1351
+ const {
1352
+ currentViewletId,
1353
+ views
1354
+ } = state;
1355
+ const index = views.indexOf(name);
1240
1356
  if (index === -1) {
1241
1357
  return state;
1242
1358
  }
1243
- if (name === state.currentViewletId) {
1359
+ if (name === currentViewletId) {
1244
1360
  return state;
1245
1361
  }
1246
1362
  return selectIndex(state, index);
1247
1363
  };
1248
1364
 
1365
+ const renderActionsUid = (oldState, newState) => {
1366
+ const oldActionsUid = oldState.actionsUid;
1367
+ if (oldActionsUid <= 0 || oldActionsUid === newState.actionsUid) {
1368
+ return [];
1369
+ }
1370
+ return ['Viewlet.dispose', oldActionsUid];
1371
+ };
1372
+
1249
1373
  // TODO also need to dispose child when panel becomes hidden
1250
1374
  const renderChildUid = (oldState, newState) => {
1251
1375
  const oldChildUid = oldState.childUid;
@@ -1489,7 +1613,6 @@ const diffChildren = (oldChildren, newChildren, patches) => {
1489
1613
  patches.push({
1490
1614
  type: NavigateParent
1491
1615
  });
1492
- currentChildIndex = -1;
1493
1616
  }
1494
1617
  // Add remove patches in reverse order (highest index first)
1495
1618
  // This ensures indices remain valid as we remove
@@ -1566,17 +1689,19 @@ const IconButton = 'IconButton';
1566
1689
  const MaskIcon = 'MaskIcon';
1567
1690
  const MaskIconChevronUp = 'MaskIconChevronUp';
1568
1691
  const MaskIconClose = 'MaskIconClose';
1692
+ const MaskIconRestore = 'MaskIconRestore';
1569
1693
  const Actions = 'Actions';
1570
1694
 
1695
+ const emptyActionsNode = {
1696
+ childCount: 0,
1697
+ className: Actions,
1698
+ role: ToolBar,
1699
+ type: Div
1700
+ };
1571
1701
  const getActionsDom = newState => {
1572
1702
  const actions = newState.actionsUid || -1;
1573
- if (actions === -1 || Map) {
1574
- return [{
1575
- childCount: 0,
1576
- className: Actions,
1577
- role: ToolBar,
1578
- type: Div
1579
- }];
1703
+ if (actions <= 0) {
1704
+ return [emptyActionsNode];
1580
1705
  }
1581
1706
  return [{
1582
1707
  type: Reference,
@@ -1586,6 +1711,7 @@ const getActionsDom = newState => {
1586
1711
 
1587
1712
  const HandleClickClose = 'handleClickClose';
1588
1713
  const HandleClickMaximize = 'handleClickMaximize';
1714
+ const HandleClickUnmaximize = 'handleClickUnmaximize';
1589
1715
  const HandleClickSelectTab = 'HandleClickSelectTab';
1590
1716
  const HandleClickTab = 'HandleClickTab';
1591
1717
 
@@ -1602,31 +1728,42 @@ const i18nString = (key, placeholders = emptyObject) => {
1602
1728
  };
1603
1729
 
1604
1730
  const Maximize = 'Maximize';
1731
+ const Unmaximize = 'Unmaximize';
1605
1732
  const Close = 'Close';
1606
1733
 
1607
1734
  const maximize = () => {
1608
1735
  return i18nString(Maximize);
1609
1736
  };
1737
+ const unmaximize = () => {
1738
+ return i18nString(Unmaximize);
1739
+ };
1610
1740
  const close = () => {
1611
1741
  return i18nString(Close);
1612
1742
  };
1613
1743
 
1614
- const getGlobalActionsDom = () => {
1615
- return [{
1616
- childCount: 2,
1617
- className: PanelToolBar,
1618
- role: ToolBar,
1619
- type: Div
1620
- }, {
1621
- ariaLabel: maximize(),
1744
+ const panelToolBarNode = {
1745
+ childCount: 2,
1746
+ className: PanelToolBar,
1747
+ role: ToolBar,
1748
+ type: Div
1749
+ };
1750
+ const getGlobalActionsDom = state => {
1751
+ const {
1752
+ maximized
1753
+ } = state;
1754
+ const maximizeLabel = maximized ? unmaximize() : maximize();
1755
+ const maximizeOnClick = maximized ? HandleClickUnmaximize : HandleClickMaximize;
1756
+ const maximizeIcon = maximized ? MaskIconRestore : MaskIconChevronUp;
1757
+ return [panelToolBarNode, {
1758
+ ariaLabel: maximizeLabel,
1622
1759
  childCount: 1,
1623
1760
  className: IconButton,
1624
- onClick: HandleClickMaximize,
1625
- title: maximize(),
1761
+ onClick: maximizeOnClick,
1762
+ title: maximizeLabel,
1626
1763
  type: Button
1627
1764
  }, {
1628
1765
  childCount: 0,
1629
- className: mergeClassNames(MaskIcon, MaskIconChevronUp),
1766
+ className: mergeClassNames(MaskIcon, maximizeIcon),
1630
1767
  type: Div
1631
1768
  }, {
1632
1769
  ariaLabel: close(),
@@ -1645,12 +1782,17 @@ const getGlobalActionsDom = () => {
1645
1782
  const getTabClassName = isSelected => {
1646
1783
  let className = PanelTab;
1647
1784
  if (isSelected) {
1648
- className += ' ' + PanelTabSelected;
1785
+ className = mergeClassNames(className, PanelTabSelected);
1649
1786
  }
1650
1787
  return className;
1651
1788
  };
1652
1789
 
1653
- const createPanelTab = (tab, badgeCount, isSelected, index) => {
1790
+ const badgeNode = {
1791
+ childCount: 1,
1792
+ className: Badge,
1793
+ type: Div
1794
+ };
1795
+ const createPanelTab = (tab, badgeCount, isSelected) => {
1654
1796
  const label = tab;
1655
1797
  const className = getTabClassName(isSelected);
1656
1798
  const childCount = badgeCount ? 2 : 1;
@@ -1658,7 +1800,6 @@ const createPanelTab = (tab, badgeCount, isSelected, index) => {
1658
1800
  ariaSelected: isSelected,
1659
1801
  childCount,
1660
1802
  className,
1661
- 'data-index': index,
1662
1803
  name: tab,
1663
1804
  onClick: HandleClickTab,
1664
1805
  role: Tab,
@@ -1666,11 +1807,7 @@ const createPanelTab = (tab, badgeCount, isSelected, index) => {
1666
1807
  };
1667
1808
  const dom = [tabDom, text(label)];
1668
1809
  if (badgeCount) {
1669
- dom.push({
1670
- childCount: 1,
1671
- className: Badge,
1672
- type: Div
1673
- }, text(' ' + badgeCount));
1810
+ dom.push(badgeNode, text(' ' + badgeCount));
1674
1811
  }
1675
1812
  return dom;
1676
1813
  };
@@ -1681,34 +1818,36 @@ const getPanelTabsVirtualDom = (tabs, selectedIndex, badgeCounts) => {
1681
1818
  const isSelected = i === selectedIndex;
1682
1819
  const tab = tabs[i];
1683
1820
  const badgeCount = badgeCounts[tab] || 0;
1684
- dom.push(...createPanelTab(tab, badgeCount, isSelected, i));
1821
+ dom.push(...createPanelTab(tab, badgeCount, isSelected));
1685
1822
  }
1686
1823
  return dom;
1687
1824
  };
1688
1825
 
1826
+ const panelHeaderNode = {
1827
+ childCount: 3,
1828
+ className: PanelHeader,
1829
+ type: Div
1830
+ };
1689
1831
  const getPanelHeaderDom = newState => {
1690
1832
  const tabsDom = getPanelTabsVirtualDom(newState.views, newState.selectedIndex, newState.badgeCounts);
1691
- return [{
1692
- childCount: 3,
1693
- className: PanelHeader,
1694
- type: Div
1695
- }, {
1833
+ return [panelHeaderNode, {
1696
1834
  childCount: newState.views.length,
1697
1835
  className: PanelTabs,
1698
1836
  role: TabList,
1699
1837
  type: Div
1700
- }, ...tabsDom, ...getActionsDom(newState), ...getGlobalActionsDom()];
1838
+ }, ...tabsDom, ...getActionsDom(newState), ...getGlobalActionsDom(newState)];
1701
1839
  };
1702
1840
 
1841
+ const panelNode = {
1842
+ childCount: 2,
1843
+ className: Panel,
1844
+ type: Div
1845
+ };
1703
1846
  const getPanelDom = newState => {
1704
1847
  const {
1705
1848
  childUid
1706
1849
  } = newState;
1707
- return [{
1708
- childCount: 2,
1709
- className: Panel,
1710
- type: Div
1711
- }, ...getPanelHeaderDom(newState), {
1850
+ return [panelNode, ...getPanelHeaderDom(newState), {
1712
1851
  type: Reference,
1713
1852
  uid: childUid
1714
1853
  }];
@@ -1734,6 +1873,8 @@ const renderIncremental = (oldState, newState) => {
1734
1873
 
1735
1874
  const getRenderer = diffType => {
1736
1875
  switch (diffType) {
1876
+ case RenderActionsUid:
1877
+ return renderActionsUid;
1737
1878
  case RenderChildUid:
1738
1879
  return renderChildUid;
1739
1880
  case RenderIncremental:
@@ -1771,6 +1912,9 @@ const renderEventListeners = () => {
1771
1912
  return [{
1772
1913
  name: HandleClickMaximize,
1773
1914
  params: ['handleClickMaximize']
1915
+ }, {
1916
+ name: HandleClickUnmaximize,
1917
+ params: ['handleClickUnmaximize']
1774
1918
  }, {
1775
1919
  name: HandleClickClose,
1776
1920
  params: ['handleClickClose']
@@ -1818,7 +1962,10 @@ const selectName = async (state, name) => {
1818
1962
  if (!name) {
1819
1963
  return state;
1820
1964
  }
1821
- const index = state.views.indexOf(name);
1965
+ const {
1966
+ views
1967
+ } = state;
1968
+ const index = views.indexOf(name);
1822
1969
  if (index === -1) {
1823
1970
  return state;
1824
1971
  }
@@ -1832,7 +1979,9 @@ const commandMap = {
1832
1979
  'Panel.handleBlur': wrapCommand(handleBlur),
1833
1980
  'Panel.handleClickClose': wrapCommand(handleClickClose),
1834
1981
  'Panel.handleClickMaximize': wrapCommand(handleClickMaximize),
1982
+ 'Panel.handleClickUnmaximize': wrapCommand(handleClickUnmaximize),
1835
1983
  'Panel.handleFilterInput': wrapCommand(handleFilterInput),
1984
+ 'Panel.handlePanelLayoutChanged': wrapCommand(handlePanelLayoutChanged),
1836
1985
  'Panel.loadContent': wrapCommand(loadContent),
1837
1986
  'Panel.openViewlet': wrapCommand(openViewlet),
1838
1987
  'Panel.render2': render2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/panel-worker",
3
- "version": "1.11.0",
3
+ "version": "2.2.0",
4
4
  "description": "Panel 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/panelWorkerMain.js",
13
- "dependencies": {
14
- "@lvce-editor/virtual-dom-worker": "^8.3.0"
15
- }
12
+ "main": "dist/panelWorkerMain.js"
16
13
  }