ice-entity-designer 0.0.30 → 0.0.31
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/README.md +99 -58
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/types/gantt/gantt_text.d.mts +31 -0
- package/dist/types/gantt/gantt_text.d.ts +31 -0
- package/dist/types/index.d.mts +4 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/statechart/statechart_text.d.mts +41 -0
- package/dist/types/statechart/statechart_text.d.ts +41 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare type GanttTextImportResult = {
|
|
9
|
+
tasks: number;
|
|
10
|
+
dependencies: number;
|
|
11
|
+
/** 解析不了 / 不支持的输入行(不阻断整体导入) */
|
|
12
|
+
warnings: string[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* 导出为 Mermaid gantt 文本。
|
|
16
|
+
*
|
|
17
|
+
* 只输出**排期语义**(负责人分组、日期、天数、进度、依赖),不输出像素/画布坐标 ——
|
|
18
|
+
* 要保坐标的场景用引擎快照(`designer.serialize()`)或 SVG 导出。
|
|
19
|
+
*/
|
|
20
|
+
export declare function toMermaidGantt(designer: any, options?: {
|
|
21
|
+
title?: string;
|
|
22
|
+
}): string;
|
|
23
|
+
/**
|
|
24
|
+
* 从 Mermaid gantt 文本导入(容错:不认识的行进 `warnings`,不阻断整体导入)。
|
|
25
|
+
*
|
|
26
|
+
* 会先清空目标 designer 的当前模型(与 BPMN XML / UML 文本导入同一语义)。
|
|
27
|
+
* `after X` 按引擎的依赖语义(前置结束 → 本任务开始)反推出起始日期,并建立依赖线。
|
|
28
|
+
*/
|
|
29
|
+
export declare function fromMermaidGantt(text: string, designer: any, options?: {
|
|
30
|
+
defaultStart?: string;
|
|
31
|
+
}): GanttTextImportResult;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare type GanttTextImportResult = {
|
|
9
|
+
tasks: number;
|
|
10
|
+
dependencies: number;
|
|
11
|
+
/** 解析不了 / 不支持的输入行(不阻断整体导入) */
|
|
12
|
+
warnings: string[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* 导出为 Mermaid gantt 文本。
|
|
16
|
+
*
|
|
17
|
+
* 只输出**排期语义**(负责人分组、日期、天数、进度、依赖),不输出像素/画布坐标 ——
|
|
18
|
+
* 要保坐标的场景用引擎快照(`designer.serialize()`)或 SVG 导出。
|
|
19
|
+
*/
|
|
20
|
+
export declare function toMermaidGantt(designer: any, options?: {
|
|
21
|
+
title?: string;
|
|
22
|
+
}): string;
|
|
23
|
+
/**
|
|
24
|
+
* 从 Mermaid gantt 文本导入(容错:不认识的行进 `warnings`,不阻断整体导入)。
|
|
25
|
+
*
|
|
26
|
+
* 会先清空目标 designer 的当前模型(与 BPMN XML / UML 文本导入同一语义)。
|
|
27
|
+
* `after X` 按引擎的依赖语义(前置结束 → 本任务开始)反推出起始日期,并建立依赖线。
|
|
28
|
+
*/
|
|
29
|
+
export declare function fromMermaidGantt(text: string, designer: any, options?: {
|
|
30
|
+
defaultStart?: string;
|
|
31
|
+
}): GanttTextImportResult;
|
package/dist/types/index.d.mts
CHANGED
|
@@ -37,6 +37,8 @@ export { default as StateNode, STATECHART_NODE_KINDS } from './statechart/StateN
|
|
|
37
37
|
export type { StatechartNodeKind } from './statechart/StateNode.mjs';
|
|
38
38
|
export { default as StateTransition } from './statechart/StateTransition.mjs';
|
|
39
39
|
export { default as StatechartDesigner } from './statechart/StatechartDesigner.mjs';
|
|
40
|
+
export { toPlantUmlState, fromPlantUmlState, splitTransitionLabel } from './statechart/statechart_text.mjs';
|
|
41
|
+
export type { StatechartTextImportResult } from './statechart/statechart_text.mjs';
|
|
40
42
|
export type { StatechartIssue } from './statechart/StatechartDesigner.mjs';
|
|
41
43
|
export { default as GanttTask } from './gantt/GanttTask.mjs';
|
|
42
44
|
export { default as GanttDependency } from './gantt/GanttDependency.mjs';
|
|
@@ -44,6 +46,8 @@ export { default as GanttRuler } from './gantt/GanttRuler.mjs';
|
|
|
44
46
|
export type { GanttRulerOptions } from './gantt/GanttRuler.mjs';
|
|
45
47
|
export { default as GanttDesigner } from './gantt/GanttDesigner.mjs';
|
|
46
48
|
export type { GanttIssue, GanttTaskInput } from './gantt/GanttDesigner.mjs';
|
|
49
|
+
export { toMermaidGantt, fromMermaidGantt } from './gantt/gantt_text.mjs';
|
|
50
|
+
export type { GanttTextImportResult } from './gantt/gantt_text.mjs';
|
|
47
51
|
export { parseDate, formatDate, addDays, diffDays, eachDay, tickLabel } from './gantt/gantt_date.mjs';
|
|
48
52
|
export { toPlantUml, fromPlantUml, arrowOf, detectUmlDialect } from './uml/uml_text.mjs';
|
|
49
53
|
export type { UmlTextImportResult } from './uml/uml_text.mjs';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export { default as StateNode, STATECHART_NODE_KINDS } from './statechart/StateN
|
|
|
37
37
|
export type { StatechartNodeKind } from './statechart/StateNode';
|
|
38
38
|
export { default as StateTransition } from './statechart/StateTransition';
|
|
39
39
|
export { default as StatechartDesigner } from './statechart/StatechartDesigner';
|
|
40
|
+
export { toPlantUmlState, fromPlantUmlState, splitTransitionLabel } from './statechart/statechart_text';
|
|
41
|
+
export type { StatechartTextImportResult } from './statechart/statechart_text';
|
|
40
42
|
export type { StatechartIssue } from './statechart/StatechartDesigner';
|
|
41
43
|
export { default as GanttTask } from './gantt/GanttTask';
|
|
42
44
|
export { default as GanttDependency } from './gantt/GanttDependency';
|
|
@@ -44,6 +46,8 @@ export { default as GanttRuler } from './gantt/GanttRuler';
|
|
|
44
46
|
export type { GanttRulerOptions } from './gantt/GanttRuler';
|
|
45
47
|
export { default as GanttDesigner } from './gantt/GanttDesigner';
|
|
46
48
|
export type { GanttIssue, GanttTaskInput } from './gantt/GanttDesigner';
|
|
49
|
+
export { toMermaidGantt, fromMermaidGantt } from './gantt/gantt_text';
|
|
50
|
+
export type { GanttTextImportResult } from './gantt/gantt_text';
|
|
47
51
|
export { parseDate, formatDate, addDays, diffDays, eachDay, tickLabel } from './gantt/gantt_date';
|
|
48
52
|
export { toPlantUml, fromPlantUml, arrowOf, detectUmlDialect } from './uml/uml_text';
|
|
49
53
|
export type { UmlTextImportResult } from './uml/uml_text';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare type StatechartTextImportResult = {
|
|
9
|
+
states: number;
|
|
10
|
+
transitions: number;
|
|
11
|
+
/** 解析不了 / 不支持的输入行(不阻断整体导入) */
|
|
12
|
+
warnings: string[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* `事件 [守卫] / 动作` → 三段(`StateTransition.composeLabel` 的逆运算)。
|
|
16
|
+
*
|
|
17
|
+
* 规则与拼装严格对称:只按**第一个** ` / ` 切分(动作里再出现 ` / ` 也属于动作),
|
|
18
|
+
* 守卫取事件末尾那对方括号;缺哪段就是空串,不会凭空造出括号或斜杠。
|
|
19
|
+
*/
|
|
20
|
+
export declare function splitTransitionLabel(label: string): {
|
|
21
|
+
event: string;
|
|
22
|
+
guard: string;
|
|
23
|
+
action: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* 导出为 PlantUML 状态图文本。
|
|
27
|
+
*
|
|
28
|
+
* 只输出**记法本身**(状态、嵌套、转移),不输出坐标 —— PlantUML 自己会排版;
|
|
29
|
+
* 要保坐标的场景用引擎快照(`designer.serialize()`)或 SVG 导出。
|
|
30
|
+
*/
|
|
31
|
+
export declare function toPlantUmlState(designer: any, options?: {
|
|
32
|
+
title?: string;
|
|
33
|
+
}): string;
|
|
34
|
+
/**
|
|
35
|
+
* 从 PlantUML 状态图文本导入(容错:不认识的行进 `warnings`,不阻断整体导入)。
|
|
36
|
+
*
|
|
37
|
+
* 会先清空目标 designer 的当前模型(与 BPMN XML / UML 文本导入同一语义)。
|
|
38
|
+
* 文本里没有坐标:导入后按「根级分层、子状态装在复合状态盒子里」给一套可读的初始布局,
|
|
39
|
+
* 用户随后可以自己排版(或交给自动布局)。
|
|
40
|
+
*/
|
|
41
|
+
export declare function fromPlantUmlState(text: string, designer: any): StatechartTextImportResult;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare type StatechartTextImportResult = {
|
|
9
|
+
states: number;
|
|
10
|
+
transitions: number;
|
|
11
|
+
/** 解析不了 / 不支持的输入行(不阻断整体导入) */
|
|
12
|
+
warnings: string[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* `事件 [守卫] / 动作` → 三段(`StateTransition.composeLabel` 的逆运算)。
|
|
16
|
+
*
|
|
17
|
+
* 规则与拼装严格对称:只按**第一个** ` / ` 切分(动作里再出现 ` / ` 也属于动作),
|
|
18
|
+
* 守卫取事件末尾那对方括号;缺哪段就是空串,不会凭空造出括号或斜杠。
|
|
19
|
+
*/
|
|
20
|
+
export declare function splitTransitionLabel(label: string): {
|
|
21
|
+
event: string;
|
|
22
|
+
guard: string;
|
|
23
|
+
action: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* 导出为 PlantUML 状态图文本。
|
|
27
|
+
*
|
|
28
|
+
* 只输出**记法本身**(状态、嵌套、转移),不输出坐标 —— PlantUML 自己会排版;
|
|
29
|
+
* 要保坐标的场景用引擎快照(`designer.serialize()`)或 SVG 导出。
|
|
30
|
+
*/
|
|
31
|
+
export declare function toPlantUmlState(designer: any, options?: {
|
|
32
|
+
title?: string;
|
|
33
|
+
}): string;
|
|
34
|
+
/**
|
|
35
|
+
* 从 PlantUML 状态图文本导入(容错:不认识的行进 `warnings`,不阻断整体导入)。
|
|
36
|
+
*
|
|
37
|
+
* 会先清空目标 designer 的当前模型(与 BPMN XML / UML 文本导入同一语义)。
|
|
38
|
+
* 文本里没有坐标:导入后按「根级分层、子状态装在复合状态盒子里」给一套可读的初始布局,
|
|
39
|
+
* 用户随后可以自己排版(或交给自动布局)。
|
|
40
|
+
*/
|
|
41
|
+
export declare function fromPlantUmlState(text: string, designer: any): StatechartTextImportResult;
|