@theia/core 1.22.0-next.6 → 1.22.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.
- package/README.in.md +12 -5
- package/README.md +43 -35
- package/electron-shared/@electron/remote/index.d.ts +1 -0
- package/electron-shared/@electron/remote/index.js +1 -0
- package/electron-shared/@electron/remote/main/index.d.ts +1 -0
- package/electron-shared/@electron/remote/main/index.js +1 -0
- package/electron-shared/electron/index.d.ts +2 -0
- package/electron-shared/electron/index.js +1 -0
- package/electron-shared/electron-store/index.d.ts +2 -0
- package/electron-shared/electron-store/index.js +1 -0
- package/electron-shared/fix-path/index.d.ts +2 -0
- package/electron-shared/fix-path/index.js +1 -0
- package/electron-shared/native-keymap/index.d.ts +1 -0
- package/electron-shared/native-keymap/index.js +1 -0
- package/lib/browser/common-frontend-contribution.js +2 -2
- package/lib/browser/common-frontend-contribution.js.map +1 -1
- package/lib/browser/context-key-service.d.ts +46 -3
- package/lib/browser/context-key-service.d.ts.map +1 -1
- package/lib/browser/context-key-service.js +24 -5
- package/lib/browser/context-key-service.js.map +1 -1
- package/lib/browser/context-menu-renderer.d.ts +7 -0
- package/lib/browser/context-menu-renderer.d.ts.map +1 -1
- package/lib/browser/context-menu-renderer.js +4 -1
- package/lib/browser/context-menu-renderer.js.map +1 -1
- package/lib/browser/dialogs.d.ts +1 -0
- package/lib/browser/dialogs.d.ts.map +1 -1
- package/lib/browser/dialogs.js +5 -2
- package/lib/browser/dialogs.js.map +1 -1
- package/lib/browser/external-uri-service.d.ts +12 -13
- package/lib/browser/external-uri-service.d.ts.map +1 -1
- package/lib/browser/external-uri-service.js +22 -12
- package/lib/browser/external-uri-service.js.map +1 -1
- package/lib/browser/frontend-application-module.js +1 -1
- package/lib/browser/frontend-application-module.js.map +1 -1
- package/lib/browser/frontend-application.d.ts +6 -0
- package/lib/browser/frontend-application.d.ts.map +1 -1
- package/lib/browser/frontend-application.js.map +1 -1
- package/lib/browser/index.d.ts +0 -1
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +0 -1
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/keybinding.d.ts +5 -2
- package/lib/browser/keybinding.d.ts.map +1 -1
- package/lib/browser/keybinding.js +8 -5
- package/lib/browser/keybinding.js.map +1 -1
- package/lib/browser/keybinding.spec.js +1 -1
- package/lib/browser/keybinding.spec.js.map +1 -1
- package/lib/browser/menu/browser-menu-plugin.js +1 -1
- package/lib/browser/menu/browser-menu-plugin.js.map +1 -1
- package/lib/browser/navigatable-types.d.ts +1 -0
- package/lib/browser/navigatable-types.d.ts.map +1 -1
- package/lib/browser/navigatable-types.js +6 -0
- package/lib/browser/navigatable-types.js.map +1 -1
- package/lib/browser/preferences/preference-contribution.d.ts.map +1 -1
- package/lib/browser/preferences/preference-contribution.js +3 -3
- package/lib/browser/preferences/preference-contribution.js.map +1 -1
- package/lib/browser/quick-input/quick-command-service.js +1 -1
- package/lib/browser/quick-input/quick-command-service.js.map +1 -1
- package/lib/browser/quick-input/quick-view-service.js +1 -1
- package/lib/browser/quick-input/quick-view-service.js.map +1 -1
- package/lib/browser/resource-context-key.js +1 -1
- package/lib/browser/resource-context-key.js.map +1 -1
- package/lib/browser/shell/application-shell.d.ts.map +1 -1
- package/lib/browser/shell/application-shell.js +14 -11
- package/lib/browser/shell/application-shell.js.map +1 -1
- package/lib/browser/shell/sidebar-bottom-menu-widget.d.ts.map +1 -1
- package/lib/browser/shell/sidebar-bottom-menu-widget.js +1 -0
- package/lib/browser/shell/sidebar-bottom-menu-widget.js.map +1 -1
- package/lib/browser/shell/sidebar-menu-widget.d.ts +10 -0
- package/lib/browser/shell/sidebar-menu-widget.d.ts.map +1 -1
- package/lib/browser/shell/sidebar-menu-widget.js +26 -1
- package/lib/browser/shell/sidebar-menu-widget.js.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar.js +1 -1
- package/lib/browser/shell/tab-bar-toolbar.js.map +1 -1
- package/lib/browser/tree/tree-view-welcome-widget.js +1 -1
- package/lib/browser/tree/tree-view-welcome-widget.js.map +1 -1
- package/lib/browser/tree/tree-widget-selection.d.ts +1 -1
- package/lib/browser/tree/tree-widget-selection.d.ts.map +1 -1
- package/lib/browser/window/default-window-service.d.ts.map +1 -1
- package/lib/browser/window/default-window-service.js +1 -0
- package/lib/browser/window/default-window-service.js.map +1 -1
- package/lib/common/command.d.ts +7 -0
- package/lib/common/command.d.ts.map +1 -1
- package/lib/common/command.js +15 -0
- package/lib/common/command.js.map +1 -1
- package/lib/common/json-schema.d.ts +1 -0
- package/lib/common/json-schema.d.ts.map +1 -1
- package/lib/common/keybinding.d.ts +14 -1
- package/lib/common/keybinding.d.ts.map +1 -1
- package/lib/common/keybinding.js +14 -2
- package/lib/common/keybinding.js.map +1 -1
- package/lib/common/path.d.ts +10 -0
- package/lib/common/path.d.ts.map +1 -1
- package/lib/common/path.js +23 -0
- package/lib/common/path.js.map +1 -1
- package/lib/common/path.spec.js +10 -0
- package/lib/common/path.spec.js.map +1 -1
- package/lib/common/uri.d.ts +4 -0
- package/lib/common/uri.d.ts.map +1 -1
- package/lib/common/uri.js +9 -0
- package/lib/common/uri.js.map +1 -1
- package/lib/common/uri.spec.js +11 -0
- package/lib/common/uri.spec.js.map +1 -1
- package/lib/electron-browser/keyboard/electron-keyboard-layout-change-notifier.js +1 -1
- package/lib/electron-browser/keyboard/electron-keyboard-layout-change-notifier.js.map +1 -1
- package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts +1 -1
- package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-context-menu-renderer.js +4 -2
- package/lib/electron-browser/menu/electron-context-menu-renderer.js.map +1 -1
- package/lib/electron-browser/menu/electron-main-menu-factory.d.ts +1 -1
- package/lib/electron-browser/menu/electron-main-menu-factory.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-main-menu-factory.js +20 -16
- package/lib/electron-browser/menu/electron-main-menu-factory.js.map +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.d.ts +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.js +9 -8
- package/lib/electron-browser/menu/electron-menu-contribution.js.map +1 -1
- package/lib/electron-browser/messaging/electron-ipc-connection-provider.d.ts.map +1 -1
- package/lib/electron-browser/messaging/electron-ipc-connection-provider.js +1 -1
- package/lib/electron-browser/messaging/electron-ipc-connection-provider.js.map +1 -1
- package/lib/electron-browser/token/electron-token-frontend-module.js +2 -2
- package/lib/electron-browser/token/electron-token-frontend-module.js.map +1 -1
- package/lib/electron-browser/window/electron-window-service.d.ts.map +1 -1
- package/lib/electron-browser/window/electron-window-service.js +3 -2
- package/lib/electron-browser/window/electron-window-service.js.map +1 -1
- package/lib/electron-main/electron-main-application.d.ts +4 -2
- package/lib/electron-main/electron-main-application.d.ts.map +1 -1
- package/lib/electron-main/electron-main-application.js +31 -8
- package/lib/electron-main/electron-main-application.js.map +1 -1
- package/lib/electron-main/electron-main-window-service-impl.js +1 -1
- package/lib/electron-main/electron-main-window-service-impl.js.map +1 -1
- package/lib/electron-main/electron-native-keymap.d.ts.map +1 -1
- package/lib/electron-main/electron-native-keymap.js +2 -2
- package/lib/electron-main/electron-native-keymap.js.map +1 -1
- package/lib/electron-main/electron-security-token-service.js +1 -1
- package/lib/electron-main/electron-security-token-service.js.map +1 -1
- package/lib/electron-main/messaging/electron-messaging-contribution.d.ts +1 -1
- package/lib/electron-main/messaging/electron-messaging-contribution.d.ts.map +1 -1
- package/lib/electron-main/messaging/electron-messaging-contribution.js +1 -1
- package/lib/electron-main/messaging/electron-messaging-contribution.js.map +1 -1
- package/lib/electron-node/keyboard/electron-keyboard-layout-provider.js +1 -1
- package/lib/electron-node/keyboard/electron-keyboard-layout-provider.js.map +1 -1
- package/package.json +50 -41
- package/shared/@phosphor/{algorithm.d.ts → algorithm/index.d.ts} +0 -0
- package/shared/@phosphor/{algorithm.js → algorithm/index.js} +0 -0
- package/shared/@phosphor/{commands.d.ts → commands/index.d.ts} +0 -0
- package/shared/@phosphor/{commands.js → commands/index.js} +0 -0
- package/shared/@phosphor/{coreutils.d.ts → coreutils/index.d.ts} +0 -0
- package/shared/@phosphor/{coreutils.js → coreutils/index.js} +0 -0
- package/shared/@phosphor/{domutils.d.ts → domutils/index.d.ts} +0 -0
- package/shared/@phosphor/{domutils.js → domutils/index.js} +0 -0
- package/shared/@phosphor/{dragdrop.d.ts → dragdrop/index.d.ts} +0 -0
- package/shared/@phosphor/{dragdrop.js → dragdrop/index.js} +0 -0
- package/shared/@phosphor/{messaging.d.ts → messaging/index.d.ts} +0 -0
- package/shared/@phosphor/{messaging.js → messaging/index.js} +0 -0
- package/shared/@phosphor/{properties.d.ts → properties/index.d.ts} +0 -0
- package/shared/@phosphor/{properties.js → properties/index.js} +0 -0
- package/shared/@phosphor/{signaling.d.ts → signaling/index.d.ts} +0 -0
- package/shared/@phosphor/{signaling.js → signaling/index.js} +0 -0
- package/shared/@phosphor/{virtualdom.d.ts → virtualdom/index.d.ts} +0 -0
- package/shared/@phosphor/{virtualdom.js → virtualdom/index.js} +0 -0
- package/shared/@phosphor/{widgets.d.ts → widgets/index.d.ts} +0 -0
- package/shared/@phosphor/{widgets.js → widgets/index.js} +0 -0
- package/shared/@theia/application-package/lib/{api.d.ts → api/index.d.ts} +0 -0
- package/shared/@theia/application-package/lib/{api.js → api/index.js} +0 -0
- package/shared/@theia/application-package/lib/{environment.d.ts → environment/index.d.ts} +0 -0
- package/shared/@theia/application-package/lib/{environment.js → environment/index.js} +0 -0
- package/shared/ajv/index.d.ts +2 -0
- package/shared/ajv/index.js +1 -0
- package/shared/{dompurify.d.ts → dompurify/index.d.ts} +0 -0
- package/shared/{dompurify.js → dompurify/index.js} +0 -0
- package/shared/{express.d.ts → express/index.d.ts} +0 -0
- package/shared/{express.js → express/index.js} +0 -0
- package/shared/{fs-extra.d.ts → fs-extra/index.d.ts} +0 -0
- package/shared/{fs-extra.js → fs-extra/index.js} +0 -0
- package/shared/{fuzzy.d.ts → fuzzy/index.d.ts} +0 -0
- package/shared/{fuzzy.js → fuzzy/index.js} +0 -0
- package/shared/{inversify.d.ts → inversify/index.d.ts} +0 -0
- package/shared/{inversify.js → inversify/index.js} +0 -0
- package/shared/{lodash.debounce.d.ts → lodash.debounce/index.d.ts} +0 -0
- package/shared/{lodash.debounce.js → lodash.debounce/index.js} +0 -0
- package/shared/{lodash.throttle.d.ts → lodash.throttle/index.d.ts} +0 -0
- package/shared/{lodash.throttle.js → lodash.throttle/index.js} +0 -0
- package/shared/markdown-it/index.d.ts +2 -0
- package/shared/markdown-it/index.js +1 -0
- package/shared/markdown-it.d.ts +2 -0
- package/shared/markdown-it.js +1 -0
- package/shared/{nsfw.d.ts → nsfw/index.d.ts} +0 -0
- package/shared/{nsfw.js → nsfw/index.js} +0 -0
- package/shared/{react.d.ts → react/index.d.ts} +0 -0
- package/shared/{react.js → react/index.js} +0 -0
- package/shared/{react-dom.d.ts → react-dom/index.d.ts} +0 -0
- package/shared/{react-dom.js → react-dom/index.js} +0 -0
- package/shared/{react-virtualized.d.ts → react-virtualized/index.d.ts} +0 -0
- package/shared/{react-virtualized.js → react-virtualized/index.js} +0 -0
- package/shared/{vscode-languageserver-protocol.d.ts → vscode-languageserver-protocol/index.d.ts} +0 -0
- package/shared/{vscode-languageserver-protocol.js → vscode-languageserver-protocol/index.js} +0 -0
- package/shared/vscode-languageserver-types/index.d.ts +1 -0
- package/shared/vscode-languageserver-types/index.js +1 -0
- package/shared/{vscode-uri.d.ts → vscode-uri/index.d.ts} +0 -0
- package/shared/{vscode-uri.js → vscode-uri/index.js} +0 -0
- package/shared/{vscode-ws-jsonrpc.d.ts → vscode-ws-jsonrpc/index.d.ts} +0 -0
- package/shared/{vscode-ws-jsonrpc.js → vscode-ws-jsonrpc/index.js} +0 -0
- package/shared/{ws.d.ts → ws/index.d.ts} +0 -0
- package/shared/{ws.js → ws/index.js} +0 -0
- package/shared/{yargs.d.ts → yargs/index.d.ts} +0 -0
- package/shared/{yargs.js → yargs/index.js} +0 -0
- package/src/browser/common-frontend-contribution.ts +1 -1
- package/src/browser/context-key-service.ts +60 -2
- package/src/browser/context-menu-renderer.ts +15 -5
- package/src/browser/dialogs.ts +6 -2
- package/src/browser/external-uri-service.ts +31 -16
- package/src/browser/frontend-application-module.ts +2 -2
- package/src/browser/frontend-application.ts +6 -0
- package/src/browser/index.ts +0 -1
- package/src/browser/keybinding.spec.ts +2 -2
- package/src/browser/keybinding.ts +7 -4
- package/src/browser/navigatable-types.ts +5 -0
- package/src/browser/preferences/preference-contribution.ts +3 -3
- package/src/browser/shell/application-shell.ts +13 -10
- package/src/browser/shell/sidebar-bottom-menu-widget.tsx +1 -0
- package/src/browser/shell/sidebar-menu-widget.tsx +34 -1
- package/src/browser/tree/tree-widget-selection.ts +1 -1
- package/src/browser/window/default-window-service.ts +1 -0
- package/src/common/command.ts +18 -0
- package/src/common/json-schema.ts +1 -0
- package/src/common/keybinding.ts +22 -2
- package/src/common/path.spec.ts +12 -0
- package/src/common/path.ts +24 -0
- package/src/common/uri.spec.ts +13 -0
- package/src/common/uri.ts +10 -0
- package/src/electron-browser/keyboard/electron-keyboard-layout-change-notifier.ts +1 -1
- package/src/electron-browser/menu/electron-context-menu-renderer.ts +4 -2
- package/src/electron-browser/menu/electron-main-menu-factory.ts +23 -20
- package/src/electron-browser/menu/electron-menu-contribution.ts +9 -8
- package/src/electron-browser/messaging/electron-ipc-connection-provider.ts +1 -1
- package/src/electron-browser/token/electron-token-frontend-module.ts +2 -2
- package/src/electron-browser/window/electron-window-service.ts +3 -2
- package/src/electron-main/electron-main-application.ts +33 -9
- package/src/electron-main/electron-main-window-service-impl.ts +1 -1
- package/src/electron-main/electron-native-keymap.ts +2 -2
- package/src/electron-main/electron-security-token-service.ts +1 -1
- package/src/electron-main/messaging/electron-messaging-contribution.ts +1 -1
- package/src/electron-node/keyboard/electron-keyboard-layout-provider.ts +1 -1
- package/lib/browser/markdown-renderer.d.ts +0 -33
- package/lib/browser/markdown-renderer.d.ts.map +0 -1
- package/lib/browser/markdown-renderer.js +0 -72
- package/lib/browser/markdown-renderer.js.map +0 -1
- package/lib/browser/markdown-renderer.spec.d.ts +0 -17
- package/lib/browser/markdown-renderer.spec.d.ts.map +0 -1
- package/lib/browser/markdown-renderer.spec.js +0 -71
- package/lib/browser/markdown-renderer.spec.js.map +0 -1
- package/shared/electron.d.ts +0 -2
- package/shared/electron.js +0 -1
- package/shared/index.js +0 -111
- package/src/browser/markdown-renderer.spec.ts +0 -78
- package/src/browser/markdown-renderer.ts +0 -76
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-renderer.spec.js","sourceRoot":"","sources":["../../src/browser/markdown-renderer.spec.ts"],"names":[],"mappings":"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"}
|
package/shared/electron.d.ts
DELETED
package/shared/electron.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('@theia/electron');
|
package/shared/index.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
"use-strict";
|
|
3
|
-
/********************************************************************************
|
|
4
|
-
* Copyright (C) 2021 Ericsson and others.
|
|
5
|
-
*
|
|
6
|
-
* This program and the accompanying materials are made available under the
|
|
7
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
-
*
|
|
10
|
-
* This Source Code may also be made available under the following Secondary
|
|
11
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
-
* with the GNU Classpath Exception which is available at
|
|
14
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
15
|
-
*
|
|
16
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
17
|
-
********************************************************************************/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @file Common data and functions to manage shared core dependencies.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const { theiaReExports } = require('../package.json');
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Path prefix used to require shared dependencies such as
|
|
27
|
-
* ```ts
|
|
28
|
-
* const sharedDep = require(theiaCoreSharedPrefix + 'sharedDep')
|
|
29
|
-
* ```
|
|
30
|
-
* @type {string}
|
|
31
|
-
*/
|
|
32
|
-
const theiaCoreSharedPrefix = '@theia/core/shared/';
|
|
33
|
-
/**
|
|
34
|
-
* List of modules exported like
|
|
35
|
-
* ```ts
|
|
36
|
-
* export * from 'module';
|
|
37
|
-
* ```
|
|
38
|
-
* @type {{module: string, alias: string}[]}
|
|
39
|
-
*/
|
|
40
|
-
const exportStar = theiaReExports['export *'].map(entry => {
|
|
41
|
-
const [module, alias = entry] = entry.split(':', 2);
|
|
42
|
-
return { module, alias };
|
|
43
|
-
});
|
|
44
|
-
/**
|
|
45
|
-
* List of modules exported via namespace like
|
|
46
|
-
* ```ts
|
|
47
|
-
* import namespace = require('module');
|
|
48
|
-
* export = namespace;
|
|
49
|
-
* ```
|
|
50
|
-
* @type {{module: string, namespace: string}[]}
|
|
51
|
-
*/
|
|
52
|
-
const exportEqual = theiaReExports['export ='].map(entry => {
|
|
53
|
-
const [module, namespace = entry] = entry.split(' as ', 2);
|
|
54
|
-
return { module, namespace };
|
|
55
|
-
});
|
|
56
|
-
/**
|
|
57
|
-
* List of all shared modules.
|
|
58
|
-
* @type {string[]}
|
|
59
|
-
*/
|
|
60
|
-
const sharedModules = [
|
|
61
|
-
'electron',
|
|
62
|
-
...exportStar.map(entry => entry.module),
|
|
63
|
-
...exportEqual.map(entry => entry.module),
|
|
64
|
-
].sort();
|
|
65
|
-
|
|
66
|
-
module.exports = {
|
|
67
|
-
exportStar,
|
|
68
|
-
exportEqual,
|
|
69
|
-
sharedModules,
|
|
70
|
-
theiaCoreSharedPrefix,
|
|
71
|
-
getPackageName,
|
|
72
|
-
isSharedModule,
|
|
73
|
-
getTheiaCoreSharedModule,
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Only keep the first two parts of the package name e.g.,
|
|
78
|
-
* - `@a/b/c/...` => `@a/b`
|
|
79
|
-
* - `a/b/c/...` => `a`
|
|
80
|
-
* @param {string} package
|
|
81
|
-
* @returns {string}
|
|
82
|
-
*/
|
|
83
|
-
function getPackageName(package) {
|
|
84
|
-
const slice = package.startsWith('@') ? 2 : 1;
|
|
85
|
-
return package.split('/', slice + 1)
|
|
86
|
-
.slice(0, slice)
|
|
87
|
-
.join('/');
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @param {string} module
|
|
92
|
-
* @returns {boolean} is the module part of the shared dependencies
|
|
93
|
-
*/
|
|
94
|
-
function isSharedModule(module) {
|
|
95
|
-
return sharedModules.includes(module);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Given an import like `@theia/core/shared/a/b/c` it will return `a/b/c`.
|
|
100
|
-
* If the import is not from `@theia/core/shared/` it will return undefined.
|
|
101
|
-
* @param {string} module
|
|
102
|
-
* @returns {string | undefined}
|
|
103
|
-
*/
|
|
104
|
-
function getTheiaCoreSharedModule(module) {
|
|
105
|
-
if (module.startsWith(theiaCoreSharedPrefix)) {
|
|
106
|
-
const shared = module.substr(theiaCoreSharedPrefix.length);
|
|
107
|
-
if (shared.length > 0) {
|
|
108
|
-
return shared;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (C) 2021 TypeFox and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
|
|
17
|
-
import { enableJSDOM } from '../browser/test/jsdom';
|
|
18
|
-
let disableJSDOM = enableJSDOM();
|
|
19
|
-
|
|
20
|
-
import { expect } from 'chai';
|
|
21
|
-
import * as markdownit from 'markdown-it';
|
|
22
|
-
import { MarkdownRenderer } from './markdown-renderer';
|
|
23
|
-
|
|
24
|
-
disableJSDOM();
|
|
25
|
-
|
|
26
|
-
describe('MarkdownRenderer', () => {
|
|
27
|
-
|
|
28
|
-
before(() => disableJSDOM = enableJSDOM());
|
|
29
|
-
after(() => disableJSDOM());
|
|
30
|
-
|
|
31
|
-
it('Should render markdown', () => {
|
|
32
|
-
const markdownRenderer = new MarkdownRenderer();
|
|
33
|
-
const result = markdownRenderer.renderInline('[title](link)').innerHTML;
|
|
34
|
-
expect(result).to.be.equal('<a href="link">title</a>');
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('Should accept and use custom engine', () => {
|
|
38
|
-
const engine = markdownit();
|
|
39
|
-
const originalTextRenderer = engine.renderer.rules.text!;
|
|
40
|
-
engine.renderer.rules.text = (tokens, idx, options, env, self) => `[${originalTextRenderer(tokens, idx, options, env, self)}]`;
|
|
41
|
-
const markdownRenderer = new MarkdownRenderer(engine);
|
|
42
|
-
const result = markdownRenderer.renderInline('text').innerHTML;
|
|
43
|
-
expect(result).to.be.equal('[text]');
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('Should modify rendered markdown in place', () => {
|
|
47
|
-
const markdownRenderer = new MarkdownRenderer().modify('a', a => {
|
|
48
|
-
a.href = 'something-else';
|
|
49
|
-
});
|
|
50
|
-
const result = markdownRenderer.renderInline('[title](link)').innerHTML;
|
|
51
|
-
expect(result).to.be.equal('<a href="something-else">title</a>');
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('Should modify descendants of children', () => {
|
|
55
|
-
const markdownRenderer = new MarkdownRenderer().modify('em', em => {
|
|
56
|
-
const strong = document.createElement('strong');
|
|
57
|
-
// eslint-disable-next-line no-unsanitized/property
|
|
58
|
-
strong.innerHTML = em.innerHTML;
|
|
59
|
-
return strong;
|
|
60
|
-
});
|
|
61
|
-
const result = markdownRenderer.render('**bold *bold and italic***').innerHTML;
|
|
62
|
-
expect(result).to.be.equal('<p><strong>bold <strong>bold and italic</strong></strong></p>\n');
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('Should modify descendants of children after previous modification', () => {
|
|
66
|
-
const markdownRenderer = new MarkdownRenderer().modify('em', em => {
|
|
67
|
-
const strong = document.createElement('strong');
|
|
68
|
-
// eslint-disable-next-line no-unsanitized/property
|
|
69
|
-
strong.innerHTML = em.innerHTML;
|
|
70
|
-
return strong;
|
|
71
|
-
}).modify('strong', strong => { // Will pick up both the original and modified strong element
|
|
72
|
-
const textNode = strong.childNodes.item(0);
|
|
73
|
-
textNode.textContent = `changed_${textNode.textContent}`;
|
|
74
|
-
});
|
|
75
|
-
const result = markdownRenderer.render('**bold *bold and italic***').innerHTML;
|
|
76
|
-
expect(result).to.be.equal('<p><strong>changed_bold <strong>changed_bold and italic</strong></strong></p>\n');
|
|
77
|
-
});
|
|
78
|
-
});
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (C) 2021 TypeFox and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
|
|
17
|
-
import * as DOMPurify from 'dompurify';
|
|
18
|
-
import * as markdownit from 'markdown-it';
|
|
19
|
-
|
|
20
|
-
export class MarkdownRenderer {
|
|
21
|
-
|
|
22
|
-
protected engine: markdownit;
|
|
23
|
-
protected callbacks = new Map<string, ((element: Element) => Element | void)[]>();
|
|
24
|
-
|
|
25
|
-
constructor(engine?: markdownit) {
|
|
26
|
-
this.engine = engine ?? markdownit();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Adds a modification callback that is applied to every element with the specified tag after rendering to HTML.
|
|
31
|
-
*
|
|
32
|
-
* @param tag The tag that this modification applies to.
|
|
33
|
-
* @param callback The modification to apply on every selected rendered element. Can either modify the element in place or return a new element.
|
|
34
|
-
*/
|
|
35
|
-
modify<K extends keyof HTMLElementTagNameMap>(tag: K, callback: (element: HTMLElementTagNameMap[K]) => Element | void): MarkdownRenderer {
|
|
36
|
-
if (this.callbacks.has(tag)) {
|
|
37
|
-
this.callbacks.get(tag)!.push(callback);
|
|
38
|
-
} else {
|
|
39
|
-
this.callbacks.set(tag, [callback]);
|
|
40
|
-
}
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
render(markdown: string): HTMLElement {
|
|
45
|
-
return this.renderInternal(this.engine.render(markdown));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
renderInline(markdown: string): HTMLElement {
|
|
49
|
-
return this.renderInternal(this.engine.renderInline(markdown));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
protected renderInternal(renderedHtml: string): HTMLElement {
|
|
53
|
-
const div = this.sanitizeHtml(renderedHtml);
|
|
54
|
-
for (const [tag, calls] of this.callbacks) {
|
|
55
|
-
for (const callback of calls) {
|
|
56
|
-
const elements = Array.from(div.getElementsByTagName(tag));
|
|
57
|
-
for (const element of elements) {
|
|
58
|
-
const result = callback(element);
|
|
59
|
-
if (result) {
|
|
60
|
-
const parent = element.parentElement;
|
|
61
|
-
if (parent) {
|
|
62
|
-
parent.replaceChild(result, element);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return div;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
protected sanitizeHtml(html: string): HTMLElement {
|
|
72
|
-
const div = document.createElement('div');
|
|
73
|
-
div.innerHTML = DOMPurify.sanitize(html);
|
|
74
|
-
return div;
|
|
75
|
-
}
|
|
76
|
-
}
|