@liuman/react-workspace 1.2.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.
- package/LICENSE +21 -0
- package/README.md +470 -0
- package/dist/antd.d.ts +84 -0
- package/dist/components/FloatingWindow.d.ts +19 -0
- package/dist/components/FloatingWindow.d.ts.map +1 -0
- package/dist/components/WindowContainer.d.ts +14 -0
- package/dist/components/WindowContainer.d.ts.map +1 -0
- package/dist/components/WindowManager.d.ts +30 -0
- package/dist/components/WindowManager.d.ts.map +1 -0
- package/dist/components/WindowTabs.d.ts +24 -0
- package/dist/components/WindowTabs.d.ts.map +1 -0
- package/dist/components/Workspace.d.ts +10 -0
- package/dist/components/Workspace.d.ts.map +1 -0
- package/dist/components/WorkspaceSidebar.d.ts +20 -0
- package/dist/components/WorkspaceSidebar.d.ts.map +1 -0
- package/dist/context/WorkspaceContext.d.ts +16 -0
- package/dist/context/WorkspaceContext.d.ts.map +1 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +14 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/hooks/useWorkspace.d.ts +3 -0
- package/dist/hooks/useWorkspace.d.ts.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/integrations/AntdSidebar.d.ts +24 -0
- package/dist/integrations/AntdSidebar.d.ts.map +1 -0
- package/dist/integrations/antd.d.ts +4 -0
- package/dist/integrations/antd.d.ts.map +1 -0
- package/dist/react-workspace-antd.cjs +1 -0
- package/dist/react-workspace-antd.js +99 -0
- package/dist/react-workspace.cjs +1 -0
- package/dist/react-workspace.css +1 -0
- package/dist/react-workspace.js +1142 -0
- package/dist/theme-CzPgEJDm.js +113 -0
- package/dist/theme-DIsh66tX.cjs +1 -0
- package/dist/types.d.ts +194 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/ui/Dropdown.d.ts +17 -0
- package/dist/ui/Dropdown.d.ts.map +1 -0
- package/dist/ui/EmptyState.d.ts +7 -0
- package/dist/ui/EmptyState.d.ts.map +1 -0
- package/dist/ui/Icons.d.ts +15 -0
- package/dist/ui/Icons.d.ts.map +1 -0
- package/dist/ui/Spinner.d.ts +8 -0
- package/dist/ui/Spinner.d.ts.map +1 -0
- package/dist/utils/menuUtils.d.ts +20 -0
- package/dist/utils/menuUtils.d.ts.map +1 -0
- package/dist/utils/theme.d.ts +41 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/windowStorage.d.ts +19 -0
- package/dist/utils/windowStorage.d.ts.map +1 -0
- package/package.json +84 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
function a(r, c) {
|
|
2
|
+
for (const e of r) {
|
|
3
|
+
if ("type" in e && e.type === "divider") continue;
|
|
4
|
+
const o = e;
|
|
5
|
+
if (o.key === c) return o;
|
|
6
|
+
if (o.children) {
|
|
7
|
+
const t = a(o.children, c);
|
|
8
|
+
if (t) return t;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
function f(r, c, e) {
|
|
14
|
+
const o = (t) => {
|
|
15
|
+
for (const n of t) {
|
|
16
|
+
if ("type" in n && n.type === "divider") continue;
|
|
17
|
+
const i = n;
|
|
18
|
+
if (i.windowType === c)
|
|
19
|
+
return typeof i.label == "string" ? i.label : i.key;
|
|
20
|
+
if (i.children) {
|
|
21
|
+
const l = o(i.children);
|
|
22
|
+
if (l) return l;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
};
|
|
27
|
+
return o(r) ?? e ?? c;
|
|
28
|
+
}
|
|
29
|
+
function d(r, c) {
|
|
30
|
+
for (const e of r) {
|
|
31
|
+
if ("type" in e && e.type === "divider") continue;
|
|
32
|
+
const o = e;
|
|
33
|
+
if (o.windowType === c) return o.key;
|
|
34
|
+
if (o.children) {
|
|
35
|
+
const t = d(o.children, c);
|
|
36
|
+
if (t) return t;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
function g(r) {
|
|
42
|
+
const c = [];
|
|
43
|
+
for (const e of r) {
|
|
44
|
+
if ("type" in e && e.type === "divider") continue;
|
|
45
|
+
const o = e;
|
|
46
|
+
o.children?.length && c.push(o.key);
|
|
47
|
+
}
|
|
48
|
+
return c;
|
|
49
|
+
}
|
|
50
|
+
function m(r) {
|
|
51
|
+
return typeof r == "string" || typeof r == "number" ? String(r) : "";
|
|
52
|
+
}
|
|
53
|
+
const s = {
|
|
54
|
+
colorPrimary: "--rw-color-primary",
|
|
55
|
+
colorPrimaryHover: "--rw-color-primary-hover",
|
|
56
|
+
colorPrimaryBg: "--rw-color-primary-bg",
|
|
57
|
+
colorBg: "--rw-color-bg",
|
|
58
|
+
colorBgSecondary: "--rw-color-bg-secondary",
|
|
59
|
+
colorBgTertiary: "--rw-color-bg-tertiary",
|
|
60
|
+
colorBgHover: "--rw-color-bg-hover",
|
|
61
|
+
colorBgActive: "--rw-color-bg-active",
|
|
62
|
+
colorBorder: "--rw-color-border",
|
|
63
|
+
colorBorderStrong: "--rw-color-border-strong",
|
|
64
|
+
colorText: "--rw-color-text",
|
|
65
|
+
colorTextSecondary: "--rw-color-text-secondary",
|
|
66
|
+
colorTextMuted: "--rw-color-text-muted",
|
|
67
|
+
sidebarWidth: "--rw-sidebar-width",
|
|
68
|
+
tabHeight: "--rw-tab-height",
|
|
69
|
+
radius: "--rw-radius",
|
|
70
|
+
fontSize: "--rw-font-size"
|
|
71
|
+
};
|
|
72
|
+
function u(r) {
|
|
73
|
+
const c = {};
|
|
74
|
+
return Object.keys(r).forEach((e) => {
|
|
75
|
+
const o = r[e];
|
|
76
|
+
if (o !== void 0) {
|
|
77
|
+
const t = s[e];
|
|
78
|
+
c[t] = typeof o == "number" ? `${o}px` : o;
|
|
79
|
+
}
|
|
80
|
+
}), c;
|
|
81
|
+
}
|
|
82
|
+
function y(r) {
|
|
83
|
+
return {
|
|
84
|
+
colorPrimary: r.colorPrimary,
|
|
85
|
+
colorPrimaryHover: r.colorPrimaryHover,
|
|
86
|
+
colorPrimaryBg: r.colorPrimaryBg,
|
|
87
|
+
colorBg: r.colorBgContainer,
|
|
88
|
+
colorBgSecondary: r.colorFillAlter ?? r.colorBgContainer,
|
|
89
|
+
colorBgTertiary: r.colorBgLayout,
|
|
90
|
+
colorBgHover: r.colorBgTextHover,
|
|
91
|
+
colorBgActive: r.colorPrimaryBg,
|
|
92
|
+
colorBorder: r.colorBorder,
|
|
93
|
+
colorBorderStrong: r.colorBorderSecondary ?? r.colorBorder,
|
|
94
|
+
colorText: r.colorText,
|
|
95
|
+
colorTextSecondary: r.colorTextSecondary,
|
|
96
|
+
colorTextMuted: r.colorTextTertiary,
|
|
97
|
+
radius: r.borderRadius,
|
|
98
|
+
fontSize: r.fontSize
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function B(r) {
|
|
102
|
+
return u(y(r));
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
a,
|
|
106
|
+
y as b,
|
|
107
|
+
g as c,
|
|
108
|
+
d as f,
|
|
109
|
+
m as l,
|
|
110
|
+
B as m,
|
|
111
|
+
f as r,
|
|
112
|
+
u as t
|
|
113
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function d(r,t){for(const e of r){if("type"in e&&e.type==="divider")continue;const o=e;if(o.key===t)return o;if(o.children){const n=d(o.children,t);if(n)return n}}return null}function y(r,t,e){const o=n=>{for(const i of n){if("type"in i&&i.type==="divider")continue;const c=i;if(c.windowType===t)return typeof c.label=="string"?c.label:c.key;if(c.children){const l=o(c.children);if(l)return l}}return null};return o(r)??e??t}function s(r,t){for(const e of r){if("type"in e&&e.type==="divider")continue;const o=e;if(o.windowType===t)return o.key;if(o.children){const n=s(o.children,t);if(n)return n}}return null}function f(r){const t=[];for(const e of r){if("type"in e&&e.type==="divider")continue;const o=e;o.children?.length&&t.push(o.key)}return t}function m(r){return typeof r=="string"||typeof r=="number"?String(r):""}const g={colorPrimary:"--rw-color-primary",colorPrimaryHover:"--rw-color-primary-hover",colorPrimaryBg:"--rw-color-primary-bg",colorBg:"--rw-color-bg",colorBgSecondary:"--rw-color-bg-secondary",colorBgTertiary:"--rw-color-bg-tertiary",colorBgHover:"--rw-color-bg-hover",colorBgActive:"--rw-color-bg-active",colorBorder:"--rw-color-border",colorBorderStrong:"--rw-color-border-strong",colorText:"--rw-color-text",colorTextSecondary:"--rw-color-text-secondary",colorTextMuted:"--rw-color-text-muted",sidebarWidth:"--rw-sidebar-width",tabHeight:"--rw-tab-height",radius:"--rw-radius",fontSize:"--rw-font-size"};function u(r){const t={};return Object.keys(r).forEach(e=>{const o=r[e];if(o!==void 0){const n=g[e];t[n]=typeof o=="number"?`${o}px`:o}}),t}function a(r){return{colorPrimary:r.colorPrimary,colorPrimaryHover:r.colorPrimaryHover,colorPrimaryBg:r.colorPrimaryBg,colorBg:r.colorBgContainer,colorBgSecondary:r.colorFillAlter??r.colorBgContainer,colorBgTertiary:r.colorBgLayout,colorBgHover:r.colorBgTextHover,colorBgActive:r.colorPrimaryBg,colorBorder:r.colorBorder,colorBorderStrong:r.colorBorderSecondary??r.colorBorder,colorText:r.colorText,colorTextSecondary:r.colorTextSecondary,colorTextMuted:r.colorTextTertiary,radius:r.borderRadius,fontSize:r.fontSize}}function T(r){return u(a(r))}exports.collectParentMenuKeys=f;exports.findMenuItem=d;exports.findMenuKeyByWindowType=s;exports.labelToString=m;exports.mapAntdTokenToCssVars=T;exports.mapAntdTokenToWorkspaceTheme=a;exports.resolveWindowTitle=y;exports.themeToCssVars=u;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* react-workspace 类型定义
|
|
3
|
+
*/
|
|
4
|
+
import type { ReactNode, Dispatch, SetStateAction, CSSProperties, Ref } from 'react';
|
|
5
|
+
import type { WorkspaceTheme } from './utils/theme';
|
|
6
|
+
/** 窗口位置和大小 */
|
|
7
|
+
export interface WindowPosition {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
/** 浮动窗口默认尺寸 */
|
|
14
|
+
export interface FloatingWindowDefaults {
|
|
15
|
+
x?: number;
|
|
16
|
+
y?: number;
|
|
17
|
+
width?: number;
|
|
18
|
+
height?: number;
|
|
19
|
+
minWidth?: number;
|
|
20
|
+
minHeight?: number;
|
|
21
|
+
}
|
|
22
|
+
/** 窗口配置 */
|
|
23
|
+
export interface WindowConfig {
|
|
24
|
+
id: string;
|
|
25
|
+
/** 窗口类型标识,由使用者自定义 */
|
|
26
|
+
type: string;
|
|
27
|
+
title: string;
|
|
28
|
+
minimized: boolean;
|
|
29
|
+
floating?: boolean;
|
|
30
|
+
floatingPosition?: WindowPosition;
|
|
31
|
+
floatingZIndex?: number;
|
|
32
|
+
props?: Record<string, unknown>;
|
|
33
|
+
pendingAction?: string;
|
|
34
|
+
pendingDragStart?: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** 侧边栏菜单项 */
|
|
40
|
+
export interface SidebarMenuItem {
|
|
41
|
+
key: string;
|
|
42
|
+
label: ReactNode;
|
|
43
|
+
icon?: ReactNode;
|
|
44
|
+
/** 点击后打开的窗口类型 */
|
|
45
|
+
windowType?: string;
|
|
46
|
+
children?: SidebarMenuEntry[];
|
|
47
|
+
/** 自定义操作标识 */
|
|
48
|
+
action?: string;
|
|
49
|
+
/** 传递给窗口的额外属性 */
|
|
50
|
+
props?: Record<string, unknown>;
|
|
51
|
+
/** 是否禁用 */
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** 侧边栏分隔线 */
|
|
55
|
+
export interface SidebarMenuDivider {
|
|
56
|
+
type: 'divider';
|
|
57
|
+
key?: string;
|
|
58
|
+
}
|
|
59
|
+
export type SidebarMenuEntry = SidebarMenuItem | SidebarMenuDivider;
|
|
60
|
+
/** 批量窗口管理操作 */
|
|
61
|
+
export type BatchWindowAction = 'close-all' | 'close-others' | 'close-left' | 'close-right' | 'minimize-all' | 'restore-all' | 'reset-windows';
|
|
62
|
+
/** 默认窗口配置(不含 id) */
|
|
63
|
+
export interface DefaultWindowConfig {
|
|
64
|
+
type: string;
|
|
65
|
+
title: string;
|
|
66
|
+
minimized?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** 窗口渲染上下文 */
|
|
69
|
+
export interface WindowRenderContext {
|
|
70
|
+
workspaceId: string;
|
|
71
|
+
active: boolean;
|
|
72
|
+
activeWindowId: string | null;
|
|
73
|
+
windows: WindowConfig[];
|
|
74
|
+
openWindow: (config: Omit<WindowConfig, 'id'>, props?: Record<string, unknown>) => void;
|
|
75
|
+
switchWindow: (windowId: string) => void;
|
|
76
|
+
closeWindow: (windowId: string) => void;
|
|
77
|
+
toggleMinimize: (windowId: string) => void;
|
|
78
|
+
floatWindow: (windowId: string, mousePosition?: {
|
|
79
|
+
x: number;
|
|
80
|
+
y: number;
|
|
81
|
+
}) => void;
|
|
82
|
+
updateWindowProps: (windowId: string, props: Record<string, unknown>) => void;
|
|
83
|
+
clearPendingAction: (windowId: string) => void;
|
|
84
|
+
}
|
|
85
|
+
/** useWorkspace 配置 */
|
|
86
|
+
export interface UseWorkspaceOptions {
|
|
87
|
+
workspaceId: string;
|
|
88
|
+
defaultWindow?: DefaultWindowConfig;
|
|
89
|
+
/** 是否同步窗口状态到 URL searchParams */
|
|
90
|
+
syncToUrl?: boolean;
|
|
91
|
+
/** syncToUrl 为 true 时,保留 URL 中其他参数 */
|
|
92
|
+
preserveUrlParams?: boolean;
|
|
93
|
+
searchParams?: URLSearchParams;
|
|
94
|
+
setSearchParams?: (params: URLSearchParams, options?: {
|
|
95
|
+
replace?: boolean;
|
|
96
|
+
}) => void;
|
|
97
|
+
storageKeyPrefix?: string;
|
|
98
|
+
/** 浮动窗口默认尺寸 */
|
|
99
|
+
floatingDefaults?: FloatingWindowDefaults;
|
|
100
|
+
/** 窗口列表变化回调 */
|
|
101
|
+
onWindowsChange?: (windows: WindowConfig[], activeWindowId: string | null) => void;
|
|
102
|
+
}
|
|
103
|
+
/** useWorkspace 返回值 */
|
|
104
|
+
export interface UseWorkspaceReturn {
|
|
105
|
+
windows: WindowConfig[];
|
|
106
|
+
activeWindowId: string | null;
|
|
107
|
+
openWindow: (config: Omit<WindowConfig, 'id'>, props?: Record<string, unknown>) => void;
|
|
108
|
+
switchWindow: (windowId: string) => void;
|
|
109
|
+
closeWindow: (windowId: string) => void;
|
|
110
|
+
toggleMinimize: (windowId: string) => void;
|
|
111
|
+
floatWindow: (windowId: string, mousePosition?: {
|
|
112
|
+
x: number;
|
|
113
|
+
y: number;
|
|
114
|
+
}) => void;
|
|
115
|
+
restoreWindow: (windowId: string, insertIndex?: number) => void;
|
|
116
|
+
updateFloatingPosition: (windowId: string, position: WindowPosition) => void;
|
|
117
|
+
focusWindow: (windowId: string) => void;
|
|
118
|
+
batchManage: (action: BatchWindowAction) => void;
|
|
119
|
+
updateWindowProps: (windowId: string, props: Record<string, unknown>) => void;
|
|
120
|
+
updateWindowTitle: (windowId: string, title: string) => void;
|
|
121
|
+
clearPendingAction: (windowId: string) => void;
|
|
122
|
+
setWindows: Dispatch<SetStateAction<WindowConfig[]>>;
|
|
123
|
+
setActiveWindowId: Dispatch<SetStateAction<string | null>>;
|
|
124
|
+
resetWorkspace: () => void;
|
|
125
|
+
reorderWindows: (fromIndex: number, toIndex: number) => void;
|
|
126
|
+
}
|
|
127
|
+
/** Workspace 组件暴露的 Ref */
|
|
128
|
+
export interface WorkspaceRef extends UseWorkspaceReturn {
|
|
129
|
+
workspaceId: string;
|
|
130
|
+
}
|
|
131
|
+
/** 自定义侧边栏 renderSidebar 接收的参数 */
|
|
132
|
+
export interface WorkspaceSidebarRenderProps {
|
|
133
|
+
menuItems: SidebarMenuEntry[];
|
|
134
|
+
onMenuClick: (windowType: string, props?: Record<string, unknown>) => void;
|
|
135
|
+
onAction?: (action: string) => void;
|
|
136
|
+
activeWindowType?: string;
|
|
137
|
+
header?: ReactNode;
|
|
138
|
+
footer?: ReactNode;
|
|
139
|
+
defaultOpenKeys?: string[];
|
|
140
|
+
siderWidth?: number;
|
|
141
|
+
}
|
|
142
|
+
/** Workspace 组件 Props */
|
|
143
|
+
export interface WorkspaceProps {
|
|
144
|
+
workspaceId: string;
|
|
145
|
+
/** 侧边栏菜单项 */
|
|
146
|
+
menuItems: SidebarMenuEntry[];
|
|
147
|
+
/** 渲染窗口内容 */
|
|
148
|
+
renderWindow: (window: WindowConfig, context: WindowRenderContext) => ReactNode;
|
|
149
|
+
/** 侧边栏顶部区域(如项目切换器) */
|
|
150
|
+
sidebarHeader?: ReactNode;
|
|
151
|
+
/** 侧边栏底部区域(如用户信息) */
|
|
152
|
+
sidebarFooter?: ReactNode;
|
|
153
|
+
/** 默认打开的窗口 */
|
|
154
|
+
defaultWindow?: DefaultWindowConfig;
|
|
155
|
+
/** 加载状态 */
|
|
156
|
+
loading?: boolean;
|
|
157
|
+
loadingTip?: string;
|
|
158
|
+
/** 自定义操作回调 */
|
|
159
|
+
onAction?: (action: string) => void;
|
|
160
|
+
/** 当前激活的窗口类型(用于菜单高亮,不传则自动推断) */
|
|
161
|
+
activeWindowType?: string;
|
|
162
|
+
/** 空状态描述 */
|
|
163
|
+
emptyDescription?: ReactNode;
|
|
164
|
+
/** 是否同步 URL */
|
|
165
|
+
syncToUrl?: boolean;
|
|
166
|
+
preserveUrlParams?: boolean;
|
|
167
|
+
searchParams?: URLSearchParams;
|
|
168
|
+
setSearchParams?: (params: URLSearchParams, options?: {
|
|
169
|
+
replace?: boolean;
|
|
170
|
+
}) => void;
|
|
171
|
+
/** 浮动窗口默认尺寸 */
|
|
172
|
+
floatingDefaults?: FloatingWindowDefaults;
|
|
173
|
+
/** 窗口列表变化回调 */
|
|
174
|
+
onWindowsChange?: (windows: WindowConfig[], activeWindowId: string | null) => void;
|
|
175
|
+
/** 工作区就绪回调,可获取完整 API */
|
|
176
|
+
onReady?: (api: WorkspaceRef) => void;
|
|
177
|
+
/** 暴露 ref */
|
|
178
|
+
ref?: Ref<WorkspaceRef>;
|
|
179
|
+
/** 侧边栏宽度 */
|
|
180
|
+
siderWidth?: number;
|
|
181
|
+
/** 内容区背景色 */
|
|
182
|
+
contentBackground?: string;
|
|
183
|
+
/** 是否启用快捷键 Ctrl+W / Ctrl+Tab */
|
|
184
|
+
enableKeyboardShortcuts?: boolean;
|
|
185
|
+
/** 主题 class,如 rw-theme-dark */
|
|
186
|
+
themeClassName?: string;
|
|
187
|
+
/** 通过 props 覆盖 CSS 变量主题(可与 antd token 映射配合) */
|
|
188
|
+
theme?: WorkspaceTheme;
|
|
189
|
+
/** 完全自定义侧边栏,例如使用 Ant Design Menu */
|
|
190
|
+
renderSidebar?: (props: WorkspaceSidebarRenderProps) => ReactNode;
|
|
191
|
+
className?: string;
|
|
192
|
+
style?: CSSProperties;
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,cAAc;AACd,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAe;AACf,MAAM,WAAW,sBAAsB;IACrC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,E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ACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa;IACb,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gCAAgC;IAChC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,+BAA+B;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,oCAAoC;IACpC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,SAAS,CAAC;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '../styles/ui.css';
|
|
3
|
+
export interface DropdownItem {
|
|
4
|
+
key: string;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
divider?: boolean;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface DropdownProps {
|
|
11
|
+
items: DropdownItem[];
|
|
12
|
+
trigger: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const Dropdown: React.FC<DropdownProps>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=Dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../src/ui/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,UAAU,aAAa;IACrB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAuC5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/ui/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,kBAAkB,CAAC;AAE1B,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAQ1F,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type IconProps = {
|
|
3
|
+
size?: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const IconClose: React.FC<IconProps>;
|
|
7
|
+
export declare const IconMinus: React.FC<IconProps>;
|
|
8
|
+
export declare const IconFloat: React.FC<IconProps>;
|
|
9
|
+
export declare const IconMore: React.FC<IconProps>;
|
|
10
|
+
export declare const IconMenuFold: React.FC<IconProps>;
|
|
11
|
+
export declare const IconMenuUnfold: React.FC<IconProps>;
|
|
12
|
+
export declare const IconFolder: React.FC<IconProps>;
|
|
13
|
+
export declare const IconChevronDown: React.FC<IconProps>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=Icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icons.d.ts","sourceRoot":"","sources":["../../src/ui/Icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,SAAS,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAIvD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAEzC,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAEzC,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAEzC,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAExC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAE5C,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAE9C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAI1C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAE/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/ui/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,kBAAkB,CAAC;AAE1B,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAc9F,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 菜单工具函数
|
|
3
|
+
*/
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
import type { SidebarMenuItem } from '../types';
|
|
6
|
+
export type SidebarMenuEntry = SidebarMenuItem | {
|
|
7
|
+
type: 'divider';
|
|
8
|
+
key?: string;
|
|
9
|
+
};
|
|
10
|
+
/** 在菜单树中查找指定 key 的菜单项 */
|
|
11
|
+
export declare function findMenuItem(items: SidebarMenuEntry[], targetKey: string): SidebarMenuItem | null;
|
|
12
|
+
/** 根据窗口类型解析菜单标题 */
|
|
13
|
+
export declare function resolveWindowTitle(items: SidebarMenuEntry[], windowType: string, fallback?: string): string;
|
|
14
|
+
/** 根据窗口类型查找菜单 key(用于高亮) */
|
|
15
|
+
export declare function findMenuKeyByWindowType(items: SidebarMenuEntry[], windowType: string): string | null;
|
|
16
|
+
/** 提取菜单中所有可展开的父级 key */
|
|
17
|
+
export declare function collectParentMenuKeys(items: SidebarMenuEntry[]): string[];
|
|
18
|
+
/** 将 label 转为可读字符串 */
|
|
19
|
+
export declare function labelToString(label: ReactNode): string;
|
|
20
|
+
//# sourceMappingURL=menuUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuUtils.d.ts","sourceRoot":"","sources":["../../src/utils/menuUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnF,yBAAyB;AACzB,wBAAgB,YAAY,CAC1B,KAAK,EAAE,gBAAgB,EAAE,EACzB,SAAS,EAAE,MAAM,GAChB,eAAe,GAAG,IAAI,CAWxB;AAED,mBAAmB;AACnB,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,gBAAgB,EAAE,EACzB,UAAU,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAgBR;AAED,2BAA2B;AAC3B,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,gBAAgB,EAAE,EACzB,UAAU,EAAE,MAAM,GACjB,MAAM,GAAG,IAAI,CAWf;AAED,wBAAwB;AACxB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,MAAM,EAAE,CAUzE;AAED,sBAAsB;AACtB,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGtD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
/** 可覆盖的 Workspace 主题变量(对应 CSS --rw-* 变量) */
|
|
3
|
+
export interface WorkspaceTheme {
|
|
4
|
+
colorPrimary?: string;
|
|
5
|
+
colorPrimaryHover?: string;
|
|
6
|
+
colorPrimaryBg?: string;
|
|
7
|
+
colorBg?: string;
|
|
8
|
+
colorBgSecondary?: string;
|
|
9
|
+
colorBgTertiary?: string;
|
|
10
|
+
colorBgHover?: string;
|
|
11
|
+
colorBgActive?: string;
|
|
12
|
+
colorBorder?: string;
|
|
13
|
+
colorBorderStrong?: string;
|
|
14
|
+
colorText?: string;
|
|
15
|
+
colorTextSecondary?: string;
|
|
16
|
+
colorTextMuted?: string;
|
|
17
|
+
sidebarWidth?: number;
|
|
18
|
+
tabHeight?: number;
|
|
19
|
+
radius?: number;
|
|
20
|
+
fontSize?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function themeToCssVars(theme: WorkspaceTheme): CSSProperties;
|
|
23
|
+
/** 将 Ant Design token 映射为 Workspace CSS 变量(无需在库内 import antd) */
|
|
24
|
+
export declare function mapAntdTokenToWorkspaceTheme(token: {
|
|
25
|
+
colorPrimary?: string;
|
|
26
|
+
colorPrimaryHover?: string;
|
|
27
|
+
colorPrimaryBg?: string;
|
|
28
|
+
colorBgContainer?: string;
|
|
29
|
+
colorBgLayout?: string;
|
|
30
|
+
colorBgTextHover?: string;
|
|
31
|
+
colorFillAlter?: string;
|
|
32
|
+
colorBorder?: string;
|
|
33
|
+
colorBorderSecondary?: string;
|
|
34
|
+
colorText?: string;
|
|
35
|
+
colorTextSecondary?: string;
|
|
36
|
+
colorTextTertiary?: string;
|
|
37
|
+
borderRadius?: number;
|
|
38
|
+
fontSize?: number;
|
|
39
|
+
}): WorkspaceTheme;
|
|
40
|
+
export declare function mapAntdTokenToCssVars(token: Parameters<typeof mapAntdTokenToWorkspaceTheme>[0]): CSSProperties;
|
|
41
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,4CAA4C;AAC5C,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAsBD,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,aAAa,CAUnE;AAED,iEAAiE;AACjE,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,cAAc,CAkBjB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAE9G"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { WindowPosition } from '../types';
|
|
2
|
+
/** 检测并修复窗口位置,确保至少保留一个角落可见 */
|
|
3
|
+
export declare function fixWindowPosition(position: WindowPosition): WindowPosition;
|
|
4
|
+
export interface WindowState {
|
|
5
|
+
position?: WindowPosition;
|
|
6
|
+
minimized?: boolean;
|
|
7
|
+
floating?: boolean;
|
|
8
|
+
floatingZIndex?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function getStorageKey(prefix: string, workspaceId: string): string;
|
|
11
|
+
export declare function getAllWindowStatesFromStorage(storageKeyPrefix: string, workspaceId: string): Record<string, WindowState>;
|
|
12
|
+
export declare function saveWindowStateToStorage(storageKeyPrefix: string, workspaceId: string, windowType: string, state: WindowState): void;
|
|
13
|
+
export declare function updateTabClickOrder(storageKeyPrefix: string, workspaceId: string, windowType: string): void;
|
|
14
|
+
/** 按点击顺序选择下一个激活窗口 */
|
|
15
|
+
export declare function pickNextActiveWindowId(windows: {
|
|
16
|
+
id: string;
|
|
17
|
+
type: string;
|
|
18
|
+
}[], storageKeyPrefix: string, workspaceId: string): string | null;
|
|
19
|
+
//# sourceMappingURL=windowStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windowStorage.d.ts","sourceRoot":"","sources":["../../src/utils/windowStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI/C,6BAA6B;AAC7B,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,CA6B1E;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CA4C7B;AAED,wBAAgB,wBAAwB,CACtC,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,WAAW,GACjB,IAAI,CASN;AAED,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,IAAI,CAsCN;AAED,qBAAqB;AACrB,wBAAgB,sBAAsB,CACpC,OAAO,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,EACvC,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAsBf"}
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@liuman/react-workspace",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Zero-dependency React IDE-like multi-window workspace with tabs, floating windows, keyboard shortcuts, theming, and optional Ant Design integration",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/react-workspace.cjs",
|
|
7
|
+
"module": "./dist/react-workspace.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/react-workspace.js",
|
|
13
|
+
"require": "./dist/react-workspace.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./style.css": "./dist/react-workspace.css",
|
|
16
|
+
"./antd": {
|
|
17
|
+
"types": "./dist/integrations/antd.d.ts",
|
|
18
|
+
"import": "./dist/react-workspace-antd.js",
|
|
19
|
+
"require": "./dist/react-workspace-antd.cjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"**/*.css"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "vite build && tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
32
|
+
"build:demo": "vite build --config demo/vite.config.ts",
|
|
33
|
+
"dev:demo": "vite --config demo/vite.config.ts",
|
|
34
|
+
"type-check": "tsc --noEmit",
|
|
35
|
+
"prepublishOnly": "yarn build"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"react",
|
|
39
|
+
"workspace",
|
|
40
|
+
"multi-window",
|
|
41
|
+
"tabs",
|
|
42
|
+
"floating-window",
|
|
43
|
+
"ide",
|
|
44
|
+
"keyboard-shortcuts",
|
|
45
|
+
"zero-dependencies"
|
|
46
|
+
],
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "https://github.com/mxyg/react-workspace.git"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://mxyg.github.io/react-workspace/",
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/mxyg/react-workspace/issues"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": ">=18.0.0",
|
|
58
|
+
"react-dom": ">=18.0.0"
|
|
59
|
+
},
|
|
60
|
+
"peerDependenciesMeta": {
|
|
61
|
+
"react-router-dom": {
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"antd": {
|
|
65
|
+
"optional": true
|
|
66
|
+
},
|
|
67
|
+
"@ant-design/icons": {
|
|
68
|
+
"optional": true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@ant-design/icons": "^5.6.1",
|
|
73
|
+
"@types/react": "^18.3.24",
|
|
74
|
+
"@types/react-dom": "^18.3.7",
|
|
75
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
76
|
+
"antd": "^5.24.0",
|
|
77
|
+
"react": "^18.3.1",
|
|
78
|
+
"react-dom": "^18.3.1",
|
|
79
|
+
"react-router-dom": "^7.8.2",
|
|
80
|
+
"typescript": "~5.8.3",
|
|
81
|
+
"vite": "^7.2.2",
|
|
82
|
+
"vite-plugin-dts": "^4.5.0"
|
|
83
|
+
}
|
|
84
|
+
}
|