@lvce-editor/main-area-worker 9.67.0 → 9.67.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.
@@ -7897,25 +7897,25 @@ const getEditorInputUris = editorInput => {
7897
7897
  return [];
7898
7898
  }
7899
7899
  };
7900
- const getChangedEditorUid = (editorUid, editorInput, uri, changedUris) => {
7900
+ const getChangedEditorUid = (editorUid, editorInput, uri, changedUris, reloadAll) => {
7901
7901
  if (editorUid === -1) {
7902
7902
  return undefined;
7903
7903
  }
7904
7904
  const uris = getEditorInputUris(editorInput);
7905
- if (uris.some(editorUri => changedUris.has(editorUri)) || uris.length === 0 && uri && changedUris.has(uri)) {
7905
+ if (reloadAll && (uris.length > 0 || uri) || uris.some(editorUri => changedUris.has(editorUri)) || uris.length === 0 && uri && changedUris.has(uri)) {
7906
7906
  return editorUid;
7907
7907
  }
7908
7908
  return undefined;
7909
7909
  };
7910
- const reloadChangedEditors = async (state, changed) => {
7911
- if (changed.length === 0) {
7910
+ const reloadChangedEditors = async (state, changed, reloadAll) => {
7911
+ if (changed.length === 0 && !reloadAll) {
7912
7912
  return;
7913
7913
  }
7914
7914
  const changedUris = new Set(changed);
7915
7915
  const editorUids = new Set();
7916
7916
  for (const group of state.layout.groups) {
7917
7917
  for (const tab of group.tabs) {
7918
- const editorUid = getChangedEditorUid(tab.editorUid, tab.editorInput, tab.uri, changedUris);
7918
+ const editorUid = getChangedEditorUid(tab.editorUid, tab.editorInput, tab.uri, changedUris, reloadAll);
7919
7919
  if (editorUid !== undefined) {
7920
7920
  editorUids.add(editorUid);
7921
7921
  }
@@ -7932,6 +7932,7 @@ const handleWorkspaceRefresh = async (state, refresh = {}) => {
7932
7932
  deleted = [],
7933
7933
  renamed = []
7934
7934
  } = changes;
7935
+ const reloadAll = changes.reloadAll === true;
7935
7936
  let newState = state;
7936
7937
  for (const [oldUri, newUri] of renamed) {
7937
7938
  newState = await handleUriChange(newState, oldUri, newUri);
@@ -7944,7 +7945,7 @@ const handleWorkspaceRefresh = async (state, refresh = {}) => {
7944
7945
  }
7945
7946
  }
7946
7947
  }
7947
- await reloadChangedEditors(newState, changed);
7948
+ await reloadChangedEditors(newState, changed, reloadAll);
7948
7949
  return newState;
7949
7950
  };
7950
7951
  const handleWorkspaceRefreshWithContext = async (context, refresh = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-area-worker",
3
- "version": "9.67.0",
3
+ "version": "9.67.1",
4
4
  "description": "Main Area Worker",
5
5
  "repository": {
6
6
  "type": "git",