chunk-GGACME3A.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. import {
  2. getDi
  3. } from "./chunk-L5SG54UC.js";
  4. import {
  5. assign
  6. } from "./chunk-4AK4GF4H.js";
  7. // node_modules/.pnpm/bpmn-js@16.3.2/node_modules/bpmn-js/lib/features/palette/PaletteProvider.js
  8. function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate) {
  9. this._palette = palette;
  10. this._create = create;
  11. this._elementFactory = elementFactory;
  12. this._spaceTool = spaceTool;
  13. this._lassoTool = lassoTool;
  14. this._handTool = handTool;
  15. this._globalConnect = globalConnect;
  16. this._translate = translate;
  17. palette.registerProvider(this);
  18. }
  19. PaletteProvider.$inject = [
  20. "palette",
  21. "create",
  22. "elementFactory",
  23. "spaceTool",
  24. "lassoTool",
  25. "handTool",
  26. "globalConnect",
  27. "translate"
  28. ];
  29. PaletteProvider.prototype.getPaletteEntries = function() {
  30. var actions = {}, create = this._create, elementFactory = this._elementFactory, spaceTool = this._spaceTool, lassoTool = this._lassoTool, handTool = this._handTool, globalConnect = this._globalConnect, translate = this._translate;
  31. function createAction(type, group, className, title, options) {
  32. function createListener(event) {
  33. var shape = elementFactory.createShape(assign({ type }, options));
  34. if (options) {
  35. var di = getDi(shape);
  36. di.isExpanded = options.isExpanded;
  37. }
  38. create.start(event, shape);
  39. }
  40. return {
  41. group,
  42. className,
  43. title,
  44. action: {
  45. dragstart: createListener,
  46. click: createListener
  47. }
  48. };
  49. }
  50. function createSubprocess(event) {
  51. var subProcess = elementFactory.createShape({
  52. type: "bpmn:SubProcess",
  53. x: 0,
  54. y: 0,
  55. isExpanded: true
  56. });
  57. var startEvent = elementFactory.createShape({
  58. type: "bpmn:StartEvent",
  59. x: 40,
  60. y: 82,
  61. parent: subProcess
  62. });
  63. create.start(event, [subProcess, startEvent], {
  64. hints: {
  65. autoSelect: [subProcess]
  66. }
  67. });
  68. }
  69. function createParticipant(event) {
  70. create.start(event, elementFactory.createParticipantShape());
  71. }
  72. assign(actions, {
  73. "hand-tool": {
  74. group: "tools",
  75. className: "bpmn-icon-hand-tool",
  76. title: translate("Activate hand tool"),
  77. action: {
  78. click: function(event) {
  79. handTool.activateHand(event);
  80. }
  81. }
  82. },
  83. "lasso-tool": {
  84. group: "tools",
  85. className: "bpmn-icon-lasso-tool",
  86. title: translate("Activate lasso tool"),
  87. action: {
  88. click: function(event) {
  89. lassoTool.activateSelection(event);
  90. }
  91. }
  92. },
  93. "space-tool": {
  94. group: "tools",
  95. className: "bpmn-icon-space-tool",
  96. title: translate("Activate create/remove space tool"),
  97. action: {
  98. click: function(event) {
  99. spaceTool.activateSelection(event);
  100. }
  101. }
  102. },
  103. "global-connect-tool": {
  104. group: "tools",
  105. className: "bpmn-icon-connection-multi",
  106. title: translate("Activate global connect tool"),
  107. action: {
  108. click: function(event) {
  109. globalConnect.start(event);
  110. }
  111. }
  112. },
  113. "tool-separator": {
  114. group: "tools",
  115. separator: true
  116. },
  117. "create.start-event": createAction(
  118. "bpmn:StartEvent",
  119. "event",
  120. "bpmn-icon-start-event-none",
  121. translate("Create start event")
  122. ),
  123. "create.intermediate-event": createAction(
  124. "bpmn:IntermediateThrowEvent",
  125. "event",
  126. "bpmn-icon-intermediate-event-none",
  127. translate("Create intermediate/boundary event")
  128. ),
  129. "create.end-event": createAction(
  130. "bpmn:EndEvent",
  131. "event",
  132. "bpmn-icon-end-event-none",
  133. translate("Create end event")
  134. ),
  135. "create.exclusive-gateway": createAction(
  136. "bpmn:ExclusiveGateway",
  137. "gateway",
  138. "bpmn-icon-gateway-none",
  139. translate("Create gateway")
  140. ),
  141. "create.task": createAction(
  142. "bpmn:Task",
  143. "activity",
  144. "bpmn-icon-task",
  145. translate("Create task")
  146. ),
  147. "create.data-object": createAction(
  148. "bpmn:DataObjectReference",
  149. "data-object",
  150. "bpmn-icon-data-object",
  151. translate("Create data object reference")
  152. ),
  153. "create.data-store": createAction(
  154. "bpmn:DataStoreReference",
  155. "data-store",
  156. "bpmn-icon-data-store",
  157. translate("Create data store reference")
  158. ),
  159. "create.subprocess-expanded": {
  160. group: "activity",
  161. className: "bpmn-icon-subprocess-expanded",
  162. title: translate("Create expanded sub-process"),
  163. action: {
  164. dragstart: createSubprocess,
  165. click: createSubprocess
  166. }
  167. },
  168. "create.participant-expanded": {
  169. group: "collaboration",
  170. className: "bpmn-icon-participant",
  171. title: translate("Create pool/participant"),
  172. action: {
  173. dragstart: createParticipant,
  174. click: createParticipant
  175. }
  176. },
  177. "create.group": createAction(
  178. "bpmn:Group",
  179. "artifact",
  180. "bpmn-icon-group",
  181. translate("Create group")
  182. )
  183. });
  184. return actions;
  185. };
  186. export {
  187. PaletteProvider
  188. };
  189. //# sourceMappingURL=chunk-GGACME3A.js.map