@drawo-app/drawo 2.0.7 → 2.0.8
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/assets/html2canvas.esm-DXEQVQnt.js +5 -0
- package/dist/assets/index-C2UxGHff.js +247 -0
- package/dist/{drawo.css → assets/index-C8x8KD-Y.css} +1 -1
- package/dist/assets/index.es-Dqr-Y4Tn.js +5 -0
- package/dist/assets/jspdf.es.min-CkIPA4tF.js +79 -0
- package/dist/assets/purify.es-CovBOfck.js +2 -0
- package/dist/index.html +440 -0
- package/package.json +8 -15
- package/dist/index.cjs +0 -327
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -169
- package/dist/index.d.ts +0 -169
- package/dist/index.js +0 -59540
- package/dist/index.js.map +0 -1
package/dist/index.d.cts
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ReactNode, JSX } from "react";
|
|
2
|
-
|
|
3
|
-
export interface DrawoProps {
|
|
4
|
-
theme?: string;
|
|
5
|
-
colorScheme?: "light" | "dark";
|
|
6
|
-
locale?: "en_US" | "es_ES";
|
|
7
|
-
initialScene?: Scene;
|
|
8
|
-
onSceneChange?: (scene: Scene) => void;
|
|
9
|
-
tools?: Array<"select" | "pan" | "text" | "rectangle" | "circle" | "line" | "draw" | "image" | "laser">;
|
|
10
|
-
initialOpenTopbarPanel?: "music" | "timer" | "sidebar" | null;
|
|
11
|
-
disablePersistence?: boolean;
|
|
12
|
-
disableKeyboardShortcuts?: boolean;
|
|
13
|
-
className?: string;
|
|
14
|
-
style?: React.CSSProperties;
|
|
15
|
-
onExportProject?: () => void;
|
|
16
|
-
onExportImage?: (options: {
|
|
17
|
-
format: "png" | "jpg" | "svg" | "pdf";
|
|
18
|
-
qualityScale: number;
|
|
19
|
-
transparentBackground: boolean;
|
|
20
|
-
padding: number;
|
|
21
|
-
}) => Promise<void>;
|
|
22
|
-
onOpenProject?: (file: File) => Promise<void>;
|
|
23
|
-
onUndo?: () => void;
|
|
24
|
-
onRedo?: () => void;
|
|
25
|
-
onZoomIn?: () => void;
|
|
26
|
-
onZoomOut?: () => void;
|
|
27
|
-
onZoomReset?: () => void;
|
|
28
|
-
onInteractionModeChange?: (mode: "select" | "pan") => void;
|
|
29
|
-
onDrawingToolChange?: (tool: NewElementType | "laser" | null) => void;
|
|
30
|
-
onLocaleChange?: (locale: "en_US" | "es_ES") => void;
|
|
31
|
-
onThemeChange?: (theme: string, colorScheme: "light" | "dark") => void;
|
|
32
|
-
children?: ReactNode;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface Camera {
|
|
36
|
-
x: number;
|
|
37
|
-
y: number;
|
|
38
|
-
zoom: number;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface SceneSettings {
|
|
42
|
-
showGrid: boolean;
|
|
43
|
-
gridStyle: "dots" | "squares";
|
|
44
|
-
snapToGrid: boolean;
|
|
45
|
-
smartGuides: boolean;
|
|
46
|
-
quillDrawOptimizations: boolean;
|
|
47
|
-
gridSize: number;
|
|
48
|
-
theme: "light" | "dark" | "system";
|
|
49
|
-
colorScheme: string;
|
|
50
|
-
zenMode: boolean;
|
|
51
|
-
presentationMode: boolean;
|
|
52
|
-
drawDefaults: {
|
|
53
|
-
canvas: string;
|
|
54
|
-
drawStroke: string;
|
|
55
|
-
markerStroke: string;
|
|
56
|
-
quillStroke: string;
|
|
57
|
-
drawStrokeWidth: number;
|
|
58
|
-
markerStrokeWidth: number;
|
|
59
|
-
quillStrokeWidth: number;
|
|
60
|
-
};
|
|
61
|
-
shapeDefaults: {
|
|
62
|
-
fill: string;
|
|
63
|
-
stroke: string;
|
|
64
|
-
textColor: string;
|
|
65
|
-
lineStroke: string;
|
|
66
|
-
};
|
|
67
|
-
laserSettings: {
|
|
68
|
-
lifetime: number;
|
|
69
|
-
baseWidth: number;
|
|
70
|
-
minWidth: number;
|
|
71
|
-
shadow: boolean;
|
|
72
|
-
color: string;
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface SceneElement {
|
|
77
|
-
id: string;
|
|
78
|
-
type: string;
|
|
79
|
-
[key: string]: unknown;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface Scene {
|
|
83
|
-
elements: SceneElement[];
|
|
84
|
-
selectedId: string | null;
|
|
85
|
-
selectedIds: string[];
|
|
86
|
-
camera: Camera;
|
|
87
|
-
settings: SceneSettings;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export type NewElementType = "rectangle" | "circle" | "text" | "image" | "quill" | "draw" | "marker" | "line";
|
|
91
|
-
|
|
92
|
-
export interface LocaleMessages {
|
|
93
|
-
[key: string]: unknown;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface ResolvedTheme {
|
|
97
|
-
preset: {
|
|
98
|
-
strokeColors: readonly string[];
|
|
99
|
-
shapeColors: readonly [readonly string[], readonly string[]];
|
|
100
|
-
};
|
|
101
|
-
dataTheme: string;
|
|
102
|
-
isDark: boolean;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface DrawoContextValue {
|
|
106
|
-
scene: Scene;
|
|
107
|
-
resolvedTheme: ResolvedTheme;
|
|
108
|
-
isDarkMode: boolean;
|
|
109
|
-
isPresentationMode: boolean;
|
|
110
|
-
isZenMode: boolean;
|
|
111
|
-
locale: "en_US" | "es_ES";
|
|
112
|
-
messages: LocaleMessages;
|
|
113
|
-
interactionMode: "select" | "pan";
|
|
114
|
-
drawingTool: NewElementType | "laser" | null;
|
|
115
|
-
openTopbarPanel: "music" | "timer" | "sidebar" | null;
|
|
116
|
-
canUndo: boolean;
|
|
117
|
-
canRedo: boolean;
|
|
118
|
-
props: DrawoProps;
|
|
119
|
-
setScene: (updater: React.SetStateAction<Scene>) => void;
|
|
120
|
-
setSceneWithoutHistory: (updater: React.SetStateAction<Scene>) => void;
|
|
121
|
-
commitInteractionHistory: (before: Scene) => void;
|
|
122
|
-
dispatch: (action: { type: string; [key: string]: unknown }) => void;
|
|
123
|
-
setInteractionMode: (mode: "select" | "pan") => void;
|
|
124
|
-
setDrawingTool: (tool: NewElementType | "laser" | null) => void;
|
|
125
|
-
setOpenTopbarPanel: (panel: "music" | "timer" | "sidebar" | null | ((prev: "music" | "timer" | "sidebar" | null) => "music" | "timer" | "sidebar" | null)) => void;
|
|
126
|
-
setLocale: (locale: "en_US" | "es_ES") => void;
|
|
127
|
-
undo: () => void;
|
|
128
|
-
redo: () => void;
|
|
129
|
-
handlers: Record<string, (...args: unknown[]) => void>;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export type ExportImageFormat = "png" | "jpg" | "svg" | "pdf";
|
|
133
|
-
export type LibrarySvgAsset = { defaultWidth: number; defaultHeight: number; [key: string]: unknown };
|
|
134
|
-
export type LibraryCategoryId = string;
|
|
135
|
-
|
|
136
|
-
export function useDrawo(): DrawoContextValue;
|
|
137
|
-
export function DrawoProvider(props: DrawoProps & { children: ReactNode }): JSX.Element;
|
|
138
|
-
|
|
139
|
-
export const Drawo: React.FC<DrawoProps> & {
|
|
140
|
-
TopBar: React.FC<{ children?: ReactNode }>;
|
|
141
|
-
Canvas: React.FC;
|
|
142
|
-
ToolBar: React.FC;
|
|
143
|
-
UndoBar: React.FC;
|
|
144
|
-
ZoomBar: React.FC;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
export function DrawoTopBar(props: { children?: ReactNode }): JSX.Element;
|
|
148
|
-
export function DrawoCanvas(): JSX.Element;
|
|
149
|
-
export function DrawoToolBar(): JSX.Element;
|
|
150
|
-
export function DrawoUndoBar(): JSX.Element;
|
|
151
|
-
export function DrawoZoomBar(): JSX.Element;
|
|
152
|
-
|
|
153
|
-
export function Timer(props: { isOpen: boolean; onOpenChange: (next: boolean) => void; messages: LocaleMessages }): JSX.Element;
|
|
154
|
-
export function MusicBar(props: { isOpen: boolean; onOpenChange: (next: boolean) => void; messages: LocaleMessages }): JSX.Element;
|
|
155
|
-
|
|
156
|
-
export function MenuBar(props: Record<string, unknown>): JSX.Element;
|
|
157
|
-
export function ToolBar(props: Record<string, unknown>): JSX.Element;
|
|
158
|
-
export function UndoBar(props: { canUndo: boolean; canRedo: boolean; onUndo: () => void; onRedo: () => void }): JSX.Element;
|
|
159
|
-
export function ZoomBar(props: { zoomPercent: number; canZoomOut: boolean; canZoomIn: boolean; onZoomOut: () => void; onZoomIn: () => void; onZoomReset: () => void }): JSX.Element;
|
|
160
|
-
export function CanvasView(props: Record<string, unknown>): JSX.Element;
|
|
161
|
-
export function CanvasContextMenu(props: Record<string, unknown>): JSX.Element;
|
|
162
|
-
export function CanvasEmptyState(props: Record<string, unknown>): JSX.Element;
|
|
163
|
-
export function SelectionToolbar(props: Record<string, unknown>): JSX.Element;
|
|
164
|
-
export function SelectionTextControls(props: Record<string, unknown>): JSX.Element;
|
|
165
|
-
export function SelectionShapeControls(props: Record<string, unknown>): JSX.Element;
|
|
166
|
-
export function SelectionStrokeControls(props: Record<string, unknown>): JSX.Element;
|
|
167
|
-
export function SelectionImageControls(props: Record<string, unknown>): JSX.Element;
|
|
168
|
-
export function TextEditorOverlay(props: Record<string, unknown>): JSX.Element;
|
|
169
|
-
export function SearchLibrarySidebar(props: Record<string, unknown>): JSX.Element;
|
package/dist/index.d.ts
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ReactNode, JSX } from "react";
|
|
2
|
-
|
|
3
|
-
export interface DrawoProps {
|
|
4
|
-
theme?: string;
|
|
5
|
-
colorScheme?: "light" | "dark";
|
|
6
|
-
locale?: "en_US" | "es_ES";
|
|
7
|
-
initialScene?: Scene;
|
|
8
|
-
onSceneChange?: (scene: Scene) => void;
|
|
9
|
-
tools?: Array<"select" | "pan" | "text" | "rectangle" | "circle" | "line" | "draw" | "image" | "laser">;
|
|
10
|
-
initialOpenTopbarPanel?: "music" | "timer" | "sidebar" | null;
|
|
11
|
-
disablePersistence?: boolean;
|
|
12
|
-
disableKeyboardShortcuts?: boolean;
|
|
13
|
-
className?: string;
|
|
14
|
-
style?: React.CSSProperties;
|
|
15
|
-
onExportProject?: () => void;
|
|
16
|
-
onExportImage?: (options: {
|
|
17
|
-
format: "png" | "jpg" | "svg" | "pdf";
|
|
18
|
-
qualityScale: number;
|
|
19
|
-
transparentBackground: boolean;
|
|
20
|
-
padding: number;
|
|
21
|
-
}) => Promise<void>;
|
|
22
|
-
onOpenProject?: (file: File) => Promise<void>;
|
|
23
|
-
onUndo?: () => void;
|
|
24
|
-
onRedo?: () => void;
|
|
25
|
-
onZoomIn?: () => void;
|
|
26
|
-
onZoomOut?: () => void;
|
|
27
|
-
onZoomReset?: () => void;
|
|
28
|
-
onInteractionModeChange?: (mode: "select" | "pan") => void;
|
|
29
|
-
onDrawingToolChange?: (tool: NewElementType | "laser" | null) => void;
|
|
30
|
-
onLocaleChange?: (locale: "en_US" | "es_ES") => void;
|
|
31
|
-
onThemeChange?: (theme: string, colorScheme: "light" | "dark") => void;
|
|
32
|
-
children?: ReactNode;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface Camera {
|
|
36
|
-
x: number;
|
|
37
|
-
y: number;
|
|
38
|
-
zoom: number;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface SceneSettings {
|
|
42
|
-
showGrid: boolean;
|
|
43
|
-
gridStyle: "dots" | "squares";
|
|
44
|
-
snapToGrid: boolean;
|
|
45
|
-
smartGuides: boolean;
|
|
46
|
-
quillDrawOptimizations: boolean;
|
|
47
|
-
gridSize: number;
|
|
48
|
-
theme: "light" | "dark" | "system";
|
|
49
|
-
colorScheme: string;
|
|
50
|
-
zenMode: boolean;
|
|
51
|
-
presentationMode: boolean;
|
|
52
|
-
drawDefaults: {
|
|
53
|
-
canvas: string;
|
|
54
|
-
drawStroke: string;
|
|
55
|
-
markerStroke: string;
|
|
56
|
-
quillStroke: string;
|
|
57
|
-
drawStrokeWidth: number;
|
|
58
|
-
markerStrokeWidth: number;
|
|
59
|
-
quillStrokeWidth: number;
|
|
60
|
-
};
|
|
61
|
-
shapeDefaults: {
|
|
62
|
-
fill: string;
|
|
63
|
-
stroke: string;
|
|
64
|
-
textColor: string;
|
|
65
|
-
lineStroke: string;
|
|
66
|
-
};
|
|
67
|
-
laserSettings: {
|
|
68
|
-
lifetime: number;
|
|
69
|
-
baseWidth: number;
|
|
70
|
-
minWidth: number;
|
|
71
|
-
shadow: boolean;
|
|
72
|
-
color: string;
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface SceneElement {
|
|
77
|
-
id: string;
|
|
78
|
-
type: string;
|
|
79
|
-
[key: string]: unknown;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface Scene {
|
|
83
|
-
elements: SceneElement[];
|
|
84
|
-
selectedId: string | null;
|
|
85
|
-
selectedIds: string[];
|
|
86
|
-
camera: Camera;
|
|
87
|
-
settings: SceneSettings;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export type NewElementType = "rectangle" | "circle" | "text" | "image" | "quill" | "draw" | "marker" | "line";
|
|
91
|
-
|
|
92
|
-
export interface LocaleMessages {
|
|
93
|
-
[key: string]: unknown;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface ResolvedTheme {
|
|
97
|
-
preset: {
|
|
98
|
-
strokeColors: readonly string[];
|
|
99
|
-
shapeColors: readonly [readonly string[], readonly string[]];
|
|
100
|
-
};
|
|
101
|
-
dataTheme: string;
|
|
102
|
-
isDark: boolean;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface DrawoContextValue {
|
|
106
|
-
scene: Scene;
|
|
107
|
-
resolvedTheme: ResolvedTheme;
|
|
108
|
-
isDarkMode: boolean;
|
|
109
|
-
isPresentationMode: boolean;
|
|
110
|
-
isZenMode: boolean;
|
|
111
|
-
locale: "en_US" | "es_ES";
|
|
112
|
-
messages: LocaleMessages;
|
|
113
|
-
interactionMode: "select" | "pan";
|
|
114
|
-
drawingTool: NewElementType | "laser" | null;
|
|
115
|
-
openTopbarPanel: "music" | "timer" | "sidebar" | null;
|
|
116
|
-
canUndo: boolean;
|
|
117
|
-
canRedo: boolean;
|
|
118
|
-
props: DrawoProps;
|
|
119
|
-
setScene: (updater: React.SetStateAction<Scene>) => void;
|
|
120
|
-
setSceneWithoutHistory: (updater: React.SetStateAction<Scene>) => void;
|
|
121
|
-
commitInteractionHistory: (before: Scene) => void;
|
|
122
|
-
dispatch: (action: { type: string; [key: string]: unknown }) => void;
|
|
123
|
-
setInteractionMode: (mode: "select" | "pan") => void;
|
|
124
|
-
setDrawingTool: (tool: NewElementType | "laser" | null) => void;
|
|
125
|
-
setOpenTopbarPanel: (panel: "music" | "timer" | "sidebar" | null | ((prev: "music" | "timer" | "sidebar" | null) => "music" | "timer" | "sidebar" | null)) => void;
|
|
126
|
-
setLocale: (locale: "en_US" | "es_ES") => void;
|
|
127
|
-
undo: () => void;
|
|
128
|
-
redo: () => void;
|
|
129
|
-
handlers: Record<string, (...args: unknown[]) => void>;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export type ExportImageFormat = "png" | "jpg" | "svg" | "pdf";
|
|
133
|
-
export type LibrarySvgAsset = { defaultWidth: number; defaultHeight: number; [key: string]: unknown };
|
|
134
|
-
export type LibraryCategoryId = string;
|
|
135
|
-
|
|
136
|
-
export function useDrawo(): DrawoContextValue;
|
|
137
|
-
export function DrawoProvider(props: DrawoProps & { children: ReactNode }): JSX.Element;
|
|
138
|
-
|
|
139
|
-
export const Drawo: React.FC<DrawoProps> & {
|
|
140
|
-
TopBar: React.FC<{ children?: ReactNode }>;
|
|
141
|
-
Canvas: React.FC;
|
|
142
|
-
ToolBar: React.FC;
|
|
143
|
-
UndoBar: React.FC;
|
|
144
|
-
ZoomBar: React.FC;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
export function DrawoTopBar(props: { children?: ReactNode }): JSX.Element;
|
|
148
|
-
export function DrawoCanvas(): JSX.Element;
|
|
149
|
-
export function DrawoToolBar(): JSX.Element;
|
|
150
|
-
export function DrawoUndoBar(): JSX.Element;
|
|
151
|
-
export function DrawoZoomBar(): JSX.Element;
|
|
152
|
-
|
|
153
|
-
export function Timer(props: { isOpen: boolean; onOpenChange: (next: boolean) => void; messages: LocaleMessages }): JSX.Element;
|
|
154
|
-
export function MusicBar(props: { isOpen: boolean; onOpenChange: (next: boolean) => void; messages: LocaleMessages }): JSX.Element;
|
|
155
|
-
|
|
156
|
-
export function MenuBar(props: Record<string, unknown>): JSX.Element;
|
|
157
|
-
export function ToolBar(props: Record<string, unknown>): JSX.Element;
|
|
158
|
-
export function UndoBar(props: { canUndo: boolean; canRedo: boolean; onUndo: () => void; onRedo: () => void }): JSX.Element;
|
|
159
|
-
export function ZoomBar(props: { zoomPercent: number; canZoomOut: boolean; canZoomIn: boolean; onZoomOut: () => void; onZoomIn: () => void; onZoomReset: () => void }): JSX.Element;
|
|
160
|
-
export function CanvasView(props: Record<string, unknown>): JSX.Element;
|
|
161
|
-
export function CanvasContextMenu(props: Record<string, unknown>): JSX.Element;
|
|
162
|
-
export function CanvasEmptyState(props: Record<string, unknown>): JSX.Element;
|
|
163
|
-
export function SelectionToolbar(props: Record<string, unknown>): JSX.Element;
|
|
164
|
-
export function SelectionTextControls(props: Record<string, unknown>): JSX.Element;
|
|
165
|
-
export function SelectionShapeControls(props: Record<string, unknown>): JSX.Element;
|
|
166
|
-
export function SelectionStrokeControls(props: Record<string, unknown>): JSX.Element;
|
|
167
|
-
export function SelectionImageControls(props: Record<string, unknown>): JSX.Element;
|
|
168
|
-
export function TextEditorOverlay(props: Record<string, unknown>): JSX.Element;
|
|
169
|
-
export function SearchLibrarySidebar(props: Record<string, unknown>): JSX.Element;
|