Skip to content

Commit

Permalink
feat: 增加新版ContextPad
Browse files Browse the repository at this point in the history
  • Loading branch information
miyuesc committed Oct 16, 2023
1 parent 9b71d11 commit f1635dd
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 0 deletions.
59 changes: 59 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"bpmnlint": "^7.8.0",
"camunda-bpmn-moddle": "^7.0.1",
"core-js": "^3.8.1",
"diagram-js-context-pad": "^1.0.2",
"diagram-js-grid-bg": "^1.0.3",
"diagram-js-minimap": "^2.1.1",
"element-ui": "^2.15.10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class EnhancementContextPadProvider extends ContextPadProvider {
getContextPadEntries(element) {
const actions = {};
const modeling = this._modeling;
const contextPad = this._contextPad;

// const appendUserTask = (event, element) => {
// const shape = this._elementFactory.createShape({ type: "bpmn:UserTask" });
Expand Down Expand Up @@ -96,6 +97,16 @@ class EnhancementContextPadProvider extends ContextPadProvider {
}
}
};
actions["enhancement-op-1"] = {
group: "edit",
className: "enhancement-op",
title: "切换ContextPad样式",
action: {
click: function (e) {
contextPad.toggleStyles && contextPad.toggleStyles();
}
}
};

return actions;
}
Expand Down
7 changes: 7 additions & 0 deletions packages/components/Designer/moduleAndExtensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { resolver, rules } from "@packages/additional-modules/Lint/bpmnlint";
// 小地图
import minimapModule from "diagram-js-minimap";
import gridBGModule from "diagram-js-grid-bg";
import contextPadModule from "diagram-js-context-pad";

// moddle 定义文件
import activitiModdleDescriptors from "@packages/moddle-extensions/activiti.json";
Expand Down Expand Up @@ -115,6 +116,12 @@ export default function (settings) {
modules.push(gridBGModule);
}

// 扩展的上下文菜单
modules.push(contextPadModule);
options["contextPad"] = {
beauty: true
};

// 设置其他模块的启用
if (settings.otherModule) {
// 设置 自定义规则
Expand Down
1 change: 1 addition & 0 deletions packages/theme/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@import "bpmn-js-token-simulation/assets/css/bpmn-js-token-simulation.css";

@import "diagram-js-context-pad/assets/index.css";

@import "toolbar";
@import "designer";
Expand Down

0 comments on commit f1635dd

Please sign in to comment.