Links handling in commands (#15118)

* format

* update external options type

* add command flag for command

* Allow commands in Notebooks

Co-authored-by: chgagnon <chgagnon@microsoft.com>
This commit is contained in:
Aditya Bist
2021-04-14 13:06:45 -07:00
committed by GitHub
parent 842a33e318
commit e151668c81
20 changed files with 69 additions and 35 deletions

View File

@@ -50,7 +50,7 @@ export class Link extends Disposable {
this._register(onOpen(e => {
EventHelper.stop(e, true);
openerService.open(link.href);
openerService.open(link.href, { allowCommands: true });
}));
this.applyStyles();

View File

@@ -29,9 +29,18 @@ type OpenInternalOptions = {
* action, such as keyboard or mouse usage.
*/
readonly fromUserGesture?: boolean;
/**
* Allow command links to be handled.
*/
readonly allowCommands?: boolean;
};
type OpenExternalOptions = { readonly openExternal?: boolean; readonly allowTunneling?: boolean };
export type OpenExternalOptions = {
readonly openExternal?: boolean;
readonly allowTunneling?: boolean;
readonly allowContributedOpeners?: boolean | string;
};
export type OpenOptions = OpenInternalOptions & OpenExternalOptions;