123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- import {
- assign
- } from "./chunk-4AK4GF4H.js";
- // node_modules/.pnpm/bpmn-js@16.3.2/node_modules/bpmn-js/lib/features/align-elements/AlignElementsIcons.js
- var icons = {
- align: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
- <line x1="200" y1="150" x2="200" y2="1850" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="500" y="150" width="1300" height="700" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="500" y="1150" width="700" height="700" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,
- bottom: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <line x1="150" y1="1650" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="150" y="350" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="1050" y="850" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,
- center: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <line x1="900" y1="150" x2="900" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="250" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="500" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,
- left: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <line x1="100" y1="150" x2="100" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="100" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="100" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,
- right: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <line x1="1650" y1="150" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="350" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="850" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,
- top: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <line x1="150" y1="150" x2="1650" y2="150" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="150" y="150" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="1050" y="150" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,
- middle: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <line x1="150" y1="900" x2="1650" y2="900" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="150" y="250" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="1050" y="500" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`
- };
- var AlignElementsIcons_default = icons;
- // node_modules/.pnpm/bpmn-js@16.3.2/node_modules/bpmn-js/lib/features/align-elements/AlignElementsContextPadProvider.js
- var LOW_PRIORITY = 900;
- function AlignElementsContextPadProvider(contextPad, popupMenu, translate, canvas) {
- contextPad.registerProvider(LOW_PRIORITY, this);
- this._contextPad = contextPad;
- this._popupMenu = popupMenu;
- this._translate = translate;
- this._canvas = canvas;
- }
- AlignElementsContextPadProvider.$inject = [
- "contextPad",
- "popupMenu",
- "translate",
- "canvas"
- ];
- AlignElementsContextPadProvider.prototype.getMultiElementContextPadEntries = function(elements) {
- var actions = {};
- if (this._isAllowed(elements)) {
- assign(actions, this._getEntries(elements));
- }
- return actions;
- };
- AlignElementsContextPadProvider.prototype._isAllowed = function(elements) {
- return !this._popupMenu.isEmpty(elements, "align-elements");
- };
- AlignElementsContextPadProvider.prototype._getEntries = function() {
- var self = this;
- return {
- "align-elements": {
- group: "align-elements",
- title: self._translate("Align elements"),
- html: `<div class="entry">${AlignElementsIcons_default["align"]}</div>`,
- action: {
- click: function(event, target) {
- var position = self._getMenuPosition(target);
- assign(position, {
- cursor: {
- x: event.x,
- y: event.y
- }
- });
- self._popupMenu.open(target, "align-elements", position);
- }
- }
- }
- };
- };
- AlignElementsContextPadProvider.prototype._getMenuPosition = function(elements) {
- var Y_OFFSET = 5;
- var pad = this._contextPad.getPad(elements).html;
- var padRect = pad.getBoundingClientRect();
- var pos = {
- x: padRect.left,
- y: padRect.bottom + Y_OFFSET
- };
- return pos;
- };
- export {
- AlignElementsIcons_default,
- AlignElementsContextPadProvider
- };
- //# sourceMappingURL=chunk-I2KWQ44T.js.map
|