drawui-react 0.5.1 → 0.5.3
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/IMAGE_UPLOAD.md +205 -0
- package/README.md +41 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +1 -1
- package/dist/styles.css +167 -0
- package/package.json +10 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ToolType, Language, Shape, EditorData, Editor, ImageUploadOption, ExportFormat, ArrowStyle } from 'drawui-core';
|
|
2
|
+
import { ToolType, PageTheme, Language, Shape, EditorData, Editor, ImageUploadOption, ExportFormat, ArrowStyle } from 'drawui-core';
|
|
3
3
|
export { ToolType } from 'drawui-core';
|
|
4
4
|
|
|
5
5
|
interface CanvasBoardProps {
|
|
@@ -7,6 +7,10 @@ interface CanvasBoardProps {
|
|
|
7
7
|
className?: string;
|
|
8
8
|
/** 主题主色(选中态/手柄/强调色等),默认 #3b82f6 */
|
|
9
9
|
themeColor?: string;
|
|
10
|
+
/** 页面主题(画布背景/UI 色调),默认 'light' */
|
|
11
|
+
theme?: PageTheme;
|
|
12
|
+
/** 页面主题变化回调(未提供时组件内部自持状态) */
|
|
13
|
+
onThemeChange?: (theme: PageTheme) => void;
|
|
10
14
|
/** 界面语言,默认 'zh-CN' */
|
|
11
15
|
language?: Language;
|
|
12
16
|
/** 初始图形数据:传入后画布以此初始化,不再读写 localStorage */
|
|
@@ -22,13 +26,15 @@ interface CanvasBoardProps {
|
|
|
22
26
|
*/
|
|
23
27
|
imageUpload?: ImageUploadOption;
|
|
24
28
|
}
|
|
25
|
-
declare function CanvasBoard({ initialTool, className, themeColor, language, data, onChange, onReady, imageUpload, }: CanvasBoardProps): react.JSX.Element;
|
|
29
|
+
declare function CanvasBoard({ initialTool, className, themeColor, theme, onThemeChange, language, data, onChange, onReady, imageUpload, }: CanvasBoardProps): react.JSX.Element;
|
|
26
30
|
|
|
27
31
|
interface ToolbarProps {
|
|
28
32
|
activeTool: ToolType;
|
|
29
33
|
onToolChange: (tool: ToolType) => void;
|
|
30
34
|
showGrid: boolean;
|
|
31
35
|
onToggleGrid: () => void;
|
|
36
|
+
pageTheme?: PageTheme;
|
|
37
|
+
onPageThemeChange?: (theme: PageTheme) => void;
|
|
32
38
|
canUndo?: boolean;
|
|
33
39
|
canRedo?: boolean;
|
|
34
40
|
onUndo?: () => void;
|
|
@@ -51,6 +57,8 @@ interface ToolbarProps {
|
|
|
51
57
|
/** 新建箭头的默认样式(工具栏「箭头」下拉里展示/修改) */
|
|
52
58
|
arrowStyle?: ArrowStyle;
|
|
53
59
|
onArrowStyleChange?: (updates: Partial<ArrowStyle>) => void;
|
|
60
|
+
/** 拖拽/调整图形时临时隐藏整个工具条(避免遮挡拖拽目标);松手即恢复 */
|
|
61
|
+
hidden?: boolean;
|
|
54
62
|
}
|
|
55
63
|
declare const Toolbar: react.NamedExoticComponent<ToolbarProps>;
|
|
56
64
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ToolType, Language, Shape, EditorData, Editor, ImageUploadOption, ExportFormat, ArrowStyle } from 'drawui-core';
|
|
2
|
+
import { ToolType, PageTheme, Language, Shape, EditorData, Editor, ImageUploadOption, ExportFormat, ArrowStyle } from 'drawui-core';
|
|
3
3
|
export { ToolType } from 'drawui-core';
|
|
4
4
|
|
|
5
5
|
interface CanvasBoardProps {
|
|
@@ -7,6 +7,10 @@ interface CanvasBoardProps {
|
|
|
7
7
|
className?: string;
|
|
8
8
|
/** 主题主色(选中态/手柄/强调色等),默认 #3b82f6 */
|
|
9
9
|
themeColor?: string;
|
|
10
|
+
/** 页面主题(画布背景/UI 色调),默认 'light' */
|
|
11
|
+
theme?: PageTheme;
|
|
12
|
+
/** 页面主题变化回调(未提供时组件内部自持状态) */
|
|
13
|
+
onThemeChange?: (theme: PageTheme) => void;
|
|
10
14
|
/** 界面语言,默认 'zh-CN' */
|
|
11
15
|
language?: Language;
|
|
12
16
|
/** 初始图形数据:传入后画布以此初始化,不再读写 localStorage */
|
|
@@ -22,13 +26,15 @@ interface CanvasBoardProps {
|
|
|
22
26
|
*/
|
|
23
27
|
imageUpload?: ImageUploadOption;
|
|
24
28
|
}
|
|
25
|
-
declare function CanvasBoard({ initialTool, className, themeColor, language, data, onChange, onReady, imageUpload, }: CanvasBoardProps): react.JSX.Element;
|
|
29
|
+
declare function CanvasBoard({ initialTool, className, themeColor, theme, onThemeChange, language, data, onChange, onReady, imageUpload, }: CanvasBoardProps): react.JSX.Element;
|
|
26
30
|
|
|
27
31
|
interface ToolbarProps {
|
|
28
32
|
activeTool: ToolType;
|
|
29
33
|
onToolChange: (tool: ToolType) => void;
|
|
30
34
|
showGrid: boolean;
|
|
31
35
|
onToggleGrid: () => void;
|
|
36
|
+
pageTheme?: PageTheme;
|
|
37
|
+
onPageThemeChange?: (theme: PageTheme) => void;
|
|
32
38
|
canUndo?: boolean;
|
|
33
39
|
canRedo?: boolean;
|
|
34
40
|
onUndo?: () => void;
|
|
@@ -51,6 +57,8 @@ interface ToolbarProps {
|
|
|
51
57
|
/** 新建箭头的默认样式(工具栏「箭头」下拉里展示/修改) */
|
|
52
58
|
arrowStyle?: ArrowStyle;
|
|
53
59
|
onArrowStyleChange?: (updates: Partial<ArrowStyle>) => void;
|
|
60
|
+
/** 拖拽/调整图形时临时隐藏整个工具条(避免遮挡拖拽目标);松手即恢复 */
|
|
61
|
+
hidden?: boolean;
|
|
54
62
|
}
|
|
55
63
|
declare const Toolbar: react.NamedExoticComponent<ToolbarProps>;
|
|
56
64
|
|