@theia/preview 1.45.1 → 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.
- package/README.md +45 -45
- package/lib/browser/index.d.ts +3 -3
- package/lib/browser/index.js +29 -29
- package/lib/browser/markdown/index.d.ts +1 -1
- package/lib/browser/markdown/index.js +28 -28
- package/lib/browser/markdown/markdown-preview-handler.d.ts +28 -28
- package/lib/browser/markdown/markdown-preview-handler.js +301 -301
- package/lib/browser/markdown/markdown-preview-handler.spec.d.ts +1 -1
- package/lib/browser/markdown/markdown-preview-handler.spec.js +193 -193
- package/lib/browser/preview-contribution.d.ts +50 -50
- package/lib/browser/preview-contribution.js +262 -262
- package/lib/browser/preview-frontend-module.d.ts +5 -5
- package/lib/browser/preview-frontend-module.js +52 -52
- package/lib/browser/preview-handler.d.ts +104 -104
- package/lib/browser/preview-handler.js +76 -76
- package/lib/browser/preview-link-normalizer.d.ts +7 -7
- package/lib/browser/preview-link-normalizer.js +54 -54
- package/lib/browser/preview-preferences.d.ts +11 -11
- package/lib/browser/preview-preferences.js +46 -46
- package/lib/browser/preview-uri.d.ts +8 -8
- package/lib/browser/preview-uri.js +47 -47
- package/lib/browser/preview-widget.d.ts +54 -54
- package/lib/browser/preview-widget.js +261 -261
- package/lib/package.spec.js +25 -25
- package/package.json +7 -7
- package/src/browser/index.ts +19 -19
- package/src/browser/markdown/index.ts +17 -17
- package/src/browser/markdown/markdown-preview-handler.spec.ts +228 -228
- package/src/browser/markdown/markdown-preview-handler.ts +309 -309
- package/src/browser/markdown/style/index.css +18 -18
- package/src/browser/markdown/style/markdown.css +203 -203
- package/src/browser/markdown/style/tomorrow.css +105 -105
- package/src/browser/preview-contribution.ts +276 -276
- package/src/browser/preview-frontend-module.ts +57 -57
- package/src/browser/preview-handler.ts +141 -141
- package/src/browser/preview-link-normalizer.ts +40 -40
- package/src/browser/preview-preferences.ts +58 -58
- package/src/browser/preview-uri.ts +43 -43
- package/src/browser/preview-widget.ts +277 -277
- package/src/browser/style/index.css +17 -17
- package/src/browser/style/preview-widget.css +29 -29
- package/src/package.spec.ts +29 -29
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 TypeFox 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.PreviewUri = void 0;
|
|
19
|
-
var PreviewUri;
|
|
20
|
-
(function (PreviewUri) {
|
|
21
|
-
PreviewUri.id = 'code-editor-preview';
|
|
22
|
-
PreviewUri.param = 'open-handler=' + PreviewUri.id;
|
|
23
|
-
function match(uri) {
|
|
24
|
-
return uri.query.indexOf(PreviewUri.param) !== -1;
|
|
25
|
-
}
|
|
26
|
-
PreviewUri.match = match;
|
|
27
|
-
function encode(uri) {
|
|
28
|
-
if (match(uri)) {
|
|
29
|
-
return uri;
|
|
30
|
-
}
|
|
31
|
-
const params = [PreviewUri.param];
|
|
32
|
-
if (uri.query) {
|
|
33
|
-
params.push(...uri.query.split('&'));
|
|
34
|
-
}
|
|
35
|
-
const query = params.join('&');
|
|
36
|
-
return uri.withQuery(query);
|
|
37
|
-
}
|
|
38
|
-
PreviewUri.encode = encode;
|
|
39
|
-
function decode(uri) {
|
|
40
|
-
if (!match(uri)) {
|
|
41
|
-
return uri;
|
|
42
|
-
}
|
|
43
|
-
const query = uri.query.split('&').filter(p => p !== PreviewUri.param).join('&');
|
|
44
|
-
return uri.withQuery(query);
|
|
45
|
-
}
|
|
46
|
-
PreviewUri.decode = decode;
|
|
47
|
-
})(PreviewUri = exports.PreviewUri || (exports.PreviewUri = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 TypeFox 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.PreviewUri = void 0;
|
|
19
|
+
var PreviewUri;
|
|
20
|
+
(function (PreviewUri) {
|
|
21
|
+
PreviewUri.id = 'code-editor-preview';
|
|
22
|
+
PreviewUri.param = 'open-handler=' + PreviewUri.id;
|
|
23
|
+
function match(uri) {
|
|
24
|
+
return uri.query.indexOf(PreviewUri.param) !== -1;
|
|
25
|
+
}
|
|
26
|
+
PreviewUri.match = match;
|
|
27
|
+
function encode(uri) {
|
|
28
|
+
if (match(uri)) {
|
|
29
|
+
return uri;
|
|
30
|
+
}
|
|
31
|
+
const params = [PreviewUri.param];
|
|
32
|
+
if (uri.query) {
|
|
33
|
+
params.push(...uri.query.split('&'));
|
|
34
|
+
}
|
|
35
|
+
const query = params.join('&');
|
|
36
|
+
return uri.withQuery(query);
|
|
37
|
+
}
|
|
38
|
+
PreviewUri.encode = encode;
|
|
39
|
+
function decode(uri) {
|
|
40
|
+
if (!match(uri)) {
|
|
41
|
+
return uri;
|
|
42
|
+
}
|
|
43
|
+
const query = uri.query.split('&').filter(p => p !== PreviewUri.param).join('&');
|
|
44
|
+
return uri.withQuery(query);
|
|
45
|
+
}
|
|
46
|
+
PreviewUri.decode = decode;
|
|
47
|
+
})(PreviewUri = exports.PreviewUri || (exports.PreviewUri = {}));
|
|
48
48
|
//# sourceMappingURL=preview-uri.js.map
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { Resource } from '@theia/core';
|
|
2
|
-
import { Navigatable } from '@theia/core/lib/browser/navigatable';
|
|
3
|
-
import { BaseWidget, Message } from '@theia/core/lib/browser';
|
|
4
|
-
import URI from '@theia/core/lib/common/uri';
|
|
5
|
-
import { Event, Emitter } from '@theia/core/lib/common';
|
|
6
|
-
import { PreviewHandler, PreviewHandlerProvider } from './preview-handler';
|
|
7
|
-
import { ThemeService } from '@theia/core/lib/browser/theming';
|
|
8
|
-
import { EditorPreferences } from '@theia/editor/lib/browser';
|
|
9
|
-
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
10
|
-
import { MonacoWorkspace } from '@theia/monaco/lib/browser/monaco-workspace';
|
|
11
|
-
import { Location } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
12
|
-
export declare const PREVIEW_WIDGET_CLASS = "theia-preview-widget";
|
|
13
|
-
export declare const PreviewWidgetOptions: unique symbol;
|
|
14
|
-
export interface PreviewWidgetOptions {
|
|
15
|
-
resource: Resource;
|
|
16
|
-
}
|
|
17
|
-
export declare class PreviewWidget extends BaseWidget implements Navigatable {
|
|
18
|
-
protected readonly options: PreviewWidgetOptions;
|
|
19
|
-
protected readonly previewHandlerProvider: PreviewHandlerProvider;
|
|
20
|
-
protected readonly themeService: ThemeService;
|
|
21
|
-
protected readonly workspace: MonacoWorkspace;
|
|
22
|
-
protected readonly editorPreferences: EditorPreferences;
|
|
23
|
-
readonly uri: URI;
|
|
24
|
-
protected readonly resource: Resource;
|
|
25
|
-
protected previewHandler: PreviewHandler | undefined;
|
|
26
|
-
protected firstUpdate: (() => void) | undefined;
|
|
27
|
-
protected readonly onDidScrollEmitter: Emitter<number>;
|
|
28
|
-
protected readonly onDidDoubleClickEmitter: Emitter<Location>;
|
|
29
|
-
protected scrollBeyondLastLine: boolean;
|
|
30
|
-
constructor(options: PreviewWidgetOptions, previewHandlerProvider: PreviewHandlerProvider, themeService: ThemeService, workspace: MonacoWorkspace, editorPreferences: EditorPreferences);
|
|
31
|
-
initialize(): Promise<void>;
|
|
32
|
-
protected onBeforeAttach(msg: Message): void;
|
|
33
|
-
protected preventScrollNotification: boolean;
|
|
34
|
-
protected startScrollSync(): Disposable;
|
|
35
|
-
protected startDoubleClickListener(): Disposable;
|
|
36
|
-
getUri(): URI;
|
|
37
|
-
getResourceUri(): URI | undefined;
|
|
38
|
-
createMoveToUri(resourceUri: URI): URI | undefined;
|
|
39
|
-
onActivateRequest(msg: Message): void;
|
|
40
|
-
onUpdateRequest(msg: Message): void;
|
|
41
|
-
protected forceUpdate(): void;
|
|
42
|
-
protected previousContent: string | undefined;
|
|
43
|
-
protected performUpdate(): Promise<void>;
|
|
44
|
-
protected render(content: string, originUri: URI): Promise<HTMLElement | undefined>;
|
|
45
|
-
protected revealFragment(uri: URI): void;
|
|
46
|
-
revealForSourceLine(sourceLine: number): void;
|
|
47
|
-
protected readonly internalRevealForSourceLine: (sourceLine: number) => void;
|
|
48
|
-
get onDidScroll(): Event<number>;
|
|
49
|
-
protected fireDidScrollToSourceLine(line: number): void;
|
|
50
|
-
protected didScroll(scrollTop: number): void;
|
|
51
|
-
get onDidDoubleClick(): Event<Location>;
|
|
52
|
-
protected fireDidDoubleClickToSourceLine(line: number): void;
|
|
53
|
-
protected didDoubleClick(offsetTop: number): void;
|
|
54
|
-
}
|
|
1
|
+
import { Resource } from '@theia/core';
|
|
2
|
+
import { Navigatable } from '@theia/core/lib/browser/navigatable';
|
|
3
|
+
import { BaseWidget, Message } from '@theia/core/lib/browser';
|
|
4
|
+
import URI from '@theia/core/lib/common/uri';
|
|
5
|
+
import { Event, Emitter } from '@theia/core/lib/common';
|
|
6
|
+
import { PreviewHandler, PreviewHandlerProvider } from './preview-handler';
|
|
7
|
+
import { ThemeService } from '@theia/core/lib/browser/theming';
|
|
8
|
+
import { EditorPreferences } from '@theia/editor/lib/browser';
|
|
9
|
+
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
10
|
+
import { MonacoWorkspace } from '@theia/monaco/lib/browser/monaco-workspace';
|
|
11
|
+
import { Location } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
12
|
+
export declare const PREVIEW_WIDGET_CLASS = "theia-preview-widget";
|
|
13
|
+
export declare const PreviewWidgetOptions: unique symbol;
|
|
14
|
+
export interface PreviewWidgetOptions {
|
|
15
|
+
resource: Resource;
|
|
16
|
+
}
|
|
17
|
+
export declare class PreviewWidget extends BaseWidget implements Navigatable {
|
|
18
|
+
protected readonly options: PreviewWidgetOptions;
|
|
19
|
+
protected readonly previewHandlerProvider: PreviewHandlerProvider;
|
|
20
|
+
protected readonly themeService: ThemeService;
|
|
21
|
+
protected readonly workspace: MonacoWorkspace;
|
|
22
|
+
protected readonly editorPreferences: EditorPreferences;
|
|
23
|
+
readonly uri: URI;
|
|
24
|
+
protected readonly resource: Resource;
|
|
25
|
+
protected previewHandler: PreviewHandler | undefined;
|
|
26
|
+
protected firstUpdate: (() => void) | undefined;
|
|
27
|
+
protected readonly onDidScrollEmitter: Emitter<number>;
|
|
28
|
+
protected readonly onDidDoubleClickEmitter: Emitter<Location>;
|
|
29
|
+
protected scrollBeyondLastLine: boolean;
|
|
30
|
+
constructor(options: PreviewWidgetOptions, previewHandlerProvider: PreviewHandlerProvider, themeService: ThemeService, workspace: MonacoWorkspace, editorPreferences: EditorPreferences);
|
|
31
|
+
initialize(): Promise<void>;
|
|
32
|
+
protected onBeforeAttach(msg: Message): void;
|
|
33
|
+
protected preventScrollNotification: boolean;
|
|
34
|
+
protected startScrollSync(): Disposable;
|
|
35
|
+
protected startDoubleClickListener(): Disposable;
|
|
36
|
+
getUri(): URI;
|
|
37
|
+
getResourceUri(): URI | undefined;
|
|
38
|
+
createMoveToUri(resourceUri: URI): URI | undefined;
|
|
39
|
+
onActivateRequest(msg: Message): void;
|
|
40
|
+
onUpdateRequest(msg: Message): void;
|
|
41
|
+
protected forceUpdate(): void;
|
|
42
|
+
protected previousContent: string | undefined;
|
|
43
|
+
protected performUpdate(): Promise<void>;
|
|
44
|
+
protected render(content: string, originUri: URI): Promise<HTMLElement | undefined>;
|
|
45
|
+
protected revealFragment(uri: URI): void;
|
|
46
|
+
revealForSourceLine(sourceLine: number): void;
|
|
47
|
+
protected readonly internalRevealForSourceLine: (sourceLine: number) => void;
|
|
48
|
+
get onDidScroll(): Event<number>;
|
|
49
|
+
protected fireDidScrollToSourceLine(line: number): void;
|
|
50
|
+
protected didScroll(scrollTop: number): void;
|
|
51
|
+
get onDidDoubleClick(): Event<Location>;
|
|
52
|
+
protected fireDidDoubleClickToSourceLine(line: number): void;
|
|
53
|
+
protected didDoubleClick(offsetTop: number): void;
|
|
54
|
+
}
|
|
55
55
|
//# sourceMappingURL=preview-widget.d.ts.map
|