diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index f373d2ab09..1ee4062158 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -56,33 +56,13 @@ export { default as IconSearch } from './components/icons/Search.svelte' export { default as IconToDo } from './components/icons/ToDo.svelte' export { default as IconComments } from './components/icons/Comments.svelte' +import type { AnySvelteComponent, AnyComponent } from './types' +import { writable } from 'svelte/store' + export function createApp (target: HTMLElement): SvelteComponent { return new Root({ target }) } -// let documentProvider: DocumentProvider | undefined - -// async function open (doc: Document): Promise { -// if (documentProvider != null) { -// return await documentProvider.open(doc) -// } -// return await Promise.reject(new Error('Document provider is not registred')) -// } - -// function selection (): Document | undefined { -// if (documentProvider != null) { -// return documentProvider.selection() -// } -// return undefined -// } - -// function registerDocumentProvider (provider: DocumentProvider): void { -// documentProvider = provider -// } - -import type { AnySvelteComponent, AnyComponent } from './types' -import { writable } from 'svelte/store' - interface CompAndProps { is: AnySvelteComponent | AnyComponent | undefined props: any diff --git a/packages/ui/src/types.ts b/packages/ui/src/types.ts index acdea8f26b..64774fffad 100644 --- a/packages/ui/src/types.ts +++ b/packages/ui/src/types.ts @@ -31,26 +31,6 @@ export type AnySvelteComponent = typeof SvelteComponent export type Component = Resource export type AnyComponent = Resource -export const CONTEXT_PLATFORM = 'platform' -export const CONTEXT_PLATFORM_UI = 'platform-ui' - -export interface Document {} // eslint-disable-line @typescript-eslint/no-empty-interface - -/** - * Allow to control currently selected document. - */ -export interface DocumentProvider { - /** - * Opening a document - * */ - open: (doc: Document) => Promise - - /** - * Return currently selected document, if one. - */ - selection: () => Document | undefined -} - export interface Action { label: IntlString icon: Asset | AnySvelteComponent @@ -65,34 +45,3 @@ export interface IPopupItem { selected?: boolean action?: Function } - -// export default plugin( -// 'ui' as Plugin, -// {}, -// { -// metadata: { -// LoginApplication: '' as Metadata, -// DefaultApplication: '' as Metadata -// }, -// icon: { -// Default: '' as Asset, -// Error: '' as Asset, -// Network: '' as Asset, -// Search: '' as Asset, -// Add: '' as Asset, -// ArrowDown: '' as Asset, -// Message: '' as Asset, -// Phone: '' as Asset, -// Mail: '' as Asset, -// More: '' as Asset -// }, -// component: { -// Icon: '' as AnyComponent, -// Spinner: '' as AnyComponent, -// BadComponent: '' as AnyComponent -// }, -// method: { -// AnAction: '' as Resource<(args: any) => void> -// } -// } -// )