Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export special view for reuse #2401

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions plugins/workbench-resources/src/components/SpecialView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
export let label: IntlString
export let createLabel: IntlString | undefined
export let createComponent: AnyComponent | undefined
export let descriptor: Ref<ViewletDescriptor> | undefined
export let createComponentProps: Record<string, any> = {}
export let descriptor: Ref<ViewletDescriptor> | undefined = undefined
export let baseQuery: DocumentQuery<Doc> = {}

let search = ''
Expand Down Expand Up @@ -68,7 +69,7 @@

function showCreateDialog (ev: MouseEvent) {
if (createComponent === undefined) return
showPopup(createComponent, {}, 'top')
showPopup(createComponent, createComponentProps, 'top')
}

function updateResultQuery (search: string, baseQuery: DocumentQuery<Doc> = {}): DocumentQuery<Doc> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
</script>

<!-- svelte-ignore a11y-mouse-events-have-key-events -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="antiNav-element"
class:selected
Expand Down
1 change: 1 addition & 0 deletions plugins/workbench-resources/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function hasArchiveSpaces (spaces: Space[]): boolean {
export { default as SpaceBrowser } from './components/SpaceBrowser.svelte'
export { default as TreeNode } from './components/navigator/TreeNode.svelte'
export { default as SpecialElement } from './components/navigator/SpecialElement.svelte'
export { SpecialView }
export default async (): Promise<Resources> => ({
component: {
WorkbenchApp,
Expand Down