@ws-ui/shared 1.8.3 → 1.8.4-rc1
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/dist/components/FloatingTooltip/index.d.ts +11 -0
- package/dist/components/Panel.d.ts +18 -0
- package/dist/components/Tooltip.d.ts +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-enhanced-state/setupDevTools.d.ts +27 -0
- package/dist/hooks/use-enhanced-state/useEnhancedState.d.ts +16 -0
- package/dist/index.cjs.js +116 -116
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +7979 -7453
- package/dist/index.es.js.map +1 -1
- package/package.json +5 -2
- package/README.md +0 -7
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
type TooltipProps = {
|
|
3
|
+
message?: string | JSX.Element;
|
|
4
|
+
delayDuration?: number;
|
|
5
|
+
open?: boolean;
|
|
6
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
7
|
+
sideOffset?: number;
|
|
8
|
+
alignOffset?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function FloatingTooltip(props: PropsWithChildren<TooltipProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
export declare const PANEL_INITIAL_HEIGHT = 30;
|
|
3
|
+
export declare const PANEL_EXPANDED_HEIGHT = 500;
|
|
4
|
+
export interface ICommonPanelProps {
|
|
5
|
+
headerRightSide?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface IPanelProps extends PropsWithChildren<{
|
|
8
|
+
render?: ReactNode;
|
|
9
|
+
} & ICommonPanelProps> {
|
|
10
|
+
path: string;
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
onOpen: () => void;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
onResize?: () => void;
|
|
15
|
+
tipKey?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const Panel: FC<IPanelProps>;
|
|
18
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type DevToolsMessageType = 'DISPATCH' | string;
|
|
2
|
+
export type DevToolsMessagePayload = {
|
|
3
|
+
type?: string;
|
|
4
|
+
state?: any;
|
|
5
|
+
};
|
|
6
|
+
export type DevToolsMessage = {
|
|
7
|
+
type?: DevToolsMessageType;
|
|
8
|
+
payload?: DevToolsMessagePayload;
|
|
9
|
+
};
|
|
10
|
+
export type DevTools = {
|
|
11
|
+
init: (state: any) => void;
|
|
12
|
+
connect: (options: {
|
|
13
|
+
name: string;
|
|
14
|
+
trace: boolean;
|
|
15
|
+
}) => any;
|
|
16
|
+
subscribe: (message: DevToolsMessage) => any;
|
|
17
|
+
send: (action: {
|
|
18
|
+
type: string;
|
|
19
|
+
state?: any;
|
|
20
|
+
}, newState: any) => any;
|
|
21
|
+
unsubscribe: () => any;
|
|
22
|
+
dispatch: (action: {
|
|
23
|
+
type: string;
|
|
24
|
+
}) => any;
|
|
25
|
+
disconnect: () => any;
|
|
26
|
+
};
|
|
27
|
+
export declare const devtools: DevTools | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Draft } from 'immer';
|
|
2
|
+
export type EnhancedStateController<T> = {
|
|
3
|
+
[key: string]: (state: Draft<T>, payload: any) => void;
|
|
4
|
+
};
|
|
5
|
+
export type EnhancedStateDispatch<T extends Record<string, (state: any, payload: any) => void>> = {
|
|
6
|
+
[Key in keyof T]: Parameters<T[Key]>['1'] extends undefined ? () => EnhancedStateDispatch<T> : (payload: Parameters<T[Key]>['1']) => EnhancedStateDispatch<T>;
|
|
7
|
+
};
|
|
8
|
+
export type EnhanceFunction = <T, K extends {
|
|
9
|
+
[key: string]: (state: Draft<T>, payload: any) => void;
|
|
10
|
+
}>(state: T, controller: K, store_name?: string) => {
|
|
11
|
+
state: T;
|
|
12
|
+
dispatch: {
|
|
13
|
+
[Property in keyof typeof controller]: Parameters<(typeof controller)[Property]>['1'] extends undefined ? () => EnhancedStateDispatch<K> : (payload: Parameters<(typeof controller)[Property]>['1']) => EnhancedStateDispatch<K>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const useEnhancedState: EnhanceFunction;
|