@lvce-editor/main-area-worker 9.64.0 → 9.64.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.
@@ -1798,14 +1798,42 @@ const getActiveFileUri = state => {
1798
1798
  return editorInput && 'uri' in editorInput ? editorInput.uri : '';
1799
1799
  };
1800
1800
 
1801
+ const getActiveTab = state => {
1802
+ const {
1803
+ layout
1804
+ } = state;
1805
+ const {
1806
+ groups
1807
+ } = layout;
1808
+ const activeGroup = groups.find(group => group.focused);
1809
+ if (!activeGroup || !activeGroup.activeTabId) {
1810
+ return undefined;
1811
+ }
1812
+ const activeTab = activeGroup.tabs.find(tab => tab.id === activeGroup.activeTabId);
1813
+ if (!activeTab) {
1814
+ return undefined;
1815
+ }
1816
+ return {
1817
+ groupId: activeGroup.id,
1818
+ tab: activeTab
1819
+ };
1820
+ };
1821
+
1822
+ const hasActiveTextEditor = state => {
1823
+ const activeTab = getActiveTab(state);
1824
+ return activeTab?.tab.editorInput?.type === 'editor';
1825
+ };
1826
+
1801
1827
  const notifyActiveEditorChange = async (oldState, newState) => {
1802
1828
  const oldUri = getActiveFileUri(oldState);
1803
1829
  const newUri = getActiveFileUri(newState);
1804
- if (oldUri === newUri) {
1830
+ const oldIsTextEditor = hasActiveTextEditor(oldState);
1831
+ const newIsTextEditor = hasActiveTextEditor(newState);
1832
+ if (oldUri === newUri && oldIsTextEditor === newIsTextEditor) {
1805
1833
  return;
1806
1834
  }
1807
1835
  try {
1808
- await invoke$1(newState.applicationId, 'Layout.handleActiveEditorChange', newUri);
1836
+ await invoke$1(newState.applicationId, 'Layout.handleActiveEditorChange', newUri, newIsTextEditor);
1809
1837
  } catch (error) {
1810
1838
  console.warn('Failed to notify viewlets about active editor change', error);
1811
1839
  }
@@ -2764,27 +2792,6 @@ const diff2 = uid => {
2764
2792
  return result;
2765
2793
  };
2766
2794
 
2767
- const getActiveTab = state => {
2768
- const {
2769
- layout
2770
- } = state;
2771
- const {
2772
- groups
2773
- } = layout;
2774
- const activeGroup = groups.find(group => group.focused);
2775
- if (!activeGroup || !activeGroup.activeTabId) {
2776
- return undefined;
2777
- }
2778
- const activeTab = activeGroup.tabs.find(tab => tab.id === activeGroup.activeTabId);
2779
- if (!activeTab) {
2780
- return undefined;
2781
- }
2782
- return {
2783
- groupId: activeGroup.id,
2784
- tab: activeTab
2785
- };
2786
- };
2787
-
2788
2795
  const state = {
2789
2796
  connected: false
2790
2797
  };
@@ -4560,6 +4567,7 @@ const renderSash = (direction, sashId) => {
4560
4567
  }, {
4561
4568
  childCount: 0,
4562
4569
  className: getSashBorderClassName(direction),
4570
+ 'data-sashId': sashId,
4563
4571
  type: Div
4564
4572
  }];
4565
4573
  };
@@ -7784,11 +7792,6 @@ const handleWorkspaceRefreshWithContext = async (context, refresh = {}) => {
7784
7792
  }
7785
7793
  };
7786
7794
 
7787
- const hasActiveTextEditor = state => {
7788
- const activeTab = getActiveTab(state);
7789
- return activeTab?.tab.editorInput?.type === 'editor';
7790
- };
7791
-
7792
7795
  const getTabs = group => {
7793
7796
  return group.tabs;
7794
7797
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-area-worker",
3
- "version": "9.64.0",
3
+ "version": "9.64.1",
4
4
  "description": "Main Area Worker",
5
5
  "repository": {
6
6
  "type": "git",