Add extension points for source tree (#1816)

This change will add an extension point which allows to wrap the source tree. This is required in order to use a context provider e.g. to capture a selected file. Another extension point allows to add a row between the row of a file.
In order to implement the extension points ui-extensions has now a wrapper property and passes the children of an extension point to implementing extension.
This commit is contained in:
Sebastian Sdorra
2021-09-30 16:41:04 +02:00
committed by GitHub
parent 2b85081032
commit f5d9855a24
8 changed files with 279 additions and 70 deletions

View File

@@ -24,6 +24,7 @@
import React from "react";
import {
File,
Branch,
IndexResources,
Links,
@@ -83,6 +84,31 @@ export type ReposSourcesEmptyActionbar = ExtensionPointDefinition<
ReposSourcesEmptyActionbarExtension
>;
export type ReposSourcesTreeWrapperProps = {
repository: Repository;
directory: File;
baseUrl: string;
revision: string;
};
export type ReposSourcesTreeWrapperExtension = ExtensionPointDefinition<
"repos.source.tree.wrapper",
React.ComponentType<ReposSourcesTreeWrapperProps>
>;
export type ReposSourcesTreeRowProps = {
file: File;
};
export type ReposSourcesTreeRowRightExtension = ExtensionPointDefinition<
"repos.sources.tree.row.right",
React.ComponentType<ReposSourcesTreeRowProps>
>;
export type ReposSourcesTreeRowAfterExtension = ExtensionPointDefinition<
"repos.sources.tree.row.after",
React.ComponentType<ReposSourcesTreeRowProps>
>;
export type PrimaryNavigationLoginButtonProps = {
links: Links;
label: string;