@univerjs/ui 0.8.0-beta.0 → 0.8.0-beta.1

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.
@@ -1,5 +1,5 @@
1
- import { IDisposable } from '@univerjs/core';
2
- import { default as React } from 'react';
1
+ import { IDisposable, Disposable } from '@univerjs/core';
2
+ import { ForwardRefExoticComponent } from 'react';
3
3
  import { defineComponent } from 'vue';
4
4
  type ComponentFramework = 'vue3' | 'react';
5
5
  export interface IComponentOptions {
@@ -11,17 +11,17 @@ export interface IVue3Component<T extends Record<string, any> = Record<string, a
11
11
  }
12
12
  export interface IReactComponent<T extends Record<string, any> = Record<string, any>> {
13
13
  framework: 'react';
14
- component: React.ForwardRefExoticComponent<T>;
14
+ component: ForwardRefExoticComponent<T>;
15
15
  }
16
- export type ComponentType<T extends Record<string, any> = Record<string, any>> = React.ForwardRefExoticComponent<T> | ReturnType<typeof defineComponent>;
16
+ export type ComponentType<T extends Record<string, any> = Record<string, any>> = ForwardRefExoticComponent<T> | ReturnType<typeof defineComponent>;
17
17
  export type ComponentList = Map<string, IVue3Component | IReactComponent>;
18
- export declare class ComponentManager {
18
+ export declare class ComponentManager extends Disposable {
19
19
  private _components;
20
20
  private _componentsReverse;
21
21
  constructor();
22
22
  register(name: string, component: ComponentType, options?: IComponentOptions): IDisposable;
23
23
  getKey(component: ComponentType): string | undefined;
24
- get(name: string): React.ForwardRefExoticComponent<Record<string, any>> | ((props: Record<string, any>) => React.FunctionComponentElement<{
24
+ get(name: string): ForwardRefExoticComponent<Record<string, any>> | ((props: Record<string, any>) => import('react').FunctionComponentElement<{
25
25
  component: ReturnType<typeof defineComponent>;
26
26
  props: Record<string, any>;
27
27
  }>) | undefined;
@@ -30,5 +30,5 @@ export declare class ComponentManager {
30
30
  export declare function VueComponentWrapper(options: {
31
31
  component: ReturnType<typeof defineComponent>;
32
32
  props: Record<string, any>;
33
- }): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement>;
33
+ }): import('react').DetailedReactHTMLElement<import('react').HTMLAttributes<HTMLElement>, HTMLElement>;
34
34
  export {};
@@ -1,12 +1,12 @@
1
+ import { ReactNode } from 'react';
1
2
  import { Observable } from 'rxjs';
2
3
  import { IMenuSelectorItem } from '../../services/menu/menu';
3
- import { default as React } from 'react';
4
4
  export type ICustomLabelProps<T = undefined> = {
5
5
  className?: string;
6
6
  value?: string | number | undefined;
7
7
  value$?: Observable<T>;
8
8
  onChange?(v: string | number): void;
9
- title?: React.ReactNode;
9
+ title?: ReactNode;
10
10
  } & Pick<IMenuSelectorItem<unknown>, 'label' | 'icon'>;
11
11
  /**
12
12
  * The component to render toolbar item label and menu item label.
@@ -1,2 +1,2 @@
1
- import { default as React } from 'react';
2
- export declare const useUpdateEffect: typeof React.useEffect;
1
+ import { useEffect } from 'react';
2
+ export declare const useUpdateEffect: typeof useEffect;
@@ -1,3 +1,2 @@
1
- import { IAccessor } from '@univerjs/core';
2
1
  import { IMenuButtonItem } from '../../services/menu/menu';
3
- export declare function ShortcutPanelMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
2
+ export declare function ShortcutPanelMenuItemFactory(): IMenuButtonItem;
@@ -117,10 +117,10 @@ export interface IFUniverUIMixin {
117
117
  * @example
118
118
  * ```ts
119
119
  * // Univer Icon can be viewed at https://univer.ai/en-US/icons
120
- * import { SmileSingle } from '@univerjs/icons'
120
+ * import { SmileIcon } from '@univerjs/icons'
121
121
  *
122
122
  * // Create a custom menu with an univer icon
123
- * univerAPI.registerComponent('custom-menu-icon', SmileSingle);
123
+ * univerAPI.registerComponent('custom-menu-icon', SmileIcon);
124
124
  * univerAPI.createMenu({
125
125
  * id: 'custom-menu',
126
126
  * icon: 'custom-menu-icon',
@@ -1,12 +1,12 @@
1
1
  import { Injector } from '@univerjs/core';
2
- import { ComponentType, default as React } from 'react';
2
+ import { ComponentType, ReactNode } from 'react';
3
3
  import { ComponentRenderer } from '../../services/parts/parts.service';
4
4
  export interface IComponentContainerProps {
5
5
  components?: Set<ComponentType>;
6
- fallback?: React.ReactNode;
6
+ fallback?: ReactNode;
7
7
  sharedProps?: Record<string, unknown>;
8
8
  }
9
- export declare function ComponentContainer(props: IComponentContainerProps): React.ReactNode;
9
+ export declare function ComponentContainer(props: IComponentContainerProps): ReactNode;
10
10
  /**
11
11
  * Get a set of render functions to render components of a part.
12
12
  *
@@ -1,6 +1,5 @@
1
1
  import { IFloatDom } from '../../../services/dom/canvas-dom-layer.service';
2
- import { default as React } from 'react';
3
- export declare const FloatDomSingle: React.MemoExoticComponent<(props: {
2
+ export declare const FloatDomSingle: import('react').MemoExoticComponent<(props: {
4
3
  layer: IFloatDom;
5
4
  id: string;
6
5
  }) => import("react/jsx-runtime").JSX.Element | null>;
@@ -1,8 +1,8 @@
1
+ import { ReactNode } from 'react';
1
2
  import { IPopup } from '../../../services/popup/canvas-popup.service';
2
- import { default as React } from 'react';
3
3
  interface ISingleCanvasPopupProps {
4
4
  popup: IPopup;
5
- children?: React.ReactNode;
5
+ children?: ReactNode;
6
6
  }
7
7
  export declare const SingleCanvasPopup: ({ popup, children }: ISingleCanvasPopupProps) => import("react/jsx-runtime").JSX.Element | null;
8
8
  export declare function CanvasPopup(): import("react/jsx-runtime").JSX.Element[];
@@ -1,5 +1,5 @@
1
1
  import { Nullable } from '@univerjs/core';
2
- import { RefObject, default as React } from 'react';
2
+ import { ReactNode, RefObject } from 'react';
3
3
  import { Observable } from 'rxjs';
4
4
  interface IAbsolutePosition {
5
5
  left: number;
@@ -9,7 +9,7 @@ interface IAbsolutePosition {
9
9
  }
10
10
  export type RectPopupDirection = 'left' | 'left-center' | 'left-bottom' | 'left-top' | 'right' | 'right-center' | 'right-bottom' | 'right-top' | 'top' | 'top-center' | 'top-left' | 'top-right' | 'bottom' | 'bottom-center' | 'bottom-left' | 'bottom-right' | 'vertical' | 'vertical-left' | 'vertical-right' | 'vertical-center' | 'horizontal' | 'horizontal-top' | 'horizontal-bottom' | 'horizontal-center';
11
11
  export interface IRectPopupProps {
12
- children?: React.ReactNode;
12
+ children?: ReactNode;
13
13
  /**
14
14
  * the anchor element bounding rect
15
15
  */