@bwp-web/canvas 0.8.2 → 0.9.0
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/context/CanvasRefContext.d.ts +17 -0
- package/dist/context/CanvasRefContext.d.ts.map +1 -0
- package/dist/context/EditCanvasContext.d.ts +53 -5
- package/dist/context/EditCanvasContext.d.ts.map +1 -1
- package/dist/context/ViewCanvasContext.d.ts +53 -6
- package/dist/context/ViewCanvasContext.d.ts.map +1 -1
- package/dist/context/index.d.ts +5 -4
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/useCanvasRef.d.ts +15 -0
- package/dist/context/useCanvasRef.d.ts.map +1 -0
- package/dist/hooks/useCanvasClick.d.ts +14 -0
- package/dist/hooks/useCanvasClick.d.ts.map +1 -1
- package/dist/hooks/useCanvasEvents.d.ts +13 -0
- package/dist/hooks/useCanvasEvents.d.ts.map +1 -1
- package/dist/hooks/useCanvasTooltip.d.ts +13 -0
- package/dist/hooks/useCanvasTooltip.d.ts.map +1 -1
- package/dist/hooks/useEditCanvas.d.ts +28 -3
- package/dist/hooks/useEditCanvas.d.ts.map +1 -1
- package/dist/hooks/useViewCanvas.d.ts +22 -0
- package/dist/hooks/useViewCanvas.d.ts.map +1 -1
- package/dist/index.cjs +432 -171
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +417 -161
- package/dist/index.js.map +1 -1
- package/dist/overlay/FixedSizeContent.d.ts +1 -1
- package/dist/overlay/ObjectOverlay.d.ts +16 -3
- package/dist/overlay/ObjectOverlay.d.ts.map +1 -1
- package/dist/overlay/OverlayBadge.d.ts +1 -1
- package/dist/overlay/OverlayContent.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { Canvas as FabricCanvas } from 'fabric';
|
|
3
|
+
/**
|
|
4
|
+
* Shared context for the canvas ref. Provided by both
|
|
5
|
+
* {@link EditCanvasProvider} and {@link ViewCanvasProvider}.
|
|
6
|
+
*
|
|
7
|
+
* The value is a stable `RefObject` that never changes identity after
|
|
8
|
+
* mount, so consumers of this context will **not** re-render when
|
|
9
|
+
* canvas state (zoom, selection, etc.) changes.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CanvasRefContext: import("react").Context<RefObject<FabricCanvas | null> | null>;
|
|
12
|
+
/**
|
|
13
|
+
* Read `canvasRef` from the nearest {@link CanvasRefContext} provider.
|
|
14
|
+
* Returns `null` if no provider is present.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useCanvasRefContext(): RefObject<FabricCanvas | null> | null;
|
|
17
|
+
//# sourceMappingURL=CanvasRefContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanvasRefContext.d.ts","sourceRoot":"","sources":["../../src/context/CanvasRefContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAErD;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,gEAC+B,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,IAAI,CAE3E"}
|
|
@@ -2,6 +2,10 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
import { useEditCanvas, type UseEditCanvasOptions } from '../hooks/useEditCanvas';
|
|
3
3
|
/** The full return value of {@link useEditCanvas}, exposed via context. */
|
|
4
4
|
export type EditCanvasContextValue = ReturnType<typeof useEditCanvas>;
|
|
5
|
+
/** Viewport slice — changes on every zoom/scroll. */
|
|
6
|
+
export type EditCanvasViewportValue = Pick<EditCanvasContextValue, 'zoom' | 'viewport'>;
|
|
7
|
+
/** State slice — everything except canvasRef and viewport. */
|
|
8
|
+
export type EditCanvasStateValue = Omit<EditCanvasContextValue, 'canvasRef' | 'zoom' | 'viewport'>;
|
|
5
9
|
export interface EditCanvasProviderProps {
|
|
6
10
|
/** Options forwarded to the underlying {@link useEditCanvas} hook. */
|
|
7
11
|
options?: UseEditCanvasOptions;
|
|
@@ -11,13 +15,28 @@ export interface EditCanvasProviderProps {
|
|
|
11
15
|
* Calls {@link useEditCanvas} internally and provides the full canvas API
|
|
12
16
|
* to all descendants via React context.
|
|
13
17
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
18
|
+
* Internally splits state into three contexts (ref, viewport, state) so
|
|
19
|
+
* that helper hooks like {@link useCanvasRef} and components like
|
|
20
|
+
* {@link ObjectOverlay} do not re-render on unrelated state changes.
|
|
21
|
+
*
|
|
22
|
+
* Use {@link useEditCanvasContext} in any descendant to access the full
|
|
23
|
+
* combined value, or use the fine-grained hooks
|
|
24
|
+
* {@link useEditCanvasViewport} / {@link useEditCanvasState} for better
|
|
25
|
+
* performance.
|
|
26
|
+
*
|
|
27
|
+
* Descendant components can also use {@link ObjectOverlay},
|
|
28
|
+
* {@link useCanvasEvents}, {@link useCanvasTooltip}, and
|
|
29
|
+
* {@link useCanvasClick} without passing `canvasRef` explicitly — they
|
|
30
|
+
* read it from the nearest provider automatically.
|
|
17
31
|
*
|
|
18
32
|
* @example
|
|
19
33
|
* ```tsx
|
|
20
|
-
* <EditCanvasProvider options={{
|
|
34
|
+
* <EditCanvasProvider options={{
|
|
35
|
+
* canvasData: savedJson,
|
|
36
|
+
* invertBackground: isDarkMode,
|
|
37
|
+
* trackChanges: true,
|
|
38
|
+
* history: true,
|
|
39
|
+
* }}>
|
|
21
40
|
* <MyCanvas />
|
|
22
41
|
* <MySidebar />
|
|
23
42
|
* <MyToolbar />
|
|
@@ -29,7 +48,7 @@ export interface EditCanvasProviderProps {
|
|
|
29
48
|
* }
|
|
30
49
|
*
|
|
31
50
|
* function MySidebar() {
|
|
32
|
-
* const { isDirty, resetDirty } =
|
|
51
|
+
* const { isDirty, resetDirty } = useEditCanvasState();
|
|
33
52
|
* return <SaveButton disabled={!isDirty} onClick={() => { save(); resetDirty(); }} />;
|
|
34
53
|
* }
|
|
35
54
|
* ```
|
|
@@ -39,7 +58,36 @@ export declare function EditCanvasProvider({ options, children, }: EditCanvasPro
|
|
|
39
58
|
* Access the full {@link useEditCanvas} API from any descendant of
|
|
40
59
|
* {@link EditCanvasProvider}.
|
|
41
60
|
*
|
|
61
|
+
* This subscribes to all three internal contexts, so the component will
|
|
62
|
+
* re-render on any state change. For better performance, prefer
|
|
63
|
+
* {@link useEditCanvasViewport} or {@link useEditCanvasState}.
|
|
64
|
+
*
|
|
42
65
|
* Throws if called outside of a provider.
|
|
43
66
|
*/
|
|
44
67
|
export declare function useEditCanvasContext(): EditCanvasContextValue;
|
|
68
|
+
/**
|
|
69
|
+
* Like {@link useEditCanvasContext} but returns `null` instead of throwing
|
|
70
|
+
* when called outside of an {@link EditCanvasProvider}.
|
|
71
|
+
*/
|
|
72
|
+
export declare function useEditCanvasContextSafe(): EditCanvasContextValue | null;
|
|
73
|
+
/**
|
|
74
|
+
* Access only the viewport slice (zoom level and viewport controls) from
|
|
75
|
+
* the nearest {@link EditCanvasProvider}.
|
|
76
|
+
*
|
|
77
|
+
* This subscribes only to viewport changes — the component will **not**
|
|
78
|
+
* re-render when selection, dirty state, or other non-viewport state changes.
|
|
79
|
+
*
|
|
80
|
+
* Throws if called outside of a provider.
|
|
81
|
+
*/
|
|
82
|
+
export declare function useEditCanvasViewport(): EditCanvasViewportValue;
|
|
83
|
+
/**
|
|
84
|
+
* Access only the non-viewport state slice from the nearest
|
|
85
|
+
* {@link EditCanvasProvider}.
|
|
86
|
+
*
|
|
87
|
+
* This subscribes only to state changes (selection, dirty, history, etc.) —
|
|
88
|
+
* the component will **not** re-render on zoom/scroll changes.
|
|
89
|
+
*
|
|
90
|
+
* Throws if called outside of a provider.
|
|
91
|
+
*/
|
|
92
|
+
export declare function useEditCanvasState(): EditCanvasStateValue;
|
|
45
93
|
//# sourceMappingURL=EditCanvasContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditCanvasContext.d.ts","sourceRoot":"","sources":["../../src/context/EditCanvasContext.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"EditCanvasContext.d.ts","sourceRoot":"","sources":["../../src/context/EditCanvasContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAGhC,2EAA2E;AAC3E,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAEtE,qDAAqD;AACrD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,sBAAsB,EACtB,MAAM,GAAG,UAAU,CACpB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,sBAAsB,EACtB,WAAW,GAAG,MAAM,GAAG,UAAU,CAClC,CAAC;AAOF,MAAM,WAAW,uBAAuB;IACtC,sEAAsE;IACtE,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,QAAQ,GACT,EAAE,uBAAuB,2CAkDzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,sBAAsB,CAe7D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,sBAAsB,GAAG,IAAI,CAcxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,IAAI,uBAAuB,CAQ/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,oBAAoB,CAQzD"}
|
|
@@ -2,6 +2,10 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
import { useViewCanvas, type UseViewCanvasOptions } from '../hooks/useViewCanvas';
|
|
3
3
|
/** The full return value of {@link useViewCanvas}, exposed via context. */
|
|
4
4
|
export type ViewCanvasContextValue = ReturnType<typeof useViewCanvas>;
|
|
5
|
+
/** Viewport slice — changes on every zoom/scroll. */
|
|
6
|
+
export type ViewCanvasViewportValue = Pick<ViewCanvasContextValue, 'zoom' | 'viewport'>;
|
|
7
|
+
/** State slice — everything except canvasRef and viewport. */
|
|
8
|
+
export type ViewCanvasStateValue = Omit<ViewCanvasContextValue, 'canvasRef' | 'zoom' | 'viewport'>;
|
|
5
9
|
export interface ViewCanvasProviderProps {
|
|
6
10
|
/** Options forwarded to the underlying {@link useViewCanvas} hook. */
|
|
7
11
|
options?: UseViewCanvasOptions;
|
|
@@ -11,24 +15,38 @@ export interface ViewCanvasProviderProps {
|
|
|
11
15
|
* Calls {@link useViewCanvas} internally and provides the full canvas API
|
|
12
16
|
* to all descendants via React context.
|
|
13
17
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
18
|
+
* Internally splits state into three contexts (ref, viewport, state) so
|
|
19
|
+
* that helper hooks like {@link useCanvasRef} and components like
|
|
20
|
+
* {@link ObjectOverlay} do not re-render on unrelated state changes.
|
|
21
|
+
*
|
|
22
|
+
* Use {@link useViewCanvasContext} in any descendant to access the full
|
|
23
|
+
* combined value, or use the fine-grained hooks
|
|
24
|
+
* {@link useViewCanvasViewport} / {@link useViewCanvasState} for better
|
|
25
|
+
* performance.
|
|
26
|
+
*
|
|
27
|
+
* Descendant components can also use {@link ObjectOverlay},
|
|
28
|
+
* {@link useCanvasEvents}, {@link useCanvasTooltip}, and
|
|
29
|
+
* {@link useCanvasClick} without passing `canvasRef` explicitly — they
|
|
30
|
+
* read it from the nearest provider automatically.
|
|
17
31
|
*
|
|
18
32
|
* @example
|
|
19
33
|
* ```tsx
|
|
20
|
-
* <ViewCanvasProvider options={{
|
|
34
|
+
* <ViewCanvasProvider options={{
|
|
35
|
+
* canvasData: savedJson,
|
|
36
|
+
* invertBackground: isDarkMode,
|
|
37
|
+
* scaledStrokes: true,
|
|
38
|
+
* }}>
|
|
21
39
|
* <MyCanvas />
|
|
22
40
|
* <MyToolbar />
|
|
23
41
|
* </ViewCanvasProvider>
|
|
24
42
|
*
|
|
25
43
|
* function MyCanvas() {
|
|
26
|
-
* const { onReady } = useViewCanvasContext();
|
|
44
|
+
* const { onReady, objects, isLoading } = useViewCanvasContext();
|
|
27
45
|
* return <Canvas onReady={onReady} />;
|
|
28
46
|
* }
|
|
29
47
|
*
|
|
30
48
|
* function MyToolbar() {
|
|
31
|
-
* const { viewport } =
|
|
49
|
+
* const { viewport } = useViewCanvasViewport();
|
|
32
50
|
* return <ZoomControls onZoomIn={viewport.zoomIn} onZoomOut={viewport.zoomOut} />;
|
|
33
51
|
* }
|
|
34
52
|
* ```
|
|
@@ -38,7 +56,36 @@ export declare function ViewCanvasProvider({ options, children, }: ViewCanvasPro
|
|
|
38
56
|
* Access the full {@link useViewCanvas} API from any descendant of
|
|
39
57
|
* {@link ViewCanvasProvider}.
|
|
40
58
|
*
|
|
59
|
+
* This subscribes to all three internal contexts, so the component will
|
|
60
|
+
* re-render on any state change. For better performance, prefer
|
|
61
|
+
* {@link useViewCanvasViewport} or {@link useViewCanvasState}.
|
|
62
|
+
*
|
|
41
63
|
* Throws if called outside of a provider.
|
|
42
64
|
*/
|
|
43
65
|
export declare function useViewCanvasContext(): ViewCanvasContextValue;
|
|
66
|
+
/**
|
|
67
|
+
* Like {@link useViewCanvasContext} but returns `null` instead of throwing
|
|
68
|
+
* when called outside of a {@link ViewCanvasProvider}.
|
|
69
|
+
*/
|
|
70
|
+
export declare function useViewCanvasContextSafe(): ViewCanvasContextValue | null;
|
|
71
|
+
/**
|
|
72
|
+
* Access only the viewport slice (zoom level and viewport controls) from
|
|
73
|
+
* the nearest {@link ViewCanvasProvider}.
|
|
74
|
+
*
|
|
75
|
+
* This subscribes only to viewport changes — the component will **not**
|
|
76
|
+
* re-render when objects or loading state changes.
|
|
77
|
+
*
|
|
78
|
+
* Throws if called outside of a provider.
|
|
79
|
+
*/
|
|
80
|
+
export declare function useViewCanvasViewport(): ViewCanvasViewportValue;
|
|
81
|
+
/**
|
|
82
|
+
* Access only the non-viewport state slice from the nearest
|
|
83
|
+
* {@link ViewCanvasProvider}.
|
|
84
|
+
*
|
|
85
|
+
* This subscribes only to state changes (objects, loading, etc.) —
|
|
86
|
+
* the component will **not** re-render on zoom/scroll changes.
|
|
87
|
+
*
|
|
88
|
+
* Throws if called outside of a provider.
|
|
89
|
+
*/
|
|
90
|
+
export declare function useViewCanvasState(): ViewCanvasStateValue;
|
|
44
91
|
//# sourceMappingURL=ViewCanvasContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewCanvasContext.d.ts","sourceRoot":"","sources":["../../src/context/ViewCanvasContext.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ViewCanvasContext.d.ts","sourceRoot":"","sources":["../../src/context/ViewCanvasContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAGhC,2EAA2E;AAC3E,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAEtE,qDAAqD;AACrD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,sBAAsB,EACtB,MAAM,GAAG,UAAU,CACpB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,sBAAsB,EACtB,WAAW,GAAG,MAAM,GAAG,UAAU,CAClC,CAAC;AAOF,MAAM,WAAW,uBAAuB;IACtC,sEAAsE;IACtE,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,QAAQ,GACT,EAAE,uBAAuB,2CA+BzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,sBAAsB,CAe7D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,sBAAsB,GAAG,IAAI,CAcxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,IAAI,uBAAuB,CAQ/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,oBAAoB,CAQzD"}
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { EditCanvasProvider, useEditCanvasContext } from './EditCanvasContext';
|
|
2
|
-
export type { EditCanvasProviderProps, EditCanvasContextValue, } from './EditCanvasContext';
|
|
3
|
-
export { ViewCanvasProvider, useViewCanvasContext } from './ViewCanvasContext';
|
|
4
|
-
export type { ViewCanvasProviderProps, ViewCanvasContextValue, } from './ViewCanvasContext';
|
|
1
|
+
export { EditCanvasProvider, useEditCanvasContext, useEditCanvasContextSafe, useEditCanvasViewport, useEditCanvasState, } from './EditCanvasContext';
|
|
2
|
+
export type { EditCanvasProviderProps, EditCanvasContextValue, EditCanvasViewportValue, EditCanvasStateValue, } from './EditCanvasContext';
|
|
3
|
+
export { ViewCanvasProvider, useViewCanvasContext, useViewCanvasContextSafe, useViewCanvasViewport, useViewCanvasState, } from './ViewCanvasContext';
|
|
4
|
+
export type { ViewCanvasProviderProps, ViewCanvasContextValue, ViewCanvasViewportValue, ViewCanvasStateValue, } from './ViewCanvasContext';
|
|
5
|
+
export { useCanvasRef } from './useCanvasRef';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import type { Canvas as FabricCanvas } from 'fabric';
|
|
3
|
+
/**
|
|
4
|
+
* Read `canvasRef` from the nearest {@link ViewCanvasProvider} or
|
|
5
|
+
* {@link EditCanvasProvider}.
|
|
6
|
+
*
|
|
7
|
+
* Returns `null` if neither provider is present in the tree.
|
|
8
|
+
*
|
|
9
|
+
* This hook reads from the shared {@link CanvasRefContext}, which holds a
|
|
10
|
+
* stable `RefObject` that never changes identity. Consumers of this hook
|
|
11
|
+
* will **not** re-render when canvas state (zoom, selection, etc.) changes
|
|
12
|
+
* — only when the provider mounts/unmounts.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useCanvasRef(): RefObject<FabricCanvas | null> | null;
|
|
15
|
+
//# sourceMappingURL=useCanvasRef.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCanvasRef.d.ts","sourceRoot":"","sources":["../../src/context/useCanvasRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGrD;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,IAAI,CAEpE"}
|
|
@@ -6,6 +6,20 @@ export interface UseCanvasClickOptions {
|
|
|
6
6
|
/** Maximum duration in milliseconds for the gesture to count as a click. Default: 300. */
|
|
7
7
|
maxDuration?: number;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Distinguish clicks from pan gestures on a canvas, using the `canvasRef`
|
|
11
|
+
* from the nearest {@link ViewCanvasProvider} or {@link EditCanvasProvider}.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* useCanvasClick((target) => {
|
|
16
|
+
* if (target?.data?.id) {
|
|
17
|
+
* navigate(`/locations/${target.data.id}`);
|
|
18
|
+
* }
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useCanvasClick(onClick: (target: FabricObject | undefined) => void, options?: UseCanvasClickOptions): void;
|
|
9
23
|
/**
|
|
10
24
|
* Distinguish clicks from pan gestures on a canvas.
|
|
11
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCanvasClick.d.ts","sourceRoot":"","sources":["../../src/hooks/useCanvasClick.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EACV,MAAM,IAAI,YAAY,EAEtB,YAAY,EACb,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"useCanvasClick.d.ts","sourceRoot":"","sources":["../../src/hooks/useCanvasClick.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EACV,MAAM,IAAI,YAAY,EAEtB,YAAY,EACb,MAAM,QAAQ,CAAC;AAGhB,MAAM,WAAW,qBAAqB;IACpC,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,KAAK,IAAI,EACnD,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAAC;AACR;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,EACzC,OAAO,EAAE,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,KAAK,IAAI,EACnD,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAAC"}
|
|
@@ -15,6 +15,19 @@ import type { Canvas as FabricCanvas, CanvasEvents } from 'fabric';
|
|
|
15
15
|
export type CanvasEventHandlers = {
|
|
16
16
|
[K in keyof CanvasEvents]?: (event: CanvasEvents[K]) => void;
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Subscribe to Fabric canvas events using the `canvasRef` from the nearest
|
|
20
|
+
* {@link ViewCanvasProvider} or {@link EditCanvasProvider}.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* useCanvasEvents({
|
|
25
|
+
* 'mouse:wheel': hideTooltip,
|
|
26
|
+
* 'object:moving': hideTooltip,
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function useCanvasEvents(events: CanvasEventHandlers): void;
|
|
18
31
|
/**
|
|
19
32
|
* Subscribe to Fabric canvas events with automatic cleanup.
|
|
20
33
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCanvasEvents.d.ts","sourceRoot":"","sources":["../../src/hooks/useCanvasEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"useCanvasEvents.d.ts","sourceRoot":"","sources":["../../src/hooks/useCanvasEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGnE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,mBAAmB,GAAG;KAC/B,CAAC,IAAI,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI;CAC7D,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;AACnE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,EACzC,MAAM,EAAE,mBAAmB,GAC1B,IAAI,CAAC"}
|
|
@@ -15,6 +15,19 @@ export interface CanvasTooltipState<T> {
|
|
|
15
15
|
y: number;
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Track mouse hover over canvas objects and return tooltip state, using the
|
|
20
|
+
* `canvasRef` from the nearest {@link ViewCanvasProvider} or
|
|
21
|
+
* {@link EditCanvasProvider}.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const tooltip = useCanvasTooltip({
|
|
26
|
+
* getContent: (obj) => obj.data ? { id: obj.data.id, type: obj.data.type } : null,
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function useCanvasTooltip<T>(options: UseCanvasTooltipOptions<T>): CanvasTooltipState<T>;
|
|
18
31
|
/**
|
|
19
32
|
* Track mouse hover over canvas objects and return tooltip state.
|
|
20
33
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCanvasTooltip.d.ts","sourceRoot":"","sources":["../../src/hooks/useCanvasTooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EACV,MAAM,IAAI,YAAY,EAEtB,YAAY,EACb,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"useCanvasTooltip.d.ts","sourceRoot":"","sources":["../../src/hooks/useCanvasTooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EACV,MAAM,IAAI,YAAY,EAEtB,YAAY,EACb,MAAM,QAAQ,CAAC;AAGhB,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,wFAAwF;IACxF,UAAU,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,CAAC,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,4EAA4E;IAC5E,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;IAClB,gFAAgF;IAChF,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAClC,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACzB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,SAAS,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,EACzC,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAClC,kBAAkB,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { type ObjectAlignmentOptions, type RotationSnapOptions } from '../alignm
|
|
|
4
4
|
import { type VertexEditOptions } from '../interactions';
|
|
5
5
|
import { type ResizeImageOptions } from '../background';
|
|
6
6
|
import { type HistoryOptions } from '../history';
|
|
7
|
-
import type { ModeSetup } from '../types';
|
|
7
|
+
import type { ModeSetup, CanvasJSON } from '../types';
|
|
8
8
|
export interface UseEditCanvasOptions {
|
|
9
9
|
/** Configure pan and zoom. Pass `false` to disable, or options to customize. Default: enabled. */
|
|
10
10
|
panAndZoom?: boolean | PanAndZoomOptions;
|
|
@@ -59,7 +59,7 @@ export interface UseEditCanvasOptions {
|
|
|
59
59
|
* Listens for `object:added`, `object:removed`, `object:modified`, and
|
|
60
60
|
* `background:modified` events. Call `resetDirty()` after a successful
|
|
61
61
|
* save to clear the flag, or `markDirty()` to set it manually.
|
|
62
|
-
* Default:
|
|
62
|
+
* Pass `false` to disable. Default: enabled.
|
|
63
63
|
*/
|
|
64
64
|
trackChanges?: boolean;
|
|
65
65
|
/**
|
|
@@ -73,6 +73,23 @@ export interface UseEditCanvasOptions {
|
|
|
73
73
|
* Default: disabled.
|
|
74
74
|
*/
|
|
75
75
|
history?: boolean | HistoryOptions;
|
|
76
|
+
/**
|
|
77
|
+
* Canvas data to load automatically after initialisation.
|
|
78
|
+
* When provided, `loadCanvas` is called internally before the user's
|
|
79
|
+
* `onReady` callback, and the resulting objects are available via the
|
|
80
|
+
* returned `objects` array.
|
|
81
|
+
*/
|
|
82
|
+
canvasData?: CanvasJSON | object;
|
|
83
|
+
/**
|
|
84
|
+
* Filter function for loaded objects. Passed to `loadCanvas` as
|
|
85
|
+
* `options.filter`. Only relevant when `canvasData` is provided.
|
|
86
|
+
*/
|
|
87
|
+
filter?: (obj: FabricObject) => boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Whether the background image should have an Invert filter applied.
|
|
90
|
+
* Reactive — changes are applied automatically without remounting.
|
|
91
|
+
*/
|
|
92
|
+
invertBackground?: boolean;
|
|
76
93
|
}
|
|
77
94
|
/**
|
|
78
95
|
* Hook that provides a batteries-included canvas experience with full
|
|
@@ -103,6 +120,10 @@ export declare function useEditCanvas(options?: UseEditCanvasOptions): {
|
|
|
103
120
|
canvasRef: import("react").RefObject<FabricCanvas | null>;
|
|
104
121
|
/** Current zoom level (reactive). */
|
|
105
122
|
zoom: number;
|
|
123
|
+
/** Loaded objects (reactive). Populated when `canvasData` is provided. */
|
|
124
|
+
objects: FabricObject<Partial<import("fabric").FabricObjectProps>, import("fabric").SerializedObjectProps, import("fabric").ObjectEvents>[];
|
|
125
|
+
/** Whether canvas data is currently being loaded. */
|
|
126
|
+
isLoading: boolean;
|
|
106
127
|
/** Currently selected objects (reactive). */
|
|
107
128
|
selected: FabricObject<Partial<import("fabric").FabricObjectProps>, import("fabric").SerializedObjectProps, import("fabric").ObjectEvents>[];
|
|
108
129
|
/** Viewport controls. */
|
|
@@ -151,7 +172,7 @@ export declare function useEditCanvas(options?: UseEditCanvasOptions): {
|
|
|
151
172
|
setBackground: (url: string, bgOpts?: {
|
|
152
173
|
preserveContrast?: boolean;
|
|
153
174
|
}) => Promise<import("fabric").FabricImage<Partial<import("fabric").ImageProps>, import("fabric").SerializedImageProps, import("fabric").ObjectEvents>>;
|
|
154
|
-
/** Whether the canvas has been modified since the last `resetDirty()` call.
|
|
175
|
+
/** Whether the canvas has been modified since the last `resetDirty()` call. Enabled by default (disable via `trackChanges: false`). */
|
|
155
176
|
isDirty: boolean;
|
|
156
177
|
/** Reset the dirty flag (e.g., after a successful save). */
|
|
157
178
|
resetDirty: () => void;
|
|
@@ -165,5 +186,9 @@ export declare function useEditCanvas(options?: UseEditCanvasOptions): {
|
|
|
165
186
|
canUndo: boolean;
|
|
166
187
|
/** Whether a redo operation is available (reactive). Requires `history: true`. */
|
|
167
188
|
canRedo: boolean;
|
|
189
|
+
/** Whether the canvas is locked to light mode. Read from loaded canvas data. */
|
|
190
|
+
lockLightMode: boolean | undefined;
|
|
191
|
+
/** Update lockLightMode on both the canvas instance and React state. */
|
|
192
|
+
setLockLightMode: (value: boolean) => void;
|
|
168
193
|
};
|
|
169
194
|
//# sourceMappingURL=useEditCanvas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditCanvas.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditCanvas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,KAAK,YAAY,EAAW,MAAM,QAAQ,CAAC;AAC5E,OAAO,EAEL,KAAK,iBAAiB,EAEtB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AAMrB,OAAO,EAEL,KAAK,sBAAsB,EAE3B,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"useEditCanvas.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditCanvas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,KAAK,YAAY,EAAW,MAAM,QAAQ,CAAC;AAC5E,OAAO,EAEL,KAAK,iBAAiB,EAEtB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AAMrB,OAAO,EAEL,KAAK,sBAAsB,EAE3B,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EAIL,KAAK,kBAAkB,EAExB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,cAAc,EAEp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;IAqXtD,8CAA8C;sBAnSvC,YAAY;IAqSnB,oDAAoD;;IAEpD,qCAAqC;;IAErC,0EAA0E;;IAE1E,qDAAqD;;IAErD,6CAA6C;;IAE7C,yBAAyB;;QAtFzB,wCAAwC;;QAExC,wDAAwD;wBAbjB,YAAY;QAenD,wFAAwF;;QAExF,2DAA2D;;QAE3D,0DAA0D;;QAE1D,uDAAuD;;QAEvD,6DAA6D;;;IA4E7D,+DAA+D;;IAE/D;;;;;;;;;;;;;;OAcG;qBA1W6B,SAAS,GAAG,IAAI;IA4WhD;;;;;;;OAOG;yBAnEO,MAAM,WAAW;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE;IAqEzD,uIAAuI;;IAEvI,4DAA4D;;IAE5D,oGAAoG;;IAEpG,sDAAsD;;IAEtD,iEAAiE;;IAEjE,mFAAmF;;IAEnF,kFAAkF;;IAElF,gFAAgF;;IAEhF,wEAAwE;8BAtJ/B,OAAO;EAwKrD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Canvas as FabricCanvas, type FabricObject } from 'fabric';
|
|
2
2
|
import { type PanAndZoomOptions } from '../viewport';
|
|
3
|
+
import type { CanvasJSON } from '../types';
|
|
3
4
|
/** Visual properties that can be updated on view-canvas objects. */
|
|
4
5
|
export interface ViewObjectStyle {
|
|
5
6
|
fill?: string;
|
|
@@ -30,6 +31,23 @@ export interface UseViewCanvasOptions {
|
|
|
30
31
|
* Pass a number to customize (default: 4), or `false` to disable.
|
|
31
32
|
*/
|
|
32
33
|
borderRadius?: number | false;
|
|
34
|
+
/**
|
|
35
|
+
* Canvas data to load automatically after initialisation.
|
|
36
|
+
* When provided, `loadCanvas` is called internally before the user's
|
|
37
|
+
* `onReady` callback, and the resulting objects are available via the
|
|
38
|
+
* returned `objects` array.
|
|
39
|
+
*/
|
|
40
|
+
canvasData?: CanvasJSON | object;
|
|
41
|
+
/**
|
|
42
|
+
* Filter function for loaded objects. Passed to `loadCanvas` as
|
|
43
|
+
* `options.filter`. Only relevant when `canvasData` is provided.
|
|
44
|
+
*/
|
|
45
|
+
filter?: (obj: FabricObject) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the background image should have an Invert filter applied.
|
|
48
|
+
* Reactive — changes are applied automatically without remounting.
|
|
49
|
+
*/
|
|
50
|
+
invertBackground?: boolean;
|
|
33
51
|
}
|
|
34
52
|
/**
|
|
35
53
|
* Hook that provides a view-only canvas experience.
|
|
@@ -52,6 +70,10 @@ export declare function useViewCanvas(options?: UseViewCanvasOptions): {
|
|
|
52
70
|
canvasRef: import("react").RefObject<FabricCanvas | null>;
|
|
53
71
|
/** Current zoom level (reactive). */
|
|
54
72
|
zoom: number;
|
|
73
|
+
/** Loaded objects (reactive). Populated when `canvasData` is provided. */
|
|
74
|
+
objects: FabricObject<Partial<import("fabric").FabricObjectProps>, import("fabric").SerializedObjectProps, import("fabric").ObjectEvents>[];
|
|
75
|
+
/** Whether canvas data is currently being loaded. */
|
|
76
|
+
isLoading: boolean;
|
|
55
77
|
/** Viewport controls. */
|
|
56
78
|
viewport: {
|
|
57
79
|
/** Reset viewport to default (no pan, zoom = 1), or fit to background if one is set. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useViewCanvas.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewCanvas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,aAAa,CAAC;AASrB,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,kG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