@eclipse-docks/core 0.7.96 → 0.7.98

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.
package/dist/api/index.js CHANGED
@@ -3,5 +3,5 @@ import { i as setLogLevel, n as defaultLogger, o as rootContext, s as uiContext,
3
3
  import { C as toastWarning, S as toastInfo, _ as applyConfigNameRemaps, a as TOPIC_COMMAND_REGISTERED, b as overrideContributionTargets, c as EMPTY_SIGNALPORT, d as activeSelectionSignal, f as activeTasksSignal, g as contributionRegistry, h as TOPIC_CONTRIBUTEIONS_CHANGED, i as CommandStack, l as activeEditorSignal, m as perspectiveSwitchedSignal, n as watchSignal, o as commandRegistry, p as partDirtySignal, r as CommandRegistry, s as registerAll, t as DocksWidget, u as activePartSignal, v as contributionTargetMappingRegistry, x as toastError, y as listContributionNameRemaps } from "../widget-BgBerzhp.js";
4
4
  import { n as subscribe, r as unsubscribe, t as publish } from "../events-B_ZxkU_G.js";
5
5
  import { a as File, c as TOPIC_WORKSPACE_CHANGED, d as WorkspaceService, f as workspaceService, i as Directory, l as TOPIC_WORKSPACE_CONNECTED, o as FileContentType, p as persistenceService, r as CompositeDirectory, s as StringFile, t as FileSysDirHandleResource } from "../fs-access-D-fDaJ8V.js";
6
- import { a as DocksStandardLayout, c as createLazyLabel, i as createJsRuntime, l as i18n, n as getFrameworkConfig, o as treeNodeComparator, r as runJavaScriptCode, s as editorRegistry, t as configureFramework } from "../api-BCLny6A5.js";
6
+ import { a as DocksStandardLayout, c as createLazyLabel, i as createJsRuntime, l as i18n, n as getFrameworkConfig, o as treeNodeComparator, r as runJavaScriptCode, s as editorRegistry, t as configureFramework } from "../api-CRZ-pC4q.js";
7
7
  export { COMMAND_SAVE, CommandRegistry, CommandStack, CompositeDirectory, Directory, DocksContainer, DocksDialogContent, DocksElement, DocksPart, DocksStandardLayout, DocksWidget, EDITOR_AREA_MAIN, EMPTY_SIGNALPORT, File, FileContentType, FileSysDirHandleResource, HIDE_DOT_RESOURCE, MouseButton, PANEL_BOTTOM, SIDEBAR_AUXILIARY, SIDEBAR_MAIN, SIDEBAR_MAIN_BOTTOM, SIDEBAR_MAIN_TOOLBAR, SYSTEM_LAYOUTS, SYSTEM_VIEWS, StringFile, TOOLBAR_BOTTOM, TOOLBAR_BOTTOM_CENTER, TOOLBAR_BOTTOM_END, TOOLBAR_MAIN, TOOLBAR_MAIN_CENTER, TOOLBAR_MAIN_RIGHT, TOPIC_COMMAND_REGISTERED, TOPIC_CONTRIBUTEIONS_CHANGED, TOPIC_SETTINGS_CHANGED, TOPIC_WORKSPACE_CHANGED, TOPIC_WORKSPACE_CONNECTED, WorkspaceService, activeEditorSignal, activePartSignal, activeSelectionSignal, activeTasksSignal, appLoaderService, appSettings, applyConfigNameRemaps, commandRegistry, configureFramework, confirmDialog, contributionRegistry, contributionTargetMappingRegistry, createJsRuntime, createLazyLabel, createLogger, dialogService, editorRegistry, esmShService, extensionRegistry, filebrowserDialog, getFrameworkConfig, i18n, icon, infoDialog, listContributionNameRemaps, defaultLogger as logger, navigableInfoDialog, overrideContributionTargets, parseIconSpec, partDirtySignal, persistenceService, perspectiveSwitchedSignal, promptDialog, publish, registerAll, rootContext, runJavaScriptCode, setLogLevel, subscribe, taskService, toastError, toastInfo, toastWarning, treeNodeComparator, uiContext, unsubscribe, watchSignal, workspaceService };
@@ -12,7 +12,6 @@ import { customElement, property, state } from "lit/decorators.js";
12
12
  import _decorate from "@oxc-project/runtime/helpers/decorate";
13
13
  import { createRef, ref } from "lit/directives/ref.js";
14
14
  import { when } from "lit/directives/when.js";
15
- import JSZip from "jszip";
16
15
  //#region src/core/i18n.ts
17
16
  /**
18
17
  * Why this custom i18n layer exists (instead of directly using @lit/localize):
@@ -4136,77 +4135,6 @@ registerAll({
4136
4135
  } }
4137
4136
  });
4138
4137
  //#endregion
4139
- //#region src/commands/unzip.ts
4140
- registerAll({
4141
- command: {
4142
- id: "unzip",
4143
- name: "Unzip Archive",
4144
- description: "Extract a zip archive from the workspace",
4145
- parameters: [{
4146
- name: "file",
4147
- description: "the zip file to extract, if not provided, the current selection will be used",
4148
- required: false
4149
- }, {
4150
- name: "target",
4151
- description: "target folder to extract into, defaults to the zip filename without extension",
4152
- required: false
4153
- }]
4154
- },
4155
- handler: {
4156
- canExecute: (context) => {
4157
- let filePath = context.params?.file;
4158
- if (!filePath) {
4159
- const selectedItem = activeSelectionSignal.get();
4160
- if (!selectedItem || !("path" in selectedItem)) return false;
4161
- filePath = selectedItem.path;
4162
- }
4163
- return filePath.toLowerCase().endsWith(".zip");
4164
- },
4165
- execute: async (context) => {
4166
- let filePath = context.params?.file;
4167
- if (!filePath) filePath = activeSelectionSignal.get().path;
4168
- const workspaceDir = await workspaceService.getWorkspace();
4169
- if (!workspaceDir) {
4170
- toastError("No workspace selected.");
4171
- return;
4172
- }
4173
- await taskService.runAsync("Extracting archive", async (progress) => {
4174
- try {
4175
- const fileResource = await workspaceDir.getResource(filePath);
4176
- if (!fileResource) {
4177
- toastError("File not found: " + filePath);
4178
- return;
4179
- }
4180
- let targetFolder = context.params?.target;
4181
- if (!targetFolder) targetFolder = (filePath.split("/").pop() || "extracted").replace(/\.zip$/i, "") + "/";
4182
- progress.message = "Loading archive...";
4183
- progress.progress = 0;
4184
- await workspaceDir.getResource(targetFolder, { create: true });
4185
- const blob = await fileResource.getContents({ blob: true });
4186
- const zip = await JSZip.loadAsync(blob);
4187
- const totalFiles = Object.values(zip.files).filter((entry) => !entry.dir).length;
4188
- let extractedCount = 0;
4189
- progress.message = `Extracting to ${targetFolder.replace(/\/$/, "")}...`;
4190
- for (const [relativePath, zipEntry] of Object.entries(zip.files)) {
4191
- if (zipEntry.dir) continue;
4192
- const entryBlob = await zipEntry.async("blob");
4193
- const fullPath = `${targetFolder}${relativePath}`;
4194
- await (await workspaceDir.getResource(fullPath, { create: true })).saveContents(entryBlob, { contentType: FileContentType.BINARY });
4195
- extractedCount++;
4196
- progress.progress = Math.round(extractedCount / totalFiles * 100);
4197
- progress.message = `Extracting ${extractedCount}/${totalFiles} files...`;
4198
- }
4199
- progress.progress = 100;
4200
- toastInfo(`Archive extracted to ${targetFolder.replace(/\/$/, "")}: ${extractedCount} file(s)`);
4201
- } catch (err) {
4202
- toastError("Failed to extract archive: " + err);
4203
- throw err;
4204
- }
4205
- });
4206
- }
4207
- }
4208
- });
4209
- //#endregion
4210
4138
  //#region src/commands/wc.ts
4211
4139
  registerAll({
4212
4140
  command: {
@@ -4395,4 +4323,4 @@ function getFrameworkConfig() {
4395
4323
  //#endregion
4396
4324
  export { DocksStandardLayout as a, createLazyLabel as c, createJsRuntime as i, i18n as l, getFrameworkConfig as n, treeNodeComparator as o, runJavaScriptCode as r, editorRegistry as s, configureFramework as t };
4397
4325
 
4398
- //# sourceMappingURL=api-BCLny6A5.js.map
4326
+ //# sourceMappingURL=api-CRZ-pC4q.js.map