From 3fb1baaa31cfcaa279f91d7a873c2ddff83fbc8b Mon Sep 17 00:00:00 2001 From: Andrey Platov Date: Wed, 18 Aug 2021 11:37:15 +0200 Subject: [PATCH] cleanup Signed-off-by: Andrey Platov --- packages/ui/src/index.ts | 26 +++----------------- packages/ui/src/types.ts | 51 ---------------------------------------- 2 files changed, 3 insertions(+), 74 deletions(-) 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> -// } -// } -// )