mce 0.32.2 → 0.32.4
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/shared/Menu.vue.d.ts +7 -0
- package/dist/composables/icon.d.ts +16 -1
- package/dist/composables/node.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6415 -6248
- package/dist/mixins/4.3.element.d.ts +2 -0
- package/dist/mixins/extensions.d.ts +20 -6
- package/dist/plugins/doc.d.ts +2 -0
- package/dist/plugins/toolbelt.d.ts +1 -3
- package/dist/plugins/view.d.ts +2 -0
- package/dist/scene/Doc.d.ts +3 -1
- package/dist/typed-plugins.d.ts +0 -1
- package/package.json +4 -4
- package/dist/components/MadeWith.vue.d.ts +0 -3
- package/dist/plugins/madeWith.d.ts +0 -12
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Element2D } from 'modern-canvas';
|
|
2
2
|
import type { ImagePipeline as ImagePipelineRef, PipelineImage } from 'modern-idoc';
|
|
3
3
|
import type { Component, Ref } from 'vue';
|
|
4
|
+
import type { IconValue } from '../composables/icon';
|
|
4
5
|
import type { AnimationPreset, ImagePipeline } from '../utils';
|
|
5
6
|
declare global {
|
|
6
7
|
namespace Mce {
|
|
@@ -36,10 +37,21 @@ declare global {
|
|
|
36
37
|
icon?: string;
|
|
37
38
|
/** 是否激活(高亮)。渲染时调用,读响应式状态即可自动更新。 */
|
|
38
39
|
isActive?: () => boolean;
|
|
39
|
-
/**
|
|
40
|
-
handle
|
|
40
|
+
/** 点击处理(分隔线项可省略)。 */
|
|
41
|
+
handle?: () => void;
|
|
41
42
|
/** 放置在内置工具之前 / 之后(默认 after)。 */
|
|
42
43
|
placement?: 'before' | 'after';
|
|
44
|
+
/**
|
|
45
|
+
* 放入工具腰带「+」新建菜单(而非作为一级按钮)。有此类项时「+」菜单用它们
|
|
46
|
+
* (按当前模式过滤),否则回退到内置形状菜单。供 @mce/workflow 的新增节点使用。
|
|
47
|
+
*/
|
|
48
|
+
slot?: 'create';
|
|
49
|
+
/** slot='create' 时:限定仅某编辑模式显示(缺省则所有模式)。 */
|
|
50
|
+
mode?: string;
|
|
51
|
+
/** slot='create' 时:菜单项的快捷键提示(如 ⇧T)。 */
|
|
52
|
+
kbd?: string;
|
|
53
|
+
/** slot='create' 时:分隔线分组。 */
|
|
54
|
+
type?: 'divider';
|
|
43
55
|
}
|
|
44
56
|
interface Editor {
|
|
45
57
|
/** 选择重定向链。 */
|
|
@@ -75,8 +87,8 @@ declare global {
|
|
|
75
87
|
* 合并进 IconsSymbol 的 aliases,从而让 `$<name>` 可解析。供 @mce/table、@mce/chart
|
|
76
88
|
* 等把自己的图标随插件携带,核心图标集不再硬编码它们。
|
|
77
89
|
*/
|
|
78
|
-
icons: Ref<Record<string,
|
|
79
|
-
registerIcon: (name: string, path:
|
|
90
|
+
icons: Ref<Record<string, IconValue>>;
|
|
91
|
+
registerIcon: (name: string, path: IconValue) => void;
|
|
80
92
|
/**
|
|
81
93
|
* 插件注册的编辑模式(除核心 'canvas' 外,如 @mce/workflow 的 'workflow')。
|
|
82
94
|
* 菜单的模式切换项据此生成;模式 UI 由插件以 overlay 组件按 mode 自行条件渲染。
|
|
@@ -90,11 +102,13 @@ declare global {
|
|
|
90
102
|
statusbarItems: Ref<Component[]>;
|
|
91
103
|
registerStatusbarItem: (component: Component) => void;
|
|
92
104
|
/**
|
|
93
|
-
* 插件向工具腰带追加的一级按钮(如 @mce/comments
|
|
105
|
+
* 插件向工具腰带追加的一级按钮(如 @mce/comments 的评论工具)或「+」菜单创建项。
|
|
94
106
|
* Toolbelt 据此渲染,核心不再硬编码插件工具。
|
|
107
|
+
* `registerToolbeltItem` 返回移除函数;也可用 `unregisterToolbeltItem` 按引用移除。
|
|
95
108
|
*/
|
|
96
109
|
toolbeltItems: Ref<ToolbeltItem[]>;
|
|
97
|
-
registerToolbeltItem: (item: ToolbeltItem) => void;
|
|
110
|
+
registerToolbeltItem: (item: ToolbeltItem) => () => void;
|
|
111
|
+
unregisterToolbeltItem: (item: ToolbeltItem) => void;
|
|
98
112
|
/**
|
|
99
113
|
* 插件注册的动画预设(进入 / 退出 / 强调)。核心不内置任何预设——
|
|
100
114
|
* Timeline / Trackhead 的「添加动画」菜单据此生成,为空时不显示添加入口。
|
package/dist/plugins/doc.d.ts
CHANGED
|
@@ -5,10 +5,8 @@ declare global {
|
|
|
5
5
|
}
|
|
6
6
|
interface ToolbeltConfig {
|
|
7
7
|
visible: boolean;
|
|
8
|
-
/**
|
|
8
|
+
/** 停靠方向:上 / 下 / 左 / 右。左右为竖向排列。默认 bottom。 */
|
|
9
9
|
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
10
|
-
/** 沿停靠边的中心坐标(上 / 下 为 x、左 / 右 为 y,相对画板像素)。undefined 表示居中。 */
|
|
11
|
-
offset?: number;
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
12
|
}
|
package/dist/plugins/view.d.ts
CHANGED
package/dist/scene/Doc.d.ts
CHANGED
|
@@ -20,7 +20,9 @@ export declare class Doc extends Node {
|
|
|
20
20
|
protected _pendingYUpdates: Uint8Array[];
|
|
21
21
|
protected _pendingYOrigin: any;
|
|
22
22
|
protected _yFlushScheduled: boolean;
|
|
23
|
-
constructor(source?: Mce.DocumentSource
|
|
23
|
+
constructor(source?: Mce.DocumentSource, options?: {
|
|
24
|
+
name?: string;
|
|
25
|
+
});
|
|
24
26
|
/**
|
|
25
27
|
* 累积增量并安排一个 microtask 合并转发。
|
|
26
28
|
* - 零丢失:同步批次内的每条增量都进入缓冲,绝不丢弃(旧 throttle 会丢中间增量导致两端发散)。
|
package/dist/typed-plugins.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.32.
|
|
4
|
+
"version": "0.32.4",
|
|
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,10 +60,10 @@
|
|
|
60
60
|
"@vueuse/core": "^14.3.0",
|
|
61
61
|
"diff": "^9.0.0",
|
|
62
62
|
"lodash-es": "^4.18.1",
|
|
63
|
-
"modern-canvas": "^0.
|
|
64
|
-
"modern-font": "^0.6.
|
|
63
|
+
"modern-canvas": "^0.26.3",
|
|
64
|
+
"modern-font": "^0.6.2",
|
|
65
65
|
"modern-idoc": "^0.12.3",
|
|
66
|
-
"modern-text": "^2.
|
|
66
|
+
"modern-text": "^2.1.3",
|
|
67
67
|
"y-protocols": "^1.0.7",
|
|
68
68
|
"yjs": "^13.6.31"
|
|
69
69
|
},
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|