mce 0.18.4 → 0.18.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.
- package/dist/components/EditorLayout.vue.d.ts +7 -29
- package/dist/components/Selection.vue.d.ts +6 -6
- package/dist/components/Workflow.vue.d.ts +3 -0
- package/dist/components/shared/Transform.vue.d.ts +1 -1
- package/dist/composables/icons.d.ts +1 -0
- package/dist/index.css +75 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1727 -876
- package/dist/locale/en.d.ts +3 -0
- package/dist/locale/zh-Hans.d.ts +3 -0
- package/dist/mixins/0.context.d.ts +1 -0
- package/dist/mixins/strategy.d.ts +19 -0
- package/dist/plugins/workflow.d.ts +23 -0
- package/dist/typed-global.d.ts +5 -0
- package/dist/typed-plugins.d.ts +2 -0
- package/dist/utils/create.d.ts +44 -1
- package/dist/utils/workflow.d.ts +9 -0
- package/package.json +5 -5
package/dist/locale/en.d.ts
CHANGED
package/dist/locale/zh-Hans.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ declare global {
|
|
|
46
46
|
textSelection: Ref<IndexCharacter[] | undefined>;
|
|
47
47
|
hoverElement: Ref<Element2D | undefined>;
|
|
48
48
|
state: Ref<State | undefined>;
|
|
49
|
+
mode: Ref<Mode>;
|
|
49
50
|
getGlobalPointer: () => Vector2Like;
|
|
50
51
|
parseAnchor: (anchor: Anchor, isRtl?: boolean) => ParsedAnchor;
|
|
51
52
|
isNode: (value: any) => value is Node;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ActiveStrategy, DoubleclickStrategy, HoverStrategy, ResizeStrategy } from '../composables/strategy';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface Editor {
|
|
5
|
+
activeStrategy: ActiveStrategy;
|
|
6
|
+
doubleclickStrategy: DoubleclickStrategy;
|
|
7
|
+
hoverStrategy: HoverStrategy;
|
|
8
|
+
resizeStrategy?: ResizeStrategy;
|
|
9
|
+
}
|
|
10
|
+
interface Options {
|
|
11
|
+
activeStrategy?: ActiveStrategy;
|
|
12
|
+
doubleclickStrategy?: DoubleclickStrategy;
|
|
13
|
+
hoverStrategy?: HoverStrategy;
|
|
14
|
+
resizeStrategy?: ResizeStrategy;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
declare const _default: import("..").Mixin;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Element2D } from 'modern-canvas';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface WorkflowNodeTemplate {
|
|
5
|
+
/** Layer-panel name (and header label). */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Bold first line shown inside the node. */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** Gray hint paragraphs under the title. */
|
|
10
|
+
body?: string[];
|
|
11
|
+
}
|
|
12
|
+
interface Options {
|
|
13
|
+
/** Override/extend the workflow node content templates, keyed by node type. */
|
|
14
|
+
workflowNodes?: Record<string, WorkflowNodeTemplate>;
|
|
15
|
+
}
|
|
16
|
+
interface Commands {
|
|
17
|
+
addWorkflowNode: (type: string, position?: AddElementPosition) => Element2D;
|
|
18
|
+
addWorkflowConnection: (startId: string, startIdx: number, endId: string, endIdx: number) => Element2D;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
declare const _default: import("../plugin").Plugin;
|
|
23
|
+
export default _default;
|
package/dist/typed-global.d.ts
CHANGED
|
@@ -31,6 +31,11 @@ declare global {
|
|
|
31
31
|
//
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
// Persistent editor mode, orthogonal to the transient `State`. 'canvas' is
|
|
35
|
+
// the free-form editing experience; 'workflow' turns the canvas into a
|
|
36
|
+
// node-graph editor (directional connections, port handles).
|
|
37
|
+
type Mode = 'canvas' | 'workflow'
|
|
38
|
+
|
|
34
39
|
type State
|
|
35
40
|
= | 'loading'
|
|
36
41
|
| 'hand'
|
package/dist/typed-plugins.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import './mixins/http'
|
|
|
22
22
|
import './mixins/loader'
|
|
23
23
|
import './mixins/snapper'
|
|
24
24
|
import './mixins/snapshot'
|
|
25
|
+
import './mixins/strategy'
|
|
25
26
|
import './mixins/tool'
|
|
26
27
|
import './plugins/arrange'
|
|
27
28
|
import './plugins/autoNest'
|
|
@@ -60,6 +61,7 @@ import './plugins/transform'
|
|
|
60
61
|
import './plugins/typography'
|
|
61
62
|
import './plugins/url'
|
|
62
63
|
import './plugins/view'
|
|
64
|
+
import './plugins/workflow'
|
|
63
65
|
import './plugins/zoom'
|
|
64
66
|
|
|
65
67
|
export {}
|
package/dist/utils/create.d.ts
CHANGED
|
@@ -1,4 +1,47 @@
|
|
|
1
|
-
import type { Element, Fill, Outline } from 'modern-idoc';
|
|
1
|
+
import type { Element, Fill, Outline, ShapeConnectionPoint } from 'modern-idoc';
|
|
2
2
|
export declare function createShapeElement(shape?: Element['shape'], fill?: Fill, outline?: Outline): Element;
|
|
3
3
|
export declare function createTextElement(content: string, style?: Record<string, any>): Element;
|
|
4
4
|
export declare function createImageElement(image: string): Promise<Element>;
|
|
5
|
+
export interface CreateCardElementOptions {
|
|
6
|
+
/** Body text below the title. Omitted if empty. */
|
|
7
|
+
body?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
fill?: Fill;
|
|
11
|
+
outline?: Outline;
|
|
12
|
+
borderRadius?: number;
|
|
13
|
+
/** Inset of the title/body from the card edges. */
|
|
14
|
+
padding?: number;
|
|
15
|
+
titleStyle?: Record<string, any>;
|
|
16
|
+
bodyStyle?: Record<string, any>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A rounded panel with a bold title and optional body, composed as child text
|
|
20
|
+
* elements (so each line keeps its own styling and can be edited in place).
|
|
21
|
+
*/
|
|
22
|
+
export declare function createCardElement(title: string, options?: CreateCardElementOptions): Element;
|
|
23
|
+
export interface CreateFlowNodeElementOptions {
|
|
24
|
+
width?: number;
|
|
25
|
+
height?: number;
|
|
26
|
+
fill?: Fill;
|
|
27
|
+
outline?: Outline;
|
|
28
|
+
borderRadius?: number;
|
|
29
|
+
textStyle?: Record<string, any>;
|
|
30
|
+
/** Override the default right/left/bottom/top connector anchors. */
|
|
31
|
+
connectionPoints?: ShapeConnectionPoint[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A labelled rounded box that exposes connection points, so connectors can
|
|
35
|
+
* attach and route to it. Pairs with the `connection` element.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createFlowNodeElement(label?: string, options?: CreateFlowNodeElementOptions): Element;
|
|
38
|
+
export interface CreateStickyElementOptions {
|
|
39
|
+
width?: number;
|
|
40
|
+
height?: number;
|
|
41
|
+
fill?: Fill;
|
|
42
|
+
color?: string;
|
|
43
|
+
fontSize?: number;
|
|
44
|
+
padding?: number;
|
|
45
|
+
}
|
|
46
|
+
/** A solid colored note with top-aligned text, e.g. for whiteboard annotations. */
|
|
47
|
+
export declare function createStickyElement(content: string, options?: CreateStickyElementOptions): Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Element2D } from 'modern-canvas';
|
|
2
|
+
import type { ShapeConnectionPoint } from 'modern-idoc';
|
|
3
|
+
export interface WorkflowPort extends ShapeConnectionPoint {
|
|
4
|
+
kind: 'input' | 'output';
|
|
5
|
+
}
|
|
6
|
+
export declare const INPUT_PORT: WorkflowPort;
|
|
7
|
+
export declare const OUTPUT_PORT: WorkflowPort;
|
|
8
|
+
export declare function getWorkflowPorts(el: Element2D): WorkflowPort[];
|
|
9
|
+
export declare function toConnectionPoints(ports: WorkflowPort[]): ShapeConnectionPoint[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.18.
|
|
4
|
+
"version": "0.18.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,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.
|
|
63
|
+
"modern-canvas": "^0.19.1",
|
|
64
|
+
"modern-font": "^0.6.0",
|
|
65
65
|
"modern-idoc": "^0.11.5",
|
|
66
|
-
"modern-text": "^
|
|
66
|
+
"modern-text": "^2.0.3",
|
|
67
67
|
"y-protocols": "^1.0.7",
|
|
68
68
|
"yjs": "^13.6.30"
|
|
69
69
|
},
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@types/lodash-es": "^4.17.12",
|
|
89
89
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
90
90
|
"jiti": "^2.7.0",
|
|
91
|
-
"sass-embedded": "^1.
|
|
91
|
+
"sass-embedded": "^1.100.0",
|
|
92
92
|
"typedoc": "^0.28.19",
|
|
93
93
|
"typedoc-plugin-markdown": "^4.11.0"
|
|
94
94
|
},
|