@theia/getting-started 1.45.0 → 1.46.0-next.72

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.
@@ -1,57 +1,57 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2023 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.bindGettingStartedPreferences = exports.createGettingStartedPreferences = exports.GettingStartedPreferences = exports.GettingStartedPreferenceContribution = exports.GettingStartedPreferenceSchema = void 0;
19
- const preferences_1 = require("@theia/core/lib/browser/preferences");
20
- const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
21
- const nls_1 = require("@theia/core/lib/common/nls");
22
- exports.GettingStartedPreferenceSchema = {
23
- 'type': 'object',
24
- properties: {
25
- 'workbench.startupEditor': {
26
- type: 'string',
27
- enum: ['none', 'welcomePage', 'readme', 'newUntitledFile', 'welcomePageInEmptyWorkbench'],
28
- enumDescriptions: [
29
- nls_1.nls.localizeByDefault('Start without an editor.'),
30
- nls_1.nls.localize('theia/getting-started/startup-editor/welcomePage', 'Open the Welcome page, with content to aid in getting started with {0} and extensions.', frontend_application_config_provider_1.FrontendApplicationConfigProvider.get().applicationName),
31
- // eslint-disable-next-line max-len
32
- nls_1.nls.localizeByDefault("Open the README when opening a folder that contains one, fallback to 'welcomePage' otherwise. Note: This is only observed as a global configuration, it will be ignored if set in a workspace or folder configuration."),
33
- nls_1.nls.localizeByDefault('Open a new untitled text file (only applies when opening an empty window).'),
34
- nls_1.nls.localizeByDefault('Open the Welcome page when opening an empty workbench.'),
35
- ],
36
- default: 'welcomePage',
37
- description: nls_1.nls.localizeByDefault('Controls which editor is shown at startup, if none are restored from the previous session.')
38
- },
39
- }
40
- };
41
- exports.GettingStartedPreferenceContribution = Symbol('GettingStartedPreferenceContribution');
42
- exports.GettingStartedPreferences = Symbol('GettingStartedPreferences');
43
- function createGettingStartedPreferences(preferences, schema = exports.GettingStartedPreferenceSchema) {
44
- return (0, preferences_1.createPreferenceProxy)(preferences, schema);
45
- }
46
- exports.createGettingStartedPreferences = createGettingStartedPreferences;
47
- function bindGettingStartedPreferences(bind) {
48
- bind(exports.GettingStartedPreferences).toDynamicValue(ctx => {
49
- const preferences = ctx.container.get(preferences_1.PreferenceService);
50
- const contribution = ctx.container.get(exports.GettingStartedPreferenceContribution);
51
- return createGettingStartedPreferences(preferences, contribution.schema);
52
- }).inSingletonScope();
53
- bind(exports.GettingStartedPreferenceContribution).toConstantValue({ schema: exports.GettingStartedPreferenceSchema });
54
- bind(preferences_1.PreferenceContribution).toService(exports.GettingStartedPreferenceContribution);
55
- }
56
- exports.bindGettingStartedPreferences = bindGettingStartedPreferences;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.bindGettingStartedPreferences = exports.createGettingStartedPreferences = exports.GettingStartedPreferences = exports.GettingStartedPreferenceContribution = exports.GettingStartedPreferenceSchema = void 0;
19
+ const preferences_1 = require("@theia/core/lib/browser/preferences");
20
+ const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
21
+ const nls_1 = require("@theia/core/lib/common/nls");
22
+ exports.GettingStartedPreferenceSchema = {
23
+ 'type': 'object',
24
+ properties: {
25
+ 'workbench.startupEditor': {
26
+ type: 'string',
27
+ enum: ['none', 'welcomePage', 'readme', 'newUntitledFile', 'welcomePageInEmptyWorkbench'],
28
+ enumDescriptions: [
29
+ nls_1.nls.localizeByDefault('Start without an editor.'),
30
+ nls_1.nls.localize('theia/getting-started/startup-editor/welcomePage', 'Open the Welcome page, with content to aid in getting started with {0} and extensions.', frontend_application_config_provider_1.FrontendApplicationConfigProvider.get().applicationName),
31
+ // eslint-disable-next-line max-len
32
+ nls_1.nls.localizeByDefault("Open the README when opening a folder that contains one, fallback to 'welcomePage' otherwise. Note: This is only observed as a global configuration, it will be ignored if set in a workspace or folder configuration."),
33
+ nls_1.nls.localizeByDefault('Open a new untitled text file (only applies when opening an empty window).'),
34
+ nls_1.nls.localizeByDefault('Open the Welcome page when opening an empty workbench.'),
35
+ ],
36
+ default: 'welcomePage',
37
+ description: nls_1.nls.localizeByDefault('Controls which editor is shown at startup, if none are restored from the previous session.')
38
+ },
39
+ }
40
+ };
41
+ exports.GettingStartedPreferenceContribution = Symbol('GettingStartedPreferenceContribution');
42
+ exports.GettingStartedPreferences = Symbol('GettingStartedPreferences');
43
+ function createGettingStartedPreferences(preferences, schema = exports.GettingStartedPreferenceSchema) {
44
+ return (0, preferences_1.createPreferenceProxy)(preferences, schema);
45
+ }
46
+ exports.createGettingStartedPreferences = createGettingStartedPreferences;
47
+ function bindGettingStartedPreferences(bind) {
48
+ bind(exports.GettingStartedPreferences).toDynamicValue(ctx => {
49
+ const preferences = ctx.container.get(preferences_1.PreferenceService);
50
+ const contribution = ctx.container.get(exports.GettingStartedPreferenceContribution);
51
+ return createGettingStartedPreferences(preferences, contribution.schema);
52
+ }).inSingletonScope();
53
+ bind(exports.GettingStartedPreferenceContribution).toConstantValue({ schema: exports.GettingStartedPreferenceSchema });
54
+ bind(preferences_1.PreferenceContribution).toService(exports.GettingStartedPreferenceContribution);
55
+ }
56
+ exports.bindGettingStartedPreferences = bindGettingStartedPreferences;
57
57
  //# sourceMappingURL=getting-started-preferences.js.map
@@ -1,157 +1,157 @@
1
- /// <reference types="react" />
2
- import * as React from '@theia/core/shared/react';
3
- import URI from '@theia/core/lib/common/uri';
4
- import { CommandRegistry } from '@theia/core/lib/common';
5
- import { WorkspaceService } from '@theia/workspace/lib/browser';
6
- import { Message, ReactWidget, LabelProvider, PreferenceService } from '@theia/core/lib/browser';
7
- import { ApplicationInfo, ApplicationServer } from '@theia/core/lib/common/application-protocol';
8
- import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
9
- import { WindowService } from '@theia/core/lib/browser/window/window-service';
10
- /**
11
- * Default implementation of the `GettingStartedWidget`.
12
- * The widget is displayed when there are currently no workspaces present.
13
- * Some of the features displayed include:
14
- * - `open` commands.
15
- * - `recently used workspaces`.
16
- * - `settings` commands.
17
- * - `help` commands.
18
- * - helpful links.
19
- */
20
- export declare class GettingStartedWidget extends ReactWidget {
21
- /**
22
- * The widget `id`.
23
- */
24
- static readonly ID = "getting.started.widget";
25
- /**
26
- * The widget `label` which is used for display purposes.
27
- */
28
- static readonly LABEL: string;
29
- /**
30
- * The `ApplicationInfo` for the application if available.
31
- * Used in order to obtain the version number of the application.
32
- */
33
- protected applicationInfo: ApplicationInfo | undefined;
34
- /**
35
- * The application name which is used for display purposes.
36
- */
37
- protected applicationName: string;
38
- protected home: string | undefined;
39
- /**
40
- * The recently used workspaces limit.
41
- * Used in order to limit the number of recently used workspaces to display.
42
- */
43
- protected recentLimit: number;
44
- /**
45
- * The list of recently used workspaces.
46
- */
47
- protected recentWorkspaces: string[];
48
- /**
49
- * Collection of useful links to display for end users.
50
- */
51
- protected readonly documentationUrl = "https://www.theia-ide.org/docs/";
52
- protected readonly compatibilityUrl = "https://eclipse-theia.github.io/vscode-theia-comparator/status.html";
53
- protected readonly extensionUrl = "https://www.theia-ide.org/docs/authoring_extensions";
54
- protected readonly pluginUrl = "https://www.theia-ide.org/docs/authoring_plugins";
55
- protected readonly appServer: ApplicationServer;
56
- protected readonly commandRegistry: CommandRegistry;
57
- protected readonly environments: EnvVariablesServer;
58
- protected readonly labelProvider: LabelProvider;
59
- protected readonly windowService: WindowService;
60
- protected readonly workspaceService: WorkspaceService;
61
- protected readonly preferenceService: PreferenceService;
62
- protected init(): void;
63
- protected doInit(): Promise<void>;
64
- protected onActivateRequest(msg: Message): void;
65
- /**
66
- * Render the content of the widget.
67
- */
68
- protected render(): React.ReactNode;
69
- /**
70
- * Render the widget header.
71
- * Renders the title `{applicationName} Getting Started`.
72
- */
73
- protected renderHeader(): React.ReactNode;
74
- /**
75
- * Render the `open` section.
76
- * Displays a collection of `open` commands.
77
- */
78
- protected renderOpen(): React.ReactNode;
79
- /**
80
- * Render the recently used workspaces section.
81
- */
82
- protected renderRecentWorkspaces(): React.ReactNode;
83
- /**
84
- * Render the settings section.
85
- * Generally used to display useful links.
86
- */
87
- protected renderSettings(): React.ReactNode;
88
- /**
89
- * Render the help section.
90
- */
91
- protected renderHelp(): React.ReactNode;
92
- /**
93
- * Render the version section.
94
- */
95
- protected renderVersion(): React.ReactNode;
96
- protected renderPreferences(): React.ReactNode;
97
- /**
98
- * Build the list of workspace paths.
99
- * @param workspaces {string[]} the list of workspaces.
100
- * @returns {string[]} the list of workspace paths.
101
- */
102
- protected buildPaths(workspaces: string[]): string[];
103
- /**
104
- * Trigger the open command.
105
- */
106
- protected doOpen: () => Promise<unknown>;
107
- protected doOpenEnter: (e: React.KeyboardEvent) => void;
108
- /**
109
- * Trigger the open file command.
110
- */
111
- protected doOpenFile: () => Promise<unknown>;
112
- protected doOpenFileEnter: (e: React.KeyboardEvent) => void;
113
- /**
114
- * Trigger the open folder command.
115
- */
116
- protected doOpenFolder: () => Promise<unknown>;
117
- protected doOpenFolderEnter: (e: React.KeyboardEvent) => void;
118
- /**
119
- * Trigger the open workspace command.
120
- */
121
- protected doOpenWorkspace: () => Promise<unknown>;
122
- protected doOpenWorkspaceEnter: (e: React.KeyboardEvent) => void;
123
- /**
124
- * Trigger the open recent workspace command.
125
- */
126
- protected doOpenRecentWorkspace: () => Promise<unknown>;
127
- protected doOpenRecentWorkspaceEnter: (e: React.KeyboardEvent) => void;
128
- /**
129
- * Trigger the open preferences command.
130
- * Used to open the preferences widget.
131
- */
132
- protected doOpenPreferences: () => Promise<unknown>;
133
- protected doOpenPreferencesEnter: (e: React.KeyboardEvent) => void;
134
- /**
135
- * Trigger the open keyboard shortcuts command.
136
- * Used to open the keyboard shortcuts widget.
137
- */
138
- protected doOpenKeyboardShortcuts: () => Promise<unknown>;
139
- protected doOpenKeyboardShortcutsEnter: (e: React.KeyboardEvent) => void;
140
- /**
141
- * Open a workspace given its uri.
142
- * @param uri {URI} the workspace uri.
143
- */
144
- protected open: (uri: URI) => void;
145
- protected openEnter: (e: React.KeyboardEvent, uri: URI) => void;
146
- /**
147
- * Open a link in an external window.
148
- * @param url the link.
149
- */
150
- protected doOpenExternalLink: (url: string) => undefined;
151
- protected doOpenExternalLinkEnter: (e: React.KeyboardEvent, url: string) => void;
152
- protected isEnterKey(e: React.KeyboardEvent): boolean;
153
- }
154
- export interface PreferencesProps {
155
- preferenceService: PreferenceService;
156
- }
1
+ /// <reference types="react" />
2
+ import * as React from '@theia/core/shared/react';
3
+ import URI from '@theia/core/lib/common/uri';
4
+ import { CommandRegistry } from '@theia/core/lib/common';
5
+ import { WorkspaceService } from '@theia/workspace/lib/browser';
6
+ import { Message, ReactWidget, LabelProvider, PreferenceService } from '@theia/core/lib/browser';
7
+ import { ApplicationInfo, ApplicationServer } from '@theia/core/lib/common/application-protocol';
8
+ import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
9
+ import { WindowService } from '@theia/core/lib/browser/window/window-service';
10
+ /**
11
+ * Default implementation of the `GettingStartedWidget`.
12
+ * The widget is displayed when there are currently no workspaces present.
13
+ * Some of the features displayed include:
14
+ * - `open` commands.
15
+ * - `recently used workspaces`.
16
+ * - `settings` commands.
17
+ * - `help` commands.
18
+ * - helpful links.
19
+ */
20
+ export declare class GettingStartedWidget extends ReactWidget {
21
+ /**
22
+ * The widget `id`.
23
+ */
24
+ static readonly ID = "getting.started.widget";
25
+ /**
26
+ * The widget `label` which is used for display purposes.
27
+ */
28
+ static readonly LABEL: string;
29
+ /**
30
+ * The `ApplicationInfo` for the application if available.
31
+ * Used in order to obtain the version number of the application.
32
+ */
33
+ protected applicationInfo: ApplicationInfo | undefined;
34
+ /**
35
+ * The application name which is used for display purposes.
36
+ */
37
+ protected applicationName: string;
38
+ protected home: string | undefined;
39
+ /**
40
+ * The recently used workspaces limit.
41
+ * Used in order to limit the number of recently used workspaces to display.
42
+ */
43
+ protected recentLimit: number;
44
+ /**
45
+ * The list of recently used workspaces.
46
+ */
47
+ protected recentWorkspaces: string[];
48
+ /**
49
+ * Collection of useful links to display for end users.
50
+ */
51
+ protected readonly documentationUrl = "https://www.theia-ide.org/docs/";
52
+ protected readonly compatibilityUrl = "https://eclipse-theia.github.io/vscode-theia-comparator/status.html";
53
+ protected readonly extensionUrl = "https://www.theia-ide.org/docs/authoring_extensions";
54
+ protected readonly pluginUrl = "https://www.theia-ide.org/docs/authoring_plugins";
55
+ protected readonly appServer: ApplicationServer;
56
+ protected readonly commandRegistry: CommandRegistry;
57
+ protected readonly environments: EnvVariablesServer;
58
+ protected readonly labelProvider: LabelProvider;
59
+ protected readonly windowService: WindowService;
60
+ protected readonly workspaceService: WorkspaceService;
61
+ protected readonly preferenceService: PreferenceService;
62
+ protected init(): void;
63
+ protected doInit(): Promise<void>;
64
+ protected onActivateRequest(msg: Message): void;
65
+ /**
66
+ * Render the content of the widget.
67
+ */
68
+ protected render(): React.ReactNode;
69
+ /**
70
+ * Render the widget header.
71
+ * Renders the title `{applicationName} Getting Started`.
72
+ */
73
+ protected renderHeader(): React.ReactNode;
74
+ /**
75
+ * Render the `open` section.
76
+ * Displays a collection of `open` commands.
77
+ */
78
+ protected renderOpen(): React.ReactNode;
79
+ /**
80
+ * Render the recently used workspaces section.
81
+ */
82
+ protected renderRecentWorkspaces(): React.ReactNode;
83
+ /**
84
+ * Render the settings section.
85
+ * Generally used to display useful links.
86
+ */
87
+ protected renderSettings(): React.ReactNode;
88
+ /**
89
+ * Render the help section.
90
+ */
91
+ protected renderHelp(): React.ReactNode;
92
+ /**
93
+ * Render the version section.
94
+ */
95
+ protected renderVersion(): React.ReactNode;
96
+ protected renderPreferences(): React.ReactNode;
97
+ /**
98
+ * Build the list of workspace paths.
99
+ * @param workspaces {string[]} the list of workspaces.
100
+ * @returns {string[]} the list of workspace paths.
101
+ */
102
+ protected buildPaths(workspaces: string[]): string[];
103
+ /**
104
+ * Trigger the open command.
105
+ */
106
+ protected doOpen: () => Promise<unknown>;
107
+ protected doOpenEnter: (e: React.KeyboardEvent) => void;
108
+ /**
109
+ * Trigger the open file command.
110
+ */
111
+ protected doOpenFile: () => Promise<unknown>;
112
+ protected doOpenFileEnter: (e: React.KeyboardEvent) => void;
113
+ /**
114
+ * Trigger the open folder command.
115
+ */
116
+ protected doOpenFolder: () => Promise<unknown>;
117
+ protected doOpenFolderEnter: (e: React.KeyboardEvent) => void;
118
+ /**
119
+ * Trigger the open workspace command.
120
+ */
121
+ protected doOpenWorkspace: () => Promise<unknown>;
122
+ protected doOpenWorkspaceEnter: (e: React.KeyboardEvent) => void;
123
+ /**
124
+ * Trigger the open recent workspace command.
125
+ */
126
+ protected doOpenRecentWorkspace: () => Promise<unknown>;
127
+ protected doOpenRecentWorkspaceEnter: (e: React.KeyboardEvent) => void;
128
+ /**
129
+ * Trigger the open preferences command.
130
+ * Used to open the preferences widget.
131
+ */
132
+ protected doOpenPreferences: () => Promise<unknown>;
133
+ protected doOpenPreferencesEnter: (e: React.KeyboardEvent) => void;
134
+ /**
135
+ * Trigger the open keyboard shortcuts command.
136
+ * Used to open the keyboard shortcuts widget.
137
+ */
138
+ protected doOpenKeyboardShortcuts: () => Promise<unknown>;
139
+ protected doOpenKeyboardShortcutsEnter: (e: React.KeyboardEvent) => void;
140
+ /**
141
+ * Open a workspace given its uri.
142
+ * @param uri {URI} the workspace uri.
143
+ */
144
+ protected open: (uri: URI) => void;
145
+ protected openEnter: (e: React.KeyboardEvent, uri: URI) => void;
146
+ /**
147
+ * Open a link in an external window.
148
+ * @param url the link.
149
+ */
150
+ protected doOpenExternalLink: (url: string) => undefined;
151
+ protected doOpenExternalLinkEnter: (e: React.KeyboardEvent, url: string) => void;
152
+ protected isEnterKey(e: React.KeyboardEvent): boolean;
153
+ }
154
+ export interface PreferencesProps {
155
+ preferenceService: PreferenceService;
156
+ }
157
157
  //# sourceMappingURL=getting-started-widget.d.ts.map