zs_library 0.6.3 → 0.6.5

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 +1,13 @@
1
- export declare const useSortableConfig: () => import('./context').SortableConfig<any, any>;
1
+ import { Theme } from '../../themes';
2
+ export declare const useSortableConfig: () => {
3
+ theme: Theme;
4
+ noLetters?: boolean;
5
+ typeConfigMap?: import('../..').TypeConfigMap;
6
+ dataTypeMenuConfigMap?: import('../..').DataTypeMenuConfigMap;
7
+ contextMenu?: false | import('../../context-menu').ContextMenuProps<any, any> | ((data: import('../..').SortItem<any, any>) => false | import('../../context-menu').ContextMenuProps<any, any>) | undefined;
8
+ pagingDotsBuilder?: (dots: React.ReactNode) => React.JSX.Element;
9
+ pagingDotBuilder?: ((item: import('../..').ListItem<any, any>, index: number, isActive: boolean) => React.JSX.Element) | undefined;
10
+ itemBuilder?: ((item: import('../..').SortItem<any, any>) => React.ReactNode) | undefined;
11
+ itemIconBuilder?: ((item: import('../..').SortItem<any, any>) => React.ReactNode) | undefined;
12
+ contextMenuBuilder?: ((data: import('../..').SortItem<any, any>) => import('../../context-menu').ContextMenuProps<any, any>) | undefined;
13
+ };
@@ -0,0 +1,6 @@
1
+ import { motion } from 'motion/react';
2
+ import { FC } from 'react';
3
+ export interface ContentMenuContextProps extends React.ComponentProps<typeof motion.div> {
4
+ }
5
+ declare const ContextMenuContent: FC<ContentMenuContextProps>;
6
+ export default ContextMenuContent;
@@ -0,0 +1,5 @@
1
+ export interface HoverContextType {
2
+ hoveredIndex: number | null;
3
+ setHoveredIndex: (index: number | null) => void;
4
+ }
5
+ export declare const HoverContext: import('react').Context<HoverContextType>;
@@ -12,3 +12,11 @@ export interface ContextMenuProps<D, C> {
12
12
  }
13
13
  declare const ContextMenu: <D, C>(props: ContextMenuProps<D, C>) => import("react/jsx-runtime").JSX.Element;
14
14
  export default ContextMenu;
15
+ export { MenuItem } from './menu-item';
16
+ export { SubMenuItem } from './sub-menu-item';
17
+ export { SizeSubMenuContent } from './size-sub-menu-content';
18
+ export { HoverContext } from './hover-context';
19
+ export type { MenuItemProps } from './menu-item';
20
+ export type { SubMenuItemProps } from './sub-menu-item';
21
+ export type { SizeMenuItemProps } from './size-sub-menu-content';
22
+ export type { HoverContextType } from './hover-context';
@@ -0,0 +1,10 @@
1
+ export interface MenuItemProps {
2
+ icon?: React.ReactNode;
3
+ text: string;
4
+ color?: string;
5
+ textColor?: string;
6
+ onClick?: () => void;
7
+ index: number;
8
+ children?: React.ReactNode;
9
+ }
10
+ export declare const MenuItem: ({ icon, text, color, textColor, onClick, index, children, ...props }: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export interface SizeMenuItemProps {
2
+ sizes: string[];
3
+ currentSize: string;
4
+ onSizeChange: (size: string) => void;
5
+ }
6
+ export declare const SizeSubMenuContent: ({ sizes, currentSize, onSizeChange }: SizeMenuItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export interface SubMenuItemProps {
2
+ text: string;
3
+ icon: React.ReactNode;
4
+ index: number;
5
+ children: React.ReactNode;
6
+ color?: string;
7
+ textColor?: string;
8
+ }
9
+ export declare const SubMenuItem: ({ text, icon, index, children, color, textColor, ...props }: SubMenuItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,14 @@
1
1
  import { default as React } from 'react';
2
2
  import { SortItem } from '../types';
3
- export interface DockProps {
3
+ export interface DockProps<D, C> {
4
4
  /**
5
5
  * dock 项目列表
6
6
  */
7
- items?: SortItem[];
7
+ items?: SortItem<D, C>[];
8
8
  /**
9
9
  * 固定项目列表(在sortable之前显示,不可拖拽排序)
10
10
  */
11
- fixedItems?: SortItem[];
11
+ fixedItems?: SortItem<D, C>[];
12
12
  /**
13
13
  * dock 位置
14
14
  */
@@ -20,15 +20,15 @@ export interface DockProps {
20
20
  /**
21
21
  * dock 项目点击事件
22
22
  */
23
- onItemClick?: (item: SortItem) => void;
23
+ onItemClick?: (item: SortItem<D, C>) => void;
24
24
  /**
25
25
  * 自定义项目渲染
26
26
  */
27
- itemBuilder?: (item: SortItem, index: number) => React.ReactNode;
27
+ itemBuilder?: (item: SortItem<D, C>, index: number) => React.ReactNode;
28
28
  /**
29
29
  * 自定义固定项目渲染
30
30
  */
31
- fixedItemBuilder?: (item: SortItem, index: number) => React.ReactNode;
31
+ fixedItemBuilder?: (item: SortItem<D, C>, index: number) => React.ReactNode;
32
32
  /**
33
33
  * 是否显示启动台按钮
34
34
  */
@@ -44,7 +44,7 @@ export interface DockProps {
44
44
  /**
45
45
  * dock 项目列表变更事件
46
46
  */
47
- onDockItemsChange?: (items: SortItem[]) => void;
47
+ onDockItemsChange?: (items: SortItem<D, C>[]) => void;
48
48
  }
49
- declare const Dock: React.FC<DockProps>;
49
+ declare const Dock: <D, C>({ items, fixedItems, position, className, itemBuilder, fixedItemBuilder, showLaunchpad, onLaunchpadClick, onDrop, onDockItemsChange, }: DockProps<D, C>) => import("react/jsx-runtime").JSX.Element | null;
50
50
  export default Dock;
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { Theme } from '../themes';
2
3
  export interface StackedIconProps {
3
4
  /**
4
5
  * 点击事件
@@ -8,6 +9,10 @@ export interface StackedIconProps {
8
9
  * 自定义类名
9
10
  */
10
11
  className?: string;
12
+ /**
13
+ * 主题配置
14
+ */
15
+ theme?: Theme;
11
16
  }
12
17
  declare const StackedIcon: React.FC<StackedIconProps>;
13
18
  export default StackedIcon;
@@ -21,4 +21,6 @@ export type { Theme, ThemeType } from './themes';
21
21
  export { themeLight as desktopThemeLight, themeDark as desktopThemeDark, defaultTheme as desktopDefaultTheme, themes as desktopThemes, } from './themes';
22
22
  export { Dock, LaunchpadModal, LaunchpadButton } from './dock';
23
23
  export type { DockProps, LaunchpadModalProps, LaunchpadButtonProps } from './dock';
24
+ export { BaseModal } from './modal';
25
+ export type { BaseModalProps } from './modal';
24
26
  export default Desktop;
@@ -13,6 +13,7 @@ export interface SortableItemProps<D, C> {
13
13
  childrenLength?: number;
14
14
  contextMenuProps?: false | Partial<ContextMenuProps<D, C>>;
15
15
  icon?: React.ReactNode;
16
+ iconSize?: number;
16
17
  /**
17
18
  * 来源 当前仅支持 dock
18
19
  */
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- interface BaseModalProps {
2
+ export interface BaseModalProps {
3
3
  visible: boolean;
4
4
  onClose: () => void;
5
5
  title?: ReactNode;
@@ -1 +1,2 @@
1
1
  export { default as BaseModal } from './base-modal';
2
+ export type { BaseModalProps } from './base-modal';
@@ -39,31 +39,7 @@ export interface SortableProps<D, C> {
39
39
  * 是否显示 dock
40
40
  */
41
41
  enabled?: boolean;
42
- /**
43
- * dock 位置
44
- */
45
- position?: "top" | "bottom" | "left" | "right";
46
- /**
47
- * dock 样式类名
48
- */
49
- className?: string;
50
- /**
51
- * 自定义 dock 项目渲染
52
- */
53
- itemBuilder?: DockProps["itemBuilder"];
54
- /**
55
- * 自定义固定项目渲染
56
- */
57
- fixedItemBuilder?: DockProps["fixedItemBuilder"];
58
- /**
59
- * 固定项目列表(在sortable之前显示,不可拖拽排序)
60
- */
61
- fixedItems?: DockProps["fixedItems"];
62
- /**
63
- * 是否显示启动台按钮
64
- */
65
- showLaunchpad?: boolean;
66
- };
42
+ } & Omit<DockProps<D, C>, "onDrop" | "onDockItemsChange">;
67
43
  }
68
44
  declare const Sortable: <D, C>(props: SortableProps<D, C>) => import("react/jsx-runtime").JSX.Element;
69
45
  export default Sortable;
@@ -1,5 +1,29 @@
1
1
  import { themeDark } from './dark';
2
2
  import { themeLight } from './light';
3
+ export interface BaseModalTheme {
4
+ mask?: {
5
+ backgroundColor?: string;
6
+ backdropFilter?: string;
7
+ };
8
+ content?: {
9
+ backgroundColor?: string;
10
+ backdropFilter?: string;
11
+ boxShadowColor?: string;
12
+ boxShadowBorderColor?: string;
13
+ borderColor?: string;
14
+ borderRadius?: string;
15
+ };
16
+ header?: {
17
+ textColor?: string;
18
+ };
19
+ scrollbar?: {
20
+ width?: string;
21
+ trackColor?: string;
22
+ thumbColor?: string;
23
+ thumbHoverColor?: string;
24
+ borderRadius?: string;
25
+ };
26
+ }
3
27
  export interface DockTheme {
4
28
  backgroundColor?: string;
5
29
  borderColor?: string;
@@ -7,6 +31,31 @@ export interface DockTheme {
7
31
  divider?: {
8
32
  color?: string;
9
33
  };
34
+ launchpad?: {
35
+ modal?: {
36
+ searchBox?: {
37
+ iconColor?: string;
38
+ iconFocusColor?: string;
39
+ backgroundColor?: string;
40
+ focusBackgroundColor?: string;
41
+ textColor?: string;
42
+ placeholderColor?: string;
43
+ shadowColor?: string;
44
+ clearButton?: {
45
+ backgroundColor?: string;
46
+ hoverBackgroundColor?: string;
47
+ textColor?: string;
48
+ };
49
+ };
50
+ };
51
+ icon?: {
52
+ textColor?: string;
53
+ backgroundColor?: string;
54
+ borderColor?: string;
55
+ shadowColor?: string;
56
+ hoverGlowColor?: string;
57
+ };
58
+ };
10
59
  }
11
60
  export interface LaunchpadTheme {
12
61
  button?: {
@@ -16,21 +65,55 @@ export interface LaunchpadTheme {
16
65
  borderColor?: string;
17
66
  hoverBackgroundColor?: string;
18
67
  };
19
- modal?: {};
68
+ modal?: BaseModalTheme;
69
+ }
70
+ export interface ContextMenuTheme {
71
+ textColor?: string;
72
+ activeColor?: string;
73
+ dangerColor?: string;
74
+ backgroundColor?: string;
75
+ shadowColor?: string;
76
+ boxShadowBorderColor?: string;
77
+ borderColor?: string;
78
+ backdropFilter?: string;
79
+ }
80
+ export interface ItemsTheme {
81
+ textColor?: string;
82
+ iconBackgroundColor?: string;
83
+ iconShadowColor?: string;
84
+ groupIconBackgroundColor?: string;
85
+ groupIconShadowColor?: string;
86
+ infoModalBackgroundColor?: string;
87
+ groupModal?: {
88
+ backgroundColor?: string;
89
+ title?: {
90
+ textColor?: string;
91
+ backgroundColor?: string;
92
+ hoverBackgroundColor?: string;
93
+ focusBackgroundColor?: string;
94
+ shadowColor?: string;
95
+ placeholderColor?: string;
96
+ selectionBackgroundColor?: string;
97
+ };
98
+ };
99
+ }
100
+ export interface BaseTheme {
101
+ hoverColor?: string;
102
+ dangerColor?: string;
103
+ backgroundColor?: string;
104
+ textColor?: string;
105
+ shadowColor?: string;
106
+ boxShadowBorderColor?: string;
107
+ borderColor?: string;
108
+ backdropFilter?: string;
20
109
  }
21
110
  export interface Theme {
22
111
  token: {
23
- itemNameColor?: string;
24
- itemIconBackgroundColor?: string;
25
- itemIconShadowColor?: string;
26
- groupItemIconBackgroundColor?: string;
27
- groupItemIconShadowColor?: string;
28
- groupItemModalBackgroundColor?: string;
29
- contextMenuTextColor?: string;
30
- contextMenuActiveColor?: string;
31
- contextMenuBackgroundColor?: string;
32
- contextMenuShadowColor?: string;
112
+ base?: BaseTheme;
33
113
  dock?: DockTheme;
114
+ modal?: BaseModalTheme;
115
+ contextMenu?: ContextMenuTheme;
116
+ items?: ItemsTheme;
34
117
  };
35
118
  }
36
119
  export declare const defaultTheme: Theme;
@@ -0,0 +1,6 @@
1
+ import { Theme } from './index';
2
+ /**
3
+ * 合成完整主题配置
4
+ * 优先级:base外配置 > base配置 > 内置base配置
5
+ */
6
+ export declare function mergeTheme(theme: Theme | "light" | "dark"): Theme;
@@ -17,6 +17,8 @@ export type { Theme as DesktopTheme, ThemeType as DesktopThemeType } from './des
17
17
  export { default as SortableUtils } from './desktop/utils';
18
18
  export { Dock as DesktopDock, LaunchpadModal as DesktopLaunchpadModal, LaunchpadButton as DesktopLaunchpadButton, } from './desktop/dock';
19
19
  export type { DockProps as DesktopDockProps, LaunchpadModalProps as DesktopLaunchpadModalProps, LaunchpadButtonProps as DesktopLaunchpadButtonProps, } from './desktop/dock';
20
+ export { BaseModal as DesktopBaseModal } from './desktop/modal';
21
+ export type { BaseModalProps as DesktopBaseModalProps } from './desktop/modal';
20
22
  export { default as MdEditor } from './md-editor';
21
23
  export { default as Markdown } from './md-editor/preview';
22
24
  export { default as Dock } from './dock';