@univerjs/ui 0.8.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +10 -10
- package/lib/es/index.js +1180 -1192
- package/lib/index.js +1180 -1192
- package/lib/types/common/component-manager.d.ts +15 -20
- package/lib/types/components/notification/Notification.stories.d.ts +1 -0
- package/lib/umd/index.js +9 -9
- package/package.json +7 -11
|
@@ -1,34 +1,29 @@
|
|
|
1
1
|
import { IDisposable, Disposable } from '@univerjs/core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type ComponentFramework = 'vue3' | 'react';
|
|
2
|
+
import { createElement, useEffect, useRef } from 'react';
|
|
3
|
+
type ComponentFramework = string;
|
|
5
4
|
export interface IComponentOptions {
|
|
6
5
|
framework?: ComponentFramework;
|
|
7
6
|
}
|
|
8
|
-
export interface
|
|
9
|
-
framework:
|
|
10
|
-
component:
|
|
7
|
+
export interface IComponent<T = any> {
|
|
8
|
+
framework: string;
|
|
9
|
+
component: any;
|
|
11
10
|
}
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
component: ForwardRefExoticComponent<T>;
|
|
15
|
-
}
|
|
16
|
-
export type ComponentType<T extends Record<string, any> = Record<string, any>> = ForwardRefExoticComponent<T> | ReturnType<typeof defineComponent>;
|
|
17
|
-
export type ComponentList = Map<string, IVue3Component | IReactComponent>;
|
|
11
|
+
export type ComponentType<T = any> = any;
|
|
12
|
+
export type ComponentList = Map<string, IComponent>;
|
|
18
13
|
export declare class ComponentManager extends Disposable {
|
|
19
14
|
private _components;
|
|
20
15
|
private _componentsReverse;
|
|
21
16
|
constructor();
|
|
22
17
|
register(name: string, component: ComponentType, options?: IComponentOptions): IDisposable;
|
|
23
18
|
getKey(component: ComponentType): string | undefined;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
reactUtils: {
|
|
20
|
+
createElement: typeof createElement;
|
|
21
|
+
useEffect: typeof useEffect;
|
|
22
|
+
useRef: typeof useRef;
|
|
23
|
+
};
|
|
24
|
+
private _handler;
|
|
25
|
+
setHandler(framework: string, handler: (component: IComponent['component'], name?: string) => any): void;
|
|
26
|
+
get(name: string): any;
|
|
28
27
|
delete(name: string): void;
|
|
29
28
|
}
|
|
30
|
-
export declare function VueComponentWrapper(options: {
|
|
31
|
-
component: ReturnType<typeof defineComponent>;
|
|
32
|
-
props: Record<string, any>;
|
|
33
|
-
}): import('react').DetailedReactHTMLElement<import('react').HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
34
29
|
export {};
|