chunk-I2KWQ44T.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. import {
  2. assign
  3. } from "./chunk-4AK4GF4H.js";
  4. // node_modules/.pnpm/bpmn-js@16.3.2/node_modules/bpmn-js/lib/features/align-elements/AlignElementsIcons.js
  5. var icons = {
  6. align: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
  7. <line x1="200" y1="150" x2="200" y2="1850" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  8. <rect x="500" y="150" width="1300" height="700" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  9. <rect x="500" y="1150" width="700" height="700" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  10. </svg>`,
  11. bottom: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  12. <line x1="150" y1="1650" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  13. <rect x="150" y="350" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  14. <rect x="1050" y="850" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  15. </svg>`,
  16. center: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  17. <line x1="900" y1="150" x2="900" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  18. <rect x="250" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  19. <rect x="500" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  20. </svg>`,
  21. left: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  22. <line x1="100" y1="150" x2="100" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  23. <rect x="100" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  24. <rect x="100" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  25. </svg>`,
  26. right: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  27. <line x1="1650" y1="150" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  28. <rect x="350" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  29. <rect x="850" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  30. </svg>`,
  31. top: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  32. <line x1="150" y1="150" x2="1650" y2="150" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  33. <rect x="150" y="150" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  34. <rect x="1050" y="150" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  35. </svg>`,
  36. middle: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  37. <line x1="150" y1="900" x2="1650" y2="900" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  38. <rect x="150" y="250" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  39. <rect x="1050" y="500" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  40. </svg>`
  41. };
  42. var AlignElementsIcons_default = icons;
  43. // node_modules/.pnpm/bpmn-js@16.3.2/node_modules/bpmn-js/lib/features/align-elements/AlignElementsContextPadProvider.js
  44. var LOW_PRIORITY = 900;
  45. function AlignElementsContextPadProvider(contextPad, popupMenu, translate, canvas) {
  46. contextPad.registerProvider(LOW_PRIORITY, this);
  47. this._contextPad = contextPad;
  48. this._popupMenu = popupMenu;
  49. this._translate = translate;
  50. this._canvas = canvas;
  51. }
  52. AlignElementsContextPadProvider.$inject = [
  53. "contextPad",
  54. "popupMenu",
  55. "translate",
  56. "canvas"
  57. ];
  58. AlignElementsContextPadProvider.prototype.getMultiElementContextPadEntries = function(elements) {
  59. var actions = {};
  60. if (this._isAllowed(elements)) {
  61. assign(actions, this._getEntries(elements));
  62. }
  63. return actions;
  64. };
  65. AlignElementsContextPadProvider.prototype._isAllowed = function(elements) {
  66. return !this._popupMenu.isEmpty(elements, "align-elements");
  67. };
  68. AlignElementsContextPadProvider.prototype._getEntries = function() {
  69. var self = this;
  70. return {
  71. "align-elements": {
  72. group: "align-elements",
  73. title: self._translate("Align elements"),
  74. html: `<div class="entry">${AlignElementsIcons_default["align"]}</div>`,
  75. action: {
  76. click: function(event, target) {
  77. var position = self._getMenuPosition(target);
  78. assign(position, {
  79. cursor: {
  80. x: event.x,
  81. y: event.y
  82. }
  83. });
  84. self._popupMenu.open(target, "align-elements", position);
  85. }
  86. }
  87. }
  88. };
  89. };
  90. AlignElementsContextPadProvider.prototype._getMenuPosition = function(elements) {
  91. var Y_OFFSET = 5;
  92. var pad = this._contextPad.getPad(elements).html;
  93. var padRect = pad.getBoundingClientRect();
  94. var pos = {
  95. x: padRect.left,
  96. y: padRect.bottom + Y_OFFSET
  97. };
  98. return pos;
  99. };
  100. export {
  101. AlignElementsIcons_default,
  102. AlignElementsContextPadProvider
  103. };
  104. //# sourceMappingURL=chunk-I2KWQ44T.js.map