@lvce-editor/main-area-worker 9.73.1 → 9.74.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.
@@ -2064,6 +2064,9 @@ const getLoadFileErrorMessage = error => {
2064
2064
  }
2065
2065
  return error.message;
2066
2066
  };
2067
+ const isBinaryFileError = error => {
2068
+ return error instanceof Error && error.name === 'BinaryFileError';
2069
+ };
2067
2070
  const loadTabContentAsync = async (tabId, path, requestId, getLatestState) => {
2068
2071
  try {
2069
2072
  await loadFileContent(path);
@@ -2101,6 +2104,16 @@ const loadTabContentAsync = async (tabId, path, requestId, getLatestState) => {
2101
2104
  if (latestTab.loadingState !== 'loading') {
2102
2105
  return latestState;
2103
2106
  }
2107
+ if (isBinaryFileError(error)) {
2108
+ return updateTab(latestState, tabId, {
2109
+ editorInput: {
2110
+ type: 'binary',
2111
+ uri: path
2112
+ },
2113
+ errorMessage: undefined,
2114
+ loadingState: 'binary'
2115
+ });
2116
+ }
2104
2117
  const errorMessage = getLoadFileErrorMessage(error);
2105
2118
  return updateTab(latestState, tabId, {
2106
2119
  errorMessage,
@@ -4101,7 +4114,7 @@ const NewTextFile = 'New Text File';
4101
4114
  const NewWindow = 'New Window';
4102
4115
  const OpenFile = 'Open File';
4103
4116
  const OpenAnyway = 'Open Anyway';
4104
- const OpenInTextEditor = 'Open in Text Editor';
4117
+ const OpenInTextEditor = 'Reopen with Text Editor';
4105
4118
  const BinaryFileNotDisplayed = 'The file is not displayed in the text editor because its contents are binary.';
4106
4119
  const LargeFileNotDisplayed = 'The file is not displayed in the text editor because it is very large';
4107
4120
  const SplitDown = 'Split Down';
@@ -4422,6 +4435,7 @@ const ProcessExplorerScheme = 'process-explorer://';
4422
4435
  const RunningExtensionsScheme = 'running-extensions://';
4423
4436
  const SearchEditorScheme = 'search-editor://';
4424
4437
  const SettingsScheme = 'settings://';
4438
+ const WorkersScheme = 'workers:///';
4425
4439
  const tabIconNode = {
4426
4440
  childCount: 1,
4427
4441
  className: TabIcon,
@@ -4459,6 +4473,9 @@ const renderTabIcon = tab => {
4459
4473
  if (tab.uri?.startsWith(SettingsScheme)) {
4460
4474
  return renderMaskIcon(MaskIconSettingsGear);
4461
4475
  }
4476
+ if (tab.uri?.startsWith(WorkersScheme)) {
4477
+ return renderMaskIcon(MaskIconDebugAlt2);
4478
+ }
4462
4479
  if (!tab.icon) {
4463
4480
  return [];
4464
4481
  }
@@ -5617,6 +5634,9 @@ const getViewletArgs = options => {
5617
5634
  return [{
5618
5635
  ...context,
5619
5636
  focus: options.focus,
5637
+ ...(options.editorInput.type === 'editor' && options.editorInput.forceText === true && {
5638
+ forceText: true
5639
+ }),
5620
5640
  ...(options.forceOpen === true && {
5621
5641
  largeFile: true
5622
5642
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-area-worker",
3
- "version": "9.73.1",
3
+ "version": "9.74.0",
4
4
  "description": "Main Area Worker",
5
5
  "repository": {
6
6
  "type": "git",