UNPKG

@theia/workspace

Version:
66 lines (64 loc) 3.44 kB
"use strict"; // ***************************************************************************** // Copyright (C) 2026 EclipseSource and others. // // This program and the accompanying materials are made available under the // terms of the Eclipse Public License v. 2.0 which is available at // http://www.eclipse.org/legal/epl-2.0. // // This Source Code may also be made available under the following Secondary // Licenses when the conditions for such availability set forth in the Eclipse // Public License v. 2.0 are satisfied: GNU General Public License, version 2 // with the GNU Classpath Exception which is available at // https://www.gnu.org/software/classpath/license.html. // // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 // ***************************************************************************** Object.defineProperty(exports, "__esModule", { value: true }); exports.WorkspaceTrustDialog = void 0; const core_1 = require("@theia/core"); const browser_1 = require("@theia/core/lib/browser"); const react_dialog_1 = require("@theia/core/lib/browser/dialogs/react-dialog"); const React = require("@theia/core/shared/react"); class WorkspaceTrustDialog extends react_dialog_1.ReactDialog { constructor(folderUris) { super({ title: '', maxWidth: 500 }); this.folderUris = folderUris; this.confirmed = true; this.node.classList.add('workspace-trust-dialog'); this.appendCloseButton(core_1.nls.localizeByDefault("No, I don't trust the authors")); this.appendAcceptButton(core_1.nls.localizeByDefault('Yes, I trust the authors')); this.controlPanel.removeChild(this.errorMessageNode); } get value() { return this.confirmed; } handleEscape() { this.confirmed = false; this.accept(); } close() { this.confirmed = false; this.accept(); } render() { return (React.createElement("div", { className: "workspace-trust-content" }, React.createElement("div", { className: "workspace-trust-header" }, React.createElement("i", { className: (0, browser_1.codicon)('shield') }), React.createElement("div", { className: "workspace-trust-title" }, core_1.nls.localizeByDefault('Do you trust the authors of the files in this folder?'))), React.createElement("div", { className: "workspace-trust-description" }, core_1.nls.localize('theia/workspace/trustDialogMessage', `If you trust the authors, code in this folder may be executed. If not, some features will be disabled. The workspace trust feature is currently under development in Theia; not all features are integrated with workspace trust yet. Check the 'Restricted Mode' indicator in the status bar for details.`)), this.folderUris.length > 0 && (React.createElement("div", { className: "workspace-trust-folder" }, React.createElement("ul", { className: "workspace-trust-folder-list" }, this.folderUris.map(uri => { const stringified = uri.path.fsPath(); return (React.createElement("li", { key: stringified }, stringified)); })))))); } } exports.WorkspaceTrustDialog = WorkspaceTrustDialog; //# sourceMappingURL=workspace-trust-dialog.js.map