mce 0.30.0 → 0.31.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/index.d.ts +0 -1
- package/dist/index.js +1375 -1412
- package/dist/mixins/extensions.d.ts +1 -1
- package/dist/utils/imagePipeline.d.ts +4 -14
- package/package.json +1 -1
|
@@ -106,7 +106,7 @@ declare global {
|
|
|
106
106
|
/**
|
|
107
107
|
* 插件 / 宿主注册的图片处理管线(`image → image`,如描边/调色/抠图)。
|
|
108
108
|
* 数据只记录管线名与参数(`ImageFill.imagePipelines`),处理函数为运行时黑盒。
|
|
109
|
-
* 注册同 name
|
|
109
|
+
* 注册同 name 则覆盖。渲染端经引擎解析器烘焙;导出端把同款解析器注入各底层导出库自行烘焙。
|
|
110
110
|
*/
|
|
111
111
|
imagePipelines: Ref<ImagePipeline[]>;
|
|
112
112
|
registerImagePipeline: (pipeline: ImagePipeline) => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PipelineImage } from 'modern-idoc';
|
|
2
2
|
/**
|
|
3
3
|
* 图片处理管线(外部可注册):把图片像素处理成新的图片像素(`image → image`)。
|
|
4
4
|
*
|
|
5
|
-
* 数据只记录管线名与参数(`ImageFill.imagePipelines
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* 数据只记录管线名与参数(`ImageFill.imagePipelines`),处理函数为运行时注册的黑盒,
|
|
6
|
+
* 不入持久化数据。渲染端经引擎注入的解析器烘焙到运行时纹理;非渲染导出端(pdf/svg/pptx)
|
|
7
|
+
* 由各底层库经注入的同款解析器(`editor.resolveImagePipelines`)在自身嵌入图片时烘焙。
|
|
8
8
|
*/
|
|
9
9
|
export interface ImagePipeline {
|
|
10
10
|
/** 唯一名,对应数据 `imagePipelines[].name`。 */
|
|
@@ -14,13 +14,3 @@ export interface ImagePipeline {
|
|
|
14
14
|
/** 处理函数:接收图片像素 + 参数,返回处理后的像素,可异步。 */
|
|
15
15
|
process: (image: PipelineImage, params?: Record<string, any>) => PipelineImage | Promise<PipelineImage>;
|
|
16
16
|
}
|
|
17
|
-
type ImagePipelineResolver = (steps: ImagePipelineRef[], image: PipelineImage) => Promise<PipelineImage>;
|
|
18
|
-
/**
|
|
19
|
-
* 导出前物化:深度遍历文档,把所有带 `imagePipelines` 的图片填充跑一遍管线,
|
|
20
|
-
* 结果写回 `image`(PNG dataURI)并删除 `imagePipelines` 字段。这样数据解析类导出器
|
|
21
|
-
* (pdf/svg/pptx)只看到普通图片填充,无需各自实现管线逻辑,跨端一致。
|
|
22
|
-
*
|
|
23
|
-
* 注意:原地修改传入的 `doc`(导出链路里 `doc` 已是 `toJSON` 出的独立快照)。
|
|
24
|
-
*/
|
|
25
|
-
export declare function materializeImagePipelines(doc: any, resolve: ImagePipelineResolver): Promise<void>;
|
|
26
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.31.0",
|
|
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",
|