@drawo-app/drawo 2.0.17 → 2.0.19
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/drawo.css +1 -1
- package/dist/index.cjs +176 -189
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -17
- package/dist/index.d.ts +8 -17
- package/dist/index.js +21925 -23520
- package/dist/index.js.map +1 -1
- package/package.json +17 -8
package/dist/index.d.cts
CHANGED
|
@@ -7,7 +7,7 @@ export interface DrawoProps {
|
|
|
7
7
|
initialScene?: Scene;
|
|
8
8
|
onSceneChange?: (scene: Scene) => void;
|
|
9
9
|
tools?: Array<"select" | "pan" | "text" | "rectangle" | "circle" | "line" | "draw" | "image" | "laser">;
|
|
10
|
-
initialOpenTopbarPanel?: "
|
|
10
|
+
initialOpenTopbarPanel?: "sidebar" | null;
|
|
11
11
|
disablePersistence?: boolean;
|
|
12
12
|
disableKeyboardShortcuts?: boolean;
|
|
13
13
|
className?: string;
|
|
@@ -48,16 +48,12 @@ export interface DrawoTopBarProps {
|
|
|
48
48
|
left?: ReactNode;
|
|
49
49
|
/** Fully replace the right section content. When set, rightBefore/rightAfter are ignored. */
|
|
50
50
|
right?: ReactNode;
|
|
51
|
-
/** Content inserted before the default right items (
|
|
51
|
+
/** Content inserted before the default right items (SidebarLauncher). */
|
|
52
52
|
rightBefore?: ReactNode;
|
|
53
|
-
/** Content inserted after the default right items (
|
|
53
|
+
/** Content inserted after the default right items (SidebarLauncher). */
|
|
54
54
|
rightAfter?: ReactNode;
|
|
55
55
|
/** Show/hide the default MenuBar. Default: true */
|
|
56
56
|
showMenuBar?: boolean;
|
|
57
|
-
/** Show/hide the default Timer in the right section. Default: true */
|
|
58
|
-
showTimer?: boolean;
|
|
59
|
-
/** Show/hide the default MusicBar in the right section. Default: true */
|
|
60
|
-
showMusicBar?: boolean;
|
|
61
57
|
/** Show/hide the default Sidebar launcher in the right section. Default: true */
|
|
62
58
|
showSidebarLauncher?: boolean;
|
|
63
59
|
/** Extra props forwarded to the built-in MenuBar (only when showMenuBar=true) */
|
|
@@ -164,7 +160,7 @@ export interface DrawoContextValue {
|
|
|
164
160
|
messages: LocaleMessages;
|
|
165
161
|
interactionMode: "select" | "pan";
|
|
166
162
|
drawingTool: NewElementType | "laser" | null;
|
|
167
|
-
openTopbarPanel: "
|
|
163
|
+
openTopbarPanel: "sidebar" | null;
|
|
168
164
|
canUndo: boolean;
|
|
169
165
|
canRedo: boolean;
|
|
170
166
|
props: DrawoProps;
|
|
@@ -174,7 +170,7 @@ export interface DrawoContextValue {
|
|
|
174
170
|
dispatch: (action: { type: string;[key: string]: unknown }) => void;
|
|
175
171
|
setInteractionMode: (mode: "select" | "pan") => void;
|
|
176
172
|
setDrawingTool: (tool: NewElementType | "laser" | null) => void;
|
|
177
|
-
setOpenTopbarPanel: (panel: "
|
|
173
|
+
setOpenTopbarPanel: (panel: "sidebar" | null | ((prev: "sidebar" | null) => "sidebar" | null)) => void;
|
|
178
174
|
setLocale: (locale: "en_US" | "es_ES") => void;
|
|
179
175
|
undo: () => void;
|
|
180
176
|
redo: () => void;
|
|
@@ -258,7 +254,7 @@ export function DrawoUndoBar(): JSX.Element;
|
|
|
258
254
|
export function DrawoZoomBar(): JSX.Element;
|
|
259
255
|
export function DrawoEmptyState(props: DrawoEmptyStateProps): JSX.Element;
|
|
260
256
|
|
|
261
|
-
/** Default right-side content:
|
|
257
|
+
/** Default right-side content: SidebarLauncher. */
|
|
262
258
|
export function DefaultTopBarRight(): JSX.Element;
|
|
263
259
|
/** Default MenuBar wired to Drawo context. Accepts MenuBar slot props. */
|
|
264
260
|
export function DefaultMenuBar(props?: Omit<
|
|
@@ -273,16 +269,9 @@ export function DefaultMenuBar(props?: Omit<
|
|
|
273
269
|
| "onExportImage"
|
|
274
270
|
| "onOpenProject"
|
|
275
271
|
>): JSX.Element;
|
|
276
|
-
/** Default Timer wired to Drawo context. */
|
|
277
|
-
export function DefaultTimer(): JSX.Element;
|
|
278
|
-
/** Default MusicBar wired to Drawo context. */
|
|
279
|
-
export function DefaultMusicBar(): JSX.Element;
|
|
280
272
|
/** Default Sidebar launcher button wired to Drawo context. */
|
|
281
273
|
export function DefaultSidebarLauncher(): JSX.Element;
|
|
282
274
|
|
|
283
|
-
export function Timer(props: { isOpen: boolean; onOpenChange: (next: boolean) => void; messages: LocaleMessages }): JSX.Element;
|
|
284
|
-
export function MusicBar(props: { isOpen: boolean; onOpenChange: (next: boolean) => void; messages: LocaleMessages }): JSX.Element;
|
|
285
|
-
|
|
286
275
|
export function MenuBar(props: MenuBarProps): JSX.Element;
|
|
287
276
|
export function ToolBar(props: Record<string, unknown>): JSX.Element;
|
|
288
277
|
export function UndoBar(props: { canUndo: boolean; canRedo: boolean; onUndo: () => void; onRedo: () => void }): JSX.Element;
|
|
@@ -290,6 +279,8 @@ export function ZoomBar(props: { zoomPercent: number; canZoomOut: boolean; canZo
|
|
|
290
279
|
export function CanvasView(props: Record<string, unknown>): JSX.Element;
|
|
291
280
|
export function CanvasContextMenu(props: Record<string, unknown>): JSX.Element;
|
|
292
281
|
export function CanvasEmptyState(props: Record<string, unknown>): JSX.Element;
|
|
282
|
+
/** The library's own watermark logotype used as the default empty-state content. */
|
|
283
|
+
export function DefaultCanvasEmptyState(props: Record<string, unknown>): JSX.Element;
|
|
293
284
|
export function SelectionToolbar(props: Record<string, unknown>): JSX.Element;
|
|
294
285
|
export function SelectionTextControls(props: Record<string, unknown>): JSX.Element;
|
|
295
286
|
export function SelectionShapeControls(props: Record<string, unknown>): JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface DrawoProps {
|
|
|
7
7
|
initialScene?: Scene;
|
|
8
8
|
onSceneChange?: (scene: Scene) => void;
|
|
9
9
|
tools?: Array<"select" | "pan" | "text" | "rectangle" | "circle" | "line" | "draw" | "image" | "laser">;
|
|
10
|
-
initialOpenTopbarPanel?: "
|
|
10
|
+
initialOpenTopbarPanel?: "sidebar" | null;
|
|
11
11
|
disablePersistence?: boolean;
|
|
12
12
|
disableKeyboardShortcuts?: boolean;
|
|
13
13
|
className?: string;
|
|
@@ -48,16 +48,12 @@ export interface DrawoTopBarProps {
|
|
|
48
48
|
left?: ReactNode;
|
|
49
49
|
/** Fully replace the right section content. When set, rightBefore/rightAfter are ignored. */
|
|
50
50
|
right?: ReactNode;
|
|
51
|
-
/** Content inserted before the default right items (
|
|
51
|
+
/** Content inserted before the default right items (SidebarLauncher). */
|
|
52
52
|
rightBefore?: ReactNode;
|
|
53
|
-
/** Content inserted after the default right items (
|
|
53
|
+
/** Content inserted after the default right items (SidebarLauncher). */
|
|
54
54
|
rightAfter?: ReactNode;
|
|
55
55
|
/** Show/hide the default MenuBar. Default: true */
|
|
56
56
|
showMenuBar?: boolean;
|
|
57
|
-
/** Show/hide the default Timer in the right section. Default: true */
|
|
58
|
-
showTimer?: boolean;
|
|
59
|
-
/** Show/hide the default MusicBar in the right section. Default: true */
|
|
60
|
-
showMusicBar?: boolean;
|
|
61
57
|
/** Show/hide the default Sidebar launcher in the right section. Default: true */
|
|
62
58
|
showSidebarLauncher?: boolean;
|
|
63
59
|
/** Extra props forwarded to the built-in MenuBar (only when showMenuBar=true) */
|
|
@@ -164,7 +160,7 @@ export interface DrawoContextValue {
|
|
|
164
160
|
messages: LocaleMessages;
|
|
165
161
|
interactionMode: "select" | "pan";
|
|
166
162
|
drawingTool: NewElementType | "laser" | null;
|
|
167
|
-
openTopbarPanel: "
|
|
163
|
+
openTopbarPanel: "sidebar" | null;
|
|
168
164
|
canUndo: boolean;
|
|
169
165
|
canRedo: boolean;
|
|
170
166
|
props: DrawoProps;
|
|
@@ -174,7 +170,7 @@ export interface DrawoContextValue {
|
|
|
174
170
|
dispatch: (action: { type: string;[key: string]: unknown }) => void;
|
|
175
171
|
setInteractionMode: (mode: "select" | "pan") => void;
|
|
176
172
|
setDrawingTool: (tool: NewElementType | "laser" | null) => void;
|
|
177
|
-
setOpenTopbarPanel: (panel: "
|
|
173
|
+
setOpenTopbarPanel: (panel: "sidebar" | null | ((prev: "sidebar" | null) => "sidebar" | null)) => void;
|
|
178
174
|
setLocale: (locale: "en_US" | "es_ES") => void;
|
|
179
175
|
undo: () => void;
|
|
180
176
|
redo: () => void;
|
|
@@ -258,7 +254,7 @@ export function DrawoUndoBar(): JSX.Element;
|
|
|
258
254
|
export function DrawoZoomBar(): JSX.Element;
|
|
259
255
|
export function DrawoEmptyState(props: DrawoEmptyStateProps): JSX.Element;
|
|
260
256
|
|
|
261
|
-
/** Default right-side content:
|
|
257
|
+
/** Default right-side content: SidebarLauncher. */
|
|
262
258
|
export function DefaultTopBarRight(): JSX.Element;
|
|
263
259
|
/** Default MenuBar wired to Drawo context. Accepts MenuBar slot props. */
|
|
264
260
|
export function DefaultMenuBar(props?: Omit<
|
|
@@ -273,16 +269,9 @@ export function DefaultMenuBar(props?: Omit<
|
|
|
273
269
|
| "onExportImage"
|
|
274
270
|
| "onOpenProject"
|
|
275
271
|
>): JSX.Element;
|
|
276
|
-
/** Default Timer wired to Drawo context. */
|
|
277
|
-
export function DefaultTimer(): JSX.Element;
|
|
278
|
-
/** Default MusicBar wired to Drawo context. */
|
|
279
|
-
export function DefaultMusicBar(): JSX.Element;
|
|
280
272
|
/** Default Sidebar launcher button wired to Drawo context. */
|
|
281
273
|
export function DefaultSidebarLauncher(): JSX.Element;
|
|
282
274
|
|
|
283
|
-
export function Timer(props: { isOpen: boolean; onOpenChange: (next: boolean) => void; messages: LocaleMessages }): JSX.Element;
|
|
284
|
-
export function MusicBar(props: { isOpen: boolean; onOpenChange: (next: boolean) => void; messages: LocaleMessages }): JSX.Element;
|
|
285
|
-
|
|
286
275
|
export function MenuBar(props: MenuBarProps): JSX.Element;
|
|
287
276
|
export function ToolBar(props: Record<string, unknown>): JSX.Element;
|
|
288
277
|
export function UndoBar(props: { canUndo: boolean; canRedo: boolean; onUndo: () => void; onRedo: () => void }): JSX.Element;
|
|
@@ -290,6 +279,8 @@ export function ZoomBar(props: { zoomPercent: number; canZoomOut: boolean; canZo
|
|
|
290
279
|
export function CanvasView(props: Record<string, unknown>): JSX.Element;
|
|
291
280
|
export function CanvasContextMenu(props: Record<string, unknown>): JSX.Element;
|
|
292
281
|
export function CanvasEmptyState(props: Record<string, unknown>): JSX.Element;
|
|
282
|
+
/** The library's own watermark logotype used as the default empty-state content. */
|
|
283
|
+
export function DefaultCanvasEmptyState(props: Record<string, unknown>): JSX.Element;
|
|
293
284
|
export function SelectionToolbar(props: Record<string, unknown>): JSX.Element;
|
|
294
285
|
export function SelectionTextControls(props: Record<string, unknown>): JSX.Element;
|
|
295
286
|
export function SelectionShapeControls(props: Record<string, unknown>): JSX.Element;
|