|
@ -23,8 +23,8 @@ export interface WebviewPanelDescriptor { |
|
|
readonly trackingFeature: TrackedUsageFeatures; |
|
|
readonly trackingFeature: TrackedUsageFeatures; |
|
|
readonly plusFeature: boolean; |
|
|
readonly plusFeature: boolean; |
|
|
readonly column?: ViewColumn; |
|
|
readonly column?: ViewColumn; |
|
|
readonly options?: WebviewOptions; |
|
|
|
|
|
readonly panelOptions?: WebviewPanelOptions; |
|
|
|
|
|
|
|
|
readonly webviewOptions?: WebviewOptions; |
|
|
|
|
|
readonly webviewPanelOptions?: WebviewPanelOptions; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
interface WebviewPanelRegistration<State, SerializedState = State> { |
|
|
interface WebviewPanelRegistration<State, SerializedState = State> { |
|
@ -48,7 +48,7 @@ export interface WebviewViewDescriptor { |
|
|
readonly contextKeyPrefix: `gitlens:webviewView:${WebviewViewIds}`; |
|
|
readonly contextKeyPrefix: `gitlens:webviewView:${WebviewViewIds}`; |
|
|
readonly trackingFeature: TrackedUsageFeatures; |
|
|
readonly trackingFeature: TrackedUsageFeatures; |
|
|
readonly plusFeature: boolean; |
|
|
readonly plusFeature: boolean; |
|
|
readonly options?: WebviewOptions; |
|
|
|
|
|
|
|
|
readonly webviewOptions?: WebviewOptions; |
|
|
readonly webviewViewOptions?: { |
|
|
readonly webviewViewOptions?: { |
|
|
readonly retainContextWhenHidden?: boolean; |
|
|
readonly retainContextWhenHidden?: boolean; |
|
|
}; |
|
|
}; |
|
@ -83,7 +83,7 @@ export class WebviewsController implements Disposable { |
|
|
descriptor: WebviewViewDescriptor, |
|
|
descriptor: WebviewViewDescriptor, |
|
|
resolveProvider: ( |
|
|
resolveProvider: ( |
|
|
container: Container, |
|
|
container: Container, |
|
|
host: WebviewController<State, SerializedState>, |
|
|
|
|
|
|
|
|
controller: WebviewController<State, SerializedState>, |
|
|
) => Promise<WebviewProvider<State, SerializedState>>, |
|
|
) => Promise<WebviewProvider<State, SerializedState>>, |
|
|
canResolveProvider?: () => boolean | Promise<boolean>, |
|
|
canResolveProvider?: () => boolean | Promise<boolean>, |
|
|
): WebviewViewProxy { |
|
|
): WebviewViewProxy { |
|
@ -113,7 +113,7 @@ export class WebviewsController implements Disposable { |
|
|
enableCommandUris: true, |
|
|
enableCommandUris: true, |
|
|
enableScripts: true, |
|
|
enableScripts: true, |
|
|
localResourceRoots: [Uri.file(this.container.context.extensionPath)], |
|
|
localResourceRoots: [Uri.file(this.container.context.extensionPath)], |
|
|
...descriptor.options, |
|
|
|
|
|
|
|
|
...descriptor.webviewOptions, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
webviewView.title = descriptor.title; |
|
|
webviewView.title = descriptor.title; |
|
@ -175,7 +175,7 @@ export class WebviewsController implements Disposable { |
|
|
descriptor: WebviewPanelDescriptor, |
|
|
descriptor: WebviewPanelDescriptor, |
|
|
resolveProvider: ( |
|
|
resolveProvider: ( |
|
|
container: Container, |
|
|
container: Container, |
|
|
host: WebviewController<State, SerializedState>, |
|
|
|
|
|
|
|
|
controller: WebviewController<State, SerializedState>, |
|
|
) => Promise<WebviewProvider<State, SerializedState>>, |
|
|
) => Promise<WebviewProvider<State, SerializedState>>, |
|
|
canResolveProvider?: () => boolean | Promise<boolean>, |
|
|
canResolveProvider?: () => boolean | Promise<boolean>, |
|
|
): WebviewPanelProxy { |
|
|
): WebviewPanelProxy { |
|
@ -218,8 +218,8 @@ export class WebviewsController implements Disposable { |
|
|
enableScripts: true, |
|
|
enableScripts: true, |
|
|
localResourceRoots: [Uri.file(container.context.extensionPath)], |
|
|
localResourceRoots: [Uri.file(container.context.extensionPath)], |
|
|
}, |
|
|
}, |
|
|
...descriptor.options, |
|
|
|
|
|
...descriptor.panelOptions, |
|
|
|
|
|
|
|
|
...descriptor.webviewOptions, |
|
|
|
|
|
...descriptor.webviewPanelOptions, |
|
|
}, |
|
|
}, |
|
|
); |
|
|
); |
|
|
panel.iconPath = Uri.file(container.context.asAbsolutePath(descriptor.iconPath)); |
|
|
panel.iconPath = Uri.file(container.context.asAbsolutePath(descriptor.iconPath)); |
|
|