@lvce-editor/main-area-worker 9.42.0 → 9.44.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.
@@ -2728,9 +2728,14 @@ const closeTabsRight = (state, groupId) => {
2728
2728
  layout
2729
2729
  } = state;
2730
2730
  const {
2731
+ activeGroupId,
2731
2732
  groups
2732
2733
  } = layout;
2733
- const group = getGroupById(state, groupId);
2734
+ const targetGroupId = groupId ?? activeGroupId;
2735
+ if (targetGroupId === -1) {
2736
+ return state;
2737
+ }
2738
+ const group = getGroupById(state, targetGroupId);
2734
2739
  if (!group) {
2735
2740
  return state;
2736
2741
  }
@@ -2749,7 +2754,7 @@ const closeTabsRight = (state, groupId) => {
2749
2754
  if (newTabs.length === tabs.length) {
2750
2755
  return state;
2751
2756
  }
2752
- const groupIndex = groups.findIndex(g => g.id === groupId);
2757
+ const groupIndex = groups.findIndex(g => g.id === targetGroupId);
2753
2758
  const closedTabs = tabs.slice(activeTabIndex + 1).map((tab, index) => ({
2754
2759
  group,
2755
2760
  groupIndex,
@@ -2757,7 +2762,7 @@ const closeTabsRight = (state, groupId) => {
2757
2762
  tabIndex: activeTabIndex + index + 1
2758
2763
  }));
2759
2764
  const newGroups = groups.map(g => {
2760
- if (g.id === groupId) {
2765
+ if (g.id === targetGroupId) {
2761
2766
  return {
2762
2767
  ...g,
2763
2768
  isEmpty: newTabs.length === 0,
@@ -2987,7 +2992,7 @@ const getEditorInputUri = editorInput => {
2987
2992
 
2988
2993
  const imageExtensions = new Set(['.avif', '.bmp', '.gif', '.ico', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff', '.webp']);
2989
2994
  const videoExtensions = new Set(['.avi', '.m4v', '.mkv', '.mov', '.mp4', '.mpeg', '.mpg', '.ogv', '.webm']);
2990
- const binaryFileSuffixes = ['.7z', '.apk', '.br', '.bz2', '.deb', '.gz', '.jar', '.pdf', '.rar', '.rpm', '.tar', '.tar.br', '.tar.bz2', '.tar.gz', '.tar.xz', '.tar.zst', '.tbr', '.tgz', '.war', '.xz', '.zip', '.zst'];
2995
+ const binaryFileSuffixes = ['.7z', '.apk', '.beam', '.br', '.bz2', '.deb', '.gz', '.jar', '.pdf', '.rar', '.rpm', '.tar', '.tar.br', '.tar.bz2', '.tar.gz', '.tar.xz', '.tar.zst', '.tbr', '.tgz', '.war', '.xz', '.zip', '.zst'];
2991
2996
  const getPathEndIndex = pathName => {
2992
2997
  const queryIndex = pathName.indexOf('?');
2993
2998
  const hashIndex = pathName.indexOf('#');
@@ -4263,12 +4268,12 @@ const clampIndex = (value, min, max) => {
4263
4268
  return Math.min(Math.max(value, min), max);
4264
4269
  };
4265
4270
  const getRestoredTab = tab => {
4266
- return {
4271
+ return normalizeTabEditorInput({
4267
4272
  ...tab,
4268
4273
  editorUid: -1,
4269
4274
  errorMessage: '',
4270
4275
  loadingState: undefined
4271
- };
4276
+ });
4272
4277
  };
4273
4278
  const getStateWithoutLastClosedTab = state => {
4274
4279
  const {
@@ -4507,7 +4512,7 @@ const getGroupSegments = (groups, parentDirection) => {
4507
4512
  index++;
4508
4513
  }
4509
4514
  segments.push({
4510
- direction: group.direction,
4515
+ direction: nestedGroups.length === 1 ? undefined : group.direction,
4511
4516
  groups: nestedGroups,
4512
4517
  startIndex
4513
4518
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-area-worker",
3
- "version": "9.42.0",
3
+ "version": "9.44.1",
4
4
  "description": "Main Area Worker",
5
5
  "repository": {
6
6
  "type": "git",