mce 0.28.1 → 0.29.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/components/Floatbar.vue.d.ts +1 -1
- package/dist/components/Scrollbars.vue.d.ts +1 -1
- package/dist/components/Selection.vue.d.ts +16 -16
- package/dist/components/shared/Cropper.vue.d.ts +2 -2
- package/dist/components/shared/Menu.vue.d.ts +1 -1
- package/dist/components/shared/Overlay.vue.d.ts +1 -1
- package/dist/components/shared/Tooltip.vue.d.ts +6 -6
- package/dist/components/shared/Transform.vue.d.ts +3 -3
- package/dist/composables/animationPresetsMenu.d.ts +9 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/overlay.d.ts +7 -7
- package/dist/crdt/YDoc.d.ts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5552 -5550
- package/dist/mixins/2.box.d.ts +14 -0
- package/dist/mixins/exporter.d.ts +14 -0
- package/dist/utils/base64.d.ts +7 -0
- package/dist/utils/components.d.ts +0 -5
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/registry.d.ts +11 -0
- package/dist/utils/source.d.ts +12 -0
- package/package.json +1 -1
package/dist/mixins/2.box.d.ts
CHANGED
|
@@ -9,6 +9,20 @@ declare global {
|
|
|
9
9
|
obbToDrawboardObb: (aabb: Obb2D) => Obb2D;
|
|
10
10
|
getAabb: (node: Node | Node[] | undefined, inTarget?: 'drawboard' | 'frame' | 'parent') => Aabb2D;
|
|
11
11
|
aabbToDrawboardAabb: (aabb: Aabb2D) => Aabb2D;
|
|
12
|
+
globalToDrawboard: (point: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
}) => {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
drawboardToGlobal: (point: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
}) => {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
};
|
|
12
26
|
viewportAabb: ComputedRef<Aabb2D>;
|
|
13
27
|
rootAabb: ComputedRef<Aabb2D>;
|
|
14
28
|
selectionAabb: ComputedRef<Aabb2D>;
|
|
@@ -15,6 +15,18 @@ declare global {
|
|
|
15
15
|
saveAs?: boolean | ((exported: any) => Blob);
|
|
16
16
|
handle: ExporterHandle;
|
|
17
17
|
}
|
|
18
|
+
interface RenderFramesOptions {
|
|
19
|
+
/** to('json') 的导出数据,需含 meta.startTime / meta.endTime。 */
|
|
20
|
+
data: any;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
/** 帧间隔(毫秒)。 */
|
|
24
|
+
step: number;
|
|
25
|
+
onFrame: (pixels: Uint8ClampedArray, info: {
|
|
26
|
+
duration: number;
|
|
27
|
+
progress: number;
|
|
28
|
+
}) => void | Promise<void>;
|
|
29
|
+
}
|
|
18
30
|
interface Editor {
|
|
19
31
|
exporters: Reactive<Map<string, Exporter>>;
|
|
20
32
|
registerExporter: (value: Exporter | Exporter[]) => void;
|
|
@@ -23,6 +35,8 @@ declare global {
|
|
|
23
35
|
to: <K extends keyof Exporters>(name: K, options?: ExportOptions) => Exporters[K];
|
|
24
36
|
exporting: Ref<boolean>;
|
|
25
37
|
exportProgress: Ref<number>;
|
|
38
|
+
/** 按 step 逐帧渲染时间轴并回调像素,供 gif/mp4 等视频导出复用。 */
|
|
39
|
+
renderFrames: (options: RenderFramesOptions) => Promise<void>;
|
|
26
40
|
}
|
|
27
41
|
}
|
|
28
42
|
}
|
|
@@ -20,11 +20,6 @@ export type InstanceOverrides = Record<string, any>;
|
|
|
20
20
|
* (addElement 的 regenId 只清顶层 id,子节点 id 会冲突。)
|
|
21
21
|
*/
|
|
22
22
|
export declare function stripNodeIds<T>(node: T): T;
|
|
23
|
-
/**
|
|
24
|
-
* 按 path → value 应用一组覆盖。返回新对象,不改输入。
|
|
25
|
-
* 值为普通对象时与原值**深合并**(便于只覆盖 `style` 的部分字段而不丢其余);
|
|
26
|
-
* 基本类型 / 数组则整值替换。
|
|
27
|
-
*/
|
|
28
23
|
export declare function applyOverrides<T>(node: T, overrides?: InstanceOverrides): T;
|
|
29
24
|
/**
|
|
30
25
|
* 从 master 定义实例化一份节点 JSON:先剥 id(保证新实例独立),再叠加 override。
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './animationPresets';
|
|
2
2
|
export * from './arrow';
|
|
3
|
+
export * from './base64';
|
|
3
4
|
export * from './box';
|
|
4
5
|
export * from './components';
|
|
5
6
|
export * from './console';
|
|
@@ -12,8 +13,10 @@ export * from './image';
|
|
|
12
13
|
export * from './keyframes';
|
|
13
14
|
export * from './lottie';
|
|
14
15
|
export * from './propsFactory';
|
|
16
|
+
export * from './registry';
|
|
15
17
|
export * from './remapTextSelection';
|
|
16
18
|
export * from './saveAs';
|
|
19
|
+
export * from './source';
|
|
17
20
|
export * from './transform';
|
|
18
21
|
export * from './traverse';
|
|
19
22
|
export * from './variables';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Reactive } from 'vue';
|
|
2
|
+
export interface MapRegistry<T> {
|
|
3
|
+
map: Reactive<Map<string, T>>;
|
|
4
|
+
register: (value: T | T[]) => void;
|
|
5
|
+
unregister: (key: string) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 创建一个以字符串为键的响应式注册表。
|
|
9
|
+
* 统一「reactive(Map) + 数组展平 register + delete unregister」样板。
|
|
10
|
+
*/
|
|
11
|
+
export declare function createMapRegistry<T>(keyFn: (item: T) => string): MapRegistry<T>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface MatchSourceOptions {
|
|
2
|
+
/** 文件名扩展名匹配(针对 File)。 */
|
|
3
|
+
ext?: RegExp;
|
|
4
|
+
/** MIME 前缀匹配(针对 Blob/File,命中任一即可)。 */
|
|
5
|
+
mime?: string | string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 生成 loader 的 `test` 谓词,统一各导入插件中重复的 `instanceof File/Blob` + 扩展名/MIME 判定。
|
|
9
|
+
* - File:先按扩展名匹配,再回退 MIME 前缀;
|
|
10
|
+
* - 其它 Blob:按 MIME 前缀匹配。
|
|
11
|
+
*/
|
|
12
|
+
export declare function matchSource(options: MatchSourceOptions): (source: any) => boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.29.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",
|