@machete-jhun/canvas-studio 0.0.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.
Files changed (32) hide show
  1. package/README.md +157 -0
  2. package/dist/CanvasStudio.d.ts +46 -0
  3. package/dist/CanvasStudio.styles.d.ts +9 -0
  4. package/dist/components/AuxiliaryLines/AuxiliaryLine.d.ts +42 -0
  5. package/dist/components/AuxiliaryLines/index.d.ts +26 -0
  6. package/dist/components/BackScreen.d.ts +9 -0
  7. package/dist/components/BarCodeSvgKonva.d.ts +10 -0
  8. package/dist/components/ContextMenu/BaseMenu.d.ts +14 -0
  9. package/dist/components/ContextMenu/ContextMenuItem.d.ts +8 -0
  10. package/dist/components/ContextMenu/HelpLineMenu.d.ts +8 -0
  11. package/dist/components/ContextMenu/index.d.ts +16 -0
  12. package/dist/components/Geometry.d.ts +16 -0
  13. package/dist/components/GroupTransformerGeometry.d.ts +14 -0
  14. package/dist/components/ImageKonva.d.ts +8 -0
  15. package/dist/components/QrCodeSvgKonva.d.ts +8 -0
  16. package/dist/components/RiveKonva.d.ts +24 -0
  17. package/dist/components/StageMouseControl.d.ts +19 -0
  18. package/dist/components/SvgImageKonva.d.ts +10 -0
  19. package/dist/components/VideoKonva.d.ts +23 -0
  20. package/dist/components/index.d.ts +7 -0
  21. package/dist/constants/index.d.ts +31 -0
  22. package/dist/index.d.ts +6 -0
  23. package/dist/index.js +25 -0
  24. package/dist/types/index.d.ts +4 -0
  25. package/dist/types/shapeTypes.d.ts +119 -0
  26. package/dist/utils/enableDragBackground.d.ts +8 -0
  27. package/dist/utils/enableDragStage.d.ts +6 -0
  28. package/dist/utils/enableKeyboardShortcuts.d.ts +10 -0
  29. package/dist/utils/enableZoomStage.d.ts +4 -0
  30. package/dist/utils/index.d.ts +21 -0
  31. package/dist/utils/shapeTools.d.ts +13 -0
  32. package/package.json +82 -0
package/README.md ADDED
@@ -0,0 +1,157 @@
1
+ # CanvasStudio 🎨
2
+
3
+ 基于 React + Konva 的轻量级 Canvas 画布编辑器组件
4
+
5
+ ## 特性
6
+
7
+ - 🎨 支持多种图形:矩形、椭圆、文本、图片、SVG、二维码、条形码
8
+ - 🖱️ 拖拽、缩放、旋转图形
9
+ - ⌨️ 键盘快捷键支持
10
+ - 📐 辅助线与对齐吸附
11
+ - 🔲 棋盘格/点阵背景
12
+ - 📏 标尺显示
13
+ - 💪 完整的 TypeScript 类型支持
14
+ - ⚡ 轻量级打包 (~33KB gzip: ~11KB)
15
+
16
+ ## 安装
17
+
18
+ ```bash
19
+ npm install canvas-studio
20
+ # 或
21
+ pnpm add canvas-studio
22
+ ```
23
+
24
+ ### Peer Dependencies
25
+
26
+ 需要同时安装以下依赖:
27
+
28
+ ```bash
29
+ npm install react react-dom konva react-konva react-konva-utils nanoid lodash-es js-base64 qrcode jsbarcode
30
+ ```
31
+
32
+ ## 基础使用
33
+
34
+ ```tsx
35
+ import { CanvasStudio, type CanvasStudioRef } from 'canvas-studio'
36
+ import { useRef } from 'react'
37
+
38
+ function App() {
39
+ const canvasRef = useRef<CanvasStudioRef>(null)
40
+
41
+ return (
42
+ <CanvasStudio
43
+ ref={canvasRef}
44
+ width={800}
45
+ height={600}
46
+ backgroundType="grid"
47
+ />
48
+ )
49
+ }
50
+ ```
51
+
52
+ ## Props
53
+
54
+ | 属性 | 类型 | 默认值 | 说明 |
55
+ |------|------|--------|------|
56
+ | `width` | `number` | `800` | 画布宽度 |
57
+ | `height` | `number` | `600` | 画布高度 |
58
+ | `shapeList` | `MyShapeConfig[]` | `[]` | 图形列表 |
59
+ | `bgShapeList` | `MyShapeConfig[]` | `[]` | 背景图形列表(锁定) |
60
+ | `backgroundType` | `'grid' \| 'point' \| 'none'` | `'grid'` | 背景类型 |
61
+ | `hideRuler` | `boolean` | `false` | 是否隐藏标尺 |
62
+ | `ppmm` | `number` | `1` | 每毫米像素数 |
63
+ | `className` | `string` | `''` | 自定义类名 |
64
+ | `onShapeListChange` | `(shapes: MyShapeConfig[]) => void` | - | 图形变化回调 |
65
+ | `onSelectedShapeIdsChange` | `(ids: string[]) => void` | - | 选中变化回调 |
66
+
67
+ ## Ref 方法
68
+
69
+ ```tsx
70
+ const canvasRef = useRef<CanvasStudioRef>(null)
71
+
72
+ // 获取 Konva Stage 实例
73
+ canvasRef.current?.getStage()
74
+
75
+ // 获取/设置选中图形
76
+ canvasRef.current?.getSelectedShapeIds()
77
+ canvasRef.current?.setSelectedShapeIds(['id1', 'id2'])
78
+
79
+ // 增删改图形
80
+ canvasRef.current?.addShapes([...shapes])
81
+ canvasRef.current?.removeShapes(['id1'])
82
+ canvasRef.current?.updateShape(shape)
83
+ canvasRef.current?.getShapeList()
84
+
85
+ // 适配内容
86
+ canvasRef.current?.fitToContent()
87
+ ```
88
+
89
+ ## 创建图形
90
+
91
+ ```tsx
92
+ import {
93
+ createRect,
94
+ createEllipse,
95
+ createText,
96
+ createImage,
97
+ createSvg,
98
+ createQrCode,
99
+ createBarCode,
100
+ copyShape,
101
+ } from 'canvas-studio'
102
+
103
+ // 创建矩形
104
+ const rect = createRect(100, 100, 200, 150, '#ff0000')
105
+
106
+ // 创建文本
107
+ const text = createText('Hello', 24, 'Arial', 'font-id', 'font-url', 100, 100)
108
+
109
+ // 创建图片
110
+ const image = createImage('https://...', 'image.png', '图片', 100, 100, 200, 200)
111
+
112
+ // 创建二维码
113
+ const qrcode = createQrCode('https://example.com', 100, 100, 150)
114
+
115
+ // 创建条形码
116
+ const barcode = createBarCode('123456789', 100, 100, 200, 80)
117
+
118
+ // 复制图形
119
+ const copiedShape = copyShape(rect)
120
+
121
+ // 添加到画布
122
+ canvasRef.current?.addShapes([rect, text, image])
123
+ ```
124
+
125
+ ## 导出的常量
126
+
127
+ ```tsx
128
+ import {
129
+ STAGE_CONTAINER_ID,
130
+ CUSTOMER_SHAPE_NAME,
131
+ BACKGROUND_SHAPE_NAME,
132
+ SHAPE_LAYER_NAME,
133
+ // ...
134
+ } from 'canvas-studio'
135
+ ```
136
+
137
+ ## 导出的工具函数
138
+
139
+ ```tsx
140
+ import {
141
+ isMac,
142
+ complementaryHexColor,
143
+ getPointerPosition,
144
+ getStageCenter,
145
+ getStageViewPortCenter,
146
+ } from 'canvas-studio'
147
+ ```
148
+
149
+ ### 扣绿幕
150
+ ffmpeg -i dragon_green_screen.mp4 -vf "chromakey=0x00FF00:0.15:0.1" -c:v libvpx-vp9 -pix_fmt yuva420p -b:v 5M output_transparent.webm
151
+ ### mov 转webm
152
+ ffmpeg -i 你的文件名.mov -c:v libvpx-vp9 -pix_fmt yuva420p output.webm
153
+ ## License
154
+
155
+ MIT
156
+
157
+
@@ -0,0 +1,46 @@
1
+ import Konva from 'konva';
2
+ import type { MyShapeConfig } from './types/shapeTypes';
3
+ export interface CanvasStudioProps {
4
+ /** 画布宽度 */
5
+ width?: number;
6
+ /** 画布高度 */
7
+ height?: number;
8
+ /** 图形列表 - 用户绘制的形状 */
9
+ shapeList?: MyShapeConfig[];
10
+ /** 背景图形列表 - 锁定的背景图层 */
11
+ bgShapeList?: MyShapeConfig[];
12
+ /** 当选中的图形ID变化时触发 */
13
+ onSelectedShapeIdsChange?: (ids: string[]) => void;
14
+ /** 当图形列表变化时触发 */
15
+ onShapeListChange?: (shapes: MyShapeConfig[]) => void;
16
+ /** 当背景图形列表变化时触发 */
17
+ onBgShapeListChange?: (shapes: MyShapeConfig[]) => void;
18
+ /** 自定义类名 */
19
+ className?: string;
20
+ /** 背景类型: 'grid' 棋盘 | 'point' 点阵 | 'none' 无背景 */
21
+ backgroundType?: 'grid' | 'point' | 'none';
22
+ /** 是否隐藏标尺 */
23
+ hideRuler?: boolean;
24
+ /** 每毫米像素数 (1 = px模式) */
25
+ ppmm?: number;
26
+ }
27
+ export interface CanvasStudioRef {
28
+ /** 获取Stage实例 */
29
+ getStage: () => Konva.Stage | null;
30
+ /** 获取当前选中的图形ID */
31
+ getSelectedShapeIds: () => string[];
32
+ /** 设置选中的图形ID */
33
+ setSelectedShapeIds: (ids: string[]) => void;
34
+ /** 添加图形 */
35
+ addShapes: (shapes: MyShapeConfig[]) => void;
36
+ /** 删除图形 */
37
+ removeShapes: (ids: string[]) => void;
38
+ /** 更新图形 */
39
+ updateShape: (shape: MyShapeConfig) => void;
40
+ /** 获取所有图形 */
41
+ getShapeList: () => MyShapeConfig[];
42
+ /** 居中缩放适配所有内容 */
43
+ fitToContent: () => void;
44
+ }
45
+ export declare const CanvasStudio: import("react").ForwardRefExoticComponent<CanvasStudioProps & import("react").RefAttributes<CanvasStudioRef>>;
46
+ export default CanvasStudio;
@@ -0,0 +1,9 @@
1
+ import type { CSSProperties } from 'react';
2
+ export declare const styles: {
3
+ wrapper: CSSProperties;
4
+ container: CSSProperties;
5
+ stage: CSSProperties;
6
+ };
7
+ export declare const getPointBackgroundStyle: (offsetX?: number, offsetY?: number, size?: number) => CSSProperties;
8
+ export declare const getGridBackgroundStyle: (offsetX?: number, offsetY?: number, size?: number, color?: string) => CSSProperties;
9
+ export declare const canvasStyle: CSSProperties;
@@ -0,0 +1,42 @@
1
+ export interface RulerDataParams {
2
+ x: number;
3
+ y: number;
4
+ width: number;
5
+ height: number;
6
+ scale: number;
7
+ strokeWidth: number;
8
+ ppmm: number;
9
+ total?: number;
10
+ }
11
+ export interface RulerNode {
12
+ x: number;
13
+ y: number;
14
+ tickMarkScale: number;
15
+ label: string;
16
+ }
17
+ export interface RulerDataResult {
18
+ path: string;
19
+ nodes: RulerNode[];
20
+ interval: number;
21
+ rect: {
22
+ x: number;
23
+ y: number;
24
+ width: number;
25
+ height: number;
26
+ };
27
+ }
28
+ export declare function getRulerData(params: RulerDataParams, type: 'V' | 'H', defaultInterval?: number): RulerDataResult;
29
+ export type AuxiliaryLineDefaultSetting = Pick<AuxiliaryLineType, 'color' | 'strokeWidth' | 'dashType'>;
30
+ export interface AuxiliaryLineType {
31
+ vertical: boolean;
32
+ x: number;
33
+ y: number;
34
+ draggable: boolean;
35
+ strokeWidth: number;
36
+ color?: string;
37
+ visible: boolean;
38
+ dashType?: 'solid' | 'dash1' | 'dash2';
39
+ absolute?: boolean;
40
+ length?: number;
41
+ }
42
+ export declare function getAuxiliaryLineDash(dashType: AuxiliaryLineType['dashType'], strokeWidth?: number): number[];
@@ -0,0 +1,26 @@
1
+ import Konva from 'konva';
2
+ import React from 'react';
3
+ import { type AuxiliaryLineDefaultSetting } from './AuxiliaryLine';
4
+ export interface AuxiliaryLinesProps {
5
+ stageIns: Konva.Stage | null;
6
+ /** 隐藏标尺 */
7
+ hideRuler?: boolean;
8
+ /** 每毫米像素数 (1 = px, 其他值 = mm) */
9
+ currentPpmm?: number;
10
+ /** 辅助线数据 JSON 字符串 */
11
+ auxiliaryData?: string;
12
+ /** 是否显示辅助线 */
13
+ auxiliaryVisible?: boolean;
14
+ /** 是否锁定辅助线 */
15
+ auxiliaryLock?: boolean;
16
+ /** 全局辅助线设置 */
17
+ globalAuxiliaryLineSettings?: AuxiliaryLineDefaultSetting;
18
+ /** 禁用辅助线功能 */
19
+ disableAuxiliary?: boolean;
20
+ }
21
+ export interface AuxiliaryLinesRef {
22
+ rulerReRender: (stage: Konva.Stage) => void;
23
+ calcHelpLine: () => void;
24
+ }
25
+ declare const AuxiliaryLines: React.ForwardRefExoticComponent<AuxiliaryLinesProps & React.RefAttributes<AuxiliaryLinesRef>>;
26
+ export default AuxiliaryLines;
@@ -0,0 +1,9 @@
1
+ import { Image } from 'react-konva';
2
+ import type { ComponentProps } from 'react';
3
+ type BackScreenProps = {
4
+ screenId: string;
5
+ onLoad?: () => void;
6
+ fill: string;
7
+ } & Omit<ComponentProps<typeof Image>, 'image'>;
8
+ declare const _default: import("react").ForwardRefExoticComponent<Omit<BackScreenProps, "ref"> & import("react").RefAttributes<import("konva/lib/shapes/Image").Image>>;
9
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import type { ComponentProps } from 'react';
2
+ import { Image as KonvaImage } from 'react-konva';
3
+ import type { MyBarCodeShape } from '../types/shapeTypes';
4
+ type BarCodeSvgKonvaProps = {
5
+ value: MyBarCodeShape;
6
+ onLoad?: () => void;
7
+ onShapeChange?: (shape: MyBarCodeShape) => void;
8
+ } & Omit<ComponentProps<typeof KonvaImage>, 'image'>;
9
+ declare const _default: import("react").ForwardRefExoticComponent<Omit<BarCodeSvgKonvaProps, "ref"> & import("react").RefAttributes<import("konva/lib/shapes/Image").Image>>;
10
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import type { FC, HTMLAttributes } from 'react';
2
+ import type Konva from 'konva';
3
+ import type { MyShapeConfig } from '../../types';
4
+ type BaseMenuProps = HTMLAttributes<HTMLDivElement> & {
5
+ target: Konva.Node;
6
+ shapeList: MyShapeConfig[];
7
+ closeMenu: () => void;
8
+ onUpdateShapeList: (shapes: MyShapeConfig[]) => void;
9
+ onSetSelectedIds: (ids: string[]) => void;
10
+ onDeleteShape: (id: string) => void;
11
+ onDuplicateShape: (shape: MyShapeConfig) => void;
12
+ };
13
+ declare const BaseMenu: FC<BaseMenuProps>;
14
+ export default BaseMenu;
@@ -0,0 +1,8 @@
1
+ import type { FC, HTMLAttributes, ReactNode } from 'react';
2
+ type ContextMenuItemProps = HTMLAttributes<HTMLDivElement> & {
3
+ icon?: ReactNode;
4
+ danger?: boolean;
5
+ disabled?: boolean;
6
+ };
7
+ declare const ContextMenuItem: FC<ContextMenuItemProps>;
8
+ export default ContextMenuItem;
@@ -0,0 +1,8 @@
1
+ import type { FC, HTMLAttributes } from 'react';
2
+ import type Konva from 'konva';
3
+ type HelpLineMenuProps = HTMLAttributes<HTMLDivElement> & {
4
+ target: Konva.Line | null;
5
+ closeMenu: () => void;
6
+ };
7
+ declare const HelpLineMenu: FC<HelpLineMenuProps>;
8
+ export default HelpLineMenu;
@@ -0,0 +1,16 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { Vector2d } from 'konva/lib/types';
3
+ export interface ContextMenuRef {
4
+ show: (position: Vector2d) => void;
5
+ close: () => void;
6
+ }
7
+ interface ContextMenuProps {
8
+ children: ReactNode;
9
+ containerWidth?: number;
10
+ containerHeight?: number;
11
+ }
12
+ declare const ContextMenu: import("react").ForwardRefExoticComponent<ContextMenuProps & import("react").RefAttributes<ContextMenuRef>>;
13
+ export default ContextMenu;
14
+ export { default as BaseMenu } from './BaseMenu';
15
+ export { default as HelpLineMenu } from './HelpLineMenu';
16
+ export { default as ContextMenuItem } from './ContextMenuItem';
@@ -0,0 +1,16 @@
1
+ import type { KonvaEventObject } from 'konva/lib/Node';
2
+ import { type KonvaNodeEvents } from 'react-konva';
3
+ import React from 'react';
4
+ import type { MyShapeConfig } from '../types/shapeTypes';
5
+ interface GeometryProps extends KonvaNodeEvents {
6
+ shapeProps: MyShapeConfig;
7
+ hideDelIcon?: boolean;
8
+ onSelect?: (evt: KonvaEventObject<Event>) => void;
9
+ onChange?: (config: MyShapeConfig) => void;
10
+ onDragStart?: (evt: KonvaEventObject<DragEvent>) => void;
11
+ onDragEnd?: (evt: KonvaEventObject<DragEvent>) => void;
12
+ onLoad?: (type?: string) => void;
13
+ onShapeChange?: (shape: MyShapeConfig) => void;
14
+ }
15
+ declare const _default: React.NamedExoticComponent<GeometryProps>;
16
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import Konva from 'konva';
2
+ import type { FC } from 'react';
3
+ import type { KonvaEventObject } from 'konva/lib/Node';
4
+ type TransformerGeometryProps = Konva.TransformerConfig & {
5
+ stageIns: Konva.Stage | undefined | null;
6
+ selectedShapeIds: string[] | undefined | null;
7
+ rotateEnabled?: boolean;
8
+ shaleSelector?: string;
9
+ enabledAnchor?: string[];
10
+ onTransformEnd?: (e: KonvaEventObject<Event>) => void;
11
+ onDragEnd?: (e: KonvaEventObject<Event>) => void;
12
+ };
13
+ declare const GroupTransformerGeometry: FC<TransformerGeometryProps>;
14
+ export default GroupTransformerGeometry;
@@ -0,0 +1,8 @@
1
+ import { Image } from 'react-konva';
2
+ import type { ComponentProps } from 'react';
3
+ type ImageKonvaProps = {
4
+ url: string;
5
+ onLoad?: () => void;
6
+ } & Omit<ComponentProps<typeof Image>, 'image'>;
7
+ declare const _default: import("react").ForwardRefExoticComponent<Omit<ImageKonvaProps, "ref"> & import("react").RefAttributes<import("konva/lib/shapes/Image").Image>>;
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { MyQrCodeShape } from '../types/shapeTypes';
2
+ type QrCodeSvgKonvaProps = {
3
+ value: MyQrCodeShape;
4
+ onLoad?: () => void;
5
+ onShapeChange?: (shape: MyQrCodeShape) => void;
6
+ };
7
+ declare const _default: import("react").ForwardRefExoticComponent<QrCodeSvgKonvaProps & import("react").RefAttributes<import("konva/lib/shapes/Image").Image>>;
8
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ type RiveInputItem = {
3
+ name: string;
4
+ type: 'number' | 'boolean' | 'color';
5
+ value: unknown;
6
+ bindName?: string;
7
+ };
8
+ type RiveKonvaProps = {
9
+ value: {
10
+ id: string;
11
+ url: string;
12
+ stateMachine: string;
13
+ artboard?: string;
14
+ width: number;
15
+ height: number;
16
+ x: number;
17
+ y: number;
18
+ inputs?: RiveInputItem[];
19
+ };
20
+ onLoad?: () => void;
21
+ variableObj: Record<string, unknown>;
22
+ };
23
+ declare const RiveKonva: React.ForwardRefExoticComponent<RiveKonvaProps & React.RefAttributes<import("konva/lib/shapes/Image").Image>>;
24
+ export default RiveKonva;
@@ -0,0 +1,19 @@
1
+ import type { FC, HTMLAttributes } from 'react';
2
+ import type Konva from 'konva';
3
+ import type { MyShapeConfig } from '../types';
4
+ export type StageMouseControlCallbacks = {
5
+ onSetActiveShapeIds: (ids: string[]) => void;
6
+ onAddActiveShapeId: (id: string) => void;
7
+ onRemoveActiveShapeId: (id: string) => void;
8
+ onUpdateShapeList: (shapes: MyShapeConfig[]) => void;
9
+ onDeleteShape: (id: string) => void;
10
+ onDuplicateShape: (shape: MyShapeConfig) => void;
11
+ };
12
+ type StageMouseControlProps = {
13
+ stageIns: Konva.Stage | null;
14
+ selectedShapeIds: string[];
15
+ shapeList: MyShapeConfig[];
16
+ callbacks: StageMouseControlCallbacks;
17
+ } & HTMLAttributes<HTMLElement>;
18
+ declare const StageMouseControl: FC<StageMouseControlProps>;
19
+ export default StageMouseControl;
@@ -0,0 +1,10 @@
1
+ type SvgImageKonvaProps = {
2
+ url: string;
3
+ colors?: {
4
+ origin: string;
5
+ target: string;
6
+ }[];
7
+ onLoad?: () => void;
8
+ };
9
+ declare const _default: import("react").ForwardRefExoticComponent<SvgImageKonvaProps & import("react").RefAttributes<import("konva/lib/shapes/Image").Image>>;
10
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import type { RemoveShapeProps } from '../types';
2
+ import type { ImageConfig } from 'konva/lib/Node';
3
+ declare const _default: import("react").ForwardRefExoticComponent<{
4
+ id: string;
5
+ rotation: number;
6
+ x: number;
7
+ y: number;
8
+ lock?: boolean;
9
+ name: string;
10
+ displayName: string;
11
+ opacity: number;
12
+ info?: Record<string, unknown>;
13
+ visible: boolean;
14
+ height?: number;
15
+ } & Required<Pick<import("konva/lib/Shape").ShapeConfig, import("..").RequestShapeProps>> & {
16
+ value: {
17
+ url: string;
18
+ playbackRate?: number;
19
+ loop?: boolean;
20
+ };
21
+ onLoad?: () => void;
22
+ } & Omit<ImageConfig, RemoveShapeProps> & import("react").RefAttributes<import("konva/lib/shapes/Image").Image>>;
23
+ export default _default;
@@ -0,0 +1,7 @@
1
+ export { default as Geometry } from './Geometry';
2
+ export { default as ImageKonva } from './ImageKonva';
3
+ export { default as SvgImageKonva } from './SvgImageKonva';
4
+ export { default as QrCodeSvgKonva } from './QrCodeSvgKonva';
5
+ export { default as BarCodeSvgKonva } from './BarCodeSvgKonva';
6
+ export { default as GroupTransformerGeometry } from './GroupTransformerGeometry';
7
+ export { default as StageMouseControl } from './StageMouseControl';
@@ -0,0 +1,31 @@
1
+ export declare const STAGE_CONTAINER_ID = "c0";
2
+ export declare const CUSTOMER_SHAPE_NAME = "c1";
3
+ export declare const BACKGROUND_SHAPE_NAME = "c2";
4
+ export declare const AREA_SHAPE_NAME = "c3";
5
+ export declare const DRAW_AREA_SHAPE_NAME = "c4";
6
+ export declare const SHAPE_LAYER_NAME = "c5";
7
+ export declare const SHAPE_GROUP = "c6";
8
+ export declare const BACKGROUND_LAYER_NAME = "c7";
9
+ export declare const DRAW_AREA_LAYER_NAME = "c8";
10
+ export declare const AUXILIARY_LAYER_NAME = "c9";
11
+ export declare const AUXILIARY_GROUP = "ca";
12
+ export declare const HELP_LINE_NAME = "cb";
13
+ export declare const SNAPPING_LINE_NAME = "cc";
14
+ export declare const RULER_RECT_V = "cd";
15
+ export declare const RULER_RECT_H = "ce";
16
+ export declare const SHAPE_TYPES: {
17
+ readonly IMAGE: "image";
18
+ readonly RECT: "rect";
19
+ readonly TEXT: "text";
20
+ readonly SVG: "svg";
21
+ readonly QR_CODE: "qr_code";
22
+ readonly BAR_CODE: "bar_code";
23
+ readonly RIVE: "rive";
24
+ readonly VIDEO: "video";
25
+ readonly BACK_SCREEN: "back_screen";
26
+ };
27
+ export declare const THEME_COLOR: {
28
+ active: string;
29
+ disable: string;
30
+ default: string;
31
+ };
@@ -0,0 +1,6 @@
1
+ export { CanvasStudio, type CanvasStudioProps, type CanvasStudioRef } from './CanvasStudio';
2
+ export { default } from './CanvasStudio';
3
+ export * from './types';
4
+ export * from './constants';
5
+ export * from './utils/shapeTools';
6
+ export { isMac, complementaryHexColor, getPointerPosition, getStageCenter, getStageViewPortCenter, } from './utils';