mce 0.29.3 → 0.29.5

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.
@@ -8,6 +8,11 @@ declare global {
8
8
  polygon: [];
9
9
  star: [];
10
10
  }
11
+ /** 直线 / 箭头 / 画笔的绘制样式(描边色 + 线宽),由工具选项面板编辑。 */
12
+ interface DrawStyleConfig {
13
+ color: string;
14
+ width: number;
15
+ }
11
16
  }
12
17
  }
13
18
  declare const _default: import("..").Plugin;
@@ -5,5 +5,5 @@ declare global {
5
5
  }
6
6
  }
7
7
  }
8
- declare const _default: import("../plugin").Plugin;
8
+ declare const _default: import("..").Plugin;
9
9
  export default _default;
@@ -10,5 +10,7 @@ export interface ArrowPathOptions {
10
10
  endMarker?: ArrowMarker;
11
11
  roundValues?: boolean;
12
12
  }
13
+ export declare const TAPERED_ARROW_VERTEX_COUNT = 7;
14
+ export declare function getTaperedArrowPath(p1: Point, p2: Point, width: number): string;
13
15
  export declare function getArrowPath(p1: Point, p2: Point, options?: ArrowPathOptions): string;
14
16
  export {};
@@ -13,6 +13,7 @@ export * from './image';
13
13
  export * from './keyframes';
14
14
  export * from './line';
15
15
  export * from './lottie';
16
+ export * from './png';
16
17
  export * from './propsFactory';
17
18
  export * from './registry';
18
19
  export * from './remapTextSelection';
@@ -8,3 +8,4 @@ export interface LinePoint {
8
8
  }
9
9
  export declare function parseLineShape(el: Element2D): LineShapeInfo | null;
10
10
  export declare function getLineEndpoints(el: Element2D): [LinePoint, LinePoint] | null;
11
+ export declare function getTaperedArrowWidth(el: Element2D): number;
@@ -0,0 +1,10 @@
1
+ /** 单边 / 面积超过该值的 PNG 走直编码绕过 canvas(取桌面 Chrome 实测的 canvas 上限)。 */
2
+ export declare const MAX_CANVAS_SIDE = 16384;
3
+ export declare const MAX_CANVAS_AREA: number;
4
+ /** 当前环境是否支持绕过 canvas 的大图 PNG 编码(CompressionStream:Chrome80+/Safari16.4+/FF113+)。 */
5
+ export declare function supportsPngStream(): boolean;
6
+ /**
7
+ * 把 width×height 的 RGBA 像素编码为 PNG Blob(8 位、color type 6)。
8
+ * onProgress 回报逐行写入进度(0..1)。
9
+ */
10
+ export declare function rgbaToPngBlob(rgba: Uint8ClampedArray<ArrayBuffer> | Uint8Array<ArrayBuffer>, width: number, height: number, onProgress?: (progress: number) => void): Promise<Blob>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mce",
3
3
  "type": "module",
4
- "version": "0.29.3",
4
+ "version": "0.29.5",
5
5
  "description": "A headless infinite canvas editor framework built on WebGL rendering, supports exporting to image, video, and PPT. Only the ESM.",
6
6
  "author": "wxm",
7
7
  "license": "MIT",
@@ -60,7 +60,7 @@
60
60
  "@vueuse/core": "^14.3.0",
61
61
  "diff": "^9.0.0",
62
62
  "lodash-es": "^4.18.1",
63
- "modern-canvas": "^0.24.6",
63
+ "modern-canvas": "^0.24.10",
64
64
  "modern-font": "^0.6.1",
65
65
  "modern-idoc": "^0.12.1",
66
66
  "modern-text": "^2.0.9",