123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861 |
- import {
- isEventSubProcess,
- isExpanded
- } from "./chunk-ZH5JUQV2.js";
- import {
- getParent
- } from "./chunk-NRHG7SAN.js";
- import {
- asBounds,
- asTRBL
- } from "./chunk-7FXQS3I2.js";
- import {
- is,
- isAny
- } from "./chunk-L5SG54UC.js";
- import {
- assign,
- every,
- filter,
- find,
- forEach,
- groupBy,
- isArray,
- isNumber,
- isObject,
- isUndefined
- } from "./chunk-4AK4GF4H.js";
- // node_modules/.pnpm/diagram-js@13.4.0/node_modules/diagram-js/lib/util/Elements.js
- function getParents(elements) {
- return filter(elements, function(element) {
- return !find(elements, function(e) {
- return e !== element && getParent2(element, e);
- });
- });
- }
- function getParent2(element, parent) {
- if (!parent) {
- return;
- }
- if (element === parent) {
- return parent;
- }
- if (!element.parent) {
- return;
- }
- return getParent2(element.parent, parent);
- }
- function add(elements, element, unique) {
- var canAdd = !unique || elements.indexOf(element) === -1;
- if (canAdd) {
- elements.push(element);
- }
- return canAdd;
- }
- function eachElement(elements, fn, depth) {
- depth = depth || 0;
- if (!isArray(elements)) {
- elements = [elements];
- }
- forEach(elements, function(s, i) {
- var filter2 = fn(s, i, depth);
- if (isArray(filter2) && filter2.length) {
- eachElement(filter2, fn, depth + 1);
- }
- });
- }
- function selfAndChildren(elements, unique, maxDepth) {
- var result = [], processedChildren = [];
- eachElement(elements, function(element, i, depth) {
- add(result, element, unique);
- var children = element.children;
- if (maxDepth === -1 || depth < maxDepth) {
- if (children && add(processedChildren, children, unique)) {
- return children;
- }
- }
- });
- return result;
- }
- function selfAndAllChildren(elements, allowDuplicates) {
- return selfAndChildren(elements, !allowDuplicates, -1);
- }
- function getClosure(elements, isTopLevel, closure) {
- if (isUndefined(isTopLevel)) {
- isTopLevel = true;
- }
- if (isObject(isTopLevel)) {
- closure = isTopLevel;
- isTopLevel = true;
- }
- closure = closure || {};
- var allShapes = copyObject(closure.allShapes), allConnections = copyObject(closure.allConnections), enclosedElements = copyObject(closure.enclosedElements), enclosedConnections = copyObject(closure.enclosedConnections);
- var topLevel = copyObject(
- closure.topLevel,
- isTopLevel && groupBy(elements, function(e) {
- return e.id;
- })
- );
- function handleConnection(c) {
- if (topLevel[c.source.id] && topLevel[c.target.id]) {
- topLevel[c.id] = [c];
- }
- if (allShapes[c.source.id] && allShapes[c.target.id]) {
- enclosedConnections[c.id] = enclosedElements[c.id] = c;
- }
- allConnections[c.id] = c;
- }
- function handleElement(element) {
- enclosedElements[element.id] = element;
- if (element.waypoints) {
- enclosedConnections[element.id] = allConnections[element.id] = element;
- } else {
- allShapes[element.id] = element;
- forEach(element.incoming, handleConnection);
- forEach(element.outgoing, handleConnection);
- return element.children;
- }
- }
- eachElement(elements, handleElement);
- return {
- allShapes,
- allConnections,
- topLevel,
- enclosedConnections,
- enclosedElements
- };
- }
- function getBBox(elements, stopRecursion) {
- stopRecursion = !!stopRecursion;
- if (!isArray(elements)) {
- elements = [elements];
- }
- var minX, minY, maxX, maxY;
- forEach(elements, function(element) {
- var bbox = element;
- if (element.waypoints && !stopRecursion) {
- bbox = getBBox(element.waypoints, true);
- }
- var x = bbox.x, y = bbox.y, height = bbox.height || 0, width = bbox.width || 0;
- if (x < minX || minX === void 0) {
- minX = x;
- }
- if (y < minY || minY === void 0) {
- minY = y;
- }
- if (x + width > maxX || maxX === void 0) {
- maxX = x + width;
- }
- if (y + height > maxY || maxY === void 0) {
- maxY = y + height;
- }
- });
- return {
- x: minX,
- y: minY,
- height: maxY - minY,
- width: maxX - minX
- };
- }
- function getEnclosedElements(elements, bbox) {
- var filteredElements = {};
- forEach(elements, function(element) {
- var e = element;
- if (e.waypoints) {
- e = getBBox(e);
- }
- if (!isNumber(bbox.y) && e.x > bbox.x) {
- filteredElements[element.id] = element;
- }
- if (!isNumber(bbox.x) && e.y > bbox.y) {
- filteredElements[element.id] = element;
- }
- if (e.x > bbox.x && e.y > bbox.y) {
- if (isNumber(bbox.width) && isNumber(bbox.height) && e.width + e.x < bbox.width + bbox.x && e.height + e.y < bbox.height + bbox.y) {
- filteredElements[element.id] = element;
- } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {
- filteredElements[element.id] = element;
- }
- }
- });
- return filteredElements;
- }
- function getType(element) {
- if ("waypoints" in element) {
- return "connection";
- }
- if ("x" in element) {
- return "shape";
- }
- return "root";
- }
- function isFrameElement(element) {
- return !!(element && element.isFrame);
- }
- function copyObject(src1, src2) {
- return assign({}, src1 || {}, src2 || {});
- }
- // node_modules/.pnpm/diagram-js@13.4.0/node_modules/diagram-js/lib/features/resize/ResizeUtil.js
- var max = Math.max;
- var min = Math.min;
- var DEFAULT_CHILD_BOX_PADDING = 20;
- function substractTRBL(trblA, trblB) {
- return {
- top: trblA.top - trblB.top,
- right: trblA.right - trblB.right,
- bottom: trblA.bottom - trblB.bottom,
- left: trblA.left - trblB.left
- };
- }
- function resizeBounds(bounds, direction, delta) {
- var dx = delta.x, dy = delta.y;
- var newBounds = {
- x: bounds.x,
- y: bounds.y,
- width: bounds.width,
- height: bounds.height
- };
- if (direction.indexOf("n") !== -1) {
- newBounds.y = bounds.y + dy;
- newBounds.height = bounds.height - dy;
- } else if (direction.indexOf("s") !== -1) {
- newBounds.height = bounds.height + dy;
- }
- if (direction.indexOf("e") !== -1) {
- newBounds.width = bounds.width + dx;
- } else if (direction.indexOf("w") !== -1) {
- newBounds.x = bounds.x + dx;
- newBounds.width = bounds.width - dx;
- }
- return newBounds;
- }
- function resizeTRBL(bounds, resize) {
- return {
- x: bounds.x + (resize.left || 0),
- y: bounds.y + (resize.top || 0),
- width: bounds.width - (resize.left || 0) + (resize.right || 0),
- height: bounds.height - (resize.top || 0) + (resize.bottom || 0)
- };
- }
- function applyConstraints(attr, trbl, resizeConstraints) {
- var value = trbl[attr], minValue = resizeConstraints.min && resizeConstraints.min[attr], maxValue = resizeConstraints.max && resizeConstraints.max[attr];
- if (isNumber(minValue)) {
- value = (/top|left/.test(attr) ? min : max)(value, minValue);
- }
- if (isNumber(maxValue)) {
- value = (/top|left/.test(attr) ? max : min)(value, maxValue);
- }
- return value;
- }
- function ensureConstraints(currentBounds, resizeConstraints) {
- if (!resizeConstraints) {
- return currentBounds;
- }
- var currentTrbl = asTRBL(currentBounds);
- return asBounds({
- top: applyConstraints("top", currentTrbl, resizeConstraints),
- right: applyConstraints("right", currentTrbl, resizeConstraints),
- bottom: applyConstraints("bottom", currentTrbl, resizeConstraints),
- left: applyConstraints("left", currentTrbl, resizeConstraints)
- });
- }
- function getMinResizeBounds(direction, currentBounds, minDimensions, childrenBounds) {
- var currentBox = asTRBL(currentBounds);
- var minBox = {
- top: /n/.test(direction) ? currentBox.bottom - minDimensions.height : currentBox.top,
- left: /w/.test(direction) ? currentBox.right - minDimensions.width : currentBox.left,
- bottom: /s/.test(direction) ? currentBox.top + minDimensions.height : currentBox.bottom,
- right: /e/.test(direction) ? currentBox.left + minDimensions.width : currentBox.right
- };
- var childrenBox = childrenBounds ? asTRBL(childrenBounds) : minBox;
- var combinedBox = {
- top: min(minBox.top, childrenBox.top),
- left: min(minBox.left, childrenBox.left),
- bottom: max(minBox.bottom, childrenBox.bottom),
- right: max(minBox.right, childrenBox.right)
- };
- return asBounds(combinedBox);
- }
- function asPadding(mayBePadding, defaultValue) {
- if (typeof mayBePadding !== "undefined") {
- return mayBePadding;
- } else {
- return DEFAULT_CHILD_BOX_PADDING;
- }
- }
- function addPadding(bbox, padding) {
- var left, right, top, bottom;
- if (typeof padding === "object") {
- left = asPadding(padding.left);
- right = asPadding(padding.right);
- top = asPadding(padding.top);
- bottom = asPadding(padding.bottom);
- } else {
- left = right = top = bottom = asPadding(padding);
- }
- return {
- x: bbox.x - left,
- y: bbox.y - top,
- width: bbox.width + left + right,
- height: bbox.height + top + bottom
- };
- }
- function isBBoxChild(element) {
- if (element.waypoints) {
- return false;
- }
- if (element.type === "label") {
- return false;
- }
- return true;
- }
- function computeChildrenBBox(shapeOrChildren, padding) {
- var elements;
- if (shapeOrChildren.length === void 0) {
- elements = filter(shapeOrChildren.children, isBBoxChild);
- } else {
- elements = shapeOrChildren;
- }
- if (elements.length) {
- return addPadding(getBBox(elements), padding);
- }
- }
- // node_modules/.pnpm/bpmn-js@16.3.2/node_modules/bpmn-js/lib/features/modeling/util/LaneUtil.js
- var abs = Math.abs;
- function getTRBLResize(oldBounds, newBounds) {
- return substractTRBL(asTRBL(newBounds), asTRBL(oldBounds));
- }
- var LANE_PARENTS = [
- "bpmn:Participant",
- "bpmn:Process",
- "bpmn:SubProcess"
- ];
- var LANE_INDENTATION = 30;
- function collectLanes(shape, collectedShapes) {
- collectedShapes = collectedShapes || [];
- shape.children.filter(function(s) {
- if (is(s, "bpmn:Lane")) {
- collectLanes(s, collectedShapes);
- collectedShapes.push(s);
- }
- });
- return collectedShapes;
- }
- function getChildLanes(shape) {
- return shape.children.filter(function(c) {
- return is(c, "bpmn:Lane");
- });
- }
- function getLanesRoot(shape) {
- return getParent(shape, LANE_PARENTS) || shape;
- }
- function computeLanesResize(shape, newBounds) {
- var rootElement = getLanesRoot(shape);
- var initialShapes = is(rootElement, "bpmn:Process") ? [] : [rootElement];
- var allLanes = collectLanes(rootElement, initialShapes), shapeTrbl = asTRBL(shape), shapeNewTrbl = asTRBL(newBounds), trblResize = getTRBLResize(shape, newBounds), resizeNeeded = [];
- allLanes.forEach(function(other) {
- if (other === shape) {
- return;
- }
- var topResize = 0, rightResize = trblResize.right, bottomResize = 0, leftResize = trblResize.left;
- var otherTrbl = asTRBL(other);
- if (trblResize.top) {
- if (abs(otherTrbl.bottom - shapeTrbl.top) < 10) {
- bottomResize = shapeNewTrbl.top - otherTrbl.bottom;
- }
- if (abs(otherTrbl.top - shapeTrbl.top) < 5) {
- topResize = shapeNewTrbl.top - otherTrbl.top;
- }
- }
- if (trblResize.bottom) {
- if (abs(otherTrbl.top - shapeTrbl.bottom) < 10) {
- topResize = shapeNewTrbl.bottom - otherTrbl.top;
- }
- if (abs(otherTrbl.bottom - shapeTrbl.bottom) < 5) {
- bottomResize = shapeNewTrbl.bottom - otherTrbl.bottom;
- }
- }
- if (topResize || rightResize || bottomResize || leftResize) {
- resizeNeeded.push({
- shape: other,
- newBounds: resizeTRBL(other, {
- top: topResize,
- right: rightResize,
- bottom: bottomResize,
- left: leftResize
- })
- });
- }
- });
- return resizeNeeded;
- }
- // node_modules/.pnpm/diagram-js@13.4.0/node_modules/diagram-js/lib/util/Event.js
- function __stopPropagation(event) {
- if (!event || typeof event.stopPropagation !== "function") {
- return;
- }
- event.stopPropagation();
- }
- function getOriginal(event) {
- return event.originalEvent || event.srcEvent;
- }
- function stopPropagation(event) {
- __stopPropagation(event);
- __stopPropagation(getOriginal(event));
- }
- function toPoint(event) {
- if (event.pointers && event.pointers.length) {
- event = event.pointers[0];
- }
- if (event.touches && event.touches.length) {
- event = event.touches[0];
- }
- return event ? {
- x: event.clientX,
- y: event.clientY
- } : null;
- }
- // node_modules/.pnpm/diagram-js@13.4.0/node_modules/diagram-js/lib/util/Platform.js
- function isMac() {
- return /mac/i.test(navigator.platform);
- }
- // node_modules/.pnpm/diagram-js@13.4.0/node_modules/diagram-js/lib/util/Mouse.js
- function isButton(event, button) {
- return (getOriginal(event) || event).button === button;
- }
- function isPrimaryButton(event) {
- return isButton(event, 0);
- }
- function isAuxiliaryButton(event) {
- return isButton(event, 1);
- }
- function hasPrimaryModifier(event) {
- var originalEvent = getOriginal(event) || event;
- if (!isPrimaryButton(event)) {
- return false;
- }
- if (isMac()) {
- return originalEvent.metaKey;
- } else {
- return originalEvent.ctrlKey;
- }
- }
- function hasSecondaryModifier(event) {
- var originalEvent = getOriginal(event) || event;
- return isPrimaryButton(event) && originalEvent.shiftKey;
- }
- // node_modules/.pnpm/bpmn-js@16.3.2/node_modules/bpmn-js/lib/features/context-pad/ContextPadProvider.js
- function ContextPadProvider(config, injector, eventBus, contextPad, modeling, elementFactory, connect, create, popupMenu, canvas, rules, translate, appendPreview) {
- config = config || {};
- contextPad.registerProvider(this);
- this._contextPad = contextPad;
- this._modeling = modeling;
- this._elementFactory = elementFactory;
- this._connect = connect;
- this._create = create;
- this._popupMenu = popupMenu;
- this._canvas = canvas;
- this._rules = rules;
- this._translate = translate;
- this._eventBus = eventBus;
- this._appendPreview = appendPreview;
- if (config.autoPlace !== false) {
- this._autoPlace = injector.get("autoPlace", false);
- }
- eventBus.on("create.end", 250, function(event) {
- var context = event.context, shape = context.shape;
- if (!hasPrimaryModifier(event) || !contextPad.isOpen(shape)) {
- return;
- }
- var entries = contextPad.getEntries(shape);
- if (entries.replace) {
- entries.replace.action.click(event, shape);
- }
- });
- }
- ContextPadProvider.$inject = [
- "config.contextPad",
- "injector",
- "eventBus",
- "contextPad",
- "modeling",
- "elementFactory",
- "connect",
- "create",
- "popupMenu",
- "canvas",
- "rules",
- "translate",
- "appendPreview"
- ];
- ContextPadProvider.prototype.getMultiElementContextPadEntries = function(elements) {
- var modeling = this._modeling;
- var actions = {};
- if (this._isDeleteAllowed(elements)) {
- assign(actions, {
- "delete": {
- group: "edit",
- className: "bpmn-icon-trash",
- title: this._translate("Remove"),
- action: {
- click: function(event, elements2) {
- modeling.removeElements(elements2.slice());
- }
- }
- }
- });
- }
- return actions;
- };
- ContextPadProvider.prototype._isDeleteAllowed = function(elements) {
- var baseAllowed = this._rules.allowed("elements.delete", {
- elements
- });
- if (isArray(baseAllowed)) {
- return every(baseAllowed, function(element) {
- return includes(baseAllowed, element);
- });
- }
- return baseAllowed;
- };
- ContextPadProvider.prototype.getContextPadEntries = function(element) {
- var contextPad = this._contextPad, modeling = this._modeling, elementFactory = this._elementFactory, connect = this._connect, create = this._create, popupMenu = this._popupMenu, rules = this._rules, autoPlace = this._autoPlace, translate = this._translate, appendPreview = this._appendPreview;
- var actions = {};
- if (element.type === "label") {
- return actions;
- }
- var businessObject = element.businessObject;
- function startConnect(event, element2) {
- connect.start(event, element2);
- }
- function removeElement(e, element2) {
- modeling.removeElements([element2]);
- }
- function getReplaceMenuPosition(element2) {
- var Y_OFFSET = 5;
- var pad = contextPad.getPad(element2).html;
- var padRect = pad.getBoundingClientRect();
- var pos = {
- x: padRect.left,
- y: padRect.bottom + Y_OFFSET
- };
- return pos;
- }
- function appendAction(type, className, title, options) {
- function appendStart(event, element2) {
- var shape = elementFactory.createShape(assign({ type }, options));
- create.start(event, shape, {
- source: element2
- });
- appendPreview.cleanUp();
- }
- var append = autoPlace ? function(_, element2) {
- var shape = elementFactory.createShape(assign({ type }, options));
- autoPlace.append(element2, shape);
- appendPreview.cleanUp();
- } : appendStart;
- var previewAppend = autoPlace ? function(_, element2) {
- appendPreview.create(element2, type, options);
- return () => {
- appendPreview.cleanUp();
- };
- } : null;
- return {
- group: "model",
- className,
- title,
- action: {
- dragstart: appendStart,
- click: append,
- hover: previewAppend
- }
- };
- }
- function splitLaneHandler(count) {
- return function(_, element2) {
- modeling.splitLane(element2, count);
- contextPad.open(element2, true);
- };
- }
- if (isAny(businessObject, ["bpmn:Lane", "bpmn:Participant"]) && isExpanded(element)) {
- var childLanes = getChildLanes(element);
- assign(actions, {
- "lane-insert-above": {
- group: "lane-insert-above",
- className: "bpmn-icon-lane-insert-above",
- title: translate("Add lane above"),
- action: {
- click: function(event, element2) {
- modeling.addLane(element2, "top");
- }
- }
- }
- });
- if (childLanes.length < 2) {
- if (element.height >= 120) {
- assign(actions, {
- "lane-divide-two": {
- group: "lane-divide",
- className: "bpmn-icon-lane-divide-two",
- title: translate("Divide into two lanes"),
- action: {
- click: splitLaneHandler(2)
- }
- }
- });
- }
- if (element.height >= 180) {
- assign(actions, {
- "lane-divide-three": {
- group: "lane-divide",
- className: "bpmn-icon-lane-divide-three",
- title: translate("Divide into three lanes"),
- action: {
- click: splitLaneHandler(3)
- }
- }
- });
- }
- }
- assign(actions, {
- "lane-insert-below": {
- group: "lane-insert-below",
- className: "bpmn-icon-lane-insert-below",
- title: translate("Add lane below"),
- action: {
- click: function(event, element2) {
- modeling.addLane(element2, "bottom");
- }
- }
- }
- });
- }
- if (is(businessObject, "bpmn:FlowNode")) {
- if (is(businessObject, "bpmn:EventBasedGateway")) {
- assign(actions, {
- "append.receive-task": appendAction(
- "bpmn:ReceiveTask",
- "bpmn-icon-receive-task",
- translate("Append receive task")
- ),
- "append.message-intermediate-event": appendAction(
- "bpmn:IntermediateCatchEvent",
- "bpmn-icon-intermediate-event-catch-message",
- translate("Append message intermediate catch event"),
- { eventDefinitionType: "bpmn:MessageEventDefinition" }
- ),
- "append.timer-intermediate-event": appendAction(
- "bpmn:IntermediateCatchEvent",
- "bpmn-icon-intermediate-event-catch-timer",
- translate("Append timer intermediate catch event"),
- { eventDefinitionType: "bpmn:TimerEventDefinition" }
- ),
- "append.condition-intermediate-event": appendAction(
- "bpmn:IntermediateCatchEvent",
- "bpmn-icon-intermediate-event-catch-condition",
- translate("Append conditional intermediate catch event"),
- { eventDefinitionType: "bpmn:ConditionalEventDefinition" }
- ),
- "append.signal-intermediate-event": appendAction(
- "bpmn:IntermediateCatchEvent",
- "bpmn-icon-intermediate-event-catch-signal",
- translate("Append signal intermediate catch event"),
- { eventDefinitionType: "bpmn:SignalEventDefinition" }
- )
- });
- } else if (isEventType(businessObject, "bpmn:BoundaryEvent", "bpmn:CompensateEventDefinition")) {
- assign(actions, {
- "append.compensation-activity": appendAction(
- "bpmn:Task",
- "bpmn-icon-task",
- translate("Append compensation activity"),
- {
- isForCompensation: true
- }
- )
- });
- } else if (!is(businessObject, "bpmn:EndEvent") && !businessObject.isForCompensation && !isEventType(businessObject, "bpmn:IntermediateThrowEvent", "bpmn:LinkEventDefinition") && !isEventSubProcess(businessObject)) {
- assign(actions, {
- "append.end-event": appendAction(
- "bpmn:EndEvent",
- "bpmn-icon-end-event-none",
- translate("Append end event")
- ),
- "append.gateway": appendAction(
- "bpmn:ExclusiveGateway",
- "bpmn-icon-gateway-none",
- translate("Append gateway")
- ),
- "append.append-task": appendAction(
- "bpmn:Task",
- "bpmn-icon-task",
- translate("Append task")
- ),
- "append.intermediate-event": appendAction(
- "bpmn:IntermediateThrowEvent",
- "bpmn-icon-intermediate-event-none",
- translate("Append intermediate/boundary event")
- )
- });
- }
- }
- if (!popupMenu.isEmpty(element, "bpmn-replace")) {
- assign(actions, {
- "replace": {
- group: "edit",
- className: "bpmn-icon-screw-wrench",
- title: translate("Change type"),
- action: {
- click: function(event, element2) {
- var position = assign(getReplaceMenuPosition(element2), {
- cursor: { x: event.x, y: event.y }
- });
- popupMenu.open(element2, "bpmn-replace", position, {
- title: translate("Change element"),
- width: 300,
- search: true
- });
- }
- }
- }
- });
- }
- if (is(businessObject, "bpmn:SequenceFlow")) {
- assign(actions, {
- "append.text-annotation": appendAction(
- "bpmn:TextAnnotation",
- "bpmn-icon-text-annotation",
- translate("Append text annotation")
- )
- });
- }
- if (isAny(businessObject, [
- "bpmn:FlowNode",
- "bpmn:InteractionNode",
- "bpmn:DataObjectReference",
- "bpmn:DataStoreReference"
- ])) {
- assign(actions, {
- "append.text-annotation": appendAction(
- "bpmn:TextAnnotation",
- "bpmn-icon-text-annotation",
- translate("Append text annotation")
- ),
- "connect": {
- group: "connect",
- className: "bpmn-icon-connection-multi",
- title: translate(
- "Connect using " + (businessObject.isForCompensation ? "" : "sequence/message flow or ") + "association"
- ),
- action: {
- click: startConnect,
- dragstart: startConnect
- }
- }
- });
- }
- if (is(businessObject, "bpmn:TextAnnotation")) {
- assign(actions, {
- "connect": {
- group: "connect",
- className: "bpmn-icon-connection-multi",
- title: translate("Connect using association"),
- action: {
- click: startConnect,
- dragstart: startConnect
- }
- }
- });
- }
- if (isAny(businessObject, ["bpmn:DataObjectReference", "bpmn:DataStoreReference"])) {
- assign(actions, {
- "connect": {
- group: "connect",
- className: "bpmn-icon-connection-multi",
- title: translate("Connect using data input association"),
- action: {
- click: startConnect,
- dragstart: startConnect
- }
- }
- });
- }
- if (is(businessObject, "bpmn:Group")) {
- assign(actions, {
- "append.text-annotation": appendAction(
- "bpmn:TextAnnotation",
- "bpmn-icon-text-annotation",
- translate("Append text annotation")
- )
- });
- }
- var deleteAllowed = rules.allowed("elements.delete", { elements: [element] });
- if (isArray(deleteAllowed)) {
- deleteAllowed = deleteAllowed[0] === element;
- }
- if (deleteAllowed) {
- assign(actions, {
- "delete": {
- group: "edit",
- className: "bpmn-icon-trash",
- title: translate("Remove"),
- action: {
- click: removeElement
- }
- }
- });
- }
- return actions;
- };
- function isEventType(businessObject, type, eventDefinitionType) {
- var isType = businessObject.$instanceOf(type);
- var isDefinition = false;
- var definitions = businessObject.eventDefinitions || [];
- forEach(definitions, function(def) {
- if (def.$type === eventDefinitionType) {
- isDefinition = true;
- }
- });
- return isType && isDefinition;
- }
- function includes(array, item) {
- return array.indexOf(item) !== -1;
- }
- export {
- getParents,
- eachElement,
- selfAndAllChildren,
- getClosure,
- getBBox,
- getEnclosedElements,
- getType,
- isFrameElement,
- substractTRBL,
- resizeBounds,
- ensureConstraints,
- getMinResizeBounds,
- computeChildrenBBox,
- LANE_INDENTATION,
- collectLanes,
- getChildLanes,
- getLanesRoot,
- computeLanesResize,
- getOriginal,
- stopPropagation,
- toPoint,
- isMac,
- isPrimaryButton,
- isAuxiliaryButton,
- hasPrimaryModifier,
- hasSecondaryModifier,
- ContextPadProvider
- };
- //# sourceMappingURL=chunk-KSLPIYOU.js.map
|