diff --git a/app-v2/index.html b/app-v2/index.html index 71ef9a1..082406d 100644 --- a/app-v2/index.html +++ b/app-v2/index.html @@ -10,7 +10,7 @@ - + - + diff --git a/app-v2/main.b814f779ccdf2636.js b/app-v2/main.bcc6538b2752ae37.js similarity index 97% rename from app-v2/main.b814f779ccdf2636.js rename to app-v2/main.bcc6538b2752ae37.js index d520624..609800b 100644 --- a/app-v2/main.b814f779ccdf2636.js +++ b/app-v2/main.bcc6538b2752ae37.js @@ -63582,26 +63582,32 @@ module.exports = function whichTypedArray(value) { /***/ }), -/***/ 90080: +/***/ 20092: /*!**********************************!*\ - !*** ./src/app/BPMN-JS/index.js ***! + !*** ./src/app/app.component.ts ***! \**********************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ DomainStoryModeler) +/* harmony export */ AppComponent: () => (/* binding */ AppComponent) /* harmony export */ }); -/* harmony import */ var bpmn_js_lib_Modeler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! bpmn-js/lib/Modeler */ 3922); -/* harmony import */ var diagram_js_lib_features_resize__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! diagram-js/lib/features/resize */ 33485); -/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! min-dash */ 93673); -/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ 51270); -/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _modeler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modeler */ 45077); -/* harmony import */ var _modeler_labeling__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modeler/labeling */ 9148); -/* harmony import */ var _modeler_modeling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modeler/modeling */ 63493); -/* harmony import */ var _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Domain/Common/elementTypes */ 30236); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs */ 95981); +/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../environments/environment */ 45312); +/* harmony import */ var ngx_color_picker__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ngx-color-picker */ 54743); +/* harmony import */ var _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./domain/entities/constants */ 40550); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_workbench_services_settings_settings_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/workbench/services/settings/settings.service */ 1299); +/* harmony import */ var _tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tools/title/services/title.service */ 41535); +/* harmony import */ var _tools_export_services_export_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tools/export/services/export.service */ 39595); +/* harmony import */ var _tools_autosave_services_autosave_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tools/autosave/services/autosave.service */ 41707); +/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); +/* harmony import */ var _tools_replay_services_replay_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tools/replay/services/replay.service */ 3687); +/* harmony import */ var _workbench_presentation_header_header_header_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./workbench/presentation/header/header/header.component */ 38361); +/* harmony import */ var src_app_workbench_presentation_settings_settings_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/workbench/presentation/settings/settings.component */ 45263); +/* harmony import */ var src_app_tools_modeler_presentation_modeler_modeler_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/tools/modeler/presentation/modeler/modeler.component */ 87286); +/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @angular/common */ 56610); @@ -63610,1481 +63616,1120 @@ __webpack_require__.r(__webpack_exports__); -function DomainStoryModeler(options) { - bpmn_js_lib_Modeler__WEBPACK_IMPORTED_MODULE_5__["default"].call(this, options); - this._customElements = []; - this._groupElements = []; -} -inherits__WEBPACK_IMPORTED_MODULE_0___default()(DomainStoryModeler, bpmn_js_lib_Modeler__WEBPACK_IMPORTED_MODULE_5__["default"]); -DomainStoryModeler.prototype._modules = [].concat(DomainStoryModeler.prototype._modules, [_modeler__WEBPACK_IMPORTED_MODULE_1__["default"], _modeler_labeling__WEBPACK_IMPORTED_MODULE_2__["default"], _modeler_modeling__WEBPACK_IMPORTED_MODULE_3__["default"]], [diagram_js_lib_features_resize__WEBPACK_IMPORTED_MODULE_6__["default"]]); -/** - * add a single custom element to the underlying diagram - * - * @param {Object} customElement - */ -DomainStoryModeler.prototype._addCustomShape = function (customElement) { - let parentId = customElement.parent; - delete customElement.children; - delete customElement.parent; - this._customElements.push(customElement); - let canvas = this.get("canvas"), - elementFactory = this.get("elementFactory"); - let customAttrs = (0,min_dash__WEBPACK_IMPORTED_MODULE_7__.assign)({ - businessObject: customElement - }, customElement); - let customShape = elementFactory.create("shape", customAttrs); - if (isGroup(customElement)) { - this._groupElements[customElement.id] = customShape; + + + + + + + + +function AppComponent_Conditional_2_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelement"](0, "app-settings"); } - if (parentId) { - let parentShape = this._groupElements[parentId]; - if (isGroup(parentShape)) { - return canvas.addShape(customShape, parentShape, parentShape.id); +} +let AppComponent = /*#__PURE__*/(() => { + class AppComponent { + constructor(settingsService, titleService, exportService, autosaveService, cd, snackbar, replayService) { + this.settingsService = settingsService; + this.titleService = titleService; + this.exportService = exportService; + this.autosaveService = autosaveService; + this.cd = cd; + this.snackbar = snackbar; + this.version = _environments_environment__WEBPACK_IMPORTED_MODULE_0__.environment.version; + this.color = _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.BLACK; + this.skipNextColorUpdate = false; + // define preset colors that have good contrast on white background and are compatible to EventStorming notation + this.colorBox = [_domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.YELLOW, _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.ORANGE, _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.RED, _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.LIGHT_PINK, _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.DARK_PINK, _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.PURPLE, _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.BLUE, _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.CYAN, _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.GREEN, _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.LIME, _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.GREY, _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.BLACK]; + this.showSettings$ = new rxjs__WEBPACK_IMPORTED_MODULE_11__.BehaviorSubject(false); + this.showDescription$ = new rxjs__WEBPACK_IMPORTED_MODULE_11__.BehaviorSubject(true); + document.addEventListener('keydown', e => { + if (e.ctrlKey && e.key === 's') { + e.preventDefault(); + e.stopPropagation(); + if (this.exportService.isDomainStoryExportable()) { + this.exportService.downloadDST(); + } + } + if (e.ctrlKey && e.key === 'l') { + e.preventDefault(); + e.stopPropagation(); + document.getElementById('import')?.click(); + } + if ((e.key === 'ArrowRight' || e.key === 'ArrowUp') && replayService.getReplayOn()) { + e.preventDefault(); + e.stopPropagation(); + replayService.nextSentence(); + } + if ((e.key === 'ArrowLeft' || e.key === 'ArrowDown') && replayService.getReplayOn()) { + e.preventDefault(); + e.stopPropagation(); + replayService.previousSentence(); + } + if (e.key === 'Escape') { + e.preventDefault(); + e.stopPropagation(); + this.skipNextColorUpdate = true; + this.colorPicker.closeDialog(); + } + }); + document.addEventListener('defaultColor', event => { + const customEvent = event; + if (customEvent.detail.color === 'black') { + this.color = _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.BLACK; + } else { + this.color = customEvent.detail.color; + } + }); + document.addEventListener('openColorPicker', () => { + this.colorPicker.openDialog(); + }); + document.addEventListener('errorColoringOnlySvg', () => { + this.snackbar.open('Only SVG icons can be colored', undefined, { + duration: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.SNACKBAR_DURATION * 2, + panelClass: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.SNACKBAR_INFO + }); + }); } - } - return canvas.addShape(customShape); -}; -DomainStoryModeler.prototype._addCustomConnection = function (customElement) { - this._customElements.push(customElement); - let canvas = this.get("canvas"), - elementFactory = this.get("elementFactory"), - elementRegistry = this.get("elementRegistry"); - let customAttrs = (0,min_dash__WEBPACK_IMPORTED_MODULE_7__.assign)({ - businessObject: customElement - }, customElement); - let connection = elementFactory.create("connection", (0,min_dash__WEBPACK_IMPORTED_MODULE_7__.assign)(customAttrs, { - source: elementRegistry.get(customElement.source), - target: elementRegistry.get(customElement.target) - }), elementRegistry.get(customElement.source).parent); - return canvas.addConnection(connection); -}; -//** We import BusinessObjects, not the whole Canvas Object!!!!!!!! -DomainStoryModeler.prototype.importCustomElements = function (elements) { - this.get("eventBus").fire("diagram.clear", {}); - this._customElements = []; - this._groupElements = []; - this.addCustomElements(elements); -}; -/** - * add a number of custom elements and connections to the underlying diagram. - * - * @param {Array} customElements - */ -DomainStoryModeler.prototype.addCustomElements = function (customElements) { - if (!(0,min_dash__WEBPACK_IMPORTED_MODULE_7__.isArray)(customElements)) { - throw new Error("argument must be an array"); - } - let shapes = [], - connections = [], - groups = []; - customElements.forEach(function (customElement) { - if (isConnection(customElement)) { - connections.push(customElement); - } else if (isGroup(customElement)) { - groups.push(customElement); - } else { - shapes.push(customElement); + ngOnInit() { + this.showDescription$ = this.titleService.showDescription$; + this.showSettings$ = this.settingsService.showSettings$; } - }); - // add groups before shapes and shapes before connections so that connections - // can already rely on the shapes being part of the diagram - groups.forEach(this._addCustomShape, this); - shapes.forEach(this._addCustomShape, this); - connections.forEach(this._addCustomConnection, this); -}; -/** - * get custom elements with their current status. - * - * @return {Array} custom elements on the diagram - */ -DomainStoryModeler.prototype.getCustomElements = function () { - return this._customElements; -}; -// override standard function to prevent default elements on canvas -DomainStoryModeler.prototype.createDiagram = function (done) {}; -function isConnection(element) { - return element.type === _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_4__.ElementTypes.ACTIVITY || element.type === _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_4__.ElementTypes.CONNECTION; -} -function isGroup(element) { - return element && element.type === _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_4__.ElementTypes.GROUP; -} + onColorChanged(color) { + if (this.skipNextColorUpdate) { + this.skipNextColorUpdate = false; + return; + } + document.dispatchEvent(new CustomEvent('pickedColor', { + detail: { + color: color + } + })); + } + ngAfterViewInit() { + this.autosaveService.loadLatestDraft(); + this.cd.detectChanges(); + } + static #_ = this.ɵfac = function AppComponent_Factory(t) { + return new (t || AppComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](src_app_workbench_services_settings_settings_service__WEBPACK_IMPORTED_MODULE_2__.SettingsService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_3__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_tools_export_services_export_service__WEBPACK_IMPORTED_MODULE_4__.ExportService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_tools_autosave_services_autosave_service__WEBPACK_IMPORTED_MODULE_5__.AutosaveService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_10__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_12__.MatSnackBar), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_tools_replay_services_replay_service__WEBPACK_IMPORTED_MODULE_6__.ReplayService)); + }; + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineComponent"]({ + type: AppComponent, + selectors: [["app-root"]], + viewQuery: function AppComponent_Query(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵviewQuery"](ngx_color_picker__WEBPACK_IMPORTED_MODULE_13__.ColorPickerDirective, 5); + } + if (rf & 2) { + let _t; + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵloadQuery"]()) && (ctx.colorPicker = _t.first); + } + }, + decls: 36, + vars: 40, + consts: [["role", "main", 1, "content"], ["id", "colorPicker", 2, "display", "none", "height", "0", 3, "colorPickerChange", "colorPickerClose", "cpPresetColors", "colorPicker"], ["src", "favicon.ico", "height", "24", "alt", "Egon Logo"], ["href", "https://egon.io", "target", "_blank"], ["href", "https://egon.io/changelog", "target", "_blank"], ["src", "assets/logo/wps-icon.ico", "height", "24", "alt", "WPS Logo"], ["href", "https://www.wps.de/", "target", "_blank"], ["href", "https://www.wps.de/datenschutz/", "target", "_blank"], ["href", "https://www.wps.de/impressum/", "target", "_blank"]], + template: function AppComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](0, "div", 0)(1, "input", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtwoWayListener"]("colorPickerChange", function AppComponent_Template_input_colorPickerChange_1_listener($event) { + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtwoWayBindingSet"](ctx.color, $event) || (ctx.color = $event); + return $event; + }); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("colorPickerClose", function AppComponent_Template_input_colorPickerClose_1_listener($event) { + return ctx.onColorChanged($event); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtemplate"](2, AppComponent_Conditional_2_Template, 1, 0, "app-settings"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](3, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](4, "div"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](5, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](6, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](7, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](8, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](9, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelement"](10, "app-header"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](11, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](12, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelement"](13, "app-modeler"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](14, "div"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](15, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](16, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](17, "span"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelement"](18, "img", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](19, "a", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](20, " egon.io"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](21, "span"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](22, "version: "); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](23, "a", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](24); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](25, "span"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](26, "by "); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelement"](27, "img", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](28, "a", 6); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](29, "WPS"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](30, "span")(31, "a", 7); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](32, "Privacy"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](33, "span")(34, "a", 8); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](35, "Imprint"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()()()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵstyleProp"]("background", ctx.color); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵproperty"]("cpPresetColors", ctx.colorBox); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtwoWayProperty"]("colorPicker", ctx.color); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵconditional"](2, _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](3, 20, ctx.showSettings$) ? 2 : -1); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵclassProp"]("headerAndCanvas", !_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](5, 22, ctx.showSettings$) && _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](6, 24, ctx.showDescription$))("headerAndCanvasCollapsed", !_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](7, 26, ctx.showSettings$) && !_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](8, 28, ctx.showDescription$))("hidden", _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](9, 30, ctx.showSettings$)); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](6); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵclassProp"]("header", _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](11, 32, ctx.showDescription$))("headerCollapsed", !_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](12, 34, ctx.showDescription$)); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵclassProp"]("logoContainer", !_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](15, 36, ctx.showSettings$))("hidden", _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](16, 38, ctx.showSettings$)); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](10); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtextInterpolate"](ctx.version); + } + }, + dependencies: [ngx_color_picker__WEBPACK_IMPORTED_MODULE_13__.ColorPickerDirective, _workbench_presentation_header_header_header_component__WEBPACK_IMPORTED_MODULE_7__.HeaderComponent, src_app_workbench_presentation_settings_settings_component__WEBPACK_IMPORTED_MODULE_8__.SettingsComponent, src_app_tools_modeler_presentation_modeler_modeler_component__WEBPACK_IMPORTED_MODULE_9__.ModelerComponent, _angular_common__WEBPACK_IMPORTED_MODULE_14__.AsyncPipe], + styles: [".content[_ngcontent-%COMP%] {\n height: 100%;\n overflow: hidden;\n}\n\n\n\n.headerAndCanvas[_ngcontent-%COMP%] {\n height: 100%;\n width: 100%;\n display: grid;\n grid-template-rows: min-content auto;\n overflow: hidden;\n}\n\n.headerAndCanvasCollapsed[_ngcontent-%COMP%] {\n height: 100%;\n width: 100%;\n display: grid;\n grid-template-rows: min-content auto;\n overflow: hidden;\n}\n\n.settings[_ngcontent-%COMP%] {\n height: 100%;\n}\n\n.header[_ngcontent-%COMP%] {\n display: grid;\n grid-template-rows: min-content 155px;\n}\n\n\n\n.logoContainer[_ngcontent-%COMP%] {\n display: flex;\n position: absolute;\n bottom: 0;\n right: 100px;\n align-items: flex-end;\n}\n.logoContainer[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n margin-left: 16px;\n margin-bottom: 14px;\n align-items: center;\n}\n\n.hidden[_ngcontent-%COMP%] {\n height: 1px;\n width: 1px;\n}\n\n#wrapper[_ngcontent-%COMP%] {\n padding: 16px;\n min-height: 100%;\n height: 100%;\n box-sizing: border-box; \n\n}\n\n#tab-group[_ngcontent-%COMP%] {\n height: 100%;\n}\n\n#tab-group[_ngcontent-%COMP%] mat-tab-body[_ngcontent-%COMP%] {\n flex-grow: 1;\n}\n\n.mat-button-toggle-label-content[_ngcontent-%COMP%] {\n font-size: 10pt !important;\n padding: 0 5px !important;\n line-height: inherit !important;\n}\n\n .mdc-text-field--filled:not(.mdc-text-field--disabled) {\n background-color: white;\n}\n\nspan[_ngcontent-%COMP%] *[_ngcontent-%COMP%] {\n vertical-align: middle;\n}\n\nspan[_ngcontent-%COMP%] {\n height: 24px;\n}"] + }); + } + return AppComponent; +})(); /***/ }), -/***/ 1080: -/*!********************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/change-icon/replace.js ***! - \********************************************************/ +/***/ 50635: +/*!*******************************!*\ + !*** ./src/app/app.module.ts ***! + \*******************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ Replace) +/* harmony export */ AppModule: () => (/* binding */ AppModule) /* harmony export */ }); -/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ 93673); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! @angular/platform-browser */ 76098); +/* harmony import */ var _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! @angular/material/checkbox */ 63422); +/* harmony import */ var _angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! @angular/platform-browser/animations */ 7573); +/* harmony import */ var src_app_workbench_presentation_settings_settings_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/workbench/presentation/settings/settings.component */ 45263); +/* harmony import */ var src_app_app_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/app.component */ 20092); +/* harmony import */ var src_app_tools_export_services_export_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/tools/export/services/export.service */ 39595); +/* harmony import */ var src_app_tools_import_services_import_domain_story_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/tools/import/services/import-domain-story.service */ 93586); +/* harmony import */ var src_app_tools_import_services_import_repair_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/tools/import/services/import-repair.service */ 56511); +/* harmony import */ var src_app_tools_modeler_services_modeler_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/tools/modeler/services/modeler.service */ 40439); +/* harmony import */ var src_app_tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/tools/title/services/title.service */ 41535); +/* harmony import */ var src_app_tools_label_dictionary_services_label_dictionary_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/tools/label-dictionary/services/label-dictionary.service */ 69731); +/* harmony import */ var src_app_tools_replay_services_replay_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/tools/replay/services/replay.service */ 3687); +/* harmony import */ var src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/domain/services/element-registry.service */ 85511); +/* harmony import */ var src_app_tools_icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! src/app/tools/icon-set-config/services/icon-set-configuration.service */ 46527); +/* harmony import */ var src_app_tools_label_dictionary_services_mass_naming_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! src/app/tools/label-dictionary/services/mass-naming.service */ 75961); +/* harmony import */ var src_app_domain_presentation_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! src/app/domain/presentation/info-dialog/info-dialog.component */ 10454); +/* harmony import */ var src_app_tools_export_presentation_export_dialog_export_dialog_component__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! src/app/tools/export/presentation/export-dialog/export-dialog.component */ 2200); +/* harmony import */ var src_app_tools_modeler_presentation_activity_dialog_activity_dialog_component__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! src/app/tools/modeler/presentation/activity-dialog/activity-dialog.component */ 89142); +/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! @angular/forms */ 37222); +/* harmony import */ var src_app_tools_title_presentation_title_dialog_title_dialog_component__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! src/app/tools/title/presentation/title-dialog/title-dialog.component */ 35458); +/* harmony import */ var src_app_tools_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! src/app/tools/icon-set-config/services/icon-dictionary.service */ 6932); +/* harmony import */ var src_app_tools_modeler_presentation_modeler_modeler_component__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! src/app/tools/modeler/presentation/modeler/modeler.component */ 87286); +/* harmony import */ var src_app_workbench_presentation_settings_settings_module__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! src/app/workbench/presentation/settings/settings.module */ 98830); +/* harmony import */ var _tools_autosave_services_autosave_service__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./tools/autosave/services/autosave.service */ 41707); +/* harmony import */ var _tools_label_dictionary_presentation_label_dictionary_dialog_label_dictionary_dialog_component__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./tools/label-dictionary/presentation/label-dictionary-dialog/label-dictionary-dialog.component */ 68701); +/* harmony import */ var _material_module__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./material.module */ 89439); +/* harmony import */ var ngx_color_picker__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ngx-color-picker */ 54743); +/* harmony import */ var _domain_services_dirty_flag_service__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./domain/services/dirty-flag.service */ 94658); +/* harmony import */ var _tools_icon_set_config_services_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./tools/icon-set-config/services/icon-set-customization.service */ 46252); +/* harmony import */ var _tools_modeler_bpmn_modeler_context_pad_domainStoryContextPadProvider__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./tools/modeler/bpmn/modeler/context-pad/domainStoryContextPadProvider */ 57218); +/* harmony import */ var _tools_modeler_bpmn_modeler_palette_domainStoryPalette__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./tools/modeler/bpmn/modeler/palette/domainStoryPalette */ 60148); +/* harmony import */ var _tools_modeler_bpmn_modeler_domainStoryRenderer__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./tools/modeler/bpmn/modeler/domainStoryRenderer */ 79552); +/* harmony import */ var _tools_modeler_bpmn_modeler_labeling_dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./tools/modeler/bpmn/modeler/labeling/dsLabelEditingProvider */ 64467); +/* harmony import */ var _tools_modeler_bpmn_modeler_change_icon_replaceOptions__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./tools/modeler/bpmn/modeler/change-icon/replaceOptions */ 18405); +/* harmony import */ var _tools_modeler_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./tools/modeler/bpmn/modeler/numbering/numbering */ 14945); +/* harmony import */ var _tools_modeler_bpmn_modeler_updateHandler_activityUpdateHandlers__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./tools/modeler/bpmn/modeler/updateHandler/activityUpdateHandlers */ 56185); +/* harmony import */ var _workbench_presentation_header_header_header_component__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./workbench/presentation/header/header/header.component */ 38361); +/* harmony import */ var _workbench_presentation_header_domain_story_modeler_module_module__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./workbench/presentation/header/domain-story-modeler-module.module */ 78435); +/* harmony import */ var _tools_label_dictionary_presentation_label_dictionary_label_dictionary_component__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./tools/label-dictionary/presentation/label-dictionary/label-dictionary.component */ 36921); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -/** - * service that allow replacing of elements. - */ -function Replace(modeling) { - this._modeling = modeling; -} -/** - * @param {Element} oldElement - element to be replaced - * @param {Object} newElementData - containing information about the new Element, for example height, width, type. - * @param modeling - */ -function replaceElement(oldElement, newElementData, modeling) { - // let modeling = this._modeling; - let newElement = setCenterOfElement(newElementData, oldElement, modeling); - let outgoingActivities = newElement.outgoing; - let incomingActivities = newElement.incoming; - outgoingActivities.forEach(element => { - element.businessObject.source = newElement.id; - }); - incomingActivities.forEach(element => { - element.businessObject.target = newElement.id; - }); - return newElement; -} -function setCenterOfElement(newElementData, oldElement, modeling) { - newElementData.x = Math.ceil(oldElement.x + (newElementData.width || oldElement.width) / 2); - newElementData.y = Math.ceil(oldElement.y + (newElementData.height || oldElement.height) / 2); - (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)(newElementData, { - name: oldElement.businessObject.name - }); - return modeling.replaceShape(oldElement, newElementData, {}); -} -Replace.prototype.replaceElement = replaceElement; -/***/ }), -/***/ 96554: -/*!********************************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/change-icon/replaceMenuProvider.js ***! - \********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ ReplaceMenuProvider) -/* harmony export */ }); -/* harmony import */ var _replace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./replace */ 1080); -/* harmony import */ var _replaceOptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./replaceOptions */ 66252); -/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! min-dash */ 93673); -/** - * This module is an element agnostic replace menu provider for the popup menu. - */ -function ReplaceMenuProvider(modeling) { - this._dsReplace = new _replace__WEBPACK_IMPORTED_MODULE_0__["default"](modeling); - this._modeling = modeling; -} -ReplaceMenuProvider.$inject = ["modeling"]; -/** - * Get all entries from replaceOptions for the given element and apply filters - * on them. Get for example only elements, which are different from the current one. - * - * @param {djs.model.Base} element - * - * @return {Array} a list of menu entry items - */ -ReplaceMenuProvider.prototype.getEntries = function (element) { - let entries; - if (element.type.includes("actor")) { - entries = _replaceOptions__WEBPACK_IMPORTED_MODULE_1__.actorReplaceOptions(element.type); - } else if (element.type.includes("workObject")) { - entries = _replaceOptions__WEBPACK_IMPORTED_MODULE_1__.workObjectReplaceOptions(element.type); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +let AppModule = /*#__PURE__*/(() => { + class AppModule { + constructor(autosaveService) { + this.autosaveService = autosaveService; + // autosaveService wird so automatisch initialisiert, auf keinen Fall entfernen! + } + + ngDoBootstrap(app) { + const componentElement = document.createElement('app-root'); + document.body.append(componentElement); + app.bootstrap(src_app_app_component__WEBPACK_IMPORTED_MODULE_1__.AppComponent); + } + static #_ = this.ɵfac = function AppModule_Factory(t) { + return new (t || AppModule)(_angular_core__WEBPACK_IMPORTED_MODULE_34__["ɵɵinject"](_tools_autosave_services_autosave_service__WEBPACK_IMPORTED_MODULE_19__.AutosaveService)); + }; + static #_2 = this.ɵmod = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_34__["ɵɵdefineNgModule"]({ + type: AppModule + }); + static #_3 = this.ɵinj = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_34__["ɵɵdefineInjector"]({ + providers: [_tools_autosave_services_autosave_service__WEBPACK_IMPORTED_MODULE_19__.AutosaveService, src_app_tools_export_services_export_service__WEBPACK_IMPORTED_MODULE_2__.ExportService, src_app_tools_import_services_import_domain_story_service__WEBPACK_IMPORTED_MODULE_3__.ImportDomainStoryService, src_app_tools_import_services_import_repair_service__WEBPACK_IMPORTED_MODULE_4__.ImportRepairService, src_app_tools_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_16__.IconDictionaryService, src_app_tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_6__.TitleService, src_app_tools_label_dictionary_services_label_dictionary_service__WEBPACK_IMPORTED_MODULE_7__.LabelDictionaryService, src_app_tools_replay_services_replay_service__WEBPACK_IMPORTED_MODULE_8__.ReplayService, src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_9__.ElementRegistryService, src_app_tools_icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_10__.IconSetConfigurationService, src_app_tools_modeler_services_modeler_service__WEBPACK_IMPORTED_MODULE_5__.ModelerService, src_app_tools_label_dictionary_services_mass_naming_service__WEBPACK_IMPORTED_MODULE_11__.MassNamingService, _angular_forms__WEBPACK_IMPORTED_MODULE_35__.UntypedFormBuilder, { + provide: _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_36__.MAT_CHECKBOX_DEFAULT_OPTIONS, + useValue: { + clickAction: 'noop' + } + }, { + provide: _angular_core__WEBPACK_IMPORTED_MODULE_34__.APP_INITIALIZER, + useFactory: initialize, + multi: true, + deps: [_domain_services_dirty_flag_service__WEBPACK_IMPORTED_MODULE_22__.DirtyFlagService, src_app_tools_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_16__.IconDictionaryService, src_app_tools_icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_10__.IconSetConfigurationService, src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_9__.ElementRegistryService, src_app_tools_label_dictionary_services_label_dictionary_service__WEBPACK_IMPORTED_MODULE_7__.LabelDictionaryService] + }, { + provide: _tools_icon_set_config_services_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_23__.IconSetChangedService, + useExisting: src_app_tools_import_services_import_domain_story_service__WEBPACK_IMPORTED_MODULE_3__.ImportDomainStoryService + }], + imports: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_37__.BrowserModule, _angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_38__.NoopAnimationsModule, _angular_forms__WEBPACK_IMPORTED_MODULE_35__.ReactiveFormsModule, src_app_workbench_presentation_settings_settings_module__WEBPACK_IMPORTED_MODULE_18__.SettingsModule, _workbench_presentation_header_domain_story_modeler_module_module__WEBPACK_IMPORTED_MODULE_32__.DomainStoryModelerModuleModule, _material_module__WEBPACK_IMPORTED_MODULE_21__.MaterialModule, ngx_color_picker__WEBPACK_IMPORTED_MODULE_39__.ColorPickerModule] + }); } - return this._createEntries(element, entries); -}; -/** - * Creates an array of menu entry objects for a given element and filters the replaceOptions - * according to a filter function. - * - * @param {djs.model.Base} element - * @param {Object} replaceOptions - * - * @return {Array} a list of menu items - */ -ReplaceMenuProvider.prototype._createEntries = function (element, replaceOptions) { - let menuEntries = []; - let self = this; - (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.forEach)(replaceOptions, function (definition) { - let entry = self._createMenuEntry(definition, element); - menuEntries.push(entry); + return AppModule; +})(); +(function () { + (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_34__["ɵɵsetNgModuleScope"](AppModule, { + declarations: [_workbench_presentation_header_header_header_component__WEBPACK_IMPORTED_MODULE_31__.HeaderComponent, src_app_workbench_presentation_settings_settings_component__WEBPACK_IMPORTED_MODULE_0__.SettingsComponent, src_app_app_component__WEBPACK_IMPORTED_MODULE_1__.AppComponent, src_app_domain_presentation_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_12__.InfoDialogComponent, src_app_tools_export_presentation_export_dialog_export_dialog_component__WEBPACK_IMPORTED_MODULE_13__.ExportDialogComponent, src_app_tools_modeler_presentation_activity_dialog_activity_dialog_component__WEBPACK_IMPORTED_MODULE_14__.ActivityDialogComponent, src_app_tools_title_presentation_title_dialog_title_dialog_component__WEBPACK_IMPORTED_MODULE_15__.TitleDialogComponent, src_app_tools_modeler_presentation_modeler_modeler_component__WEBPACK_IMPORTED_MODULE_17__.ModelerComponent, _tools_label_dictionary_presentation_label_dictionary_dialog_label_dictionary_dialog_component__WEBPACK_IMPORTED_MODULE_20__.LabelDictionaryDialogComponent], + imports: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_37__.BrowserModule, _angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_38__.NoopAnimationsModule, _angular_forms__WEBPACK_IMPORTED_MODULE_35__.ReactiveFormsModule, src_app_workbench_presentation_settings_settings_module__WEBPACK_IMPORTED_MODULE_18__.SettingsModule, _workbench_presentation_header_domain_story_modeler_module_module__WEBPACK_IMPORTED_MODULE_32__.DomainStoryModelerModuleModule, _material_module__WEBPACK_IMPORTED_MODULE_21__.MaterialModule, ngx_color_picker__WEBPACK_IMPORTED_MODULE_39__.ColorPickerModule] }); - return menuEntries; -}; -/** - * Creates and returns a single menu entry item. - * - * @param {Object} definition a single replace options definition object - * @param {djs.model.Base} element - * @param {Function} [action] an action callback function which gets called when - * the menu entry is being triggered. - * - * @return {Object} menu entry item - */ -ReplaceMenuProvider.prototype._createMenuEntry = function (definition, element, action) { - let replaceElement = this._dsReplace.replaceElement; - let modeling = this._modeling; - let replaceAction = function () { - return replaceElement(element, definition.target, modeling); - }; - action = action || replaceAction; - return { - label: definition.label, - className: definition.className, - id: definition.actionName, - action: action +})(); +_angular_core__WEBPACK_IMPORTED_MODULE_34__["ɵɵsetComponentScope"](_tools_label_dictionary_presentation_label_dictionary_dialog_label_dictionary_dialog_component__WEBPACK_IMPORTED_MODULE_20__.LabelDictionaryDialogComponent, [_tools_label_dictionary_presentation_label_dictionary_label_dictionary_component__WEBPACK_IMPORTED_MODULE_33__.LabelDictionaryComponent, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_40__.MatDialogContent], []); +function initialize(dirtyFlagService, iconDictionaryService, configurationService, elementRegistryService, labelDictionaryService) { + return () => { + (0,_tools_modeler_bpmn_modeler_context_pad_domainStoryContextPadProvider__WEBPACK_IMPORTED_MODULE_24__.initializeContextPadProvider)(dirtyFlagService, iconDictionaryService); + /** The Palette and the Context Menu need the Icons present in the Domain, + * so the IconDictionaryService and the IconSetConfigurationService needs to be given to the Palette **/ + (0,_tools_modeler_bpmn_modeler_palette_domainStoryPalette__WEBPACK_IMPORTED_MODULE_25__.initializePalette)(iconDictionaryService, configurationService); + (0,_tools_modeler_bpmn_modeler_domainStoryRenderer__WEBPACK_IMPORTED_MODULE_26__.initializeRenderer)(iconDictionaryService, elementRegistryService, dirtyFlagService); + (0,_tools_modeler_bpmn_modeler_labeling_dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_27__.initializeLabelEditingProvider)(labelDictionaryService); + (0,_tools_modeler_bpmn_modeler_change_icon_replaceOptions__WEBPACK_IMPORTED_MODULE_28__.initializeReplaceOptions)(iconDictionaryService); + (0,_tools_modeler_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_29__.initializeNumbering)(elementRegistryService); + (0,_tools_modeler_bpmn_modeler_updateHandler_activityUpdateHandlers__WEBPACK_IMPORTED_MODULE_30__.initializeActivityUpdateHandler)(elementRegistryService); }; -}; +} /***/ }), -/***/ 66252: -/*!***************************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/change-icon/replaceOptions.js ***! - \***************************************************************/ +/***/ 56165: +/*!**************************************************!*\ + !*** ./src/app/domain/entities/configuration.ts ***! + \**************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ actorReplaceOptions: () => (/* binding */ actorReplaceOptions), -/* harmony export */ initializeReplaceOptions: () => (/* binding */ initializeReplaceOptions), -/* harmony export */ workObjectReplaceOptions: () => (/* binding */ workObjectReplaceOptions) +/* harmony export */ Configuration: () => (/* binding */ Configuration) /* harmony export */ }); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); - -let iconDictionaryService; -function initializeReplaceOptions(iconDictionary) { - iconDictionaryService = iconDictionary; -} -function actorReplaceOptions(name) { - const actorTypes = iconDictionaryService.getTypeDictionary(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR); - let replaceOption = {}; - let i = 0; - actorTypes.keysArray().forEach(actorType => { - if (!name.includes(actorType)) { - const typeName = actorType; - replaceOption[i] = { - label: "Change to " + typeName, - actionName: "replace-with-actor-" + typeName.toLowerCase(), - className: iconDictionaryService.getIconForBPMN(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR, actorType), - target: { - type: `${src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR}${actorType}` - } - }; - i++; - } - }); - return replaceOption; -} -function workObjectReplaceOptions(name) { - const workObjectTypes = iconDictionaryService.getTypeDictionary(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT); - let replaceOption = {}; - let i = 0; - workObjectTypes.keysArray().forEach(workObjectType => { - if (!name.includes(workObjectType)) { - const typeName = workObjectType; - replaceOption[i] = { - label: "Change to " + typeName, - actionName: "replace-with-actor-" + typeName, - className: iconDictionaryService.getIconForBPMN(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT, workObjectType), - target: { - type: `${src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT}${workObjectType}` - } - }; - } - i++; - }); - return replaceOption; +class Configuration { + constructor(actors, workObjects) { + this.actors = actors; + this.workObjects = workObjects; + } } /***/ }), -/***/ 74669: -/*!******************************************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/context-pad/domainStoryContextPadProvider.js ***! - \******************************************************************************/ +/***/ 40550: +/*!**********************************************!*\ + !*** ./src/app/domain/entities/constants.ts ***! + \**********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ DomainStoryContextPadProvider), -/* harmony export */ initializeContextPadProvider: () => (/* binding */ initializeContextPadProvider) +/* harmony export */ APPENDED_ICONS_TAG: () => (/* binding */ APPENDED_ICONS_TAG), +/* harmony export */ BLACK: () => (/* binding */ BLACK), +/* harmony export */ BLUE: () => (/* binding */ BLUE), +/* harmony export */ CYAN: () => (/* binding */ CYAN), +/* harmony export */ DARK_PINK: () => (/* binding */ DARK_PINK), +/* harmony export */ DEFAULT_AUTOSAVES_ENABLED: () => (/* binding */ DEFAULT_AUTOSAVES_ENABLED), +/* harmony export */ DEFAULT_AUTOSAVES_INTERVAL: () => (/* binding */ DEFAULT_AUTOSAVES_INTERVAL), +/* harmony export */ DEFAULT_AUTOSAVES_MAX_DRAFTS: () => (/* binding */ DEFAULT_AUTOSAVES_MAX_DRAFTS), +/* harmony export */ GREEN: () => (/* binding */ GREEN), +/* harmony export */ GREY: () => (/* binding */ GREY), +/* harmony export */ ICON_SET_CONFIGURATION_TAG: () => (/* binding */ ICON_SET_CONFIGURATION_TAG), +/* harmony export */ IMPLICIT_ROOT_ID: () => (/* binding */ IMPLICIT_ROOT_ID), +/* harmony export */ INITIAL_DESCRIPTION: () => (/* binding */ INITIAL_DESCRIPTION), +/* harmony export */ INITIAL_ICON_SET_NAME: () => (/* binding */ INITIAL_ICON_SET_NAME), +/* harmony export */ INITIAL_TITLE: () => (/* binding */ INITIAL_TITLE), +/* harmony export */ LIGHT_PINK: () => (/* binding */ LIGHT_PINK), +/* harmony export */ LIME: () => (/* binding */ LIME), +/* harmony export */ ORANGE: () => (/* binding */ ORANGE), +/* harmony export */ PURPLE: () => (/* binding */ PURPLE), +/* harmony export */ RED: () => (/* binding */ RED), +/* harmony export */ SNACKBAR_DURATION: () => (/* binding */ SNACKBAR_DURATION), +/* harmony export */ SNACKBAR_ERROR: () => (/* binding */ SNACKBAR_ERROR), +/* harmony export */ SNACKBAR_INFO: () => (/* binding */ SNACKBAR_INFO), +/* harmony export */ SNACKBAR_SUCCESS: () => (/* binding */ SNACKBAR_SUCCESS), +/* harmony export */ YELLOW: () => (/* binding */ YELLOW) /* harmony export */ }); -/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ 51270); -/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var bpmn_js_lib_features_context_pad_ContextPadProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! bpmn-js/lib/features/context-pad/ContextPadProvider */ 78809); -/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! min-dash */ 93673); -/* harmony import */ var _numbering_numbering__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../numbering/numbering */ 37126); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/Domain/Icon-Set-Configuration/allIcons */ 57488); - - - - - - - +/** DEFAULT VALUES **/ +const INITIAL_TITLE = '< title >'; +const INITIAL_DESCRIPTION = ''; +const INITIAL_ICON_SET_NAME = 'default'; +/** LocalStorageTags **/ +const APPENDED_ICONS_TAG = 'appendedIcons'; +// String value of tag should not be renamed, because existing configurations would not load +const ICON_SET_CONFIGURATION_TAG = 'domainConfigurationTag'; +/** AUTOSAVE DEFAULTS **/ +const DEFAULT_AUTOSAVES_ENABLED = true; +const DEFAULT_AUTOSAVES_MAX_DRAFTS = 5; +const DEFAULT_AUTOSAVES_INTERVAL = 30; +/** SNACKBAR **/ +const SNACKBAR_DURATION = 2000; +const SNACKBAR_SUCCESS = 'snackbar_success'; +const SNACKBAR_ERROR = 'snackbar_error'; +const SNACKBAR_INFO = 'snackbar_info'; +/** BPMN_RELEVANT_CONSTANTS **/ +const IMPLICIT_ROOT_ID = '__implicitroot'; +/** COLOR PICKER DEFAULT COLORS **/ +const YELLOW = '#FDD835'; +const ORANGE = '#FB8C00'; +const RED = '#D32F2F'; +const LIGHT_PINK = '#F48FB1'; +const DARK_PINK = '#EC407A'; +const PURPLE = '#8E24AA'; +const BLUE = '#1E88E5'; +const CYAN = '#00ACC1'; +const GREEN = '#43A047'; +const LIME = '#C0CA33'; +const GREY = '#9E9E9E'; +const BLACK = '#000000'; + +/***/ }), + +/***/ 20843: +/*!***********************************************!*\ + !*** ./src/app/domain/entities/dictionary.ts ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -let dirtyFlagService; -let iconDictionaryService; -function initializeContextPadProvider(dirtyFlag, iconDictionary) { - dirtyFlagService = dirtyFlag; - iconDictionaryService = iconDictionary; -} -function DomainStoryContextPadProvider(injector, connect, translate, elementFactory, create, canvas, contextPad, popupMenu, replaceMenuProvider, commandStack, eventBus, modeling) { - let startConnect; - let selectedElement; - injector.invoke(bpmn_js_lib_features_context_pad_ContextPadProvider__WEBPACK_IMPORTED_MODULE_4__["default"], this); - let autoPlace = injector.get("autoPlace", false); - let cached = (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.bind)(this.getContextPadEntries, this); - document.addEventListener("pickedColor", event => { - if (selectedElement) { - executeCommandStack(event); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Dictionary: () => (/* binding */ Dictionary), +/* harmony export */ Entry: () => (/* binding */ Entry) +/* harmony export */ }); +class Dictionary { + constructor() { + this.entries = []; + } + get length() { + return this.entries.length; + } + all() { + return this.entries; + } + size() { + return this.entries.length; + } + isEmpty() { + return this.entries.length <= 0; + } + has(key) { + return this.entries.some(entry => entry.key === key); + } + set(key, value) { + if (!this.has(key)) { + this.entries.push(new Entry(value, key)); } - }); - popupMenu.registerProvider("ds-replace", replaceMenuProvider); - popupMenu.registerProvider("bpmn-replace", replaceMenuProvider); - this.getContextPadEntries = function (element) { - selectedElement = element; - document.dispatchEvent(new CustomEvent("defaultColor", { - detail: { - color: selectedElement.businessObject.pickedColor ?? "#000000" - } - })); - const allStandardIconKeys = (0,src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_3__.getAllStandardIconKeys)(); - let actions = cached(element); - startConnect = function (event, element, autoActivate) { - connect.start(event, element, autoActivate); - }; - if (element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT)) { - if (!src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.isCustomType(element.type) || src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.isCustomSvgType(element.type)) { - addColorChange(actions); - } - addConnectWithActivity(actions, startConnect); - addTextAnnotation(actions); - addActors(appendAction, actions); - addWorkObjects(appendAction, actions); - addChangeWorkObjectTypeMenu(actions); - } else if (element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR)) { - if (!src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.isCustomType(element.type) || src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.isCustomSvgType(element.type)) { - addColorChange(actions); - } - addConnectWithActivity(actions, startConnect); - addTextAnnotation(actions); - addWorkObjects(appendAction, actions); - addChangeActorTypeMenu(actions); - } else if (element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.GROUP)) { - delete actions.delete; - addTextAnnotation(actions); - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { - deleteGroup: { - group: "edit", - className: "bpmn-icon-trash", - title: "Remove Group without Child-Elements", - action: { - click: function (event, element) { - modeling.removeGroup(element); - dirtyFlagService.makeDirty(); - } - } - } - }); - addColorChange(actions); - } else if (element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTIVITY)) { - moveDeleteActionToEndOfArray(actions); - addColorChange(actions); - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { - delete: { - group: "edit", - className: "bpmn-icon-trash", - title: "Remove", - action: { - click: function (event, element) { - modeling.removeElements({ - element - }); - dirtyFlagService.makeDirty(); - } - } - } - }); + } + add(value, key) { + this.set(key, value); + } + putEntry(entry) { + if (!this.has(entry.key)) { + this.entries.push(new Entry(entry.value, entry.key)); } - return actions; - }; - function moveDeleteActionToEndOfArray(actions) { - delete actions.delete; - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { - changeDirection: { - group: "edit", - className: "icon-domain-story-changeDirection", - title: translate("Change direction"), - action: { - // event needs to be addressed - click: function (event, element) { - changeDirection(element); - } - } - } - }); } - function addChangeActorTypeMenu(actions) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { - replace: { - group: "edit", - className: "bpmn-icon-screw-wrench", - title: translate("Change type"), - action: { - click: function (event, element) { - let position = (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(getReplaceMenuPosition(element), { - cursor: { - x: event.x, - y: event.y - } - }); - popupMenu.open(element, "ds-replace", position); - } - } - } - }); + keysArray() { + return this.entries.map(entry => entry.key); } - function addColorChange(actions) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { - colorChange: { - group: "edit", - className: "icon-domain-story-color-picker", - title: translate("Change color"), - action: { - click: function (event, element) { - document.dispatchEvent(new CustomEvent("openColorPicker")); - } - } - } + addEach(object) { + Object.keys(object).forEach(key => { + this.set(key, object[key]); }); } - function addTextAnnotation(actions) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { - "append.text-annotation": appendAction(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.TEXTANNOTATION, "bpmn-icon-text-annotation", "textannotation", "connect") - }); + appendDict(dict) { + dict.entries.forEach(entry => this.putEntry(entry)); } - function addConnectWithActivity(actions, startConnect) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { - connect: { - group: "connect", - className: "bpmn-icon-connection", - title: translate("Connect with activity"), - action: { - click: startConnect, - dragstart: startConnect - } - } - }); + clear() { + this.entries = []; } - function addWorkObjects(appendAction, actions) { - let workObjectTypes = iconDictionaryService.getTypeDictionary(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT); - workObjectTypes.keysArray().forEach(workObjectType => { - let name = workObjectType; - let icon = iconDictionaryService.getIconForBPMN(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT, workObjectType); - let action = []; - action["append.workObject" + name] = appendAction(`${src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT}${workObjectType}`, icon, name, "workObjects"); - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, action); - }); + delete(key) { + this.entries = this.entries.filter(entry => entry.key !== key); } - function addActors(appendAction, actions) { - let actorTypes = iconDictionaryService.getTypeDictionary(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR); - actorTypes.keysArray().forEach(actorType => { - let name = actorType; - let icon = iconDictionaryService.getIconForBPMN(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR, actorType); - let action = []; - action["append.actor" + name] = appendAction(`${src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR}${actorType}`, icon, name, "actors"); - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, action); - }); + get(key) { + const found = this.entries.filter(entry => entry.key === key); + return found[0] ? found[0].value : null; } - function addChangeWorkObjectTypeMenu(actions) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { - replace: { - group: "edit", - className: "bpmn-icon-screw-wrench", - title: translate("Change type"), - action: { - click: function (event, element) { - let position = (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(getReplaceMenuPosition(element), { - cursor: { - x: event.x, - y: event.y - } - }); - popupMenu.open(element, "ds-replace", position); - } - } - } - }); +} +class Entry { + constructor(value, key) { + this.value = value; + this.key = key; } - function changeDirection(element) { - let context; - let businessObject = element.businessObject; - let newNumber; - if (element.source.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR)) { - newNumber = 0; - } else { - newNumber = (0,_numbering_numbering__WEBPACK_IMPORTED_MODULE_1__.generateAutomaticNumber)(element, commandStack); +} + +/***/ }), + +/***/ 73190: +/*!*************************************************!*\ + !*** ./src/app/domain/entities/elementTypes.ts ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ ElementTypes: () => (/* binding */ ElementTypes) +/* harmony export */ }); +var ElementTypes = /*#__PURE__*/function (ElementTypes) { + ElementTypes["ACTIVITY"] = "domainStory:activity"; + ElementTypes["CONNECTION"] = "domainStory:connection"; + ElementTypes["ACTOR"] = "domainStory:actor"; + ElementTypes["WORKOBJECT"] = "domainStory:workObject"; + ElementTypes["GROUP"] = "domainStory:group"; + ElementTypes["TEXTANNOTATION"] = "domainStory:textAnnotation"; + ElementTypes["DOMAINSTORY"] = "domainStory:"; + return ElementTypes; +}(ElementTypes || {}); +(function (ElementTypes) { + function getIconId(type) { + if (type.startsWith(ElementTypes.ACTOR)) { + return type.replace(ElementTypes.ACTOR, ''); + } else if (type.startsWith(ElementTypes.WORKOBJECT)) { + return type.replace(ElementTypes.WORKOBJECT, ''); } - context = { - businessObject: businessObject, - newNumber: newNumber, - element: element - }; - commandStack.execute("activity.directionChange", context); + return ''; } - function getReplaceMenuPosition(element) { - let Y_OFFSET = 5; - let diagramContainer = canvas.getContainer(), - pad = contextPad.getPad(element).html; - let diagramRect = diagramContainer.getBoundingClientRect(), - padRect = pad.getBoundingClientRect(); - let top = padRect.top - diagramRect.top; - let left = padRect.left - diagramRect.left; - return { - x: left, - y: top + padRect.height + Y_OFFSET - }; - } - /** - * create an append action - * - * @param {String} type - * @param {String} className - * @param {String} [title] - * @param {String} group - * @param {Object} [options] - * - * @return {Object} descriptor - */ - function appendAction(type, className, title, group, options) { - if (typeof title !== "string") { - options = title; - title = translate("{type}", { - type: type.replace(/^domainStory:/, "") - }); - } - function appendStart(event, element) { - let shape = elementFactory.createShape((0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)({ - type: type - }, options)); - let context = { - elements: [shape], - hints: {}, - source: element - }; - create.start(event, shape, context); - } - return { - group: group, - className: className, - title: "Append " + title, - action: { - dragstart: startConnect, - click: appendStart - } - }; - } - function getSelectedBusinessObject(event) { - return { - businessObject: selectedElement.businessObject, - newColor: event.detail.color, - element: selectedElement - }; - } - function executeCommandStack(event) { - const selectedBusinessObject = getSelectedBusinessObject(event); - commandStack.execute("element.colorChange", selectedBusinessObject); - dirtyFlagService.makeDirty(); - } -} -inherits__WEBPACK_IMPORTED_MODULE_0___default()(DomainStoryContextPadProvider, bpmn_js_lib_features_context_pad_ContextPadProvider__WEBPACK_IMPORTED_MODULE_4__["default"]); -DomainStoryContextPadProvider.$inject = ["injector", "connect", "translate", "elementFactory", "create", "canvas", "contextPad", "popupMenu", "replaceMenuProvider", "commandStack", "eventBus", "modeling"]; + ElementTypes.getIconId = getIconId; +})(ElementTypes || (ElementTypes = {})); /***/ }), -/***/ 86258: -/*!**************************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/domainStoryElementFactory.js ***! - \**************************************************************/ +/***/ 11719: +/*!***************************************************!*\ + !*** ./src/app/domain/entities/infoDialogData.ts ***! + \***************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ DomainStoryElementFactory) +/* harmony export */ InfoDialogData: () => (/* binding */ InfoDialogData) /* harmony export */ }); -/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! min-dash */ 93673); -/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ 51270); -/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! bpmn-js/lib/features/modeling/ElementFactory */ 63784); -/* harmony import */ var bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! bpmn-js/lib/util/LabelUtil */ 50815); -/* harmony import */ var _domainStoryIdFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./domainStoryIdFactory */ 12003); - - - - - - - -/** - * A custom factory that knows how to create BPMN _and_ custom elements. - */ -function DomainStoryElementFactory(bpmnFactory, moddle) { - bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_2__["default"].call(this, bpmnFactory, moddle); - let self = this; - let domainStoryIdFactory = new _domainStoryIdFactory__WEBPACK_IMPORTED_MODULE_1__["default"](); - /** - * create a diagram-js element with the given type (any of shape, connection, label). - * - * @param {String} elementType - * @param {Object} attrs - * - * @return {djs.model.Base} - */ - this.create = function (elementType, attrs) { - let type = attrs.type; - if (elementType === "label") { - return self.baseCreate(elementType, (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)({ - type: "label" - }, bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_4__.DEFAULT_LABEL_SIZE, attrs)); - } - // add type to businessObject if custom - if (/^domainStory:/.test(type)) { - if (!attrs.businessObject) { - attrs.businessObject = { - type: type, - name: attrs.name ? attrs.name : "" - }; - } - if (attrs.id) { - domainStoryIdFactory.registerId(attrs.id); - } else { - attrs.id = domainStoryIdFactory.getId(elementType); - } - (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(attrs.businessObject, { - id: attrs.id - }); - let id = attrs.id; - attrs.businessObject.get = function (key) { - if (key === "id") { - return id; - } - }; - attrs.businessObject.set = function (key, value) { - if (key === "id") { - (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(attrs.businessObject, { - id: value - }); - } - }; - if (!attrs.businessObject.$type) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(attrs.businessObject, { - $type: "Element" - }); - } - (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(attrs.businessObject, { - di: {} - }); - if (!attrs.businessObject.$descriptor) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(attrs.businessObject, { - $descriptor: {} - }); - } - // add width and height if shape - if ((!/:activity$/.test(type) || !/:connection$/.test(type)) && !(/:group$/.test(type) && attrs.height || attrs.width)) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(attrs, self._getCustomElementSize(type)); - } - if (!("$instanceOf" in attrs.businessObject)) { - // ensure we can use ModelUtil#is for type checks - Object.defineProperty(attrs.businessObject, "$instanceOf", { - value: function (type) { - return this.type === type; - } - }); - } - return self.baseCreate(elementType, attrs); - } - return self.createBpmnElement(elementType, attrs); - }; +class InfoDialogData { + constructor(title, infoText, isInfo, isLink = false, linkText) { + this.title = title; + this.infoText = infoText; + this.isInfo = isInfo; + this.isLink = isLink; + this.linkText = linkText; + } } -inherits__WEBPACK_IMPORTED_MODULE_0___default()(DomainStoryElementFactory, bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_2__["default"]); -DomainStoryElementFactory.$inject = ["bpmnFactory", "moddle"]; -/** - * returns the default size of custom shapes. - * - * the following example shows an interface on how - * to setup the custom shape's dimensions. - * * - * @param {String} type - * - * @return {Dimensions} a {width, height} object representing the size of the element - */ -DomainStoryElementFactory.prototype._getCustomElementSize = function (type) { - let shapes = { - __default: { - width: 75, - height: 75 - }, - "domainStory:textAnnotation": { - width: 100, - height: 30 - }, - "domainStory:group": { - width: 525, - height: 275 - } - }; - return shapes[type] || shapes.__default; -}; -class Dimensions {} /***/ }), -/***/ 12003: -/*!*********************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/domainStoryIdFactory.js ***! - \*********************************************************/ +/***/ 10454: +/*!**************************************************************************!*\ + !*** ./src/app/domain/presentation/info-dialog/info-dialog.component.ts ***! + \**************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ containsId: () => (/* binding */ containsId), -/* harmony export */ "default": () => (/* binding */ DomainStoryIdFactory) +/* harmony export */ InfoDialogComponent: () => (/* binding */ InfoDialogComponent) /* harmony export */ }); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_domain_entities_infoDialogData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/infoDialogData */ 11719); -let idList = []; -function DomainStoryIdFactory() {} -DomainStoryIdFactory.prototype.getId = function (type) { - return generateId(type); -}; -DomainStoryIdFactory.prototype.registerId = function (id) { - idList.push(id); -}; -function generateId(type) { - let idNumber = fourDigitsId(); - let id = type + "_" + idSuffix(idNumber); - while (containsId(id)) { - idNumber++; - id = type + "_" + idSuffix(idNumber); + + +function InfoDialogComponent_Conditional_3_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "span", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); } - idList.push(id); - return id; -} -function idSuffix(idNumber) { - let id; - if (idNumber > 9999) { - id = 0; - } else if (idNumber < 10) { - id = "000" + idNumber; - } else if (idNumber < 100) { - id = "00" + idNumber; - } else if (idNumber < 1000) { - id = "0" + idNumber; - } else { - id = "" + idNumber; + if (rf & 2) { + const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate1"]("", ctx_r0.infoText, " "); } - return id; } -function fourDigitsId() { - return Math.floor(Math.random() * 10000); -} -function containsId(id) { - let same = false; - idList.forEach(element => { - if (id === element) { - same = true; - } - }); - return same; +function InfoDialogComponent_Conditional_4_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "a", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + } + if (rf & 2) { + const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpropertyInterpolate"]("href", ctx_r0.linkText, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsanitizeUrl"]); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate"](ctx_r0.linkText); + } +} +function InfoDialogComponent_Conditional_5_Template(rf, ctx) { + if (rf & 1) { + const _r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "mat-dialog-actions")(1, "button", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function InfoDialogComponent_Conditional_5_Template_button_click_1_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r2); + const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r0.close()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](2, "Close"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); + } } +let InfoDialogComponent = /*#__PURE__*/(() => { + class InfoDialogComponent { + constructor(dialogRef, data) { + this.dialogRef = dialogRef; + this.title = data.title; + this.infoText = data.infoText; + this.showConfirmButton = !data.isInfo; + this.hasLink = data.isLink; + this.linkText = data.linkText || ''; + } + ngAfterViewInit() { + const span = document.getElementsByClassName('readOnlyText')[0]; + span.style.height = span.scrollHeight + 'px'; + } + close() { + this.dialogRef.close(); + } + static #_ = this.ɵfac = function InfoDialogComponent_Factory(t) { + return new (t || InfoDialogComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__.MatDialogRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__.MAT_DIALOG_DATA)); + }; + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ + type: InfoDialogComponent, + selectors: [["app-info-dialog"]], + decls: 6, + vars: 4, + consts: [[1, "content"], ["id", "info-dialog-title"], [1, "readOnlyText"], [3, "href"], [1, "mat-raised-button", 3, "click"]], + template: function InfoDialogComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "mat-dialog-content", 0)(1, "h2", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](3, InfoDialogComponent_Conditional_3_Template, 2, 1, "span", 2)(4, InfoDialogComponent_Conditional_4_Template, 2, 2, "a", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](5, InfoDialogComponent_Conditional_5_Template, 3, 0, "mat-dialog-actions"); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate"](ctx.title); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵconditional"](3, ctx.infoText != "" ? 3 : -1); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵconditional"](4, ctx.hasLink ? 4 : -1); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵconditional"](5, ctx.showConfirmButton ? 5 : -1); + } + }, + dependencies: [_angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__.MatDialogActions, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__.MatDialogContent], + styles: [".readOnlyText[_ngcontent-%COMP%] {\n display: block;\n border: none;\n resize: none;\n width: 100%;\n overflow: hidden;\n white-space: pre-wrap;\n}\n\n.content[_ngcontent-%COMP%] {\n height: -moz-fit-content;\n height: fit-content;\n width: 30vw;\n overflow: hidden;\n}"] + }); + } + return InfoDialogComponent; +})(); /***/ }), -/***/ 37751: -/*!********************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/domainStoryRenderer.js ***! - \********************************************************/ +/***/ 96445: +/*!**********************************************************!*\ + !*** ./src/app/domain/services/command-stack.service.ts ***! + \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ DomainStoryRenderer), -/* harmony export */ initializeRenderer: () => (/* binding */ initializeRenderer) +/* harmony export */ CommandStackService: () => (/* binding */ CommandStackService) /* harmony export */ }); -/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ 51270); -/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var diagram_js_lib_draw_BaseRenderer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! diagram-js/lib/draw/BaseRenderer */ 74919); -/* harmony import */ var ids__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ids */ 28287); -/* harmony import */ var _labeling_dsLabelEditingPreview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./labeling/dsLabelEditingPreview */ 15537); -/* harmony import */ var diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! diagram-js/lib/util/RenderUtil */ 97915); -/* harmony import */ var tiny_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! tiny-svg */ 87004); -/* harmony import */ var min_dom__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! min-dom */ 63030); -/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! min-dash */ 93673); -/* harmony import */ var _labeling_dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./labeling/dsLabelEditingProvider */ 50572); -/* harmony import */ var _numbering_numbering__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./numbering/numbering */ 37126); -/* harmony import */ var _labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./labeling/dsLabelUtil */ 84745); -/* harmony import */ var _labeling_position__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./labeling/position */ 49417); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var _Utils_mathExtensions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../Utils/mathExtensions */ 114); - - +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2978); +let CommandStackService = /*#__PURE__*/(() => { + class CommandStackService { + constructor() {} + setCommandStack(commandStack) { + this.commandStack = commandStack; + } + execute(action, payload) { + this.commandStack.execute(action, payload); + } + static #_ = this.ɵfac = function CommandStackService_Factory(t) { + return new (t || CommandStackService)(); + }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ + token: CommandStackService, + factory: CommandStackService.ɵfac, + providedIn: 'root' + }); + } + return CommandStackService; +})(); +/***/ }), +/***/ 12855: +/*!***************************************************!*\ + !*** ./src/app/domain/services/dialog.service.ts ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DialogService: () => (/* binding */ DialogService) +/* harmony export */ }); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +/* harmony import */ var _entities_infoDialogData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../entities/infoDialogData */ 11719); +/* harmony import */ var _presentation_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../presentation/info-dialog/info-dialog.component */ 10454); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2978); +let DialogService = /*#__PURE__*/(() => { + class DialogService { + constructor(matDialog) { + this.matDialog = matDialog; + } + openDialog(dialog, config) { + this.matDialog.open(dialog, config); + } + openKeyboardShortcutsDialog() { + const title = 'Keyboard Shortcuts'; + const shortCutText = 'Undo:\t\t\t\t\tctrl + Z \n' + 'Redo:\t\t\t\t\tctrl + Y OR ctrl + shift + Z\n' + 'Select All:\t\t\t\tctrl + A\n' + 'Export as EGN:\t\t\tctrl + S\n' + 'Import Domain Story: \tctrl + L\n' + 'Search for text:\t\t\tctrl + F\n' + 'Direct editing:\t\t\tE\n' + 'Hand tool:\t\t\t\tH\n' + 'Lasso tool:\t\t\t\tL\n' + 'Space tool:\t\t\t\tS'; + const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__.MatDialogConfig(); + config.disableClose = false; + config.autoFocus = true; + config.data = new _entities_infoDialogData__WEBPACK_IMPORTED_MODULE_0__.InfoDialogData(title, shortCutText, true); + this.openDialog(_presentation_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_1__.InfoDialogComponent, config); + } + static #_ = this.ɵfac = function DialogService_Factory(t) { + return new (t || DialogService)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__.MatDialog)); + }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjectable"]({ + token: DialogService, + factory: DialogService.ɵfac, + providedIn: 'root' + }); + } + return DialogService; +})(); +/***/ }), +/***/ 94658: +/*!*******************************************************!*\ + !*** ./src/app/domain/services/dirty-flag.service.ts ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DirtyFlagService: () => (/* binding */ DirtyFlagService) +/* harmony export */ }); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 95981); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); -let RENDERER_IDS = new ids__WEBPACK_IMPORTED_MODULE_1__["default"](); -let numbers = []; -const DEFAULT_COLOR = "black"; -/** - * a renderer that knows how to render custom elements. - */ -let _iconDictionaryService; -let _elementRegistryService; -let _dirtyFlagService; -function initializeRenderer(iconDictionaryService, elementRegistryService, dirtyFlagService) { - _iconDictionaryService = iconDictionaryService; - _elementRegistryService = elementRegistryService; - _dirtyFlagService = dirtyFlagService; -} -function DomainStoryRenderer(eventBus, styles, canvas, textRenderer, pathMap, commandStack) { - diagram_js_lib_draw_BaseRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].call(this, eventBus, 2000); - let rendererId = RENDERER_IDS.next(); - let markers = {}; - let computeStyle = styles.computeStyle; - // generate the automatic Number for an activity originating from an actor - function generateActivityNumber(parentGfx, element, box) { - // whenever we want to edit an activity, it gets redrawn as a new object - // and the custom information is lost, - // so we stash it before the editing occurs and set the value here - let numberStash = (0,_labeling_dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_3__.getNumberStash)(); - let semantic = element.businessObject; - if (numberStash.use) { - semantic.number = numberStash.number; +let DirtyFlagService = /*#__PURE__*/(() => { + class DirtyFlagService { + constructor() { + this.isDirtySubject = new rxjs__WEBPACK_IMPORTED_MODULE_0__.BehaviorSubject(false); + this.dirty$ = this.isDirtySubject.asObservable(); } - numbers[semantic.number] = true; - box.x -= 26; - box.y -= 16; - if (semantic.number < 10) { - box.x += 3; + makeDirty() { + this.isDirtySubject.next(true); } - let newRenderedNumber = renderNumber(parentGfx, semantic.number, numberStyle(box), element.type); - (0,_numbering_numbering__WEBPACK_IMPORTED_MODULE_4__.addNumberToRegistry)(newRenderedNumber, semantic.number); - } - // style functions - function numberStyle(box) { - return { - box: box, - fitBox: true, - style: (0,min_dash__WEBPACK_IMPORTED_MODULE_10__.assign)({}, textRenderer.getExternalStyle(), { - fill: "black", - position: "absolute" - }) - }; - } - function backgroundBoxStyle(box) { - return { - box: box, - fitBox: true, - style: (0,min_dash__WEBPACK_IMPORTED_MODULE_10__.assign)({}, textRenderer.getExternalStyle(), { - fill: "black", - fontSize: 50, - position: "absolute", - fontFamily: "Courier New" - }) - }; - } - function backgroundDotStyle(box) { - return { - box: box, - fitBox: true, - style: (0,min_dash__WEBPACK_IMPORTED_MODULE_10__.assign)({}, textRenderer.getExternalStyle(), { - fill: "white", - fontSize: 150, - position: "absolute", - fontFamily: "Courier" - }) + makeClean() { + this.isDirtySubject.next(false); + } + get dirty() { + return this.isDirtySubject.value; + } + static #_ = this.ɵfac = function DirtyFlagService_Factory(t) { + return new (t || DirtyFlagService)(); }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ + token: DirtyFlagService, + factory: DirtyFlagService.ɵfac, + providedIn: 'root' + }); } - // render functions - // render label associated with actors and workobjects - function renderEmbeddedLabel(parentGfx, element, align, padding) { - let businessObject = element.businessObject; - return renderLabel(parentGfx, businessObject.name, { - box: element, - align: align, - padding: padding ? padding : 0, - style: { - fill: "#000000" - } - }, element.type); - } - // render label associated with activities - function renderExternalLabel(parentGfx, element) { - let semantic = element.businessObject; - let waypoints = element.waypoints; - let lines = (0,_labeling_position__WEBPACK_IMPORTED_MODULE_6__.countLines)(semantic.name); - if (element.waypoints != null) { - let position = (0,_labeling_position__WEBPACK_IMPORTED_MODULE_6__.labelPosition)(waypoints, lines); - let startPoint = element.waypoints[position.selected]; - let endPoint = element.waypoints[position.selected + 1]; - let angle = (0,_Utils_mathExtensions__WEBPACK_IMPORTED_MODULE_8__.angleBetween)(startPoint, endPoint); - let alignment = "left"; - let boxWidth = 500; - let xStart = position.x; - // if the activity is horizontal, we want to center the label - if (angle === 0 || angle === 180) { - boxWidth = Math.abs(startPoint.x - endPoint.x); - alignment = "center"; - xStart = (startPoint.x + endPoint.x) / 2 - (0,_labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_5__.calculateTextWidth)(semantic.name); - } - let box = { - textAlign: alignment, - width: boxWidth, - height: 30, - x: xStart, - y: position.y - }; - if (semantic.name && semantic.name.length) { - return renderLabel(parentGfx, semantic.name, { - box: box, - fitBox: true, - style: (0,min_dash__WEBPACK_IMPORTED_MODULE_10__.assign)({}, textRenderer.getExternalStyle(), { - fill: "black", - wordWrap: "break-word", - overflowWrap: "break-word", - hyphens: "auto" - }) - }, element.type); - } + return DirtyFlagService; +})(); + +/***/ }), + +/***/ 85511: +/*!*************************************************************!*\ + !*** ./src/app/domain/services/element-registry.service.ts ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ ElementRegistryService: () => (/* binding */ ElementRegistryService) +/* harmony export */ }); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); + + +let ElementRegistryService = /*#__PURE__*/(() => { + class ElementRegistryService { + constructor() { + this.fullyInitialized = false; } - } - // render the number associated with an activity - function renderExternalNumber(parentGfx, element) { - if (element && element.source) { - let semantic = element.businessObject; - let box = (0,_numbering_numbering__WEBPACK_IMPORTED_MODULE_4__.numberBoxDefinitions)(element); - if (semantic.number == null && element.source.type && element.source.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.ACTOR)) { - (0,_numbering_numbering__WEBPACK_IMPORTED_MODULE_4__.generateAutomaticNumber)(element, commandStack); - } - // render the background for the number - if (semantic.number && element.source.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.ACTOR)) { - generateActivityNumber(parentGfx, element, box); - } else { - semantic.number = null; + /** + * Initially the registry has only the root-Element. + * Once the canvas has bees initialized, we adjust the reference to point to the elements on the canvas for convenience + */ + correctInitialize() { + if (!this.fullyInitialized) { + if (this.registry.__implicitroot) { + this.registry = this.registry.__implicitroot.element.children; + this.fullyInitialized = true; + } } } - } - // render a number on the canvas - function renderNumber(parentGfx, number, options, type) { - if (number < 10) { - number = String(number); - } - number = String(number); - let text = textRenderer.createText(number || "", options); - let height = 0; - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.classes)(text).add("djs-labelNumber"); - setCoordinates(type, text, options, height, parentGfx); - // !IMPORTANT! - // When converting svg-files via Inkscape or Photoshop the svg-circle is converted to a black dot that obscures the number. - // To circumvent this, we draw an arc. - let circle = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.create)("path"); - let radius = 11; - let x = options.box.x + 18 + (number > 9 ? 3 : 0); - let y = options.box.y - radius + 7; - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.attr)(circle, { - d: ` - M ${x} ${y} - m ${radius},0 - a ${radius},${radius} 0 1,0 ${-radius * 2},0 - a ${radius},${radius} 0 1,0 ${radius * 2},0 - `, - fill: "white", - stroke: "black" - }); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.append)(parentGfx, circle); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.append)(parentGfx, text); - return text; - } - // the coordinates of the activity label must be set directly and will not be taken from the box - function setCoordinates(type, text, options, height, parentGfx) { - if (/:activity$/.test(type)) { - text.innerHTML = manipulateInnerHTMLXLabel(text.children, options.box.x, 0); - text.innerHTML = manipulateInnerHTMLYLabel(text.children, options.box.y, 0); - } else if (/:actor/.test(type)) { - height = parentGfx.firstChild.attributes.height.nodeValue; - text.innerHTML = manipulateInnerHTMLYLabel(text.children, height, 0); - } else if (/:workObject/.test(type)) { - height = parentGfx.firstChild.attributes.height.nodeValue; - text.innerHTML = manipulateInnerHTMLYLabel(text.children, height, 26); + setElementRegistry(registry) { + this.registry = registry._elements; } - } - // render a label on the canvas - function renderLabel(parentGfx, label, options, type) { - let text = textRenderer.createText(label || "", options); - let height = 0; - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.classes)(text).add("djs-label"); - setCoordinates(type, text, options, height, parentGfx); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.append)(parentGfx, text); - return text; - } - // determine the Y-coordinate of the label / number to be rendered - function manipulateInnerHTMLYLabel(children, y, offset) { - if (children) { - let result = ""; - for (let i = 0; i < children.length; i++) { - result += children[i].outerHTML.replace(/y="-?\d*.\d*"/, 'y="' + (Number(y) + offset + 14 * i) + '"'); - } - return result; + clear() { + this.registry = null; + this.fullyInitialized = false; } - } - // determine the X-coordinate of the label / number to be rendered - function manipulateInnerHTMLXLabel(children, x, offset) { - if (children) { - let result = ""; - for (let i = 0; i < children.length; i++) { - result += children[i].outerHTML.replace(/x="-?\d*.\d*"/, 'x="' + (Number(x) + offset + 14) + '"'); + createObjectListForDSTDownload() { + if (this.registry) { + const allObjectsFromCanvas = this.getAllCanvasObjects(); + const groups = this.getAllGroups(); + const objectList = []; + this.fillListOfCanvasObjects(allObjectsFromCanvas, objectList, groups); + return objectList; } - return result; + return []; } - } - // draw functions - this.drawGroup = function (parentGfx, element) { - if (!element.businessObject.pickedColor) { - element.businessObject.pickedColor = DEFAULT_COLOR; + fillListOfCanvasObjects(allObjectsFromCanvas, objectList, groups) { + allObjectsFromCanvas.forEach(canvasElement => { + if (canvasElement.type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY) { + objectList.push(canvasElement); + } + // ensure that Activities are always after Actors, Workobjects and Groups in .dst files + else { + if (canvasElement.type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.TEXTANNOTATION) { + canvasElement.businessObject.width = canvasElement.width; + canvasElement.businessObject.height = canvasElement.height; + } + if (!objectList.includes(canvasElement)) { + objectList.unshift(canvasElement); + } + } + }); + groups.forEach(group => { + objectList.push(group); + }); } - let rect = drawRect(parentGfx, element.width, element.height, 0, (0,min_dash__WEBPACK_IMPORTED_MODULE_10__.assign)({ - fill: "none", - stroke: element.businessObject.pickedColor - }, element.attrs)); - renderEmbeddedLabel(parentGfx, element, "left-top", 8); - return rect; - }; - function applyColorToCustomSvgIcon(pickedColor, iconSvg) { - if (!pickedColor) { - return iconSvg; + getAllActivities() { + const activities = []; + this.getAllCanvasObjects().forEach(element => { + if (element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY)) { + activities.push(element); + } + }); + return activities; } - const [rest, base64Svg] = iconSvg.split("base64,"); - const svg = atob(base64Svg); - const coloredSvg = applyColorToIcon(pickedColor, svg); - const encodedColoredSvg = btoa(coloredSvg); - return rest + "base64," + encodedColoredSvg; - } - function applyColorToIcon(pickedColor = DEFAULT_COLOR, iconSvg) { - const match = iconSvg.match(/fill="(?!none).*?"/); - if (match && match.length > 0) { - return iconSvg.replaceAll(/fill="(?!none).*?"/g, 'fill="' + pickedColor + '"'); - } else { - const index = iconSvg.indexOf(" { + const type = element.type; + if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.CONNECTION) { + connections.push(element); + } + }); + return connections; } - } - function getIconSvg(iconSvg, element) { - const pickedColor = element.businessObject.pickedColor; - let isCustomIcon = iconSvg.startsWith("data") && src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.isCustomType(element.type); - if (isCustomIcon) { - const svg = src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.isCustomSvgType(element.type) ? applyColorToCustomSvgIcon(pickedColor, iconSvg) : iconSvg; - return '' + ''; - } else { - return applyColorToIcon(pickedColor, iconSvg); + getAllCanvasObjects() { + const allObjects = []; + const groupObjects = []; + this.checkChildForGroup(groupObjects, allObjects); + // for each memorized group, remove it from the group-array and check its children, whether they are groups or not + // if a child is a group, memorize it in the group-array + // other children should already be in the allObjects list + let i = groupObjects.length - 1; + while (groupObjects.length >= 1) { + const currentGroup = groupObjects.pop(); + // @ts-ignore + currentGroup.children.forEach(child => { + const type = child.type; + if (type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.GROUP)) { + groupObjects.push(child); + } + }); + i = groupObjects.length - 1; + } + return allObjects; } - } - this.drawActor = function (parent, element) { - let svgDynamicSizeAttributes = { - width: element.width, - height: element.height - }; - let iconSRC = _iconDictionaryService.getTypeIconSRC(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.ACTOR, src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.getIconId(element.type)); - iconSRC = getIconSvg(iconSRC, element); - let actor = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.create)(iconSRC); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.attr)(actor, svgDynamicSizeAttributes); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.append)(parent, actor); - renderEmbeddedLabel(parent, element, "center", -5); - return actor; - }; - this.drawWorkObject = function (parent, element) { - let svgDynamicSizeAttributes = { - width: element.width * 0.65, - height: element.height * 0.65, - x: element.width / 2 - 25, - y: element.height / 2 - 25 - }, - workObject; - let iconSRC = _iconDictionaryService.getTypeIconSRC(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.WORKOBJECT, src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.getIconId(element.type)); - iconSRC = getIconSvg(iconSRC, element); - workObject = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.create)(iconSRC); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.attr)(workObject, svgDynamicSizeAttributes); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.append)(parent, workObject); - renderEmbeddedLabel(parent, element, "center", -5); - return workObject; - }; - function useColorForActivity(element) { - if (!element.businessObject.pickedColor) { - element.businessObject.pickedColor = "black"; + // returns all groups on the canvas and inside other groups + getAllGroups() { + const groupObjects = []; + const allObjects = []; + this.checkChildForGroup(groupObjects, allObjects); + for (const group of groupObjects) { + group.children?.forEach(child => { + if (child.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.GROUP)) { + groupObjects.push(child); + } + }); + } + return groupObjects; } - let attrs = ""; - return computeStyle(attrs, { - stroke: element.businessObject.pickedColor, - fill: "none", - strokeWidth: 1.5, - strokeLinejoin: "round", - markerEnd: marker("activity", "black", element.businessObject.pickedColor) - }); - } - this.drawActivity = function (p, element) { - adjustForTextOverlap(element); - if (element) { - let attrs = useColorForActivity(element); - let x = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.append)(p, (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_12__.createLine)(element.waypoints, attrs)); - renderExternalLabel(p, element); - renderExternalNumber(p, element); - // just adjusting the start- and endpoint of the connection-element moves only the drawn connection, - // not the interactive line. This can be fixed by manually overriding the points of the interactive polyline - // in the HTMl with the points of the drawn one. - // this however does not adjust the surrounding box of the connection. - fixConnectionInHTML(p.parentElement); - return x; - } - }; - function checkIfPointOverlapsText(point, source) { - if (point.y > source.y + 60) { - if (point.x > source.x + 3 && point.x < source.x + 72) { - let lineOffset = getLineOffset(source); - if (source.y + 75 + lineOffset > point.y) { - point.y += lineOffset; + checkChildForGroup(groupObjects, allObjects) { + const registryElementNames = Object.keys(this.registry); + for (let name of registryElementNames) { + const entry = this.registry[name].element; + if (entry.businessObject) { + const type = entry.type; + if (type && type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.GROUP)) { + // if it is a group, memorize this for later + groupObjects.push(entry); + } else if (type) { + allObjects.push(entry); + } } } } - } - function adjustForTextOverlap(element) { - let source = element.source; - let target = element.target; - let waypoints = element.waypoints; - let startPoint = waypoints[0]; - let endPoint = waypoints[waypoints.length - 1]; - if (startPoint && endPoint && source && target) { - checkIfPointOverlapsText(startPoint, source); - checkIfPointOverlapsText(endPoint, source); - } - } - function getLineOffset(element) { - let id = element.id; - let offset = 0; - let objects = document.getElementsByClassName("djs-element djs-shape"); - for (let i = 0; i < objects.length; i++) { - let data_id = objects.item(i).getAttribute("data-element-id"); - if (data_id === id) { - let object = objects.item(i); - let text = object.getElementsByTagName("text")[0]; - let tspans = text.getElementsByTagName("tspan"); - let tspan = tspans[tspans.length - 1]; - offset = tspan.getAttribute("y"); - } - } - return offset - 70; - } - function fixConnectionInHTML(wantedConnection) { - if (wantedConnection) { - let polylines = wantedConnection.getElementsByTagName("polyline"); - if (polylines.length > 1) { - polylines[1].setAttribute("points", polylines[0].getAttribute("points")); - } - } - } - this.drawDSConnection = function (p, element) { - let attrs = ""; - attrs = computeStyle(attrs, { - stroke: "#000000", - strokeWidth: 1.5, - strokeLinejoin: "round", - strokeDasharray: "5, 5" - }); - return (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.append)(p, (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_12__.createLine)(element.waypoints, attrs)); - }; - this.drawAnnotation = function (parentGfx, element) { - let style = { - fill: "none", - stroke: "none" - }; - let text = element.businessObject.text || ""; - if (element.businessObject.text) { - let height = (0,_labeling_dsLabelEditingPreview__WEBPACK_IMPORTED_MODULE_2__.getAnnotationBoxHeight)(); - if (height === 0 && element.businessObject.number) { - height = element.businessObject.number; - } - (0,min_dash__WEBPACK_IMPORTED_MODULE_10__.assign)(element, { - height: height + // get a list of activities, that originate from an actor-type + getActivitiesFromActors() { + const activitiesFromActors = []; + const activities = this.getAllActivities(); + activities.forEach(activity => { + if (activity.source?.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR)) { + activitiesFromActors.push(activity); + } }); - // for some reason the keyword height is not exported, so we use another, which we know will be exported, - // to ensure persistent annotation heights between sessions - (0,min_dash__WEBPACK_IMPORTED_MODULE_10__.assign)(element.businessObject, { - number: height + // sort by activityBusinessObject number + activitiesFromActors.sort((activityCanvasA, activityCanvasB) => { + const activityNumberA = Number(activityCanvasA.businessObject.number); + const activityNumberB = Number(activityCanvasB.businessObject.number); + return activityNumberA - activityNumberB; }); + return activitiesFromActors; } - let textElement = drawRect(parentGfx, element.width, element.height, 0, 0, style); - let textPathData = pathMap.getScaledPath("TEXT_ANNOTATION", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0.0, - my: 0.0 - } - }); - drawPath(parentGfx, textPathData, { - stroke: "black" - }); - renderLabel(parentGfx, text, { - box: element, - align: "left-top", - padding: 5, - style: { - fill: "black" - } - }); - return textElement; - }; - // draw helper functions - function drawPath(parentGfx, d, attrs) { - attrs = computeStyle(attrs, ["no-fill"], { - strokeWidth: 2, - stroke: "black" - }); - let path = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.create)("path"); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.attr)(path, { - d: d - }); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.attr)(path, attrs); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.append)(parentGfx, path); - return path; - } - function drawRect(parentGfx, width, height, r, offset, attrs) { - if ((0,min_dash__WEBPACK_IMPORTED_MODULE_10__.isObject)(offset)) { - attrs = offset; - offset = 0; + getUsedIcons() { + const actors = this.getAllActors(); + const workobjects = this.getAllWorkobjects(); + return { + actors: actors.map(a => a.type.replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR, '')), + workobjects: workobjects.map(w => w.type.replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT, '')) + }; } - offset = offset || 0; - attrs = computeStyle(attrs, { - stroke: "black", - strokeWidth: 2, - fill: "white" - }); - let rect = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.create)("rect"); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.attr)(rect, { - x: offset, - y: offset, - width: width - offset * 2, - height: height - offset * 2, - rx: r, - ry: r + getAllActors() { + return this.getAllCanvasObjects().filter(co => co.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR)); + } + getAllWorkobjects() { + return this.getAllCanvasObjects().filter(co => co.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT)); + } + static #_ = this.ɵfac = function ElementRegistryService_Factory(t) { + return new (t || ElementRegistryService)(); + }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ + token: ElementRegistryService, + factory: ElementRegistryService.ɵfac, + providedIn: 'root' }); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.attr)(rect, attrs); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.append)(parentGfx, rect); - return rect; } - // marker functions - function marker(type, fill, stroke) { - let id = type + "-" + fill + "-" + stroke + "-" + rendererId; - if (!markers[id]) { - createMarker(type, fill, stroke); + return ElementRegistryService; +})(); + +/***/ }), + +/***/ 50624: +/*!****************************************************!*\ + !*** ./src/app/domain/services/storage.service.ts ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ StorageService: () => (/* binding */ StorageService) +/* harmony export */ }); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2978); + +let StorageService = /*#__PURE__*/(() => { + class StorageService { + set(key, value) { + localStorage.setItem(key, JSON.stringify(value)); } - return "url(#" + id + ")"; - } - function createMarker(type, fill, stroke) { - let id = type + "-" + fill + "-" + stroke + "-" + rendererId; - if (type === "activity") { - let sequenceflowEnd = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.create)("path"); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.attr)(sequenceflowEnd, { - d: "M 1 5 L 11 10 L 1 15 Z" - }); - addMarker(id, { - element: sequenceflowEnd, - ref: { - x: 11, - y: 10 - }, - scale: 0.5, - attrs: { - fill: stroke, - stroke: stroke - } - }); + get(key) { + const json = localStorage.getItem(key); + if (json) { + return JSON.parse(json); + } + return null; } - } - function addMarker(id, options) { - let attrs = (0,min_dash__WEBPACK_IMPORTED_MODULE_10__.assign)({ - fill: "black", - strokeWidth: 1, - strokeLinecap: "round", - strokeDasharray: "none" - }, options.attrs); - let ref = options.ref || { - x: 0, - y: 0 + static #_ = this.ɵfac = function StorageService_Factory(t) { + return new (t || StorageService)(); }; - let scale = options.scale || 1; - // resetting stroke dash array - if (attrs.strokeDasharray === "none") { - attrs.strokeDasharray = [10000, 1]; - } - let marker = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.create)("marker"); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.attr)(options.element, attrs); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.append)(marker, options.element); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.attr)(marker, { - id: id, - viewBox: "0 0 20 20", - refX: ref.x, - refY: ref.y, - markerWidth: 20 * scale, - markerHeight: 20 * scale, - orient: "auto" + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ + token: StorageService, + factory: StorageService.ɵfac, + providedIn: 'root' }); - let defs = (0,min_dom__WEBPACK_IMPORTED_MODULE_13__.query)("defs", canvas._svg); - if (!defs) { - defs = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.create)("defs"); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.append)(canvas._svg, defs); - } - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_11__.append)(defs, marker); - markers[id] = marker; } - // path functions - this.getWorkObjectPath = function (shape) { - let rectangle = getRectPath(shape); - return (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_12__.componentsToPath)(rectangle); - }; - this.getGroupPath = function (shape) { - let rectangle = getRectPath(shape); - return (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_12__.componentsToPath)(rectangle); - }; - this.getActivityPath = function (connection) { - let waypoints = connection.waypoints.map(function (p) { - return p.original || p; - }); - let activityPath = [["M", waypoints[0].x, waypoints[0].y]]; - waypoints.forEach(function (waypoint, index) { - if (index !== 0) { - activityPath.push(["L", waypoint.x, waypoint.y]); - } + return StorageService; +})(); + +/***/ }), + +/***/ 89439: +/*!************************************!*\ + !*** ./src/app/material.module.ts ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ MaterialModule: () => (/* binding */ MaterialModule) +/* harmony export */ }); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/form-field */ 29344); +/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/input */ 92583); +/* harmony import */ var _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/material/toolbar */ 23550); +/* harmony import */ var _angular_material_expansion__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/material/expansion */ 71288); +/* harmony import */ var _angular_material_card__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/material/card */ 90643); +/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); +/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/material/button */ 72221); +/* harmony import */ var _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/grid-list */ 81322); +/* harmony import */ var _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/button-toggle */ 26470); +/* harmony import */ var _angular_material_list__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/list */ 93901); +/* harmony import */ var _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/checkbox */ 63422); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2978); + + + + + + + + + + + + + +let MaterialModule = /*#__PURE__*/(() => { + class MaterialModule { + static #_ = this.ɵfac = function MaterialModule_Factory(t) { + return new (t || MaterialModule)(); + }; + static #_2 = this.ɵmod = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ + type: MaterialModule }); - return (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_12__.componentsToPath)(activityPath); - }; - this.getActorPath = function (shape) { - let rectangle = getRectPath(shape); - return (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_12__.componentsToPath)(rectangle); - }; -} -inherits__WEBPACK_IMPORTED_MODULE_0___default()(DomainStoryRenderer, diagram_js_lib_draw_BaseRenderer__WEBPACK_IMPORTED_MODULE_9__["default"]); -DomainStoryRenderer.$inject = ["eventBus", "styles", "canvas", "textRenderer", "pathMap", "commandStack"]; -DomainStoryRenderer.prototype.canRender = function (element) { - return /^domainStory:/.test(element.type); -}; -DomainStoryRenderer.prototype.drawShape = function (p, element) { - // polyfill for tests - if (!String.prototype.startsWith) { - Object.defineProperty(String.prototype, "startsWith", { - value: function (search, pos) { - pos = !pos || pos < 0 ? 0 : +pos; - return this.substring(pos, pos + search.length) === search; - } + static #_3 = this.ɵinj = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ + imports: [_angular_material_button__WEBPACK_IMPORTED_MODULE_1__.MatButtonModule, _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_2__.MatButtonToggleModule, _angular_material_list__WEBPACK_IMPORTED_MODULE_3__.MatListModule, _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_4__.MatCheckboxModule, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__.MatDialogModule, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatFormFieldModule, _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_7__.MatGridListModule, _angular_material_input__WEBPACK_IMPORTED_MODULE_8__.MatInputModule, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__.MatToolbarModule, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_10__.MatExpansionModule, _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__.MatSnackBarModule, _angular_material_card__WEBPACK_IMPORTED_MODULE_12__.MatCardModule, _angular_material_button__WEBPACK_IMPORTED_MODULE_1__.MatButtonModule, _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_2__.MatButtonToggleModule, _angular_material_list__WEBPACK_IMPORTED_MODULE_3__.MatListModule, _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_4__.MatCheckboxModule, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__.MatDialogModule, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatFormFieldModule, _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_7__.MatGridListModule, _angular_material_input__WEBPACK_IMPORTED_MODULE_8__.MatInputModule, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__.MatToolbarModule, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_10__.MatExpansionModule, _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__.MatSnackBarModule, _angular_material_card__WEBPACK_IMPORTED_MODULE_12__.MatCardModule] }); } - let type = element.type; - element.businessObject.type = type; - _elementRegistryService.correctInitialize(); - _dirtyFlagService.makeDirty(); - if (type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.ACTOR)) { - return this.drawActor(p, element); - } else if (type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.WORKOBJECT)) { - return this.drawWorkObject(p, element); - } else if (type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.TEXTANNOTATION)) { - return this.drawAnnotation(p, element); - } else if (type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.GROUP)) { - return this.drawGroup(p, element); - } -}; -DomainStoryRenderer.prototype.getShapePath = function (shape) { - let type = shape.type; - if (type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.ACTOR)) { - return this.getActorPath(shape); - } else if (type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.WORKOBJECT)) { - return this.getWorkObjectPath(shape); - } else if (type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.GROUP)) { - return this.getGroupPath(shape); - } -}; -DomainStoryRenderer.prototype.drawConnection = function (p, element) { - let type = element.type; - _dirtyFlagService.makeDirty(); - // fixes activities that were copy-pasted - if (!element.businessObject.type) { - element.businessObject.type = type; - } - if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.ACTIVITY) { - return this.drawActivity(p, element); - } else if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.CONNECTION) { - return this.drawDSConnection(p, element); - } -}; -// creates a SVG path that describes a rectangle which encloses the given shape. -function getRectPath(shape) { - let offset = 5; - let x = shape.x, - y = shape.y, - width = shape.width / 2 + offset, - height = shape.height / 2 + offset; - return [["M", x, y], ["l", width, 0], ["l", width, height], ["l", -width, height], ["l", -width, 0], ["z"]]; -} + return MaterialModule; +})(); +(function () { + (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsetNgModuleScope"](MaterialModule, { + imports: [_angular_material_button__WEBPACK_IMPORTED_MODULE_1__.MatButtonModule, _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_2__.MatButtonToggleModule, _angular_material_list__WEBPACK_IMPORTED_MODULE_3__.MatListModule, _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_4__.MatCheckboxModule, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__.MatDialogModule, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatFormFieldModule, _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_7__.MatGridListModule, _angular_material_input__WEBPACK_IMPORTED_MODULE_8__.MatInputModule, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__.MatToolbarModule, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_10__.MatExpansionModule, _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__.MatSnackBarModule, _angular_material_card__WEBPACK_IMPORTED_MODULE_12__.MatCardModule], + exports: [_angular_material_button__WEBPACK_IMPORTED_MODULE_1__.MatButtonModule, _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_2__.MatButtonToggleModule, _angular_material_list__WEBPACK_IMPORTED_MODULE_3__.MatListModule, _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_4__.MatCheckboxModule, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__.MatDialogModule, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatFormFieldModule, _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_7__.MatGridListModule, _angular_material_input__WEBPACK_IMPORTED_MODULE_8__.MatInputModule, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__.MatToolbarModule, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_10__.MatExpansionModule, _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__.MatSnackBarModule, _angular_material_card__WEBPACK_IMPORTED_MODULE_12__.MatCardModule] + }); +})(); /***/ }), -/***/ 71185: -/*!*****************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/domainStoryRules.js ***! - \*****************************************************/ +/***/ 421: +/*!*******************************************************************************************!*\ + !*** ./src/app/tools/autosave/presentation/AutosaveOptions/autosave-options.component.ts ***! + \*******************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ DomainStoryRules) +/* harmony export */ AutosaveOptionsComponent: () => (/* binding */ AutosaveOptionsComponent) /* harmony export */ }); -/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! min-dash */ 93673); -/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ 51270); -/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var diagram_js_lib_features_rules_RuleProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! diagram-js/lib/features/rules/RuleProvider */ 63169); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ 36997); +/* harmony import */ var src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/constants */ 40550); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _services_autosave_configuration_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/autosave-configuration.service */ 96040); +/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); +/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/button */ 72221); +/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/form-field */ 29344); +/* harmony import */ var _angular_material_card__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/card */ 90643); +/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/common */ 56610); @@ -65092,431 +64737,295 @@ __webpack_require__.r(__webpack_exports__); -const HIGH_PRIORITY = 1500; -const MIN_SIZE = 125; -function isDomainStory(element) { - return element && /^domainStory:/.test(element.type); -} -function isDomainStoryGroup(element) { - return element && /^domainStory:group/.test(element.type); -} -function isActor(element) { - return element && /^domainStory:actor\w*/.test(element.type); -} -function isWorkObject(element) { - return element && /^domainStory:workObject/.test(element.type); -} -function isActivity(element) { - return element && /^domainStory:activity/.test(element.type); -} -function isConnection(element) { - return element && /^domainStory:connection/.test(element.type); -} -function isAnnotation(element) { - return element && /^domainStory:textAnnotation/.test(element.type); -} -/** - * can source and target be connected? - */ -function canConnect(source, target) { - // only judge about two custom elements - if (isDomainStoryGroup(target) || !isDomainStory(source) || !isDomainStory(target)) { - return; - } - // do not allow a connection from one element to itself - if (source === target) { - return; - } - // do not allow a connection between two actors - if (isActor(source) && isActor(target)) { - return; - } - // do not allow a connection, where the source or target is an activity - if (isActivity(source) || isActivity(target)) { - return; - } - // do not allow a connection, where the source or target is an annotation connection - if (isConnection(source) || isConnection(target)) { - return; + +function AutosaveOptionsComponent_Conditional_0_Template(rf, ctx) { + if (rf & 1) { + const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "mat-card")(1, "mat-card-header")(2, "mat-card-title"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](3, "Autosave Options"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](4, "mat-card-content", 3)(5, "div", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](6, "input", 5, 0); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](8, "mat-label"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](9, "Enabled"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](10, "div", 6)(11, "mat-label"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](12, "Interval [sec]"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](13, "input", 7, 1); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](15, "div", 6)(16, "mat-label"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](17, "Max. Drafts"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](18, "input", 7, 2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](20, "button", 8); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function AutosaveOptionsComponent_Conditional_0_Template_button_click_20_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵrestoreView"](_r1); + const activated_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵreference"](7); + const interval_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵreference"](14); + const drafts_r4 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵreference"](19); + const ctx_r4 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresetView"](ctx_r4.save(activated_r2.checked, +drafts_r4.value, +interval_r3.value)); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](21, " Apply "); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()()(); } - // do not allow a connection to a connection(the special type of connection between an element and a comment box) - // when the target is an annotation, the connection type is an annotation connection instead of an activity - if (isAnnotation(target)) { - return { - type: src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.CONNECTION - }; + if (rf & 2) { + const configuration_r6 = ctx; + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](6); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("checked", configuration_r6.activated); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](7); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("value", configuration_r6.interval); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](5); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("value", configuration_r6.maxDrafts); } - return { - type: src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTIVITY - }; } -function canResize(shape, newBounds) { - if ((0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(shape, src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.GROUP)) { - if (newBounds) { - let lowerLeft = { - x: shape.x, - y: shape.y + shape.height - }; - let lowerRight = { - x: shape.x + shape.width, - y: shape.y + shape.height - }; - let upperRight = { - x: shape.x + shape.width, - y: shape.y - }; - if (newBounds.x !== shape.x && newBounds.y !== shape.y) { - // upper left - if (newBounds.x > lowerRight.x - MIN_SIZE) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(newBounds, { - x: lowerRight.x - MIN_SIZE - }); - } - if (newBounds.y > lowerRight.y - MIN_SIZE) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(newBounds, { - y: lowerRight.y - MIN_SIZE - }); - } - } - if (newBounds.x !== shape.x && newBounds.y === shape.y) { - // lower left - if (newBounds.x > upperRight.x - MIN_SIZE) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(newBounds, { - x: upperRight.x - MIN_SIZE - }); - } - } - if (newBounds.x === shape.x && newBounds.y !== shape.y) { - // upper right - if (newBounds.y > lowerLeft.y - MIN_SIZE) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(newBounds, { - y: lowerLeft.y - MIN_SIZE - }); - } - } - if (newBounds.height < MIN_SIZE) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(newBounds, { - height: MIN_SIZE +let AutosaveOptionsComponent = /*#__PURE__*/(() => { + class AutosaveOptionsComponent { + constructor(autosaveConfiguration, snackbar) { + this.autosaveConfiguration = autosaveConfiguration; + this.snackbar = snackbar; + } + save(activated, maxDrafts, interval) { + if (this.autosaveConfiguration.setConfiguration({ + activated, + maxDrafts, + interval + })) { + this.snackbar.open('Settings for Autosave saved', undefined, { + duration: src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION, + panelClass: src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_SUCCESS }); - } - if (newBounds.width < MIN_SIZE) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(newBounds, { - width: MIN_SIZE + } else { + this.snackbar.open('Unable to save settings for Autosave - please try again', undefined, { + duration: 2 * src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION, + panelClass: src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_ERROR }); } } - return true; - } - return false; -} -function canAttach(elements, target, source) { - if (!Array.isArray(elements)) { - elements = [elements]; - } - // disallow appending as boundary event - if (source) { - return false; - } - // only (re-)attach one element at a time - if (elements.length !== 1) { - return false; - } - // allow default move operation - if (!target) { - return true; - } - // only allow drop on DomainStory Elements - if (!isDomainStory(target)) { - return false; - } - return "attach"; -} -function canConnectToAnnotation(source, target, connection) { - // do not allow an activity connect to an annotation - if (isActivity(connection) && isAnnotation(target)) { - return false; - } - // do not allow an annotation connection between two annotations - if (isConnection(connection) && isAnnotation(source) && isAnnotation(target)) { - return false; - } - // do not allow an annotation connection between an actor or workObject and anything except an annotation - return !(isConnection(connection) && !isAnnotation(target) && (isActor(source) || isWorkObject(source))); -} -/** - * specific rules for custom elements - */ -function DomainStoryRules(eventBus) { - diagram_js_lib_features_rules_RuleProvider__WEBPACK_IMPORTED_MODULE_4__["default"].call(this, eventBus); -} -inherits__WEBPACK_IMPORTED_MODULE_0___default()(DomainStoryRules, diagram_js_lib_features_rules_RuleProvider__WEBPACK_IMPORTED_MODULE_4__["default"]); -DomainStoryRules.$inject = ["eventBus"]; -DomainStoryRules.prototype.init = function () { - /** - * can shape be created on target container? - */ - function canCreate(shape, target) { - // only judge about custom elements - if (!isDomainStory(shape)) { - return; - } - // allow creation just on groups - return !isDomainStory(target) || isDomainStoryGroup(target); - } - this.addRule("elements.create", function (context) { - const elements = context.elements, - position = context.position, - target = context.target; - return (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.every)(elements, function (element) { - if (isConnection(element)) { - return canConnect(element.source, element.target, element); - } - if (element.host) { - return canAttach(element, element.host, null, position); - } - return canCreate(element, target, null, position); + static #_ = this.ɵfac = function AutosaveOptionsComponent_Factory(t) { + return new (t || AutosaveOptionsComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_services_autosave_configuration_service__WEBPACK_IMPORTED_MODULE_1__.AutosaveConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_3__.MatSnackBar)); + }; + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ + type: AutosaveOptionsComponent, + selectors: [["app-autosave-options"]], + decls: 2, + vars: 3, + consts: [["activated", ""], ["interval", ""], ["drafts", ""], [1, "cardContent"], [1, "alignSelfCenter"], ["type", "checkbox", 3, "checked"], [1, "inputContainer"], ["min", "1", "type", "number", 1, "numberInput", 3, "value"], ["mat-raised-button", "", "color", "primary", 1, "saveButton", 3, "click"]], + template: function AutosaveOptionsComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtemplate"](0, AutosaveOptionsComponent_Conditional_0_Template, 22, 3, "mat-card"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵpipe"](1, "async"); + } + if (rf & 2) { + let tmp_0_0; + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵconditional"](0, (tmp_0_0 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵpipeBind1"](1, 1, ctx.autosaveConfiguration.configuration$)) ? 0 : -1, tmp_0_0); + } + }, + dependencies: [_angular_material_button__WEBPACK_IMPORTED_MODULE_4__.MatButton, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_5__.MatLabel, _angular_material_card__WEBPACK_IMPORTED_MODULE_6__.MatCard, _angular_material_card__WEBPACK_IMPORTED_MODULE_6__.MatCardContent, _angular_material_card__WEBPACK_IMPORTED_MODULE_6__.MatCardHeader, _angular_material_card__WEBPACK_IMPORTED_MODULE_6__.MatCardTitle, _angular_common__WEBPACK_IMPORTED_MODULE_7__.AsyncPipe], + styles: [".autosaveEnabled[_ngcontent-%COMP%], .autosaveInterval[_ngcontent-%COMP%] {\n display: inline-grid;\n grid-template-columns: 120px auto;\n width: 300px;\n grid-row-gap: 5px;\n height: 20px;\n}\n\n.enableButton[_ngcontent-%COMP%] {\n justify-self: start;\n}\n\n.autosaveEnabled[_ngcontent-%COMP%] {\n padding-bottom: 2px;\n}\n\n.autosaveInterval[_ngcontent-%COMP%] {\n padding-bottom: 10px;\n}\n\n.autosaveIntervalSpan[_ngcontent-%COMP%] {\n padding-top: 2px;\n justify-self: start;\n}\n\n.saveButton[_ngcontent-%COMP%] {\n align-self: end;\n right: 0;\n margin-left: -5px;\n}\n\n.cardContent[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n}\n\n.inputContainer[_ngcontent-%COMP%] {\n display: inline-grid;\n width: -moz-fit-content;\n width: fit-content;\n}\n\n.numberInput[_ngcontent-%COMP%] {\n justify-self: end;\n width: 64px;\n}\n\n.alignSelfCenter[_ngcontent-%COMP%] {\n align-self: center;\n}"] }); - }); - this.addRule("elements.move", HIGH_PRIORITY, function (context) { - let target = context.target, - shapes = context.shapes; - let type; - // do not allow mixed movements of custom / BPMN shapes - // if any shape cannot be moved, the group cannot be moved, too - // reject, if we have at least one - // custom element that cannot be moved - return (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.reduce)(shapes, function (result, s) { - if (type === undefined) { - type = isDomainStory(s); - } - if (type !== isDomainStory(s) || result === false) { - return false; - } - return canCreate(s, target); - }, undefined); - }); - this.addRule("shape.create", HIGH_PRIORITY, function (context) { - let target = context.target, - shape = context.shape; - return canCreate(shape, target); - }); - this.addRule("connection.create", HIGH_PRIORITY, function (context) { - let source = context.source, - target = context.target; - return canConnect(source, target); - }); - this.addRule("connection.reconnect", HIGH_PRIORITY, function (context) { - let connection = context.connection, - source = context.hover || context.source, - target = context.target; - // -------------------------------------------------------------- - let result = canConnectToAnnotation(source, target, connection); - if (!result) { - return; - } - // -------------------------------------------------------------- - return canConnect(source, target, connection); - }); - this.addRule("shape.resize", function (context) { - let shape = context.shape, - newBounds = context.newBounds; - return canResize(shape, newBounds); - }); -}; -DomainStoryRules.prototype.canConnect = canConnect; -DomainStoryRules.prototype.canAttach = canAttach; -DomainStoryRules.prototype.isDomainStory = isDomainStory; -DomainStoryRules.prototype.canResize = canResize; + } + return AutosaveOptionsComponent; +})(); /***/ }), -/***/ 37747: -/*!*******************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/domainStoryUpdater.js ***! - \*******************************************************/ +/***/ 91525: +/*!*********************************************************************************************!*\ + !*** ./src/app/tools/autosave/presentation/AutosaveSettings/autosave-settings.component.ts ***! + \*********************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ DomainStoryUpdater) +/* harmony export */ AutosaveSettingsComponent: () => (/* binding */ AutosaveSettingsComponent) /* harmony export */ }); -/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ 51270); -/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! min-dash */ 93673); -/* harmony import */ var diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! diagram-js/lib/command/CommandInterceptor */ 87502); -/* harmony import */ var diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! diagram-js/lib/util/Collections */ 90238); -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ 36997); -/* harmony import */ var _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Domain/Common/elementTypes */ 30236); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _AutosaveOptions_autosave_options_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../AutosaveOptions/autosave-options.component */ 421); +/* harmony import */ var _AutosavedDrafts_autosaved_drafts_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AutosavedDrafts/autosaved-drafts.component */ 29051); +let AutosaveSettingsComponent = /*#__PURE__*/(() => { + class AutosaveSettingsComponent { + static #_ = this.ɵfac = function AutosaveSettingsComponent_Factory(t) { + return new (t || AutosaveSettingsComponent)(); + }; + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ + type: AutosaveSettingsComponent, + selectors: [["app-autosave-settings"]], + decls: 2, + vars: 0, + template: function AutosaveSettingsComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](0, "app-autosave-options")(1, "app-autosaved-drafts"); + } + }, + dependencies: [_AutosaveOptions_autosave_options_component__WEBPACK_IMPORTED_MODULE_0__.AutosaveOptionsComponent, _AutosavedDrafts_autosaved_drafts_component__WEBPACK_IMPORTED_MODULE_1__.AutosavedDraftsComponent] + }); + } + return AutosaveSettingsComponent; +})(); +/***/ }), +/***/ 29051: +/*!*******************************************************************************************!*\ + !*** ./src/app/tools/autosave/presentation/AutosavedDrafts/autosaved-drafts.component.ts ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AutosavedDraftsComponent: () => (/* binding */ AutosavedDraftsComponent) +/* harmony export */ }); +/* harmony import */ var src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/constants */ 40550); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _services_autosave_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/autosave.service */ 41707); +/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); +/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/button */ 72221); +/* harmony import */ var _angular_material_expansion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/expansion */ 71288); -/** - * a handler responsible for updating the custom element's businessObject - * once changes on the diagram happen. - */ -function DomainStoryUpdater(eventBus, bpmnjs) { - diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_3__["default"].call(this, eventBus); - function updateCustomElement(e) { - let context = e.context, - shape = context.shape, - businessObject = shape.businessObject; - if (!shape || !shape.type.includes(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.DOMAINSTORY)) { - return; - } - let parent = shape.parent; - let customElements = bpmnjs._customElements; - // make sure element is added / removed from bpmnjs.customElements - if (!parent) { - (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_4__.remove)(customElements, businessObject); - } else { - (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_4__.add)(customElements, businessObject); - } - // save custom element position - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(businessObject, (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.pick)(shape, ["x", "y"])); - // save custom element size if resizable - if (shape.type === _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.GROUP) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(businessObject, (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.pick)(shape, ["height", "width"])); - // rework the child-parent relations if a group was moved, such that all Objects that are visually in the group are also associated with it - // since we do not have access to the standard-canvas object here, we cannot use the function correctGroupChildren() from DSLabelUtil - if (parent != null) { - (0,_util__WEBPACK_IMPORTED_MODULE_1__.reworkGroupElements)(parent, shape); - } - } - if (shape && shape.parent && "type" in shape.parent && shape.parent.type === _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.GROUP) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(businessObject, { - parent: shape.parent.id - }); - } - } - function updateCustomConnection(e) { - let context = e.context, - connection = context.connection, - source = connection.source, - target = connection.target, - businessObject = connection.businessObject; - if (e.newTarget) { - target = e.newTarget; + + + + +function AutosavedDraftsComponent_Conditional_7_For_2_Template(rf, ctx) { + if (rf & 1) { + const _r2 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "div", 1)(1, "div")(2, "div", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](3); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](4, "div", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](5); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](6, "button", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function AutosavedDraftsComponent_Conditional_7_For_2_Template_button_click_6_listener() { + const draft_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵrestoreView"](_r2).$implicit; + const ctx_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵnextContext"](2); + return _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresetView"](ctx_r3.loadDraft(draft_r3)); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](7, " Load Draft "); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + } + if (rf & 2) { + const draft_r3 = ctx.$implicit; + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtextInterpolate"](draft_r3.title); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtextInterpolate"](draft_r3.date); + } +} +function AutosavedDraftsComponent_Conditional_7_Template(rf, ctx) { + if (rf & 1) { + const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "div", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵrepeaterCreate"](1, AutosavedDraftsComponent_Conditional_7_For_2_Template, 8, 2, "div", 1, _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵrepeaterTrackByIdentity"]); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](3, "div", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](4, "div"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](5, "button", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function AutosavedDraftsComponent_Conditional_7_Template_button_click_5_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵrestoreView"](_r1); + const ctx_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresetView"](ctx_r3.removeAllDrafts()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](6, " Remove All Drafts "); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()()(); + } + if (rf & 2) { + const ctx_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵnextContext"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵrepeater"](ctx_r3.drafts); + } +} +function AutosavedDraftsComponent_Conditional_8_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](0, " No drafts found. "); + } +} +let AutosavedDraftsComponent = /*#__PURE__*/(() => { + class AutosavedDraftsComponent { + constructor(autosaveService, snackbar) { + this.autosaveService = autosaveService; + this.snackbar = snackbar; + this.drafts = []; + this.subscription = this.autosaveService.autosavedDraftsChanged$.subscribe(() => this.initDrafts()); } - if (e.newSource) { - source = e.newSource; + ngOnInit() { + this.initDrafts(); } - let parent = connection.parent; - let customElements = bpmnjs._customElements; - // make sure element is added / removed from bpmnjs.customElements - if (!parent) { - (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_4__.remove)(customElements, businessObject); - } else { - (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_4__.add)(customElements, businessObject); + initDrafts() { + this.drafts = this.autosaveService.loadCurrentDrafts(); } - // update waypoints - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(businessObject, { - waypoints: copyWaypoints(connection) - }); - if (source) { - if (!businessObject.source) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(businessObject, { - source: source.id - }); - } else { - businessObject.source = source.id; - } + loadDraft(draft) { + this.autosaveService.loadDraft(draft); + this.snackbar.open('Draft loaded', undefined, { + duration: src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION, + panelClass: src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_SUCCESS + }); } - if (target) { - if (!businessObject.target) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(businessObject, { - target: target.id - }); - } else { - businessObject.target = target.id; - } + removeAllDrafts() { + this.autosaveService.removeAllDrafts(); } - } - function copyWaypoints(connection) { - return connection.waypoints.map(function (p) { - if (p.original) { - return { - original: { - x: p.original.x, - y: p.original.y - }, - x: p.x, - y: p.y - }; - } else { - return { - x: p.x, - y: p.y - }; - } + static #_ = this.ɵfac = function AutosavedDraftsComponent_Factory(t) { + return new (t || AutosavedDraftsComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_services_autosave_service__WEBPACK_IMPORTED_MODULE_1__.AutosaveService), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_3__.MatSnackBar)); + }; + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ + type: AutosavedDraftsComponent, + selectors: [["app-autosaved-drafts"]], + decls: 9, + vars: 3, + consts: [[1, "items"], [1, "item", "border-bottom"], [1, "item"], ["mat-raised-button", "", "color", "primary", 1, "item-button", 3, "click"], [1, "item-title"], [1, "item-date"]], + template: function AutosavedDraftsComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "mat-accordion")(1, "mat-expansion-panel")(2, "mat-expansion-panel-header")(3, "mat-panel-title"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](4, "History"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](5, "mat-panel-description"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](6); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtemplate"](7, AutosavedDraftsComponent_Conditional_7_Template, 7, 0, "div", 0)(8, AutosavedDraftsComponent_Conditional_8_Template, 1, 0); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](6); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtextInterpolate2"](" ", ctx.drafts.length ? ctx.drafts.length : "no", " ", ctx.drafts.length > 1 ? "drafts" : "draft", " available "); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵconditional"](7, ctx.drafts.length ? 7 : 8); + } + }, + dependencies: [_angular_material_button__WEBPACK_IMPORTED_MODULE_4__.MatButton, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_5__.MatAccordion, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_5__.MatExpansionPanel, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_5__.MatExpansionPanelHeader, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_5__.MatExpansionPanelTitle, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_5__.MatExpansionPanelDescription], + styles: [".items[_ngcontent-%COMP%] {\n padding-top: 0 !important;\n}\n.items[_ngcontent-%COMP%] .mat-list-item-content {\n padding: 0;\n}\n\n.item[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 8px 0;\n width: 400px;\n}\n\n.border-bottom[_ngcontent-%COMP%] {\n border-bottom: 1px solid darkgray;\n}\n\n.item-title[_ngcontent-%COMP%] {\n font-weight: bold;\n width: 270px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n\n.item-date[_ngcontent-%COMP%] {\n font-weight: normal;\n}\n\n.item-button[_ngcontent-%COMP%] {\n margin-left: 1rem;\n}\n\nmat-list-item[_ngcontent-%COMP%] {\n border-bottom: 1px solid darkgray;\n}"] }); } - this.executed(["shape.create", "shape.move", "shape.delete", "shape.resize", "shape.removeGroupWithChildren"], ifDomainStoryElement(updateCustomElement)); - this.reverted(["shape.create", "shape.move", "shape.delete", "shape.resize", "shape.removeGroupWithChildren"], ifDomainStoryElement(updateCustomElement)); - this.executed(["connection.create", "connection.reconnect", "connection.updateWaypoints", "connection.delete", "connection.layout", "connection.move"], ifDomainStoryElement(updateCustomConnection)); - this.reverted(["connection.create", "connection.reconnect", "connection.updateWaypoints", "connection.delete", "connection.layout", "connection.move"], ifDomainStoryElement(updateCustomConnection)); -} -// check if element in the context of an event is a domainStory element -function ifDomainStoryElement(fn) { - return event => { - const context = event.context; - const element = context.shape || context.connection; - if (isDomainStory(element)) { - fn(event); - } - }; -} -function isDomainStory(element) { - return element && /domainStory:/.test(element.type); -} -inherits__WEBPACK_IMPORTED_MODULE_0___default()(DomainStoryUpdater, diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_3__["default"]); -DomainStoryUpdater.$inject = ["eventBus", "bpmnjs"]; + return AutosavedDraftsComponent; +})(); /***/ }), -/***/ 45077: -/*!******************************************!*\ - !*** ./src/app/BPMN-JS/modeler/index.js ***! - \******************************************/ +/***/ 63246: +/*!*************************************************************************!*\ + !*** ./src/app/tools/autosave/presentation/autosave-settings.module.ts ***! + \*************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ AutosaveSettingsModule: () => (/* binding */ AutosaveSettingsModule) /* harmony export */ }); -/* harmony import */ var _domainStoryElementFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domainStoryElementFactory */ 86258); -/* harmony import */ var _domainStoryRenderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./domainStoryRenderer */ 37751); -/* harmony import */ var _palette_domainStoryPalette__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./palette/domainStoryPalette */ 84277); -/* harmony import */ var _domainStoryRules__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./domainStoryRules */ 71185); -/* harmony import */ var _domainStoryUpdater__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./domainStoryUpdater */ 37747); -/* harmony import */ var bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! bpmn-js/lib/features/modeling/ElementFactory */ 63784); -/* harmony import */ var diagram_js_lib_features_create__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! diagram-js/lib/features/create */ 31073); -/* harmony import */ var bpmn_js_lib_draw_PathMap__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! bpmn-js/lib/draw/PathMap */ 66652); -/* harmony import */ var bpmn_js_lib_features_popup_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! bpmn-js/lib/features/popup-menu */ 77029); -/* harmony import */ var diagram_js_lib_features_context_pad__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! diagram-js/lib/features/context-pad */ 64712); -/* harmony import */ var diagram_js_lib_command_CommandStack__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! diagram-js/lib/command/CommandStack */ 22205); -/* harmony import */ var _updateHandler_updateLabelHandler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./updateHandler/updateLabelHandler */ 79182); -/* harmony import */ var _updateHandler_headlineAndDescriptionUpdateHandler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./updateHandler/headlineAndDescriptionUpdateHandler */ 65501); -/* harmony import */ var _context_pad_domainStoryContextPadProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./context-pad/domainStoryContextPadProvider */ 74669); -/* harmony import */ var _change_icon_replaceMenuProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./change-icon/replaceMenuProvider */ 96554); -/* harmony import */ var _modeling_dSModeling__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./modeling/dSModeling */ 38875); - - - - - - - - - - - +/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ 56610); +/* harmony import */ var _AutosaveSettings_autosave_settings_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AutosaveSettings/autosave-settings.component */ 91525); +/* harmony import */ var _AutosaveOptions_autosave_options_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AutosaveOptions/autosave-options.component */ 421); +/* harmony import */ var _AutosavedDrafts_autosaved_drafts_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AutosavedDrafts/autosaved-drafts.component */ 29051); +/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/forms */ 37222); +/* harmony import */ var _material_module__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../material.module */ 89439); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 2978); @@ -65524,157 +65033,122 @@ __webpack_require__.r(__webpack_exports__); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - __depends__: [diagram_js_lib_features_create__WEBPACK_IMPORTED_MODULE_10__["default"], diagram_js_lib_features_context_pad__WEBPACK_IMPORTED_MODULE_11__["default"], bpmn_js_lib_features_popup_menu__WEBPACK_IMPORTED_MODULE_12__["default"]], - __init__: ["domainStoryRenderer", "paletteProvider", "domainStoryRules", "domainStoryUpdater", "contextPadProvider", "replaceMenuProvider"], - elementFactory: ["type", _domainStoryElementFactory__WEBPACK_IMPORTED_MODULE_0__["default"]], - domainStoryRenderer: ["type", _domainStoryRenderer__WEBPACK_IMPORTED_MODULE_1__["default"]], - paletteProvider: ["type", _palette_domainStoryPalette__WEBPACK_IMPORTED_MODULE_2__["default"]], - domainStoryRules: ["type", _domainStoryRules__WEBPACK_IMPORTED_MODULE_3__["default"]], - domainStoryUpdater: ["type", _domainStoryUpdater__WEBPACK_IMPORTED_MODULE_4__["default"]], - contextPadProvider: ["type", _context_pad_domainStoryContextPadProvider__WEBPACK_IMPORTED_MODULE_7__["default"]], - elementFactoryBpmn: ["type", bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_13__["default"]], - pathMap: ["type", bpmn_js_lib_draw_PathMap__WEBPACK_IMPORTED_MODULE_14__["default"]], - replaceMenuProvider: ["type", _change_icon_replaceMenuProvider__WEBPACK_IMPORTED_MODULE_8__["default"]], - commandStack: ["type", diagram_js_lib_command_CommandStack__WEBPACK_IMPORTED_MODULE_15__["default"]], - updateLabelHandler: ["type", _updateHandler_updateLabelHandler__WEBPACK_IMPORTED_MODULE_5__["default"]], - headlineAndDescriptionUpdateHandler: ["type", _updateHandler_headlineAndDescriptionUpdateHandler__WEBPACK_IMPORTED_MODULE_6__["default"]], - modeling: ["type", _modeling_dSModeling__WEBPACK_IMPORTED_MODULE_9__["default"]] -}); +let AutosaveSettingsModule = /*#__PURE__*/(() => { + class AutosaveSettingsModule { + static #_ = this.ɵfac = function AutosaveSettingsModule_Factory(t) { + return new (t || AutosaveSettingsModule)(); + }; + static #_2 = this.ɵmod = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineNgModule"]({ + type: AutosaveSettingsModule + }); + static #_3 = this.ɵinj = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjector"]({ + imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_6__.FormsModule, _material_module__WEBPACK_IMPORTED_MODULE_3__.MaterialModule] + }); + } + return AutosaveSettingsModule; +})(); +(function () { + (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵsetNgModuleScope"](AutosaveSettingsModule, { + declarations: [_AutosaveSettings_autosave_settings_component__WEBPACK_IMPORTED_MODULE_0__.AutosaveSettingsComponent, _AutosaveOptions_autosave_options_component__WEBPACK_IMPORTED_MODULE_1__.AutosaveOptionsComponent, _AutosavedDrafts_autosaved_drafts_component__WEBPACK_IMPORTED_MODULE_2__.AutosavedDraftsComponent], + imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_6__.FormsModule, _material_module__WEBPACK_IMPORTED_MODULE_3__.MaterialModule], + exports: [_AutosaveSettings_autosave_settings_component__WEBPACK_IMPORTED_MODULE_0__.AutosaveSettingsComponent] + }); +})(); /***/ }), -/***/ 15537: -/*!*******************************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/labeling/dsLabelEditingPreview.js ***! - \*******************************************************************/ +/***/ 96040: +/*!***************************************************************************!*\ + !*** ./src/app/tools/autosave/services/autosave-configuration.service.ts ***! + \***************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ DSLabelEditingPreview), -/* harmony export */ getAnnotationBoxHeight: () => (/* binding */ getAnnotationBoxHeight) +/* harmony export */ AutosaveConfigurationService: () => (/* binding */ AutosaveConfigurationService) /* harmony export */ }); -/* harmony import */ var tiny_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tiny-svg */ 87004); -/* harmony import */ var diagram_js_lib_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! diagram-js/lib/util/SvgTransformUtil */ 53813); -/* harmony import */ var _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Domain/Common/elementTypes */ 30236); -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util */ 36997); - - +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 39090); +/* harmony import */ var src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/constants */ 40550); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _domain_services_storage_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../domain/services/storage.service */ 50624); -const MARKER_HIDDEN = "djs-element-hidden", - MARKER_LABEL_HIDDEN = "djs-label-hidden"; -let annotationBoxHeight = 0; -function getAnnotationBoxHeight() { - return annotationBoxHeight; -} -function DSLabelEditingPreview(eventBus, canvas, pathMap) { - let self = this; - let defaultLayer = canvas.getDefaultLayer(); - let element, absoluteElementBBox, gfx; - eventBus.on("directEditing.activate", function (context) { - let activeProvider = context.active; - element = activeProvider.element.label || activeProvider.element; - // text annotation - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.is)(element, _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.TEXTANNOTATION)) { - absoluteElementBBox = canvas.getAbsoluteBBox(element); - gfx = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.create)("g"); - annotationBoxHeight = element.height; - let textPathData = pathMap.getScaledPath("TEXT_ANNOTATION", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0.0, - my: 0.0 - } - }); - let path = self.path = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.create)("path"); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.attr)(path, { - d: textPathData, - strokeWidth: 2, - stroke: getStrokeColor(element) - }); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.append)(gfx, path); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.append)(defaultLayer, gfx); - (0,diagram_js_lib_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_3__.translate)(gfx, element.x, element.y); +const AUTOSAVE_CONFIGURATION_TAG = 'autosaveConfiguration'; +const defaultConfiguration = { + activated: src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_AUTOSAVES_ENABLED, + interval: src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_AUTOSAVES_INTERVAL, + maxDrafts: src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_AUTOSAVES_MAX_DRAFTS +}; +let AutosaveConfigurationService = /*#__PURE__*/(() => { + class AutosaveConfigurationService { + constructor(storageService) { + this.storageService = storageService; + this.configuration = defaultConfiguration; + this.configurationSubject = new rxjs__WEBPACK_IMPORTED_MODULE_2__.ReplaySubject(1); + this.configuration$ = this.configurationSubject.asObservable(); + this.initializeConfiguration(); } - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.is)(element, _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.TEXTANNOTATION) || element.labelTarget) { - canvas.addMarker(element, MARKER_HIDDEN); - } else if (element.type.includes(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR) || element.type.includes(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT) || element.type.includes(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY) || element.type.includes(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.GROUP)) { - canvas.addMarker(element, MARKER_LABEL_HIDDEN); + initializeConfiguration() { + this.loadConfiguration(); + this.configurationSubject.next(this.configuration); } - }); - eventBus.on("directEditing.resize", function (context) { - // text annotation - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.is)(element, _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.TEXTANNOTATION)) { - let height = context.height, - dy = context.dy; - let newElementHeight = Math.max(element.height / absoluteElementBBox.height * (height + dy), 0); - annotationBoxHeight = newElementHeight; - let textPathData = pathMap.getScaledPath("TEXT_ANNOTATION", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: element.width, - containerHeight: newElementHeight, - position: { - mx: 0.0, - my: 0.0 - } - }); - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.attr)(self.path, { - d: textPathData - }); + setConfiguration(configuration) { + try { + this.configuration = configuration; + this.saveConfiguration(); + this.configurationSubject.next(configuration); + return true; + } catch { + return false; + } } - }); - eventBus.on(["directEditing.complete", "directEditing.cancel"], function (context) { - let activeProvider = context.active; - if (activeProvider) { - canvas.removeMarker(activeProvider.element.label || activeProvider.element, MARKER_HIDDEN); - canvas.removeMarker(element, MARKER_LABEL_HIDDEN); + loadConfiguration() { + this.configuration = this.storageService.get(AUTOSAVE_CONFIGURATION_TAG) ?? defaultConfiguration; } - element = undefined; - absoluteElementBBox = undefined; - if (gfx) { - (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.remove)(gfx); - gfx = undefined; + saveConfiguration() { + this.storageService.set(AUTOSAVE_CONFIGURATION_TAG, this.configuration); } - }); -} -DSLabelEditingPreview.$inject = ["eventBus", "canvas", "pathMap"]; -// helpers /////////////////// -function getStrokeColor() { - return "black"; -} + static #_ = this.ɵfac = function AutosaveConfigurationService_Factory(t) { + return new (t || AutosaveConfigurationService)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](_domain_services_storage_service__WEBPACK_IMPORTED_MODULE_1__.StorageService)); + }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjectable"]({ + token: AutosaveConfigurationService, + factory: AutosaveConfigurationService.ɵfac, + providedIn: 'root' + }); + } + return AutosaveConfigurationService; +})(); /***/ }), -/***/ 50572: -/*!********************************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/labeling/dsLabelEditingProvider.js ***! - \********************************************************************/ +/***/ 41707: +/*!*************************************************************!*\ + !*** ./src/app/tools/autosave/services/autosave.service.ts ***! + \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ DSLabelEditingProvider), -/* harmony export */ focusElement: () => (/* binding */ focusElement), -/* harmony export */ getNumberStash: () => (/* binding */ getNumberStash), -/* harmony export */ initializeLabelEditingProvider: () => (/* binding */ initializeLabelEditingProvider), -/* harmony export */ toggleStashUse: () => (/* binding */ toggleStashUse) +/* harmony export */ AutosaveService: () => (/* binding */ AutosaveService), +/* harmony export */ DRAFTS_TAG: () => (/* binding */ DRAFTS_TAG) /* harmony export */ }); -/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! min-dash */ 93673); -/* harmony import */ var _dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dsLabelUtil */ 84745); -/* harmony import */ var bpmn_js_lib_features_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bpmn-js/lib/features/modeling/util/ModelingUtil */ 87908); -/* harmony import */ var bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! bpmn-js/lib/util/LabelUtil */ 50815); -/* harmony import */ var _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Domain/Common/elementTypes */ 30236); -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util */ 36997); +/* harmony import */ var _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../domain/entities/elementTypes */ 73190); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ 907); +/* harmony import */ var _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../domain/entities/constants */ 40550); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _autosave_configuration_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./autosave-configuration.service */ 96040); +/* harmony import */ var _export_services_export_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../export/services/export.service */ 39595); +/* harmony import */ var _icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../icon-set-config/services/icon-dictionary.service */ 6932); +/* harmony import */ var _modeler_services_renderer_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../modeler/services/renderer.service */ 63812); +/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); +/* harmony import */ var _domain_services_storage_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../domain/services/storage.service */ 50624); +/* harmony import */ var _title_services_title_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../title/services/title.service */ 41535); +/* harmony import */ var _icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../icon-set-config/services/icon-set-configuration.service */ 46527); @@ -65683,760 +65157,367 @@ __webpack_require__.r(__webpack_exports__); -let dictionaryService; -let numberStash = 0; -let stashUse = false; -function initializeLabelEditingProvider(labelingDictionary) { - dictionaryService = labelingDictionary; -} -function getNumberStash() { - let number = { - use: stashUse, - number: numberStash - }; - stashUse = false; - return number; -} -function toggleStashUse(use) { - stashUse = use; -} -function focusElement(element) { - // Opening a Angular Dialog seems to mess with the focus logic somehow. - // My guess is that is makes the mousedown event passive, which prevents "preventDefault" from intercepting. - // I am not sure how to fix it, but this seems to be a workaround. - setTimeout(() => element.focus(), 0); -} -function DSLabelEditingProvider(eventBus, canvas, directEditing, modeling, resizeHandles, textRenderer, updateLabelHandler) { - this._canvas = canvas; - this._modeling = modeling; - this._textRenderer = textRenderer; - this._updateLabelHandler = updateLabelHandler; - directEditing.registerProvider(this); - // listen to dblclick on non-root elements - eventBus.on("element.dblclick", function (event) { - activateDirectEdit(event.element, true); - if ((0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(event.element, _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTIVITY)) { - // if we edit an activity, we do not want the standard editing box - numberStash = event.element.businessObject.number; - stashUse = true; - directEditing.complete(); + + + + +const DRAFTS_TAG = 'autosaveDrafts'; +let AutosaveService = /*#__PURE__*/(() => { + class AutosaveService { + constructor(autosaveConfiguration, exportService, iconDictionaryService, rendererService, snackbar, storageService, titleService, iconSetConfigurationService) { + this.autosaveConfiguration = autosaveConfiguration; + this.exportService = exportService; + this.iconDictionaryService = iconDictionaryService; + this.rendererService = rendererService; + this.snackbar = snackbar; + this.storageService = storageService; + this.titleService = titleService; + this.iconSetConfigurationService = iconSetConfigurationService; + this.autosavedDraftsChanged$ = new rxjs__WEBPACK_IMPORTED_MODULE_9__.Subject(); + this.autosaveConfiguration.configuration$.subscribe(configuration => this.updateConfiguration(configuration)); } - }); - // complete on followup canvas operation - eventBus.on(["element.mousedown", "drag.init", "canvas.viewbox.changing", "autoPlace", "popupMenu.open"], function () { - if (directEditing.isActive()) { - directEditing.complete(); + loadCurrentDrafts() { + const drafts = this.readDrafts(); + this.sortDrafts(drafts); + return drafts; } - }); - // cancel on command stack changes - eventBus.on(["commandStack.changed"], function () { - if (directEditing.isActive()) { - directEditing.cancel(); + loadDraft(draft) { + const configFromFile = draft.configAndDST.domain; + const config = this.iconSetConfigurationService.createIconSetConfiguration(configFromFile); + const story = JSON.parse(draft.configAndDST.dst); + this.titleService.updateTitleAndDescription(draft.title, draft.description, false); + const actorIcons = this.iconDictionaryService.getElementsOfType(story, _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR); + const workObjectIcons = this.iconDictionaryService.getElementsOfType(story, _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT); + this.iconDictionaryService.updateIconRegistries(actorIcons, workObjectIcons, config); + this.rendererService.importStory(story, true, config, false); } - }); - eventBus.on("directEditing.activate", function (event) { - resizeHandles.removeResizers(); - let element = event.active.element; - createAutocomplete(element); - }); - eventBus.on("create.end", 500, function (event) { - let element = event.shape, - canExecute = event.context.canExecute, - isTouch = event.isTouch; - if (isTouch) { - return; + removeAllDrafts() { + this.storageService.set(DRAFTS_TAG, []); + this.autosavedDraftsChanged$.next(); } - if (!canExecute) { - return; + loadLatestDraft() { + const drafts = this.readDrafts(); + if (drafts.length === 0) { + return; + } + this.loadDraft(drafts[0]); } - if (!(0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(element, _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTIVITY)) { - activateDirectEdit(element); + updateConfiguration(configuration) { + this.stopTimer(); + if (configuration.activated) { + this.startTimer(configuration.interval, configuration.maxDrafts); + } } - let editingBox = document.getElementsByClassName("djs-direct-editing-content"); - focusElement(editingBox.item(0)); - }); - eventBus.on("autoPlace.end", 500, function (event) { - activateDirectEdit(event.shape); - }); - function activateDirectEdit(element, force) { - if (force || (0,bpmn_js_lib_features_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_3__.isAny)(element, [_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.TEXTANNOTATION]) || element.businessObject.type.includes(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.DOMAINSTORY)) { - directEditing.activate(element); + stopTimer() { + if (this.autosaveTimer) { + clearInterval(this.autosaveTimer); + this.autosaveTimer = undefined; + } } - } - function createAutocomplete(element) { - let editingBox = document.getElementsByClassName("djs-direct-editing-content"); - focusElement(editingBox.item(0)); - (0,_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.autocomplete)(editingBox[0], dictionaryService.getUniqueWorkObjectNames(), element, eventBus); - } -} -DSLabelEditingProvider.$inject = ["eventBus", "canvas", "directEditing", "modeling", "resizeHandles", "textRenderer", "updateLabelHandler"]; -/** - * activate direct editing for activities and text annotations. - * - * @param {djs.model.Base} element - * - * @return {Object} an object with properties bounds (position and size), text and options - */ -DSLabelEditingProvider.prototype.activate = function (element) { - // text - if (element.id === "__implicitrootbase") { - return; - } - let text = (0,_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.getLabel)(element); - if (text === undefined) { - return; - } - let context = { - text: text - }; - // bounds - let bounds = this.getEditingBBox(element); - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(context, bounds); - let options = {}; - // external labels - if ((0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_5__.isLabelExternal)(element)) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(options, { - autoResize: true - }); - } - // text annotations - if ((0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(element, _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.TEXTANNOTATION)) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(options, { - resizable: true, - autoResize: true - }); - } - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(context, { - options: options - }); - return context; -}; -/** - * get the editing bounding box based on the element's size and position - * - * @param {djs.model.Base} element - * - * @return {Object} an object containing information about position - * and size (fixed or minimum and/or maximum) - */ -DSLabelEditingProvider.prototype.getEditingBBox = function (element) { - let canvas = this._canvas; - let target = element.label || element; - let bbox = canvas.getAbsoluteBBox(target); - let mid = { - x: bbox.x + bbox.width / 2, - y: bbox.y + bbox.height / 2 - }; - // default position - let bounds = { - x: bbox.x, - y: bbox.y - }; - /** The cavnas is an Object from BPMN, the IDE might say, that zoom is deprecated, - * because it thinks canvas is the standard HTMLElement. -> Needs to stay toom **/ - let zoom = canvas.zoom(); - let defaultStyle = this._textRenderer.getDefaultStyle(), - externalStyle = this._textRenderer.getExternalStyle(); - // take zoom into account - let externalFontSize = externalStyle.fontSize * zoom, - externalLineHeight = externalStyle.lineHeight, - defaultFontSize = defaultStyle.fontSize * zoom, - defaultLineHeight = defaultStyle.lineHeight; - let style = { - fontFamily: this._textRenderer.getDefaultStyle().fontFamily, - fontWeight: this._textRenderer.getDefaultStyle().fontWeight - }; - // adjust for groups - if ((0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(element, _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.GROUP)) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(bounds, { - minWidth: bbox.width / 2.5 > 125 ? bbox.width / 2.5 : 125, - maxWidth: bbox.width, - minHeight: 30 * zoom, - x: bbox.x, - y: bbox.y - }); - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(style, { - fontSize: defaultFontSize + "px", - lineHeight: defaultLineHeight, - paddingTop: 7 * zoom + "px", - paddingBottom: 7 * zoom + "px", - paddingLeft: 5 * zoom + "px", - paddingRight: 5 * zoom + "px", - textAlign: "left" - }); - } - // internal labels for tasks and collapsed call activities, - // sub processes and participants - if (/^domainStory:actor\w*/.test(element.type) || /^domainStory:workObject\w*/.test(element.type)) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(bounds, { - width: bbox.width, - minHeight: 30, - y: bbox.y + bbox.height - 20, - x: bbox.x - }); - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(style, { - fontSize: defaultFontSize + "px", - lineHeight: defaultLineHeight, - paddingTop: 7 * zoom + "px", - paddingBottom: 7 * zoom + "px", - paddingLeft: 5 * zoom + "px", - paddingRight: 5 * zoom + "px" - }); - } - let width = 90 * zoom, - paddingTop = 7 * zoom, - paddingBottom = 4 * zoom; - // external labels for events, data elements, gateways and connections - if (target.labelTarget) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(bounds, { - width: width, - height: bbox.height + paddingTop + paddingBottom, - x: mid.x - width / 2, - y: bbox.y - paddingTop - }); - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(style, { - fontSize: externalFontSize + "px", - lineHeight: externalLineHeight, - paddingTop: paddingTop + "px", - paddingBottom: paddingBottom + "px" - }); - } - // external label not yet created - if ((0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_5__.isLabelExternal)(target) && !(0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_5__.hasExternalLabel)(target) && !(0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_5__.isLabel)(target)) { - let externalLabelMid = (0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_5__.getExternalLabelMid)(element); - let absoluteBBox = canvas.getAbsoluteBBox({ - x: externalLabelMid.x, - y: externalLabelMid.y, - width: 0, - height: 0 - }); - let height = externalFontSize + paddingTop + paddingBottom; - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(bounds, { - width: width, - height: height, - x: absoluteBBox.x - width / 2, - y: absoluteBBox.y - height / 2 - }); - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(style, { - fontSize: externalFontSize + "px", - lineHeight: externalLineHeight, - paddingTop: paddingTop + "px", - paddingBottom: paddingBottom + "px" - }); - } - // text annotations - if ((0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(element, _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.TEXTANNOTATION)) { - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(bounds, { - width: bbox.width, - height: bbox.height, - minWidth: 30 * zoom, - minHeight: 10 * zoom - }); - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(style, { - textAlign: "left", - paddingTop: 7 * zoom + "px", - paddingBottom: 7 * zoom + "px", - paddingLeft: 5 * zoom + "px", - paddingRight: 5 * zoom + "px", - fontSize: defaultFontSize + "px", - lineHeight: defaultLineHeight - }); - } - return { - bounds: bounds, - style: style - }; -}; -DSLabelEditingProvider.prototype.update = function (element, newLabel, activeContextText, bounds) { - let newBounds, bbox; - if ((0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(element, _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.TEXTANNOTATION)) { - bbox = this._canvas.getAbsoluteBBox(element); - newBounds = { - x: element.x, - y: element.y, - width: element.width / bbox.width * bounds.width, - height: element.height / bbox.height * bounds.height + startTimer(interval, maxDrafts) { + this.autosaveTimer = setInterval(() => { + const savedDrafts = this.loadCurrentDrafts(); + const newDraft = this.createDraft(); + let isChanged = maxDrafts > 0; + if (savedDrafts.length > 0) { + isChanged = isChanged && !this.isSame(newDraft, savedDrafts[0]); + } + if (isChanged && !this.isDraftEmpty(newDraft)) { + savedDrafts.unshift(newDraft); + while (savedDrafts.length > maxDrafts) { + savedDrafts.pop(); + } + this.writeDrafts(savedDrafts); + this.snackbar.open('Draft Saved', undefined, { + panelClass: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.SNACKBAR_INFO, + duration: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.SNACKBAR_DURATION + }); + this.autosavedDraftsChanged$.next(); + } + }, interval * 1000); + } + isDraftEmpty(draft) { + const configAndDST = draft.configAndDST ?? { + dst: '[]' + }; + return draft.title === _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_TITLE && draft.description === _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_DESCRIPTION && JSON.parse(configAndDST.dst).length === 0; + } + isSame(a, b) { + return a.title === b.title && a.description === b.description && JSON.stringify(a.configAndDST) === JSON.stringify(b.configAndDST); + } + writeDrafts(drafts) { + this.storageService.set(DRAFTS_TAG, drafts); + } + readDrafts() { + return this.storageService.get(DRAFTS_TAG) ?? []; + } + createDraft() { + const dst = JSON.stringify(this.rendererService.getStory(), null, 2); + const configAndDST = this.exportService.createConfigAndDST(dst); + const date = new Date().toString().slice(0, 25); + return { + title: this.titleService.getTitle(), + description: this.titleService.getDescription(), + configAndDST, + date + }; + } + sortDrafts(drafts) { + drafts.sort((a, b) => { + const aDate = Date.parse(a.date); + const bDate = Date.parse(b.date); + return aDate > bDate ? 0 : 1; + }); + } + static #_ = this.ɵfac = function AutosaveService_Factory(t) { + return new (t || AutosaveService)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_autosave_configuration_service__WEBPACK_IMPORTED_MODULE_2__.AutosaveConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_export_services_export_service__WEBPACK_IMPORTED_MODULE_3__.ExportService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_4__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_modeler_services_renderer_service__WEBPACK_IMPORTED_MODULE_5__.RendererService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__.MatSnackBar), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_domain_services_storage_service__WEBPACK_IMPORTED_MODULE_6__.StorageService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_title_services_title_service__WEBPACK_IMPORTED_MODULE_7__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_8__.IconSetConfigurationService)); }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineInjectable"]({ + token: AutosaveService, + factory: AutosaveService.ɵfac, + providedIn: 'root' + }); } - this._modeling.updateLabel(element, newLabel, newBounds); -}; + return AutosaveService; +})(); /***/ }), -/***/ 84745: -/*!*********************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/labeling/dsLabelUtil.js ***! - \*********************************************************/ +/***/ 55701: +/*!****************************************************************!*\ + !*** ./src/app/tools/export/domain/dialog/exportDialogData.ts ***! + \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ autocomplete: () => (/* binding */ autocomplete), -/* harmony export */ calculateTextWidth: () => (/* binding */ calculateTextWidth), -/* harmony export */ getLabel: () => (/* binding */ getLabel), -/* harmony export */ getNumber: () => (/* binding */ getNumber), -/* harmony export */ selectPartOfActivity: () => (/* binding */ selectPartOfActivity), -/* harmony export */ setLabel: () => (/* binding */ setLabel), -/* harmony export */ setNumber: () => (/* binding */ setNumber) +/* harmony export */ ExportDialogData: () => (/* binding */ ExportDialogData), +/* harmony export */ ExportOption: () => (/* binding */ ExportOption) /* harmony export */ }); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util */ 36997); - - - - -function getLabelAttr(semantic) { - if (semantic.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR) || semantic.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT) || semantic.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY) || semantic.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.GROUP)) { - return "name"; - } - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.TEXTANNOTATION)) { - return "text"; +class ExportDialogData { + constructor(title, options) { + this.title = title; + this.options = options; } } -function getNumberAttr(semantic) { - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY)) { - return "number"; +class ExportOption { + constructor(text, tooltip, fn) { + this.text = text; + this.tooltip = tooltip; + this.fn = fn; } } -function getLabel(element) { - let semantic; - if (element.businessObject) { - semantic = element.businessObject; - } else { - semantic = element; - } - let attr = getLabelAttr(semantic); - if (attr && semantic) { - return semantic[attr] || ""; - } -} -function getNumber(element) { - let semantic = element.businessObject, - attr = getNumberAttr(semantic); - if (attr) { - return semantic[attr] || ""; - } -} -function setLabel(element, text) { - let semantic; - if (element.businessObject) { - semantic = element.businessObject; - } else { - semantic = element; - } - let attr = getLabelAttr(semantic); - if (attr) { - semantic[attr] = text; - } - return element; -} -function setNumber(element, textNumber) { - let semantic = element.businessObject, - attr = getNumberAttr(semantic); - if (attr) { - semantic[attr] = textNumber; - } - return element; -} -// select at which part of the activity the label should be attached to -function selectPartOfActivity(waypoints, angleActivity) { - let selectedActivity = 0; - let linelength = 49; - for (let i = 0; i < waypoints.length; i++) { - if (angleActivity[i] === 0 || angleActivity[i] === 180) { - let length = Math.abs(waypoints[i].x - waypoints[i + 1].x); - if (length > linelength) { - selectedActivity = i; - } - } - } - return selectedActivity; -} -// approximate the width of the label text, standard fontsize: 11 -function calculateTextWidth(text) { - if (!text) { - return 0; - } - let fontsize = text.length * 5.1; - fontsize = fontsize / 2; - // add an initial offset to the absolute middle of the activity - fontsize += 20; - return fontsize; -} -/** - * copied from https://www.w3schools.com/howto/howto_js_autocomplete.asp on 18.09.2018 - */ -function autocomplete(input, workObjectNames, element, eventBus) { - closeAllLists(); - /* the autocomplete function takes three arguments, - the text field element and an array of possible autocompleted values and an optional element to which it is appended:*/ - let currentFocus, filteredWorkObjectNames; - /* execute a function when someone writes in the text field:*/ - input.addEventListener("input", function () { - if (workObjectNames.length === 0) { - return; - } - /* the direct editing field of actors and workobjects is a recycled html-element and has old values that need to be overridden*/ - if (element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT)) { - this.value = this.innerHTML; - } - let autocompleteList, - autocompleteItem, - val = this.value; - /* close any already open lists of autocompleted values*/ - closeAllLists(); - currentFocus = -1; - /* create a DIV element that will contain the items (values):*/ - autocompleteList = document.createElement("DIV"); - autocompleteList.setAttribute("id", "autocomplete-list"); - autocompleteList.setAttribute("class", "autocomplete-items"); - /* append the DIV element as a child of the autocomplete container:*/ - this.parentNode.appendChild(autocompleteList); - /* for each item in the array...*/ - filteredWorkObjectNames = []; - for (const name of workObjectNames) { - /* check if the item starts with the same letters as the text field value:*/ - if (val) { - if (name.substring(0, val.length).toUpperCase() === val.toUpperCase()) { - /* create a DIV element for each matching element:*/ - autocompleteItem = document.createElement("DIV"); - /* make the matching letters bold:*/ - autocompleteItem.innerHTML = "" + name.substring(0, val.length) + "" + name.substring(val.length); - /* insert an input field that will hold the current name:*/ - autocompleteItem.innerHTML += ""; - autocompleteList.appendChild(autocompleteItem); - filteredWorkObjectNames.push(name); - } - } - } - // if we edit an actor, we do not want auto-complete, since actors generally are unique - if (element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR)) { - autocompleteList.style.visibility = "hidden"; - } - }); - /* execute a function presses a key on the keyboard:*/ - input.onkeydown = function (e) { - let autocompleteList = document.getElementById("autocomplete-list"); - if (autocompleteList) { - autocompleteList = autocompleteList.getElementsByTagName("div"); - } - if (e.keyCode === 40) { - /* If the arrow DOWN key is pressed, - increase the currentFocus letiable:*/ - currentFocus++; - /* and and make the current item more visible:*/ - addActive(autocompleteList); - } else if (e.keyCode === 38) { - // up - /* If the arrow UP key is pressed, - decrease the currentFocus letiable:*/ - currentFocus--; - /* and and make the current item more visible:*/ - addActive(autocompleteList); - } else if (e.keyCode === 13) { - e.preventDefault(); - /* If the ENTER key is pressed, prevent the form from being submitted,*/ - if (currentFocus > -1) { - element.businessObject.name = filteredWorkObjectNames[currentFocus]; - eventBus.fire("element.changed", { - element - }); - } - } - }; - function addActive(autocompleteList) { - /* a function to classify an item as "active":*/ - if (!autocompleteList || autocompleteList.length < 1) return false; - /* start by removing the "active" class on all items:*/ - removeActive(autocompleteList); - if (currentFocus >= autocompleteList.length) currentFocus = 0; - if (currentFocus < 0) currentFocus = autocompleteList.length - 1; - /* add class "autocomplete-active":*/ - autocompleteList[currentFocus].classList.add("autocomplete-active"); - } - function removeActive(autocompleteList) { - /* a function to remove the "active" class from all autocomplete items:*/ - if (autocompleteList.length > 1) { - for (const item of autocompleteList) { - item.classList.remove("autocomplete-active"); - } - } - } - function closeAllLists(survivor) { - /* close all autocomplete lists in the document, - except the one passed as an argument:*/ - let autocompleteList = document.getElementsByClassName("autocomplete-items"); - for (const item of autocompleteList) { - if (survivor != item && survivor != input) { - item.parentNode.removeChild(item); - } - } - } - /* execute a function when someone clicks in the document:*/ - document.addEventListener("click", function (e) { - closeAllLists(e.target); - }); -} /***/ }), -/***/ 9148: -/*!***************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/labeling/index.js ***! - \***************************************************/ +/***/ 23959: +/*!************************************************************!*\ + !*** ./src/app/tools/export/domain/export/configAndDst.ts ***! + \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ ConfigAndDST: () => (/* binding */ ConfigAndDST), +/* harmony export */ testConfigAndDst: () => (/* binding */ testConfigAndDst) /* harmony export */ }); -/* harmony import */ var diagram_js_lib_features_change_support__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! diagram-js/lib/features/change-support */ 99567); -/* harmony import */ var diagram_js_lib_features_resize__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! diagram-js/lib/features/resize */ 33485); -/* harmony import */ var diagram_js_direct_editing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js-direct-editing */ 95153); -/* harmony import */ var diagram_js_lib_command_CommandStack__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! diagram-js/lib/command/CommandStack */ 22205); -/* harmony import */ var _updateHandler_updateLabelHandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../updateHandler/updateLabelHandler */ 79182); -/* harmony import */ var _dsLabelEditingPreview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dsLabelEditingPreview */ 15537); -/* harmony import */ var _dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dsLabelEditingProvider */ 50572); -/* harmony import */ var _modeling_dSModeling__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../modeling/dSModeling */ 38875); - - - - - - - +class ConfigAndDST { + constructor(domain, dst) { + this.domain = domain; + this.dst = dst; + } +} +const testConfigAndDst = { + domain: JSON.parse('{"name":"",' + '"actors":{"Person":"' + '' + '",' + '"Group":"' + '' + '",' + '"System":"' + '"},' + '"workObjects":{"Document":"' + '",' + '"Folder":"' + '' + '",' + '"Call":"' + '",' + '"Email":"' + '",' + '"Conversation":"' + '",' + '"Info":"' + '' + '"}}'), + dst: '[' + '{"type":"domainStory:workObjectDocument","name":"","id":"shape_3792","$type":"Element","di":{},"$descriptor":{},"pickedColor":"black","x":302,"y":102},' + '{"type":"domainStory:actorPerson","name":"","id":"shape_4666","$type":"Element","di":{},"$descriptor":{},"pickedColor":"black","x":103,"y":93},' + '{"type":"domainStory:activity","name":"","id":"connection_4884","$type":"Element","di":{},"$descriptor":{},"pickedColor":"black","number":1,' + '"waypoints":[{"original":{"x":141,"y":131},"x":186,"y":133},{"original":{"x":340,"y":140},"x":302,"y":138}],' + '"source":"shape_4666","target":"shape_3792"}]' +}; +/***/ }), +/***/ 41646: +/*!***************************************************************!*\ + !*** ./src/app/tools/export/domain/export/exportConstants.ts ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - __depends__: [diagram_js_lib_features_change_support__WEBPACK_IMPORTED_MODULE_5__["default"], diagram_js_lib_features_resize__WEBPACK_IMPORTED_MODULE_6__["default"], diagram_js_direct_editing__WEBPACK_IMPORTED_MODULE_0__["default"]], - __init__: ["dSlabelEditingProvider", "dSlabelEditingPreview"], - dSlabelEditingProvider: ["type", _dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_3__["default"]], - dSlabelEditingPreview: ["type", _dsLabelEditingPreview__WEBPACK_IMPORTED_MODULE_2__["default"]], - updateLabelHandler: ["type", _updateHandler_updateLabelHandler__WEBPACK_IMPORTED_MODULE_1__["default"]], - commandStack: ["type", diagram_js_lib_command_CommandStack__WEBPACK_IMPORTED_MODULE_7__["default"]], - modeling: ["type ", _modeling_dSModeling__WEBPACK_IMPORTED_MODULE_4__["default"]] -}); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DEFAULT_PADDING: () => (/* binding */ DEFAULT_PADDING), +/* harmony export */ SVG_LINK: () => (/* binding */ SVG_LINK), +/* harmony export */ TEXTSPAN_DESCRIPTION_HEIGHT: () => (/* binding */ TEXTSPAN_DESCRIPTION_HEIGHT), +/* harmony export */ TEXTSPAN_TITLE_HEIGHT: () => (/* binding */ TEXTSPAN_TITLE_HEIGHT), +/* harmony export */ X_OFFSET_UTIL: () => (/* binding */ X_OFFSET_UTIL) +/* harmony export */ }); +const SVG_LINK = 'http://www.w3.org/2000/svg'; +const X_OFFSET_UTIL = '8'; +const TEXTSPAN_TITLE_HEIGHT = 30; +const TEXTSPAN_DESCRIPTION_HEIGHT = 15; +const DEFAULT_PADDING = 15; /***/ }), -/***/ 49417: -/*!******************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/labeling/position.js ***! - \******************************************************/ +/***/ 2200: +/*!************************************************************************************!*\ + !*** ./src/app/tools/export/presentation/export-dialog/export-dialog.component.ts ***! + \************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ countLines: () => (/* binding */ countLines), -/* harmony export */ labelPosition: () => (/* binding */ labelPosition), -/* harmony export */ labelPositionX: () => (/* binding */ labelPositionX), -/* harmony export */ labelPositionY: () => (/* binding */ labelPositionY) +/* harmony export */ ExportDialogComponent: () => (/* binding */ ExportDialogComponent) /* harmony export */ }); -/* harmony import */ var _dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dsLabelUtil */ 84745); -/* harmony import */ var _Utils_mathExtensions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/mathExtensions */ 114); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +/* harmony import */ var rxjs_internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/internal/BehaviorSubject */ 95981); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/button */ 72221); +/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ 56610); +/* harmony import */ var src_app_tools_export_domain_dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/tools/export/domain/dialog/exportDialogData */ 55701); -function countLines(str) { - return str.split(/\r\n|\r|\n/).length; -} -// determine the position of the label at the activity -function labelPosition(waypoints, lines = 1) { - let amountWaypoints = waypoints.length; - let determinedPosition; - let xPos; - let yPos; - if (amountWaypoints > 2) { - let angleActivity = new Array(amountWaypoints - 1); - for (let i = 0; i < amountWaypoints - 1; i++) { - // calculate the angles of the activities - angleActivity[i] = (0,_Utils_mathExtensions__WEBPACK_IMPORTED_MODULE_1__.angleBetween)(waypoints[i], waypoints[i + 1]); - } - let selectedActivity = (0,_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.selectPartOfActivity)(waypoints, angleActivity); - xPos = labelPositionX(waypoints[selectedActivity], waypoints[selectedActivity + 1]); - yPos = labelPositionY(waypoints[selectedActivity], waypoints[selectedActivity + 1], lines); - determinedPosition = { - x: xPos, - y: yPos, - selected: selectedActivity - }; - return determinedPosition; - } else { - xPos = labelPositionX(waypoints[0], waypoints[1]); - yPos = labelPositionY(waypoints[0], waypoints[1], lines); - determinedPosition = { - x: xPos, - y: yPos, - selected: 0 - }; - return determinedPosition; - } -} -// calculate the X position of the label -function labelPositionX(startPoint, endPoint) { - let angle = (0,_Utils_mathExtensions__WEBPACK_IMPORTED_MODULE_1__.angleBetween)(startPoint, endPoint); - let offsetX = 0; - let scaledAngle = 0; - if (angle === 0 || angle === 180 || angle === 90 || angle === 270) { - offsetX = 0; - } else if (angle > 0 && angle < 90) { - // endpoint in upper right quadrant - offsetX = 5 - angle / 6; - } else if (angle > 90 && angle < 180) { - // endpoint in upper left quadrant - scaledAngle = angle - 90; - offsetX = 5 - scaledAngle / 18; - } else if (angle > 180 && angle < 270) { - // endpoint in lower left quadrant - scaledAngle = angle - 180; - offsetX = scaledAngle / 18; - } else if (angle > 270) { - // endpoint in lower right quadrant - scaledAngle = angle - 270; - offsetX = 5 - scaledAngle / 6; - } - return offsetX + (startPoint.x + endPoint.x) / 2; -} -// calculate the Y position of the label -function labelPositionY(startPoint, endPoint, lines = 1) { - let angle = (0,_Utils_mathExtensions__WEBPACK_IMPORTED_MODULE_1__.angleBetween)(startPoint, endPoint); - let offsetY = 0; - let scaledAngle = 0; - if (angle === 0 || angle === 180) { - offsetY = 15; - } else if (angle === 90 || angle === 270) { - offsetY = 0; - } else if (angle > 0 && angle < 90) { - // endpoint in upper right quadrant - offsetY = 15 - angle / 6; - } else if (angle > 90 && angle < 180) { - // endpoint in upper left quadrant - scaledAngle = angle - 90; - offsetY = -scaledAngle / 9 * lines; - } else if (angle > 180 && angle < 270) { - // endpoint in lower left quadrant - scaledAngle = angle - 180; - offsetY = 15 - scaledAngle / 3; - } else if (angle > 270) { - // endpoint in lower right quadrant - scaledAngle = angle - 270; - offsetY = -scaledAngle / 9 * lines; - } - return offsetY + (startPoint.y + endPoint.y) / 2; -} - -/***/ }), - -/***/ 38875: -/*!********************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/modeling/dSModeling.js ***! - \********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ DSModeling) -/* harmony export */ }); -/* harmony import */ var bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bpmn-js/lib/features/modeling/Modeling */ 89113); -/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! util */ 1525); -/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_0__); - -function DSModeling(eventBus, elementFactory, commandStack, domainStoryRules) { - bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__["default"].call(this, eventBus, elementFactory, commandStack, domainStoryRules); +function ExportDialogComponent_For_18_Template(rf, ctx) { + if (rf & 1) { + const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "button", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function ExportDialogComponent_For_18_Template_button_click_0_listener() { + const i_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r1).$index; + const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r2.doOption(i_r2)); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + } + if (rf & 2) { + const option_r4 = ctx.$implicit; + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("title", option_r4.tooltip); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate1"](" ", option_r4.text, " "); + } } -bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.updateLabel = function (element, newLabel, newBounds) { - if (element.businessObject ? newLabel !== element.businessObject.name : newLabel !== element.name) { - if (/^domainStory:/.test(element.type)) { - this._commandStack.execute("element.updateCustomLabel", { - element: element, - newLabel: newLabel, - newBounds: newBounds - }); - } else { - this._commandStack.execute("element.updateLabel", { - element: element, - newLabel: newLabel, - newBounds: newBounds - }); +let ExportDialogComponent = /*#__PURE__*/(() => { + class ExportDialogComponent { + constructor(dialogRef, data) { + this.dialogRef = dialogRef; + this.withTitle = new rxjs_internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_2__.BehaviorSubject(true); + this.useWhiteBackground = new rxjs_internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_2__.BehaviorSubject(true); + this.title = data.title; + this.options = data.options; } - } -}; -bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.updateNumber = function (element, newNumber, newBounds) { - if (element.businessObject ? newNumber !== element.businessObject.number : newNumber !== element.number) { - if (/^domainStory:/.test(element.type)) { - this._commandStack.execute("element.updateCustomLabel", { - element: element, - newNumber: newNumber, - newBounds: newBounds - }); - } else { - this._commandStack.execute("element.updateLabel", { - element: element, - newNumber: newNumber, - newBounds: newBounds - }); + ngOnInit() {} + doOption(i) { + this.options[i].fn(this.withTitle.value, this.useWhiteBackground.value); + this.close(); + } + close() { + this.dialogRef.close(); } + updateWithTitle($event) { + // @ts-ignore + this.withTitle.next($event.target.checked); + } + updateUseWhiteBackground($event) { + // @ts-ignore + this.useWhiteBackground.next($event.target.checked); + } + static #_ = this.ɵfac = function ExportDialogComponent_Factory(t) { + return new (t || ExportDialogComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MatDialogRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MAT_DIALOG_DATA)); + }; + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ + type: ExportDialogComponent, + selectors: [["app-export-dialog"]], + decls: 19, + vars: 7, + consts: [["type", "checkbox", 3, "change", "checked"], ["mat-flat-button", "", 3, "click"], ["mat-stroked-button", "", 1, "mr-1", 3, "title"], ["mat-stroked-button", "", 1, "mr-1", 3, "click", "title"]], + template: function ExportDialogComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "mat-dialog-content")(1, "h2"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](3, "label")(4, "input", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](5, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("change", function ExportDialogComponent_Template_input_change_4_listener($event) { + return ctx.updateWithTitle($event); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](6, " Add title and description to image "); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](7, "br"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](8, "label")(9, "input", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](10, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("change", function ExportDialogComponent_Template_input_change_9_listener($event) { + return ctx.updateUseWhiteBackground($event); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](11, " Add white background to SVG (default: transparent) "); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](12, "mat-dialog-actions"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](13, "br"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](14, "div")(15, "button", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function ExportDialogComponent_Template_button_click_15_listener() { + return ctx.close(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](16, "Cancel"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrepeaterCreate"](17, ExportDialogComponent_For_18_Template, 2, 2, "button", 2, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrepeaterTrackByIdentity"]); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate"](ctx.title); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("checked", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](5, 3, ctx.withTitle)); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](5); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("checked", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](10, 5, ctx.useWhiteBackground)); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](8); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrepeater"](ctx.options); + } + }, + dependencies: [_angular_material_button__WEBPACK_IMPORTED_MODULE_4__.MatButton, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MatDialogActions, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MatDialogContent, _angular_common__WEBPACK_IMPORTED_MODULE_5__.AsyncPipe] + }); } -}; -bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.replaceShape = function (oldShape, newShape, hints) { - let context = { - oldShape: oldShape, - newData: newShape, - hints: hints || {} - }; - this._commandStack.execute("shape.replace", context); - return context.newShape; -}; -bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.removeGroup = function (element) { - this._commandStack.execute("shape.removeGroupWithoutChildren", { - element: element - }); - this.removeElements({ - element - }); -}; -(0,util__WEBPACK_IMPORTED_MODULE_0__.inherits)(DSModeling, bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__["default"]); -DSModeling.$inject = ["eventBus", "elementFactory", "commandStack", "domainStoryRules"]; + return ExportDialogComponent; +})(); /***/ }), -/***/ 63493: -/*!***************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/modeling/index.js ***! - \***************************************************/ +/***/ 39595: +/*!*********************************************************!*\ + !*** ./src/app/tools/export/services/export.service.ts ***! + \*********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ ExportService: () => (/* binding */ ExportService) /* harmony export */ }); -/* harmony import */ var _palette_domainStoryPalette__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../palette/domainStoryPalette */ 84277); -/* harmony import */ var bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! bpmn-js/lib/features/modeling/ElementFactory */ 63784); -/* harmony import */ var diagram_js_lib_features_create__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! diagram-js/lib/features/create */ 31073); -/* harmony import */ var bpmn_js_lib_draw_PathMap__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! bpmn-js/lib/draw/PathMap */ 66652); -/* harmony import */ var bpmn_js_lib_features_popup_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! bpmn-js/lib/features/popup-menu */ 77029); -/* harmony import */ var diagram_js_lib_features_context_pad__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! diagram-js/lib/features/context-pad */ 64712); -/* harmony import */ var diagram_js_lib_command_CommandStack__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! diagram-js/lib/command/CommandStack */ 22205); -/* harmony import */ var _updateHandler_updateLabelHandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../updateHandler/updateLabelHandler */ 79182); -/* harmony import */ var _domainStoryUpdater__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../domainStoryUpdater */ 37747); -/* harmony import */ var _domainStoryElementFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../domainStoryElementFactory */ 86258); -/* harmony import */ var _updateHandler_headlineAndDescriptionUpdateHandler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../updateHandler/headlineAndDescriptionUpdateHandler */ 65501); -/* harmony import */ var _domainStoryRenderer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../domainStoryRenderer */ 37751); -/* harmony import */ var _dSModeling__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dSModeling */ 38875); -/* harmony import */ var _domainStoryRules__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../domainStoryRules */ 71185); -/* harmony import */ var _change_icon_replaceMenuProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../change-icon/replaceMenuProvider */ 96554); -/* harmony import */ var _context_pad_domainStoryContextPadProvider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../context-pad/domainStoryContextPadProvider */ 74669); - +/* harmony import */ var src_app_utils_sanitizer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/utils/sanitizer */ 43515); +/* harmony import */ var src_app_tools_export_domain_export_configAndDst__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/tools/export/domain/export/configAndDst */ 23959); +/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @angular/common */ 56610); +/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../environments/environment */ 45312); +/* harmony import */ var _domain_dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../domain/dialog/exportDialogData */ 55701); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +/* harmony import */ var _presentation_export_dialog_export_dialog_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../presentation/export-dialog/export-dialog.component */ 2200); +/* harmony import */ var _domain_entities_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../domain/entities/constants */ 40550); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_tools_icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/tools/icon-set-config/services/icon-set-configuration.service */ 46527); +/* harmony import */ var src_app_tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/tools/title/services/title.service */ 41535); +/* harmony import */ var src_app_domain_services_dirty_flag_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/domain/services/dirty-flag.service */ 94658); +/* harmony import */ var src_app_tools_export_services_png_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/tools/export/services/png.service */ 82972); +/* harmony import */ var src_app_tools_export_services_svg_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! src/app/tools/export/services/svg.service */ 56837); +/* harmony import */ var _html_presentation_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./html-presentation.service */ 87047); +/* harmony import */ var _modeler_services_renderer_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../modeler/services/renderer.service */ 63812); +/* harmony import */ var _modeler_services_modeler_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../modeler/services/modeler.service */ 40439); +/* harmony import */ var _domain_services_dialog_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../domain/services/dialog.service */ 12855); +/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); @@ -66454,1246 +65535,804 @@ __webpack_require__.r(__webpack_exports__); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - __depends__: [diagram_js_lib_features_create__WEBPACK_IMPORTED_MODULE_10__["default"], diagram_js_lib_features_context_pad__WEBPACK_IMPORTED_MODULE_11__["default"], bpmn_js_lib_features_popup_menu__WEBPACK_IMPORTED_MODULE_12__["default"]], - __init__: ["domainStoryRenderer", "paletteProvider", "domainStoryRules", "domainStoryUpdater", "contextPadProvider", "replaceMenuProvider"], - elementFactory: ["type", _domainStoryElementFactory__WEBPACK_IMPORTED_MODULE_3__["default"]], - domainStoryRenderer: ["type", _domainStoryRenderer__WEBPACK_IMPORTED_MODULE_5__["default"]], - paletteProvider: ["type", _palette_domainStoryPalette__WEBPACK_IMPORTED_MODULE_0__["default"]], - domainStoryRules: ["type", _domainStoryRules__WEBPACK_IMPORTED_MODULE_7__["default"]], - domainStoryUpdater: ["type", _domainStoryUpdater__WEBPACK_IMPORTED_MODULE_2__["default"]], - contextPadProvider: ["type", _context_pad_domainStoryContextPadProvider__WEBPACK_IMPORTED_MODULE_9__["default"]], - elementFactoryBpmn: ["type", bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_13__["default"]], - pathMap: ["type", bpmn_js_lib_draw_PathMap__WEBPACK_IMPORTED_MODULE_14__["default"]], - replaceMenuProvider: ["type", _change_icon_replaceMenuProvider__WEBPACK_IMPORTED_MODULE_8__["default"]], - commandStack: ["type", diagram_js_lib_command_CommandStack__WEBPACK_IMPORTED_MODULE_15__["default"]], - updateLabelHandler: ["type", _updateHandler_updateLabelHandler__WEBPACK_IMPORTED_MODULE_1__["default"]], - headlineAndDescriptionUpdateHandler: ["type", _updateHandler_headlineAndDescriptionUpdateHandler__WEBPACK_IMPORTED_MODULE_4__["default"]], - modeling: ["type", _dSModeling__WEBPACK_IMPORTED_MODULE_6__["default"]] -}); -/***/ }), -/***/ 37126: -/*!********************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/numbering/numbering.js ***! - \********************************************************/ +let ExportService = /*#__PURE__*/(() => { + class ExportService { + constructor(configurationService, titleService, dirtyFlagService, pngService, svgService, htmlPresentationService, rendererService, modelerService, dialogService, snackbar) { + this.configurationService = configurationService; + this.titleService = titleService; + this.dirtyFlagService = dirtyFlagService; + this.pngService = pngService; + this.svgService = svgService; + this.htmlPresentationService = htmlPresentationService; + this.rendererService = rendererService; + this.modelerService = modelerService; + this.dialogService = dialogService; + this.snackbar = snackbar; + this.title = ''; + this.description = ''; + this.titleSubscription = this.titleService.title$.subscribe(title => { + this.title = title; + }); + this.descriptionSubscription = this.titleService.description$.subscribe(description => { + this.description = description; + }); + } + ngOnDestroy() { + this.titleSubscription.unsubscribe(); + this.descriptionSubscription.unsubscribe(); + } + isDomainStoryExportable() { + return this.rendererService.getStory().length >= 1; + } + createConfigAndDST(DomainStory) { + return new src_app_tools_export_domain_export_configAndDst__WEBPACK_IMPORTED_MODULE_1__.ConfigAndDST(this.configurationService.getCurrentConfigurationForExport(), DomainStory); + } + downloadDST() { + const dst = this.getStoryForDownload(); + const configAndDST = this.createConfigAndDST(dst); + const json = JSON.stringify(configAndDST, null, 2); + const filename = (0,src_app_utils_sanitizer__WEBPACK_IMPORTED_MODULE_0__.sanitizeForDesktop)(this.title + '_' + this.getCurrentDateString()); + this.downloadFile(json, 'data:text/plain;charset=utf-8,', filename, '.egn', true); + } + downloadFile(data, datatype, filename, fileEnding, makeClean) { + const element = document.createElement('a'); + element.setAttribute('href', datatype + encodeURIComponent(data)); + element.setAttribute('download', filename + fileEnding); + element.style.display = 'none'; + document.body.appendChild(element); + element.click(); + if (makeClean) { + this.dirtyFlagService.makeClean(); + } + document.body.removeChild(element); + } + downloadSVG(withTitle, useWhiteBackground) { + const story = this.getStoryForDownload(); + const dst = this.createConfigAndDST(story); + const svgData = this.svgService.createSVGData(this.title, this.description, dst, withTitle, useWhiteBackground); + this.downloadFile(svgData, 'data:application/bpmn20-xml;charset=UTF-8,', (0,src_app_utils_sanitizer__WEBPACK_IMPORTED_MODULE_0__.sanitizeForDesktop)(this.title + '_' + this.getCurrentDateString()), '.egn.svg', true); + } + downloadPNG(withTitle) { + const canvas = document.getElementById('canvas'); + if (canvas) { + const container = canvas.getElementsByClassName('djs-container'); + const svgElements = container[0].getElementsByTagName('svg'); + const outerSVGElement = svgElements[0]; + const viewport = outerSVGElement.getElementsByClassName('viewport')[0]; + const layerBase = viewport.getElementsByClassName('layer-base')[0]; + const image = document.createElement('img'); + // removes unwanted black dots in image + let svg = this.pngService.extractSVG(viewport, outerSVGElement); + svg = this.pngService.prepareSVG(svg, layerBase, this.description, this.title, withTitle); + image.onload = () => { + const tempCanvas = document.createElement('canvas'); + // add a 10px buffer to the right and lower boundary + tempCanvas.width = this.pngService.getWidth() + 10; + tempCanvas.height = this.pngService.getHeight() + 10; + const ctx = tempCanvas.getContext('2d'); + if (ctx) { + // fill with white background + ctx.rect(0, 0, tempCanvas.width, tempCanvas.height); + ctx.fillStyle = 'white'; + ctx.fill(); + ctx.drawImage(image, 0, 0); + } + const png64 = tempCanvas.toDataURL('image/png'); + const ele = document.createElement('a'); + ele.setAttribute('download', (0,src_app_utils_sanitizer__WEBPACK_IMPORTED_MODULE_0__.sanitizeForDesktop)(this.title) + '_' + this.getCurrentDateString() + '.png'); + ele.setAttribute('href', png64); + document.body.appendChild(ele); + ele.click(); + document.body.removeChild(ele); + // image source has to be removed to circumvent browser caching + image.src = ''; + }; + image.onchange = image.onload; + image.width = this.pngService.getWidth(); + image.height = this.pngService.getHeight(); + image.src = 'data:image/svg+xml,' + svg; + } + } + downloadHTMLPresentation(modeler) { + const filename = (0,src_app_utils_sanitizer__WEBPACK_IMPORTED_MODULE_0__.sanitizeForDesktop)(this.title + '_' + this.getCurrentDateString()); + this.htmlPresentationService.downloadHTMLPresentation(filename, modeler).then(); + } + getStoryForDownload() { + const story = this.rendererService.getStory(); + story.push({ + info: this.titleService.getDescription() + }); + story.push({ + version: _environments_environment__WEBPACK_IMPORTED_MODULE_2__.environment.version + }); + return story; + } + getCurrentDateString() { + return (0,_angular_common__WEBPACK_IMPORTED_MODULE_15__.formatDate)(new Date(), 'YYYY-MM-dd', 'en-GB'); + } + openDownloadDialog() { + if (this.isDomainStoryExportable()) { + const SVGDownloadOption = new _domain_dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_3__.ExportOption('SVG', 'Download an SVG-Image with the Domain-Story embedded. Can be used to save and share your Domain-Story.', (withTitle, useWhiteBackground) => this.downloadSVG(withTitle, useWhiteBackground)); + const EGNDownloadOption = new _domain_dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_3__.ExportOption('EGN', 'Download an EGN-File with the Domain-Story. Can be used to save and share your Domain-Story.', () => this.downloadDST()); + const PNGDownloadOption = new _domain_dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_3__.ExportOption('PNG', 'Download a PNG-Image of the Domain-Story. This does not include the Domain-Story!', withTitle => this.downloadPNG(withTitle)); + const HTMLDownloadOption = new _domain_dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_3__.ExportOption('HTML-Presentation', 'Download an HTML-Presentation. This does not include the Domain-Story!', () => this.downloadHTMLPresentation(this.modelerService.getModeler())); + const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_16__.MatDialogConfig(); + config.disableClose = false; + config.autoFocus = true; + config.data = new _domain_dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_3__.ExportDialogData('Export', [SVGDownloadOption, EGNDownloadOption, PNGDownloadOption, HTMLDownloadOption]); + this.dialogService.openDialog(_presentation_export_dialog_export_dialog_component__WEBPACK_IMPORTED_MODULE_4__.ExportDialogComponent, config); + } else { + this.snackbar.open('No Domain Story to be exported', undefined, { + duration: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_5__.SNACKBAR_DURATION, + panelClass: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_5__.SNACKBAR_INFO + }); + } + } + static #_ = this.ɵfac = function ExportService_Factory(t) { + return new (t || ExportService)(_angular_core__WEBPACK_IMPORTED_MODULE_17__["ɵɵinject"](src_app_tools_icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_6__.IconSetConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_17__["ɵɵinject"](src_app_tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_7__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_17__["ɵɵinject"](src_app_domain_services_dirty_flag_service__WEBPACK_IMPORTED_MODULE_8__.DirtyFlagService), _angular_core__WEBPACK_IMPORTED_MODULE_17__["ɵɵinject"](src_app_tools_export_services_png_service__WEBPACK_IMPORTED_MODULE_9__.PngService), _angular_core__WEBPACK_IMPORTED_MODULE_17__["ɵɵinject"](src_app_tools_export_services_svg_service__WEBPACK_IMPORTED_MODULE_10__.SvgService), _angular_core__WEBPACK_IMPORTED_MODULE_17__["ɵɵinject"](_html_presentation_service__WEBPACK_IMPORTED_MODULE_11__.HtmlPresentationService), _angular_core__WEBPACK_IMPORTED_MODULE_17__["ɵɵinject"](_modeler_services_renderer_service__WEBPACK_IMPORTED_MODULE_12__.RendererService), _angular_core__WEBPACK_IMPORTED_MODULE_17__["ɵɵinject"](_modeler_services_modeler_service__WEBPACK_IMPORTED_MODULE_13__.ModelerService), _angular_core__WEBPACK_IMPORTED_MODULE_17__["ɵɵinject"](_domain_services_dialog_service__WEBPACK_IMPORTED_MODULE_14__.DialogService), _angular_core__WEBPACK_IMPORTED_MODULE_17__["ɵɵinject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_18__.MatSnackBar)); + }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_17__["ɵɵdefineInjectable"]({ + token: ExportService, + factory: ExportService.ɵfac, + providedIn: 'root' + }); + } + return ExportService; +})(); + +/***/ }), + +/***/ 99160: +/*!*****************************************************!*\ + !*** ./src/app/tools/export/services/exportUtil.js ***! + \*****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ addNumberToRegistry: () => (/* binding */ addNumberToRegistry), -/* harmony export */ generateAutomaticNumber: () => (/* binding */ generateAutomaticNumber), -/* harmony export */ getMultipleNumberRegistry: () => (/* binding */ getMultipleNumberRegistry), -/* harmony export */ getNumberRegistry: () => (/* binding */ getNumberRegistry), -/* harmony export */ getNumbersAndIDs: () => (/* binding */ getNumbersAndIDs), -/* harmony export */ initializeNumbering: () => (/* binding */ initializeNumbering), -/* harmony export */ numberBoxDefinitions: () => (/* binding */ numberBoxDefinitions), -/* harmony export */ setNumberIsMultiple: () => (/* binding */ setNumberIsMultiple), -/* harmony export */ updateExistingNumbersAtEditing: () => (/* binding */ updateExistingNumbersAtEditing), -/* harmony export */ updateExistingNumbersAtGeneration: () => (/* binding */ updateExistingNumbersAtGeneration), -/* harmony export */ updateMultipleNumberRegistry: () => (/* binding */ updateMultipleNumberRegistry) +/* harmony export */ createTitleAndDescriptionSVGElement: () => (/* binding */ createTitleAndDescriptionSVGElement) /* harmony export */ }); -/* harmony import */ var _Utils_mathExtensions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/mathExtensions */ 114); +/* harmony import */ var _domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../domain/export/exportConstants */ 41646); - - -let numberRegistry = []; -let multipleNumberRegistry = [false]; -let canvasElementRegistry; -function initializeNumbering(canvasElementRegistryService) { - canvasElementRegistry = canvasElementRegistryService; -} -function updateMultipleNumberRegistry(activityBusinessObjects) { - activityBusinessObjects.forEach(activity => multipleNumberRegistry[activity.number] = activity.multipleNumberAllowed); -} -// defines the box for activity numbers -function numberBoxDefinitions(element) { - let alignment = "center"; - let boxWidth = 30; - let boxHeight = 30; - let angle = 0; - if (element.waypoints.length > 1) { - angle = (0,_Utils_mathExtensions__WEBPACK_IMPORTED_MODULE_0__.angleBetween)( - // Start of first arrow segment - element.waypoints[0], - // End of first arrow segment - element.waypoints[1]); - } - let x = element.waypoints[0].x; - let y = element.waypoints[0].y; - let fixedOffsetX = 0; - let fixedOffsetY = 0; - let angleDependantOffsetX = 0; - let angleDependantOffsetY = 0; - // Fine tune positioning of sequence number above beginning of first arrow segment - if (angle >= 0 && angle <= 45) { - fixedOffsetX = 25; - angleDependantOffsetY = 20 * (1 - angle / 45); - } else if (angle <= 90) { - fixedOffsetX = 5; - angleDependantOffsetX = 15 * (1 - (angle - 45) / 45); - } else if (angle <= 135) { - fixedOffsetX = 5; - angleDependantOffsetX = -20 * ((angle - 90) / 45); - } else if (angle <= 180) { - fixedOffsetX = -15; - angleDependantOffsetY = 20 * ((angle - 135) / 45); - } else if (angle <= 225) { - fixedOffsetX = -15; - fixedOffsetY = 15; - angleDependantOffsetY = 25 * ((angle - 180) / 45); - } else if (angle <= 270) { - fixedOffsetX = 5; - angleDependantOffsetX = -20 * (1 - (angle - 225) / 45); - fixedOffsetY = 40; - } else if (angle <= 315) { - fixedOffsetX = 5; - angleDependantOffsetX = 25 * ((angle - 270) / 45); - fixedOffsetY = 40; - } else { - fixedOffsetX = 25; - fixedOffsetY = 20; - angleDependantOffsetY = 15 * (1 - (angle - 315) / 45); - } - x = x + fixedOffsetX + angleDependantOffsetX; - y = y + fixedOffsetY + angleDependantOffsetY; +let dynamicHeightOffset = 0; +// Has to be js File so we can access te correct non-standard HTML-Properties without excessive usage of ts-ignore +function createTitleAndDescriptionSVGElement(initDynamicHeightOffset, title, description, min_x, min_y, width) { + dynamicHeightOffset = initDynamicHeightOffset; + title = title.replace("<", "").replace(">", ""); + let titleElement = createTitle(title, width); + let descriptionElement = createDescription(description, width); + // to display the title and description in the SVG-file, we need to add a container for our text-elements + let insertText = '' + titleElement + descriptionElement + ""; return { - textAlign: alignment, - width: boxWidth, - height: boxHeight, - x: x, - y: y + insertText, + dynamicHeightOffset: dynamicHeightOffset }; } -// determine the next available number that is not yet used -function generateAutomaticNumber(elementActivity, commandStack) { - const semantic = elementActivity.businessObject; - const usedNumbers = [0]; - let wantedNumber = -1; - const activitiesFromActors = canvasElementRegistry.getActivitiesFromActors(); - activitiesFromActors.forEach(element => { - if (element.businessObject.number) { - usedNumbers.push(+element.businessObject.number); - } - }); - for (let i = 0; i < usedNumbers.length; i++) { - if (!usedNumbers.includes(i)) { - if (!usedNumbers.includes(i)) { - wantedNumber = i; - i = usedNumbers.length; - } - } - } - if (wantedNumber === -1) { - wantedNumber = usedNumbers.length; +function createTitle(text, width) { + let tempCanvas = document.createElement("canvas"); + let ctx = tempCanvas.getContext("2d"); + ctx.font = "30px Arial"; + return createTextSpans(text, width, ctx, 10, _domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_0__.TEXTSPAN_TITLE_HEIGHT, 30); +} +function createDescription(text, width) { + let description = ""; + let descriptionParts = text.split("
"); + let tempCanvas = document.createElement("canvas"); + let ctx = tempCanvas.getContext("2d"); + ctx.font = "12px Arial"; + for (let i = 0; i < descriptionParts.length; i++) { + description += createTextSpans(descriptionParts[i], width, ctx, 0, _domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_0__.TEXTSPAN_DESCRIPTION_HEIGHT, 12); } - updateExistingNumbersAtGeneration(activitiesFromActors, wantedNumber, commandStack); - semantic.number = wantedNumber; - return wantedNumber; + return description; } -// update the numbers at the activities when generating a new activity -function updateExistingNumbersAtGeneration(activitiesFromActors, wantedNumber, commandStack) { - activitiesFromActors.forEach(element => { - let number = +element.businessObject.number; - if (number >= wantedNumber) { - wantedNumber++; - setTimeout(function () { - commandStack.execute("activity.changed", { - businessObject: element.businessObject, - newLabel: element.businessObject.name, - newNumber: number, - element: element - }); - }, 10); - } - }); -} -// update the numbers at the activities when editing an activity -function updateExistingNumbersAtEditing(activitiesFromActors, wantedNumber, eventBus) { - // get a sorted list of all activities that could need changing - let sortedActivities = [[]]; - activitiesFromActors.forEach(activity => { - if (!sortedActivities[activity.businessObject.number]) { - sortedActivities[activity.businessObject.number] = []; - } - sortedActivities[activity.businessObject.number].push(activity); - }); - // set the number of each activity to the next highest number, starting from the number, we overrode - let oldMultipleNumberRegistry = [...multipleNumberRegistry]; - let currentNumber = wantedNumber; - for (currentNumber; currentNumber < sortedActivities.length; currentNumber++) { - if (sortedActivities[currentNumber]) { - wantedNumber++; - multipleNumberRegistry[wantedNumber] = oldMultipleNumberRegistry[currentNumber]; - setNumberOfActivity(sortedActivities[currentNumber], wantedNumber, eventBus); +function createTextSpans(text, width, ctx, yOffset, heightOffset, fontSize) { + let textSpans = ""; + let words = text.split(" "); + // every leading empty strings in the array must be removed, otherwise the text elements + // will not be filled with text + words = removeLeadingEmptyStrings(words); + let textTag = ''; + let textSpan = document.createElementNS(_domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_0__.SVG_LINK, "tspan"); + let textNode = document.createTextNode(words[0]); + textSpan.setAttribute("x", _domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_0__.X_OFFSET_UTIL); + textSpan.setAttribute("y", yOffset + dynamicHeightOffset); + textSpan.setAttribute("font-size", fontSize); + textSpan.appendChild(textNode); + for (let j = 1; j < words.length; j++) { + if (textSpan.firstChild && textSpan.firstChild.data) { + let len = textSpan.firstChild.data.length; + textNode.data += " " + words[j]; + if (ctx.measureText(textNode.data).width > width - 16) { + dynamicHeightOffset += heightOffset; + textSpan.firstChild.data = textSpan.firstChild.data.slice(0, len); // remove overflow word + textSpans += textTag + textSpan.outerHTML + ""; // append line + // create new textspan for line break + textSpan = document.createElementNS(_domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_0__.SVG_LINK, "tspan"); + textNode = document.createTextNode(words[j]); + textSpan.setAttribute("x", _domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_0__.X_OFFSET_UTIL); + textSpan.setAttribute("y", yOffset + dynamicHeightOffset); + textSpan.appendChild(textNode); + } } } + dynamicHeightOffset += heightOffset; + textSpans += textTag + textSpan.outerHTML + ""; + return textSpans; } -// get the IDs of activities with their associated number, only returns activities that are originating from an actor -function getNumbersAndIDs() { - let iDWithNumber = []; - let activities = canvasElementRegistry.getActivitiesFromActors(); - for (let i = activities.length - 1; i >= 0; i--) { - let id = activities[i].businessObject.id; - let number = activities[i].businessObject.number; - iDWithNumber.push({ - id: id, - number: number - }); - } - return iDWithNumber; -} -function addNumberToRegistry(renderedNumber, number) { - numberRegistry[number] = renderedNumber; -} -function setNumberIsMultiple(number, multi) { - multipleNumberRegistry[number] = multi; -} -/** - * @returns copy of registry - */ -function getNumberRegistry() { - return numberRegistry.slice(0); -} -function getMultipleNumberRegistry() { - return multipleNumberRegistry.slice(0); -} -function setNumberOfActivity(elementArray, wantedNumber, eventBus) { - if (elementArray) { - elementArray.forEach(element => { - if (element) { - let businessObject = element.businessObject; - if (businessObject) { - businessObject.number = wantedNumber; - } - eventBus.fire("element.changed", { - element - }); - } - }); - } +function removeLeadingEmptyStrings(stringArray) { + const firstNonEmptyIndex = stringArray.findIndex(string => string !== ""); + return stringArray.slice(firstNonEmptyIndex === -1 ? stringArray.length : firstNonEmptyIndex); } /***/ }), -/***/ 84277: -/*!***************************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/palette/domainStoryPalette.js ***! - \***************************************************************/ +/***/ 87047: +/*!********************************************************************!*\ + !*** ./src/app/tools/export/services/html-presentation.service.ts ***! + \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PaletteProvider), -/* harmony export */ initializePalette: () => (/* binding */ initializePalette) +/* harmony export */ HtmlPresentationService: () => (/* binding */ HtmlPresentationService) /* harmony export */ }); -/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! min-dash */ 93673); -/* harmony import */ var src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Icon-Set-Configuration/allIcons */ 57488); -/* harmony import */ var src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Domain/Common/dictionary/dictionary */ 54972); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../Domain/Common/constants */ 90816); +/* harmony import */ var _home_runner_work_egon_io_egon_io_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 73308); +/* harmony import */ var _utils_sanitizer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils/sanitizer */ 43515); +/* harmony import */ var dot__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! dot */ 45659); +/* harmony import */ var dot__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(dot__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _replay_services_replay_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../replay/services/replay.service */ 3687); +/* harmony import */ var _title_services_title_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../title/services/title.service */ 41535); +/* harmony import */ var _replay_services_story_creator_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../replay/services/story-creator.service */ 97720); +// @ts-ignore /** - * A palette that allows you to create BPMN _and_ custom elements. + * Initial idea and PR from https://github.com/indika-dev */ -let iconDictionary; -let configuration; -function initializePalette(iconDictionaryService, configurationService) { - iconDictionary = iconDictionaryService; - configuration = configurationService; -} -function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool) { - this._create = create; - this._elementFactory = elementFactory; - this._spaceTool = spaceTool; - this._lassoTool = lassoTool; - palette.registerProvider(this); -} -PaletteProvider.$inject = ["palette", "create", "elementFactory", "spaceTool", "lassoTool", "modeling"]; -PaletteProvider.prototype.getPaletteEntries = function () { - let actions = {}, - create = this._create, - elementFactory = this._elementFactory, - spaceTool = this._spaceTool, - lassoTool = this._lassoTool; - function createAction(type, group, className, title, options) { - function createListener(event) { - let shape = elementFactory.createShape((0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)({ - type: type - }, options)); - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(shape.businessObject, { - id: shape.id - }); - if (options) { - shape.businessObject.di.isExpanded = options.isExpanded; - } - create.start(event, shape); +let HtmlPresentationService = /*#__PURE__*/(() => { + class HtmlPresentationService { + constructor(replayService, titleService, storyCreatorService) { + this.replayService = replayService; + this.titleService = titleService; + this.storyCreatorService = storyCreatorService; } - let shortType = type.replace(/^domainStory:/, ""); - return { - group: group, - className: className, - title: "Create " + title || 0, - action: { - dragstart: createListener, - click: createListener - } - }; - } - return initPalette(actions, spaceTool, lassoTool, createAction); -}; -function appendCSSStyleCheat(customIcons) { - const sheetEl = document.createElement("style"); - document.head.appendChild(sheetEl); - let customIconDict = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); - customIconDict.appendDict(customIcons); - let customIconDictKeys = customIconDict.keysArray(); - customIconDictKeys.forEach(name => { - if (iconDictionary.getAppendedIconDictionary().has(name)) { - let src = customIconDict.get(name); - const iconStyle = ".icon-domain-story-" + name.toLowerCase() + "::before{" + " display: block;" + ' content: url("data:image/svg+xml;utf8,' + wrapSRCInSVG(src) + '");' + " margin: 3px;}"; - sheetEl.sheet.insertRule(iconStyle, sheetEl.sheet.cssRules.length); + static viewBoxCoordinates(svg) { + const ViewBoxCoordinate = /width="([^"]+)"\s+height="([^"]+)"\s+viewBox="([^"]+)"/; + const match = svg.match(ViewBoxCoordinate); + return match[3]; } - }); -} -function initPalette(actions, spaceTool, lassoTool, createAction) { - let config = iconDictionary?.getCurrentIconConfigurationForBPMN(); - let customIcons = localStorage.getItem(_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_3__.APPENDED_ICONS_TAG); - if (customIcons) { - customIcons = JSON.parse(customIcons); - if (customIconsLegacy(customIcons)) { - customIcons = convertLegacyAppendedIconsToDict(customIcons); + /* + --------------------------- + SVG handling starts here + ---------------------------- + */ + downloadHTMLPresentation(filename, modeler) { + var _this = this; + return (0,_home_runner_work_egon_io_egon_io_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + const svgData = []; + // export all sentences of domain story + _this.replayService.startReplay(); + try { + const result = yield modeler.saveSVG({}); + _this.fixActivityMarkersForEachSentence(result, _this.replayService.getCurrentSentenceNumber()); + svgData.push({ + content: HtmlPresentationService.createSVGData(result.svg), + transition: 'slide' + }); + } catch (err) { + alert('There was an error exporting the SVG.\n' + err); + } + while (_this.replayService.getCurrentSentenceNumber() < _this.replayService.getMaxSentenceNumber()) { + _this.replayService.nextSentence(); + try { + const result = yield modeler.saveSVG({}); + _this.fixActivityMarkersForEachSentence(result, _this.replayService.getCurrentSentenceNumber()); + svgData.push({ + content: HtmlPresentationService.createSVGData(result.svg), + transition: 'slide' + }); + } catch (err) { + alert('There was an error exporting the SVG.\n' + err); + } + } + _this.replayService.stopReplay(); + // create download for presentation + const revealjsTemplate = document.getElementById('revealjs-template'); + const dots = dot__WEBPACK_IMPORTED_MODULE_2___default().template(revealjsTemplate?.innerHTML); + const revealjsData = { + script: 'script', + title: _this.titleService.getTitle(), + description: _this.titleService.getDescription(), + sentences: svgData, + multiplexSecret: _this.multiplexSecret, + multiplexId: _this.multiplexId + }; + const element = document.createElement('a'); + element.setAttribute('href', 'data:text/html;charset=UTF-8,' + _this.fixMalformedHtmlScript(dots, revealjsData)); + element.setAttribute('download', (0,_utils_sanitizer__WEBPACK_IMPORTED_MODULE_1__.sanitizeForDesktop)(filename) + '.html'); + element.style.display = 'none'; + document.body.appendChild(element); + element.click(); + document.body.removeChild(element); + })(); } - if (customIcons.entries && customIcons.entries.forEach) { - const customIconsDict = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); - customIcons.entries.forEach(entry => { - customIconsDict.putEntry(entry); - }); - (0,src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_0__.overrideAppendedIcons)(customIconsDict); - appendCSSStyleCheat(customIcons); + fixMalformedHtmlScript(dots, revealjsData) { + return dots(revealjsData).replace(' { - addCanvasObjectTypes(name, createAction, actions, "actor", src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR); - }); - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(actions, { - "actor-separator": { - group: "actor", - separator: true - } - }); - let workObjectTypes = iconDictionary?.getTypeDictionary(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT); - workObjectTypes?.keysArray().forEach(name => { - addCanvasObjectTypes(name, createAction, actions, "actor", src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT); - }); - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(actions, { - "workObject-separator": { - group: "workObject", - separator: true - }, - "domainStory-group": createAction(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.GROUP, "group", "icon-domain-story-tool-group", "group"), - "group-separator": { - group: "group", - separator: true - }, - "lasso-tool": { - group: "tools", - className: "bpmn-icon-lasso-tool", - title: "Activate the lasso tool", - action: { - click: function (event) { - lassoTool.activateSelection(event); - } - } - }, - "space-tool": { - group: "tools", - className: "bpmn-icon-space-tool", - title: "Activate the create/remove space tool", - action: { - click: function (event) { - spaceTool.activateSelection(event); - } + // tslint:disable-next-line:align + static createSVGData(svg) { + let data = structuredClone(svg); + // to ensure that the title and description are inside the SVG container and do not overlap with any elements, + // we change the confines of the SVG viewbox + let viewBoxIndex = data.indexOf('width="'); + const viewBox = HtmlPresentationService.viewBoxCoordinates(data); + let xLeft; + let width; + let yUp; + let height; + const splitViewBox = viewBox.split(/\s/); + xLeft = +splitViewBox[0]; + yUp = +splitViewBox[1]; + width = +splitViewBox[2]; + height = +splitViewBox[3]; + if (width < 300) { + width += 300; } + const dataStart = data.substring(0, viewBoxIndex); + viewBoxIndex = data.indexOf('" version'); + const dataEnd = data.substring(viewBoxIndex); + dataEnd.substring(viewBoxIndex); + data = dataStart + this.createBounds(xLeft, yUp, width, height) + dataEnd; + return encodeURIComponent(data); } - }); - return actions; -} -function addCanvasObjectTypes(name, createAction, actions, className, elementType) { - let icon = iconDictionary.getIconForBPMN(elementType, name); - let action = []; - action["domainStory-" + className + name] = createAction(`${elementType}${name}`, className, icon, name); - (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(actions, action); -} -function customIconsLegacy(customIcons) { - return !(Object.keys(customIcons).length === 1 && Object.keys(customIcons)[0] === "entries"); -} -function convertLegacyAppendedIconsToDict(customIcons) { - let dict = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); - Object.keys(customIcons).forEach(key => { - dict.set(key, customIcons[key]); - }); - return dict; -} -// For some reason its important to use ' in the content for the Palette and ContextPad -// Do not change! -function wrapSRCInSVG(src) { - return "" + ""; -} - -/***/ }), - -/***/ 96588: -/*!*************************************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/updateHandler/activityUpdateHandlers.js ***! - \*************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ activityUpdateHandler), -/* harmony export */ initializeActivityUpdateHandler: () => (/* binding */ initializeActivityUpdateHandler) -/* harmony export */ }); -/* harmony import */ var _numbering_numbering__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../numbering/numbering */ 37126); - - - -/** - * commandStack Handler for changes at activities - */ -let canvasElementRegistry; -function initializeActivityUpdateHandler(canvasElementRegistryService) { - canvasElementRegistry = canvasElementRegistryService; -} -function activityUpdateHandler(commandStack, eventBus) { - commandStack.registerHandler("activity.directionChange", activity_directionChange); - commandStack.registerHandler("activity.changed", activity_changed); - // update the activity from the activity-dialog, either with or without number - // and change other activities too, to keep the numbers consistent - function activity_changed(modeling) { - this.preExecute = function (context) { - context.oldLabel = context.businessObject.name || " "; - let oldNumbersWithIDs = (0,_numbering_numbering__WEBPACK_IMPORTED_MODULE_0__.getNumbersAndIDs)(); - modeling.updateLabel(context.businessObject, context.newLabel); - modeling.updateNumber(context.businessObject, context.newNumber); - context.oldNumber = context.businessObject.number; - context.oldNumbersWithIDs = oldNumbersWithIDs; - }; - this.execute = function (context) { - let businessObject = context.businessObject; - let element = context.element; - if (context.newLabel && context.newLabel.length < 1) { - context.newLabel = " "; - } - businessObject.name = context.newLabel; - businessObject.number = context.newNumber; - eventBus.fire("element.changed", { - element - }); - }; - this.revert = function (context) { - let semantic = context.businessObject; - let element = context.element; - semantic.name = context.oldLabel; - semantic.number = context.oldNumber; - revertAutomaticNumberGenerationChange(context.oldNumbersWithIDs, eventBus); - eventBus.fire("element.changed", { - element - }); - }; - } - // change the direction of a single activity without affecting other activities - function activity_directionChange(modeling) { - this.preExecute = function (context) { - context.oldNumber = context.businessObject.number; - context.oldWaypoints = context.element.waypoints; - context.name = context.businessObject.name; - if (!context.oldNumber) { - context.oldNumber = 0; - } - modeling.updateNumber(context.businessObject, context.newNumber); - }; - this.execute = function (context) { - let businessObject = context.businessObject; - let element = context.element; - let swapSource = element.source; - let newWaypoints = []; - let waypoints = element.waypoints; - for (let i = waypoints.length - 1; i >= 0; i--) { - newWaypoints.push(waypoints[i]); - } - element.source = element.target; - businessObject.source = businessObject.target; - element.target = swapSource; - businessObject.target = swapSource.id; - businessObject.name = context.name; - businessObject.number = context.newNumber; - element.waypoints = newWaypoints; - eventBus.fire("element.changed", { - element - }); - }; - this.revert = function (context) { - let semantic = context.businessObject; - let element = context.element; - let swapSource = element.source; - element.source = element.target; - semantic.source = semantic.target; - element.target = swapSource; - semantic.target = swapSource.id; - semantic.name = context.name; - semantic.number = context.oldNumber; - element.waypoints = context.oldWaypoints; - eventBus.fire("element.changed", { - element - }); - }; - } -} -// reverts the automatic changed done by the automatic number-generation at editing -function revertAutomaticNumberGenerationChange(iDWithNumber, eventBus) { - let activities = canvasElementRegistry?.getActivitesFromActors(); - for (let i = activities.length - 1; i >= 0; i--) { - for (let j = iDWithNumber.length - 1; j >= 0; j--) { - if (iDWithNumber[j].id.includes(activities[i].businessObject.id)) { - let element = activities[i]; - element.businessObject.number = iDWithNumber[j].number; - j = -5; - eventBus.fire("element.changed", { - element + static createBounds(xLeft, yUp, width, height) { + return 'width="100%"' + ' height="100%" ' + ' preserveAspectRatio="xMidYMid meet"' + ' viewBox="' + xLeft + ' ' + yUp + ' ' + (xLeft + width) + ' ' + (yUp + height); + } + /** + * There is a Problem in the HTML-Presentation, where the Arrow-Heads of the Activities are not shown after the 4th sentence + * This is due to the fact, that the marker for the Arrow-Head is defined in each sentence with the same ID + * When the 5th sentence is reached, the first marker is set to display none, which propagates to all other markers + * + * To fix this, for each sentence the marker and its references are renamed + */ + fixActivityMarkersForEachSentence(result, sectionIndex) { + const defs = result.svg.substring(result.svg.indexOf(''), result.svg.indexOf('') + 7); + const split = defs.split(' { + const idToReplace = id.substring(4, id.length - 1); + const newId = idToReplace.slice(0, id.length - 5) + 'customId' + sectionIndex + idToReplace.slice(idToReplace.length - 2); + // @ts-ignore + result.svg = result.svg.replaceAll(idToReplace, newId); }); - iDWithNumber.splice(j, 1); + newDefs += ' { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ elementUpdateHandler) +/* harmony export */ PngService: () => (/* binding */ PngService) /* harmony export */ }); -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ 36997); - +/* harmony import */ var src_app_tools_export_services_exportUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/tools/export/services/exportUtil */ 99160); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); -function elementUpdateHandler(commandStack, eventBus) { - commandStack.registerHandler("element.colorChange", element_colorChange); - commandStack.registerHandler("shape.removeGroupWithoutChildren", removeGroupWithoutChildren); - function element_colorChange() { - this.preExecute = function (context) { - context.oldColor = context.businessObject.pickedColor; - }; - this.execute = function (context) { - let semantic = context.businessObject; - let element = context.element; - semantic.pickedColor = context.newColor; - eventBus.fire("element.changed", { - element - }); - }; - this.revert = function (context) { - let semantic = context.businessObject; - let element = context.element; - semantic.pickedColor = context.oldColor; - eventBus.fire("element.changed", { - element - }); - }; - } - function removeGroupWithoutChildren() { - this.preExecute = function (ctx) { - ctx.parent = ctx.element.parent; - ctx.children = ctx.element.children.slice(); - }; - this.execute = function (ctx) { - let element = ctx.element; - ctx.children.forEach(child => { - (0,_util__WEBPACK_IMPORTED_MODULE_0__.undoGroupRework)(element, child); - eventBus.fire("element.changed", { - element: child - }); - }); - eventBus.fire("shape.remove", { - element - }); - }; - this.revert = function (ctx) { - let element = ctx.element; - eventBus.fire("shape.added", { - element - }); - ctx.element.children.forEach(child => { - reworkGroupElements(element, child); - }); - }; - } -} - -/***/ }), - -/***/ 65501: -/*!**************************************************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/updateHandler/headlineAndDescriptionUpdateHandler.js ***! - \**************************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ headlineAndDescriptionUpdateHandler) -/* harmony export */ }); -/** - * a handler that updates the text of a BPMN element. - */ -function headlineAndDescriptionUpdateHandler(commandStack, titleService) { - commandStack.registerHandler("story.updateHeadlineAndDescription", handlerFunction); - function handlerFunction() { - this.execute = function (ctx) { - ctx.oldTitle = titleService.getTitle(); - ctx.oldDescription = titleService.getDescription(); - titleService.updateTitleAndDescription(ctx.newTitle, ctx.newDescription, false); - }; - this.revert = function (ctx) { - titleService.updateTitleAndDescription(ctx.oldTitle, ctx.oldDescription, false); - }; - } -} - -/***/ }), - -/***/ 74431: -/*!********************************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/updateHandler/massRenameHandler.js ***! - \********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ DSMassRenameHandler) -/* harmony export */ }); - - -function DSMassRenameHandler(commandStack, eventBus) { - commandStack.registerHandler("domainStoryObjects.massRename", massRename); - function massRename(modeling) { - this.preExecute = function (context) { - let relevantElements = context.elements; - context.oldLabel = relevantElements[0].businessObject.name; - relevantElements.forEach(element => { - modeling.updateLabel(element.businessObject, confirm.newValue); - }); - }; - this.execute = function (context) { - let relevantElements = context.elements; - relevantElements.forEach(element => { - let semantic = element.businessObject; - semantic.name = context.newValue; - eventBus.fire("element.changed", { - element - }); - }); - }; - this.revert = function (context) { - let relevantElements = context.elements; - relevantElements.forEach(element => { - let semantic = element.businessObject; - semantic.name = context.oldLabel; - eventBus.fire("element.changed", { - element - }); - }); - }; - } -} - -/***/ }), - -/***/ 79182: -/*!*********************************************************************!*\ - !*** ./src/app/BPMN-JS/modeler/updateHandler/updateLabelHandler.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ UpdateLabelHandler) -/* harmony export */ }); -/* harmony import */ var _labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../labeling/dsLabelUtil */ 84745); -/* harmony import */ var bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bpmn-js/lib/util/LabelUtil */ 50815); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util */ 36997); - - - - - - -const NULL_DIMENSIONS = { - width: 0, - height: 0 -}; -/** - * a handler that updates the text of a BPMN element. - */ -function UpdateLabelHandler(modeling, textRenderer, commandStack) { - commandStack.registerHandler("element.updateCustomLabel", handlerFunction); - function handlerFunction() { - /** - * Set the label and return the changed elements. - * - * Element parameter can be label itself or connection (i.e. sequence flow). - * - * @param {djs.model.Base} element - * @param {String} text - */ - this.preExecute = function (ctx) { - let element = ctx.element, - businessObject = element.businessObject, - newLabel = ctx.newLabel, - newNumber = ctx.newNumber; - if (!(0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.isLabel)(element) && (0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.isLabelExternal)(element) && !(0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.hasExternalLabel)(element) && (newLabel !== "" || newNumber !== "")) { - // create label - let paddingTop = 7; - let labelCenter = (0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.getExternalLabelMid)(element); - labelCenter = { - x: labelCenter.x, - y: labelCenter.y + paddingTop +let PngService = /*#__PURE__*/(() => { + class PngService { + constructor() { + this.width = 0; + this.height = 0; + } + browserSpecs() { + const ua = navigator.userAgent; + let tem; + let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; + if (/trident/i.test(M[1])) { + tem = /\brv[ :]+(\d+)/g.exec(ua) || []; + return { + name: 'IE', + version: tem[1] || '' }; - modeling.createLabel(element, labelCenter, { - id: businessObject.id + "_label", - businessObject: businessObject - }); - } - }; - this.execute = function (ctx) { - ctx.oldLabel = (0,_labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.getLabel)(ctx.element); - ctx.oldNumber = (0,_labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.getNumber)(ctx.element); - return setText(ctx.element, ctx.newLabel, ctx.newNumber); - }; - this.revert = function (ctx) { - return setText(ctx.element, ctx.oldLabel, ctx.oldNumber); - }; - this.postExecute = function (ctx) { - let element = ctx.element, - label = element.label || element, - newLabel = ctx.newLabel, - newBounds = ctx.newBounds; - if ((0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.isLabel)(label) && newLabel.trim() === "") { - modeling.removeShape(label); - return; } - // ignore internal labels for elements except text annotations - if (!(0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.isLabelExternal)(element) && !(0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(element, src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.TEXTANNOTATION)) { - return; + if (M[1] === 'Chrome') { + tem = ua.match(/\b(OPR|Edge)\/(\d+)/); + if (tem != null) { + return { + name: tem[1].replace('OPR', 'Opera'), + version: tem[2] + }; + } } - let bo = (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(label); - let text = bo.name || bo.text; - // don't resize without text - if (!text) { - return; + M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?']; + // tslint:disable-next-line:no-conditional-assignment + if ((tem = ua.match(/version\/(\d+)/i)) != null) { + M.splice(1, 1, tem[1]); } - // resize element based on label _or_ pre-defined bounds - if (typeof newBounds === "undefined") { - newBounds = textRenderer.getLayoutedBounds(label, text); + return { + name: M[0], + version: M[1] + }; + } + /** Needed for an SVG-Fix in CHrome where the # needs to be replaced by %23 **/ + URIHashtagFix(svg) { + let fix = false; + const browser = this.browserSpecs(); + const name = browser.name; + const version = parseInt(browser.version); + // only implemented in chrome and firefox at the moment + if (name.includes('Chrome')) { + if (version >= 72) { + fix = true; + // https://www.chromestatus.com/features/5656049583390720 + } + } else if (name.includes('Firefox')) { + fix = true; + // versionNumber of implementation unknown } - // setting newBounds to false or _null_ will - // disable the postExecute resize operation - if (newBounds) { - modeling.resizeShape(label, newBounds, NULL_DIMENSIONS); + + if (fix) { + while (svg.includes('#')) { + svg = svg.replace('#', '%23'); + } } - }; - } -} -function setText(element, text, textNumber) { - // external label if present - let label = element.label || element; - let number = element.number || element; - let labelTarget = element.labelTarget || element; - let numberTarget = element.numberTarget || element; - (0,_labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.setLabel)(label, text); - (0,_labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.setNumber)(number, textNumber); - return [label, labelTarget, number, numberTarget]; -} -UpdateLabelHandler.$inject = ["modeling", "textRenderer", "commandStack"]; - -/***/ }), - -/***/ 36997: -/*!*****************************************!*\ - !*** ./src/app/BPMN-JS/modeler/util.js ***! - \*****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ getBusinessObject: () => (/* binding */ getBusinessObject), -/* harmony export */ is: () => (/* binding */ is), -/* harmony export */ isAny: () => (/* binding */ isAny), -/* harmony export */ reworkGroupElements: () => (/* binding */ reworkGroupElements), -/* harmony export */ undoGroupRework: () => (/* binding */ undoGroupRework) -/* harmony export */ }); -/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ 93673); - -function is(element, type) { - const bo = getBusinessObject(element); - return bo && typeof bo.$instanceOf == "function" && bo.$instanceOf(type); -} -function getBusinessObject(element) { - return element && element.businessObject || element; -} -function isAny(element, types) { - return (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.some)(types, function (t) { - return is(element, t); - }); -} -function reworkGroupElements(parent, shape) { - parent.children.slice().forEach(innerShape => { - if (innerShape.id !== shape.id) { - if (innerShape.x >= shape.x && innerShape.x <= shape.x + shape.width) { - if (innerShape.y >= shape.y && innerShape.y <= shape.y + shape.height) { - innerShape.parent = shape; - if (!shape.children.includes(innerShape)) { - shape.children.push(innerShape); + return svg; + } + findMostOuterElements(svg) { + let xLeft = 0; + let xRight = 0; + let yUp = 0; + let yDown = 0; + const elements = svg.getElementsByClassName('djs-group'); + // tslint:disable-next-line:prefer-for-of + for (let i = 0; i < elements.length; i++) { + const element = elements[i]; + const sub = element.children; + let elXLeft; + let elXRight; + let elYUp; + let elYDown; + const transform = sub[0].getAttribute('transform'); + if (transform) { + let nums; + if (transform.includes('matrix')) { + transform.replace('matrix(', ''); + transform.replace(')', ''); + nums = transform.split(' '); + elXLeft = parseInt(nums[4]); + elYUp = parseInt(nums[5]); + } else { + transform.replace('translate(', ''); + transform.replace(')', ''); + nums = transform.split(' '); + elXLeft = parseInt(nums[0]); + elYUp = parseInt(nums[1]); } + const rects = sub[0].getElementsByTagName('rect'); + const outerRect = rects[rects.length - 1]; + const width = outerRect.getAttribute('width'); + elXRight = elXLeft + parseInt(width != null ? width : '0'); + elYDown = elYUp + sub[0].getBoundingClientRect().height; + } else { + const rects = element.getElementsByTagName('rect'); + const outerRect = rects[rects.length - 1]; + const x = outerRect.getAttribute('x'); + const y = outerRect.getAttribute('y'); + elXLeft = parseInt(x != null ? x : '0'); + elYUp = parseInt(y != null ? y : '0'); + const width = outerRect.getAttribute('width'); + const height = outerRect.getAttribute('height'); + elXRight = elXLeft + parseInt(width != null ? width : '0'); + elYDown = elYUp + parseInt(height != null ? height : '0') + 20; // Add 20 px as Padding for text at the bottom + } + + if (elXLeft < xLeft) { + xLeft = elXLeft; + } + if (elXRight > xRight) { + xRight = elXRight; + } + if (elYUp < yUp) { + yUp = elYUp; + } + if (elYDown > yDown) { + yDown = elYDown; } } + yUp -= 75; // we need to adjust yUp to have space for the title and description + return { + xLeft, + xRight, + yUp, + yDown + }; } - }); -} -function undoGroupRework(parent, shape) { - const superParent = parent.parent; - parent.children.remove(shape); - superParent.children.add(shape); - shape.parent = superParent; - const svgShape = document.querySelector("[data-element-id=" + shape.id + "]").parentElement; - const svgGroup = svgShape.parentElement; - const svgGroupParent = svgGroup.parentElement.parentElement; - svgGroup.removeChild(svgShape); - svgGroupParent.appendChild(svgShape); -} + prepareSVG(svg, layerBase, description, title, withTitle) { + const box = this.findMostOuterElements(layerBase); + let viewBoxIndex = svg.indexOf('width="'); + this.calculateWidthAndHeight(box); + const { + insertText, + dynamicHeightOffset + } = (0,src_app_tools_export_services_exportUtil__WEBPACK_IMPORTED_MODULE_0__.createTitleAndDescriptionSVGElement)(0, title, description, box.xLeft + 10, box.yUp + 20, this.width); + if (withTitle) { + this.height += dynamicHeightOffset; + } + const bounds = this.createBounds(box, dynamicHeightOffset); + const dataStart = svg.substring(0, viewBoxIndex); + viewBoxIndex = svg.indexOf('style="'); + const dataEnd = svg.substring(viewBoxIndex); + dataEnd.substring(viewBoxIndex); + svg = dataStart + bounds + dataEnd; + const insertIndex = svg.indexOf('') + 20; + if (withTitle) { + svg = [svg.slice(0, insertIndex), insertText, svg.slice(insertIndex)].join(''); + } + svg = this.URIHashtagFix(svg); + return svg; + } + createBounds(box, extraHeight) { + return 'width="' + this.width + '" height="' + this.height + '" viewBox=" ' + box.xLeft + ' ' + (box.yUp - extraHeight) + ' ' + this.width + ' ' + this.height + '" '; + } + /** + * Calculate the Width and Height of the Bounding Box for the PNG so no Parts are cut off + */ + calculateWidthAndHeight(box) { + if (box.xLeft < 0) { + if (box.xRight < 0) { + this.width = Math.abs(box.xLeft - box.xRight); + } else { + this.width = Math.abs(box.xLeft) + box.xRight; + } + } else { + this.width = box.xRight - box.xLeft; + } + if (box.yUp < 0) { + if (box.yDown < 0) { + this.height = Math.abs(box.yUp - box.yDown); + } else { + this.height = Math.abs(box.yUp) + box.yDown; + } + } else { + this.height = box.yDown - box.yUp; + } + // if the domain-Story is smaller than 300px in width or height, increase its dimensions + if (this.height < 300) { + this.height += 300; + box.yUp -= 150; + box.yDown += 150; + } + if (this.width < 300) { + this.width += 300; + box.xLeft -= 150; + box.xRight += 150; + } + return [this.height, this.width]; + } + extractSVG(viewport, outerSVGElement) { + const layerResizers = viewport.getElementsByClassName('layer-resizers'); + const layerOverlays = viewport.getElementsByClassName('layer-overlays'); + const transform = viewport.getAttribute('transform'); + const translate = viewport.getAttribute('translate'); + if (layerResizers[0]) { + layerResizers[0].parentNode.removeChild(layerResizers[0]); + } + if (layerOverlays[0]) { + layerOverlays[0].parentNode.removeChild(layerOverlays[0]); + } + // remove canvas scrolling and scaling before serializeToString of SVG + if (transform) { + viewport.removeAttribute('transform'); + } + if (translate) { + viewport.removeAttribute('translate'); + } + const svg = new XMLSerializer().serializeToString(outerSVGElement); + // re-add canvas scrolling and scaling + if (transform) { + viewport.setAttribute('transform', transform); + } + if (translate) { + viewport.setAttribute('translate', translate); + } + return svg; + } + getWidth() { + return this.width; + } + getHeight() { + return this.height; + } + static #_ = this.ɵfac = function PngService_Factory(t) { + return new (t || PngService)(); + }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ + token: PngService, + factory: PngService.ɵfac, + providedIn: 'root' + }); + } + return PngService; +})(); /***/ }), -/***/ 78828: -/*!*************************************************!*\ - !*** ./src/app/Domain/Common/businessObject.ts ***! - \*************************************************/ +/***/ 56837: +/*!******************************************************!*\ + !*** ./src/app/tools/export/services/svg.service.ts ***! + \******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ testBusinessObject: () => (/* binding */ testBusinessObject) +/* harmony export */ SvgService: () => (/* binding */ SvgService) /* harmony export */ }); -/* harmony import */ var _elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./elementTypes */ 30236); - -const testBusinessObject = { - $descriptor: undefined, - $type: undefined, - di: undefined, - get: undefined, - set: undefined, - id: 'test', - name: 'test', - type: _elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT, - x: 0, - y: 0, - height: 38, - width: 38, - pickedColor: undefined -}; - -/***/ }), +/* harmony import */ var src_app_tools_export_services_exportUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/tools/export/services/exportUtil */ 99160); +/* harmony import */ var _domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../domain/export/exportConstants */ 41646); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _modeler_services_modeler_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../modeler/services/modeler.service */ 40439); -/***/ 80775: -/*!************************************************!*\ - !*** ./src/app/Domain/Common/configuration.ts ***! - \************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Configuration: () => (/* binding */ Configuration) -/* harmony export */ }); -class Configuration { - constructor(actors, workObjects) { - this.actors = actors; - this.workObjects = workObjects; - } -} -/***/ }), -/***/ 90816: -/*!********************************************!*\ - !*** ./src/app/Domain/Common/constants.ts ***! - \********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ APPENDED_ICONS_TAG: () => (/* binding */ APPENDED_ICONS_TAG), -/* harmony export */ DEFAULT_AUTOSAVES_ENABLED: () => (/* binding */ DEFAULT_AUTOSAVES_ENABLED), -/* harmony export */ DEFAULT_AUTOSAVES_INTERVAL: () => (/* binding */ DEFAULT_AUTOSAVES_INTERVAL), -/* harmony export */ DEFAULT_AUTOSAVES_MAX_DRAFTS: () => (/* binding */ DEFAULT_AUTOSAVES_MAX_DRAFTS), -/* harmony export */ ICON_SET_CONFIGURATION_TAG: () => (/* binding */ ICON_SET_CONFIGURATION_TAG), -/* harmony export */ IMPLICIT_ROOT_ID: () => (/* binding */ IMPLICIT_ROOT_ID), -/* harmony export */ INITIAL_DESCRIPTION: () => (/* binding */ INITIAL_DESCRIPTION), -/* harmony export */ INITIAL_ICON_SET_NAME: () => (/* binding */ INITIAL_ICON_SET_NAME), -/* harmony export */ INITIAL_TITLE: () => (/* binding */ INITIAL_TITLE), -/* harmony export */ SNACKBAR_DURATION: () => (/* binding */ SNACKBAR_DURATION), -/* harmony export */ SNACKBAR_ERROR: () => (/* binding */ SNACKBAR_ERROR), -/* harmony export */ SNACKBAR_INFO: () => (/* binding */ SNACKBAR_INFO), -/* harmony export */ SNACKBAR_SUCCESS: () => (/* binding */ SNACKBAR_SUCCESS) -/* harmony export */ }); -/** DEFAULT VALUES **/ -const INITIAL_TITLE = '< title >'; -const INITIAL_DESCRIPTION = ''; -const INITIAL_ICON_SET_NAME = 'default'; -/** LocalStorageTags **/ -const APPENDED_ICONS_TAG = 'appendedIcons'; -// String value of tag should not be renamed, because existing configurations would not load -const ICON_SET_CONFIGURATION_TAG = 'domainConfigurationTag'; -/** AUTOSAVE DEFAULTS **/ -const DEFAULT_AUTOSAVES_ENABLED = true; -const DEFAULT_AUTOSAVES_MAX_DRAFTS = 5; -const DEFAULT_AUTOSAVES_INTERVAL = 30; -/** SNACKBAR **/ -const SNACKBAR_DURATION = 2000; -const SNACKBAR_SUCCESS = 'snackbar_success'; -const SNACKBAR_ERROR = 'snackbar_error'; -const SNACKBAR_INFO = 'snackbar_info'; -/** BPMN_RELEVANT_CONSTANTS **/ -const IMPLICIT_ROOT_ID = '__implicitroot'; - -/***/ }), - -/***/ 54972: -/*!********************************************************!*\ - !*** ./src/app/Domain/Common/dictionary/dictionary.ts ***! - \********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Dictionary: () => (/* binding */ Dictionary), -/* harmony export */ Entry: () => (/* binding */ Entry) -/* harmony export */ }); -class Dictionary { - constructor() { - this.entries = []; - } - get length() { - return this.entries.length; - } - all() { - return this.entries; - } - size() { - return this.entries.length; - } - isEmpty() { - return this.entries.length <= 0; - } - has(key) { - return this.entries.some(entry => entry.key === key); - } - set(key, value) { - if (!this.has(key)) { - this.entries.push(new Entry(value, key)); +let SvgService = /*#__PURE__*/(() => { + class SvgService { + constructor(modelerService) { + this.modelerService = modelerService; + this.cacheData = ''; } - } - add(value, key) { - this.set(key, value); - } - putEntry(entry) { - if (!this.has(entry.key)) { - this.entries.push(new Entry(entry.value, entry.key)); + createSVGData(title, description, dst, withTitle, useWhiteBackground) { + this.cacheData = this.modelerService.getEncoded(); + let domainStorySvg = structuredClone(this.cacheData); + let viewBoxIndex = domainStorySvg.indexOf('width="'); + let { + width, + height, + viewBox + } = this.viewBoxCoordinates(domainStorySvg); + // The value of the viewBox attribute is a list of four numbers separated by whitespace + // and/or a comma: min-x, min-y, width, and height. min-x and min-y represent the smallest + // X and Y coordinates that the viewBox may have (the origin coordinates of the viewBox) + // and the width and height specify the viewBox size. The resulting viewBox is a + // rectangle in user space mapped to the bounds of the viewport of an SVG element. + // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox + let min_x; + let viewBoxWidth; + let min_y; + let viewBoxHeight; + const splitViewBox = viewBox.split(/\s/); + min_x = +splitViewBox[0]; + min_y = +splitViewBox[1]; + viewBoxWidth = +splitViewBox[2]; + viewBoxHeight = +splitViewBox[3]; + // Set minimum width to ensure title and description are displayed reasonably + if (viewBoxWidth < 300) { + viewBoxWidth += 300; + width += 300; + } + const { + insertText, + dynamicHeightOffset + } = (0,src_app_tools_export_services_exportUtil__WEBPACK_IMPORTED_MODULE_0__.createTitleAndDescriptionSVGElement)(0, title, description, min_x, min_y, width); + const bounds = this.createBounds(width, height, min_x, min_y, viewBoxWidth, viewBoxHeight, withTitle, dynamicHeightOffset); + const dataStart = domainStorySvg.substring(0, viewBoxIndex); + viewBoxIndex = domainStorySvg.indexOf('" version'); + const dataEnd = domainStorySvg.substring(viewBoxIndex); + dataEnd.substring(viewBoxIndex); + domainStorySvg = dataStart + bounds + dataEnd; + const insertIndex = this.findIndexToInsertData(domainStorySvg); + if (withTitle) { + domainStorySvg = domainStorySvg.slice(0, insertIndex) + insertText + domainStorySvg.slice(insertIndex); + } + if (useWhiteBackground) { + const svgIndex = domainStorySvg.indexOf('width="'); + const backgroundColorWhite = 'style="background-color:white" '; + domainStorySvg = domainStorySvg.slice(0, svgIndex) + backgroundColorWhite + domainStorySvg.slice(svgIndex); + } + return this.appendDST(domainStorySvg, dst); } - } - keysArray() { - return this.entries.map(entry => entry.key); - } - addEach(object) { - Object.keys(object).forEach(key => { - this.set(key, object[key]); - }); - } - appendDict(dict) { - dict.entries.forEach(entry => this.putEntry(entry)); - } - clear() { - this.entries = []; - } - delete(key) { - this.entries = this.entries.filter(entry => entry.key !== key); - } - get(key) { - const found = this.entries.filter(entry => entry.key === key); - return found[0] ? found[0].value : null; - } - sort(fn) { - this.entries.sort(fn); - } - sortByName() { - this.entries.sort((a, b) => { - if (a.key.includes('_custom') == b.key.includes('_custom')) { - if (a.key < b.key) return -1;else { - return 1; - } + findIndexToInsertData(data) { + let insertIndex = data.indexOf(''); + if (insertIndex < 0) { + insertIndex = data.indexOf('version="1.2">') + 14; } else { - if (a.key.includes('_custom')) { - return -1; - } else { - return 1; - } + insertIndex += 7; } - }); - } -} -class Entry { - constructor(value, key) { - this.value = value; - this.key = key; - } -} - -/***/ }), - -/***/ 30236: -/*!***********************************************!*\ - !*** ./src/app/Domain/Common/elementTypes.ts ***! - \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ElementTypes: () => (/* binding */ ElementTypes) -/* harmony export */ }); -var ElementTypes = /*#__PURE__*/function (ElementTypes) { - ElementTypes["ACTIVITY"] = "domainStory:activity"; - ElementTypes["CONNECTION"] = "domainStory:connection"; - ElementTypes["ACTOR"] = "domainStory:actor"; - ElementTypes["WORKOBJECT"] = "domainStory:workObject"; - ElementTypes["GROUP"] = "domainStory:group"; - ElementTypes["TEXTANNOTATION"] = "domainStory:textAnnotation"; - ElementTypes["DOMAINSTORY"] = "domainStory:"; - ElementTypes["CUSTOM"] = "-custom"; - return ElementTypes; -}(ElementTypes || {}); -(function (ElementTypes) { - function getIconId(type) { - if (type.startsWith(ElementTypes.ACTOR)) { - return type.replace(ElementTypes.ACTOR, ''); - } else if (type.startsWith(ElementTypes.WORKOBJECT)) { - return type.replace(ElementTypes.WORKOBJECT, ''); + return insertIndex; } - return ''; - } - ElementTypes.getIconId = getIconId; - function isCustomType(type) { - return type.endsWith(ElementTypes.CUSTOM); - } - ElementTypes.isCustomType = isCustomType; - function isCustomSvgType(type) { - return type.endsWith('_svg' + ElementTypes.CUSTOM); + createBounds(width, height, min_x, min_y, viewBoxWidth, viewBoxHeight, withTitle, dynamicHeightOffset) { + height = withTitle ? height + dynamicHeightOffset + _domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_1__.TEXTSPAN_TITLE_HEIGHT : height; + min_x = min_x - _domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_PADDING; + min_y = withTitle ? min_y - dynamicHeightOffset - _domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_1__.TEXTSPAN_TITLE_HEIGHT : min_y; + viewBoxHeight = withTitle ? viewBoxHeight + dynamicHeightOffset + _domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_1__.TEXTSPAN_TITLE_HEIGHT + _domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_PADDING : viewBoxHeight; + viewBoxWidth = viewBoxWidth + _domain_export_exportConstants__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_PADDING; + return `width="${width}" height="${height}" viewBox="${min_x} ${min_y} ${viewBoxWidth} ${viewBoxHeight}`; + } + viewBoxCoordinates(svg) { + const ViewBoxCoordinate = /width="([^"]+)"\s+height="([^"]+)"\s+viewBox="([^"]+)"/; + const match = svg.match(ViewBoxCoordinate); + if (match) { + return { + width: +match[1], + height: +match[2], + viewBox: match[3] + }; + } + return { + width: 0, + height: 0, + viewBox: '' + }; + } + appendDST(data, dst) { + data += '\n'; + return data; + } + static #_ = this.ɵfac = function SvgService_Factory(t) { + return new (t || SvgService)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](_modeler_services_modeler_service__WEBPACK_IMPORTED_MODULE_2__.ModelerService)); + }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjectable"]({ + token: SvgService, + factory: SvgService.ɵfac, + providedIn: 'root' + }); } - ElementTypes.isCustomSvgType = isCustomSvgType; -})(ElementTypes || (ElementTypes = {})); + return SvgService; +})(); /***/ }), -/***/ 93703: -/*!*****************************************************!*\ - !*** ./src/app/Domain/Dialog/activityDialogData.ts ***! - \*****************************************************/ +/***/ 61070: +/*!**********************************************************!*\ + !*** ./src/app/tools/icon-set-config/domain/allIcons.ts ***! + \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ActivityDialogData: () => (/* binding */ ActivityDialogData) +/* harmony export */ allIcons: () => (/* binding */ allIcons), +/* harmony export */ appendedIcons: () => (/* binding */ appendedIcons), +/* harmony export */ getAllStandardIconKeys: () => (/* binding */ getAllStandardIconKeys), +/* harmony export */ overrideAppendedIcons: () => (/* binding */ overrideAppendedIcons), +/* harmony export */ updateAppendedIcons: () => (/* binding */ updateAppendedIcons) /* harmony export */ }); -class ActivityDialogData { - constructor(activity, numberIsAllowedMultipleTimes, showNumberFields, saveFN) { - this.activity = activity; - this.numberIsAllowedMultipleTimes = numberIsAllowedMultipleTimes; - this.showNumberFields = showNumberFields; - this.saveFN = saveFN; - } -} - -/***/ }), +/* harmony import */ var src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/dictionary */ 20843); -/***/ 83064: -/*!***************************************************!*\ - !*** ./src/app/Domain/Dialog/exportDialogData.ts ***! - \***************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ExportDialogData: () => (/* binding */ ExportDialogData), -/* harmony export */ ExportOption: () => (/* binding */ ExportOption) -/* harmony export */ }); -class ExportDialogData { - constructor(title, options) { - this.title = title; - this.options = options; - } -} -class ExportOption { - constructor(text, tooltip, fn) { - this.text = text; - this.tooltip = tooltip; - this.fn = fn; - } -} - -/***/ }), - -/***/ 45574: -/*!*************************************************!*\ - !*** ./src/app/Domain/Dialog/infoDialogData.ts ***! - \*************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ InfoDialogData: () => (/* binding */ InfoDialogData) -/* harmony export */ }); -class InfoDialogData { - constructor(title, infoText, isInfo, isLink = false, linkText) { - this.title = title; - this.infoText = infoText; - this.isInfo = isInfo; - this.isLink = isLink; - this.linkText = linkText; - } -} - -/***/ }), - -/***/ 90173: -/*!***********************************************************!*\ - !*** ./src/app/Domain/DomManipulation/replayConstants.ts ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ HIGHLIGHT_NUMBER_BACKGROUNG_COLOR: () => (/* binding */ HIGHLIGHT_NUMBER_BACKGROUNG_COLOR), -/* harmony export */ HIGHLIGHT_NUMBER_COLOR: () => (/* binding */ HIGHLIGHT_NUMBER_COLOR), -/* harmony export */ HIGHLIGHT_STROKE_WIDTH: () => (/* binding */ HIGHLIGHT_STROKE_WIDTH), -/* harmony export */ NUMBER_BACKGROUND_COLOR: () => (/* binding */ NUMBER_BACKGROUND_COLOR), -/* harmony export */ NUMBER_COLOR: () => (/* binding */ NUMBER_COLOR), -/* harmony export */ STROKE_WIDTH: () => (/* binding */ STROKE_WIDTH) -/* harmony export */ }); -const NUMBER_BACKGROUND_COLOR = 'white'; -const NUMBER_COLOR = 'black'; -const STROKE_WIDTH = '1.5'; -const HIGHLIGHT_NUMBER_BACKGROUNG_COLOR = '#43acbf'; -const HIGHLIGHT_NUMBER_COLOR = 'black'; -const HIGHLIGHT_STROKE_WIDTH = '4'; - -/***/ }), - -/***/ 74306: -/*!***********************************************!*\ - !*** ./src/app/Domain/Export/configAndDst.ts ***! - \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ConfigAndDST: () => (/* binding */ ConfigAndDST), -/* harmony export */ testConfigAndDst: () => (/* binding */ testConfigAndDst) -/* harmony export */ }); -class ConfigAndDST { - constructor(domain, dst) { - this.domain = domain; - this.dst = dst; - } -} -const testConfigAndDst = { - domain: JSON.parse('{"name":"",' + '"actors":{"Person":"' + '' + '",' + '"Group":"' + '' + '",' + '"System":"' + '"},' + '"workObjects":{"Document":"' + '",' + '"Folder":"' + '' + '",' + '"Call":"' + '",' + '"Email":"' + '",' + '"Conversation":"' + '",' + '"Info":"' + '' + '"}}'), - dst: '[' + '{"type":"domainStory:workObjectDocument","name":"","id":"shape_3792","$type":"Element","di":{},"$descriptor":{},"pickedColor":"black","x":302,"y":102},' + '{"type":"domainStory:actorPerson","name":"","id":"shape_4666","$type":"Element","di":{},"$descriptor":{},"pickedColor":"black","x":103,"y":93},' + '{"type":"domainStory:activity","name":"","id":"connection_4884","$type":"Element","di":{},"$descriptor":{},"pickedColor":"black","number":1,' + '"waypoints":[{"original":{"x":141,"y":131},"x":186,"y":133},{"original":{"x":340,"y":140},"x":302,"y":138}],' + '"source":"shape_4666","target":"shape_3792"}]' -}; - -/***/ }), - -/***/ 27901: -/*!**************************************************!*\ - !*** ./src/app/Domain/Export/exportConstants.ts ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ DEFAULT_PADDING: () => (/* binding */ DEFAULT_PADDING), -/* harmony export */ SVG_LINK: () => (/* binding */ SVG_LINK), -/* harmony export */ TEXTSPAN_DESCRIPTION_HEIGHT: () => (/* binding */ TEXTSPAN_DESCRIPTION_HEIGHT), -/* harmony export */ TEXTSPAN_TITLE_HEIGHT: () => (/* binding */ TEXTSPAN_TITLE_HEIGHT), -/* harmony export */ X_OFFSET_UTIL: () => (/* binding */ X_OFFSET_UTIL) -/* harmony export */ }); -const SVG_LINK = 'http://www.w3.org/2000/svg'; -const X_OFFSET_UTIL = '8'; -const TEXTSPAN_TITLE_HEIGHT = 30; -const TEXTSPAN_DESCRIPTION_HEIGHT = 15; -const DEFAULT_PADDING = 15; - -/***/ }), - -/***/ 57488: -/*!***********************************************************!*\ - !*** ./src/app/Domain/Icon-Set-Configuration/allIcons.ts ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ allIcons: () => (/* binding */ allIcons), -/* harmony export */ appendedIcons: () => (/* binding */ appendedIcons), -/* harmony export */ getAllStandardIconKeys: () => (/* binding */ getAllStandardIconKeys), -/* harmony export */ overrideAppendedIcons: () => (/* binding */ overrideAppendedIcons) -/* harmony export */ }); -/* harmony import */ var src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/dictionary/dictionary */ 54972); - -let appendedIcons = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); +let appendedIcons = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); const allIcons = { Person: '', Group: '', @@ -67788,20 +66427,25 @@ const allIcons = { 'View-List': '' }; function getAllStandardIconKeys() { - const allIconsDict = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + const allIconsDict = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); allIconsDict.addEach(allIcons); return allIconsDict.keysArray(); } function overrideAppendedIcons(newIcons) { appendedIcons = newIcons; } +function updateAppendedIcons(newIcons) { + for (const key in newIcons.keysArray().entries()) { + appendedIcons.add(newIcons.get(key), key); + } +} /***/ }), -/***/ 69186: -/*!********************************************************************!*\ - !*** ./src/app/Domain/Icon-Set-Configuration/iconConfiguration.ts ***! - \********************************************************************/ +/***/ 26976: +/*!*******************************************************************!*\ + !*** ./src/app/tools/icon-set-config/domain/iconConfiguration.ts ***! + \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -67810,17 +66454,17 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ IconConfiguration: () => (/* binding */ IconConfiguration), /* harmony export */ defaultConf: () => (/* binding */ defaultConf) /* harmony export */ }); -/* harmony import */ var src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/dictionary/dictionary */ 54972); -/* harmony import */ var src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Domain/Icon-Set-Configuration/allIcons */ 57488); -/* harmony import */ var src_app_Domain_Common_configuration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/Domain/Common/configuration */ 80775); -/* harmony import */ var _Common_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/constants */ 90816); +/* harmony import */ var src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/dictionary */ 20843); +/* harmony import */ var src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/tools/icon-set-config/domain/allIcons */ 61070); +/* harmony import */ var src_app_domain_entities_configuration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/domain/entities/configuration */ 56165); +/* harmony import */ var _domain_entities_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../domain/entities/constants */ 40550); class IconConfiguration { constructor(allIconDictionary) { - this.domainName = _Common_constants__WEBPACK_IMPORTED_MODULE_3__.INITIAL_ICON_SET_NAME; + this.domainName = _domain_entities_constants__WEBPACK_IMPORTED_MODULE_3__.INITIAL_ICON_SET_NAME; this.allIconDictionary = allIconDictionary; } /** @@ -67844,18 +66488,18 @@ class IconConfiguration { newAppendedIcons[name] = workObjectsDict.get(name); } }); - const appen = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + const appen = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); Object.keys(newAppendedIcons).forEach(key => { appen.set(key, newAppendedIcons[key]); }); - (0,src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_1__.overrideAppendedIcons)(appen); + (0,src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_1__.updateAppendedIcons)(appen); } createCustomConf(iconSetConfiguration) { this.domainName = iconSetConfiguration.name; let actors = iconSetConfiguration.actors; let workObjects = iconSetConfiguration.workObjects; this.appendSRCFile(actors.keysArray(), actors, workObjects.keysArray(), workObjects); - return new src_app_Domain_Common_configuration__WEBPACK_IMPORTED_MODULE_2__.Configuration(actors.keysArray(), workObjects.keysArray()); + return new src_app_domain_entities_configuration__WEBPACK_IMPORTED_MODULE_2__.Configuration(actors.keysArray(), workObjects.keysArray()); } } /* eslint no-unused-vars: 0*/ @@ -67878,10 +66522,10 @@ const defaultConf = { /***/ }), -/***/ 36105: -/*!*****************************************************************!*\ - !*** ./src/app/Domain/Icon-Set-Configuration/iconFilterEnum.ts ***! - \*****************************************************************/ +/***/ 87831: +/*!****************************************************************!*\ + !*** ./src/app/tools/icon-set-config/domain/iconFilterEnum.ts ***! + \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -67899,225 +66543,248 @@ var IconFilterEnum = /*#__PURE__*/function (IconFilterEnum) { /***/ }), -/***/ 77044: -/*!***********************************************************************!*\ - !*** ./src/app/Domain/Icon-Set-Configuration/iconSetConfiguration.ts ***! - \***********************************************************************/ +/***/ 21135: +/*!*****************************************************************************************************!*\ + !*** ./src/app/tools/icon-set-config/presentation/details-list-item/details-list-item.component.ts ***! + \*****************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ fromConfigurationFromFile: () => (/* binding */ fromConfigurationFromFile), -/* harmony export */ testCustomIconSetConfiguration: () => (/* binding */ testCustomIconSetConfiguration) +/* harmony export */ DetailsListItemComponent: () => (/* binding */ DetailsListItemComponent) /* harmony export */ }); -/* harmony import */ var _Common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Common/constants */ 90816); -/* harmony import */ var _Common_businessObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/businessObject */ 78828); -/* harmony import */ var _Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/elementTypes */ 30236); -/* harmony import */ var _Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/dictionary/dictionary */ 54972); - - +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/material/form-field */ 29344); -const actor = structuredClone(_Common_businessObject__WEBPACK_IMPORTED_MODULE_1__.testBusinessObject); -actor.type = _Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR; -const testCustomIconSetConfiguration = { - name: _Common_constants__WEBPACK_IMPORTED_MODULE_0__.INITIAL_ICON_SET_NAME, - actors: ['Person'], - workObjects: ['Document'] -}; -function fromConfigurationFromFile(configFromFile) { - const actorsDict = new _Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_3__.Dictionary(); - const workObjectsDict = new _Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_3__.Dictionary(); - Object.keys(configFromFile.actors).forEach(key => { - let icon = configFromFile.actors[key]; - if (icon) { - // make sure the actor has an icon - actorsDict.add(icon, key); +let DetailsListItemComponent = /*#__PURE__*/(() => { + class DetailsListItemComponent { + constructor() { + this.iconInitiated = false; } - }); - Object.keys(configFromFile.workObjects).forEach(key => { - let icon = configFromFile.workObjects[key]; - if (icon) { - // make sure the work object has an icon - workObjectsDict.add(icon, key); + get id() { + return 'domain-configuration-details-icon-' + this.icon.name.toLowerCase() + '-' + (this.icon.isWorkObject ? 'workobject' : 'actor'); } - }); - return { - name: configFromFile.name, - actors: actorsDict, - workObjects: workObjectsDict - }; -} - -/***/ }), - -/***/ 90684: -/*!*****************************************************!*\ - !*** ./src/app/Modules/autosave-settings.module.ts ***! - \*****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AutosaveSettingsModule: () => (/* binding */ AutosaveSettingsModule) -/* harmony export */ }); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var _Presentation_Autosave_AutosaveSettings_autosave_settings_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Presentation/Autosave/AutosaveSettings/autosave-settings.component */ 94709); -/* harmony import */ var _Presentation_Autosave_AutosaveOptions_autosave_options_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Presentation/Autosave/AutosaveOptions/autosave-options.component */ 47893); -/* harmony import */ var _Presentation_Autosave_AutosavedDrafts_autosaved_drafts_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Presentation/Autosave/AutosavedDrafts/autosaved-drafts.component */ 39083); -/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/forms */ 37222); -/* harmony import */ var _material_module__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../material.module */ 89439); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 2978); - - - - - - - -let AutosaveSettingsModule = /*#__PURE__*/(() => { - class AutosaveSettingsModule { - static #_ = this.ɵfac = function AutosaveSettingsModule_Factory(t) { - return new (t || AutosaveSettingsModule)(); + get name() { + return this.icon.name; + } + ngAfterViewChecked() { + this.createIcon(); + } + createIcon() { + const img = document.getElementById(this.id); + if (img && !this.iconInitiated) { + img.src = '' + this.icon.svg; + this.iconInitiated = true; + } + } + static #_ = this.ɵfac = function DetailsListItemComponent_Factory(t) { + return new (t || DetailsListItemComponent)(); }; - static #_2 = this.ɵmod = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineNgModule"]({ - type: AutosaveSettingsModule - }); - static #_3 = this.ɵinj = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjector"]({ - imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_6__.FormsModule, _material_module__WEBPACK_IMPORTED_MODULE_3__.MaterialModule] + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ + type: DetailsListItemComponent, + selectors: [["app-details-list-item"]], + inputs: { + icon: "icon" + }, + decls: 4, + vars: 4, + consts: [[1, "detailsListItem"], [1, "icon", 3, "id", "alt", "src"], [1, "iconName"]], + template: function DetailsListItemComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](1, "img", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "mat-label", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](3); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpropertyInterpolate"]("id", ctx.id); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpropertyInterpolate"]("alt", ctx.name); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", ctx.icon.svg, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeUrl"]); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](ctx.icon.name); + } + }, + dependencies: [_angular_material_form_field__WEBPACK_IMPORTED_MODULE_1__.MatLabel], + styles: [".icon[_ngcontent-%COMP%] {\n width: 20px;\n height: 20px;\n padding-right: 3px;\n}\n\n.detailsListItem[_ngcontent-%COMP%] {\n display: flex;\n justify-items: center;\n align-items: center;\n width: 250px;\n}\n\n.iconName[_ngcontent-%COMP%] {\n max-width: 225px;\n word-wrap: anywhere;\n white-space: pre-wrap !important;\n}"] }); } - return AutosaveSettingsModule; -})(); -(function () { - (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵsetNgModuleScope"](AutosaveSettingsModule, { - declarations: [_Presentation_Autosave_AutosaveSettings_autosave_settings_component__WEBPACK_IMPORTED_MODULE_0__.AutosaveSettingsComponent, _Presentation_Autosave_AutosaveOptions_autosave_options_component__WEBPACK_IMPORTED_MODULE_1__.AutosaveOptionsComponent, _Presentation_Autosave_AutosavedDrafts_autosaved_drafts_component__WEBPACK_IMPORTED_MODULE_2__.AutosavedDraftsComponent], - imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_6__.FormsModule, _material_module__WEBPACK_IMPORTED_MODULE_3__.MaterialModule], - exports: [_Presentation_Autosave_AutosaveSettings_autosave_settings_component__WEBPACK_IMPORTED_MODULE_0__.AutosaveSettingsComponent] - }); + return DetailsListItemComponent; })(); /***/ }), -/***/ 76330: -/*!***************************************************************!*\ - !*** ./src/app/Modules/domain-story-modeler-module.module.ts ***! - \***************************************************************/ +/***/ 10665: +/*!***********************************************************************************************!*\ + !*** ./src/app/tools/icon-set-config/presentation/icon-list-item/icon-list-item.component.ts ***! + \***********************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ DomainStoryModelerModuleModule: () => (/* binding */ DomainStoryModelerModuleModule) +/* harmony export */ IconListItemComponent: () => (/* binding */ IconListItemComponent) /* harmony export */ }); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var _Presentation_Header_components_header_buttons_header_buttons_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Presentation/Header/components/header-buttons/header-buttons.component */ 9432); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 95981); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _services_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/icon-set-customization.service */ 46252); +/* harmony import */ var _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/button-toggle */ 26470); -let DomainStoryModelerModuleModule = /*#__PURE__*/(() => { - class DomainStoryModelerModuleModule { - static #_ = this.ɵfac = function DomainStoryModelerModuleModule_Factory(t) { - return new (t || DomainStoryModelerModuleModule)(); - }; - static #_2 = this.ɵmod = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ - type: DomainStoryModelerModuleModule - }); - static #_3 = this.ɵinj = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ - imports: [_angular_common__WEBPACK_IMPORTED_MODULE_2__.CommonModule] + +let IconListItemComponent = /*#__PURE__*/(() => { + class IconListItemComponent { + get name() { + return this.iconName; + } + get id() { + return 'domain-configuration-icon-' + this.iconName; + } + constructor(iconSetCustomizationService) { + this.iconSetCustomizationService = iconSetCustomizationService; + this.iconName = ''; + this.iconInitiated = false; + // @ts-ignore + this.icon = new rxjs__WEBPACK_IMPORTED_MODULE_1__.BehaviorSubject({}); + this.isActor = false; + this.isWorkobject = false; + this.isNone = true; + } + ngOnInit() { + this.icon = this.iconSetCustomizationService.getIconForName(this.iconName); + if (!this.icon) { + return; + } + this.icon.subscribe(value => { + this.isActor = value.isActor; + this.isWorkobject = value.isWorkObject; + this.isNone = !(value.isActor || value.isWorkObject); + }); + this.isActor = this.icon.value.isActor; + this.isWorkobject = this.icon.value.isWorkObject; + this.isNone = !(this.icon.value.isActor || this.icon.value.isWorkObject); + } + ngAfterViewChecked() { + this.createIcon(); + } + createIcon() { + const img = document.getElementById(this.id); + if (img && !this.iconInitiated) { + img.src = '' + this.icon?.value?.svg; + this.iconInitiated = true; + } + } + toggleNone() { + this.iconSetCustomizationService.setAsUnassigned(this.iconName, this.icon.value.isActor); + } + toggleActor() { + this.iconSetCustomizationService.setAsActor(true, this.iconName); + } + toggleWorkobject() { + this.iconSetCustomizationService.setAsWorkobject(true, this.iconName); + } + static #_ = this.ɵfac = function IconListItemComponent_Factory(t) { + return new (t || IconListItemComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_services_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_0__.IconSetCustomizationService)); + }; + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ + type: IconListItemComponent, + selectors: [["app-icon-list-item"]], + inputs: { + iconName: "iconName" + }, + decls: 16, + vars: 13, + consts: [[1, "content"], ["src", "", 1, "icon", 3, "id", "alt"], [1, "name"], [1, "footer"], [3, "change", "value", "checked"], [1, "toggleButtonTitle"]], + template: function IconListItemComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "div")(1, "div", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](2, "img", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](3, "div", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](5, "div", 3)(6, "mat-button-toggle-group")(7, "mat-button-toggle", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("change", function IconListItemComponent_Template_mat_button_toggle_change_7_listener() { + return ctx.toggleNone(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](8, "span", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](9, "None"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](10, "mat-button-toggle", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("change", function IconListItemComponent_Template_mat_button_toggle_change_10_listener() { + return ctx.toggleActor(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](11, "span", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](12, "Actor"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](13, "mat-button-toggle", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("change", function IconListItemComponent_Template_mat_button_toggle_change_13_listener() { + return ctx.toggleWorkobject(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](14, "span", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](15, "Workobject"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()()()()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵpropertyInterpolate"]("id", ctx.id); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵpropertyInterpolate"]("alt", ctx.name); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtextInterpolate"](ctx.name); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("value", ctx.isNone)("checked", ctx.isNone); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵclassProp"]("activeMatButtonActor", ctx.isActor); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("value", ctx.isActor)("checked", ctx.isActor); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵclassProp"]("activeMatButtonWorkObject", ctx.isWorkobject); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("value", ctx.isWorkobject)("checked", ctx.isWorkobject); + } + }, + dependencies: [_angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_3__.MatButtonToggleGroup, _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_3__.MatButtonToggle], + styles: [".content[_ngcontent-%COMP%] {\n display: grid;\n grid-template-rows: auto auto;\n justify-items: center;\n}\n\n.icon[_ngcontent-%COMP%] {\n width: 50px;\n height: 50px;\n}\n\n.name[_ngcontent-%COMP%] {\n word-wrap: anywhere;\n max-height: 75px;\n overflow: hidden;\n padding-bottom: 2px;\n}\n\n.footer[_ngcontent-%COMP%] {\n display: flex;\n justify-content: center;\n}\n.footer[_ngcontent-%COMP%] .mat-button-toggle-label-content {\n font-size: 10pt !important;\n padding: 0 5px !important;\n line-height: inherit !important;\n}\n.footer[_ngcontent-%COMP%] .activeMatButtonActor button {\n background-color: #43acbf;\n color: #ffffff;\n}\n.footer[_ngcontent-%COMP%] .activeMatButtonWorkObject button {\n background-color: #0168b7;\n color: #ffffff;\n}"] }); } - return DomainStoryModelerModuleModule; -})(); -(function () { - (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsetNgModuleScope"](DomainStoryModelerModuleModule, { - declarations: [_Presentation_Header_components_header_buttons_header_buttons_component__WEBPACK_IMPORTED_MODULE_0__.HeaderButtonsComponent], - imports: [_angular_common__WEBPACK_IMPORTED_MODULE_2__.CommonModule], - exports: [_Presentation_Header_components_header_buttons_header_buttons_component__WEBPACK_IMPORTED_MODULE_0__.HeaderButtonsComponent] - }); + return IconListItemComponent; })(); /***/ }), -/***/ 47261: -/*!********************************************!*\ - !*** ./src/app/Modules/settings.module.ts ***! - \********************************************/ +/***/ 26103: +/*!***************************************************************************************************************!*\ + !*** ./src/app/tools/icon-set-config/presentation/icon-set-configuration/icon-set-configuration.component.ts ***! + \***************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ SettingsModule: () => (/* binding */ SettingsModule) +/* harmony export */ IconSetConfigurationComponent: () => (/* binding */ IconSetConfigurationComponent) /* harmony export */ }); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var src_app_Presentation_DomainConfiguration_icon_set_configuration_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Presentation/DomainConfiguration/icon-set-configuration.component */ 38574); -/* harmony import */ var _Presentation_DomainConfiguration_icon_list_item_icon_list_item_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Presentation/DomainConfiguration/icon-list-item/icon-list-item.component */ 58414); -/* harmony import */ var _Presentation_DomainConfiguration_details_list_item_details_list_item_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Presentation/DomainConfiguration/details-list-item/details-list-item.component */ 62748); -/* harmony import */ var _Presentation_DomainConfiguration_icon_set_details_icon_set_details_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Presentation/DomainConfiguration/icon-set-details/icon-set-details.component */ 79052); -/* harmony import */ var _Presentation_Settings_General_general_settings_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Presentation/Settings/General/general-settings.component */ 423); -/* harmony import */ var _Presentation_LabelDictionary_label_dictionary_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Presentation/LabelDictionary/label-dictionary.component */ 86328); -/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/forms */ 37222); -/* harmony import */ var _material_module__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../material.module */ 89439); -/* harmony import */ var _autosave_settings_module__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./autosave-settings.module */ 90684); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/core */ 2978); - - - - - - - +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs */ 95981); +/* harmony import */ var src_app_tools_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/tools/icon-set-config/services/icon-dictionary.service */ 6932); +/* harmony import */ var src_app_utils_sanitizer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/utils/sanitizer */ 43515); +/* harmony import */ var _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../domain/entities/elementTypes */ 73190); +/* harmony import */ var _domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../domain/iconFilterEnum */ 87831); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_tools_icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/tools/icon-set-config/services/icon-set-configuration.service */ 46527); +/* harmony import */ var _services_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../services/icon-set-customization.service */ 46252); +/* harmony import */ var src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/domain/services/element-registry.service */ 85511); +/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/button */ 72221); +/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/material/input */ 92583); +/* harmony import */ var _icon_list_item_icon_list_item_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../icon-list-item/icon-list-item.component */ 10665); +/* harmony import */ var _icon_set_details_icon_set_details_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../icon-set-details/icon-set-details.component */ 31415); +/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/common */ 56610); -let SettingsModule = /*#__PURE__*/(() => { - class SettingsModule { - static #_ = this.ɵfac = function SettingsModule_Factory(t) { - return new (t || SettingsModule)(); - }; - static #_2 = this.ɵmod = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdefineNgModule"]({ - type: SettingsModule - }); - static #_3 = this.ɵinj = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdefineInjector"]({ - imports: [_autosave_settings_module__WEBPACK_IMPORTED_MODULE_7__.AutosaveSettingsModule, _angular_common__WEBPACK_IMPORTED_MODULE_9__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_10__.FormsModule, _material_module__WEBPACK_IMPORTED_MODULE_6__.MaterialModule] - }); - } - return SettingsModule; -})(); -(function () { - (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵsetNgModuleScope"](SettingsModule, { - declarations: [src_app_Presentation_DomainConfiguration_icon_set_configuration_component__WEBPACK_IMPORTED_MODULE_0__.IconSetConfigurationComponent, _Presentation_Settings_General_general_settings_component__WEBPACK_IMPORTED_MODULE_4__.GeneralSettingsComponent, _Presentation_LabelDictionary_label_dictionary_component__WEBPACK_IMPORTED_MODULE_5__.LabelDictionaryComponent, _Presentation_DomainConfiguration_icon_list_item_icon_list_item_component__WEBPACK_IMPORTED_MODULE_1__.IconListItemComponent, _Presentation_DomainConfiguration_details_list_item_details_list_item_component__WEBPACK_IMPORTED_MODULE_2__.DetailsListItemComponent, _Presentation_DomainConfiguration_icon_set_details_icon_set_details_component__WEBPACK_IMPORTED_MODULE_3__.IconSetDetailsComponent], - imports: [_autosave_settings_module__WEBPACK_IMPORTED_MODULE_7__.AutosaveSettingsModule, _angular_common__WEBPACK_IMPORTED_MODULE_9__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_10__.FormsModule, _material_module__WEBPACK_IMPORTED_MODULE_6__.MaterialModule], - exports: [_Presentation_Settings_General_general_settings_component__WEBPACK_IMPORTED_MODULE_4__.GeneralSettingsComponent, src_app_Presentation_DomainConfiguration_icon_set_configuration_component__WEBPACK_IMPORTED_MODULE_0__.IconSetConfigurationComponent, _Presentation_LabelDictionary_label_dictionary_component__WEBPACK_IMPORTED_MODULE_5__.LabelDictionaryComponent] - }); -})(); -/***/ }), -/***/ 47893: -/*!*************************************************************************************!*\ - !*** ./src/app/Presentation/Autosave/AutosaveOptions/autosave-options.component.ts ***! - \*************************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AutosaveOptionsComponent: () => (/* binding */ AutosaveOptionsComponent) -/* harmony export */ }); -/* harmony import */ var src_app_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/constants */ 90816); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _Service_Autosave_autosave_configuration_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Service/Autosave/autosave-configuration.service */ 97237); -/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/button */ 72221); -/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/form-field */ 29344); -/* harmony import */ var _angular_material_card__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/card */ 90643); @@ -68126,157 +66793,289 @@ __webpack_require__.r(__webpack_exports__); -function AutosaveOptionsComponent_mat_card_0_Template(rf, ctx) { +function IconSetConfigurationComponent_For_44_Template(rf, ctx) { if (rf & 1) { - const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "mat-card")(1, "mat-card-header")(2, "mat-card-title"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](3, "Autosave Options"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](4, "mat-card-content", 4)(5, "div", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](6, "input", 6, 0); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](8, "mat-label"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](9, "Enabled"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](10, "div", 7)(11, "mat-label"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](12, "Interval [sec]"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](13, "input", 8, 1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](15, "div", 7)(16, "mat-label"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](17, "Max. Drafts"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](18, "input", 8, 2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](20, "button", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function AutosaveOptionsComponent_mat_card_0_Template_button_click_20_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵrestoreView"](_r1); - const activated_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵreference"](7); - const interval_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵreference"](14); - const drafts_r4 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵreference"](19); - const ctx_r4 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresetView"](ctx_r4.save(activated_r2.checked, +drafts_r4.value, +interval_r3.value)); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](21, " Apply "); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()()(); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelement"](0, "app-icon-list-item", 19); } if (rf & 2) { - const configuration_r6 = ctx.ngIf; - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](6); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("checked", configuration_r6.activated); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](7); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("value", configuration_r6.interval); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](5); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("value", configuration_r6.maxDrafts); + const iconName_r1 = ctx.$implicit; + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵproperty"]("iconName", iconName_r1); } } -let AutosaveOptionsComponent = /*#__PURE__*/(() => { - class AutosaveOptionsComponent { - constructor(autosaveConfiguration, snackbar) { - this.autosaveConfiguration = autosaveConfiguration; - this.snackbar = snackbar; +let IconSetConfigurationComponent = /*#__PURE__*/(() => { + class IconSetConfigurationComponent { + constructor(iconSetConfigurationService, iconDictionaryService, iconSetCustomizationService, elementRegistryService) { + this.iconSetConfigurationService = iconSetConfigurationService; + this.iconDictionaryService = iconDictionaryService; + this.iconSetCustomizationService = iconSetCustomizationService; + this.elementRegistryService = elementRegistryService; + this.filter = new rxjs__WEBPACK_IMPORTED_MODULE_10__.BehaviorSubject(_domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_NONE); + this.selectedActors = new rxjs__WEBPACK_IMPORTED_MODULE_10__.BehaviorSubject([]); + this.selectedWorkobjects = new rxjs__WEBPACK_IMPORTED_MODULE_10__.BehaviorSubject([]); + this.allIconNames = new rxjs__WEBPACK_IMPORTED_MODULE_10__.BehaviorSubject([]); + this.allFilteredIconNames = new rxjs__WEBPACK_IMPORTED_MODULE_10__.BehaviorSubject([]); + this.iconSetConfigurationTypes = this.iconSetCustomizationService.getIconSetConfiguration().value; + this.allIcons = new rxjs__WEBPACK_IMPORTED_MODULE_10__.BehaviorSubject(this.iconDictionaryService.getFullDictionary()); + this.allIcons.subscribe(allIcons => { + this.allIconNames.next(allIcons.keysArray().sort(this.sortByName)); + }); + this.selectedActors = this.iconSetCustomizationService.selectedActors$; + this.selectedWorkobjects = this.iconSetCustomizationService.selectedWorkobjects$; } - save(activated, maxDrafts, interval) { - if (this.autosaveConfiguration.setConfiguration({ - activated, - maxDrafts, - interval - })) { - this.snackbar.open('Settings for Autosave saved', undefined, { - duration: src_app_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION, - panelClass: src_app_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_SUCCESS - }); - } else { - this.snackbar.open('Unable to save settings for Autosave - please try again', undefined, { - duration: 2 * src_app_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION, - panelClass: src_app_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_ERROR - }); - } + ngOnInit() { + this.filter.subscribe(type => { + let allFiltered = this.getFilteredNamesForType(type); + this.allFilteredIconNames.next(allFiltered.sort(this.sortByName)); + }); } - static #_ = this.ɵfac = function AutosaveOptionsComponent_Factory(t) { - return new (t || AutosaveOptionsComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_Service_Autosave_autosave_configuration_service__WEBPACK_IMPORTED_MODULE_1__.AutosaveConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_3__.MatSnackBar)); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ - type: AutosaveOptionsComponent, - selectors: [["app-autosave-options"]], - decls: 2, - vars: 3, - consts: [["activated", ""], ["interval", ""], ["drafts", ""], [4, "ngIf"], [1, "cardContent"], [1, "alignSelfCenter"], ["type", "checkbox", 3, "checked"], [1, "inputContainer"], ["min", "1", "type", "number", 1, "numberInput", 3, "value"], ["mat-raised-button", "", "color", "primary", 1, "saveButton", 3, "click"]], - template: function AutosaveOptionsComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtemplate"](0, AutosaveOptionsComponent_mat_card_0_Template, 22, 3, "mat-card", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵpipe"](1, "async"); - } - if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵpipeBind1"](1, 1, ctx.autosaveConfiguration.configuration$)); - } - }, - dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_4__.NgIf, _angular_material_button__WEBPACK_IMPORTED_MODULE_5__.MatButton, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatLabel, _angular_material_card__WEBPACK_IMPORTED_MODULE_7__.MatCard, _angular_material_card__WEBPACK_IMPORTED_MODULE_7__.MatCardContent, _angular_material_card__WEBPACK_IMPORTED_MODULE_7__.MatCardHeader, _angular_material_card__WEBPACK_IMPORTED_MODULE_7__.MatCardTitle, _angular_common__WEBPACK_IMPORTED_MODULE_4__.AsyncPipe], - styles: [".autosaveEnabled[_ngcontent-%COMP%], .autosaveInterval[_ngcontent-%COMP%] {\n display: inline-grid;\n grid-template-columns: 120px auto;\n width: 300px;\n grid-row-gap: 5px;\n height: 20px;\n}\n\n.enableButton[_ngcontent-%COMP%] {\n justify-self: start;\n}\n\n.autosaveEnabled[_ngcontent-%COMP%] {\n padding-bottom: 2px;\n}\n\n.autosaveInterval[_ngcontent-%COMP%] {\n padding-bottom: 10px;\n}\n\n.autosaveIntervalSpan[_ngcontent-%COMP%] {\n padding-top: 2px;\n justify-self: start;\n}\n\n.saveButton[_ngcontent-%COMP%] {\n align-self: end;\n right: 0;\n margin-left: -5px;\n}\n\n.cardContent[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n}\n\n.inputContainer[_ngcontent-%COMP%] {\n display: inline-grid;\n width: -moz-fit-content;\n width: fit-content;\n}\n\n.numberInput[_ngcontent-%COMP%] {\n justify-self: end;\n width: 64px;\n}\n\n.alignSelfCenter[_ngcontent-%COMP%] {\n align-self: center;\n}"] - }); - } - return AutosaveOptionsComponent; -})(); - -/***/ }), - -/***/ 94709: -/*!***************************************************************************************!*\ - !*** ./src/app/Presentation/Autosave/AutosaveSettings/autosave-settings.component.ts ***! - \***************************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AutosaveSettingsComponent: () => (/* binding */ AutosaveSettingsComponent) -/* harmony export */ }); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _AutosaveOptions_autosave_options_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../AutosaveOptions/autosave-options.component */ 47893); -/* harmony import */ var _AutosavedDrafts_autosaved_drafts_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AutosavedDrafts/autosaved-drafts.component */ 39083); - - - -let AutosaveSettingsComponent = /*#__PURE__*/(() => { - class AutosaveSettingsComponent { - static #_ = this.ɵfac = function AutosaveSettingsComponent_Factory(t) { - return new (t || AutosaveSettingsComponent)(); + sortByName(a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()); + } + /** Default Icon Set **/ + loadMinimalIconConfigurationWithDefaultIcons() { + this.iconSetCustomizationService.resetIconSet(); + } + loadInitialConfiguration() { + this.iconSetCustomizationService.cancel(); + } + /** Persist Icon Set **/ + saveIconSet() { + this.iconSetCustomizationService.saveIconSet(this.elementRegistryService.getUsedIcons()); + } + exportIconSet() { + this.iconSetCustomizationService.exportIconSet(); + } + /** Add Custom Icon **/ + startIconUpload() { + document.getElementById('importIcon')?.click(); + } + importIcon() { + // @ts-ignore + const files = document.getElementById('importIcon').files; + for (let iconInputFile of files) { + const reader = new FileReader(); + const name = (0,src_app_utils_sanitizer__WEBPACK_IMPORTED_MODULE_1__.sanitizeIconName)(iconInputFile.name); + const iconName = name + '-custom'; // this suffix helps users to see which icons they uploaded; it should not be used to check if an icon is actually custom or not since this convention was introduce after v1.3.0 and is therefore not reliable information + reader.onloadend = e => { + if (e.target) { + const src = e.target.result; + this.iconDictionaryService.addIMGToIconDictionary(src, iconName); + // TODO: td: What kind of type is it here? + this.iconDictionaryService.registerIconForBPMN(iconName, src_app_tools_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_0__.ICON_PREFIX + iconName.toLowerCase(), _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR); + this.allIcons.next(this.iconDictionaryService.getFullDictionary()); + this.filter.next(this.filter.value); + this.iconSetCustomizationService.addNewIcon(iconName); + } + }; + reader.readAsDataURL(iconInputFile); + } + } + /** Import Icon Set **/ + startIconSetImport() { + document.getElementById('importDomain')?.click(); + } + importIconSet() { + // @ts-ignore + const iconSetInputFile = document.getElementById('importDomain').files[0]; + const reader = new FileReader(); + reader.onloadend = e => { + const configFromFile = JSON.parse(e.target?.result); + const config = this.iconSetConfigurationService.createIconSetConfiguration(configFromFile); + this.iconSetConfigurationService.loadConfiguration(config, false); + this.iconSetCustomizationService.importConfiguration(config); + this.allIcons.next(this.iconDictionaryService.getFullDictionary()); + this.filter.next(this.filter.value); + }; + reader.readAsText(iconSetInputFile); + } + /** Filter **/ + filterForActors() { + if (this.filter.value !== _domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_ACTOR) { + this.filter.next(_domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_ACTOR); + } else { + this.filter.next(_domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_NONE); + } + } + filterForWorkobjects() { + if (this.filter.value !== _domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_WORKOBJECT) { + this.filter.next(_domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_WORKOBJECT); + } else { + this.filter.next(_domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_NONE); + } + } + filterForUnassigned() { + if (this.filter.value !== _domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_UNASSIGNED) { + this.filter.next(_domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_UNASSIGNED); + } else { + this.filter.next(_domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_NONE); + } + } + filterByNameAndType($event) { + const filteredByNameAndType = this.getFilteredNamesForType(this.filter.value).filter(name => name.toLowerCase().includes($event.target.value.toLowerCase())); + this.allFilteredIconNames.next(filteredByNameAndType.sort(this.sortByName)); + } + getFilteredNamesForType(type) { + let allFiltered = []; + switch (type) { + case _domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_NONE: + allFiltered = this.allIconNames.value; + break; + case _domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_ACTOR: + allFiltered = this.allIconNames.value.filter(name => this.iconSetCustomizationService.isIconActor(name)); + break; + case _domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_WORKOBJECT: + allFiltered = this.allIconNames.value.filter(name => this.iconSetCustomizationService.isIconWorkObject(name)); + break; + case _domain_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_UNASSIGNED: + allFiltered = this.allIconNames.value.filter(name => !this.iconSetCustomizationService.isIconActor(name) && !this.iconSetCustomizationService.isIconWorkObject(name)); + break; + } + return allFiltered; + } + static #_ = this.ɵfac = function IconSetConfigurationComponent_Factory(t) { + return new (t || IconSetConfigurationComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵdirectiveInject"](src_app_tools_icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_4__.IconSetConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵdirectiveInject"](src_app_tools_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_0__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵdirectiveInject"](_services_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_5__.IconSetCustomizationService), _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵdirectiveInject"](src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_6__.ElementRegistryService)); }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ - type: AutosaveSettingsComponent, - selectors: [["app-autosave-settings"]], - decls: 2, - vars: 0, - template: function AutosaveSettingsComponent_Template(rf, ctx) { + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵdefineComponent"]({ + type: IconSetConfigurationComponent, + selectors: [["app-icon-set-configuration"]], + decls: 47, + vars: 14, + consts: [[1, "content"], [1, "header"], [1, "searchbar"], ["mat-button", "", "title", "Unassigned Icons", 3, "click"], ["mat-button", "", "title", "Actors", 3, "click"], ["mat-button", "", "title", "Workobjects", 3, "click"], ["matInput", "", "type", "text", "placeholder", "Filter by name", 1, "textInput", 3, "input"], [1, "buttons"], ["mat-button", "", "title", "Upload Icon", 3, "click"], [1, "material-icons-outlined", "materialIconButton"], ["type", "file", "multiple", "", "accept", ".svg, image/png, image/jpeg, image/gif, image/bpmn", "id", "importIcon", "name", "file", "onclick", "this.value=null", 2, "display", "none", 3, "change"], ["mat-button", "", "title", "Reset to default icon set", 1, "button", 3, "click"], ["mat-button", "", "title", "Cancel changes", 3, "click"], [1, "divider"], ["mat-button", "", "title", "Save icon set", 3, "click"], ["mat-button", "", "title", "Import icon set", 3, "click"], ["type", "file", "accept", ".domain, .iconset", "id", "importDomain", "name", "file", "onclick", "this.value=null", 2, "display", "none", 3, "change"], ["mat-button", "", "title", "Export icon set", 3, "click"], [1, "iconList", "smallScrollbar"], [3, "iconName"], [1, "iconSetDetails"]], + template: function IconSetConfigurationComponent_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](0, "app-autosave-options")(1, "app-autosaved-drafts"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](0, "div", 0)(1, "div")(2, "div", 1)(3, "div", 2)(4, "div"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](5, "Filter by assignment:"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](6, "button", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](7, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_6_listener() { + return ctx.filterForUnassigned(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](8, "span"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](9, "None"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](10, "button", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](11, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_10_listener() { + return ctx.filterForActors(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](12, "span"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](13, "Actors"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](14, "button", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](15, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_14_listener() { + return ctx.filterForWorkobjects(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](16, "span"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](17, "Workobjects"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](18, "input", 6); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("input", function IconSetConfigurationComponent_Template_input_input_18_listener($event) { + return ctx.filterByNameAndType($event); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](19, "div", 7)(20, "button", 8); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_20_listener() { + return ctx.startIconUpload(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](21, "span", 9); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](22, "upload"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](23, "input", 10); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("change", function IconSetConfigurationComponent_Template_input_change_23_listener() { + return ctx.importIcon(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](24, "button", 11); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_24_listener() { + return ctx.loadMinimalIconConfigurationWithDefaultIcons(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](25, "span", 9); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](26, " home "); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](27, "button", 12); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_27_listener() { + return ctx.loadInitialConfiguration(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](28, "span", 9); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](29, "close"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelement"](30, "div", 13); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](31, "button", 14); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_31_listener() { + return ctx.saveIconSet(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](32, "span", 9); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](33, "save"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelement"](34, "div", 13); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](35, "button", 15); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_35_listener() { + return ctx.startIconSetImport(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](36, "span", 9); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](37, "unarchive"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](38, "input", 16); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("change", function IconSetConfigurationComponent_Template_input_change_38_listener() { + return ctx.importIconSet(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](39, "button", 17); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_39_listener() { + return ctx.exportIconSet(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](40, "span", 9); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](41, "archive"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()()()(); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](42, "div", 18); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵrepeaterCreate"](43, IconSetConfigurationComponent_For_44_Template, 1, 1, "app-icon-list-item", 19, _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵrepeaterTrackByIdentity"]); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](45, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelement"](46, "app-icon-set-details", 20); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"](); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵadvance"](6); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵclassProp"]("activeNone", _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](7, 6, ctx.filter) === "ICON_FILTER_UNASSIGNED"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵadvance"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵclassProp"]("activeActor", _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](11, 8, ctx.filter) === "ICON_FILTER_ACTOR"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵadvance"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵclassProp"]("activeWorkObject", _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](15, 10, ctx.filter) === "ICON_FILTER_WORKOBJECT"); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵadvance"](29); + _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵrepeater"](_angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](45, 12, ctx.allFilteredIconNames)); } }, - dependencies: [_AutosaveOptions_autosave_options_component__WEBPACK_IMPORTED_MODULE_0__.AutosaveOptionsComponent, _AutosavedDrafts_autosaved_drafts_component__WEBPACK_IMPORTED_MODULE_1__.AutosavedDraftsComponent] + dependencies: [_angular_material_button__WEBPACK_IMPORTED_MODULE_11__.MatButton, _angular_material_input__WEBPACK_IMPORTED_MODULE_12__.MatInput, _icon_list_item_icon_list_item_component__WEBPACK_IMPORTED_MODULE_7__.IconListItemComponent, _icon_set_details_icon_set_details_component__WEBPACK_IMPORTED_MODULE_8__.IconSetDetailsComponent, _angular_common__WEBPACK_IMPORTED_MODULE_13__.AsyncPipe], + styles: [".content[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: auto 250px;\n}\n\n.header[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: max-content auto;\n height: 46px;\n border-bottom: #ccc 2px solid;\n}\n\n.searchbar[_ngcontent-%COMP%] {\n display: inline-flex;\n margin-left: 15px;\n margin-right: 15px;\n align-self: center;\n align-items: center;\n justify-self: left;\n height: inherit;\n border-right: #ccc 2px solid;\n}\n\n.buttons[_ngcontent-%COMP%] {\n display: inline-flex;\n align-self: center;\n align-items: center;\n justify-self: right;\n height: inherit;\n}\n.buttons[_ngcontent-%COMP%] .mat-button {\n min-width: 36px;\n}\n\n.divider[_ngcontent-%COMP%] {\n border-left: #ccc 2px solid;\n height: inherit;\n}\n\n.button[_ngcontent-%COMP%] {\n width: 36px;\n}\n\n.mat-button[_ngcontent-%COMP%] {\n color: #666666;\n}\n\n.activeActor[_ngcontent-%COMP%] {\n background-color: #42aebb;\n color: white;\n}\n\n.activeNone[_ngcontent-%COMP%] {\n background-color: #e0e0e0;\n color: black;\n}\n\n.activeWorkObject[_ngcontent-%COMP%] {\n background-color: #42aebb;\n color: white;\n}\n\n.textInput[_ngcontent-%COMP%] {\n width: 300px;\n margin-left: 15px;\n margin-right: 5px;\n border: #666666 1px solid;\n}\n\n.iconList[_ngcontent-%COMP%] {\n display: flex;\n overflow-y: scroll;\n height: calc(100vh - 130px);\n flex-direction: row;\n flex-wrap: wrap;\n align-content: baseline;\n margin-top: 1rem;\n margin-left: 1rem;\n gap: 1rem;\n}\n.iconList[_ngcontent-%COMP%] [_ngcontent-%COMP%]:nth-last-child(1) {\n margin-bottom: 1rem;\n}\n\n.iconSetDetails[_ngcontent-%COMP%] {\n width: 250px;\n}\n\n .mat-grid-tile .mat-grid-tile-content {\n justify-content: inherit;\n}"] }); } - return AutosaveSettingsComponent; + return IconSetConfigurationComponent; })(); /***/ }), -/***/ 39083: -/*!*************************************************************************************!*\ - !*** ./src/app/Presentation/Autosave/AutosavedDrafts/autosaved-drafts.component.ts ***! - \*************************************************************************************/ +/***/ 31415: +/*!***************************************************************************************************!*\ + !*** ./src/app/tools/icon-set-config/presentation/icon-set-details/icon-set-details.component.ts ***! + \***************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AutosavedDraftsComponent: () => (/* binding */ AutosavedDraftsComponent) +/* harmony export */ IconSetDetailsComponent: () => (/* binding */ IconSetDetailsComponent) /* harmony export */ }); -/* harmony import */ var src_app_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/constants */ 90816); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _Service_Autosave_autosave_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Service/Autosave/autosave.service */ 30534); -/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/button */ 72221); -/* harmony import */ var _angular_material_expansion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/expansion */ 71288); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_tools_icon_set_config_services_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/tools/icon-set-config/services/icon-set-customization.service */ 46252); +/* harmony import */ var src_app_tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/tools/title/services/title.service */ 41535); +/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/forms */ 37222); +/* harmony import */ var _angular_material_list__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/list */ 93901); +/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/form-field */ 29344); +/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/input */ 92583); +/* harmony import */ var _details_list_item_details_list_item_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../details-list-item/details-list-item.component */ 21135); +/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/common */ 56610); @@ -68284,377 +67083,473 @@ __webpack_require__.r(__webpack_exports__); -function AutosavedDraftsComponent_div_7_div_1_Template(rf, ctx) { + + +function IconSetDetailsComponent_For_12_Template(rf, ctx) { if (rf & 1) { - const _r2 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "div", 6)(1, "div")(2, "div", 7); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](3); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](4, "div", 8); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](5); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](6, "button", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function AutosavedDraftsComponent_div_7_div_1_Template_button_click_6_listener() { - const draft_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵrestoreView"](_r2).$implicit; - const ctx_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵnextContext"](2); - return _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresetView"](ctx_r3.loadDraft(draft_r3)); + const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](0, "mat-list-item", 9); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("dragover", function IconSetDetailsComponent_For_12_Template_mat_list_item_dragover_0_listener($event) { + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrestoreView"](_r1); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵresetView"](ctx_r1.allowDrop($event, "actorList")); + })("dragstart", function IconSetDetailsComponent_For_12_Template_mat_list_item_dragstart_0_listener() { + const i_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrestoreView"](_r1).$index; + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵresetView"](ctx_r1.onDragStart(i_r3, "actorList")); + })("drop", function IconSetDetailsComponent_For_12_Template_mat_list_item_drop_0_listener($event) { + const ctx_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrestoreView"](_r1); + const iconName_r5 = ctx_r3.$implicit; + const i_r3 = ctx_r3.$index; + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵresetView"](ctx_r1.onDrop($event, iconName_r5, true, i_r3)); }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](7, " Load Draft "); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelement"](1, "app-details-list-item", 10); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); } if (rf & 2) { - const draft_r3 = ctx.$implicit; - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtextInterpolate"](draft_r3.title); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtextInterpolate"](draft_r3.date); + const iconName_r5 = ctx.$implicit; + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("icon", ctx_r1.getIconForName(iconName_r5)); } } -function AutosavedDraftsComponent_div_7_Template(rf, ctx) { +function IconSetDetailsComponent_For_19_Template(rf, ctx) { if (rf & 1) { - const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "div", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtemplate"](1, AutosavedDraftsComponent_div_7_div_1_Template, 8, 2, "div", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](2, "div", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](3, "div"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](4, "button", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function AutosavedDraftsComponent_div_7_Template_button_click_4_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵrestoreView"](_r1); - const ctx_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresetView"](ctx_r3.removeAllDrafts()); + const _r6 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](0, "mat-list-item", 9); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("dragover", function IconSetDetailsComponent_For_19_Template_mat_list_item_dragover_0_listener($event) { + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrestoreView"](_r6); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵresetView"](ctx_r1.allowDrop($event, "workobjectList")); + })("dragstart", function IconSetDetailsComponent_For_19_Template_mat_list_item_dragstart_0_listener() { + const i_r7 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrestoreView"](_r6).$index; + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵresetView"](ctx_r1.onDragStart(i_r7, "workobjectList")); + })("drop", function IconSetDetailsComponent_For_19_Template_mat_list_item_drop_0_listener($event) { + const ctx_r7 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrestoreView"](_r6); + const iconName_r9 = ctx_r7.$implicit; + const i_r7 = ctx_r7.$index; + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵresetView"](ctx_r1.onDrop($event, iconName_r9, false, i_r7)); }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](5, " Remove All Drafts "); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()()(); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelement"](1, "app-details-list-item", 10); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); } if (rf & 2) { - const ctx_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵnextContext"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("ngForOf", ctx_r3.drafts); - } -} -function AutosavedDraftsComponent_ng_template_8_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](0, "No drafts found."); + const iconName_r9 = ctx.$implicit; + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("icon", ctx_r1.getIconForName(iconName_r9)); } } -let AutosavedDraftsComponent = /*#__PURE__*/(() => { - class AutosavedDraftsComponent { - constructor(autosaveService, snackbar) { - this.autosaveService = autosaveService; - this.snackbar = snackbar; - this.drafts = []; - this.subscription = this.autosaveService.autosavedDraftsChanged$.subscribe(() => this.initDrafts()); - } - ngOnInit() { - this.initDrafts(); +let IconSetDetailsComponent = /*#__PURE__*/(() => { + class IconSetDetailsComponent { + constructor(customizationService, titleService) { + this.customizationService = customizationService; + this.draggedList = ''; + this.draggedIndex = 0; + this.selectedActors$ = this.customizationService.selectedActors$; + this.selectedWorkobjects$ = this.customizationService.selectedWorkobjects$; + this.iconSetName = titleService.iconSetName$; } - initDrafts() { - this.drafts = this.autosaveService.loadCurrentDrafts(); + ngOnInit() {} + changeName(event) { + // @ts-ignore + this.customizationService.changeName(event.target.value); } - loadDraft(draft) { - this.autosaveService.loadDraft(draft); - this.snackbar.open('Draft loaded', undefined, { - duration: src_app_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION, - panelClass: src_app_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_SUCCESS - }); + getIconForName(iconName) { + return this.customizationService.getIconForName(iconName).value; } - removeAllDrafts() { - this.autosaveService.removeAllDrafts(); + allowDrop($event, listName) { + if (this.draggedList === listName) { + $event.preventDefault(); + } } - static #_ = this.ɵfac = function AutosavedDraftsComponent_Factory(t) { - return new (t || AutosavedDraftsComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_Service_Autosave_autosave_service__WEBPACK_IMPORTED_MODULE_1__.AutosaveService), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_3__.MatSnackBar)); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ - type: AutosavedDraftsComponent, - selectors: [["app-autosaved-drafts"]], - decls: 10, - vars: 4, - consts: [["noDrafts", ""], ["class", "items", 4, "ngIf", "ngIfElse"], [1, "items"], ["class", "item border-bottom", 4, "ngFor", "ngForOf"], [1, "item"], ["mat-raised-button", "", "color", "primary", 1, "item-button", 3, "click"], [1, "item", "border-bottom"], [1, "item-title"], [1, "item-date"]], - template: function AutosavedDraftsComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "mat-accordion")(1, "mat-expansion-panel")(2, "mat-expansion-panel-header")(3, "mat-panel-title"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](4, "History"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](5, "mat-panel-description"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](6); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtemplate"](7, AutosavedDraftsComponent_div_7_Template, 6, 1, "div", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtemplate"](8, AutosavedDraftsComponent_ng_template_8_Template, 1, 0, "ng-template", null, 0, _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtemplateRefExtractor"]); - } - if (rf & 2) { - const noDrafts_r5 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵreference"](9); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](6); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtextInterpolate2"](" ", ctx.drafts.length ? ctx.drafts.length : "no", " ", ctx.drafts.length > 1 ? "drafts" : "draft", " available "); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("ngIf", ctx.drafts.length)("ngIfElse", noDrafts_r5); - } - }, - dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_4__.NgForOf, _angular_common__WEBPACK_IMPORTED_MODULE_4__.NgIf, _angular_material_button__WEBPACK_IMPORTED_MODULE_5__.MatButton, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_6__.MatAccordion, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_6__.MatExpansionPanel, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_6__.MatExpansionPanelHeader, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_6__.MatExpansionPanelTitle, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_6__.MatExpansionPanelDescription], - styles: [".items[_ngcontent-%COMP%] {\n padding-top: 0 !important;\n}\n.items[_ngcontent-%COMP%] .mat-list-item-content {\n padding: 0;\n}\n\n.item[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 8px 0;\n width: 400px;\n}\n\n.border-bottom[_ngcontent-%COMP%] {\n border-bottom: 1px solid darkgray;\n}\n\n.item-title[_ngcontent-%COMP%] {\n font-weight: bold;\n width: 270px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n\n.item-date[_ngcontent-%COMP%] {\n font-weight: normal;\n}\n\n.item-button[_ngcontent-%COMP%] {\n margin-left: 1rem;\n}\n\nmat-list-item[_ngcontent-%COMP%] {\n border-bottom: 1px solid darkgray;\n}"] - }); - } - return AutosavedDraftsComponent; -})(); - -/***/ }), - -/***/ 29383: -/*!**********************************************************!*\ - !*** ./src/app/Presentation/Canvas/modeler.component.ts ***! - \**********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ModelerComponent: () => (/* binding */ ModelerComponent) -/* harmony export */ }); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _Service_Modeler_modeler_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Service/Modeler/modeler.service */ 74676); -/* harmony import */ var _Service_Autosave_autosave_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Service/Autosave/autosave.service */ 30534); - - - -let ModelerComponent = /*#__PURE__*/(() => { - class ModelerComponent { - constructor(modelerService, autosaveService) { - this.modelerService = modelerService; - this.autosaveService = autosaveService; + onDrop($event, iconName, actors, index) { + let list; + if (actors) { + list = this.selectedActors$; + } else { + list = this.selectedWorkobjects$; + } + const sortedList = list.value; + const item = sortedList[this.draggedIndex]; + sortedList.splice(this.draggedIndex, 1); + sortedList.splice(index, 0, item); + list.next(sortedList); + if (actors) { + this.customizationService.setSelectedActors(sortedList); + } else { + this.customizationService.setSelectedWorkObject(sortedList); + } } - ngOnInit() { - this.modelerService.postInit(); - this.autosaveService.loadLatestDraft(); + onDragStart(index, draggedList) { + this.draggedList = draggedList; + this.draggedIndex = index; } - static #_ = this.ɵfac = function ModelerComponent_Factory(t) { - return new (t || ModelerComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_Service_Modeler_modeler_service__WEBPACK_IMPORTED_MODULE_0__.ModelerService), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_Service_Autosave_autosave_service__WEBPACK_IMPORTED_MODULE_1__.AutosaveService)); + static #_ = this.ɵfac = function IconSetDetailsComponent_Factory(t) { + return new (t || IconSetDetailsComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](src_app_tools_icon_set_config_services_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_0__.IconSetCustomizationService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](src_app_tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_1__.TitleService)); }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ - type: ModelerComponent, - selectors: [["app-modeler"]], - decls: 1, - vars: 0, - consts: [["id", "canvas"]], - template: function ModelerComponent_Template(rf, ctx) { + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineComponent"]({ + type: IconSetDetailsComponent, + selectors: [["app-icon-set-details"]], + decls: 21, + vars: 7, + consts: [[1, "details", "smallScrollbar"], [1, "iconSetDetails", "bottom-border"], [1, "inputWidth", "inputHeight"], [1, "alignment"], [1, "inputHeight"], ["matInput", "", "type", "text", "placeholder", "Icon Set Name", 3, "input", "value"], [1, "actorList", "bottom-border"], ["draggable", "true", 1, "compactItem"], [1, "workobjectList"], ["draggable", "true", 1, "compactItem", 3, "dragover", "dragstart", "drop"], [3, "icon"]], + template: function IconSetDetailsComponent_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](0, "div", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](0, "div", 0)(1, "div", 1)(2, "form", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelement"](3, "div", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](4, "mat-form-field", 4)(5, "input", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](6, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("input", function IconSetDetailsComponent_Template_input_input_5_listener($event) { + return ctx.changeName($event); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()()()(); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](7, "div", 6)(8, "h3"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](9, "Order of Actors"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](10, "mat-list"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrepeaterCreate"](11, IconSetDetailsComponent_For_12_Template, 2, 1, "mat-list-item", 7, _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrepeaterTrackByIdentity"]); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](13, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](14, "div", 8)(15, "h3"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](16, "Order of Work Objects"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](17, "mat-list"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrepeaterCreate"](18, IconSetDetailsComponent_For_19_Template, 2, 1, "mat-list-item", 7, _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrepeaterTrackByIdentity"]); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](20, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](5); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("value", _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](6, 1, ctx.iconSetName)); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](6); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrepeater"](_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](13, 3, ctx.selectedActors$)); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](7); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrepeater"](_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](20, 5, ctx.selectedWorkobjects$)); } }, - styles: ["#canvas[_ngcontent-%COMP%], #canvas[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] {\n top: 0;\n width: 100%;\n height: 100%;\n position: relative;\n bottom: 0;\n overflow: hidden;\n}"] + dependencies: [_angular_forms__WEBPACK_IMPORTED_MODULE_4__["ɵNgNoValidate"], _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NgControlStatusGroup, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NgForm, _angular_material_list__WEBPACK_IMPORTED_MODULE_5__.MatList, _angular_material_list__WEBPACK_IMPORTED_MODULE_5__.MatListItem, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatFormField, _angular_material_input__WEBPACK_IMPORTED_MODULE_7__.MatInput, _details_list_item_details_list_item_component__WEBPACK_IMPORTED_MODULE_2__.DetailsListItemComponent, _angular_common__WEBPACK_IMPORTED_MODULE_8__.AsyncPipe], + styles: [".details[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: calc(100vh - 46px - 20px);\n grid-row-gap: 1px;\n overflow-y: auto;\n overflow-x: auto;\n width: 250px;\n border-left: solid 1px #ccc;\n}\n\n.iconSetDetails[_ngcontent-%COMP%] .mat-mdc-form-field-infix {\n border: none;\n padding-bottom: 0 !important;\n padding-top: 0 !important;\n}\n.iconSetDetails[_ngcontent-%COMP%] .mdc-text-field {\n padding-left: 0 !important;\n}\n\n.compactItem[_ngcontent-%COMP%] {\n height: 40px !important;\n}\n\n.fullWidth[_ngcontent-%COMP%] {\n width: 100%;\n padding-left: 15px;\n}\n\n.alignment[_ngcontent-%COMP%] {\n height: 12px;\n}\n\n.inputHeight[_ngcontent-%COMP%] {\n height: 46px;\n}\n\n.inputWidth[_ngcontent-%COMP%] {\n width: 200px;\n margin-left: 15px;\n}\n\nh3[_ngcontent-%COMP%] {\n padding-left: 15px;\n margin-bottom: 0;\n font-weight: bold;\n}\n\nmat-list[_ngcontent-%COMP%] {\n padding-top: 0;\n}\n\n.bottom-border[_ngcontent-%COMP%] {\n border-bottom: 2px solid #ccc;\n}"] }); } - return ModelerComponent; + return IconSetDetailsComponent; })(); /***/ }), -/***/ 63954: -/*!**********************************************************************************!*\ - !*** ./src/app/Presentation/Dialog/activity-dialog/activity-dialog.component.ts ***! - \**********************************************************************************/ +/***/ 6932: +/*!***************************************************************************!*\ + !*** ./src/app/tools/icon-set-config/services/icon-dictionary.service.ts ***! + \***************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ActivityDialogComponent: () => (/* binding */ ActivityDialogComponent) +/* harmony export */ ICON_PREFIX: () => (/* binding */ ICON_PREFIX), +/* harmony export */ IconDictionaryService: () => (/* binding */ IconDictionaryService) /* harmony export */ }); -/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -/* harmony import */ var _dialog_forms_activity_dialog_form__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dialog-forms/activity-dialog-form */ 1974); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/forms */ 37222); -/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/button */ 72221); -/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/form-field */ 29344); -/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/input */ 92583); -/* harmony import */ var src_app_Domain_Dialog_activityDialogData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Domain/Dialog/activityDialogData */ 93703); - - - +/* harmony import */ var src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/dictionary */ 20843); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var src_app_tools_icon_set_config_domain_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/tools/icon-set-config/domain/iconConfiguration */ 26976); +/* harmony import */ var src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/tools/icon-set-config/domain/allIcons */ 61070); +/* harmony import */ var _utils_sanitizer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../utils/sanitizer */ 43515); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 2978); +var getIconId = src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.getIconId; -let ActivityDialogComponent = /*#__PURE__*/(() => { - class ActivityDialogComponent { - constructor(dialogRef, data) { - this.dialogRef = dialogRef; - this.activity = data.activity; - this.activityLabel = data.activity.businessObject.name; - this.numberIsAllowedMultipleTimes = data.numberIsAllowedMultipleTimes; - this.activityNumber = data.activity.businessObject.number ?? null; - this.showNumberFields = data.showNumberFields; - this.saveFN = data.saveFN; - this.form = _dialog_forms_activity_dialog_form__WEBPACK_IMPORTED_MODULE_0__.ActivityDialogForm.create(this.activityLabel, this.activityNumber, this.numberIsAllowedMultipleTimes); - this.form.controls.activityNumber.valueChanges.subscribe(activityNumber => { - if (activityNumber !== null) { - if (activityNumber < 1) { - this.form.controls.activityNumber.setValue(1); +const ICON_PREFIX = 'icon-domain-story-'; +let IconDictionaryService = /*#__PURE__*/(() => { + class IconDictionaryService { + constructor() { + this.actorIconDictionary = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + this.workObjectDictionary = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + this.allIconDictionary = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + this.iconDictionaryForBPMN = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + this.allIconDictionary.addEach(src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_3__.allIcons); + this.iconConfig = new src_app_tools_icon_set_config_domain_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__.IconConfiguration(this.allIconDictionary); + } + initTypeDictionaries(actors, workObjects) { + if (!actors || actors.length == 0) { + actors = src_app_tools_icon_set_config_domain_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__.defaultConf.actors; + } + if (!workObjects || workObjects.length == 0) { + workObjects = src_app_tools_icon_set_config_domain_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__.defaultConf.workObjects; + } + const allTypes = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + allTypes.addEach(src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_3__.allIcons); + allTypes.appendDict(this.getAppendedIconDictionary()); + this.initDictionary(actors, allTypes, this.actorIconDictionary, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR); + this.initDictionary(workObjects, allTypes, this.workObjectDictionary, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT); + } + initDictionary(keys, allTypes, dictionary, elementType) { + dictionary.clear(); + for (const key of keys) { + dictionary.add(allTypes.get(key), key); + } + dictionary.keysArray().forEach(name => { + this.registerIconForBPMN(name, ICON_PREFIX + (0,_utils_sanitizer__WEBPACK_IMPORTED_MODULE_4__.sanitizeIconName)(name.toLowerCase()), elementType); + }); + } + getCurrentIconConfigurationForBPMN() { + if (this.customConfiguration) { + return this.iconConfig.createCustomConf(this.customConfiguration); + } + return this.iconConfig.getDefaultConf(); + } + allInTypeDictionary(type, elements) { + let collection; + if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) { + collection = this.actorIconDictionary; + } else if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT) { + collection = this.workObjectDictionary; + } + let allIn = true; + if (elements) { + elements.forEach(element => { + if (!collection.has(getIconId(element.type))) { + allIn = false; + } + }); + } else { + return false; + } + return allIn; + } + /** Load Icons from Configuration **/ + addIconsFromIconSetConfiguration(dictionaryType, iconTypes) { + let collection; + if (dictionaryType === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) { + collection = this.actorIconDictionary; + } else if (dictionaryType === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT) { + collection = this.workObjectDictionary; + } + const allTypes = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + allTypes.addEach(src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_3__.allIcons); + allTypes.appendDict(src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_3__.appendedIcons); + iconTypes.forEach(name => { + if (!collection.has(name)) { + const src = allTypes.get(name); + if (src) { + this.registerIconForType(dictionaryType, name, src); + this.registerIconForBPMN(name, (0,_utils_sanitizer__WEBPACK_IMPORTED_MODULE_4__.sanitizeIconName)(ICON_PREFIX + name.toLowerCase()), dictionaryType); } } }); } - onSubmit() { - this.numberIsAllowedMultipleTimes = !this.numberIsAllowedMultipleTimes; - this.form.patchValue({ - multipleNumbers: this.numberIsAllowedMultipleTimes - }); + /** Add Icon(s) to Dictionary **/ + registerIconForBPMN(name, src, elementType) { + if (name.includes(elementType)) { + throw new Error('Should not include elementType'); + } + this.iconDictionaryForBPMN.set(`${elementType}${name}`, src); } - save() { - this.saveFN({ - activity: this.activity, - ...this.form.value - }); - this.dialogRef.close(); + addIconsToTypeDictionary(actorIcons, workObjectIcons) { + if (!this.allInTypeDictionary(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, actorIcons)) { + this.addIconsFromIconSetConfiguration(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, actorIcons.map(element => getIconId(element.type))); + } + if (!this.allInTypeDictionary(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, workObjectIcons)) { + this.addIconsFromIconSetConfiguration(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, workObjectIcons.map(element => getIconId(element.type))); + } } - close() { - this.dialogRef.close(); + registerIconForType(type, name, src) { + if (name.includes(type)) { + throw new Error('Name should not include type!'); + } + let collection = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) { + collection = this.actorIconDictionary; + } else if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT) { + collection = this.workObjectDictionary; + } + collection.add(src, name); } - preventDefault(event) { - event.preventDefault(); + unregisterIconForType(type, name) { + if (name.includes(type)) { + throw new Error('Name should not include type!'); + } + let collection = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) { + collection = this.actorIconDictionary; + } else if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT) { + collection = this.workObjectDictionary; + } + collection.delete(name); } - static #_ = this.ɵfac = function ActivityDialogComponent_Factory(t) { - return new (t || ActivityDialogComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MatDialogRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MAT_DIALOG_DATA)); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ - type: ActivityDialogComponent, - selectors: [["app-activity-dialog"]], - decls: 20, - vars: 2, - consts: [[3, "formGroup"], [3, "hidden"], [1, "shortWidth"], ["matInput", "", "type", "number", "formControlName", "activityNumber"], ["type", "checkbox", "formControlName", "multipleNumbers", 3, "change"], [1, "fullWidth"], ["matInput", "", "type", "text", "formControlName", "activityLabel", "autofocus", "", "cdkFocusInitial", "", 3, "keydown.enter", "keyup.enter", "keyup.escape"], ["mat-flat-button", "", 3, "click"], ["mat-flat-button", "", "color", "primary", 3, "click"]], - template: function ActivityDialogComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "mat-dialog-content")(1, "h2"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](2, "Edit Activity"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](3, "form", 0)(4, "div", 1)(5, "mat-form-field", 2)(6, "mat-label"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](7, "Number"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](8, "input", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](9, "input", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("change", function ActivityDialogComponent_Template_input_change_9_listener() { - return ctx.onSubmit(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](10, " multiple "); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](11, "mat-form-field", 5)(12, "mat-label"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](13, "Label"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](14, "textarea", 6); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("keydown.enter", function ActivityDialogComponent_Template_textarea_keydown_enter_14_listener($event) { - return ctx.preventDefault($event); - })("keyup.enter", function ActivityDialogComponent_Template_textarea_keyup_enter_14_listener() { - return ctx.save(); - })("keyup.escape", function ActivityDialogComponent_Template_textarea_keyup_escape_14_listener() { - return ctx.close(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()()()(); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](15, "mat-dialog-actions")(16, "button", 7); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function ActivityDialogComponent_Template_button_click_16_listener() { - return ctx.close(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](17, "Cancel"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](18, "button", 8); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function ActivityDialogComponent_Template_button_click_18_listener() { - return ctx.save(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](19, "Save"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + updateIconRegistries(actors, workObjects, config) { + const elements = []; + actors.forEach(a => elements.push(a)); + workObjects.forEach(w => elements.push(w)); + const customIcons = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + const actorsDict = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + const workObjectsDict = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + config.actors.keysArray().forEach(key => { + actorsDict.set(key, config.actors.get(key)); + }); + config.workObjects.keysArray().forEach(key => { + workObjectsDict.set(key, config.workObjects.get(key)); + }); + this.extractCustomIconsFromDictionary(actorsDict, customIcons); + this.extractCustomIconsFromDictionary(workObjectsDict, customIcons); + elements.forEach(element => { + const name = (0,_utils_sanitizer__WEBPACK_IMPORTED_MODULE_4__.sanitizeIconName)(element.type.replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, '').replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, '')); + if ((element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) || element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT)) && !this.getFullDictionary().has(name)) { + let elementType; + if (element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR)) { + elementType = src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR; + } else { + elementType = src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT; + } + this.registerIconForBPMN(ICON_PREFIX + name.toLowerCase(), getIconId(element.type), elementType); } - if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("formGroup", ctx.form); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("hidden", !ctx.showNumberFields); + }); + this.addNewIconsToDictionary(customIcons); + this.addIconsToTypeDictionary(actors, workObjects); + } + extractCustomIconsFromDictionary(elementDictionary, customIcons) { + elementDictionary.keysArray().forEach(name => { + const sanitizedName = (0,_utils_sanitizer__WEBPACK_IMPORTED_MODULE_4__.sanitizeIconName)(name); + if (!this.getFullDictionary().has(sanitizedName)) { + customIcons.add(elementDictionary.get(name), sanitizedName); } - }, - dependencies: [_angular_forms__WEBPACK_IMPORTED_MODULE_4__["ɵNgNoValidate"], _angular_forms__WEBPACK_IMPORTED_MODULE_4__.DefaultValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NumberValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.CheckboxControlValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NgControlStatusGroup, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.FormGroupDirective, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.FormControlName, _angular_material_button__WEBPACK_IMPORTED_MODULE_5__.MatButton, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MatDialogActions, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MatDialogContent, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatFormField, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatLabel, _angular_material_input__WEBPACK_IMPORTED_MODULE_7__.MatInput], - styles: [".shortWidth[_ngcontent-%COMP%] {\n width: 200px;\n}\n\n.fullWidth[_ngcontent-%COMP%] {\n width: 100%;\n}\n\n .mat-form-field-label {\n font-size: 12pt !important;\n}"] + }); + } + /** Add new Icon(s) **/ + addNewIconsToDictionary(customIcons) { + customIcons.keysArray().forEach(key => { + const custom = customIcons.get(key); + this.addIMGToIconDictionary(custom, key); + }); + this.addIconsToCss(customIcons); + } + addIMGToIconDictionary(input, name) { + src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_3__.appendedIcons.set(name, input); + } + addIconsToCss(customIcons) { + const sheetEl = document.getElementById('iconsCss'); + customIcons.keysArray().forEach(key => { + const src = customIcons.get(key); + const iconStyle = '.' + ICON_PREFIX + (0,_utils_sanitizer__WEBPACK_IMPORTED_MODULE_4__.sanitizeIconName)(key.toLowerCase()) + '::before{ content: url("data:image/svg+xml;utf8,' + this.wrapSRCInSVG(src) + '"); margin: 3px;}'; + // @ts-ignore + sheetEl?.sheet?.insertRule(iconStyle, sheetEl.sheet.cssRules.length); + }); + } + wrapSRCInSVG(src) { + return ""; + } + /** Getter & Setter **/ + getFullDictionary() { + const fullDictionary = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + fullDictionary.appendDict(this.allIconDictionary); + fullDictionary.appendDict(this.getAppendedIconDictionary()); + return fullDictionary; + } + getAppendedIconDictionary() { + const appendedDict = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_3__.appendedIcons.keysArray().forEach(key => { + if (!this.allIconDictionary.has(key)) { + appendedDict.set(key, src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_3__.appendedIcons.get(key)); + } + }); + return appendedDict; + } + getTypeDictionary(type) { + if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) { + return this.actorIconDictionary; + } else if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT) { + return this.workObjectDictionary; + } + return new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + } + getTypeDictionaryKeys(type) { + return this.getTypeDictionary(type).keysArray(); + } + getTypeIconSRC(type, name) { + if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) { + return this.actorIconDictionary.get(name); + } else if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT) { + return this.workObjectDictionary.get(name); + } + return null; + } + getIconForBPMN(elementType, name) { + return this.iconDictionaryForBPMN.get(`${elementType}${name}`); + } + getIconSource(name) { + if (this.allIconDictionary.has(name)) { + return this.allIconDictionary.get(name); + } else if (src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_3__.appendedIcons.has(name)) { + return src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_3__.appendedIcons.get(name); + } + return null; + } + getElementsOfType(elements, type) { + const elementOfType = []; + elements.forEach(element => { + if (element.type.includes(type)) { + elementOfType.push(element); + } + }); + return elementOfType; + } + getAllIconDictionary() { + return this.allIconDictionary; + } + getActorsDictionary() { + return this.actorIconDictionary; + } + getWorkObjectsDictionary() { + return this.workObjectDictionary; + } + getIconConfiguration() { + return this.iconConfig; + } + setCustomConfiguration(customConfiguration) { + this.customConfiguration = customConfiguration; + } + static #_ = this.ɵfac = function IconDictionaryService_Factory(t) { + return new (t || IconDictionaryService)(); + }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({ + token: IconDictionaryService, + factory: IconDictionaryService.ɵfac, + providedIn: 'root' }); } - return ActivityDialogComponent; + return IconDictionaryService; })(); /***/ }), -/***/ 1974: -/*!**************************************************************************!*\ - !*** ./src/app/Presentation/Dialog/dialog-forms/activity-dialog-form.ts ***! - \**************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ActivityDialogForm: () => (/* binding */ ActivityDialogForm) -/* harmony export */ }); -/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/forms */ 37222); - -var ActivityDialogForm; -(function (ActivityDialogForm) { - function create(activityLabel, activityNumber, numberIsAllowedMultipleTimes) { - return new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormGroup({ - activityLabel: new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormControl(activityLabel, { - nonNullable: true - }), - activityNumber: new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormControl(activityNumber, [_angular_forms__WEBPACK_IMPORTED_MODULE_0__.Validators.required]), - multipleNumbers: new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormControl(numberIsAllowedMultipleTimes, { - nonNullable: true - }) - }); - } - ActivityDialogForm.create = create; -})(ActivityDialogForm || (ActivityDialogForm = {})); - -/***/ }), - -/***/ 94810: -/*!************************************************************************!*\ - !*** ./src/app/Presentation/Dialog/dialog-forms/header-dialog-form.ts ***! - \************************************************************************/ +/***/ 46527: +/*!**********************************************************************************!*\ + !*** ./src/app/tools/icon-set-config/services/icon-set-configuration.service.ts ***! + \**********************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ HeaderDialogForm: () => (/* binding */ HeaderDialogForm) +/* harmony export */ IconSetConfigurationService: () => (/* binding */ IconSetConfigurationService) /* harmony export */ }); -/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/forms */ 37222); - -var HeaderDialogForm; -(function (HeaderDialogForm) { - function create(titel, description) { - return new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormGroup({ - title: new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormControl(titel), - description: new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormControl(description) - }); - } - HeaderDialogForm.create = create; -})(HeaderDialogForm || (HeaderDialogForm = {})); - -/***/ }), +/* harmony import */ var src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/dictionary */ 20843); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var _domain_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../domain/iconConfiguration */ 26976); +/* harmony import */ var _domain_entities_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../domain/entities/constants */ 40550); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_tools_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/tools/icon-set-config/services/icon-dictionary.service */ 6932); +/* harmony import */ var src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/domain/services/element-registry.service */ 85511); +/* harmony import */ var _title_services_title_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../title/services/title.service */ 41535); +/* harmony import */ var _domain_services_storage_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../domain/services/storage.service */ 50624); -/***/ 97218: -/*!******************************************************************************!*\ - !*** ./src/app/Presentation/Dialog/export-dialog/export-dialog.component.ts ***! - \******************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ExportDialogComponent: () => (/* binding */ ExportDialogComponent) -/* harmony export */ }); -/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -/* harmony import */ var rxjs_internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/internal/BehaviorSubject */ 95981); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/button */ 72221); -/* harmony import */ var src_app_Domain_Dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Dialog/exportDialogData */ 83064); @@ -68662,626 +67557,612 @@ __webpack_require__.r(__webpack_exports__); -function ExportDialogComponent_button_17_Template(rf, ctx) { - if (rf & 1) { - const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "button", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function ExportDialogComponent_button_17_Template_button_click_0_listener() { - const i_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r1).index; - const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r2.doOption(i_r2)); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - } - if (rf & 2) { - const option_r4 = ctx.$implicit; - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("title", option_r4.tooltip); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate1"](" ", option_r4.text, " "); - } -} -let ExportDialogComponent = /*#__PURE__*/(() => { - class ExportDialogComponent { - constructor(dialogRef, data) { - this.dialogRef = dialogRef; - this.withTitle = new rxjs_internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_2__.BehaviorSubject(true); - this.useWhiteBackground = new rxjs_internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_2__.BehaviorSubject(true); - this.title = data.title; - this.options = data.options; +let IconSetConfigurationService = /*#__PURE__*/(() => { + class IconSetConfigurationService { + constructor(iconDictionaryService, elementRegistryService, titleService, storageService) { + this.iconDictionaryService = iconDictionaryService; + this.elementRegistryService = elementRegistryService; + this.titleService = titleService; + this.storageService = storageService; } - ngOnInit() {} - doOption(i) { - this.options[i].fn(this.withTitle.value, this.useWhiteBackground.value); - this.close(); + setIconSetName(iconSetName) { + this.titleService.setIconSetName(iconSetName ? iconSetName : _domain_entities_constants__WEBPACK_IMPORTED_MODULE_3__.INITIAL_ICON_SET_NAME); } - close() { - this.dialogRef.close(); + exportConfiguration() { + const iconSetConfiguration = this.getCurrentConfigurationForExport(); + if (!iconSetConfiguration) { + return; + } + const configJSONString = JSON.stringify(iconSetConfiguration, null, 2); + const filename = this.titleService.getIconSetName(); + const element = document.createElement('a'); + element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(configJSONString)); + element.setAttribute('download', filename + '.iconset'); + element.style.display = 'none'; + document.body.appendChild(element); + element.click(); + document.body.removeChild(element); } - updateWithTitle($event) { - // @ts-ignore - this.withTitle.next($event.target.checked); + loadConfiguration(customConfig, updateIconSetName = true) { + let actorDict = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + let workObjectDict = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + if (customConfig.actors.keysArray()) { + actorDict = customConfig.actors; + workObjectDict = customConfig.workObjects; + } else { + actorDict.addEach(customConfig.actors); + workObjectDict.addEach(customConfig.workObjects); + } + const actorKeys = actorDict.keysArray(); + const workObjectKeys = workObjectDict.keysArray(); + this.iconDictionaryService.updateIconRegistries([], [], customConfig); + this.iconDictionaryService.getIconConfiguration().appendSRCFile(actorKeys, actorDict, workObjectKeys, workObjectDict); + this.iconDictionaryService.addIconsFromIconSetConfiguration(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, actorKeys.map(a => src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR + a)); + this.iconDictionaryService.addIconsFromIconSetConfiguration(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, workObjectKeys.map(w => src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT + w)); + if (updateIconSetName) { + const configurationName = customConfig.name; + this.setIconSetName(configurationName); + } } - updateUseWhiteBackground($event) { - // @ts-ignore - this.useWhiteBackground.next($event.target.checked); + getCurrentConfiguration() { + const actors = this.iconDictionaryService.getActorsDictionary(); + const workObjects = this.iconDictionaryService.getWorkObjectsDictionary(); + let iconSetConfiguration; + if (actors.size() > 0 && workObjects.size() > 0) { + iconSetConfiguration = this.createConfigFromDictionaries(actors, workObjects); + } + return iconSetConfiguration; } - static #_ = this.ɵfac = function ExportDialogComponent_Factory(t) { - return new (t || ExportDialogComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MatDialogRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MAT_DIALOG_DATA)); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ - type: ExportDialogComponent, - selectors: [["app-export-dialog"]], - decls: 18, - vars: 8, - consts: [["type", "checkbox", 3, "change", "checked"], ["mat-flat-button", "", 3, "click"], ["mat-stroked-button", "", "class", "mr-1", 3, "title", "click", 4, "ngFor", "ngForOf"], ["mat-stroked-button", "", 1, "mr-1", 3, "click", "title"]], - template: function ExportDialogComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "mat-dialog-content")(1, "h2"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](3, "label")(4, "input", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](5, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("change", function ExportDialogComponent_Template_input_change_4_listener($event) { - return ctx.updateWithTitle($event); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](6, " Add title and description to image "); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](7, "br"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](8, "label")(9, "input", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](10, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("change", function ExportDialogComponent_Template_input_change_9_listener($event) { - return ctx.updateUseWhiteBackground($event); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](11, " Add white background to SVG (default: transparent) "); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](12, "mat-dialog-actions"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](13, "br"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](14, "div")(15, "button", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function ExportDialogComponent_Template_button_click_15_listener() { - return ctx.close(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](16, "Cancel"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](17, ExportDialogComponent_button_17_Template, 2, 2, "button", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); + getCurrentConfigurationForExport() { + const currentConfiguration = this.getCurrentConfiguration(); + if (currentConfiguration) { + const actors = {}; + const workObjects = {}; + currentConfiguration.actors.all().forEach(entry => { + actors[entry.key] = entry.value; + }); + currentConfiguration.workObjects.all().forEach(entry => { + workObjects[entry.key] = entry.value; + }); + return { + name: currentConfiguration.name, + actors: actors, + workObjects: workObjects + }; + } + return; + } + getCurrentConfigurationNamesWithoutPrefix() { + return { + name: this.titleService.getIconSetName() || _domain_entities_constants__WEBPACK_IMPORTED_MODULE_3__.INITIAL_ICON_SET_NAME, + actors: this.iconDictionaryService.getActorsDictionary().keysArray().map(a => a.replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, '')), + workObjects: this.iconDictionaryService.getWorkObjectsDictionary().keysArray().map(w => w.replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, '')) + }; + } + createMinimalConfigurationWithDefaultIcons() { + const minimalConfig = this.createConfigFromCanvas(); + _domain_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__.defaultConf.actors.forEach(iconName => { + minimalConfig.actors.add(this.iconDictionaryService.getIconSource(iconName), iconName); + }); + _domain_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__.defaultConf.workObjects.forEach(iconName => { + minimalConfig.workObjects.add(this.iconDictionaryService.getIconSource(iconName), iconName); + }); + return minimalConfig; + } + createConfigFromDictionaries(actorsDict, workObjectsDict) { + const actorNames = actorsDict.keysArray(); + const workobjectNames = workObjectsDict.keysArray(); + const newActors = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + const newWorkobjects = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + // Fill Configuration from Canvas-Objects + actorNames.forEach(actor => { + newActors.add(actorsDict.get(actor), actor.replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, '')); + }); + workobjectNames.forEach(workObject => { + newWorkobjects.add(workObjectsDict.get(workObject), workObject.replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, '')); + }); + return { + name: this.titleService.getIconSetName(), + actors: newActors, + workObjects: newWorkobjects + }; + } + createIconSetConfiguration(fileConfiguration) { + const actorsDict = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + const workObjectsDict = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + Object.keys(fileConfiguration.actors).forEach(key => { + let icon = fileConfiguration.actors[key]; + if (icon) { + // make sure the actor has an icon + actorsDict.add(icon, key); } - if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate"](ctx.title); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("checked", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](5, 4, ctx.withTitle)); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](5); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("checked", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](10, 6, ctx.useWhiteBackground)); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](8); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngForOf", ctx.options); + }); + Object.keys(fileConfiguration.workObjects).forEach(key => { + let icon = fileConfiguration.workObjects[key]; + if (icon) { + // make sure the work object has an icon + workObjectsDict.add(icon, key); } - }, - dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_4__.NgForOf, _angular_material_button__WEBPACK_IMPORTED_MODULE_5__.MatButton, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MatDialogActions, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MatDialogContent, _angular_common__WEBPACK_IMPORTED_MODULE_4__.AsyncPipe] + }); + return { + name: fileConfiguration.name, + actors: actorsDict, + workObjects: workObjectsDict + }; + } + getStoredIconSetConfiguration() { + const iconSetString = this.storageService.get(_domain_entities_constants__WEBPACK_IMPORTED_MODULE_3__.ICON_SET_CONFIGURATION_TAG); + if (!iconSetString) { + return; + } else { + const configurationFromFile = this.createIconSetConfiguration(JSON.parse(iconSetString)); + if (this.checkValidityOfConfiguration(configurationFromFile)) { + return configurationFromFile; + } + } + return; + } + setStoredIconSetConfiguration(config) { + const actors = {}; + config.actors.keysArray().forEach(key => { + actors[key] = config.actors.get(key); + }); + const workObjects = {}; + config.workObjects.keysArray().forEach(key => { + workObjects[key] = config.workObjects.get(key); + }); + const configForStorage = { + name: config.name, + actors: actors, + workObjects: workObjects + }; + this.storageService.set(_domain_entities_constants__WEBPACK_IMPORTED_MODULE_3__.ICON_SET_CONFIGURATION_TAG, JSON.stringify(configForStorage, null, 2)); + } + createConfigFromCanvas() { + const config = { + name: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_3__.INITIAL_ICON_SET_NAME, + actors: new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(), + workObjects: new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary() + }; + let allCanvasObjects = this.elementRegistryService.getAllCanvasObjects(); + allCanvasObjects.map(e => e.businessObject).forEach(element => { + const type = element.type.replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, '').replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, ''); + if (element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR)) { + let src = this.iconDictionaryService.getIconSource(type) || ''; + config.actors.add(src, type); + } else if (element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT)) { + let src = this.iconDictionaryService.getIconSource(type) || ''; + config.workObjects.add(src, type); + } + }); + return config; + } + checkValidityOfConfiguration(iconSetConfiguration) { + return iconSetConfiguration.actors.keysArray().length > 1 && iconSetConfiguration.workObjects.keysArray().length > 1 && !iconSetConfiguration.actors.all().some(e => typeof e.value !== 'string') && !iconSetConfiguration.workObjects.all().some(e => typeof e.value !== 'string'); + } + static #_ = this.ɵfac = function IconSetConfigurationService_Factory(t) { + return new (t || IconSetConfigurationService)(_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](src_app_tools_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_4__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_5__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_title_services_title_service__WEBPACK_IMPORTED_MODULE_6__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_domain_services_storage_service__WEBPACK_IMPORTED_MODULE_7__.StorageService)); + }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdefineInjectable"]({ + token: IconSetConfigurationService, + factory: IconSetConfigurationService.ɵfac, + providedIn: 'root' }); } - return ExportDialogComponent; + return IconSetConfigurationService; })(); /***/ }), -/***/ 21270: -/*!******************************************************************************!*\ - !*** ./src/app/Presentation/Dialog/header-dialog/header-dialog.component.ts ***! - \******************************************************************************/ +/***/ 46252: +/*!**********************************************************************************!*\ + !*** ./src/app/tools/icon-set-config/services/icon-set-customization.service.ts ***! + \**********************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ HeaderDialogComponent: () => (/* binding */ HeaderDialogComponent) +/* harmony export */ IconSetChangedService: () => (/* binding */ IconSetChangedService), +/* harmony export */ IconSetCustomizationService: () => (/* binding */ IconSetCustomizationService) /* harmony export */ }); -/* harmony import */ var _dialog_forms_header_dialog_form__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dialog-forms/header-dialog-form */ 94810); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -/* harmony import */ var src_app_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Service/Title/title.service */ 69672); -/* harmony import */ var _Service_DirtyFlag_dirty_flag_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../Service/DirtyFlag/dirty-flag.service */ 89791); -/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/forms */ 37222); -/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/button */ 72221); -/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/form-field */ 29344); -/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/input */ 92583); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ 95981); +/* harmony import */ var _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../domain/entities/constants */ 40550); +/* harmony import */ var _domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../domain/entities/dictionary */ 20843); +/* harmony import */ var _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../domain/entities/elementTypes */ 73190); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./icon-set-configuration.service */ 46527); +/* harmony import */ var _icon_dictionary_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./icon-dictionary.service */ 6932); +/* harmony import */ var _title_services_title_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../title/services/title.service */ 41535); +/* harmony import */ var src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/domain/services/element-registry.service */ 85511); +/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); +var getIconId = _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.getIconId; -let HeaderDialogComponent = /*#__PURE__*/(() => { - class HeaderDialogComponent { - constructor(dialogRef, titleService, dirtyFlagService) { - this.dialogRef = dialogRef; + +/** + * We are not allowed to call ImportDomainStoryService directly, + * so we use this "interface" instead. + */ +class IconSetChangedService {} +let IconSetCustomizationService = /*#__PURE__*/(() => { + class IconSetCustomizationService { + constructor(iconSetConfigurationService, iconDictionaryService, iconSetChangedService, titleService, elementRegistryService, snackbar) { + this.iconSetConfigurationService = iconSetConfigurationService; + this.iconDictionaryService = iconDictionaryService; this.titleService = titleService; - this.dirtyFlagService = dirtyFlagService; - } - ngOnInit() { - const title = this.titleService.getTitle(); - const description = this.titleService.getDescription(); - this.form = _dialog_forms_header_dialog_form__WEBPACK_IMPORTED_MODULE_0__.HeaderDialogForm.create(title, description); - } - save() { - if (this.form.dirty) { - this.dirtyFlagService.makeDirty(); - this.titleService.updateTitleAndDescription(this.form.getRawValue().title, this.form.getRawValue().description, true); + this.elementRegistryService = elementRegistryService; + this.snackbar = snackbar; + this.allIconListItems = new _domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); + this.configurationHasChanged = false; + this.selectedActors$ = new rxjs__WEBPACK_IMPORTED_MODULE_7__.BehaviorSubject([]); + this.selectedWorkobjects$ = new rxjs__WEBPACK_IMPORTED_MODULE_7__.BehaviorSubject([]); + this.iconSetConfigurationTypes = new rxjs__WEBPACK_IMPORTED_MODULE_7__.BehaviorSubject(this.iconSetConfigurationService.getCurrentConfigurationNamesWithoutPrefix()); + this.selectedWorkobjects$.next(this.iconSetConfigurationTypes.value.workObjects); + this.selectedActors$.next(this.iconSetConfigurationTypes.value.actors); + iconDictionaryService.getAllIconDictionary().keysArray().forEach(iconName => { + this.addIconToAllIconList(iconName); + }); + iconSetChangedService.iconConfigrationChanged().subscribe(config => { + this.importConfiguration(config); + }); + const storedIconSetConfiguration = this.iconSetConfigurationService.getStoredIconSetConfiguration(); + if (storedIconSetConfiguration) { + this.importConfiguration(storedIconSetConfiguration, false); + } + const importedConfiguration = iconSetChangedService.getConfiguration(); + if (importedConfiguration) { + this.importConfiguration(importedConfiguration, false); } - this.dialogRef.close(); - } - close() { - this.dialogRef.close(); - } - preventDefault(event) { - event.preventDefault(); } - static #_ = this.ɵfac = function HeaderDialogComponent_Factory(t) { - return new (t || HeaderDialogComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_4__.MatDialogRef), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](src_app_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_1__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_Service_DirtyFlag_dirty_flag_service__WEBPACK_IMPORTED_MODULE_2__.DirtyFlagService)); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineComponent"]({ - type: HeaderDialogComponent, - selectors: [["app-header-dialog"]], - decls: 16, - vars: 1, - consts: [[3, "formGroup"], [1, "dialogWidth"], ["matInput", "", "type", "text", "formControlName", "title"], ["maxlength", "2000", "matInput", "", "formControlName", "description", 1, "descriptionInput", 3, "keydown.enter", "keyup.enter", "keyup.escape"], ["mat-flat-button", "", 3, "click"], ["mat-flat-button", "", "color", "primary", 3, "click"]], - template: function HeaderDialogComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](0, "mat-dialog-content")(1, "form", 0)(2, "mat-form-field", 1)(3, "mat-label"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](4, "Title"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelement"](5, "input", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelement"](6, "br"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](7, "mat-form-field", 1)(8, "mat-label"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](9, "Description"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](10, "textarea", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("keydown.enter", function HeaderDialogComponent_Template_textarea_keydown_enter_10_listener($event) { - return ctx.preventDefault($event); - })("keyup.enter", function HeaderDialogComponent_Template_textarea_keyup_enter_10_listener() { - return ctx.save(); - })("keyup.escape", function HeaderDialogComponent_Template_textarea_keyup_escape_10_listener() { - return ctx.close(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()()()(); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](11, "mat-dialog-actions")(12, "button", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("click", function HeaderDialogComponent_Template_button_click_12_listener() { - return ctx.close(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](13, "Cancel"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](14, "button", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("click", function HeaderDialogComponent_Template_button_click_14_listener() { - return ctx.save(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](15, "Save"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()(); + importConfiguration(customConfig, saveIconSet = true) { + const actorKeys = customConfig.actors.keysArray(); + const workObjectKeys = customConfig.workObjects.keysArray(); + this.changeName(customConfig.name); + actorKeys.forEach(iconName => { + if (!this.allIconListItems.has(iconName)) { + this.addIconToAllIconList(iconName); } - if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("formGroup", ctx.form); + const selectedActorNames = this.selectedActors$.value; + if (!selectedActorNames.includes(iconName)) { + this.selectActor(iconName); } - }, - dependencies: [_angular_forms__WEBPACK_IMPORTED_MODULE_5__["ɵNgNoValidate"], _angular_forms__WEBPACK_IMPORTED_MODULE_5__.DefaultValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_5__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_5__.NgControlStatusGroup, _angular_forms__WEBPACK_IMPORTED_MODULE_5__.MaxLengthValidator, _angular_forms__WEBPACK_IMPORTED_MODULE_5__.FormGroupDirective, _angular_forms__WEBPACK_IMPORTED_MODULE_5__.FormControlName, _angular_material_button__WEBPACK_IMPORTED_MODULE_6__.MatButton, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_4__.MatDialogActions, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_4__.MatDialogContent, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__.MatFormField, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__.MatLabel, _angular_material_input__WEBPACK_IMPORTED_MODULE_8__.MatInput], - styles: [".dialogWidth[_ngcontent-%COMP%] {\n width: 50vw;\n}\n.dialogWidth[_ngcontent-%COMP%] mat-label[_ngcontent-%COMP%] {\n font-size: 12pt;\n}\n\n.descriptionInput[_ngcontent-%COMP%] {\n min-height: 75px;\n}"] - }); - } - return HeaderDialogComponent; -})(); - -/***/ }), - -/***/ 16266: -/*!**************************************************************************!*\ - !*** ./src/app/Presentation/Dialog/info-dialog/info-dialog.component.ts ***! - \**************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ InfoDialogComponent: () => (/* binding */ InfoDialogComponent) -/* harmony export */ }); -/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var src_app_Domain_Dialog_infoDialogData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Dialog/infoDialogData */ 45574); - - - - - -function InfoDialogComponent_span_3_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "span", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - } - if (rf & 2) { - const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate1"]("", ctx_r0.infoText, " "); - } -} -function InfoDialogComponent_a_4_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "a", 6); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - } - if (rf & 2) { - const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpropertyInterpolate"]("href", ctx_r0.linkText, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsanitizeUrl"]); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate"](ctx_r0.linkText); - } -} -function InfoDialogComponent_mat_dialog_actions_5_Template(rf, ctx) { - if (rf & 1) { - const _r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "mat-dialog-actions")(1, "button", 7); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function InfoDialogComponent_mat_dialog_actions_5_Template_button_click_1_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r2); - const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r0.close()); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](2, "Close"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); - } -} -let InfoDialogComponent = /*#__PURE__*/(() => { - class InfoDialogComponent { - constructor(dialogRef, data) { - this.dialogRef = dialogRef; - this.title = data.title; - this.infoText = data.infoText; - this.showConfirmButton = !data.isInfo; - this.hasLink = data.isLink; - this.linkText = data.linkText || ''; - } - ngAfterViewInit() { - const span = document.getElementsByClassName('readOnlyText')[0]; - span.style.height = span.scrollHeight + 'px'; - } - close() { - this.dialogRef.close(); - } - static #_ = this.ɵfac = function InfoDialogComponent_Factory(t) { - return new (t || InfoDialogComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__.MatDialogRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__.MAT_DIALOG_DATA)); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ - type: InfoDialogComponent, - selectors: [["app-info-dialog"]], - decls: 6, - vars: 4, - consts: [[1, "content"], ["id", "info-dialog-title"], ["class", "readOnlyText", 4, "ngIf"], [3, "href", 4, "ngIf"], [4, "ngIf"], [1, "readOnlyText"], [3, "href"], [1, "mat-raised-button", 3, "click"]], - template: function InfoDialogComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "mat-dialog-content", 0)(1, "h2", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](3, InfoDialogComponent_span_3_Template, 2, 1, "span", 2)(4, InfoDialogComponent_a_4_Template, 2, 2, "a", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](5, InfoDialogComponent_mat_dialog_actions_5_Template, 3, 0, "mat-dialog-actions", 4); + }); + workObjectKeys.forEach(iconName => { + if (!this.allIconListItems.has(iconName)) { + this.addIconToAllIconList(iconName); } - if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate"](ctx.title); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngIf", ctx.infoText != ""); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngIf", ctx.hasLink); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngIf", ctx.showConfirmButton); + const selectedWorkobjectNames = this.selectedWorkobjects$.value; + if (!selectedWorkobjectNames.includes(iconName)) { + this.selectWorkObject(iconName); } - }, - dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_3__.NgIf, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__.MatDialogActions, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__.MatDialogContent], - styles: [".readOnlyText[_ngcontent-%COMP%] {\n display: block;\n border: none;\n resize: none;\n width: 100%;\n overflow: hidden;\n white-space: pre-wrap;\n}\n\n.content[_ngcontent-%COMP%] {\n height: -moz-fit-content;\n height: fit-content;\n width: 30vw;\n overflow: hidden;\n}"] - }); - } - return InfoDialogComponent; -})(); - -/***/ }), - -/***/ 23958: -/*!**************************************************************************************************!*\ - !*** ./src/app/Presentation/Dialog/label-dictionary-dialog/label-dictionary-dialog.component.ts ***! - \**************************************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ LabelDictionaryDialogComponent: () => (/* binding */ LabelDictionaryDialogComponent) -/* harmony export */ }); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -/* harmony import */ var _LabelDictionary_label_dictionary_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../LabelDictionary/label-dictionary.component */ 86328); - - - -let LabelDictionaryDialogComponent = /*#__PURE__*/(() => { - class LabelDictionaryDialogComponent { - constructor(dialogRef) { - this.dialogRef = dialogRef; + }); + if (saveIconSet) { + this.saveIconSet(this.elementRegistryService.getUsedIcons(), true); + } } - close() { - this.dialogRef.close(); + /** Getter & Setter **/ + getIconSetConfiguration() { + return this.iconSetConfigurationTypes; } - static #_ = this.ɵfac = function LabelDictionaryDialogComponent_Factory(t) { - return new (t || LabelDictionaryDialogComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__.MatDialogRef)); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ - type: LabelDictionaryDialogComponent, - selectors: [["app-label-dictionary-dialog"]], - decls: 4, - vars: 0, - consts: [[3, "closeEmitter"]], - template: function LabelDictionaryDialogComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "mat-dialog-content")(1, "h2"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](2, "Label Dictionary"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](3, "app-label-dictionary", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("closeEmitter", function LabelDictionaryDialogComponent_Template_app_label_dictionary_closeEmitter_3_listener() { - return ctx.close(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); - } - }, - dependencies: [_LabelDictionary_label_dictionary_component__WEBPACK_IMPORTED_MODULE_0__.LabelDictionaryComponent, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_2__.MatDialogContent] - }); - } - return LabelDictionaryDialogComponent; -})(); - -/***/ }), - -/***/ 62748: -/*!***************************************************************************************************!*\ - !*** ./src/app/Presentation/DomainConfiguration/details-list-item/details-list-item.component.ts ***! - \***************************************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ DetailsListItemComponent: () => (/* binding */ DetailsListItemComponent) -/* harmony export */ }); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/material/form-field */ 29344); - - -let DetailsListItemComponent = /*#__PURE__*/(() => { - class DetailsListItemComponent { - constructor() { - this.iconInitiated = false; + getIconForName(iconName) { + return this.allIconListItems.get(iconName); } - get id() { - return 'domain-configuration-details-icon-' + this.icon.name.toLowerCase() + '-' + (this.icon.isWorkObject ? 'workobject' : 'actor'); + isIconActor(iconName) { + return this.iconSetConfigurationTypes.value.actors.filter(actor => actor === iconName).length > 0; } - get name() { - return this.icon.name; + isIconWorkObject(iconName) { + return this.iconSetConfigurationTypes.value.workObjects.filter(workObject => workObject === iconName).length > 0; } - ngAfterViewChecked() { - this.createIcon(); + changeName(iconSetName) { + this.titleService.setIconSetName(iconSetName); + const changedIconSet = this.iconSetConfigurationTypes.value; + changedIconSet.name = iconSetName; + this.iconSetConfigurationTypes.next(changedIconSet); } - createIcon() { - const img = document.getElementById(this.id); - if (img && !this.iconInitiated) { - img.src = '' + this.icon.svg; - this.iconInitiated = true; + /** Selected Icons **/ + setAsUnassigned(iconName, isActor) { + if (isActor) { + this.deselectActor(iconName); + } else { + this.deselectWorkobject(iconName); } + this.updateIcon(false, false, iconName); } - static #_ = this.ɵfac = function DetailsListItemComponent_Factory(t) { - return new (t || DetailsListItemComponent)(); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ - type: DetailsListItemComponent, - selectors: [["app-details-list-item"]], - inputs: { - icon: "icon" - }, - decls: 4, - vars: 4, - consts: [[1, "detailsListItem"], [1, "icon", 3, "id", "alt", "src"], [1, "iconName"]], - template: function DetailsListItemComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](1, "img", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "mat-label", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](3); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + setAsActor(isActor, actor) { + if (isActor) { + this.updateIcon(true, false, actor); + this.selectActor(actor); + this.deselectWorkobject(actor); + } else { + this.deselectActor(actor); + this.updateIcon(false, false, actor); + } + } + setAsWorkobject(isWorkobject, workobject) { + if (isWorkobject) { + this.updateIcon(false, true, workobject); + this.selectWorkObject(workobject); + this.deselectActor(workobject); + } else { + this.deselectWorkobject(workobject); + this.updateIcon(false, false, workobject); + } + } + selectActor(actor) { + const value = this.iconSetConfigurationTypes.value; + if (!value.actors.includes(actor)) { + value.actors.push(actor); + this.iconSetConfigurationTypes.next(value); + this.updateActorSubject(); + } + } + selectWorkObject(workObject) { + const value = this.iconSetConfigurationTypes.value; + if (!value.workObjects.includes(workObject)) { + value.workObjects.push(workObject); + this.iconSetConfigurationTypes.next(value); + this.updateWorkObjectSubject(); + } + } + deselectActor(actor) { + if (this.iconSetConfigurationTypes) { + this.iconSetConfigurationTypes.next({ + name: this.iconSetConfigurationTypes.value.name, + actors: this.iconSetConfigurationTypes.value.actors.filter(a => !a.includes(actor)), + workObjects: this.iconSetConfigurationTypes.value.workObjects + }); + } + this.updateActorSubject(); + } + deselectWorkobject(workobject) { + if (this.iconSetConfigurationTypes) { + this.iconSetConfigurationTypes.next({ + name: this.iconSetConfigurationTypes.value.name, + actors: this.iconSetConfigurationTypes.value.actors, + workObjects: this.iconSetConfigurationTypes.value.workObjects.filter(w => !w.includes(workobject)) + }); + } + this.updateWorkObjectSubject(); + } + setSelectedWorkObject(sortedList) { + const value = this.iconSetConfigurationTypes.value; + value.workObjects = sortedList; + this.iconSetConfigurationTypes.next(value); + this.updateWorkObjectSubject(); + } + setSelectedActors(sortedList) { + const value = this.iconSetConfigurationTypes.value; + value.actors = sortedList; + this.iconSetConfigurationTypes.next(value); + this.updateActorSubject(); + } + updateActorSubject() { + this.selectedActors$.next(this.iconSetConfigurationTypes.value.actors); + this.configurationHasChanged = true; + } + updateWorkObjectSubject() { + this.selectedWorkobjects$.next(this.iconSetConfigurationTypes.value.workObjects); + this.configurationHasChanged = true; + } + /** Revert Icon Set **/ + resetIconSet() { + const defaultConfig = this.iconSetConfigurationService.createMinimalConfigurationWithDefaultIcons(); + this.selectedWorkobjects$.value.forEach(workObjectName => { + if (!defaultConfig.workObjects.has(workObjectName)) { + this.deselectWorkobject(workObjectName); } - if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpropertyInterpolate"]("id", ctx.id); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpropertyInterpolate"]("alt", ctx.name); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", ctx.icon.svg, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeUrl"]); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](ctx.icon.name); + }); + this.selectedActors$.value.forEach(actorName => { + if (!defaultConfig.actors.has(actorName)) { + this.deselectActor(actorName); } - }, - dependencies: [_angular_material_form_field__WEBPACK_IMPORTED_MODULE_1__.MatLabel], - styles: [".icon[_ngcontent-%COMP%] {\n width: 20px;\n height: 20px;\n padding-right: 3px;\n}\n\n.detailsListItem[_ngcontent-%COMP%] {\n display: flex;\n justify-items: center;\n align-items: center;\n width: 250px;\n}\n\n.iconName[_ngcontent-%COMP%] {\n max-width: 225px;\n word-wrap: anywhere;\n white-space: pre-wrap !important;\n}"] + }); + this.iconSetConfigurationTypes.next({ + name: defaultConfig.name, + actors: defaultConfig.actors.keysArray(), + workObjects: defaultConfig.workObjects.keysArray() + }); + this.updateAllIconBehaviourSubjects(); + } + cancel() { + this.iconSetConfigurationTypes.next(this.iconSetConfigurationService.getCurrentConfigurationNamesWithoutPrefix()); + this.updateAllIconBehaviourSubjects(); + this.resetToInitialConfiguration(); + } + resetToInitialConfiguration() { + this.updateActorSubject(); + this.updateWorkObjectSubject(); + } + /** Persist Icon Set **/ + saveIconSet(usedIcons, imported = false) { + const changedActors = []; + const changedWorkobjects = []; + if (this.configurationHasChanged) { + const changedIconSet = this.createIconSetConfiguration(); + const configurationActors = changedIconSet.actors.keysArray(); + usedIcons?.actors.forEach(actor => { + if (!configurationActors?.includes(actor) && !changedActors.includes(actor)) { + changedActors.push(actor); + } + }); + const configurationWorkobjects = changedIconSet.workObjects.keysArray(); + usedIcons?.workobjects.forEach(workobject => { + if (!configurationWorkobjects?.includes(workobject) && !changedWorkobjects.includes(workobject)) { + changedWorkobjects.push(workobject); + } + }); + if (!changedActors.length && !changedWorkobjects.length) { + this.changedIconSetConfiguration = changedIconSet; + this.updateIcons(changedIconSet); + this.iconSetConfigurationService.setStoredIconSetConfiguration(this.changedIconSetConfiguration); + this.snackbar.open(imported ? 'Configuration imported successfully' : 'Configuration saved successfully', undefined, { + duration: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION, + panelClass: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_SUCCESS + }); + } + } else { + this.snackbar.open(imported ? 'No configuration to be imported' : 'No configuration to be saved', undefined, { + duration: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION, + panelClass: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_INFO + }); + } + if (changedActors.length || changedWorkobjects.length) { + if (changedActors.length) { + const actors = changedActors.join(', '); + this.snackbar.open(`The following icons are already in use as actors and cannot be changed: ${actors}`, undefined, { + duration: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION * 3, + panelClass: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_INFO + }); + } + if (changedWorkobjects.length) { + const workobjects = changedWorkobjects.join(', '); + this.snackbar.open(`The following icons are already in use as workobjects and cannot be changed: ${workobjects}`, undefined, { + duration: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION * 3, + panelClass: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_INFO + }); + } + } + } + exportIconSet() { + this.iconSetConfigurationService.exportConfiguration(); + } + getAndClearSavedConfiguration() { + const temp = this.changedIconSetConfiguration; + this.changedIconSetConfiguration = undefined; + return temp; + } + createIconSetConfiguration() { + const actors = new _domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); + const workObjects = new _domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); + this.iconSetConfigurationTypes.value.actors.forEach(name => { + actors.add(this.iconDictionaryService.getIconSource(name), name); + }); + this.iconSetConfigurationTypes.value.workObjects.forEach(name => { + workObjects.add(this.iconDictionaryService.getIconSource(name), name); + }); + return { + name: this.iconSetConfigurationTypes.value.name || '', + actors, + workObjects + }; + } + /** Update Icons **/ + addNewIcon(iconName) { + const iconDict = new _domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); + iconDict.add(this.getSrcForIcon(iconName), iconName); + this.iconDictionaryService.addIconsToCss(iconDict); + this.addIconToAllIconList(iconName); + } + addIconToAllIconList(iconName) { + this.allIconListItems.add(new rxjs__WEBPACK_IMPORTED_MODULE_7__.BehaviorSubject({ + name: iconName, + svg: this.getSrcForIcon(iconName), + isActor: this.isIconActor(iconName), + isWorkObject: this.isIconWorkObject(iconName) + }), iconName); + } + updateIcon(isActor, isWorkobject, iconName) { + const iconBehaviourSubject = this.getIconForName(iconName); + const icon = iconBehaviourSubject.value; + icon.isActor = isActor; + icon.isWorkObject = isWorkobject; + iconBehaviourSubject.next(icon); + } + updateAllIconBehaviourSubjects() { + const customIconSetConfiguration = this.iconSetConfigurationTypes.value; + this.allIconListItems.keysArray().forEach(iconName => { + if (customIconSetConfiguration.actors.includes(iconName)) { + this.updateIcon(true, false, iconName); + } else if (customIconSetConfiguration.workObjects.includes(iconName)) { + this.updateIcon(false, true, iconName); + } else { + this.updateIcon(false, false, iconName); + } + }); + } + getSrcForIcon(name) { + let iconName; + if (name.includes(_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.DOMAINSTORY)) { + // TODO: td: This returns empty every time! + iconName = getIconId(name); + } else { + iconName = name; + } + const rawSrc = this.iconDictionaryService.getIconSource(iconName); + if (!rawSrc) { + return ''; + } + if (rawSrc.startsWith('data')) { + return rawSrc; + } else { + return 'data:image/svg+xml,' + rawSrc; + } + } + updateIcons(changedIconSet) { + this.allIconListItems.keysArray().forEach(item => this.setAsUnassigned(item, this.isIconActor(item))); + changedIconSet.actors.keysArray().forEach(actor => { + this.iconDictionaryService.registerIconForType(_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR, actor, this.iconDictionaryService.getFullDictionary().get(actor)); + this.iconDictionaryService.unregisterIconForType(_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT, actor); + this.setAsActor(true, actor); + }); + changedIconSet.workObjects.keysArray().forEach(workObject => { + this.iconDictionaryService.registerIconForType(_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT, workObject, this.iconDictionaryService.getFullDictionary().get(workObject)); + this.iconDictionaryService.unregisterIconForType(_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR, workObject); + this.setAsWorkobject(true, workObject); + }); + } + static #_ = this.ɵfac = function IconSetCustomizationService_Factory(t) { + return new (t || IconSetCustomizationService)(_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_3__.IconSetConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_4__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](IconSetChangedService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_title_services_title_service__WEBPACK_IMPORTED_MODULE_5__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_6__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_9__.MatSnackBar)); + }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdefineInjectable"]({ + token: IconSetCustomizationService, + factory: IconSetCustomizationService.ɵfac, + providedIn: 'root' }); } - return DetailsListItemComponent; + return IconSetCustomizationService; })(); /***/ }), -/***/ 58414: -/*!*********************************************************************************************!*\ - !*** ./src/app/Presentation/DomainConfiguration/icon-list-item/icon-list-item.component.ts ***! - \*********************************************************************************************/ +/***/ 93586: +/*!**********************************************************************!*\ + !*** ./src/app/tools/import/services/import-domain-story.service.ts ***! + \**********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ IconListItemComponent: () => (/* binding */ IconListItemComponent) +/* harmony export */ ImportDomainStoryService: () => (/* binding */ ImportDomainStoryService) /* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 95981); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _Service_IconSetConfiguration_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Service/IconSetConfiguration/icon-set-customization.service */ 87007); -/* harmony import */ var _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/button-toggle */ 26470); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/dictionary */ 20843); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var _domain_presentation_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../domain/presentation/info-dialog/info-dialog.component */ 10454); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +/* harmony import */ var _domain_entities_infoDialogData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../domain/entities/infoDialogData */ 11719); +/* harmony import */ var _domain_entities_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../domain/entities/constants */ 40550); +/* harmony import */ var src_app_tools_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/tools/icon-set-config/services/icon-dictionary.service */ 6932); +/* harmony import */ var src_app_tools_import_services_import_repair_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/tools/import/services/import-repair.service */ 56511); +/* harmony import */ var src_app_tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/tools/title/services/title.service */ 41535); +/* harmony import */ var src_app_tools_modeler_services_renderer_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/tools/modeler/services/renderer.service */ 63812); +/* harmony import */ var _domain_services_dialog_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../domain/services/dialog.service */ 12855); +/* harmony import */ var _icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../icon-set-config/services/icon-set-configuration.service */ 46527); +/* harmony import */ var _modeler_services_modeler_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../modeler/services/modeler.service */ 40439); +/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); -let IconListItemComponent = /*#__PURE__*/(() => { - class IconListItemComponent { - get name() { - return this.iconName; - } - get id() { - return 'domain-configuration-icon-' + this.iconName; - } - constructor(iconSetCustomizationService) { - this.iconSetCustomizationService = iconSetCustomizationService; - this.iconName = ''; - this.iconInitiated = false; - // @ts-ignore - this.icon = new rxjs__WEBPACK_IMPORTED_MODULE_1__.BehaviorSubject({}); - this.isActor = false; - this.isWorkobject = false; - this.isNone = true; - } - ngOnInit() { - this.icon = this.iconSetCustomizationService.getIconForName(this.iconName); - if (!this.icon) { - return; - } - this.icon.subscribe(value => { - this.isActor = value.isActor; - this.isWorkobject = value.isWorkObject; - this.isNone = !(value.isActor || value.isWorkObject); - }); - this.isActor = this.icon.value.isActor; - this.isWorkobject = this.icon.value.isWorkObject; - this.isNone = !(this.icon.value.isActor || this.icon.value.isWorkObject); - } - ngAfterViewChecked() { - this.createIcon(); - } - createIcon() { - const img = document.getElementById(this.id); - if (img && !this.iconInitiated) { - img.src = '' + this.icon.value?.svg; - this.iconInitiated = true; - } - } - toggleNone() { - this.iconSetCustomizationService.setAsUnassigned(this.iconName, this.icon.value.isActor); - } - toggleActor() { - this.iconSetCustomizationService.setAsActor(true, this.iconName); - } - toggleWorkobject() { - this.iconSetCustomizationService.setAsWorkobject(true, this.iconName); - } - static #_ = this.ɵfac = function IconListItemComponent_Factory(t) { - return new (t || IconListItemComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_Service_IconSetConfiguration_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_0__.IconSetCustomizationService)); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ - type: IconListItemComponent, - selectors: [["app-icon-list-item"]], - inputs: { - iconName: "iconName" - }, - decls: 16, - vars: 13, - consts: [[1, "content"], ["src", "", 1, "icon", 3, "id", "alt"], [1, "name"], [1, "footer"], [3, "change", "value", "checked"], [1, "toggleButtonTitle"]], - template: function IconListItemComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "div")(1, "div", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](2, "img", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](3, "div", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](5, "div", 3)(6, "mat-button-toggle-group")(7, "mat-button-toggle", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("change", function IconListItemComponent_Template_mat_button_toggle_change_7_listener() { - return ctx.toggleNone(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](8, "span", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](9, "None"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](10, "mat-button-toggle", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("change", function IconListItemComponent_Template_mat_button_toggle_change_10_listener() { - return ctx.toggleActor(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](11, "span", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](12, "Actor"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](13, "mat-button-toggle", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("change", function IconListItemComponent_Template_mat_button_toggle_change_13_listener() { - return ctx.toggleWorkobject(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](14, "span", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](15, "Workobject"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()()()()(); - } - if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵpropertyInterpolate"]("id", ctx.id); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵpropertyInterpolate"]("alt", ctx.name); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtextInterpolate"](ctx.name); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("value", ctx.isNone)("checked", ctx.isNone); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵclassProp"]("activeMatButtonActor", ctx.isActor); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("value", ctx.isActor)("checked", ctx.isActor); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵclassProp"]("activeMatButtonWorkObject", ctx.isWorkobject); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("value", ctx.isWorkobject)("checked", ctx.isWorkobject); - } - }, - dependencies: [_angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_3__.MatButtonToggleGroup, _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_3__.MatButtonToggle], - styles: [".content[_ngcontent-%COMP%] {\n display: grid;\n grid-template-rows: auto auto;\n justify-items: center;\n}\n\n.icon[_ngcontent-%COMP%] {\n width: 50px;\n height: 50px;\n}\n\n.name[_ngcontent-%COMP%] {\n word-wrap: anywhere;\n max-height: 75px;\n overflow: hidden;\n padding-bottom: 2px;\n}\n\n.footer[_ngcontent-%COMP%] {\n display: flex;\n justify-content: center;\n}\n.footer[_ngcontent-%COMP%] .mat-button-toggle-label-content {\n font-size: 10pt !important;\n padding: 0 5px !important;\n line-height: inherit !important;\n}\n.footer[_ngcontent-%COMP%] .activeMatButtonActor button {\n background-color: #43acbf;\n color: #ffffff;\n}\n.footer[_ngcontent-%COMP%] .activeMatButtonWorkObject button {\n background-color: #0168b7;\n color: #ffffff;\n}"] - }); - } - return IconListItemComponent; -})(); - -/***/ }), - -/***/ 38574: -/*!**************************************************************************************!*\ - !*** ./src/app/Presentation/DomainConfiguration/icon-set-configuration.component.ts ***! - \**************************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ IconSetConfigurationComponent: () => (/* binding */ IconSetConfigurationComponent) -/* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs */ 95981); -/* harmony import */ var src_app_Domain_Icon_Set_Configuration_iconSetConfiguration__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Icon-Set-Configuration/iconSetConfiguration */ 77044); -/* harmony import */ var src_app_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Utils/sanitizer */ 66107); -/* harmony import */ var _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Domain/Common/elementTypes */ 30236); -/* harmony import */ var _Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Domain/Icon-Set-Configuration/iconFilterEnum */ 36105); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var src_app_Service_IconSetConfiguration_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/Service/IconSetConfiguration/icon-set-configuration.service */ 10200); -/* harmony import */ var src_app_Service_IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/Service/IconSetConfiguration/icon-dictionary.service */ 93689); -/* harmony import */ var _Service_IconSetConfiguration_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../Service/IconSetConfiguration/icon-set-customization.service */ 87007); -/* harmony import */ var src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/Service/ElementRegistry/element-registry.service */ 67613); -/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/material/button */ 72221); -/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/material/input */ 92583); -/* harmony import */ var _icon_list_item_icon_list_item_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./icon-list-item/icon-list-item.component */ 58414); -/* harmony import */ var _icon_set_details_icon_set_details_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./icon-set-details/icon-set-details.component */ 79052); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @angular/common */ 56610); - - @@ -69294,502 +68175,453 @@ __webpack_require__.r(__webpack_exports__); - -function IconSetConfigurationComponent_For_44_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelement"](0, "app-icon-list-item", 19); - } - if (rf & 2) { - const iconName_r1 = ctx.$implicit; - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵproperty"]("iconName", iconName_r1); - } -} -let IconSetConfigurationComponent = /*#__PURE__*/(() => { - class IconSetConfigurationComponent { - constructor(configurationService, iconDictionaryService, iconSetCustomizationService, elementRegistryService) { - this.configurationService = configurationService; +let ImportDomainStoryService = /*#__PURE__*/(() => { + class ImportDomainStoryService { + constructor(iconDictionaryService, importRepairService, titleService, rendererService, dialogService, iconSetConfigurationService, modelerService, snackbar) { this.iconDictionaryService = iconDictionaryService; - this.iconSetCustomizationService = iconSetCustomizationService; - this.elementRegistryService = elementRegistryService; - this.filter = new rxjs__WEBPACK_IMPORTED_MODULE_11__.BehaviorSubject(_Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_NONE); - this.selectedActors = new rxjs__WEBPACK_IMPORTED_MODULE_11__.BehaviorSubject([]); - this.selectedWorkobjects = new rxjs__WEBPACK_IMPORTED_MODULE_11__.BehaviorSubject([]); - this.allIconNames = new rxjs__WEBPACK_IMPORTED_MODULE_11__.BehaviorSubject([]); - this.allFilteredIconNames = new rxjs__WEBPACK_IMPORTED_MODULE_11__.BehaviorSubject([]); - this.iconSetConfigurationTypes = this.iconSetCustomizationService.getIconSetConfiguration().value; - this.allIcons = new rxjs__WEBPACK_IMPORTED_MODULE_11__.BehaviorSubject(this.iconDictionaryService.getFullDictionary()); - this.allIcons.subscribe(allIcons => { - this.allIconNames.next(allIcons.keysArray().sort(this.sortByName)); + this.importRepairService = importRepairService; + this.titleService = titleService; + this.rendererService = rendererService; + this.dialogService = dialogService; + this.iconSetConfigurationService = iconSetConfigurationService; + this.modelerService = modelerService; + this.snackbar = snackbar; + this.title = _domain_entities_constants__WEBPACK_IMPORTED_MODULE_4__.INITIAL_TITLE; + this.description = _domain_entities_constants__WEBPACK_IMPORTED_MODULE_4__.INITIAL_DESCRIPTION; + this.importedConfiguration = null; + this.importedConfigurationEmitter = new _angular_core__WEBPACK_IMPORTED_MODULE_12__.EventEmitter(); + this.titleSubscription = this.titleService.title$.subscribe(title => { + this.title = title; }); - this.selectedActors = this.iconSetCustomizationService.selectedActors$; - this.selectedWorkobjects = this.iconSetCustomizationService.selectedWorkobjects$; - } - ngOnInit() { - this.filter.subscribe(type => { - let allFiltered = this.getFilteredNamesForType(type); - this.allFilteredIconNames.next(allFiltered.sort(this.sortByName)); + this.descriptionSubscription = this.titleService.description$.subscribe(description => { + this.description = description; }); } - sortByName(a, b) { - if (a.includes('_custom') == b.includes('_custom')) { - if (a < b) return -1;else { - return 1; - } - } else { - if (a.includes('_custom')) { - return -1; - } else { - return 1; - } - } - } - /** Default Icon Set **/ - loadMinimalIconConfigurationWithDefaultIcons() { - this.iconSetCustomizationService.resetIconSet(); - } - loadInitialConfiguration() { - this.iconSetCustomizationService.cancel(); - } - /** Persist Icon Set **/ - saveIconSet() { - this.iconSetCustomizationService.saveIconSet(this.elementRegistryService.getUsedIcons()); + ngOnDestroy() { + this.titleSubscription.unsubscribe(); + this.descriptionSubscription.unsubscribe(); } - exportIconSet() { - this.iconSetCustomizationService.exportIconSet(); + iconConfigrationChanged() { + return this.importedConfigurationEmitter.asObservable(); } - /** Add Custom Icon **/ - startIconUpload() { - document.getElementById('importIcon')?.click(); + getConfiguration() { + const config = { + name: this.importedConfiguration?.name || '', + actors: this.importedConfiguration?.actors || new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(), + workObjects: this.importedConfiguration?.workObjects || new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary() + }; + this.importedConfiguration = null; + return config; } - importIcon() { + performImport() { // @ts-ignore - const files = document.getElementById('importIcon').files; - for (let iconInputFile of files) { - const reader = new FileReader(); - const name = (0,src_app_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_1__.sanitizeIconName)(iconInputFile.name); - const iconName = name + _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.CUSTOM; - reader.onloadend = e => { - if (e.target) { - const src = e.target.result; - this.iconDictionaryService.addIMGToIconDictionary(src, iconName); - // TODO: td: What kind of type is it here? - this.iconDictionaryService.registerIconForBPMN(iconName, src, _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR); - this.allIcons.next(this.iconDictionaryService.getFullDictionary()); - this.filter.next(this.filter.value); - this.iconSetCustomizationService.addNewIcon(iconName); - } - }; - reader.readAsDataURL(iconInputFile); + const file = document.getElementById('import').files[0]; + const filename = file.name; + const dstSvgPattern = /.*(.dst)(\s*\(\d+\)){0,1}\.svg/; + const egnSvgPattern = /.*(.egn)(\s*\(\d+\)){0,1}\.svg/; + if (filename.endsWith('.dst')) { + this.importDST(file, filename, false); + } else if (filename.match(dstSvgPattern)) { + this.importDST(file, filename, true); + } else if (filename.endsWith('.egn')) { + this.importEGN(file, filename, false); + } else if (filename.match(egnSvgPattern)) { + this.importEGN(file, filename, true); } + this.modelerService.commandStackChanged(); } - /** Import Icon Set **/ - startIconSetImport() { - document.getElementById('importDomain')?.click(); - } - importIconSet() { - // @ts-ignore - const iconSetInputFile = document.getElementById('importDomain').files[0]; - const reader = new FileReader(); - reader.onloadend = e => { - const configFromFile = JSON.parse(e.target?.result); - const config = (0,src_app_Domain_Icon_Set_Configuration_iconSetConfiguration__WEBPACK_IMPORTED_MODULE_0__.fromConfigurationFromFile)(configFromFile); - this.configurationService.loadConfiguration(config, false); - this.iconSetCustomizationService.importConfiguration(config); + importDST(input, filename, isSVG) { + const fileReader = new FileReader(); + const titleText = this.restoreTitleFromFileName(filename, isSVG); + // no need to put this on the commandStack + this.titleService.updateTitleAndDescription(titleText, null, false); + fileReader.onloadend = e => { + if (e && e.target) { + this.fileReaderFunction(e.target.result, isSVG, false); + } }; - reader.readAsText(iconSetInputFile); - } - /** Filter **/ - filterForActors() { - if (this.filter.value !== _Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_ACTOR) { - this.filter.next(_Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_ACTOR); - } else { - this.filter.next(_Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_NONE); - } - } - filterForWorkobjects() { - if (this.filter.value !== _Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_WORKOBJECT) { - this.filter.next(_Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_WORKOBJECT); - } else { - this.filter.next(_Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_NONE); - } + fileReader.readAsText(input); } - filterForUnassigned() { - if (this.filter.value !== _Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_UNASSIGNED) { - this.filter.next(_Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_UNASSIGNED); - } else { - this.filter.next(_Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_NONE); - } + importEGN(input, filename, isSVG) { + const fileReader = new FileReader(); + const titleText = this.restoreTitleFromFileName(filename, isSVG); + // no need to put this on the commandStack + this.titleService.updateTitleAndDescription(titleText, null, false); + fileReader.onloadend = e => { + if (e && e.target) { + this.fileReaderFunction(e.target.result, isSVG, true); + } + }; + fileReader.readAsText(input); } - filterByNameAndType($event) { - const filteredByNameAndType = this.getFilteredNamesForType(this.filter.value).filter(name => name.toLowerCase().includes($event.target.value.toLowerCase())); - this.allFilteredIconNames.next(filteredByNameAndType.sort(this.sortByName)); + fileReaderFunction(text, isSVG, isEGN) { + let dstText; + if (typeof text === 'string') { + if (isSVG) { + dstText = this.removeXMLComments(text); + } else { + dstText = text; + } + let elements; + let config; + let configFromFile; + let dstAndConfig = this.extractDstAndConfig(dstText, isSVG); + if (dstAndConfig == null) { + return; + } + // current implementation + if (dstAndConfig.domain) { + configFromFile = isEGN ? dstAndConfig.domain : JSON.parse(dstAndConfig.domain); + config = this.iconSetConfigurationService.createIconSetConfiguration(configFromFile); + elements = isEGN ? dstAndConfig.dst : JSON.parse(dstAndConfig.dst); + } else { + // legacy implementation + if (dstAndConfig.config) { + configFromFile = JSON.parse(dstAndConfig.config); + config = this.iconSetConfigurationService.createIconSetConfiguration(configFromFile); + elements = JSON.parse(dstAndConfig.dst); + } else { + // implementation prior to configuration + elements = JSON.parse(dstText); + config = this.iconSetConfigurationService.createMinimalConfigurationWithDefaultIcons(); + } + } + const configChanged = this.checkConfigForChanges(config); + let lastElement = elements[elements.length - 1]; + if (!lastElement.id) { + lastElement = elements.pop(); + let importVersionNumber = lastElement; + // if the last element has the importedVersionNumber has the tag version, + // then there exists another meta tag 'info' for the description + if (importVersionNumber.version) { + lastElement = elements.pop(); + } + if (importVersionNumber.version) { + importVersionNumber = importVersionNumber.version; + } else { + importVersionNumber = '?'; + this.snackbar.open(`The version number is unreadable.`, undefined, { + duration: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_4__.SNACKBAR_DURATION, + panelClass: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_4__.SNACKBAR_ERROR + }); + } + elements = this.handleVersionNumber(importVersionNumber, elements); + } + if (!this.importRepairService.checkForUnreferencedElementsInActivitiesAndRepair(elements)) { + this.showBrokenImportDialog(isSVG ? 'SVG' : 'DST'); + } + this.titleService.updateTitleAndDescription(this.title, lastElement.info, false); + this.importRepairService.adjustPositions(elements); + this.updateIconRegistries(elements, config); + this.rendererService.importStory(elements, configChanged, config); + } } - getFilteredNamesForType(type) { - let allFiltered = []; - switch (type) { - case _Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_NONE: - allFiltered = this.allIconNames.value; - break; - case _Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_ACTOR: - allFiltered = this.allIconNames.value.filter(name => this.iconSetCustomizationService.isIconActor(name)); - break; - case _Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_WORKOBJECT: - allFiltered = this.allIconNames.value.filter(name => this.iconSetCustomizationService.isIconWorkObject(name)); - break; - case _Domain_Icon_Set_Configuration_iconFilterEnum__WEBPACK_IMPORTED_MODULE_3__.IconFilterEnum.ICON_FILTER_UNASSIGNED: - allFiltered = this.allIconNames.value.filter(name => !this.iconSetCustomizationService.isIconActor(name) && !this.iconSetCustomizationService.isIconWorkObject(name)); - break; + handleVersionNumber(importVersionNumber, elements) { + const versionPrefix = +importVersionNumber.substring(0, importVersionNumber.lastIndexOf('.')); + if (versionPrefix <= 0.5) { + elements = this.importRepairService.updateCustomElementsPreviousV050(elements); + this.showPreviousV050Dialog(versionPrefix); } - return allFiltered; + return elements; } - static #_ = this.ɵfac = function IconSetConfigurationComponent_Factory(t) { - return new (t || IconSetConfigurationComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](src_app_Service_IconSetConfiguration_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_4__.IconSetConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](src_app_Service_IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_5__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_Service_IconSetConfiguration_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_6__.IconSetCustomizationService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_7__.ElementRegistryService)); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineComponent"]({ - type: IconSetConfigurationComponent, - selectors: [["app-icon-set-configuration"]], - decls: 47, - vars: 14, - consts: [[1, "content"], [1, "header"], [1, "searchbar"], ["mat-button", "", "title", "Unassigned Icons", 3, "click"], ["mat-button", "", "title", "Actors", 3, "click"], ["mat-button", "", "title", "Workobjects", 3, "click"], ["matInput", "", "type", "text", "placeholder", "Filter by name", 1, "textInput", 3, "input"], [1, "buttons"], ["mat-button", "", "title", "Upload Icon", 3, "click"], [1, "material-icons-outlined", "materialIconButton"], ["type", "file", "multiple", "", "accept", ".svg, image/png, image/jpeg, image/gif, image/bpmn", "id", "importIcon", "name", "file", "onclick", "this.value=null", 2, "display", "none", 3, "change"], ["mat-button", "", "title", "Reset to default icon set", 1, "button", 3, "click"], ["mat-button", "", "title", "Cancel changes", 3, "click"], [1, "divider"], ["mat-button", "", "title", "Save icon set", 3, "click"], ["mat-button", "", "title", "Import icon set", 3, "click"], ["type", "file", "accept", ".domain, .iconset", "id", "importDomain", "name", "file", "onclick", "this.value=null", 2, "display", "none", 3, "change"], ["mat-button", "", "title", "Export icon set", 3, "click"], [1, "iconList", "smallScrollbar"], [3, "iconName"], [1, "iconSetDetails"]], - template: function IconSetConfigurationComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](0, "div", 0)(1, "div")(2, "div", 1)(3, "div", 2)(4, "div"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](5, "Filter by assignment:"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](6, "button", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](7, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_6_listener() { - return ctx.filterForUnassigned(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](8, "span"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](9, "None"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](10, "button", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](11, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_10_listener() { - return ctx.filterForActors(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](12, "span"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](13, "Actors"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](14, "button", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](15, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_14_listener() { - return ctx.filterForWorkobjects(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](16, "span"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](17, "Workobjects"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](18, "input", 6); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("input", function IconSetConfigurationComponent_Template_input_input_18_listener($event) { - return ctx.filterByNameAndType($event); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](19, "div", 7)(20, "button", 8); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_20_listener() { - return ctx.startIconUpload(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](21, "span", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](22, "upload"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](23, "input", 10); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("change", function IconSetConfigurationComponent_Template_input_change_23_listener() { - return ctx.importIcon(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](24, "button", 11); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_24_listener() { - return ctx.loadMinimalIconConfigurationWithDefaultIcons(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](25, "span", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](26, " home "); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](27, "button", 12); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_27_listener() { - return ctx.loadInitialConfiguration(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](28, "span", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](29, "close"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelement"](30, "div", 13); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](31, "button", 14); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_31_listener() { - return ctx.saveIconSet(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](32, "span", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](33, "save"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelement"](34, "div", 13); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](35, "button", 15); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_35_listener() { - return ctx.startIconSetImport(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](36, "span", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](37, "unarchive"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](38, "input", 16); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("change", function IconSetConfigurationComponent_Template_input_change_38_listener() { - return ctx.importIconSet(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](39, "button", 17); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("click", function IconSetConfigurationComponent_Template_button_click_39_listener() { - return ctx.exportIconSet(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](40, "span", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](41, "archive"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()()()(); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](42, "div", 18); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵrepeaterCreate"](43, IconSetConfigurationComponent_For_44_Template, 1, 1, "app-icon-list-item", 19, _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵrepeaterTrackByIdentity"]); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](45, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelement"](46, "app-icon-set-details", 20); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"](); + extractDstAndConfig(dstText, isSVG) { + let dstAndConfig = null; + try { + dstAndConfig = JSON.parse(dstText); + } catch (e) { + this.showBrokenImportDialog(isSVG ? 'SVG' : 'DST'); + } + return dstAndConfig; + } + removeXMLComments(xmlText) { + xmlText = xmlText.substring(xmlText.indexOf('')); + while (xmlText.includes('')) { + xmlText = xmlText.replace('', ''); + } + xmlText = xmlText.replace('', ''); + xmlText = xmlText.replace('', ''); + return xmlText; + } + checkConfigForChanges(iconSetConfiguration) { + const newActorKeys = iconSetConfiguration.actors.keysArray(); + const newWorkObjectKeys = iconSetConfiguration.workObjects.keysArray(); + const currentActorKeys = this.iconDictionaryService.getTypeDictionaryKeys(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR); + const currentWorkobjectKeys = this.iconDictionaryService.getTypeDictionaryKeys(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT); + let changed = false; + if (newActorKeys.length !== currentActorKeys.length || newWorkObjectKeys.length !== currentWorkobjectKeys.length) { + return true; + } + for (let i = 0; i < newActorKeys.length; i++) { + changed = this.clearName(currentActorKeys[i]) !== this.clearName(newActorKeys[i]); + if (changed) { + i = newActorKeys.length; } - if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](6); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵclassProp"]("activeNone", _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](7, 6, ctx.filter) === "ICON_FILTER_UNASSIGNED"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵclassProp"]("activeActor", _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](11, 8, ctx.filter) === "ICON_FILTER_ACTOR"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵclassProp"]("activeWorkObject", _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](15, 10, ctx.filter) === "ICON_FILTER_WORKOBJECT"); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](29); - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵrepeater"](_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](45, 12, ctx.allFilteredIconNames)); + } + if (changed) { + return changed; + } + for (let i = 0; i < newWorkObjectKeys.length; i++) { + changed = this.clearName(currentWorkobjectKeys[i]) !== this.clearName(newWorkObjectKeys[i]); + if (changed) { + i = newWorkObjectKeys.length; } - }, - dependencies: [_angular_material_button__WEBPACK_IMPORTED_MODULE_12__.MatButton, _angular_material_input__WEBPACK_IMPORTED_MODULE_13__.MatInput, _icon_list_item_icon_list_item_component__WEBPACK_IMPORTED_MODULE_8__.IconListItemComponent, _icon_set_details_icon_set_details_component__WEBPACK_IMPORTED_MODULE_9__.IconSetDetailsComponent, _angular_common__WEBPACK_IMPORTED_MODULE_14__.AsyncPipe], - styles: [".content[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: auto 250px;\n}\n\n.header[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: max-content auto;\n height: 46px;\n border-bottom: #ccc 2px solid;\n}\n\n.searchbar[_ngcontent-%COMP%] {\n display: inline-flex;\n margin-left: 15px;\n margin-right: 15px;\n align-self: center;\n align-items: center;\n justify-self: left;\n height: inherit;\n border-right: #ccc 2px solid;\n}\n\n.buttons[_ngcontent-%COMP%] {\n display: inline-flex;\n align-self: center;\n align-items: center;\n justify-self: right;\n height: inherit;\n}\n.buttons[_ngcontent-%COMP%] .mat-button {\n min-width: 36px;\n}\n\n.divider[_ngcontent-%COMP%] {\n border-left: #ccc 2px solid;\n height: inherit;\n}\n\n.button[_ngcontent-%COMP%] {\n width: 36px;\n}\n\n.mat-button[_ngcontent-%COMP%] {\n color: #666666;\n}\n\n.activeActor[_ngcontent-%COMP%] {\n background-color: #42aebb;\n color: white;\n}\n\n.activeNone[_ngcontent-%COMP%] {\n background-color: #e0e0e0;\n color: black;\n}\n\n.activeWorkObject[_ngcontent-%COMP%] {\n background-color: #42aebb;\n color: white;\n}\n\n.textInput[_ngcontent-%COMP%] {\n width: 300px;\n margin-left: 15px;\n margin-right: 5px;\n border: #666666 1px solid;\n}\n\n.iconList[_ngcontent-%COMP%] {\n display: flex;\n overflow-y: scroll;\n height: calc(100vh - 130px);\n flex-direction: row;\n flex-wrap: wrap;\n align-content: baseline;\n margin-top: 1rem;\n margin-left: 1rem;\n gap: 1rem;\n}\n.iconList[_ngcontent-%COMP%] [_ngcontent-%COMP%]:nth-last-child(1) {\n margin-bottom: 1rem;\n}\n\n.iconSetDetails[_ngcontent-%COMP%] {\n width: 250px;\n}\n\n .mat-grid-tile .mat-grid-tile-content {\n justify-content: inherit;\n}"] + } + return changed; + } + clearName(name) { + return name.replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, '').replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, ''); + } + updateIconRegistries(elements, config) { + const actorIcons = this.iconDictionaryService.getElementsOfType(elements, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR); + const workObjectIcons = this.iconDictionaryService.getElementsOfType(elements, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT); + this.iconDictionaryService.updateIconRegistries(actorIcons, workObjectIcons, config); + this.setImportedConfigurationAndEmit(config); + } + showPreviousV050Dialog(version) { + const title = 'Old File Format Detected'; + const text = 'You uploaded a Domain Story that was created with Egon version ' + version + '. The file format has since changed. Egon converted your Domain Story to the new format but it cannot guarantee that your Domain Story is complete.'; + const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_13__.MatDialogConfig(); + config.disableClose = false; + config.autoFocus = true; + config.data = new _domain_entities_infoDialogData__WEBPACK_IMPORTED_MODULE_3__.InfoDialogData(title, text, true); + this.dialogService.openDialog(_domain_presentation_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_2__.InfoDialogComponent, config); + } + setImportedConfigurationAndEmit(config) { + this.importedConfiguration = config; + this.importedConfigurationEmitter.emit(config); + } + showBrokenImportDialog(type) { + const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_13__.MatDialogConfig(); + config.disableClose = false; + config.autoFocus = true; + config.data = new _domain_entities_infoDialogData__WEBPACK_IMPORTED_MODULE_3__.InfoDialogData('Error during import', 'The uploaded ' + type + ' is not complete, there could be elements missing from the canvas.', true, false); + this.dialogService.openDialog(_domain_presentation_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_2__.InfoDialogComponent, config); + } + restoreTitleFromFileName(filename, isSVG) { + let title; + const domainStoryRegex = /_\d+-\d+-\d+( ?_?-?\(\d+\))?(-?\d)?(.dst|.egn)/; + const svgRegex = /_\d+-\d+-\d+( ?_?-?\(\d+\))?(-?\d)?(.dst|.egn).svg/; + const egnSuffix = '.egn'; + const dstSuffix = '.dst'; + const svgSuffix = '.svg'; + let filenameWithoutDateSuffix = filename.replace(isSVG ? svgRegex : domainStoryRegex, ''); + if (filenameWithoutDateSuffix.includes(isSVG ? svgSuffix : dstSuffix)) { + filenameWithoutDateSuffix = filenameWithoutDateSuffix.replace(svgSuffix, '').replace(dstSuffix, '').replace(egnSuffix, ''); + } + title = filenameWithoutDateSuffix; + return title; + } + static #_ = this.ɵfac = function ImportDomainStoryService_Factory(t) { + return new (t || ImportDomainStoryService)(_angular_core__WEBPACK_IMPORTED_MODULE_12__["ɵɵinject"](src_app_tools_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_5__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_12__["ɵɵinject"](src_app_tools_import_services_import_repair_service__WEBPACK_IMPORTED_MODULE_6__.ImportRepairService), _angular_core__WEBPACK_IMPORTED_MODULE_12__["ɵɵinject"](src_app_tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_7__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_12__["ɵɵinject"](src_app_tools_modeler_services_renderer_service__WEBPACK_IMPORTED_MODULE_8__.RendererService), _angular_core__WEBPACK_IMPORTED_MODULE_12__["ɵɵinject"](_domain_services_dialog_service__WEBPACK_IMPORTED_MODULE_9__.DialogService), _angular_core__WEBPACK_IMPORTED_MODULE_12__["ɵɵinject"](_icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_10__.IconSetConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_12__["ɵɵinject"](_modeler_services_modeler_service__WEBPACK_IMPORTED_MODULE_11__.ModelerService), _angular_core__WEBPACK_IMPORTED_MODULE_12__["ɵɵinject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_14__.MatSnackBar)); + }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_12__["ɵɵdefineInjectable"]({ + token: ImportDomainStoryService, + factory: ImportDomainStoryService.ɵfac, + providedIn: 'root' }); } - return IconSetConfigurationComponent; + return ImportDomainStoryService; })(); /***/ }), -/***/ 79052: -/*!*************************************************************************************************!*\ - !*** ./src/app/Presentation/DomainConfiguration/icon-set-details/icon-set-details.component.ts ***! - \*************************************************************************************************/ +/***/ 56511: +/*!****************************************************************!*\ + !*** ./src/app/tools/import/services/import-repair.service.ts ***! + \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ IconSetDetailsComponent: () => (/* binding */ IconSetDetailsComponent) +/* harmony export */ ImportRepairService: () => (/* binding */ ImportRepairService) /* harmony export */ }); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var src_app_Service_IconSetConfiguration_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Service/IconSetConfiguration/icon-set-customization.service */ 87007); -/* harmony import */ var src_app_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Service/Title/title.service */ 69672); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/forms */ 37222); -/* harmony import */ var _angular_material_list__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/list */ 93901); -/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/form-field */ 29344); -/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/input */ 92583); -/* harmony import */ var _details_list_item_details_list_item_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../details-list-item/details-list-item.component */ 62748); - - - - - - - +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); -function IconSetDetailsComponent_mat_list_item_11_Template(rf, ctx) { - if (rf & 1) { - const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](0, "mat-list-item", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("dragover", function IconSetDetailsComponent_mat_list_item_11_Template_mat_list_item_dragover_0_listener($event) { - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrestoreView"](_r1); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵresetView"](ctx_r1.allowDrop($event, "actorList")); - })("dragstart", function IconSetDetailsComponent_mat_list_item_11_Template_mat_list_item_dragstart_0_listener() { - const i_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrestoreView"](_r1).index; - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵresetView"](ctx_r1.onDragStart(i_r3, "actorList")); - })("drop", function IconSetDetailsComponent_mat_list_item_11_Template_mat_list_item_drop_0_listener($event) { - const ctx_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrestoreView"](_r1); - const iconName_r5 = ctx_r3.$implicit; - const i_r3 = ctx_r3.index; - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵresetView"](ctx_r1.onDrop($event, iconName_r5, true, i_r3)); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelement"](1, "app-details-list-item", 10); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); - } - if (rf & 2) { - const iconName_r5 = ctx.$implicit; - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("icon", ctx_r1.getIconForName(iconName_r5)); - } -} -function IconSetDetailsComponent_mat_list_item_17_Template(rf, ctx) { - if (rf & 1) { - const _r6 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](0, "mat-list-item", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("dragover", function IconSetDetailsComponent_mat_list_item_17_Template_mat_list_item_dragover_0_listener($event) { - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrestoreView"](_r6); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵresetView"](ctx_r1.allowDrop($event, "workobjectList")); - })("dragstart", function IconSetDetailsComponent_mat_list_item_17_Template_mat_list_item_dragstart_0_listener() { - const i_r7 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrestoreView"](_r6).index; - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵresetView"](ctx_r1.onDragStart(i_r7, "workobjectList")); - })("drop", function IconSetDetailsComponent_mat_list_item_17_Template_mat_list_item_drop_0_listener($event) { - const ctx_r7 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵrestoreView"](_r6); - const iconName_r9 = ctx_r7.$implicit; - const i_r7 = ctx_r7.index; - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵresetView"](ctx_r1.onDrop($event, iconName_r9, false, i_r7)); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelement"](1, "app-details-list-item", 10); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); - } - if (rf & 2) { - const iconName_r9 = ctx.$implicit; - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("icon", ctx_r1.getIconForName(iconName_r9)); - } -} -let IconSetDetailsComponent = /*#__PURE__*/(() => { - class IconSetDetailsComponent { - constructor(customizationService, titleService) { - this.customizationService = customizationService; - this.draggedList = ''; - this.draggedIndex = 0; - this.selectedActors$ = this.customizationService.selectedActors$; - this.selectedWorkobjects$ = this.customizationService.selectedWorkobjects$; - this.iconSetName = titleService.iconSetName$; - } - ngOnInit() {} - changeName(event) { - // @ts-ignore - this.customizationService.changeName(event.target.value); - } - getIconForName(iconName) { - return this.customizationService.getIconForName(iconName).value; +/** + * Repairs broken Domain Stories so that it can be rendered onto the canvas + * by removing activities and connections that reference elements that don't exists + */ +let ImportRepairService = /*#__PURE__*/(() => { + class ImportRepairService { + checkForUnreferencedElementsInActivitiesAndRepair(elements) { + const activities = []; + const objectIDs = []; + let complete = true; + elements.forEach(element => { + const type = element.type; + if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY || type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.CONNECTION) { + activities.push(element); + } else { + objectIDs.push(element.id); + } + }); + activities.forEach(activity => { + const source = activity.source; + const target = activity.target; + if (!objectIDs.includes(source) || !objectIDs.includes(target)) { + complete = false; + const activityIndex = elements.indexOf(activity); + elements = elements.splice(activityIndex, 1); + } + }); + return complete; } - allowDrop($event, listName) { - if (this.draggedList === listName) { - $event.preventDefault(); + /** + * Ensure backwards compatibility. + * Previously Document had no special name and was just addressed as workObject + * Bubble was renamed to Conversation + */ + updateCustomElementsPreviousV050(elements) { + for (const element of elements) { + if (element.type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT) { + element.type = src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT + 'Document'; + } else if (element.type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT + 'Bubble') { + element.type = src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT + 'Conversation'; + } } + return elements; } - onDrop($event, iconName, actors, index) { - let list; - if (actors) { - list = this.selectedActors$; - } else { - list = this.selectedWorkobjects$; + /** + * Adjusts Positions of Elements to ensure the Domain Story starts in the visible parts of the canvas + */ + adjustPositions(elements) { + let xLeft = 0; + let yUp = 0; + let isFirst = true; + this.findFirstElement(elements, isFirst, xLeft, yUp); + if (xLeft < 75 || xLeft > 150 || yUp < 0 || yUp > 50) { + // add Padding for the Palette and the top + xLeft -= 75; + yUp -= 50; + elements.forEach(element => this.adjustElementPosition(element, xLeft, yUp)); } - const sortedList = list.value; - const item = sortedList[this.draggedIndex]; - sortedList.splice(this.draggedIndex, 1); - sortedList.splice(index, 0, item); - list.next(sortedList); - if (actors) { - this.customizationService.setSelectedActors(sortedList); + } + adjustElementPosition(element, xLeft, yUp) { + if (element.type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY || element.type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.CONNECTION) { + const waypoints = element.waypoints; + waypoints.forEach(point => { + point.x -= xLeft; + point.y -= yUp; + if (point.original) { + point.original.x = point.x; + point.original.y = point.y; + } + }); } else { - this.customizationService.setSelectedWorkObject(sortedList); + element.x -= xLeft; + element.y -= yUp; } } - onDragStart(index, draggedList) { - this.draggedList = draggedList; - this.draggedIndex = index; + findFirstElement(elements, isFirst, xLeft, yUp) { + elements.forEach(element => { + let elXLeft; + let elYUp; + if (element.type !== src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY && element.type !== src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.CONNECTION) { + if (isFirst) { + xLeft = element.x; + yUp = element.y; + isFirst = false; + } + elXLeft = element.x; + elYUp = element.y; + if (elXLeft < xLeft) { + xLeft = elXLeft; + } + if (elYUp < yUp) { + yUp = elYUp; + } + } + }); } - static #_ = this.ɵfac = function IconSetDetailsComponent_Factory(t) { - return new (t || IconSetDetailsComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](src_app_Service_IconSetConfiguration_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_0__.IconSetCustomizationService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](src_app_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_1__.TitleService)); + static #_ = this.ɵfac = function ImportRepairService_Factory(t) { + return new (t || ImportRepairService)(); }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineComponent"]({ - type: IconSetDetailsComponent, - selectors: [["app-icon-set-details"]], - decls: 19, - vars: 9, - consts: [[1, "details", "smallScrollbar"], [1, "iconSetDetails", "bottom-border"], [1, "inputWidth", "inputHeight"], [1, "alignment"], [1, "inputHeight"], ["matInput", "", "type", "text", "placeholder", "Icon Set Name", 3, "input", "value"], [1, "actorList", "bottom-border"], ["class", "compactItem", "draggable", "true", 3, "dragover", "dragstart", "drop", 4, "ngFor", "ngForOf"], [1, "workobjectList"], ["draggable", "true", 1, "compactItem", 3, "dragover", "dragstart", "drop"], [3, "icon"]], - template: function IconSetDetailsComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](0, "div", 0)(1, "div", 1)(2, "form", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelement"](3, "div", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](4, "mat-form-field", 4)(5, "input", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](6, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("input", function IconSetDetailsComponent_Template_input_input_5_listener($event) { - return ctx.changeName($event); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()()()(); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](7, "div", 6)(8, "h3"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](9, "Order of Actors"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](10, "mat-list"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtemplate"](11, IconSetDetailsComponent_mat_list_item_11_Template, 2, 1, "mat-list-item", 7); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](12, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](13, "div", 8)(14, "h3"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](15, "Order of Work Objects"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](16, "mat-list"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtemplate"](17, IconSetDetailsComponent_mat_list_item_17_Template, 2, 1, "mat-list-item", 7); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](18, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()()(); - } - if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](5); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("value", _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](6, 3, ctx.iconSetName)); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](6); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("ngForOf", _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](12, 5, ctx.selectedActors$)); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](6); - _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("ngForOf", _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](18, 7, ctx.selectedWorkobjects$)); - } - }, - dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_4__.NgForOf, _angular_forms__WEBPACK_IMPORTED_MODULE_5__["ɵNgNoValidate"], _angular_forms__WEBPACK_IMPORTED_MODULE_5__.NgControlStatusGroup, _angular_forms__WEBPACK_IMPORTED_MODULE_5__.NgForm, _angular_material_list__WEBPACK_IMPORTED_MODULE_6__.MatList, _angular_material_list__WEBPACK_IMPORTED_MODULE_6__.MatListItem, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__.MatFormField, _angular_material_input__WEBPACK_IMPORTED_MODULE_8__.MatInput, _details_list_item_details_list_item_component__WEBPACK_IMPORTED_MODULE_2__.DetailsListItemComponent, _angular_common__WEBPACK_IMPORTED_MODULE_4__.AsyncPipe], - styles: [".details[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: calc(100vh - 46px - 20px);\n grid-row-gap: 1px;\n overflow-y: auto;\n overflow-x: auto;\n width: 250px;\n border-left: solid 1px #ccc;\n}\n\n.iconSetDetails[_ngcontent-%COMP%] .mat-mdc-form-field-infix {\n border: none;\n padding-bottom: 0 !important;\n padding-top: 0 !important;\n}\n.iconSetDetails[_ngcontent-%COMP%] .mdc-text-field {\n padding-left: 0 !important;\n}\n\n.compactItem[_ngcontent-%COMP%] {\n height: 40px !important;\n}\n\n.fullWidth[_ngcontent-%COMP%] {\n width: 100%;\n padding-left: 15px;\n}\n\n.alignment[_ngcontent-%COMP%] {\n height: 12px;\n}\n\n.inputHeight[_ngcontent-%COMP%] {\n height: 46px;\n}\n\n.inputWidth[_ngcontent-%COMP%] {\n width: 200px;\n margin-left: 15px;\n}\n\nh3[_ngcontent-%COMP%] {\n padding-left: 15px;\n margin-bottom: 0;\n font-weight: bold;\n}\n\nmat-list[_ngcontent-%COMP%] {\n padding-top: 0;\n}\n\n.bottom-border[_ngcontent-%COMP%] {\n border-bottom: 2px solid #ccc;\n}"] + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ + token: ImportRepairService, + factory: ImportRepairService.ɵfac, + providedIn: 'root' }); } - return IconSetDetailsComponent; + return ImportRepairService; })(); /***/ }), -/***/ 9432: -/*!*******************************************************************************************!*\ - !*** ./src/app/Presentation/Header/components/header-buttons/header-buttons.component.ts ***! - \*******************************************************************************************/ +/***/ 68701: +/*!******************************************************************************************************************!*\ + !*** ./src/app/tools/label-dictionary/presentation/label-dictionary-dialog/label-dictionary-dialog.component.ts ***! + \******************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ HeaderButtonsComponent: () => (/* binding */ HeaderButtonsComponent) +/* harmony export */ LabelDictionaryDialogComponent: () => (/* binding */ LabelDictionaryDialogComponent) /* harmony export */ }); -/* harmony import */ var _Domain_Dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Domain/Dialog/exportDialogData */ 83064); -/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -/* harmony import */ var _Dialog_export_dialog_export_dialog_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Dialog/export-dialog/export-dialog.component */ 97218); -/* harmony import */ var _Domain_Dialog_infoDialogData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Domain/Dialog/infoDialogData */ 45574); -/* harmony import */ var _Dialog_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../Dialog/info-dialog/info-dialog.component */ 16266); -/* harmony import */ var _Dialog_label_dictionary_dialog_label_dictionary_dialog_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../Dialog/label-dictionary-dialog/label-dictionary-dialog.component */ 23958); -/* harmony import */ var _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../Domain/Common/constants */ 90816); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _Service_Settings_settings_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../Service/Settings/settings.service */ 58124); -/* harmony import */ var _Service_Modeler_modeler_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../Service/Modeler/modeler.service */ 74676); -/* harmony import */ var _Service_Replay_replay_state_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../Service/Replay/replay-state.service */ 67820); -/* harmony import */ var _Service_DirtyFlag_dirty_flag_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../Service/DirtyFlag/dirty-flag.service */ 89791); -/* harmony import */ var _Service_Dialog_dialog_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../Service/Dialog/dialog.service */ 4730); -/* harmony import */ var _Service_Replay_replay_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../Service/Replay/replay.service */ 94788); -/* harmony import */ var _Service_Export_export_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../../Service/Export/export.service */ 98106); -/* harmony import */ var _Service_Import_import_domain_story_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../Service/Import/import-domain-story.service */ 23779); -/* harmony import */ var _Service_Title_title_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../../Service/Title/title.service */ 69672); -/* harmony import */ var _Service_Renderer_renderer_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../../Service/Renderer/renderer.service */ 94896); -/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @angular/common */ 56610); - - - - +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +let LabelDictionaryDialogComponent = /*#__PURE__*/(() => { + class LabelDictionaryDialogComponent { + constructor(dialogRef) { + this.dialogRef = dialogRef; + } + close() { + this.dialogRef.close(); + } + static #_ = this.ɵfac = function LabelDictionaryDialogComponent_Factory(t) { + return new (t || LabelDictionaryDialogComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_1__.MatDialogRef)); + }; + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ + type: LabelDictionaryDialogComponent, + selectors: [["app-label-dictionary-dialog"]], + decls: 4, + vars: 0, + consts: [[3, "closeEmitter"]], + template: function LabelDictionaryDialogComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "mat-dialog-content")(1, "h2"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](2, "Label Dictionary"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "app-label-dictionary", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("closeEmitter", function LabelDictionaryDialogComponent_Template_app_label_dictionary_closeEmitter_3_listener() { + return ctx.close(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + } + } + }); + } + return LabelDictionaryDialogComponent; +})(); +/***/ }), +/***/ 36921: +/*!****************************************************************************************************!*\ + !*** ./src/app/tools/label-dictionary/presentation/label-dictionary/label-dictionary.component.ts ***! + \****************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ LabelDictionaryComponent: () => (/* binding */ LabelDictionaryComponent) +/* harmony export */ }); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 95981); +/* harmony import */ var _services_label_dictionary_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/label-dictionary.service */ 69731); +/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/button */ 72221); +/* harmony import */ var _angular_material_list__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/list */ 93901); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/form-field */ 29344); +/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/input */ 92583); +/* harmony import */ var _angular_cdk_text_field__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/cdk/text-field */ 6554); +/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ 56610); @@ -69801,513 +68633,50 @@ __webpack_require__.r(__webpack_exports__); -function HeaderButtonsComponent_div_0_span_9_Template(rf, ctx) { +function LabelDictionaryComponent_For_6_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](0, "span", 14); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtext"](1, " archive "); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"](); + const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "mat-list-item")(1, "mat-form-field", 5)(2, "input", 6); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("change", function LabelDictionaryComponent_For_6_Template_input_change_2_listener($event) { + const workobjectEntry_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r1).$implicit; + const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r2.updateWorkobjectEntry($event, workobjectEntry_r2)); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()()(); } -} -function HeaderButtonsComponent_div_0_span_11_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](0, "span", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtext"](1, " archive "); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"](); + if (rf & 2) { + const workobjectEntry_r2 = ctx.$implicit; + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("value", workobjectEntry_r2.name); } } -function HeaderButtonsComponent_div_0_Template(rf, ctx) { +function LabelDictionaryComponent_For_13_Template(rf, ctx) { if (rf & 1) { - const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](0, "div")(1, "button", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵlistener"]("click", function HeaderButtonsComponent_div_0_Template_button_click_1_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵrestoreView"](_r1); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵresetView"](ctx_r1.startReplay()); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](2, "span", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtext"](3, " play_arrow "); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](4, "button", 3)(5, "span", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtext"](6, " unarchive "); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](7, "input", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵlistener"]("change", function HeaderButtonsComponent_div_0_Template_input_change_7_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵrestoreView"](_r1); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵresetView"](ctx_r1.import()); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](8, "button", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵlistener"]("click", function HeaderButtonsComponent_div_0_Template_button_click_8_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵrestoreView"](_r1); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵresetView"](ctx_r1.openDownloadDialog()); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtemplate"](9, HeaderButtonsComponent_div_0_span_9_Template, 2, 0, "span", 6); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵpipe"](10, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtemplate"](11, HeaderButtonsComponent_div_0_span_11_Template, 2, 0, "span", 7); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵpipe"](12, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](13, "button", 8); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵlistener"]("click", function HeaderButtonsComponent_div_0_Template_button_click_13_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵrestoreView"](_r1); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵresetView"](ctx_r1.openLabelDictionary()); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](14, "span", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtext"](15, " spellcheck "); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](16, "button", 10); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵlistener"]("click", function HeaderButtonsComponent_div_0_Template_button_click_16_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵrestoreView"](_r1); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵresetView"](ctx_r1.openSettings()); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](17, "span", 11); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtext"](18, " settings "); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](19, "button", 12); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵlistener"]("click", function HeaderButtonsComponent_div_0_Template_button_click_19_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵrestoreView"](_r1); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵresetView"](ctx_r1.openKeyboardShortcutsDialog()); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](20, "span", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtext"](21, " keyboard "); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](22, "button", 13); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵlistener"]("click", function HeaderButtonsComponent_div_0_Template_button_click_22_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵrestoreView"](_r1); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵresetView"](ctx_r1.createNewDomainStory()); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](23, "span", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtext"](24, " note_add "); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"]()()(); + const _r4 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "mat-list-item")(1, "mat-form-field", 5)(2, "textarea", 7); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("change", function LabelDictionaryComponent_For_13_Template_textarea_change_2_listener($event) { + const activityEntry_r5 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r4).$implicit; + const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r2.updateActivityEntry($event, activityEntry_r5)); + })("keydown.enter", function LabelDictionaryComponent_For_13_Template_textarea_keydown_enter_2_listener($event) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r4); + const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r2.preventDefault($event)); + })("keyup.enter", function LabelDictionaryComponent_For_13_Template_textarea_keyup_enter_2_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r4); + const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r2.save()); + })("keyup.escape", function LabelDictionaryComponent_For_13_Template_textarea_keyup_escape_2_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r4); + const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r2.close()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()()(); } if (rf & 2) { - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵnextContext"](); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵclassProp"]("disabled", !ctx_r1.replayService.isReplayable()); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵproperty"]("disabled", !ctx_r1.replayService.isReplayable()); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵadvance"](7); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵclassProp"]("disabled", !ctx_r1.isExportable()); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵproperty"]("disabled", !ctx_r1.isExportable()); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵproperty"]("ngIf", !_angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵpipeBind1"](10, 11, ctx_r1.isDirty$)); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵpipeBind1"](12, 13, ctx_r1.isDirty$)); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵclassProp"]("disabled", !ctx_r1.exportService.isDomainStoryExportable()); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵproperty"]("disabled", !ctx_r1.exportService.isDomainStoryExportable()); - } -} -function HeaderButtonsComponent_div_2_Template(rf, ctx) { - if (rf & 1) { - const _r3 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](0, "div")(1, "button", 15); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵlistener"]("click", function HeaderButtonsComponent_div_2_Template_button_click_1_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵrestoreView"](_r3); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵresetView"](ctx_r1.previousSentence()); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](2, "span", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtext"](3, " skip_previous "); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](4, "button", 16); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵlistener"]("click", function HeaderButtonsComponent_div_2_Template_button_click_4_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵrestoreView"](_r3); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵresetView"](ctx_r1.nextSentence()); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](5, "span", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtext"](6, " skip_next "); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](7, "button", 17); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵlistener"]("click", function HeaderButtonsComponent_div_2_Template_button_click_7_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵrestoreView"](_r3); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵresetView"](ctx_r1.stopReplay()); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementStart"](8, "span", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtext"](9, " stop "); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵelementEnd"]()()(); - } -} -let HeaderButtonsComponent = /*#__PURE__*/(() => { - class HeaderButtonsComponent { - constructor(settingsService, modelerService, replayStateService, dirtyFlagService, dialogService, replayService, exportService, importService, titleService, renderService, snackbar) { - this.settingsService = settingsService; - this.modelerService = modelerService; - this.replayStateService = replayStateService; - this.dirtyFlagService = dirtyFlagService; - this.dialogService = dialogService; - this.replayService = replayService; - this.exportService = exportService; - this.importService = importService; - this.titleService = titleService; - this.renderService = renderService; - this.snackbar = snackbar; - this.isReplay$ = this.replayStateService.replayOn$; - this.isDirty$ = this.dirtyFlagService.dirty$; - } - import() { - // @ts-ignore - const file = document.getElementById('import').files[0]; - const filename = file.name; - const dstSvgPattern = /.*(.dst)(\s*\(\d+\)){0,1}\.svg/; - const egnSvgPattern = /.*(.egn)(\s*\(\d+\)){0,1}\.svg/; - if (filename.endsWith('.dst')) { - this.importService.importDST(file, filename, false); - } else if (filename.match(dstSvgPattern)) { - this.importService.importDST(file, filename, true); - } else if (filename.endsWith('.egn')) { - this.importService.importEGN(file, filename, false); - } else if (filename.match(egnSvgPattern)) { - this.importService.importEGN(file, filename, true); - } - this.modelerService.commandStackChanged(); - } - openSettings() { - this.settingsService.open(); - } - /** Open Dialogs **/ - openDownloadDialog() { - if (this.exportService.isDomainStoryExportable()) { - const SVGDownloadOption = new _Domain_Dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_0__.ExportOption('SVG', 'Download an SVG-Image with the Domain-Story embedded. Can be used to save and share your Domain-Story.', (withTitle, useWhiteBackground) => this.exportService.downloadSVG(withTitle, useWhiteBackground)); - const EGNDownloadOption = new _Domain_Dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_0__.ExportOption('EGN', 'Download an EGN-File with the Domain-Story. Can be used to save and share your Domain-Story.', () => this.exportService.downloadDST()); - const PNGDownloadOption = new _Domain_Dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_0__.ExportOption('PNG', 'Download a PNG-Image of the Domain-Story. This does not include the Domain-Story!', withTitle => this.exportService.downloadPNG(withTitle)); - const HTMLDownloadOption = new _Domain_Dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_0__.ExportOption('HTML-Presentation', 'Download an HTML-Presentation. This does not include the Domain-Story!', () => this.exportService.downloadHTMLPresentation()); - const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_17__.MatDialogConfig(); - config.disableClose = false; - config.autoFocus = true; - config.data = new _Domain_Dialog_exportDialogData__WEBPACK_IMPORTED_MODULE_0__.ExportDialogData('Export', [SVGDownloadOption, EGNDownloadOption, PNGDownloadOption, HTMLDownloadOption]); - this.dialogService.openDialog(_Dialog_export_dialog_export_dialog_component__WEBPACK_IMPORTED_MODULE_1__.ExportDialogComponent, config); - } else { - this.snackbar.open('No Domain Story to be exported', undefined, { - duration: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_5__.SNACKBAR_DURATION, - panelClass: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_5__.SNACKBAR_INFO - }); - } - } - openKeyboardShortcutsDialog() { - const title = 'Keyboard Shortcuts'; - const shortCutText = 'Undo:\t\t\t\t\tctrl + Z \n' + 'Redo:\t\t\t\t\tctrl + Y OR ctrl + shift + Z\n' + 'Select All:\t\t\t\tctrl + A\n' + 'Export as EGN:\t\t\tctrl + S\n' + 'Import Domain Story: \t\tctrl + L\n' + 'Search for text:\t\t\tctrl + F\n' + 'Direct editing:\t\t\tE\n' + 'Hand tool:\t\t\t\tH\n' + 'Lasso tool:\t\t\t\tL\n' + 'Space tool:\t\t\t\tS'; - const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_17__.MatDialogConfig(); - config.disableClose = false; - config.autoFocus = true; - config.data = new _Domain_Dialog_infoDialogData__WEBPACK_IMPORTED_MODULE_2__.InfoDialogData(title, shortCutText, true); - this.dialogService.openDialog(_Dialog_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_3__.InfoDialogComponent, config); - } - openLabelDictionary() { - if (this.exportService.isDomainStoryExportable()) { - const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_17__.MatDialogConfig(); - config.disableClose = false; - config.autoFocus = true; - this.dialogService.openDialog(_Dialog_label_dictionary_dialog_label_dictionary_dialog_component__WEBPACK_IMPORTED_MODULE_4__.LabelDictionaryDialogComponent, config); - } else { - this.snackbar.open('There are currently no Elements on the canvas', undefined, { - duration: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_5__.SNACKBAR_DURATION, - panelClass: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_5__.SNACKBAR_INFO - }); - } - } - createNewDomainStory() { - this.titleService.reset(); - this.renderService.reset(); - this.dirtyFlagService.makeClean(); - } - /** Replay functions **/ - startReplay() { - this.replayService.startReplay(); - } - stopReplay() { - this.replayService.stopReplay(); - } - previousSentence() { - this.replayService.previousSentence(); - } - nextSentence() { - this.replayService.nextSentence(); - } - isExportable() { - return this.titleService.hasTitleOrDescription() || this.exportService.isDomainStoryExportable(); - } - static #_ = this.ɵfac = function HeaderButtonsComponent_Factory(t) { - return new (t || HeaderButtonsComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdirectiveInject"](_Service_Settings_settings_service__WEBPACK_IMPORTED_MODULE_6__.SettingsService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdirectiveInject"](_Service_Modeler_modeler_service__WEBPACK_IMPORTED_MODULE_7__.ModelerService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdirectiveInject"](_Service_Replay_replay_state_service__WEBPACK_IMPORTED_MODULE_8__.ReplayStateService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdirectiveInject"](_Service_DirtyFlag_dirty_flag_service__WEBPACK_IMPORTED_MODULE_9__.DirtyFlagService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdirectiveInject"](_Service_Dialog_dialog_service__WEBPACK_IMPORTED_MODULE_10__.DialogService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdirectiveInject"](_Service_Replay_replay_service__WEBPACK_IMPORTED_MODULE_11__.ReplayService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdirectiveInject"](_Service_Export_export_service__WEBPACK_IMPORTED_MODULE_12__.ExportService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdirectiveInject"](_Service_Import_import_domain_story_service__WEBPACK_IMPORTED_MODULE_13__.ImportDomainStoryService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdirectiveInject"](_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_14__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdirectiveInject"](_Service_Renderer_renderer_service__WEBPACK_IMPORTED_MODULE_15__.RendererService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdirectiveInject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_18__.MatSnackBar)); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdefineComponent"]({ - type: HeaderButtonsComponent, - selectors: [["app-header-buttons"]], - decls: 4, - vars: 6, - consts: [[4, "ngIf"], ["id", "buttonStartReplay", "title", "Start replay", 1, "headerButton", 3, "click", "disabled"], [1, "material-icons", "materialIconButton"], ["id", "buttonImport", "title", "Import story from file", "onclick", "document.getElementById('import').click();", 1, "headerButton"], ["type", "file", "accept", ".dst, .svg, .egn, .svg", "id", "import", "onclick", "this.value=null;", "name", "file", 2, "display", "none", 3, "change"], ["id", "export", "title", "Export story as .egn, .svg or .png file", 1, "headerButton", 3, "click", "disabled"], ["class", "material-icons-outlined materialIconButton", 4, "ngIf"], ["class", "material-icons materialIconButton", 4, "ngIf"], ["title", "Label Dictionary", 1, "headerButton", 3, "click", "disabled"], ["title", "Label Dictionary", 1, "material-icons", "materialIconButton"], ["title", "Settings", 1, "headerButton", 3, "click"], ["title", "Change Icons and Settings", 1, "material-icons", "materialIconButton"], ["title", "Show keyboard shortcuts", 1, "headerButton", 3, "click"], ["title", "Create a new domain story", 1, "headerButton", 3, "click"], [1, "material-icons-outlined", "materialIconButton"], ["title", "Previous sentence", 1, "headerButton", 3, "click"], ["title", "Next sentence", 1, "headerButton", 3, "click"], ["title", "Stop replay", 1, "headerButton", 3, "click"]], - template: function HeaderButtonsComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtemplate"](0, HeaderButtonsComponent_div_0_Template, 25, 15, "div", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵpipe"](1, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵtemplate"](2, HeaderButtonsComponent_div_2_Template, 10, 0, "div", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵpipe"](3, "async"); - } - if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵproperty"]("ngIf", !_angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵpipeBind1"](1, 2, ctx.isReplay$)); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵpipeBind1"](3, 4, ctx.isReplay$)); - } - }, - dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_19__.NgIf, _angular_common__WEBPACK_IMPORTED_MODULE_19__.AsyncPipe], - styles: ["span[_ngcontent-%COMP%] {\n font-size: 15pt;\n color: white;\n}\n\n#dictionaryButton[_ngcontent-%COMP%] {\n opacity: 0.2;\n pointer-events: none;\n}\n\n.headerButton[_ngcontent-%COMP%]:hover {\n cursor: pointer;\n}\n.headerButton[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%] {\n color: white;\n}\n\n.disabled[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .disabled[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%] {\n cursor: initial;\n color: gray;\n}\n\n.materialIconButton[_ngcontent-%COMP%]:hover {\n color: lightgrey;\n}"] - }); - } - return HeaderButtonsComponent; -})(); - -/***/ }), - -/***/ 91729: -/*!*********************************************************!*\ - !*** ./src/app/Presentation/Header/header.component.ts ***! - \*********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ HeaderComponent: () => (/* binding */ HeaderComponent) -/* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ 199); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 93527); -/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -/* harmony import */ var _Dialog_header_dialog_header_dialog_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Dialog/header-dialog/header-dialog.component */ 21270); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _Service_Title_title_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Service/Title/title.service */ 69672); -/* harmony import */ var _Service_Replay_replay_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Service/Replay/replay.service */ 94788); -/* harmony import */ var _Service_Replay_replay_state_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Service/Replay/replay-state.service */ 67820); -/* harmony import */ var _Service_Dialog_dialog_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Service/Dialog/dialog.service */ 4730); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var _components_header_buttons_header_buttons_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/header-buttons/header-buttons.component */ 9432); -/* harmony import */ var _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/toolbar */ 23550); -/* harmony import */ var _angular_material_card__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/material/card */ 90643); - - - - - - - - - - - - -function HeaderComponent_button_2_Template(rf, ctx) { - if (rf & 1) { - const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementStart"](0, "button", 11); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵlistener"]("click", function HeaderComponent_button_2_Template_button_click_0_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵrestoreView"](_r1); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵresetView"](ctx_r1.setShowDescription(false)); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementStart"](1, "span", 12); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtext"](2, " expand_less "); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementEnd"]()(); - } -} -function HeaderComponent_button_4_Template(rf, ctx) { - if (rf & 1) { - const _r3 = _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementStart"](0, "button", 13); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵlistener"]("click", function HeaderComponent_button_4_Template_button_click_0_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵrestoreView"](_r3); - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵresetView"](ctx_r1.setShowDescription(true)); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementStart"](1, "span", 12); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtext"](2, " expand_more"); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementEnd"]()(); - } -} -function HeaderComponent_span_13_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementStart"](0, "span", 14); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtext"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipe"](2, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementEnd"](); - } - if (rf & 2) { - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵnextContext"](); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtextInterpolate1"](" Sentence: ", _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipeBind1"](2, 1, ctx_r1.sentenceDescription$), ""); - } -} -function HeaderComponent_mat_card_17_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementStart"](0, "mat-card", 15)(1, "span", 16); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtext"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipe"](3, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementEnd"]()(); - } - if (rf & 2) { - const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵnextContext"](); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtextInterpolate"](_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipeBind1"](3, 1, ctx_r1.description$)); - } -} -let HeaderComponent = /*#__PURE__*/(() => { - class HeaderComponent { - constructor(titleService, replayService, replayStateService, dialogService) { - this.titleService = titleService; - this.replayService = replayService; - this.replayStateService = replayStateService; - this.dialogService = dialogService; - this.title$ = this.titleService.title$; - this.description$ = this.titleService.description$; - this.showDescription$ = this.titleService.showDescription$; - this.isReplay$ = this.replayStateService.replayOn$; - this.sentenceDescription$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_7__.combineLatest)([this.replayService.currentSentence$, this.replayService.maxSentenceNumber$]).pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_8__.map)(([sentence, count]) => `${sentence}/${count}`)); - this.showDescription = this.titleService.showDescription$; - } - openHeaderDialog() { - const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_9__.MatDialogConfig(); - config.disableClose = false; - config.autoFocus = true; - this.dialogService.openDialog(_Dialog_header_dialog_header_dialog_component__WEBPACK_IMPORTED_MODULE_0__.HeaderDialogComponent, config); - } - setShowDescription(show) { - this.titleService.setShowDescription(show); - } - static #_ = this.ɵfac = function HeaderComponent_Factory(t) { - return new (t || HeaderComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdirectiveInject"](_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_1__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdirectiveInject"](_Service_Replay_replay_service__WEBPACK_IMPORTED_MODULE_2__.ReplayService), _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdirectiveInject"](_Service_Replay_replay_state_service__WEBPACK_IMPORTED_MODULE_3__.ReplayStateService), _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdirectiveInject"](_Service_Dialog_dialog_service__WEBPACK_IMPORTED_MODULE_4__.DialogService)); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdefineComponent"]({ - type: HeaderComponent, - selectors: [["app-header"]], - decls: 19, - vars: 15, - consts: [["color", "primary"], ["class", "headerButton", "title", "Hide Description", 3, "click", 4, "ngIf"], ["class", "headerButton", "title", "Show Description", 3, "click", 4, "ngIf"], [1, "mr-10", "titel-scrollbar"], ["title", "Edit Title and Description", 1, "headline", 3, "click"], [1, "material-icons", "materialIconButton", "editIcon"], [1, "titleSpacer"], ["title", "Replay Sentence", 4, "ngIf"], [1, "buttonSpacer"], [1, "nowrap"], ["class", "smallScrollbar description", 4, "ngIf"], ["title", "Hide Description", 1, "headerButton", 3, "click"], [1, "material-icons", "materialIconButton", "toggle"], ["title", "Show Description", 1, "headerButton", 3, "click"], ["title", "Replay Sentence"], [1, "smallScrollbar", "description"], [1, "descriptionText"]], - template: function HeaderComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementStart"](0, "mat-toolbar", 0)(1, "mat-toolbar-row"); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtemplate"](2, HeaderComponent_button_2_Template, 3, 0, "button", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipe"](3, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtemplate"](4, HeaderComponent_button_4_Template, 3, 0, "button", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipe"](5, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementStart"](6, "div", 3)(7, "span", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵlistener"]("click", function HeaderComponent_Template_span_click_7_listener() { - return ctx.openHeaderDialog(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtext"](8); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipe"](9, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementStart"](10, "span", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtext"](11, " edit "); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementEnd"]()()(); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelement"](12, "span", 6); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtemplate"](13, HeaderComponent_span_13_Template, 3, 3, "span", 7); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipe"](14, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelement"](15, "span", 8)(16, "app-header-buttons", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtemplate"](17, HeaderComponent_mat_card_17_Template, 4, 3, "mat-card", 10); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipe"](18, "async"); - } - if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipeBind1"](3, 5, ctx.showDescription)); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵproperty"]("ngIf", !_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipeBind1"](5, 7, ctx.showDescription)); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipeBind1"](9, 9, ctx.title$), " "); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵadvance"](5); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipeBind1"](14, 11, ctx.isReplay$)); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵpipeBind1"](18, 13, ctx.showDescription$)); - } - }, - dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_10__.NgIf, _components_header_buttons_header_buttons_component__WEBPACK_IMPORTED_MODULE_5__.HeaderButtonsComponent, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_11__.MatToolbar, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_11__.MatToolbarRow, _angular_material_card__WEBPACK_IMPORTED_MODULE_12__.MatCard, _angular_common__WEBPACK_IMPORTED_MODULE_10__.AsyncPipe], - styles: [".description[_ngcontent-%COMP%] {\n top: 0;\n max-width: 100vw;\n overflow-y: scroll;\n display: grid;\n}\n\n.descriptionText[_ngcontent-%COMP%] {\n position: relative;\n font-size: 10pt;\n overflow-wrap: anywhere;\n word-wrap: anywhere;\n white-space: pre-wrap;\n padding-top: 15px;\n padding-left: 15px;\n padding-right: 15px;\n line-height: 12pt;\n}\n\n.description[_ngcontent-%COMP%]:hover {\n cursor: default;\n}\n\n.titleSpacer[_ngcontent-%COMP%] {\n flex: 1 1 auto;\n}\n\n.buttonSpacer[_ngcontent-%COMP%] {\n margin-right: 15px;\n}\n\n.headline[_ngcontent-%COMP%]:hover > .editIcon[_ngcontent-%COMP%] {\n display: contents;\n}\n\n.headline[_ngcontent-%COMP%] > .editIcon[_ngcontent-%COMP%] {\n display: none;\n}\n\n.headerButton[_ngcontent-%COMP%] {\n color: white;\n}\n\n.headerButton[_ngcontent-%COMP%]:hover {\n cursor: pointer;\n}\n\n.nowrap[_ngcontent-%COMP%] {\n white-space: nowrap;\n}\n\n.mat-toolbar-row[_ngcontent-%COMP%] {\n white-space: normal;\n height: min-content;\n min-height: 5rem;\n}\n\n.titel-scrollbar[_ngcontent-%COMP%] {\n max-height: 10rem;\n overflow: auto;\n scrollbar-width: none;\n max-width: 100rem;\n}"] - }); - } - return HeaderComponent; -})(); - -/***/ }), - -/***/ 86328: -/*!****************************************************************************!*\ - !*** ./src/app/Presentation/LabelDictionary/label-dictionary.component.ts ***! - \****************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ LabelDictionaryComponent: () => (/* binding */ LabelDictionaryComponent) -/* harmony export */ }); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 95981); -/* harmony import */ var _Service_LabelDictionary_label_dictionary_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Service/LabelDictionary/label-dictionary.service */ 59783); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/button */ 72221); -/* harmony import */ var _angular_material_list__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/list */ 93901); -/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/form-field */ 29344); -/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/input */ 92583); -/* harmony import */ var _angular_cdk_text_field__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/cdk/text-field */ 6554); - - - - - - - - - - - -function LabelDictionaryComponent_mat_list_item_5_Template(rf, ctx) { - if (rf & 1) { - const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "mat-list-item")(1, "mat-form-field", 6)(2, "input", 7); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("change", function LabelDictionaryComponent_mat_list_item_5_Template_input_change_2_listener($event) { - const workobjectEntry_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r1).$implicit; - const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r2.updateWorkobjectEntry($event, workobjectEntry_r2)); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()()(); - } - if (rf & 2) { - const workobjectEntry_r2 = ctx.$implicit; - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("value", workobjectEntry_r2.name); - } -} -function LabelDictionaryComponent_mat_list_item_11_Template(rf, ctx) { - if (rf & 1) { - const _r4 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "mat-list-item")(1, "mat-form-field", 6)(2, "textarea", 8); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("change", function LabelDictionaryComponent_mat_list_item_11_Template_textarea_change_2_listener($event) { - const activityEntry_r5 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r4).$implicit; - const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r2.updateActivityEntry($event, activityEntry_r5)); - })("keydown.enter", function LabelDictionaryComponent_mat_list_item_11_Template_textarea_keydown_enter_2_listener($event) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r4); - const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r2.preventDefault($event)); - })("keyup.enter", function LabelDictionaryComponent_mat_list_item_11_Template_textarea_keyup_enter_2_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r4); - const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r2.save()); - })("keyup.escape", function LabelDictionaryComponent_mat_list_item_11_Template_textarea_keyup_escape_2_listener() { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r4); - const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"](); - return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r2.close()); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()()(); - } - if (rf & 2) { - const activityEntry_r5 = ctx.$implicit; - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("value", activityEntry_r5.name); + const activityEntry_r5 = ctx.$implicit; + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("value", activityEntry_r5.name); } } let LabelDictionaryComponent = /*#__PURE__*/(() => { @@ -70371,7 +68740,7 @@ let LabelDictionaryComponent = /*#__PURE__*/(() => { this.closeEmitter.emit(); } static #_ = this.ɵfac = function LabelDictionaryComponent_Factory(t) { - return new (t || LabelDictionaryComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_Service_LabelDictionary_label_dictionary_service__WEBPACK_IMPORTED_MODULE_0__.LabelDictionaryService)); + return new (t || LabelDictionaryComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_services_label_dictionary_service__WEBPACK_IMPORTED_MODULE_0__.LabelDictionaryService)); }; static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: LabelDictionaryComponent, @@ -70379,46 +68748,46 @@ let LabelDictionaryComponent = /*#__PURE__*/(() => { outputs: { closeEmitter: "closeEmitter" }, - decls: 18, - vars: 6, - consts: [[1, "workobjectList"], [4, "ngFor", "ngForOf"], [1, "activityList"], [1, "activityListTitle"], ["mat-flat-button", "", 3, "click"], ["mat-flat-button", "", "color", "primary", 3, "click"], [1, "inputText"], ["matInput", "", 1, "inputText", 3, "change", "value"], ["matInput", "", "cdkTextareaAutosize", "", "cdkAutosizeMinRows", "1", "cdkAutosizeMaxRows", "3", 1, "inputText", "activity", 3, "change", "keydown.enter", "keyup.enter", "keyup.escape", "value"]], + decls: 20, + vars: 4, + consts: [[1, "workobjectList"], [1, "activityList"], [1, "activityListTitle"], ["mat-flat-button", "", 3, "click"], ["mat-flat-button", "", "color", "primary", 3, "click"], [1, "inputText"], ["matInput", "", 1, "inputText", 3, "change", "value"], ["matInput", "", "cdkTextareaAutosize", "", "cdkAutosizeMinRows", "1", "cdkAutosizeMaxRows", "3", 1, "inputText", "activity", 3, "change", "keydown.enter", "keyup.enter", "keyup.escape", "value"]], template: function LabelDictionaryComponent_Template(rf, ctx) { if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "mat-dialog-content")(1, "div", 0)(2, "h3"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](3, "Workobjects"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](3, "Work Objects"); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](4, "mat-list"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](5, LabelDictionaryComponent_mat_list_item_5_Template, 3, 1, "mat-list-item", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](6, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrepeaterCreate"](5, LabelDictionaryComponent_For_6_Template, 3, 1, "mat-list-item", null, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrepeaterTrackByIdentity"]); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](7, "async"); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](7, "div", 2)(8, "h3", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](9, "Activities"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](8, "div", 1)(9, "h3", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](10, "Activities"); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](10, "mat-list"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](11, LabelDictionaryComponent_mat_list_item_11_Template, 3, 1, "mat-list-item", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](12, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](11, "mat-list"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrepeaterCreate"](12, LabelDictionaryComponent_For_13_Template, 3, 1, "mat-list-item", null, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrepeaterTrackByIdentity"]); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](14, "async"); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()()(); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](13, "mat-dialog-actions")(14, "button", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function LabelDictionaryComponent_Template_button_click_14_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](15, "mat-dialog-actions")(16, "button", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function LabelDictionaryComponent_Template_button_click_16_listener() { return ctx.close(); }); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](15, "Cancel"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](17, "Cancel"); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](16, "button", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function LabelDictionaryComponent_Template_button_click_16_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](18, "button", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function LabelDictionaryComponent_Template_button_click_18_listener() { return ctx.save(); }); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](17, "Save"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](19, "Save"); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); } if (rf & 2) { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](5); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngForOf", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](6, 2, ctx.workobjectEntriesSubject)); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](6); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngForOf", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](12, 4, ctx.activityEntriesSubject)); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrepeater"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](7, 0, ctx.workobjectEntriesSubject)); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](7); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrepeater"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](14, 2, ctx.activityEntriesSubject)); } }, - dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_3__.NgForOf, _angular_material_button__WEBPACK_IMPORTED_MODULE_4__.MatButton, _angular_material_list__WEBPACK_IMPORTED_MODULE_5__.MatList, _angular_material_list__WEBPACK_IMPORTED_MODULE_5__.MatListItem, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_6__.MatDialogActions, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_6__.MatDialogContent, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__.MatFormField, _angular_material_input__WEBPACK_IMPORTED_MODULE_8__.MatInput, _angular_cdk_text_field__WEBPACK_IMPORTED_MODULE_9__.CdkTextareaAutosize, _angular_common__WEBPACK_IMPORTED_MODULE_3__.AsyncPipe], + dependencies: [_angular_material_button__WEBPACK_IMPORTED_MODULE_3__.MatButton, _angular_material_list__WEBPACK_IMPORTED_MODULE_4__.MatList, _angular_material_list__WEBPACK_IMPORTED_MODULE_4__.MatListItem, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__.MatDialogActions, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__.MatDialogContent, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatFormField, _angular_material_input__WEBPACK_IMPORTED_MODULE_7__.MatInput, _angular_cdk_text_field__WEBPACK_IMPORTED_MODULE_8__.CdkTextareaAutosize, _angular_common__WEBPACK_IMPORTED_MODULE_9__.AsyncPipe], styles: ["mat-dialog-content[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: auto auto;\n top: 0;\n bottom: 0;\n max-height: 75vh;\n grid-column-gap: 5px;\n width: 75vw;\n}\nmat-dialog-content[_ngcontent-%COMP%] mat-list-item[_ngcontent-%COMP%] {\n height: unset !important;\n}\nmat-dialog-content[_ngcontent-%COMP%] mat-list-item-content[_ngcontent-%COMP%] {\n padding: 0 !important;\n}\n\nh3[_ngcontent-%COMP%] {\n font-weight: bold;\n}\n\n.icon[_ngcontent-%COMP%] {\n width: 36px;\n height: 36px;\n}\n\n.inputText[_ngcontent-%COMP%] {\n width: 98%;\n resize: none;\n font-family: sans-serif;\n font-size: small;\n padding-top: 1px;\n padding-bottom: 1px;\n margin: 0;\n}\n\n.activityListHeader[_ngcontent-%COMP%] {\n display: inline-grid;\n grid-template-columns: auto auto auto;\n width: 100%;\n}\n\n.activityListTitle[_ngcontent-%COMP%] {\n justify-self: left;\n}\n\n.saveButton[_ngcontent-%COMP%] {\n justify-self: end;\n padding-right: 0 !important;\n}\n\n.saveButtonSpan[_ngcontent-%COMP%] {\n margin-left: 2px;\n}\n\n.activity[_ngcontent-%COMP%] {\n max-height: 3rem;\n}"] }); } @@ -70427,70 +68796,29 @@ let LabelDictionaryComponent = /*#__PURE__*/(() => { /***/ }), -/***/ 423: +/***/ 69731: /*!*****************************************************************************!*\ - !*** ./src/app/Presentation/Settings/General/general-settings.component.ts ***! + !*** ./src/app/tools/label-dictionary/services/label-dictionary.service.ts ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ GeneralSettingsComponent: () => (/* binding */ GeneralSettingsComponent) +/* harmony export */ LabelDictionaryService: () => (/* binding */ LabelDictionaryService) /* harmony export */ }); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _Autosave_AutosaveSettings_autosave_settings_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Autosave/AutosaveSettings/autosave-settings.component */ 94709); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +/* harmony import */ var _presentation_label_dictionary_dialog_label_dictionary_dialog_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../presentation/label-dictionary-dialog/label-dictionary-dialog.component */ 68701); +/* harmony import */ var _domain_entities_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../domain/entities/constants */ 40550); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_tools_label_dictionary_services_mass_naming_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/tools/label-dictionary/services/mass-naming.service */ 75961); +/* harmony import */ var src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/domain/services/element-registry.service */ 85511); +/* harmony import */ var _icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../icon-set-config/services/icon-dictionary.service */ 6932); +/* harmony import */ var _domain_services_dialog_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../domain/services/dialog.service */ 12855); +/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); -let GeneralSettingsComponent = /*#__PURE__*/(() => { - class GeneralSettingsComponent { - static #_ = this.ɵfac = function GeneralSettingsComponent_Factory(t) { - return new (t || GeneralSettingsComponent)(); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ - type: GeneralSettingsComponent, - selectors: [["app-general-settings"]], - decls: 2, - vars: 0, - consts: [[1, "content"]], - template: function GeneralSettingsComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "div", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](1, "app-autosave-settings"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - } - }, - dependencies: [_Autosave_AutosaveSettings_autosave_settings_component__WEBPACK_IMPORTED_MODULE_0__.AutosaveSettingsComponent], - styles: [".content[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: 450px auto;\n}"] - }); - } - return GeneralSettingsComponent; -})(); - -/***/ }), - -/***/ 1261: -/*!*************************************************************!*\ - !*** ./src/app/Presentation/Settings/settings.component.ts ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ SettingsComponent: () => (/* binding */ SettingsComponent) -/* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 95981); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var src_app_Service_Settings_settings_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Service/Settings/settings.service */ 58124); -/* harmony import */ var src_app_Service_Modeler_modeler_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Service/Modeler/modeler.service */ 74676); -/* harmony import */ var _Service_IconSetConfiguration_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Service/IconSetConfiguration/icon-set-customization.service */ 87007); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var _General_general_settings_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./General/general-settings.component */ 423); -/* harmony import */ var src_app_Presentation_DomainConfiguration_icon_set_configuration_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/Presentation/DomainConfiguration/icon-set-configuration.component */ 38574); -/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/button */ 72221); -/* harmony import */ var _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/material/toolbar */ 23550); - @@ -70499,197 +68827,181 @@ __webpack_require__.r(__webpack_exports__); - -function SettingsComponent_app_general_settings_15_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelement"](0, "app-general-settings"); - } -} -function SettingsComponent_app_icon_set_configuration_17_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelement"](0, "app-icon-set-configuration"); - } -} -let SettingsComponent = /*#__PURE__*/(() => { - class SettingsComponent { - constructor(settingsService, modelerService, iconSetCustomizationService) { - this.settingsService = settingsService; - this.modelerService = modelerService; - this.iconSetCustomizationService = iconSetCustomizationService; - this.showGeneralSettings = new rxjs__WEBPACK_IMPORTED_MODULE_6__.BehaviorSubject(false); - this.showIconSetCustomization = new rxjs__WEBPACK_IMPORTED_MODULE_6__.BehaviorSubject(true); +let LabelDictionaryService = /*#__PURE__*/(() => { + class LabelDictionaryService { + constructor(massNamingService, elementRegistryService, iconDictionaryService, dialogService, snackbar) { + this.massNamingService = massNamingService; + this.elementRegistryService = elementRegistryService; + this.iconDictionaryService = iconDictionaryService; + this.dialogService = dialogService; + this.snackbar = snackbar; + this.activityLabels = []; + this.workObjektLabels = []; } - close() { - const savedConfiguration = this.iconSetCustomizationService.getAndClearSavedConfiguration(); - if (savedConfiguration) { - this.modelerService.restart(savedConfiguration); + openLabelDictionary() { + const isActivityWithLabel = element => element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY) && element.businessObject.name; + const isWorkObjectWithLabel = element => element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT) && element.businessObject.name; + const hasAtLeastOneLabel = this.elementRegistryService.getAllCanvasObjects().some(element => isActivityWithLabel(element) || isWorkObjectWithLabel(element)); + if (hasAtLeastOneLabel) { + const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_7__.MatDialogConfig(); + config.disableClose = false; + config.autoFocus = true; + this.dialogService.openDialog(_presentation_label_dictionary_dialog_label_dictionary_dialog_component__WEBPACK_IMPORTED_MODULE_1__.LabelDictionaryDialogComponent, config); + } else { + this.snackbar.open('There are currently no activities or work objects with labels on the canvas', undefined, { + duration: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_2__.SNACKBAR_DURATION * 3, + panelClass: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_2__.SNACKBAR_INFO + }); } - this.settingsService.close(); - } - openGeneralSettings() { - this.showGeneralSettings.next(true); - this.showIconSetCustomization.next(false); } - openIconSetCustomization() { - this.showGeneralSettings.next(false); - this.showIconSetCustomization.next(true); - } - static #_ = this.ɵfac = function SettingsComponent_Factory(t) { - return new (t || SettingsComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdirectiveInject"](src_app_Service_Settings_settings_service__WEBPACK_IMPORTED_MODULE_0__.SettingsService), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdirectiveInject"](src_app_Service_Modeler_modeler_service__WEBPACK_IMPORTED_MODULE_1__.ModelerService), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdirectiveInject"](_Service_IconSetConfiguration_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_2__.IconSetCustomizationService)); - }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineComponent"]({ - type: SettingsComponent, - selectors: [["app-settings"]], - decls: 19, - vars: 14, - consts: [[1, "settings"], ["color", "primary", 1, "toolbar"], ["mat-icon-button", "", 1, "headerButton", "noPadding", 3, "click"], [1, "material-icons-outlined", "materialIconButton"], [1, "paddedButton"], ["mat-button", "", 1, "headerButton", "mr-10", 3, "click"], [1, "headline"], ["mat-button", "", 1, "headerButton", 3, "click"], [4, "ngIf"]], - template: function SettingsComponent_Template(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementStart"](0, "div", 0)(1, "mat-toolbar", 1)(2, "mat-toolbar-row")(3, "button", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵlistener"]("click", function SettingsComponent_Template_button_click_3_listener() { - return ctx.close(); - }); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementStart"](4, "span", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵtext"](5, " arrow_back"); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementStart"](6, "div", 4)(7, "button", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipe"](8, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵlistener"]("click", function SettingsComponent_Template_button_click_7_listener() { - return ctx.openIconSetCustomization(); + createLabelDictionaries() { + this.activityLabels = []; + this.workObjektLabels = []; + const allObjects = this.elementRegistryService.getAllCanvasObjects(); + allObjects.forEach(element => { + const name = element.businessObject.name; + if (name && name.length > 0 && element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY) && !this.activityLabels.map(a => a.name).includes(name)) { + this.activityLabels.push({ + name, + originalName: name }); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementStart"](9, "span", 6); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵtext"](10, "Customize Icons for Your Domain"); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementStart"](11, "button", 7); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipe"](12, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵlistener"]("click", function SettingsComponent_Template_button_click_11_listener() { - return ctx.openGeneralSettings(); + } else if (name && name.length > 0 && element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT) && !this.workObjektLabels.map(e => e.name).includes(name)) { + const iconName = element.type.replace(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT, ''); + let icon = this.iconDictionaryService.getIconSource(iconName); + if (!icon) { + return; + } + if (!icon.startsWith('data')) { + icon = 'data:image/svg+xml,' + icon; + } + this.workObjektLabels.push({ + name, + originalName: name, + icon }); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementStart"](13, "span", 6); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵtext"](14, "General Settings"); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementEnd"]()()()()(); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵtemplate"](15, SettingsComponent_app_general_settings_15_Template, 1, 0, "app-general-settings", 8); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipe"](16, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵtemplate"](17, SettingsComponent_app_icon_set_configuration_17_Template, 1, 0, "app-icon-set-configuration", 8); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipe"](18, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementEnd"](); } - if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵadvance"](7); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵclassProp"]("highlight", _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipeBind1"](8, 6, ctx.showIconSetCustomization)); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵclassProp"]("highlight", _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipeBind1"](12, 8, ctx.showGeneralSettings)); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipeBind1"](16, 10, ctx.showGeneralSettings)); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipeBind1"](18, 12, ctx.showIconSetCustomization)); + }); + this.activityLabels.sort((a, b) => { + return a.name.toLowerCase().localeCompare(b.name.toLowerCase()); + }); + this.workObjektLabels.sort((a, b) => { + return a.name.toLowerCase().localeCompare(b.name.toLowerCase()); + }); + } + getActivityLabels() { + return this.activityLabels.slice(); + } + getWorkObjectLabels() { + return this.workObjektLabels.slice(); + } + getUniqueWorkObjectNames() { + const workObjects = this.elementRegistryService.getAllWorkobjects(); + return [...new Set(workObjects.filter(workObject => { + return !!workObject.businessObject.name; + }).map(workObject => workObject.businessObject.name))]; + } + massRenameLabels(activityNames, originalActivityNames, workObjectNames, originalWorkObjectNames) { + for (let i = 0; i < originalActivityNames.length; i++) { + if (!activityNames[i]) { + activityNames[i] = ''; } - }, - dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_7__.NgIf, _General_general_settings_component__WEBPACK_IMPORTED_MODULE_3__.GeneralSettingsComponent, src_app_Presentation_DomainConfiguration_icon_set_configuration_component__WEBPACK_IMPORTED_MODULE_4__.IconSetConfigurationComponent, _angular_material_button__WEBPACK_IMPORTED_MODULE_8__.MatButton, _angular_material_button__WEBPACK_IMPORTED_MODULE_8__.MatIconButton, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__.MatToolbar, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__.MatToolbarRow, _angular_common__WEBPACK_IMPORTED_MODULE_7__.AsyncPipe], - styles: ["mat-toolbar[_ngcontent-%COMP%] *[_ngcontent-%COMP%] {\n color: white;\n}\n\napp-general-settings[_ngcontent-%COMP%] {\n overflow-y: auto;\n}\n\n.settings[_ngcontent-%COMP%] {\n display: grid;\n grid-template-rows: 65px auto;\n width: 100%;\n height: 100%;\n}\n.settings[_ngcontent-%COMP%] .mat-button {\n padding: 0;\n}\n.settings[_ngcontent-%COMP%] .materialIconButton[_ngcontent-%COMP%] {\n margin-top: 0;\n margin-right: 5px;\n padding: 0;\n}\n\n.highlight[_ngcontent-%COMP%] {\n border: 2px solid white;\n}\n\n .mat-tab-label, .mat-tab-label-active {\n height: 30px !important;\n}"] + if (!(activityNames[i] == originalActivityNames[i])) { + this.massNamingService.massChangeNames(originalActivityNames[i], activityNames[i], src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY); + } + } + for (let i = 0; i < originalWorkObjectNames.length; i++) { + if (!workObjectNames[i]) { + workObjectNames[i] = ''; + } + if (!(workObjectNames[i] == originalWorkObjectNames[i])) { + this.massNamingService.massChangeNames(originalWorkObjectNames[i], workObjectNames[i], src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT); + } + } + } + static #_ = this.ɵfac = function LabelDictionaryService_Factory(t) { + return new (t || LabelDictionaryService)(_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](src_app_tools_label_dictionary_services_mass_naming_service__WEBPACK_IMPORTED_MODULE_3__.MassNamingService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_4__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_5__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_domain_services_dialog_service__WEBPACK_IMPORTED_MODULE_6__.DialogService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_9__.MatSnackBar)); + }; + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdefineInjectable"]({ + token: LabelDictionaryService, + factory: LabelDictionaryService.ɵfac, + providedIn: 'root' }); } - return SettingsComponent; + return LabelDictionaryService; })(); /***/ }), -/***/ 97237: -/*!********************************************************************!*\ - !*** ./src/app/Service/Autosave/autosave-configuration.service.ts ***! - \********************************************************************/ +/***/ 75961: +/*!************************************************************************!*\ + !*** ./src/app/tools/label-dictionary/services/mass-naming.service.ts ***! + \************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AutosaveConfigurationService: () => (/* binding */ AutosaveConfigurationService) +/* harmony export */ MassNamingService: () => (/* binding */ MassNamingService) /* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 39090); -/* harmony import */ var src_app_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/constants */ 90816); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _BrowserStorage_storage_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../BrowserStorage/storage.service */ 59298); - +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/services/element-registry.service */ 85511); +/* harmony import */ var _domain_services_command_stack_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../domain/services/command-stack.service */ 96445); -const AUTOSAVE_CONFIGURATION_TAG = 'autosaveConfiguration'; -const defaultConfiguration = { - activated: src_app_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_AUTOSAVES_ENABLED, - interval: src_app_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_AUTOSAVES_INTERVAL, - maxDrafts: src_app_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_AUTOSAVES_MAX_DRAFTS -}; -let AutosaveConfigurationService = /*#__PURE__*/(() => { - class AutosaveConfigurationService { - constructor(storageService) { - this.storageService = storageService; - this.configuration = defaultConfiguration; - this.configurationSubject = new rxjs__WEBPACK_IMPORTED_MODULE_2__.ReplaySubject(1); - this.configuration$ = this.configurationSubject.asObservable(); - this.initializeConfiguration(); - } - initializeConfiguration() { - this.loadConfiguration(); - this.configurationSubject.next(this.configuration); - } - setConfiguration(configuration) { - try { - this.configuration = configuration; - this.saveConfiguration(); - this.configurationSubject.next(configuration); - return true; - } catch { - return false; - } - } - loadConfiguration() { - this.configuration = this.storageService.get(AUTOSAVE_CONFIGURATION_TAG) ?? defaultConfiguration; +let MassNamingService = /*#__PURE__*/(() => { + class MassNamingService { + constructor(elementRegistryService, commandStackService) { + this.elementRegistryService = elementRegistryService; + this.commandStackService = commandStackService; } - saveConfiguration() { - this.storageService.set(AUTOSAVE_CONFIGURATION_TAG, this.configuration); + massChangeNames(oldValue, newValue, type) { + const allRelevantObjects = []; + this.elementRegistryService.getAllCanvasObjects().forEach(element => { + if (element.type.includes(type) && element.businessObject.name === oldValue) { + allRelevantObjects.push(element); + } + }); + const context = { + elements: allRelevantObjects, + newValue + }; + this.commandStackService.execute('domainStoryObjects.massRename', context); } - static #_ = this.ɵfac = function AutosaveConfigurationService_Factory(t) { - return new (t || AutosaveConfigurationService)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](_BrowserStorage_storage_service__WEBPACK_IMPORTED_MODULE_1__.StorageService)); + static #_ = this.ɵfac = function MassNamingService_Factory(t) { + return new (t || MassNamingService)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_0__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_domain_services_command_stack_service__WEBPACK_IMPORTED_MODULE_1__.CommandStackService)); }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjectable"]({ - token: AutosaveConfigurationService, - factory: AutosaveConfigurationService.ɵfac, + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ + token: MassNamingService, + factory: MassNamingService.ɵfac, providedIn: 'root' }); } - return AutosaveConfigurationService; + return MassNamingService; })(); /***/ }), -/***/ 30534: -/*!******************************************************!*\ - !*** ./src/app/Service/Autosave/autosave.service.ts ***! - \******************************************************/ +/***/ 95715: +/*!*********************************************!*\ + !*** ./src/app/tools/modeler/bpmn/index.js ***! + \*********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AutosaveService: () => (/* binding */ AutosaveService), -/* harmony export */ DRAFTS_TAG: () => (/* binding */ DRAFTS_TAG) +/* harmony export */ "default": () => (/* binding */ DomainStoryModeler) /* harmony export */ }); -/* harmony import */ var _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Domain/Common/elementTypes */ 30236); -/* harmony import */ var _Domain_Icon_Set_Configuration_iconSetConfiguration__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Domain/Icon-Set-Configuration/iconSetConfiguration */ 77044); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ 907); -/* harmony import */ var _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Domain/Common/constants */ 90816); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _autosave_configuration_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./autosave-configuration.service */ 97237); -/* harmony import */ var _Export_export_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Export/export.service */ 98106); -/* harmony import */ var _IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../IconSetConfiguration/icon-dictionary.service */ 93689); -/* harmony import */ var _Renderer_renderer_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Renderer/renderer.service */ 94896); -/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); -/* harmony import */ var _BrowserStorage_storage_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../BrowserStorage/storage.service */ 59298); -/* harmony import */ var _Title_title_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Title/title.service */ 69672); - - - - +/* harmony import */ var bpmn_js_lib_Modeler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! bpmn-js/lib/Modeler */ 3922); +/* harmony import */ var diagram_js_lib_features_resize__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! diagram-js/lib/features/resize */ 33485); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! min-dash */ 93673); +/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ 51270); +/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _modeler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modeler */ 50458); +/* harmony import */ var _modeler_labeling__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modeler/labeling */ 37069); +/* harmony import */ var _modeler_modeling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modeler/modeling */ 81408); +/* harmony import */ var _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../domain/entities/elementTypes */ 73190); @@ -70698,671 +69010,629 @@ __webpack_require__.r(__webpack_exports__); -const DRAFTS_TAG = 'autosaveDrafts'; -let AutosaveService = /*#__PURE__*/(() => { - class AutosaveService { - constructor(autosaveConfiguration, exportService, iconDictionaryService, rendererService, snackbar, storageService, titleService) { - this.autosaveConfiguration = autosaveConfiguration; - this.exportService = exportService; - this.iconDictionaryService = iconDictionaryService; - this.rendererService = rendererService; - this.snackbar = snackbar; - this.storageService = storageService; - this.titleService = titleService; - this.autosavedDraftsChanged$ = new rxjs__WEBPACK_IMPORTED_MODULE_9__.Subject(); - this.autosaveConfiguration.configuration$.subscribe(configuration => this.updateConfiguration(configuration)); - } - loadCurrentDrafts() { - const drafts = this.readDrafts(); - this.sortDrafts(drafts); - return drafts; - } - loadDraft(draft) { - const configFromFile = draft.configAndDST.domain; - const config = (0,_Domain_Icon_Set_Configuration_iconSetConfiguration__WEBPACK_IMPORTED_MODULE_1__.fromConfigurationFromFile)(configFromFile); - const story = JSON.parse(draft.configAndDST.dst); - this.titleService.updateTitleAndDescription(draft.title, draft.description, false); - const actorIcons = this.iconDictionaryService.getElementsOfType(story, _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR); - const workObjectIcons = this.iconDictionaryService.getElementsOfType(story, _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT); - this.iconDictionaryService.updateIconRegistries(actorIcons, workObjectIcons, config); - this.rendererService.importStory(story, true, config, false); - } - removeAllDrafts() { - this.storageService.set(DRAFTS_TAG, []); - this.autosavedDraftsChanged$.next(); - } - loadLatestDraft() { - const drafts = this.readDrafts(); - if (drafts.length === 0) { - return; - } - this.loadDraft(drafts[0]); - } - updateConfiguration(configuration) { - this.stopTimer(); - if (configuration.activated) { - this.startTimer(configuration.interval, configuration.maxDrafts); - } - } - stopTimer() { - if (this.autosaveTimer) { - clearInterval(this.autosaveTimer); - this.autosaveTimer = undefined; - } - } - startTimer(interval, maxDrafts) { - this.autosaveTimer = setInterval(() => { - const savedDrafts = this.loadCurrentDrafts(); - const newDraft = this.createDraft(); - let isChanged = maxDrafts > 0; - if (savedDrafts.length > 0) { - isChanged = isChanged && !this.isSame(newDraft, savedDrafts[0]); - } - if (isChanged && !this.isDraftEmpty(newDraft)) { - savedDrafts.unshift(newDraft); - while (savedDrafts.length > maxDrafts) { - savedDrafts.pop(); - } - this.writeDrafts(savedDrafts); - this.snackbar.open('Draft Saved', undefined, { - panelClass: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_2__.SNACKBAR_INFO, - duration: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_2__.SNACKBAR_DURATION - }); - this.autosavedDraftsChanged$.next(); - } - }, interval * 1000); - } - isDraftEmpty(draft) { - const configAndDST = draft.configAndDST ?? { - dst: '[]' - }; - return draft.title === _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_2__.INITIAL_TITLE && draft.description === _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_2__.INITIAL_DESCRIPTION && JSON.parse(configAndDST.dst).length === 0; - } - isSame(a, b) { - return a.title === b.title && a.description === b.description && JSON.stringify(a.configAndDST) === JSON.stringify(b.configAndDST); - } - writeDrafts(drafts) { - this.storageService.set(DRAFTS_TAG, drafts); - } - readDrafts() { - return this.storageService.get(DRAFTS_TAG) ?? []; - } - createDraft() { - const dst = JSON.stringify(this.rendererService.getStory(), null, 2); - const configAndDST = this.exportService.createConfigAndDST(dst); - const date = new Date().toString().slice(0, 25); - return { - title: this.titleService.getTitle(), - description: this.titleService.getDescription(), - configAndDST, - date - }; - } - sortDrafts(drafts) { - drafts.sort((a, b) => { - const aDate = Date.parse(a.date); - const bDate = Date.parse(b.date); - return aDate > bDate ? 0 : 1; - }); +function DomainStoryModeler(options) { + bpmn_js_lib_Modeler__WEBPACK_IMPORTED_MODULE_5__["default"].call(this, options); + this._customElements = []; + this._groupElements = []; +} +inherits__WEBPACK_IMPORTED_MODULE_0___default()(DomainStoryModeler, bpmn_js_lib_Modeler__WEBPACK_IMPORTED_MODULE_5__["default"]); +DomainStoryModeler.prototype._modules = [].concat(DomainStoryModeler.prototype._modules, [_modeler__WEBPACK_IMPORTED_MODULE_1__["default"], _modeler_labeling__WEBPACK_IMPORTED_MODULE_2__["default"], _modeler_modeling__WEBPACK_IMPORTED_MODULE_3__["default"]], [diagram_js_lib_features_resize__WEBPACK_IMPORTED_MODULE_6__["default"]]); +/** + * add a single custom element to the underlying diagram + * + * @param {Object} customElement + */ +DomainStoryModeler.prototype._addCustomShape = function (customElement) { + let parentId = customElement.parent; + delete customElement.children; + delete customElement.parent; + this._customElements.push(customElement); + let canvas = this.get("canvas"), + elementFactory = this.get("elementFactory"); + let customAttrs = (0,min_dash__WEBPACK_IMPORTED_MODULE_7__.assign)({ + businessObject: customElement + }, customElement); + let customShape = elementFactory.create("shape", customAttrs); + if (isGroup(customElement)) { + this._groupElements[customElement.id] = customShape; + } + if (parentId) { + let parentShape = this._groupElements[parentId]; + if (isGroup(parentShape)) { + return canvas.addShape(customShape, parentShape, parentShape.id); } - static #_ = this.ɵfac = function AutosaveService_Factory(t) { - return new (t || AutosaveService)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_autosave_configuration_service__WEBPACK_IMPORTED_MODULE_3__.AutosaveConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_Export_export_service__WEBPACK_IMPORTED_MODULE_4__.ExportService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_5__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_Renderer_renderer_service__WEBPACK_IMPORTED_MODULE_6__.RendererService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__.MatSnackBar), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_BrowserStorage_storage_service__WEBPACK_IMPORTED_MODULE_7__.StorageService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_Title_title_service__WEBPACK_IMPORTED_MODULE_8__.TitleService)); - }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineInjectable"]({ - token: AutosaveService, - factory: AutosaveService.ɵfac, - providedIn: 'root' - }); } - return AutosaveService; -})(); + return canvas.addShape(customShape); +}; +DomainStoryModeler.prototype._addCustomConnection = function (customElement) { + this._customElements.push(customElement); + let canvas = this.get("canvas"), + elementFactory = this.get("elementFactory"), + elementRegistry = this.get("elementRegistry"); + let customAttrs = (0,min_dash__WEBPACK_IMPORTED_MODULE_7__.assign)({ + businessObject: customElement + }, customElement); + let connection = elementFactory.create("connection", (0,min_dash__WEBPACK_IMPORTED_MODULE_7__.assign)(customAttrs, { + source: elementRegistry.get(customElement.source), + target: elementRegistry.get(customElement.target) + }), elementRegistry.get(customElement.source).parent); + return canvas.addConnection(connection); +}; +//** We import BusinessObjects, not the whole Canvas Object!!!!!!!! +DomainStoryModeler.prototype.importCustomElements = function (elements) { + this.get("eventBus").fire("diagram.clear", {}); + this._customElements = []; + this._groupElements = []; + this.addCustomElements(elements); +}; +/** + * add a number of custom elements and connections to the underlying diagram. + * + * @param {Array} customElements + */ +DomainStoryModeler.prototype.addCustomElements = function (customElements) { + if (!(0,min_dash__WEBPACK_IMPORTED_MODULE_7__.isArray)(customElements)) { + throw new Error("argument must be an array"); + } + let shapes = [], + connections = [], + groups = []; + customElements.forEach(function (customElement) { + if (isConnection(customElement)) { + connections.push(customElement); + } else if (isGroup(customElement)) { + groups.push(customElement); + } else { + shapes.push(customElement); + } + }); + // add groups before shapes and shapes before connections so that connections + // can already rely on the shapes being part of the diagram + groups.forEach(this._addCustomShape, this); + shapes.forEach(this._addCustomShape, this); + connections.forEach(this._addCustomConnection, this); +}; +/** + * get custom elements with their current status. + * + * @return {Array} custom elements on the diagram + */ +DomainStoryModeler.prototype.getCustomElements = function () { + return this._customElements; +}; +// override standard function to prevent default elements on canvas +DomainStoryModeler.prototype.createDiagram = function (done) {}; +function isConnection(element) { + return element.type === _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_4__.ElementTypes.ACTIVITY || element.type === _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_4__.ElementTypes.CONNECTION; +} +function isGroup(element) { + return element && element.type === _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_4__.ElementTypes.GROUP; +} /***/ }), -/***/ 59298: -/*!***********************************************************!*\ - !*** ./src/app/Service/BrowserStorage/storage.service.ts ***! - \***********************************************************/ +/***/ 76011: +/*!*******************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/change-icon/replace.js ***! + \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ StorageService: () => (/* binding */ StorageService) +/* harmony export */ "default": () => (/* binding */ Replace) /* harmony export */ }); -/* harmony import */ var _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Domain/Common/constants */ 90816); -/* harmony import */ var _Domain_Icon_Set_Configuration_iconSetConfiguration__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Domain/Icon-Set-Configuration/iconSetConfiguration */ 77044); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); - +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ 93673); -let StorageService = /*#__PURE__*/(() => { - class StorageService { - set(key, value) { - localStorage.setItem(key, JSON.stringify(value)); - } - get(key) { - const json = localStorage.getItem(key); - if (json) { - return JSON.parse(json); - } - return null; - } - removeItem(key) { - localStorage.removeItem(key); - } - checkValidityOfConfiguration(configuratioFromFile) { - return configuratioFromFile.actors.keysArray().length > 1 && configuratioFromFile.workObjects.keysArray().length > 1 && !configuratioFromFile.actors.all().some(e => typeof e.value !== 'string') && !configuratioFromFile.workObjects.all().some(e => typeof e.value !== 'string'); - } - getStoredIconSetConfiguration() { - const iconSetString = localStorage.getItem(_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.ICON_SET_CONFIGURATION_TAG); - if (!iconSetString) { - return; - } else { - const configurationFromFile = (0,_Domain_Icon_Set_Configuration_iconSetConfiguration__WEBPACK_IMPORTED_MODULE_1__.fromConfigurationFromFile)(JSON.parse(iconSetString)); - if (this.checkValidityOfConfiguration(configurationFromFile)) { - return configurationFromFile; - } - } - return; - } - setStoredIconSetConfiguration(config) { - const actors = {}; - config.actors.keysArray().forEach(key => { - actors[key] = config.actors.get(key); - }); - const workObjects = {}; - config.workObjects.keysArray().forEach(key => { - workObjects[key] = config.workObjects.get(key); - }); - const configForStorage = { - name: config.name, - actors: actors, - workObjects: workObjects - }; - localStorage.setItem(_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.ICON_SET_CONFIGURATION_TAG, JSON.stringify(configForStorage, null, 2)); - } - static #_ = this.ɵfac = function StorageService_Factory(t) { - return new (t || StorageService)(); - }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ - token: StorageService, - factory: StorageService.ɵfac, - providedIn: 'root' - }); - } - return StorageService; -})(); -/***/ }), +/** + * service that allow replacing of elements. + */ +function Replace(modeling) { + this._modeling = modeling; +} +/** + * @param {Element} oldElement - element to be replaced + * @param {Object} newElementData - containing information about the new Element, for example height, width, type. + * @param modeling + */ +function replaceElement(oldElement, newElementData, modeling) { + // let modeling = this._modeling; + let newElement = setCenterOfElement(newElementData, oldElement, modeling); + let outgoingActivities = newElement.outgoing; + let incomingActivities = newElement.incoming; + outgoingActivities.forEach(element => { + element.businessObject.source = newElement.id; + }); + incomingActivities.forEach(element => { + element.businessObject.target = newElement.id; + }); + return newElement; +} +function setCenterOfElement(newElementData, oldElement, modeling) { + newElementData.x = Math.ceil(oldElement.x + (newElementData.width || oldElement.width) / 2); + newElementData.y = Math.ceil(oldElement.y + (newElementData.height || oldElement.height) / 2); + (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)(newElementData, { + name: oldElement.businessObject.name + }); + return modeling.replaceShape(oldElement, newElementData, {}); +} +Replace.prototype.replaceElement = replaceElement; -/***/ 19381: -/*!***************************************************************!*\ - !*** ./src/app/Service/CommandStack/command-stack.service.ts ***! - \***************************************************************/ +/***/ }), + +/***/ 98461: +/*!*******************************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/change-icon/replaceMenuProvider.js ***! + \*******************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ CommandStackService: () => (/* binding */ CommandStackService) +/* harmony export */ "default": () => (/* binding */ ReplaceMenuProvider) /* harmony export */ }); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2978); - -let CommandStackService = /*#__PURE__*/(() => { - class CommandStackService { - constructor() {} - setCommandStack(commandStack) { - this.commandStack = commandStack; - } - execute(action, payload) { - this.commandStack.execute(action, payload); - } - static #_ = this.ɵfac = function CommandStackService_Factory(t) { - return new (t || CommandStackService)(); - }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ - token: CommandStackService, - factory: CommandStackService.ɵfac, - providedIn: 'root' - }); - } - return CommandStackService; -})(); +/* harmony import */ var _replace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./replace */ 76011); +/* harmony import */ var _replaceOptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./replaceOptions */ 18405); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! min-dash */ 93673); -/***/ }), -/***/ 4730: -/*!**************************************************!*\ - !*** ./src/app/Service/Dialog/dialog.service.ts ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ DialogService: () => (/* binding */ DialogService) -/* harmony export */ }); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -let DialogService = /*#__PURE__*/(() => { - class DialogService { - constructor(matDialog) { - this.matDialog = matDialog; - } - openDialog(dialog, config) { - this.matDialog.open(dialog, config); - } - static #_ = this.ɵfac = function DialogService_Factory(t) { - return new (t || DialogService)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_1__.MatDialog)); - }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ - token: DialogService, - factory: DialogService.ɵfac, - providedIn: 'root' - }); +/** + * This module is an element agnostic replace menu provider for the popup menu. + */ +function ReplaceMenuProvider(modeling) { + this._dsReplace = new _replace__WEBPACK_IMPORTED_MODULE_0__["default"](modeling); + this._modeling = modeling; +} +ReplaceMenuProvider.$inject = ["modeling"]; +/** + * Get all entries from replaceOptions for the given element and apply filters + * on them. Get for example only elements, which are different from the current one. + * + * @param {djs.model.Base} element + * + * @return {Array} a list of menu entry items + */ +ReplaceMenuProvider.prototype.getEntries = function (element) { + let entries; + if (element.type.includes("actor")) { + entries = _replaceOptions__WEBPACK_IMPORTED_MODULE_1__.actorReplaceOptions(element.type); + } else if (element.type.includes("workObject")) { + entries = _replaceOptions__WEBPACK_IMPORTED_MODULE_1__.workObjectReplaceOptions(element.type); } - return DialogService; -})(); + return this._createEntries(element, entries); +}; +/** + * Creates an array of menu entry objects for a given element and filters the replaceOptions + * according to a filter function. + * + * @param {djs.model.Base} element + * @param {Object} replaceOptions + * + * @return {Array} a list of menu items + */ +ReplaceMenuProvider.prototype._createEntries = function (element, replaceOptions) { + let menuEntries = []; + let self = this; + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.forEach)(replaceOptions, function (definition) { + let entry = self._createMenuEntry(definition, element); + menuEntries.push(entry); + }); + return menuEntries; +}; +/** + * Creates and returns a single menu entry item. + * + * @param {Object} definition a single replace options definition object + * @param {djs.model.Base} element + * @param {Function} [action] an action callback function which gets called when + * the menu entry is being triggered. + * + * @return {Object} menu entry item + */ +ReplaceMenuProvider.prototype._createMenuEntry = function (definition, element, action) { + let replaceElement = this._dsReplace.replaceElement; + let modeling = this._modeling; + let replaceAction = function () { + return replaceElement(element, definition.target, modeling); + }; + action = action || replaceAction; + return { + label: definition.label, + className: definition.className, + id: definition.actionName, + action: action + }; +}; /***/ }), -/***/ 89791: -/*!*********************************************************!*\ - !*** ./src/app/Service/DirtyFlag/dirty-flag.service.ts ***! - \*********************************************************/ +/***/ 18405: +/*!**************************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/change-icon/replaceOptions.js ***! + \**************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ DirtyFlagService: () => (/* binding */ DirtyFlagService) +/* harmony export */ actorReplaceOptions: () => (/* binding */ actorReplaceOptions), +/* harmony export */ initializeReplaceOptions: () => (/* binding */ initializeReplaceOptions), +/* harmony export */ workObjectReplaceOptions: () => (/* binding */ workObjectReplaceOptions) /* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 95981); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); - -let DirtyFlagService = /*#__PURE__*/(() => { - class DirtyFlagService { - constructor() { - this.isDirtySubject = new rxjs__WEBPACK_IMPORTED_MODULE_0__.BehaviorSubject(false); - this.dirty$ = this.isDirtySubject.asObservable(); - } - makeDirty() { - this.isDirtySubject.next(true); - } - makeClean() { - this.isDirtySubject.next(false); +let iconDictionaryService; +function initializeReplaceOptions(iconDictionary) { + iconDictionaryService = iconDictionary; +} +function actorReplaceOptions(name) { + const actorTypes = iconDictionaryService.getTypeDictionary(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR); + let replaceOption = {}; + let i = 0; + actorTypes.keysArray().forEach(actorType => { + if (!name.includes(actorType)) { + const typeName = actorType; + replaceOption[i] = { + label: "Change to " + typeName, + actionName: "replace-with-actor-" + typeName.toLowerCase(), + className: iconDictionaryService.getIconForBPMN(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR, actorType), + target: { + type: `${src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR}${actorType}` + } + }; + i++; } - get dirty() { - return this.isDirtySubject.value; + }); + return replaceOption; +} +function workObjectReplaceOptions(name) { + const workObjectTypes = iconDictionaryService.getTypeDictionary(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT); + let replaceOption = {}; + let i = 0; + workObjectTypes.keysArray().forEach(workObjectType => { + if (!name.includes(workObjectType)) { + const typeName = workObjectType; + replaceOption[i] = { + label: "Change to " + typeName, + actionName: "replace-with-actor-" + typeName, + className: iconDictionaryService.getIconForBPMN(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT, workObjectType), + target: { + type: `${src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT}${workObjectType}` + } + }; } - static #_ = this.ɵfac = function DirtyFlagService_Factory(t) { - return new (t || DirtyFlagService)(); - }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ - token: DirtyFlagService, - factory: DirtyFlagService.ɵfac, - providedIn: 'root' - }); - } - return DirtyFlagService; -})(); + i++; + }); + return replaceOption; +} /***/ }), -/***/ 63149: -/*!*********************************************************************!*\ - !*** ./src/app/Service/DomManipulation/dom-manipulation.service.ts ***! - \*********************************************************************/ +/***/ 57218: +/*!*****************************************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/context-pad/domainStoryContextPadProvider.js ***! + \*****************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ DomManipulationService: () => (/* binding */ DomManipulationService) +/* harmony export */ "default": () => (/* binding */ DomainStoryContextPadProvider), +/* harmony export */ initializeContextPadProvider: () => (/* binding */ initializeContextPadProvider) /* harmony export */ }); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var _Domain_DomManipulation_replayConstants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Domain/DomManipulation/replayConstants */ 90173); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/Service/ElementRegistry/element-registry.service */ 67613); +/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ 51270); +/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var bpmn_js_lib_features_context_pad_ContextPadProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! bpmn-js/lib/features/context-pad/ContextPadProvider */ 78809); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! min-dash */ 93673); +/* harmony import */ var _numbering_numbering__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../numbering/numbering */ 14945); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/tools/icon-set-config/domain/allIcons */ 61070); -/** - * Manipulates the DOM during replay to only show the elements of the current Sentence - */ -let DomManipulationService = /*#__PURE__*/(() => { - class DomManipulationService { - constructor(elementRegistryService) { - this.elementRegistryService = elementRegistryService; - } - showAll() { - this.removeHighlights(); - this.elementRegistryService.getAllCanvasObjects().slice().concat(this.elementRegistryService.getAllGroups().slice()).map(e => e.businessObject).forEach(element => { - const domObject = document.querySelector('[data-element-id=' + element.id + ']'); - // @ts-ignore - domObject.style.display = 'block'; - }); - } - showSentence(replaySentence, previousSentence) { - this.removeHighlights(); - const notShown = this.getAllNotShown(replaySentence.objects); - notShown.forEach(element => { - const domObject = document.querySelector('[data-element-id=' + element.id + ']'); - if (domObject) { - // @ts-ignore - domObject.style.display = 'none'; - } - }); - this.highlightSentence(previousSentence ? replaySentence.objects.filter(o => !previousSentence.objects.includes(o)) : replaySentence.objects); - replaySentence.objects.forEach(element => { - const domObject = document.querySelector('[data-element-id=' + element.id + ']'); - if (domObject) { - // @ts-ignore - domObject.style.display = 'block'; - } - }); - } - getNumberDomForActivity(activity) { - const numberText = activity.parentElement?.getElementsByClassName('djs-labelNumber')[0] ?? ''; - const circle = numberText?.previousSibling ?? ''; - return { - numberBackgroundDom: circle, - numberTextDom: numberText - }; + + + + +let dirtyFlagService; +let iconDictionaryService; +function initializeContextPadProvider(dirtyFlag, iconDictionary) { + dirtyFlagService = dirtyFlag; + iconDictionaryService = iconDictionary; +} +function DomainStoryContextPadProvider(injector, connect, translate, elementFactory, create, canvas, contextPad, popupMenu, replaceMenuProvider, commandStack, eventBus, modeling) { + let startConnect; + let selectedElement; + injector.invoke(bpmn_js_lib_features_context_pad_ContextPadProvider__WEBPACK_IMPORTED_MODULE_4__["default"], this); + let autoPlace = injector.get("autoPlace", false); + let cached = (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.bind)(this.getContextPadEntries, this); + document.addEventListener("pickedColor", event => { + if (selectedElement) { + executeCommandStack(event); } - removeHighlights() { - const allActivities = this.elementRegistryService.getAllActivities(); - const allConnections = this.elementRegistryService.getAllConnections(); - allActivities.forEach(activity => { - const querySelector = document.querySelector('[data-element-id=' + activity.id + ']'); - if (querySelector) { - const activityDomObject = querySelector.getElementsByTagName('polyline')[0]; - activityDomObject.style.stroke = activity.businessObject.pickedColor || 'black'; - activityDomObject.style.strokeWidth = _Domain_DomManipulation_replayConstants__WEBPACK_IMPORTED_MODULE_1__.STROKE_WIDTH; - const { - numberBackgroundDom, - numberTextDom - } = this.getNumberDomForActivity(activityDomObject); - if (numberBackgroundDom && numberTextDom) { - numberBackgroundDom.style.fill = _Domain_DomManipulation_replayConstants__WEBPACK_IMPORTED_MODULE_1__.NUMBER_BACKGROUND_COLOR; - numberTextDom.style.fill = _Domain_DomManipulation_replayConstants__WEBPACK_IMPORTED_MODULE_1__.NUMBER_COLOR; + }); + popupMenu.registerProvider("ds-replace", replaceMenuProvider); + popupMenu.registerProvider("bpmn-replace", replaceMenuProvider); + this.getContextPadEntries = function (element) { + selectedElement = element; + document.dispatchEvent(new CustomEvent("defaultColor", { + detail: { + color: selectedElement.businessObject.pickedColor ?? "#000000" + } + })); + const allStandardIconKeys = (0,src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_3__.getAllStandardIconKeys)(); + let actions = cached(element); + startConnect = function (event, element, autoActivate) { + connect.start(event, element, autoActivate); + }; + if (element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT)) { + addColorChange(actions); + addConnectWithActivity(actions, startConnect); + addTextAnnotation(actions); + addActors(appendAction, actions); + addWorkObjects(appendAction, actions); + addChangeWorkObjectTypeMenu(actions); + } else if (element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR)) { + addColorChange(actions); + addConnectWithActivity(actions, startConnect); + addTextAnnotation(actions); + addWorkObjects(appendAction, actions); + addChangeActorTypeMenu(actions); + } else if (element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.GROUP)) { + delete actions.delete; + addTextAnnotation(actions); + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { + deleteGroup: { + group: "edit", + className: "bpmn-icon-trash", + title: "Remove Group without Child-Elements", + action: { + click: function (event, element) { + modeling.removeGroup(element); + dirtyFlagService.makeDirty(); + } } } }); - allConnections.forEach(connection => { - // @ts-ignore - const connectionDomObject = document.querySelector('[data-element-id=' + connection.id + ']').getElementsByTagName('polyline')[0]; - connectionDomObject.style.stroke = connection.businessObject.pickedColor || 'black'; - connectionDomObject.style.strokeWidth = '1.5'; - }); - } - highlightSentence(sentenceObjects) { - sentenceObjects.filter(e => e.type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY).forEach(activity => { - const querySelector = document.querySelector('[data-element-id=' + activity.id + ']'); - if (querySelector) { - const activityDomObject = querySelector.getElementsByTagName('polyline')[0]; - activityDomObject.style.strokeWidth = _Domain_DomManipulation_replayConstants__WEBPACK_IMPORTED_MODULE_1__.HIGHLIGHT_STROKE_WIDTH; - const { - numberBackgroundDom, - numberTextDom - } = this.getNumberDomForActivity(activityDomObject); - if (numberTextDom && numberBackgroundDom) { - numberBackgroundDom.style.fill = _Domain_DomManipulation_replayConstants__WEBPACK_IMPORTED_MODULE_1__.HIGHLIGHT_NUMBER_BACKGROUNG_COLOR; - numberTextDom.style.fill = _Domain_DomManipulation_replayConstants__WEBPACK_IMPORTED_MODULE_1__.HIGHLIGHT_NUMBER_COLOR; + addColorChange(actions); + } else if (element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTIVITY)) { + moveDeleteActionToEndOfArray(actions); + addColorChange(actions); + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { + delete: { + group: "edit", + className: "bpmn-icon-trash", + title: "Remove", + action: { + click: function (event, element) { + modeling.removeElements({ + element + }); + dirtyFlagService.makeDirty(); + } } } }); } - getAllNotShown(shownElements) { - const notShownElements = []; - const allObjects = this.elementRegistryService.getAllCanvasObjects().concat(this.elementRegistryService.getAllGroups()); - allObjects.forEach(element => { - if (!shownElements.includes(element.businessObject)) { - if (element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.CONNECTION)) { - // @ts-ignore - if (!element.source.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.GROUP)) { - notShownElements.push(element.businessObject); - } else { - // @ts-ignore - shownElements.push(element.target); - } - } else { - notShownElements.push(element.businessObject); + return actions; + }; + function moveDeleteActionToEndOfArray(actions) { + delete actions.delete; + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { + changeDirection: { + group: "edit", + className: "icon-domain-story-changeDirection", + title: translate("Change direction"), + action: { + // event needs to be addressed + click: function (event, element) { + changeDirection(element); } } - }); - return notShownElements; - } - static #_ = this.ɵfac = function DomManipulationService_Factory(t) { - return new (t || DomManipulationService)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_2__.ElementRegistryService)); - }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjectable"]({ - token: DomManipulationService, - factory: DomManipulationService.ɵfac, - providedIn: 'root' + } }); } - return DomManipulationService; -})(); - -/***/ }), - -/***/ 67613: -/*!*********************************************************************!*\ - !*** ./src/app/Service/ElementRegistry/element-registry.service.ts ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ElementRegistryService: () => (/* binding */ ElementRegistryService) -/* harmony export */ }); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); - - -let ElementRegistryService = /*#__PURE__*/(() => { - class ElementRegistryService { - constructor() { - this.fullyInitialized = false; - } - /** - * Initially the registry has only the root-Element. - * Once the canvas has bees initialized, we adjust the reference to point to the elements on the canvas for convenience - */ - correctInitialize() { - if (!this.fullyInitialized) { - if (this.registry.__implicitroot) { - this.registry = this.registry.__implicitroot.element.children; - this.fullyInitialized = true; + function addChangeActorTypeMenu(actions) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { + replace: { + group: "edit", + className: "bpmn-icon-screw-wrench", + title: translate("Change type"), + action: { + click: function (event, element) { + let position = (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(getReplaceMenuPosition(element), { + cursor: { + x: event.x, + y: event.y + } + }); + popupMenu.open(element, "ds-replace", position); + } } } - } - setElementRegistry(registry) { - this.registry = registry._elements; - } - clear() { - this.registry = null; - this.fullyInitialized = false; - } - createObjectListForDSTDownload() { - if (this.registry) { - const allObjectsFromCanvas = this.getAllCanvasObjects(); - const groups = this.getAllGroups(); - const objectList = []; - this.fillListOfCanvasObjects(allObjectsFromCanvas, objectList, groups); - return objectList; - } - return []; - } - fillListOfCanvasObjects(allObjectsFromCanvas, objectList, groups) { - allObjectsFromCanvas.forEach(canvasElement => { - if (canvasElement.type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY) { - objectList.push(canvasElement); - } - // ensure that Activities are always after Actors, Workobjects and Groups in .dst files - else { - if (canvasElement.type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.TEXTANNOTATION) { - canvasElement.businessObject.width = canvasElement.width; - canvasElement.businessObject.height = canvasElement.height; - } - if (!objectList.includes(canvasElement)) { - objectList.unshift(canvasElement); + }); + } + function addColorChange(actions) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { + colorChange: { + group: "edit", + className: "icon-domain-story-color-picker", + title: translate("Change color"), + action: { + click: function (event, element) { + document.dispatchEvent(new CustomEvent("openColorPicker")); } } - }); - groups.forEach(group => { - objectList.push(group); - }); - } - getAllActivities() { - const activities = []; - this.getAllCanvasObjects().forEach(element => { - if (element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY)) { - activities.push(element); - } - }); - return activities; - } - getAllConnections() { - const connections = []; - this.getAllCanvasObjects().forEach(element => { - const type = element.type; - if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.CONNECTION) { - connections.push(element); - } - }); - return connections; - } - getAllCanvasObjects() { - const allObjects = []; - const groupObjects = []; - this.checkChildForGroup(groupObjects, allObjects); - // for each memorized group, remove it from the group-array and check its children, whether they are groups or not - // if a child is a group, memorize it in the group-array - // other children should already be in the allObjects list - let i = groupObjects.length - 1; - while (groupObjects.length >= 1) { - const currentGroup = groupObjects.pop(); - // @ts-ignore - currentGroup.children.forEach(child => { - const type = child.type; - if (type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.GROUP)) { - groupObjects.push(child); - } - }); - i = groupObjects.length - 1; } - return allObjects; - } - // returns all groups on the canvas and inside other groups - getAllGroups() { - const groupObjects = []; - const allObjects = []; - this.checkChildForGroup(groupObjects, allObjects); - for (const group of groupObjects) { - group.children?.forEach(child => { - if (child.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.GROUP)) { - groupObjects.push(child); - } - }); + }); + } + function addTextAnnotation(actions) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { + "append.text-annotation": appendAction(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.TEXTANNOTATION, "bpmn-icon-text-annotation", "textannotation", "connect") + }); + } + function addConnectWithActivity(actions, startConnect) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { + connect: { + group: "connect", + className: "bpmn-icon-connection", + title: translate("Connect with activity"), + action: { + click: startConnect, + dragstart: startConnect + } } - return groupObjects; - } - checkChildForGroup(groupObjects, allObjects) { - const registryElementNames = Object.keys(this.registry); - for (let name of registryElementNames) { - const entry = this.registry[name].element; - if (entry.businessObject) { - const type = entry.type; - if (type && type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.GROUP)) { - // if it is a group, memorize this for later - groupObjects.push(entry); - } else if (type) { - allObjects.push(entry); + }); + } + function addWorkObjects(appendAction, actions) { + let workObjectTypes = iconDictionaryService.getTypeDictionary(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT); + workObjectTypes.keysArray().forEach(workObjectType => { + let name = workObjectType; + let icon = iconDictionaryService.getIconForBPMN(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT, workObjectType); + let action = []; + action["append.workObject" + name] = appendAction(`${src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT}${workObjectType}`, icon, name, "workObjects"); + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, action); + }); + } + function addActors(appendAction, actions) { + let actorTypes = iconDictionaryService.getTypeDictionary(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR); + actorTypes.keysArray().forEach(actorType => { + let name = actorType; + let icon = iconDictionaryService.getIconForBPMN(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR, actorType); + let action = []; + action["append.actor" + name] = appendAction(`${src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR}${actorType}`, icon, name, "actors"); + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, action); + }); + } + function addChangeWorkObjectTypeMenu(actions) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(actions, { + replace: { + group: "edit", + className: "bpmn-icon-screw-wrench", + title: translate("Change type"), + action: { + click: function (event, element) { + let position = (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(getReplaceMenuPosition(element), { + cursor: { + x: event.x, + y: event.y + } + }); + popupMenu.open(element, "ds-replace", position); } } } + }); + } + function changeDirection(element) { + let context; + let businessObject = element.businessObject; + let newNumber; + if (element.source.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR)) { + newNumber = 0; + } else { + newNumber = (0,_numbering_numbering__WEBPACK_IMPORTED_MODULE_1__.generateAutomaticNumber)(element, commandStack); } - // get a list of activities, that originate from an actor-type - getActivitiesFromActors() { - const activitiesFromActors = []; - const activities = this.getAllActivities(); - activities.forEach(activity => { - if (activity.source?.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR)) { - activitiesFromActors.push(activity); - } - }); - // sort by activityBusinessObject number - activitiesFromActors.sort((activityCanvasA, activityCanvasB) => { - const activityNumberA = Number(activityCanvasA.businessObject.number); - const activityNumberB = Number(activityCanvasB.businessObject.number); - return activityNumberA - activityNumberB; + context = { + businessObject: businessObject, + newNumber: newNumber, + element: element + }; + commandStack.execute("activity.directionChange", context); + } + function getReplaceMenuPosition(element) { + let Y_OFFSET = 5; + let diagramContainer = canvas.getContainer(), + pad = contextPad.getPad(element).html; + let diagramRect = diagramContainer.getBoundingClientRect(), + padRect = pad.getBoundingClientRect(); + let top = padRect.top - diagramRect.top; + let left = padRect.left - diagramRect.left; + return { + x: left, + y: top + padRect.height + Y_OFFSET + }; + } + /** + * create an append action + * + * @param {String} type + * @param {String} className + * @param {String} [title] + * @param {String} group + * @param {Object} [options] + * + * @return {Object} descriptor + */ + function appendAction(type, className, title, group, options) { + if (typeof title !== "string") { + options = title; + title = translate("{type}", { + type: type.replace(/^domainStory:/, "") }); - return activitiesFromActors; } - getUsedIcons() { - const actors = this.getAllActors(); - const workobjects = this.getAllWorkobjects(); - return { - actors: actors.map(a => a.type.replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR, '')), - workobjects: workobjects.map(w => w.type.replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT, '')) + function appendStart(event, element) { + let shape = elementFactory.createShape((0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)({ + type: type + }, options)); + let context = { + elements: [shape], + hints: {}, + source: element }; + create.start(event, shape, context); } - getAllActors() { - return this.getAllCanvasObjects().filter(co => co.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR)); - } - getAllWorkobjects() { - return this.getAllCanvasObjects().filter(co => co.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT)); - } - static #_ = this.ɵfac = function ElementRegistryService_Factory(t) { - return new (t || ElementRegistryService)(); + return { + group: group, + className: className, + title: "Append " + title, + action: { + dragstart: startConnect, + click: appendStart + } }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ - token: ElementRegistryService, - factory: ElementRegistryService.ɵfac, - providedIn: 'root' - }); } - return ElementRegistryService; -})(); + function getSelectedBusinessObject(event) { + return { + businessObject: selectedElement.businessObject, + newColor: event.detail.color, + element: selectedElement + }; + } + function executeCommandStack(event) { + const selectedBusinessObject = getSelectedBusinessObject(event); + commandStack.execute("element.colorChange", selectedBusinessObject); + dirtyFlagService.makeDirty(); + } +} +inherits__WEBPACK_IMPORTED_MODULE_0___default()(DomainStoryContextPadProvider, bpmn_js_lib_features_context_pad_ContextPadProvider__WEBPACK_IMPORTED_MODULE_4__["default"]); +DomainStoryContextPadProvider.$inject = ["injector", "connect", "translate", "elementFactory", "create", "canvas", "contextPad", "popupMenu", "replaceMenuProvider", "commandStack", "eventBus", "modeling"]; /***/ }), -/***/ 98106: -/*!**************************************************!*\ - !*** ./src/app/Service/Export/export.service.ts ***! - \**************************************************/ +/***/ 44877: +/*!*************************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/domainStoryElementFactory.js ***! + \*************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ExportService: () => (/* binding */ ExportService) +/* harmony export */ "default": () => (/* binding */ DomainStoryElementFactory) /* harmony export */ }); -/* harmony import */ var src_app_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Utils/sanitizer */ 66107); -/* harmony import */ var src_app_Domain_Export_configAndDst__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Domain/Export/configAndDst */ 74306); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../environments/environment */ 45312); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var src_app_Service_IconSetConfiguration_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/Service/IconSetConfiguration/icon-set-configuration.service */ 10200); -/* harmony import */ var src_app_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/Service/Title/title.service */ 69672); -/* harmony import */ var src_app_Service_DirtyFlag_dirty_flag_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/Service/DirtyFlag/dirty-flag.service */ 89791); -/* harmony import */ var src_app_Service_Export_png_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/Service/Export/png.service */ 11503); -/* harmony import */ var src_app_Service_Export_svg_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/Service/Export/svg.service */ 29298); -/* harmony import */ var _html_presentation_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./html-presentation.service */ 72680); -/* harmony import */ var _Renderer_renderer_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../Renderer/renderer.service */ 94896); - - - - - +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! min-dash */ 93673); +/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ 51270); +/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! bpmn-js/lib/features/modeling/ElementFactory */ 63784); +/* harmony import */ var bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! bpmn-js/lib/util/LabelUtil */ 50815); +/* harmony import */ var _domainStoryIdFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./domainStoryIdFactory */ 84338); @@ -71370,2148 +69640,3316 @@ __webpack_require__.r(__webpack_exports__); -let ExportService = /*#__PURE__*/(() => { - class ExportService { - constructor(configurationService, titleService, dirtyFlagService, pngService, svgService, htmlPresentationService, rendererService) { - this.configurationService = configurationService; - this.titleService = titleService; - this.dirtyFlagService = dirtyFlagService; - this.pngService = pngService; - this.svgService = svgService; - this.htmlPresentationService = htmlPresentationService; - this.rendererService = rendererService; - this.title = ''; - this.description = ''; - this.titleSubscription = this.titleService.title$.subscribe(title => { - this.title = title; - }); - this.descriptionSubscription = this.titleService.description$.subscribe(description => { - this.description = description; - }); - } - ngOnDestroy() { - this.titleSubscription.unsubscribe(); - this.descriptionSubscription.unsubscribe(); - } - isDomainStoryExportable() { - return this.rendererService.getStory().length >= 1; - } - createConfigAndDST(DomainStory) { - return new src_app_Domain_Export_configAndDst__WEBPACK_IMPORTED_MODULE_1__.ConfigAndDST(this.configurationService.getCurrentConfigurationForExport(), DomainStory); - } - downloadDST() { - const dst = this.getStoryForDownload(); - const configAndDST = this.createConfigAndDST(dst); - const json = JSON.stringify(configAndDST, null, 2); - const filename = (0,src_app_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_0__.sanitizeForDesktop)(this.title + '_' + this.getCurrentDateString()); - this.downloadFile(json, 'data:text/plain;charset=utf-8,', filename, '.egn', true); - } - downloadFile(data, datatype, filename, fileEnding, makeClean) { - const element = document.createElement('a'); - element.setAttribute('href', datatype + encodeURIComponent(data)); - element.setAttribute('download', filename + fileEnding); - element.style.display = 'none'; - document.body.appendChild(element); - element.click(); - if (makeClean) { - this.dirtyFlagService.makeClean(); - } - document.body.removeChild(element); - } - downloadSVG(withTitle, useWhiteBackground) { - const story = this.getStoryForDownload(); - const dst = this.createConfigAndDST(story); - const svgData = this.svgService.createSVGData(this.title, this.description, dst, withTitle, useWhiteBackground); - this.downloadFile(svgData, 'data:application/bpmn20-xml;charset=UTF-8,', (0,src_app_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_0__.sanitizeForDesktop)(this.title + '_' + this.getCurrentDateString()), '.egn.svg', true); +/** + * A custom factory that knows how to create BPMN _and_ custom elements. + */ +function DomainStoryElementFactory(bpmnFactory, moddle) { + bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_2__["default"].call(this, bpmnFactory, moddle); + let self = this; + let domainStoryIdFactory = new _domainStoryIdFactory__WEBPACK_IMPORTED_MODULE_1__["default"](); + /** + * create a diagram-js element with the given type (any of shape, connection, label). + * + * @param {String} elementType + * @param {Object} attrs + * + * @return {djs.model.Base} + */ + this.create = function (elementType, attrs) { + let type = attrs.type; + if (elementType === "label") { + return self.baseCreate(elementType, (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)({ + type: "label" + }, bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_4__.DEFAULT_LABEL_SIZE, attrs)); } - downloadPNG(withTitle) { - const canvas = document.getElementById('canvas'); - if (canvas) { - const container = canvas.getElementsByClassName('djs-container'); - const svgElements = container[0].getElementsByTagName('svg'); - const outerSVGElement = svgElements[0]; - const viewport = outerSVGElement.getElementsByClassName('viewport')[0]; - const layerBase = viewport.getElementsByClassName('layer-base')[0]; - const image = document.createElement('img'); - // removes unwanted black dots in image - let svg = this.pngService.extractSVG(viewport, outerSVGElement); - svg = this.pngService.prepareSVG(svg, layerBase, this.description, this.title, withTitle); - image.onload = () => { - const tempCanvas = document.createElement('canvas'); - // add a 10px buffer to the right and lower boundary - tempCanvas.width = this.pngService.getWidth() + 10; - tempCanvas.height = this.pngService.getHeight() + 10; - const ctx = tempCanvas.getContext('2d'); - if (ctx) { - // fill with white background - ctx.rect(0, 0, tempCanvas.width, tempCanvas.height); - ctx.fillStyle = 'white'; - ctx.fill(); - ctx.drawImage(image, 0, 0); - } - const png64 = tempCanvas.toDataURL('image/png'); - const ele = document.createElement('a'); - ele.setAttribute('download', (0,src_app_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_0__.sanitizeForDesktop)(this.title) + '_' + this.getCurrentDateString() + '.png'); - ele.setAttribute('href', png64); - document.body.appendChild(ele); - ele.click(); - document.body.removeChild(ele); - // image source has to be removed to circumvent browser caching - image.src = ''; + // add type to businessObject if custom + if (/^domainStory:/.test(type)) { + if (!attrs.businessObject) { + attrs.businessObject = { + type: type, + name: attrs.name ? attrs.name : "" }; - image.onchange = image.onload; - image.width = this.pngService.getWidth(); - image.height = this.pngService.getHeight(); - image.src = 'data:image/svg+xml,' + svg; } - } - downloadHTMLPresentation() { - const filename = (0,src_app_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_0__.sanitizeForDesktop)(this.title + '_' + this.getCurrentDateString()); - this.htmlPresentationService.downloadHTMLPresentation(filename).then(); - } - getStoryForDownload() { - const story = this.rendererService.getStory(); - story.push({ - info: this.titleService.getDescription() + if (attrs.id) { + domainStoryIdFactory.registerId(attrs.id); + } else { + attrs.id = domainStoryIdFactory.getId(elementType); + } + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(attrs.businessObject, { + id: attrs.id }); - story.push({ - version: _environments_environment__WEBPACK_IMPORTED_MODULE_2__.environment.version + let id = attrs.id; + attrs.businessObject.get = function (key) { + if (key === "id") { + return id; + } + }; + attrs.businessObject.set = function (key, value) { + if (key === "id") { + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(attrs.businessObject, { + id: value + }); + } + }; + if (!attrs.businessObject.$type) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(attrs.businessObject, { + $type: "Element" + }); + } + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(attrs.businessObject, { + di: {} }); - return story; + if (!attrs.businessObject.$descriptor) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(attrs.businessObject, { + $descriptor: {} + }); + } + // add width and height if shape + if ((!/:activity$/.test(type) || !/:connection$/.test(type)) && !(/:group$/.test(type) && attrs.height || attrs.width)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(attrs, self._getCustomElementSize(type)); + } + if (!("$instanceOf" in attrs.businessObject)) { + // ensure we can use ModelUtil#is for type checks + Object.defineProperty(attrs.businessObject, "$instanceOf", { + value: function (type) { + return this.type === type; + } + }); + } + return self.baseCreate(elementType, attrs); } - getCurrentDateString() { - return (0,_angular_common__WEBPACK_IMPORTED_MODULE_10__.formatDate)(new Date(), 'YYYY-MM-dd', 'en-GB'); + return self.createBpmnElement(elementType, attrs); + }; +} +inherits__WEBPACK_IMPORTED_MODULE_0___default()(DomainStoryElementFactory, bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_2__["default"]); +DomainStoryElementFactory.$inject = ["bpmnFactory", "moddle"]; +/** + * returns the default size of custom shapes. + * + * the following example shows an interface on how + * to setup the custom shape's dimensions. + * * + * @param {String} type + * + * @return {Dimensions} a {width, height} object representing the size of the element + */ +DomainStoryElementFactory.prototype._getCustomElementSize = function (type) { + let shapes = { + __default: { + width: 75, + height: 75 + }, + "domainStory:textAnnotation": { + width: 100, + height: 30 + }, + "domainStory:group": { + width: 525, + height: 275 } - static #_ = this.ɵfac = function ExportService_Factory(t) { - return new (t || ExportService)(_angular_core__WEBPACK_IMPORTED_MODULE_11__["ɵɵinject"](src_app_Service_IconSetConfiguration_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_3__.IconSetConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_11__["ɵɵinject"](src_app_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_4__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_11__["ɵɵinject"](src_app_Service_DirtyFlag_dirty_flag_service__WEBPACK_IMPORTED_MODULE_5__.DirtyFlagService), _angular_core__WEBPACK_IMPORTED_MODULE_11__["ɵɵinject"](src_app_Service_Export_png_service__WEBPACK_IMPORTED_MODULE_6__.PngService), _angular_core__WEBPACK_IMPORTED_MODULE_11__["ɵɵinject"](src_app_Service_Export_svg_service__WEBPACK_IMPORTED_MODULE_7__.SvgService), _angular_core__WEBPACK_IMPORTED_MODULE_11__["ɵɵinject"](_html_presentation_service__WEBPACK_IMPORTED_MODULE_8__.HtmlPresentationService), _angular_core__WEBPACK_IMPORTED_MODULE_11__["ɵɵinject"](_Renderer_renderer_service__WEBPACK_IMPORTED_MODULE_9__.RendererService)); - }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_11__["ɵɵdefineInjectable"]({ - token: ExportService, - factory: ExportService.ɵfac, - providedIn: 'root' - }); - } - return ExportService; -})(); + }; + return shapes[type] || shapes.__default; +}; +class Dimensions {} /***/ }), -/***/ 17782: -/*!**********************************************!*\ - !*** ./src/app/Service/Export/exportUtil.js ***! - \**********************************************/ +/***/ 84338: +/*!********************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/domainStoryIdFactory.js ***! + \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ createTitleAndDescriptionSVGElement: () => (/* binding */ createTitleAndDescriptionSVGElement) +/* harmony export */ containsId: () => (/* binding */ containsId), +/* harmony export */ "default": () => (/* binding */ DomainStoryIdFactory) /* harmony export */ }); -/* harmony import */ var _Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Domain/Export/exportConstants */ 27901); -let dynamicHeightOffset = 0; -// Has to be js File so we can access te correct non-standard HTML-Properties without excessive usage of ts-ignore -function createTitleAndDescriptionSVGElement(initDynamicHeightOffset, title, description, min_x, min_y, width) { - dynamicHeightOffset = initDynamicHeightOffset; - title = title.replace("<", "").replace(">", ""); - let titleElement = createTitle(title, width); - let descriptionElement = createDescription(description, width); - // to display the title and description in the SVG-file, we need to add a container for our text-elements - let insertText = '' + titleElement + descriptionElement + ""; - return { - insertText, - dynamicHeightOffset: dynamicHeightOffset - }; -} -function createTitle(text, width) { - let tempCanvas = document.createElement("canvas"); - let ctx = tempCanvas.getContext("2d"); - ctx.font = "30px Arial"; - return createTextSpans(text, width, ctx, 10, _Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_0__.TEXTSPAN_TITLE_HEIGHT, 30); + +let idList = []; +function DomainStoryIdFactory() {} +DomainStoryIdFactory.prototype.getId = function (type) { + return generateId(type); +}; +DomainStoryIdFactory.prototype.registerId = function (id) { + idList.push(id); +}; +function generateId(type) { + let idNumber = fourDigitsId(); + let id = type + "_" + idSuffix(idNumber); + while (containsId(id)) { + idNumber++; + id = type + "_" + idSuffix(idNumber); + } + idList.push(id); + return id; } -function createDescription(text, width) { - let description = ""; - let descriptionParts = text.split("
"); - let tempCanvas = document.createElement("canvas"); - let ctx = tempCanvas.getContext("2d"); - ctx.font = "12px Arial"; - for (let i = 0; i < descriptionParts.length; i++) { - description += createTextSpans(descriptionParts[i], width, ctx, 0, _Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_0__.TEXTSPAN_DESCRIPTION_HEIGHT, 12); +function idSuffix(idNumber) { + let id; + if (idNumber > 9999) { + id = 0; + } else if (idNumber < 10) { + id = "000" + idNumber; + } else if (idNumber < 100) { + id = "00" + idNumber; + } else if (idNumber < 1000) { + id = "0" + idNumber; + } else { + id = "" + idNumber; } - return description; + return id; } -function createTextSpans(text, width, ctx, yOffset, heightOffset, fontSize) { - let textSpans = ""; - let words = text.split(" "); - // every leading empty strings in the array must be removed, otherwise the text elements - // will not be filled with text - words = removeLeadingEmptyStrings(words); - let textTag = ''; - let textSpan = document.createElementNS(_Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_0__.SVG_LINK, "tspan"); - let textNode = document.createTextNode(words[0]); - textSpan.setAttribute("x", _Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_0__.X_OFFSET_UTIL); - textSpan.setAttribute("y", yOffset + dynamicHeightOffset); - textSpan.setAttribute("font-size", fontSize); - textSpan.appendChild(textNode); - for (let j = 1; j < words.length; j++) { - if (textSpan.firstChild && textSpan.firstChild.data) { - let len = textSpan.firstChild.data.length; - textNode.data += " " + words[j]; - if (ctx.measureText(textNode.data).width > width - 16) { - dynamicHeightOffset += heightOffset; - textSpan.firstChild.data = textSpan.firstChild.data.slice(0, len); // remove overflow word - textSpans += textTag + textSpan.outerHTML + ""; // append line - // create new textspan for line break - textSpan = document.createElementNS(_Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_0__.SVG_LINK, "tspan"); - textNode = document.createTextNode(words[j]); - textSpan.setAttribute("x", _Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_0__.X_OFFSET_UTIL); - textSpan.setAttribute("y", yOffset + dynamicHeightOffset); - textSpan.appendChild(textNode); - } - } - } - dynamicHeightOffset += heightOffset; - textSpans += textTag + textSpan.outerHTML + ""; - return textSpans; +function fourDigitsId() { + return Math.floor(Math.random() * 10000); } -function removeLeadingEmptyStrings(stringArray) { - const firstNonEmptyIndex = stringArray.findIndex(string => string !== ""); - return stringArray.slice(firstNonEmptyIndex === -1 ? stringArray.length : firstNonEmptyIndex); +function containsId(id) { + let same = false; + idList.forEach(element => { + if (id === element) { + same = true; + } + }); + return same; } /***/ }), -/***/ 72680: -/*!*************************************************************!*\ - !*** ./src/app/Service/Export/html-presentation.service.ts ***! - \*************************************************************/ +/***/ 79552: +/*!*******************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/domainStoryRenderer.js ***! + \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ HtmlPresentationService: () => (/* binding */ HtmlPresentationService) +/* harmony export */ "default": () => (/* binding */ DomainStoryRenderer), +/* harmony export */ initializeRenderer: () => (/* binding */ initializeRenderer) /* harmony export */ }); -/* harmony import */ var _home_runner_work_egon_io_egon_io_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 73308); -/* harmony import */ var _Utils_sanitizer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/sanitizer */ 66107); -/* harmony import */ var dot__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! dot */ 45659); -/* harmony import */ var dot__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(dot__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _Replay_replay_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Replay/replay.service */ 94788); -/* harmony import */ var _Title_title_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Title/title.service */ 69672); +/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ 51270); +/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var diagram_js_lib_draw_BaseRenderer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! diagram-js/lib/draw/BaseRenderer */ 74919); +/* harmony import */ var ids__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ids */ 28287); +/* harmony import */ var src_app_tools_modeler_bpmn_modeler_labeling_dsLabelEditingPreview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/tools/modeler/bpmn/modeler/labeling/dsLabelEditingPreview */ 46156); +/* harmony import */ var diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! diagram-js/lib/util/RenderUtil */ 97915); +/* harmony import */ var tiny_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! tiny-svg */ 87004); +/* harmony import */ var min_dom__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! min-dom */ 63030); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! min-dash */ 93673); +/* harmony import */ var src_app_tools_modeler_bpmn_modeler_labeling_dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/tools/modeler/bpmn/modeler/labeling/dsLabelEditingProvider */ 64467); +/* harmony import */ var src_app_tools_modeler_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/tools/modeler/bpmn/modeler/numbering/numbering */ 14945); +/* harmony import */ var src_app_tools_modeler_bpmn_modeler_labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/tools/modeler/bpmn/modeler/labeling/dsLabelUtil */ 13224); +/* harmony import */ var src_app_tools_modeler_bpmn_modeler_labeling_position__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/tools/modeler/bpmn/modeler/labeling/position */ 22346); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var _utils_mathExtensions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../utils/mathExtensions */ 67858); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./util */ 20580); + -// @ts-ignore + + + + + + + + + + +let RENDERER_IDS = new ids__WEBPACK_IMPORTED_MODULE_1__["default"](); +let numbers = []; +const DEFAULT_COLOR = "#000000"; /** - * Initial idea and PR from https://github.com/indika-dev + * a renderer that knows how to render custom elements. */ -let HtmlPresentationService = /*#__PURE__*/(() => { - class HtmlPresentationService { - constructor(replayService, titleService) { - this.replayService = replayService; - this.titleService = titleService; +let _iconDictionaryService; +let _elementRegistryService; +let _dirtyFlagService; +function initializeRenderer(iconDictionaryService, elementRegistryService, dirtyFlagService) { + _iconDictionaryService = iconDictionaryService; + _elementRegistryService = elementRegistryService; + _dirtyFlagService = dirtyFlagService; +} +function DomainStoryRenderer(eventBus, styles, canvas, textRenderer, pathMap, commandStack) { + diagram_js_lib_draw_BaseRenderer__WEBPACK_IMPORTED_MODULE_10__["default"].call(this, eventBus, 2000); + let rendererId = RENDERER_IDS.next(); + let markers = {}; + let computeStyle = styles.computeStyle; + // generate the automatic Number for an activity originating from an actor + function generateActivityNumber(parentGfx, element, box) { + // whenever we want to edit an activity, it gets redrawn as a new object + // and the custom information is lost, + // so we stash it before the editing occurs and set the value here + let numberStash = (0,src_app_tools_modeler_bpmn_modeler_labeling_dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_3__.getNumberStash)(); + let semantic = element.businessObject; + if (numberStash.use) { + semantic.number = numberStash.number; } - setModelerClasses(canvas, selection, modeler) { - this.modeler = modeler; + numbers[semantic.number] = true; + box.x -= 26; + box.y -= 16; + if (semantic.number < 10) { + box.x += 3; } - static viewBoxCoordinates(svg) { - const ViewBoxCoordinate = /width="([^"]+)"\s+height="([^"]+)"\s+viewBox="([^"]+)"/; - const match = svg.match(ViewBoxCoordinate); - return match[3]; + let newRenderedNumber = renderNumber(parentGfx, semantic.number, numberStyle(box), element.type); + (0,src_app_tools_modeler_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_4__.addNumberToRegistry)(newRenderedNumber, semantic.number); + } + // style functions + function numberStyle(box) { + return { + box: box, + fitBox: true, + style: (0,min_dash__WEBPACK_IMPORTED_MODULE_11__.assign)({}, textRenderer.getExternalStyle(), { + fill: "black", + position: "absolute" + }) + }; + } + function backgroundBoxStyle(box) { + return { + box: box, + fitBox: true, + style: (0,min_dash__WEBPACK_IMPORTED_MODULE_11__.assign)({}, textRenderer.getExternalStyle(), { + fill: "black", + fontSize: 50, + position: "absolute", + fontFamily: "Courier New" + }) + }; + } + function backgroundDotStyle(box) { + return { + box: box, + fitBox: true, + style: (0,min_dash__WEBPACK_IMPORTED_MODULE_11__.assign)({}, textRenderer.getExternalStyle(), { + fill: "white", + fontSize: 150, + position: "absolute", + fontFamily: "Courier" + }) + }; + } + // render functions + // render label associated with actors and workobjects + function renderEmbeddedLabel(parentGfx, element, align, padding) { + let businessObject = element.businessObject; + return renderLabel(parentGfx, businessObject.name, { + box: element, + align: align, + padding: padding ? padding : 0, + style: { + fill: "#000000" + } + }, element.type); + } + // render label associated with activities + function renderExternalLabel(parentGfx, element) { + let semantic = element.businessObject; + let waypoints = element.waypoints; + let lines = (0,src_app_tools_modeler_bpmn_modeler_labeling_position__WEBPACK_IMPORTED_MODULE_6__.countLines)(semantic.name); + if (element.waypoints != null) { + let position = (0,src_app_tools_modeler_bpmn_modeler_labeling_position__WEBPACK_IMPORTED_MODULE_6__.labelPosition)(waypoints, lines); + let startPoint = element.waypoints[position.selected]; + let endPoint = element.waypoints[position.selected + 1]; + let angle = (0,_utils_mathExtensions__WEBPACK_IMPORTED_MODULE_8__.angleBetween)(startPoint, endPoint); + let alignment = "left"; + let boxWidth = 500; + let xStart = position.x; + // if the activity is horizontal, we want to center the label + if (angle === 0 || angle === 180) { + boxWidth = Math.abs(startPoint.x - endPoint.x); + alignment = "center"; + xStart = (startPoint.x + endPoint.x) / 2 - (0,src_app_tools_modeler_bpmn_modeler_labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_5__.calculateTextWidth)(semantic.name); + } + let box = { + textAlign: alignment, + width: boxWidth, + height: 30, + x: xStart, + y: position.y + }; + if (semantic.name && semantic.name.length) { + return renderLabel(parentGfx, semantic.name, { + box: box, + fitBox: true, + style: (0,min_dash__WEBPACK_IMPORTED_MODULE_11__.assign)({}, textRenderer.getExternalStyle(), { + fill: "black", + wordWrap: "break-word", + overflowWrap: "break-word", + hyphens: "auto" + }) + }, element.type); + } } - /* - --------------------------- - SVG handling starts here - ---------------------------- - */ - downloadHTMLPresentation(filename) { - var _this = this; - return (0,_home_runner_work_egon_io_egon_io_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { - const svgData = []; - // export all sentences of domain story - _this.replayService.startReplay(); - try { - const result = yield _this.modeler.saveSVG({}); - _this.fixActivityMarkersForEachSentence(result, _this.replayService.getCurrentSentenceNumber()); - svgData.push({ - content: HtmlPresentationService.createSVGData(result.svg), - transition: 'slide' - }); - } catch (err) { - alert('There was an error exporting the SVG.\n' + err); - } - while (_this.replayService.getCurrentSentenceNumber() < _this.replayService.getMaxSentenceNumber()) { - _this.replayService.nextSentence(); - try { - const result = yield _this.modeler.saveSVG({}); - _this.fixActivityMarkersForEachSentence(result, _this.replayService.getCurrentSentenceNumber()); - svgData.push({ - content: HtmlPresentationService.createSVGData(result.svg), - transition: 'slide' - }); - } catch (err) { - alert('There was an error exporting the SVG.\n' + err); - } - } - _this.replayService.stopReplay(); - // create download for presentation - const revealjsTemplate = document.getElementById('revealjs-template'); - const dots = dot__WEBPACK_IMPORTED_MODULE_2___default().template(revealjsTemplate?.innerHTML); - const revealjsData = { - script: 'script', - title: _this.titleService.getTitle(), - description: _this.titleService.getDescription(), - sentences: svgData, - multiplexSecret: _this.multiplexSecret, - multiplexId: _this.multiplexId - }; - const element = document.createElement('a'); - element.setAttribute('href', 'data:text/html;charset=UTF-8,' + _this.fixMalformedHtmlScript(dots, revealjsData)); - element.setAttribute('download', (0,_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_1__.sanitizeForDesktop)(filename) + '.html'); - element.style.display = 'none'; - document.body.appendChild(element); - element.click(); - document.body.removeChild(element); - })(); + } + // render the number associated with an activity + function renderExternalNumber(parentGfx, element) { + if (element && element.source) { + let semantic = element.businessObject; + let box = (0,src_app_tools_modeler_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_4__.numberBoxDefinitions)(element); + if (semantic.number == null && element.source.type && element.source.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.ACTOR)) { + (0,src_app_tools_modeler_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_4__.generateAutomaticNumber)(element, commandStack); + } + // render the background for the number + if (semantic.number && element.source.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.ACTOR)) { + generateActivityNumber(parentGfx, element, box); + } else { + semantic.number = null; + } } - fixMalformedHtmlScript(dots, revealjsData) { - return dots(revealjsData).replace(' 9 ? 3 : 0); + let y = options.box.y - radius + 7; + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.attr)(circle, { + d: ` + M ${x} ${y} + m ${radius},0 + a ${radius},${radius} 0 1,0 ${-radius * 2},0 + a ${radius},${radius} 0 1,0 ${radius * 2},0 + `, + fill: "white", + stroke: "black" + }); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.append)(parentGfx, circle); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.append)(parentGfx, text); + return text; + } + // the coordinates of the activity label must be set directly and will not be taken from the box + function setCoordinates(type, text, options, height, parentGfx) { + if (/:activity$/.test(type)) { + text.innerHTML = manipulateInnerHTMLXLabel(text.children, options.box.x, 0); + text.innerHTML = manipulateInnerHTMLYLabel(text.children, options.box.y, 0); + } else if (/:actor/.test(type)) { + height = parentGfx.firstChild.attributes.height.nodeValue; + text.innerHTML = manipulateInnerHTMLYLabel(text.children, height, 0); + } else if (/:workObject/.test(type)) { + height = parentGfx.firstChild.attributes.height.nodeValue; + text.innerHTML = manipulateInnerHTMLYLabel(text.children, height, 26); + } + } + // render a label on the canvas + function renderLabel(parentGfx, label, options, type) { + let text = textRenderer.createText(label || "", options); + let height = 0; + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.classes)(text).add("djs-label"); + setCoordinates(type, text, options, height, parentGfx); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.append)(parentGfx, text); + return text; + } + // determine the Y-coordinate of the label / number to be rendered + function manipulateInnerHTMLYLabel(children, y, offset) { + if (children) { + let result = ""; + for (let i = 0; i < children.length; i++) { + result += children[i].outerHTML.replace(/y="-?\d*.\d*"/, 'y="' + (Number(y) + offset + 14 * i) + '"'); } - const dataStart = data.substring(0, viewBoxIndex); - viewBoxIndex = data.indexOf('" version'); - const dataEnd = data.substring(viewBoxIndex); - dataEnd.substring(viewBoxIndex); - data = dataStart + this.createBounds(xLeft, yUp, width, height) + dataEnd; - return encodeURIComponent(data); + return result; } - static createBounds(xLeft, yUp, width, height) { - return 'width="100%"' + ' height="100%" ' + ' preserveAspectRatio="xMidYMid meet"' + ' viewBox="' + xLeft + ' ' + yUp + ' ' + (xLeft + width) + ' ' + (yUp + height); + } + // determine the X-coordinate of the label / number to be rendered + function manipulateInnerHTMLXLabel(children, x, offset) { + if (children) { + let result = ""; + for (let i = 0; i < children.length; i++) { + result += children[i].outerHTML.replace(/x="-?\d*.\d*"/, 'x="' + (Number(x) + offset + 14) + '"'); + } + return result; } - /** - * There is a Problem in the HTML-Presentation, where the Arrow-Heads of the Activities are not shown after the 4th sentence - * This is due to the fact, that the marker for the Arrow-Head is defined in each sentence with the same ID - * When the 5th sentence is reached, the first marker is set to display none, which propagates to all other markers - * - * To fix this, for each sentence the marker and its references are renamed - */ - fixActivityMarkersForEachSentence(result, sectionIndex) { - const defs = result.svg.substring(result.svg.indexOf(''), result.svg.indexOf('') + 7); - const split = defs.split(' { - const idToReplace = id.substring(4, id.length - 1); - const newId = idToReplace.slice(0, id.length - 5) + 'customId' + sectionIndex + idToReplace.slice(idToReplace.length - 2); - // @ts-ignore - result.svg = result.svg.replaceAll(idToReplace, newId); - }); - newDefs += ' it)) { + return iconSvg.replaceAll(/fill=\s*"(?!none).*?"/g, `fill="${pickedColor} "`).replaceAll(/fill:\s*[#r]\w*[;\s]{1}/g, `fill:${pickedColor};`); + } else { + const index = iconSvg.indexOf("' + ''; + } else { + return applyColorToIcon(pickedColor, icon); } - static #_ = this.ɵfac = function HtmlPresentationService_Factory(t) { - return new (t || HtmlPresentationService)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_Replay_replay_service__WEBPACK_IMPORTED_MODULE_3__.ReplayService), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_Title_title_service__WEBPACK_IMPORTED_MODULE_4__.TitleService)); + } + this.drawActor = function (parent, element) { + let svgDynamicSizeAttributes = { + width: element.width, + height: element.height }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({ - token: HtmlPresentationService, - factory: HtmlPresentationService.ɵfac, - providedIn: 'root' + let iconSRC = _iconDictionaryService.getTypeIconSRC(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.ACTOR, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.getIconId(element.type)); + iconSRC = getIconSvg(iconSRC, element); + let actor = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.create)(iconSRC); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.attr)(actor, svgDynamicSizeAttributes); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.append)(parent, actor); + renderEmbeddedLabel(parent, element, "center", -5); + return actor; + }; + this.drawWorkObject = function (parent, element) { + let svgDynamicSizeAttributes = { + width: element.width * 0.65, + height: element.height * 0.65, + x: element.width / 2 - 25, + y: element.height / 2 - 25 + }, + workObject; + let iconSRC = _iconDictionaryService.getTypeIconSRC(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.WORKOBJECT, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.getIconId(element.type)); + iconSRC = getIconSvg(iconSRC, element); + workObject = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.create)(iconSRC); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.attr)(workObject, svgDynamicSizeAttributes); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.append)(parent, workObject); + renderEmbeddedLabel(parent, element, "center", -5); + return workObject; + }; + function useColorForActivity(element) { + if (!element.businessObject.pickedColor) { + element.businessObject.pickedColor = "black"; + } + let attrs = ""; + return computeStyle(attrs, { + stroke: element.businessObject.pickedColor, + fill: "none", + strokeWidth: 1.5, + strokeLinejoin: "round", + markerEnd: marker("activity", "black", element.businessObject.pickedColor) }); } - return HtmlPresentationService; -})(); - -/***/ }), - -/***/ 11503: -/*!***********************************************!*\ - !*** ./src/app/Service/Export/png.service.ts ***! - \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ PngService: () => (/* binding */ PngService) -/* harmony export */ }); -/* harmony import */ var src_app_Service_Export_exportUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Service/Export/exportUtil */ 17782); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); - - -let PngService = /*#__PURE__*/(() => { - class PngService { - constructor() { - this.width = 0; - this.height = 0; + this.drawActivity = function (p, element) { + adjustForTextOverlap(element); + if (element) { + let attrs = useColorForActivity(element); + let x = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.append)(p, (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_13__.createLine)(element.waypoints, attrs)); + renderExternalLabel(p, element); + renderExternalNumber(p, element); + // just adjusting the start- and endpoint of the connection-element moves only the drawn connection, + // not the interactive line. This can be fixed by manually overriding the points of the interactive polyline + // in the HTMl with the points of the drawn one. + // this however does not adjust the surrounding box of the connection. + fixConnectionInHTML(p.parentElement); + return x; } - browserSpecs() { - const ua = navigator.userAgent; - let tem; - let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; - if (/trident/i.test(M[1])) { - tem = /\brv[ :]+(\d+)/g.exec(ua) || []; - return { - name: 'IE', - version: tem[1] || '' - }; - } - if (M[1] === 'Chrome') { - tem = ua.match(/\b(OPR|Edge)\/(\d+)/); - if (tem != null) { - return { - name: tem[1].replace('OPR', 'Opera'), - version: tem[2] - }; + }; + function checkIfPointOverlapsText(point, source) { + if (point.y > source.y + 60) { + if (point.x > source.x + 3 && point.x < source.x + 72) { + let lineOffset = getLineOffset(source); + if (source.y + 75 + lineOffset > point.y) { + point.y += lineOffset; } } - M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?']; - // tslint:disable-next-line:no-conditional-assignment - if ((tem = ua.match(/version\/(\d+)/i)) != null) { - M.splice(1, 1, tem[1]); + } + } + function adjustForTextOverlap(element) { + let source = element.source; + let target = element.target; + let waypoints = element.waypoints; + let startPoint = waypoints[0]; + let endPoint = waypoints[waypoints.length - 1]; + if (startPoint && endPoint && source && target) { + checkIfPointOverlapsText(startPoint, source); + checkIfPointOverlapsText(endPoint, source); + } + } + function getLineOffset(element) { + let id = element.id; + let offset = 0; + let objects = document.getElementsByClassName("djs-element djs-shape"); + for (let i = 0; i < objects.length; i++) { + let data_id = objects.item(i).getAttribute("data-element-id"); + if (data_id === id) { + let object = objects.item(i); + let text = object.getElementsByTagName("text")[0]; + let tspans = text.getElementsByTagName("tspan"); + let tspan = tspans[tspans.length - 1]; + offset = tspan.getAttribute("y"); } - return { - name: M[0], - version: M[1] - }; } - /** Needed for an SVG-Fix in CHrome where the # needs to be replaced by %23 **/ - URIHashtagFix(svg) { - let fix = false; - const browser = this.browserSpecs(); - const name = browser.name; - const version = parseInt(browser.version); - // only implemented in chrome and firefox at the moment - if (name.includes('Chrome')) { - if (version >= 72) { - fix = true; - // https://www.chromestatus.com/features/5656049583390720 + return offset - 70; + } + function fixConnectionInHTML(wantedConnection) { + if (wantedConnection) { + let polylines = wantedConnection.getElementsByTagName("polyline"); + if (polylines.length > 1) { + polylines[1].setAttribute("points", polylines[0].getAttribute("points")); + } + } + } + this.drawDSConnection = function (p, element) { + let attrs = ""; + attrs = computeStyle(attrs, { + stroke: "#000000", + strokeWidth: 1.5, + strokeLinejoin: "round", + strokeDasharray: "5, 5" + }); + return (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.append)(p, (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_13__.createLine)(element.waypoints, attrs)); + }; + this.drawAnnotation = function (parentGfx, element) { + let style = { + fill: "none", + stroke: "none" + }; + let text = element.businessObject.text || ""; + if (element.businessObject.text) { + let height = (0,src_app_tools_modeler_bpmn_modeler_labeling_dsLabelEditingPreview__WEBPACK_IMPORTED_MODULE_2__.getAnnotationBoxHeight)(); + if (height === 0 && element.businessObject.number) { + height = element.businessObject.number; + } + (0,min_dash__WEBPACK_IMPORTED_MODULE_11__.assign)(element, { + height: height + }); + // for some reason the keyword height is not exported, so we use another, which we know will be exported, + // to ensure persistent annotation heights between sessions + (0,min_dash__WEBPACK_IMPORTED_MODULE_11__.assign)(element.businessObject, { + number: height + }); + } + let textElement = drawRect(parentGfx, element.width, element.height, 0, 0, style); + let textPathData = pathMap.getScaledPath("TEXT_ANNOTATION", { + xScaleFactor: 1, + yScaleFactor: 1, + containerWidth: element.width, + containerHeight: element.height, + position: { + mx: 0.0, + my: 0.0 + } + }); + drawPath(parentGfx, textPathData, { + stroke: "black" + }); + renderLabel(parentGfx, text, { + box: element, + align: "left-top", + padding: 5, + style: { + fill: "black" + } + }); + return textElement; + }; + // draw helper functions + function drawPath(parentGfx, d, attrs) { + attrs = computeStyle(attrs, ["no-fill"], { + strokeWidth: 2, + stroke: "black" + }); + let path = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.create)("path"); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.attr)(path, { + d: d + }); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.attr)(path, attrs); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.append)(parentGfx, path); + return path; + } + function drawRect(parentGfx, width, height, r, offset, attrs) { + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_11__.isObject)(offset)) { + attrs = offset; + offset = 0; + } + offset = offset || 0; + attrs = computeStyle(attrs, { + stroke: "black", + strokeWidth: 2, + fill: "white" + }); + let rect = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.create)("rect"); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.attr)(rect, { + x: offset, + y: offset, + width: width - offset * 2, + height: height - offset * 2, + rx: r, + ry: r + }); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.attr)(rect, attrs); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.append)(parentGfx, rect); + return rect; + } + // marker functions + function marker(type, fill, stroke) { + let id = type + "-" + fill + "-" + stroke + "-" + rendererId; + if (!markers[id]) { + createMarker(type, fill, stroke); + } + return "url(#" + id + ")"; + } + function createMarker(type, fill, stroke) { + let id = type + "-" + fill + "-" + stroke + "-" + rendererId; + if (type === "activity") { + let sequenceflowEnd = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.create)("path"); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.attr)(sequenceflowEnd, { + d: "M 1 5 L 11 10 L 1 15 Z" + }); + addMarker(id, { + element: sequenceflowEnd, + ref: { + x: 11, + y: 10 + }, + scale: 0.5, + attrs: { + fill: stroke, + stroke: stroke } - } else if (name.includes('Firefox')) { - fix = true; - // versionNumber of implementation unknown + }); + } + } + function addMarker(id, options) { + let attrs = (0,min_dash__WEBPACK_IMPORTED_MODULE_11__.assign)({ + fill: "black", + strokeWidth: 1, + strokeLinecap: "round", + strokeDasharray: "none" + }, options.attrs); + let ref = options.ref || { + x: 0, + y: 0 + }; + let scale = options.scale || 1; + // resetting stroke dash array + if (attrs.strokeDasharray === "none") { + attrs.strokeDasharray = [10000, 1]; + } + let marker = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.create)("marker"); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.attr)(options.element, attrs); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.append)(marker, options.element); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.attr)(marker, { + id: id, + viewBox: "0 0 20 20", + refX: ref.x, + refY: ref.y, + markerWidth: 20 * scale, + markerHeight: 20 * scale, + orient: "auto" + }); + let defs = (0,min_dom__WEBPACK_IMPORTED_MODULE_14__.query)("defs", canvas._svg); + if (!defs) { + defs = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.create)("defs"); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.append)(canvas._svg, defs); + } + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_12__.append)(defs, marker); + markers[id] = marker; + } + // path functions + this.getWorkObjectPath = function (shape) { + let rectangle = getRectPath(shape); + return (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_13__.componentsToPath)(rectangle); + }; + this.getGroupPath = function (shape) { + let rectangle = getRectPath(shape); + return (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_13__.componentsToPath)(rectangle); + }; + this.getActivityPath = function (connection) { + let waypoints = connection.waypoints.map(function (p) { + return p.original || p; + }); + let activityPath = [["M", waypoints[0].x, waypoints[0].y]]; + waypoints.forEach(function (waypoint, index) { + if (index !== 0) { + activityPath.push(["L", waypoint.x, waypoint.y]); + } + }); + return (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_13__.componentsToPath)(activityPath); + }; + this.getActorPath = function (shape) { + let rectangle = getRectPath(shape); + return (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_13__.componentsToPath)(rectangle); + }; +} +inherits__WEBPACK_IMPORTED_MODULE_0___default()(DomainStoryRenderer, diagram_js_lib_draw_BaseRenderer__WEBPACK_IMPORTED_MODULE_10__["default"]); +DomainStoryRenderer.$inject = ["eventBus", "styles", "canvas", "textRenderer", "pathMap", "commandStack"]; +DomainStoryRenderer.prototype.canRender = function (element) { + return /^domainStory:/.test(element.type); +}; +DomainStoryRenderer.prototype.drawShape = function (p, element) { + // polyfill for tests + if (!String.prototype.startsWith) { + Object.defineProperty(String.prototype, "startsWith", { + value: function (search, pos) { + pos = !pos || pos < 0 ? 0 : +pos; + return this.substring(pos, pos + search.length) === search; } + }); + } + let type = element.type; + element.businessObject.type = type; + _elementRegistryService.correctInitialize(); + _dirtyFlagService.makeDirty(); + if (type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.ACTOR)) { + return this.drawActor(p, element); + } else if (type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.WORKOBJECT)) { + return this.drawWorkObject(p, element); + } else if (type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.TEXTANNOTATION)) { + return this.drawAnnotation(p, element); + } else if (type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.GROUP)) { + return this.drawGroup(p, element); + } +}; +DomainStoryRenderer.prototype.getShapePath = function (shape) { + let type = shape.type; + if (type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.ACTOR)) { + return this.getActorPath(shape); + } else if (type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.WORKOBJECT)) { + return this.getWorkObjectPath(shape); + } else if (type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.GROUP)) { + return this.getGroupPath(shape); + } +}; +DomainStoryRenderer.prototype.drawConnection = function (p, element) { + let type = element.type; + _dirtyFlagService.makeDirty(); + // fixes activities that were copy-pasted + if (!element.businessObject.type) { + element.businessObject.type = type; + } + if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.ACTIVITY) { + return this.drawActivity(p, element); + } else if (type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_7__.ElementTypes.CONNECTION) { + return this.drawDSConnection(p, element); + } +}; +// creates a SVG path that describes a rectangle which encloses the given shape. +function getRectPath(shape) { + let offset = 5; + let x = shape.x, + y = shape.y, + width = shape.width / 2 + offset, + height = shape.height / 2 + offset; + return [["M", x, y], ["l", width, 0], ["l", width, height], ["l", -width, height], ["l", -width, 0], ["z"]]; +} + +/***/ }), + +/***/ 63344: +/*!****************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/domainStoryRules.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ DomainStoryRules) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! min-dash */ 93673); +/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ 51270); +/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var diagram_js_lib_features_rules_RuleProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! diagram-js/lib/features/rules/RuleProvider */ 63169); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ 20580); + + + + + + + +const HIGH_PRIORITY = 1500; +const MIN_SIZE = 125; +function isDomainStory(element) { + return element && /^domainStory:/.test(element.type); +} +function isDomainStoryGroup(element) { + return element && /^domainStory:group/.test(element.type); +} +function isActor(element) { + return element && /^domainStory:actor\w*/.test(element.type); +} +function isWorkObject(element) { + return element && /^domainStory:workObject/.test(element.type); +} +function isActivity(element) { + return element && /^domainStory:activity/.test(element.type); +} +function isConnection(element) { + return element && /^domainStory:connection/.test(element.type); +} +function isAnnotation(element) { + return element && /^domainStory:textAnnotation/.test(element.type); +} +/** + * can source and target be connected? + */ +function canConnect(source, target) { + // only judge about two custom elements + if (isDomainStoryGroup(target) || !isDomainStory(source) || !isDomainStory(target)) { + return; + } + // do not allow a connection from one element to itself + if (source === target) { + return; + } + // do not allow a connection between two actors + if (isActor(source) && isActor(target)) { + return; + } + // do not allow a connection, where the source or target is an activity + if (isActivity(source) || isActivity(target)) { + return; + } + // do not allow a connection, where the source or target is an annotation connection + if (isConnection(source) || isConnection(target)) { + return; + } + // do not allow a connection to a connection(the special type of connection between an element and a comment box) + // when the target is an annotation, the connection type is an annotation connection instead of an activity + if (isAnnotation(target)) { + return { + type: src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.CONNECTION + }; + } + return { + type: src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTIVITY + }; +} +function canResize(shape, newBounds) { + if ((0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(shape, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.GROUP)) { + if (newBounds) { + let lowerLeft = { + x: shape.x, + y: shape.y + shape.height + }; + let lowerRight = { + x: shape.x + shape.width, + y: shape.y + shape.height + }; + let upperRight = { + x: shape.x + shape.width, + y: shape.y + }; + if (newBounds.x !== shape.x && newBounds.y !== shape.y) { + // upper left + if (newBounds.x > lowerRight.x - MIN_SIZE) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(newBounds, { + x: lowerRight.x - MIN_SIZE + }); + } + if (newBounds.y > lowerRight.y - MIN_SIZE) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(newBounds, { + y: lowerRight.y - MIN_SIZE + }); + } + } + if (newBounds.x !== shape.x && newBounds.y === shape.y) { + // lower left + if (newBounds.x > upperRight.x - MIN_SIZE) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(newBounds, { + x: upperRight.x - MIN_SIZE + }); + } + } + if (newBounds.x === shape.x && newBounds.y !== shape.y) { + // upper right + if (newBounds.y > lowerLeft.y - MIN_SIZE) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(newBounds, { + y: lowerLeft.y - MIN_SIZE + }); + } + } + if (newBounds.height < MIN_SIZE) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(newBounds, { + height: MIN_SIZE + }); + } + if (newBounds.width < MIN_SIZE) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(newBounds, { + width: MIN_SIZE + }); + } + } + return true; + } + return false; +} +function canAttach(elements, target, source) { + if (!Array.isArray(elements)) { + elements = [elements]; + } + // disallow appending as boundary event + if (source) { + return false; + } + // only (re-)attach one element at a time + if (elements.length !== 1) { + return false; + } + // allow default move operation + if (!target) { + return true; + } + // only allow drop on DomainStory Elements + if (!isDomainStory(target)) { + return false; + } + return "attach"; +} +function canConnectToAnnotation(source, target, connection) { + // do not allow an activity connect to an annotation + if (isActivity(connection) && isAnnotation(target)) { + return false; + } + // do not allow an annotation connection between two annotations + if (isConnection(connection) && isAnnotation(source) && isAnnotation(target)) { + return false; + } + // do not allow an annotation connection between an actor or workObject and anything except an annotation + return !(isConnection(connection) && !isAnnotation(target) && (isActor(source) || isWorkObject(source))); +} +/** + * specific rules for custom elements + */ +function DomainStoryRules(eventBus) { + diagram_js_lib_features_rules_RuleProvider__WEBPACK_IMPORTED_MODULE_4__["default"].call(this, eventBus); +} +inherits__WEBPACK_IMPORTED_MODULE_0___default()(DomainStoryRules, diagram_js_lib_features_rules_RuleProvider__WEBPACK_IMPORTED_MODULE_4__["default"]); +DomainStoryRules.$inject = ["eventBus"]; +DomainStoryRules.prototype.init = function () { + /** + * can shape be created on target container? + */ + function canCreate(shape, target) { + // only judge about custom elements + if (!isDomainStory(shape)) { + return; + } + // allow creation just on groups + return !isDomainStory(target) || isDomainStoryGroup(target); + } + this.addRule("elements.create", function (context) { + const elements = context.elements, + position = context.position, + target = context.target; + return (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.every)(elements, function (element) { + if (isConnection(element)) { + return canConnect(element.source, element.target, element); + } + if (element.host) { + return canAttach(element, element.host, null, position); + } + return canCreate(element, target, null, position); + }); + }); + this.addRule("elements.move", HIGH_PRIORITY, function (context) { + let target = context.target, + shapes = context.shapes; + let type; + // do not allow mixed movements of custom / BPMN shapes + // if any shape cannot be moved, the group cannot be moved, too + // reject, if we have at least one + // custom element that cannot be moved + return (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.reduce)(shapes, function (result, s) { + if (type === undefined) { + type = isDomainStory(s); + } + if (type !== isDomainStory(s) || result === false) { + return false; + } + return canCreate(s, target); + }, undefined); + }); + this.addRule("shape.create", HIGH_PRIORITY, function (context) { + let target = context.target, + shape = context.shape; + return canCreate(shape, target); + }); + this.addRule("connection.create", HIGH_PRIORITY, function (context) { + let source = context.source, + target = context.target; + return canConnect(source, target); + }); + this.addRule("connection.reconnect", HIGH_PRIORITY, function (context) { + let connection = context.connection, + source = context.hover || context.source, + target = context.target; + // -------------------------------------------------------------- + let result = canConnectToAnnotation(source, target, connection); + if (!result) { + return; + } + // -------------------------------------------------------------- + return canConnect(source, target, connection); + }); + this.addRule("shape.resize", function (context) { + let shape = context.shape, + newBounds = context.newBounds; + return canResize(shape, newBounds); + }); +}; +DomainStoryRules.prototype.canConnect = canConnect; +DomainStoryRules.prototype.canAttach = canAttach; +DomainStoryRules.prototype.isDomainStory = isDomainStory; +DomainStoryRules.prototype.canResize = canResize; + +/***/ }), + +/***/ 85918: +/*!******************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/domainStoryUpdater.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ DomainStoryUpdater) +/* harmony export */ }); +/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ 51270); +/* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! min-dash */ 93673); +/* harmony import */ var diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! diagram-js/lib/command/CommandInterceptor */ 87502); +/* harmony import */ var diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! diagram-js/lib/util/Collections */ 90238); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ 20580); +/* harmony import */ var _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../domain/entities/elementTypes */ 73190); + + + + + + + + +/** + * a handler responsible for updating the custom element's businessObject + * once changes on the diagram happen. + */ +function DomainStoryUpdater(eventBus, bpmnjs) { + diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_3__["default"].call(this, eventBus); + function updateCustomElement(e) { + let context = e.context, + shape = context.shape, + businessObject = shape.businessObject; + if (!shape || !shape.type.includes(_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.DOMAINSTORY)) { + return; + } + let parent = shape.parent; + let customElements = bpmnjs._customElements; + // make sure element is added / removed from bpmnjs.customElements + if (!parent) { + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_4__.remove)(customElements, businessObject); + } else { + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_4__.add)(customElements, businessObject); + } + // save custom element position + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(businessObject, (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.pick)(shape, ["x", "y"])); + // save custom element size if resizable + if (shape.type === _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.GROUP) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(businessObject, (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.pick)(shape, ["height", "width"])); + // rework the child-parent relations if a group was moved, such that all Objects that are visually in the group are also associated with it + // since we do not have access to the standard-canvas object here, we cannot use the function correctGroupChildren() from DSLabelUtil + if (parent != null) { + (0,_util__WEBPACK_IMPORTED_MODULE_1__.reworkGroupElements)(parent, shape); + } + } + if (shape && shape.parent && "type" in shape.parent && shape.parent.type === _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.GROUP) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(businessObject, { + parent: shape.parent.id + }); + } + } + function updateCustomConnection(e) { + let context = e.context, + connection = context.connection, + source = connection.source, + target = connection.target, + businessObject = connection.businessObject; + if (e.newTarget) { + target = e.newTarget; + } + if (e.newSource) { + source = e.newSource; + } + let parent = connection.parent; + let customElements = bpmnjs._customElements; + // make sure element is added / removed from bpmnjs.customElements + if (!parent) { + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_4__.remove)(customElements, businessObject); + } else { + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_4__.add)(customElements, businessObject); + } + // update waypoints + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(businessObject, { + waypoints: copyWaypoints(connection) + }); + if (source) { + if (!businessObject.source) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(businessObject, { + source: source.id + }); + } else { + businessObject.source = source.id; + } + } + if (target) { + if (!businessObject.target) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)(businessObject, { + target: target.id + }); + } else { + businessObject.target = target.id; + } + } + } + function copyWaypoints(connection) { + return connection.waypoints.map(function (p) { + if (p.original) { + return { + original: { + x: p.original.x, + y: p.original.y + }, + x: p.x, + y: p.y + }; + } else { + return { + x: p.x, + y: p.y + }; + } + }); + } + this.executed(["shape.create", "shape.move", "shape.delete", "shape.resize", "shape.removeGroupWithChildren"], ifDomainStoryElement(updateCustomElement)); + this.reverted(["shape.create", "shape.move", "shape.delete", "shape.resize", "shape.removeGroupWithChildren"], ifDomainStoryElement(updateCustomElement)); + this.executed(["connection.create", "connection.reconnect", "connection.updateWaypoints", "connection.delete", "connection.layout", "connection.move"], ifDomainStoryElement(updateCustomConnection)); + this.reverted(["connection.create", "connection.reconnect", "connection.updateWaypoints", "connection.delete", "connection.layout", "connection.move"], ifDomainStoryElement(updateCustomConnection)); +} +// check if element in the context of an event is a domainStory element +function ifDomainStoryElement(fn) { + return event => { + const context = event.context; + const element = context.shape || context.connection; + if (isDomainStory(element)) { + fn(event); + } + }; +} +function isDomainStory(element) { + return element && /domainStory:/.test(element.type); +} +inherits__WEBPACK_IMPORTED_MODULE_0___default()(DomainStoryUpdater, diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_3__["default"]); +DomainStoryUpdater.$inject = ["eventBus", "bpmnjs"]; + +/***/ }), + +/***/ 50458: +/*!*****************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/index.js ***! + \*****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _domainStoryElementFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domainStoryElementFactory */ 44877); +/* harmony import */ var _domainStoryRenderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./domainStoryRenderer */ 79552); +/* harmony import */ var _palette_domainStoryPalette__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./palette/domainStoryPalette */ 60148); +/* harmony import */ var _domainStoryRules__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./domainStoryRules */ 63344); +/* harmony import */ var _domainStoryUpdater__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./domainStoryUpdater */ 85918); +/* harmony import */ var bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! bpmn-js/lib/features/modeling/ElementFactory */ 63784); +/* harmony import */ var diagram_js_lib_features_create__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! diagram-js/lib/features/create */ 31073); +/* harmony import */ var bpmn_js_lib_draw_PathMap__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! bpmn-js/lib/draw/PathMap */ 66652); +/* harmony import */ var bpmn_js_lib_features_popup_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! bpmn-js/lib/features/popup-menu */ 77029); +/* harmony import */ var diagram_js_lib_features_context_pad__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! diagram-js/lib/features/context-pad */ 64712); +/* harmony import */ var diagram_js_lib_command_CommandStack__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! diagram-js/lib/command/CommandStack */ 22205); +/* harmony import */ var _updateHandler_updateLabelHandler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./updateHandler/updateLabelHandler */ 18911); +/* harmony import */ var _updateHandler_headlineAndDescriptionUpdateHandler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./updateHandler/headlineAndDescriptionUpdateHandler */ 28126); +/* harmony import */ var _context_pad_domainStoryContextPadProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./context-pad/domainStoryContextPadProvider */ 57218); +/* harmony import */ var _change_icon_replaceMenuProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./change-icon/replaceMenuProvider */ 98461); +/* harmony import */ var _modeling_dSModeling__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./modeling/dSModeling */ 63960); + + + + + + + + + + + + + + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [diagram_js_lib_features_create__WEBPACK_IMPORTED_MODULE_10__["default"], diagram_js_lib_features_context_pad__WEBPACK_IMPORTED_MODULE_11__["default"], bpmn_js_lib_features_popup_menu__WEBPACK_IMPORTED_MODULE_12__["default"]], + __init__: ["domainStoryRenderer", "paletteProvider", "domainStoryRules", "domainStoryUpdater", "contextPadProvider", "replaceMenuProvider"], + elementFactory: ["type", _domainStoryElementFactory__WEBPACK_IMPORTED_MODULE_0__["default"]], + domainStoryRenderer: ["type", _domainStoryRenderer__WEBPACK_IMPORTED_MODULE_1__["default"]], + paletteProvider: ["type", _palette_domainStoryPalette__WEBPACK_IMPORTED_MODULE_2__["default"]], + domainStoryRules: ["type", _domainStoryRules__WEBPACK_IMPORTED_MODULE_3__["default"]], + domainStoryUpdater: ["type", _domainStoryUpdater__WEBPACK_IMPORTED_MODULE_4__["default"]], + contextPadProvider: ["type", _context_pad_domainStoryContextPadProvider__WEBPACK_IMPORTED_MODULE_7__["default"]], + elementFactoryBpmn: ["type", bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_13__["default"]], + pathMap: ["type", bpmn_js_lib_draw_PathMap__WEBPACK_IMPORTED_MODULE_14__["default"]], + replaceMenuProvider: ["type", _change_icon_replaceMenuProvider__WEBPACK_IMPORTED_MODULE_8__["default"]], + commandStack: ["type", diagram_js_lib_command_CommandStack__WEBPACK_IMPORTED_MODULE_15__["default"]], + updateLabelHandler: ["type", _updateHandler_updateLabelHandler__WEBPACK_IMPORTED_MODULE_5__["default"]], + headlineAndDescriptionUpdateHandler: ["type", _updateHandler_headlineAndDescriptionUpdateHandler__WEBPACK_IMPORTED_MODULE_6__["default"]], + modeling: ["type", _modeling_dSModeling__WEBPACK_IMPORTED_MODULE_9__["default"]] +}); + +/***/ }), + +/***/ 46156: +/*!******************************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/labeling/dsLabelEditingPreview.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ DSLabelEditingPreview), +/* harmony export */ getAnnotationBoxHeight: () => (/* binding */ getAnnotationBoxHeight) +/* harmony export */ }); +/* harmony import */ var tiny_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tiny-svg */ 87004); +/* harmony import */ var diagram_js_lib_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! diagram-js/lib/util/SvgTransformUtil */ 53813); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util */ 20580); + + + + + + +const MARKER_HIDDEN = "djs-element-hidden", + MARKER_LABEL_HIDDEN = "djs-label-hidden"; +let annotationBoxHeight = 0; +function getAnnotationBoxHeight() { + return annotationBoxHeight; +} +function DSLabelEditingPreview(eventBus, canvas, pathMap) { + let self = this; + let defaultLayer = canvas.getDefaultLayer(); + let element, absoluteElementBBox, gfx; + eventBus.on("directEditing.activate", function (context) { + let activeProvider = context.active; + element = activeProvider.element.label || activeProvider.element; + // text annotation + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.is)(element, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.TEXTANNOTATION)) { + absoluteElementBBox = canvas.getAbsoluteBBox(element); + gfx = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.create)("g"); + annotationBoxHeight = element.height; + let textPathData = pathMap.getScaledPath("TEXT_ANNOTATION", { + xScaleFactor: 1, + yScaleFactor: 1, + containerWidth: element.width, + containerHeight: element.height, + position: { + mx: 0.0, + my: 0.0 + } + }); + let path = self.path = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.create)("path"); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.attr)(path, { + d: textPathData, + strokeWidth: 2, + stroke: getStrokeColor(element) + }); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.append)(gfx, path); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.append)(defaultLayer, gfx); + (0,diagram_js_lib_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_3__.translate)(gfx, element.x, element.y); + } + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.is)(element, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.TEXTANNOTATION) || element.labelTarget) { + canvas.addMarker(element, MARKER_HIDDEN); + } else if (element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR) || element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT) || element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY) || element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.GROUP)) { + canvas.addMarker(element, MARKER_LABEL_HIDDEN); + } + }); + eventBus.on("directEditing.resize", function (context) { + // text annotation + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.is)(element, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.TEXTANNOTATION)) { + let height = context.height, + dy = context.dy; + let newElementHeight = Math.max(element.height / absoluteElementBBox.height * (height + dy), 0); + annotationBoxHeight = newElementHeight; + let textPathData = pathMap.getScaledPath("TEXT_ANNOTATION", { + xScaleFactor: 1, + yScaleFactor: 1, + containerWidth: element.width, + containerHeight: newElementHeight, + position: { + mx: 0.0, + my: 0.0 + } + }); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.attr)(self.path, { + d: textPathData + }); + } + }); + eventBus.on(["directEditing.complete", "directEditing.cancel"], function (context) { + let activeProvider = context.active; + if (activeProvider) { + canvas.removeMarker(activeProvider.element.label || activeProvider.element, MARKER_HIDDEN); + canvas.removeMarker(element, MARKER_LABEL_HIDDEN); + } + element = undefined; + absoluteElementBBox = undefined; + if (gfx) { + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_2__.remove)(gfx); + gfx = undefined; + } + }); +} +DSLabelEditingPreview.$inject = ["eventBus", "canvas", "pathMap"]; +// helpers /////////////////// +function getStrokeColor() { + return "black"; +} + +/***/ }), + +/***/ 64467: +/*!*******************************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/labeling/dsLabelEditingProvider.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ DSLabelEditingProvider), +/* harmony export */ focusElement: () => (/* binding */ focusElement), +/* harmony export */ getNumberStash: () => (/* binding */ getNumberStash), +/* harmony export */ initializeLabelEditingProvider: () => (/* binding */ initializeLabelEditingProvider), +/* harmony export */ toggleStashUse: () => (/* binding */ toggleStashUse) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! min-dash */ 93673); +/* harmony import */ var _dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dsLabelUtil */ 13224); +/* harmony import */ var bpmn_js_lib_features_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bpmn-js/lib/features/modeling/util/ModelingUtil */ 87908); +/* harmony import */ var bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! bpmn-js/lib/util/LabelUtil */ 50815); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util */ 20580); + + + + + + + + +let dictionaryService; +let numberStash = 0; +let stashUse = false; +function initializeLabelEditingProvider(labelingDictionary) { + dictionaryService = labelingDictionary; +} +function getNumberStash() { + let number = { + use: stashUse, + number: numberStash + }; + stashUse = false; + return number; +} +function toggleStashUse(use) { + stashUse = use; +} +function focusElement(element) { + // Opening a Angular Dialog seems to mess with the focus logic somehow. + // My guess is that is makes the mousedown event passive, which prevents "preventDefault" from intercepting. + // I am not sure how to fix it, but this seems to be a workaround. + setTimeout(() => element.focus(), 0); +} +function DSLabelEditingProvider(eventBus, canvas, directEditing, modeling, resizeHandles, textRenderer, updateLabelHandler) { + this._canvas = canvas; + this._modeling = modeling; + this._textRenderer = textRenderer; + this._updateLabelHandler = updateLabelHandler; + directEditing.registerProvider(this); + // listen to dblclick on non-root elements + eventBus.on("element.dblclick", function (event) { + activateDirectEdit(event.element, true); + if ((0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(event.element, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTIVITY)) { + // if we edit an activity, we do not want the standard editing box + numberStash = event.element.businessObject.number; + stashUse = true; + directEditing.complete(); + } + }); + // complete on followup canvas operation + eventBus.on(["element.mousedown", "drag.init", "canvas.viewbox.changing", "autoPlace", "popupMenu.open"], function () { + if (directEditing.isActive()) { + directEditing.complete(); + } + }); + // cancel on command stack changes + eventBus.on(["commandStack.changed"], function () { + if (directEditing.isActive()) { + directEditing.cancel(); + } + }); + eventBus.on("directEditing.activate", function (event) { + resizeHandles.removeResizers(); + let element = event.active.element; + createAutocomplete(element); + }); + eventBus.on("create.end", 500, function (event) { + let element = event.shape, + canExecute = event.context.canExecute, + isTouch = event.isTouch; + if (isTouch) { + return; + } + if (!canExecute) { + return; + } + if (!(0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(element, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTIVITY)) { + activateDirectEdit(element); + } + let editingBox = document.getElementsByClassName("djs-direct-editing-content"); + focusElement(editingBox.item(0)); + }); + eventBus.on("autoPlace.end", 500, function (event) { + activateDirectEdit(event.shape); + }); + function activateDirectEdit(element, force) { + if (force || (0,bpmn_js_lib_features_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_3__.isAny)(element, [src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.TEXTANNOTATION]) || element.businessObject.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.DOMAINSTORY)) { + directEditing.activate(element); + } + } + function createAutocomplete(element) { + let editingBox = document.getElementsByClassName("djs-direct-editing-content"); + focusElement(editingBox.item(0)); + (0,_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.autocomplete)(editingBox[0], dictionaryService.getUniqueWorkObjectNames(), element, eventBus); + } +} +DSLabelEditingProvider.$inject = ["eventBus", "canvas", "directEditing", "modeling", "resizeHandles", "textRenderer", "updateLabelHandler"]; +/** + * activate direct editing for activities and text annotations. + * + * @param {djs.model.Base} element + * + * @return {Object} an object with properties bounds (position and size), text and options + */ +DSLabelEditingProvider.prototype.activate = function (element) { + // text + if (element.id === "__implicitrootbase") { + return; + } + let text = (0,_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.getLabel)(element); + if (text === undefined) { + return; + } + let context = { + text: text + }; + // bounds + let bounds = this.getEditingBBox(element); + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(context, bounds); + let options = {}; + // external labels + if ((0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_5__.isLabelExternal)(element)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(options, { + autoResize: true + }); + } + // text annotations + if ((0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(element, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.TEXTANNOTATION)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(options, { + resizable: true, + autoResize: true + }); + } + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(context, { + options: options + }); + return context; +}; +/** + * get the editing bounding box based on the element's size and position + * + * @param {djs.model.Base} element + * + * @return {Object} an object containing information about position + * and size (fixed or minimum and/or maximum) + */ +DSLabelEditingProvider.prototype.getEditingBBox = function (element) { + let canvas = this._canvas; + let target = element.label || element; + let bbox = canvas.getAbsoluteBBox(target); + let mid = { + x: bbox.x + bbox.width / 2, + y: bbox.y + bbox.height / 2 + }; + // default position + let bounds = { + x: bbox.x, + y: bbox.y + }; + /** The cavnas is an Object from BPMN, the IDE might say, that zoom is deprecated, + * because it thinks canvas is the standard HTMLElement. -> Needs to stay toom **/ + let zoom = canvas.zoom(); + let defaultStyle = this._textRenderer.getDefaultStyle(), + externalStyle = this._textRenderer.getExternalStyle(); + // take zoom into account + let externalFontSize = externalStyle.fontSize * zoom, + externalLineHeight = externalStyle.lineHeight, + defaultFontSize = defaultStyle.fontSize * zoom, + defaultLineHeight = defaultStyle.lineHeight; + let style = { + fontFamily: this._textRenderer.getDefaultStyle().fontFamily, + fontWeight: this._textRenderer.getDefaultStyle().fontWeight + }; + // adjust for groups + if ((0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(element, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.GROUP)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(bounds, { + minWidth: bbox.width / 2.5 > 125 ? bbox.width / 2.5 : 125, + maxWidth: bbox.width, + minHeight: 30 * zoom, + x: bbox.x, + y: bbox.y + }); + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(style, { + fontSize: defaultFontSize + "px", + lineHeight: defaultLineHeight, + paddingTop: 7 * zoom + "px", + paddingBottom: 7 * zoom + "px", + paddingLeft: 5 * zoom + "px", + paddingRight: 5 * zoom + "px", + textAlign: "left" + }); + } + // internal labels for tasks and collapsed call activities, + // sub processes and participants + if (/^domainStory:actor\w*/.test(element.type) || /^domainStory:workObject\w*/.test(element.type)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(bounds, { + width: bbox.width, + minHeight: 30, + y: bbox.y + bbox.height - 20, + x: bbox.x + }); + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(style, { + fontSize: defaultFontSize + "px", + lineHeight: defaultLineHeight, + paddingTop: 7 * zoom + "px", + paddingBottom: 7 * zoom + "px", + paddingLeft: 5 * zoom + "px", + paddingRight: 5 * zoom + "px" + }); + } + let width = 90 * zoom, + paddingTop = 7 * zoom, + paddingBottom = 4 * zoom; + // external labels for events, data elements, gateways and connections + if (target.labelTarget) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(bounds, { + width: width, + height: bbox.height + paddingTop + paddingBottom, + x: mid.x - width / 2, + y: bbox.y - paddingTop + }); + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(style, { + fontSize: externalFontSize + "px", + lineHeight: externalLineHeight, + paddingTop: paddingTop + "px", + paddingBottom: paddingBottom + "px" + }); + } + // external label not yet created + if ((0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_5__.isLabelExternal)(target) && !(0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_5__.hasExternalLabel)(target) && !(0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_5__.isLabel)(target)) { + let externalLabelMid = (0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_5__.getExternalLabelMid)(element); + let absoluteBBox = canvas.getAbsoluteBBox({ + x: externalLabelMid.x, + y: externalLabelMid.y, + width: 0, + height: 0 + }); + let height = externalFontSize + paddingTop + paddingBottom; + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(bounds, { + width: width, + height: height, + x: absoluteBBox.x - width / 2, + y: absoluteBBox.y - height / 2 + }); + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(style, { + fontSize: externalFontSize + "px", + lineHeight: externalLineHeight, + paddingTop: paddingTop + "px", + paddingBottom: paddingBottom + "px" + }); + } + // text annotations + if ((0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(element, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.TEXTANNOTATION)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(bounds, { + width: bbox.width, + height: bbox.height, + minWidth: 30 * zoom, + minHeight: 10 * zoom + }); + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(style, { + textAlign: "left", + paddingTop: 7 * zoom + "px", + paddingBottom: 7 * zoom + "px", + paddingLeft: 5 * zoom + "px", + paddingRight: 5 * zoom + "px", + fontSize: defaultFontSize + "px", + lineHeight: defaultLineHeight + }); + } + return { + bounds: bounds, + style: style + }; +}; +DSLabelEditingProvider.prototype.update = function (element, newLabel, activeContextText, bounds) { + let newBounds, bbox; + if ((0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(element, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.TEXTANNOTATION)) { + bbox = this._canvas.getAbsoluteBBox(element); + newBounds = { + x: element.x, + y: element.y, + width: element.width / bbox.width * bounds.width, + height: element.height / bbox.height * bounds.height + }; + } + this._modeling.updateLabel(element, newLabel, newBounds); +}; - if (fix) { - while (svg.includes('#')) { - svg = svg.replace('#', '%23'); - } - } - return svg; - } - findMostOuterElements(svg) { - let xLeft = 0; - let xRight = 0; - let yUp = 0; - let yDown = 0; - const elements = svg.getElementsByClassName('djs-group'); - // tslint:disable-next-line:prefer-for-of - for (let i = 0; i < elements.length; i++) { - const element = elements[i]; - const sub = element.children; - let elXLeft; - let elXRight; - let elYUp; - let elYDown; - const transform = sub[0].getAttribute('transform'); - if (transform) { - let nums; - if (transform.includes('matrix')) { - transform.replace('matrix(', ''); - transform.replace(')', ''); - nums = transform.split(' '); - elXLeft = parseInt(nums[4]); - elYUp = parseInt(nums[5]); - } else { - transform.replace('translate(', ''); - transform.replace(')', ''); - nums = transform.split(' '); - elXLeft = parseInt(nums[0]); - elYUp = parseInt(nums[1]); - } - const rects = sub[0].getElementsByTagName('rect'); - const outerRect = rects[rects.length - 1]; - const width = outerRect.getAttribute('width'); - elXRight = elXLeft + parseInt(width != null ? width : '0'); - elYDown = elYUp + sub[0].getBoundingClientRect().height; - } else { - const rects = element.getElementsByTagName('rect'); - const outerRect = rects[rects.length - 1]; - const x = outerRect.getAttribute('x'); - const y = outerRect.getAttribute('y'); - elXLeft = parseInt(x != null ? x : '0'); - elYUp = parseInt(y != null ? y : '0'); - const width = outerRect.getAttribute('width'); - const height = outerRect.getAttribute('height'); - elXRight = elXLeft + parseInt(width != null ? width : '0'); - elYDown = elYUp + parseInt(height != null ? height : '0') + 20; // Add 20 px as Padding for text at the bottom - } +/***/ }), - if (elXLeft < xLeft) { - xLeft = elXLeft; - } - if (elXRight > xRight) { - xRight = elXRight; - } - if (elYUp < yUp) { - yUp = elYUp; - } - if (elYDown > yDown) { - yDown = elYDown; - } +/***/ 13224: +/*!********************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/labeling/dsLabelUtil.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ autocomplete: () => (/* binding */ autocomplete), +/* harmony export */ calculateTextWidth: () => (/* binding */ calculateTextWidth), +/* harmony export */ getLabel: () => (/* binding */ getLabel), +/* harmony export */ getNumber: () => (/* binding */ getNumber), +/* harmony export */ selectPartOfActivity: () => (/* binding */ selectPartOfActivity), +/* harmony export */ setLabel: () => (/* binding */ setLabel), +/* harmony export */ setNumber: () => (/* binding */ setNumber) +/* harmony export */ }); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util */ 20580); + + + + +function getLabelAttr(semantic) { + if (semantic.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR) || semantic.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT) || semantic.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY) || semantic.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.GROUP)) { + return "name"; + } + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.TEXTANNOTATION)) { + return "text"; + } +} +function getNumberAttr(semantic) { + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY)) { + return "number"; + } +} +function getLabel(element) { + let semantic; + if (element.businessObject) { + semantic = element.businessObject; + } else { + semantic = element; + } + let attr = getLabelAttr(semantic); + if (attr && semantic) { + return semantic[attr] || ""; + } +} +function getNumber(element) { + let semantic = element.businessObject, + attr = getNumberAttr(semantic); + if (attr) { + return semantic[attr] || ""; + } +} +function setLabel(element, text) { + let semantic; + if (element.businessObject) { + semantic = element.businessObject; + } else { + semantic = element; + } + let attr = getLabelAttr(semantic); + if (attr) { + semantic[attr] = text; + } + return element; +} +function setNumber(element, textNumber) { + let semantic = element.businessObject, + attr = getNumberAttr(semantic); + if (attr) { + semantic[attr] = textNumber; + } + return element; +} +// select at which part of the activity the label should be attached to +function selectPartOfActivity(waypoints, angleActivity) { + let selectedActivity = 0; + let linelength = 49; + for (let i = 0; i < waypoints.length; i++) { + if (angleActivity[i] === 0 || angleActivity[i] === 180) { + let length = Math.abs(waypoints[i].x - waypoints[i + 1].x); + if (length > linelength) { + selectedActivity = i; } - yUp -= 75; // we need to adjust yUp to have space for the title and description - return { - xLeft, - xRight, - yUp, - yDown - }; } - prepareSVG(svg, layerBase, description, title, withTitle) { - const box = this.findMostOuterElements(layerBase); - let viewBoxIndex = svg.indexOf('width="'); - this.calculateWidthAndHeight(box); - const { - insertText, - dynamicHeightOffset - } = (0,src_app_Service_Export_exportUtil__WEBPACK_IMPORTED_MODULE_0__.createTitleAndDescriptionSVGElement)(0, title, description, box.xLeft + 10, box.yUp + 20, this.width); - if (withTitle) { - this.height += dynamicHeightOffset; - } - const bounds = this.createBounds(box, dynamicHeightOffset); - const dataStart = svg.substring(0, viewBoxIndex); - viewBoxIndex = svg.indexOf('style="'); - const dataEnd = svg.substring(viewBoxIndex); - dataEnd.substring(viewBoxIndex); - svg = dataStart + bounds + dataEnd; - const insertIndex = svg.indexOf('') + 20; - if (withTitle) { - svg = [svg.slice(0, insertIndex), insertText, svg.slice(insertIndex)].join(''); - } - svg = this.URIHashtagFix(svg); - return svg; + } + return selectedActivity; +} +// approximate the width of the label text, standard fontsize: 11 +function calculateTextWidth(text) { + if (!text) { + return 0; + } + let fontsize = text.length * 5.1; + fontsize = fontsize / 2; + // add an initial offset to the absolute middle of the activity + fontsize += 20; + return fontsize; +} +/** + * copied from https://www.w3schools.com/howto/howto_js_autocomplete.asp on 18.09.2018 + */ +function autocomplete(input, workObjectNames, element, eventBus) { + closeAllLists(); + /* the autocomplete function takes three arguments, + the text field element and an array of possible autocompleted values and an optional element to which it is appended:*/ + let currentFocus, filteredWorkObjectNames; + /* execute a function when someone writes in the text field:*/ + input.addEventListener("input", function () { + if (workObjectNames.length === 0) { + return; } - createBounds(box, extraHeight) { - return 'width="' + this.width + '" height="' + this.height + '" viewBox=" ' + box.xLeft + ' ' + (box.yUp - extraHeight) + ' ' + this.width + ' ' + this.height + '" '; + /* the direct editing field of actors and workobjects is a recycled html-element and has old values that need to be overridden*/ + if (element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT)) { + this.value = this.innerHTML; } - /** - * Calculate the Width and Height of the Bounding Box for the PNG so no Parts are cut off - */ - calculateWidthAndHeight(box) { - if (box.xLeft < 0) { - if (box.xRight < 0) { - this.width = Math.abs(box.xLeft - box.xRight); - } else { - this.width = Math.abs(box.xLeft) + box.xRight; - } - } else { - this.width = box.xRight - box.xLeft; - } - if (box.yUp < 0) { - if (box.yDown < 0) { - this.height = Math.abs(box.yUp - box.yDown); - } else { - this.height = Math.abs(box.yUp) + box.yDown; + let autocompleteList, + autocompleteItem, + val = this.value; + /* close any already open lists of autocompleted values*/ + closeAllLists(); + currentFocus = -1; + /* create a DIV element that will contain the items (values):*/ + autocompleteList = document.createElement("DIV"); + autocompleteList.setAttribute("id", "autocomplete-list"); + autocompleteList.setAttribute("class", "autocomplete-items"); + /* append the DIV element as a child of the autocomplete container:*/ + this.parentNode.appendChild(autocompleteList); + /* for each item in the array...*/ + filteredWorkObjectNames = []; + for (const name of workObjectNames) { + /* check if the item starts with the same letters as the text field value:*/ + if (val) { + if (name.substring(0, val.length).toUpperCase() === val.toUpperCase()) { + /* create a DIV element for each matching element:*/ + autocompleteItem = document.createElement("DIV"); + /* make the matching letters bold:*/ + autocompleteItem.innerHTML = "" + name.substring(0, val.length) + "" + name.substring(val.length); + /* insert an input field that will hold the current name:*/ + autocompleteItem.innerHTML += ""; + autocompleteList.appendChild(autocompleteItem); + filteredWorkObjectNames.push(name); } - } else { - this.height = box.yDown - box.yUp; - } - // if the domain-Story is smaller than 300px in width or height, increase its dimensions - if (this.height < 300) { - this.height += 300; - box.yUp -= 150; - box.yDown += 150; - } - if (this.width < 300) { - this.width += 300; - box.xLeft -= 150; - box.xRight += 150; } - return [this.height, this.width]; } - extractSVG(viewport, outerSVGElement) { - const layerResizers = viewport.getElementsByClassName('layer-resizers'); - const layerOverlays = viewport.getElementsByClassName('layer-overlays'); - const transform = viewport.getAttribute('transform'); - const translate = viewport.getAttribute('translate'); - if (layerResizers[0]) { - layerResizers[0].parentNode.removeChild(layerResizers[0]); - } - if (layerOverlays[0]) { - layerOverlays[0].parentNode.removeChild(layerOverlays[0]); - } - // remove canvas scrolling and scaling before serializeToString of SVG - if (transform) { - viewport.removeAttribute('transform'); - } - if (translate) { - viewport.removeAttribute('translate'); - } - const svg = new XMLSerializer().serializeToString(outerSVGElement); - // re-add canvas scrolling and scaling - if (transform) { - viewport.setAttribute('transform', transform); - } - if (translate) { - viewport.setAttribute('translate', translate); + // if we edit an actor, we do not want auto-complete, since actors generally are unique + if (element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR)) { + autocompleteList.style.visibility = "hidden"; + } + }); + /* execute a function presses a key on the keyboard:*/ + input.onkeydown = function (e) { + let autocompleteList = document.getElementById("autocomplete-list"); + if (autocompleteList) { + autocompleteList = autocompleteList.getElementsByTagName("div"); + } + if (e.keyCode === 40) { + /* If the arrow DOWN key is pressed, + increase the currentFocus letiable:*/ + currentFocus++; + /* and and make the current item more visible:*/ + addActive(autocompleteList); + } else if (e.keyCode === 38) { + // up + /* If the arrow UP key is pressed, + decrease the currentFocus letiable:*/ + currentFocus--; + /* and and make the current item more visible:*/ + addActive(autocompleteList); + } else if (e.keyCode === 13) { + e.preventDefault(); + /* If the ENTER key is pressed, prevent the form from being submitted,*/ + if (currentFocus > -1) { + element.businessObject.name = filteredWorkObjectNames[currentFocus]; + eventBus.fire("element.changed", { + element + }); } - return svg; } - getWidth() { - return this.width; + }; + function addActive(autocompleteList) { + /* a function to classify an item as "active":*/ + if (!autocompleteList || autocompleteList.length < 1) return false; + /* start by removing the "active" class on all items:*/ + removeActive(autocompleteList); + if (currentFocus >= autocompleteList.length) currentFocus = 0; + if (currentFocus < 0) currentFocus = autocompleteList.length - 1; + /* add class "autocomplete-active":*/ + autocompleteList[currentFocus].classList.add("autocomplete-active"); + } + function removeActive(autocompleteList) { + /* a function to remove the "active" class from all autocomplete items:*/ + if (autocompleteList.length > 1) { + for (const item of autocompleteList) { + item.classList.remove("autocomplete-active"); + } } - getHeight() { - return this.height; + } + function closeAllLists(survivor) { + /* close all autocomplete lists in the document, + except the one passed as an argument:*/ + let autocompleteList = document.getElementsByClassName("autocomplete-items"); + for (const item of autocompleteList) { + if (survivor != item && survivor != input) { + item.parentNode.removeChild(item); + } } - static #_ = this.ɵfac = function PngService_Factory(t) { - return new (t || PngService)(); - }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ - token: PngService, - factory: PngService.ɵfac, - providedIn: 'root' - }); } - return PngService; -})(); + /* execute a function when someone clicks in the document:*/ + document.addEventListener("click", function (e) { + closeAllLists(e.target); + }); +} /***/ }), -/***/ 29298: -/*!***********************************************!*\ - !*** ./src/app/Service/Export/svg.service.ts ***! - \***********************************************/ +/***/ 37069: +/*!**************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/labeling/index.js ***! + \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ SvgService: () => (/* binding */ SvgService) +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); -/* harmony import */ var src_app_Service_Export_exportUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Service/Export/exportUtil */ 17782); -/* harmony import */ var _Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Domain/Export/exportConstants */ 27901); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _Modeler_modeler_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Modeler/modeler.service */ 74676); +/* harmony import */ var diagram_js_lib_features_change_support__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! diagram-js/lib/features/change-support */ 99567); +/* harmony import */ var diagram_js_lib_features_resize__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! diagram-js/lib/features/resize */ 33485); +/* harmony import */ var diagram_js_direct_editing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js-direct-editing */ 95153); +/* harmony import */ var diagram_js_lib_command_CommandStack__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! diagram-js/lib/command/CommandStack */ 22205); +/* harmony import */ var _updateHandler_updateLabelHandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../updateHandler/updateLabelHandler */ 18911); +/* harmony import */ var _dsLabelEditingPreview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dsLabelEditingPreview */ 46156); +/* harmony import */ var _dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dsLabelEditingProvider */ 64467); +/* harmony import */ var _modeling_dSModeling__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../modeling/dSModeling */ 63960); -let SvgService = /*#__PURE__*/(() => { - class SvgService { - constructor(modelerService) { - this.modelerService = modelerService; - this.cacheData = ''; - } - createSVGData(title, description, dst, withTitle, useWhiteBackground) { - this.cacheData = this.modelerService.getEncoded(); - let domainStorySvg = structuredClone(this.cacheData); - let viewBoxIndex = domainStorySvg.indexOf('width="'); - let { - width, - height, - viewBox - } = this.viewBoxCoordinates(domainStorySvg); - // The value of the viewBox attribute is a list of four numbers separated by whitespace - // and/or a comma: min-x, min-y, width, and height. min-x and min-y represent the smallest - // X and Y coordinates that the viewBox may have (the origin coordinates of the viewBox) - // and the width and height specify the viewBox size. The resulting viewBox is a - // rectangle in user space mapped to the bounds of the viewport of an SVG element. - // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox - let min_x; - let viewBoxWidth; - let min_y; - let viewBoxHeight; - const splitViewBox = viewBox.split(/\s/); - min_x = +splitViewBox[0]; - min_y = +splitViewBox[1]; - viewBoxWidth = +splitViewBox[2]; - viewBoxHeight = +splitViewBox[3]; - // Set minimum width to ensure title and description are displayed reasonably - if (viewBoxWidth < 300) { - viewBoxWidth += 300; - width += 300; - } - const { - insertText, - dynamicHeightOffset - } = (0,src_app_Service_Export_exportUtil__WEBPACK_IMPORTED_MODULE_0__.createTitleAndDescriptionSVGElement)(0, title, description, min_x, min_y, width); - const bounds = this.createBounds(width, height, min_x, min_y, viewBoxWidth, viewBoxHeight, withTitle, dynamicHeightOffset); - const dataStart = domainStorySvg.substring(0, viewBoxIndex); - viewBoxIndex = domainStorySvg.indexOf('" version'); - const dataEnd = domainStorySvg.substring(viewBoxIndex); - dataEnd.substring(viewBoxIndex); - domainStorySvg = dataStart + bounds + dataEnd; - const insertIndex = this.findIndexToInsertData(domainStorySvg); - if (withTitle) { - domainStorySvg = domainStorySvg.slice(0, insertIndex) + insertText + domainStorySvg.slice(insertIndex); - } - if (useWhiteBackground) { - const svgIndex = domainStorySvg.indexOf('width="'); - const backgroundColorWhite = 'style="background-color:white" '; - domainStorySvg = domainStorySvg.slice(0, svgIndex) + backgroundColorWhite + domainStorySvg.slice(svgIndex); - } - return this.appendDST(domainStorySvg, dst); - } - findIndexToInsertData(data) { - let insertIndex = data.indexOf(''); - if (insertIndex < 0) { - insertIndex = data.indexOf('version="1.2">') + 14; - } else { - insertIndex += 7; - } - return insertIndex; - } - createBounds(width, height, min_x, min_y, viewBoxWidth, viewBoxHeight, withTitle, dynamicHeightOffset) { - height = withTitle ? height + dynamicHeightOffset + _Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_1__.TEXTSPAN_TITLE_HEIGHT : height; - min_x = min_x - _Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_PADDING; - min_y = withTitle ? min_y - dynamicHeightOffset - _Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_1__.TEXTSPAN_TITLE_HEIGHT : min_y; - viewBoxHeight = withTitle ? viewBoxHeight + dynamicHeightOffset + _Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_1__.TEXTSPAN_TITLE_HEIGHT + _Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_PADDING : viewBoxHeight; - viewBoxWidth = viewBoxWidth + _Domain_Export_exportConstants__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_PADDING; - return `width="${width}" height="${height}" viewBox="${min_x} ${min_y} ${viewBoxWidth} ${viewBoxHeight}`; - } - viewBoxCoordinates(svg) { - const ViewBoxCoordinate = /width="([^"]+)"\s+height="([^"]+)"\s+viewBox="([^"]+)"/; - const match = svg.match(ViewBoxCoordinate); - if (match) { - return { - width: +match[1], - height: +match[2], - viewBox: match[3] - }; - } - return { - width: 0, - height: 0, - viewBox: '' - }; - } - appendDST(data, dst) { - data += '\n'; - return data; - } - static #_ = this.ɵfac = function SvgService_Factory(t) { - return new (t || SvgService)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](_Modeler_modeler_service__WEBPACK_IMPORTED_MODULE_2__.ModelerService)); - }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjectable"]({ - token: SvgService, - factory: SvgService.ɵfac, - providedIn: 'root' - }); - } - return SvgService; -})(); + + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [diagram_js_lib_features_change_support__WEBPACK_IMPORTED_MODULE_5__["default"], diagram_js_lib_features_resize__WEBPACK_IMPORTED_MODULE_6__["default"], diagram_js_direct_editing__WEBPACK_IMPORTED_MODULE_0__["default"]], + __init__: ["dSlabelEditingProvider", "dSlabelEditingPreview"], + dSlabelEditingProvider: ["type", _dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_3__["default"]], + dSlabelEditingPreview: ["type", _dsLabelEditingPreview__WEBPACK_IMPORTED_MODULE_2__["default"]], + updateLabelHandler: ["type", _updateHandler_updateLabelHandler__WEBPACK_IMPORTED_MODULE_1__["default"]], + commandStack: ["type", diagram_js_lib_command_CommandStack__WEBPACK_IMPORTED_MODULE_7__["default"]], + modeling: ["type ", _modeling_dSModeling__WEBPACK_IMPORTED_MODULE_4__["default"]] +}); /***/ }), -/***/ 93689: -/*!*************************************************************************!*\ - !*** ./src/app/Service/IconSetConfiguration/icon-dictionary.service.ts ***! - \*************************************************************************/ +/***/ 22346: +/*!*****************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/labeling/position.js ***! + \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ICON_PREFIX: () => (/* binding */ ICON_PREFIX), -/* harmony export */ IconDictionaryService: () => (/* binding */ IconDictionaryService) +/* harmony export */ countLines: () => (/* binding */ countLines), +/* harmony export */ labelPosition: () => (/* binding */ labelPosition), +/* harmony export */ labelPositionX: () => (/* binding */ labelPositionX), +/* harmony export */ labelPositionY: () => (/* binding */ labelPositionY) /* harmony export */ }); -/* harmony import */ var src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/dictionary/dictionary */ 54972); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var src_app_Domain_Icon_Set_Configuration_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/Domain/Icon-Set-Configuration/iconConfiguration */ 69186); -/* harmony import */ var src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/Domain/Icon-Set-Configuration/allIcons */ 57488); -/* harmony import */ var _Utils_sanitizer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Utils/sanitizer */ 66107); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 2978); - +/* harmony import */ var _dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dsLabelUtil */ 13224); +/* harmony import */ var src_app_utils_mathExtensions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/utils/mathExtensions */ 67858); -var getIconId = src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.getIconId; - -const ICON_PREFIX = 'icon-domain-story-'; -let IconDictionaryService = /*#__PURE__*/(() => { - class IconDictionaryService { - constructor() { - this.actorIconDictionary = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - this.workObjectDictionary = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - this.allIconDictionary = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - this.iconDictionaryForBPMN = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - this.allIconDictionary.addEach(src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_3__.allIcons); - this.iconConfig = new src_app_Domain_Icon_Set_Configuration_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__.IconConfiguration(this.allIconDictionary); - } - initTypeDictionaries(actors, workObjects) { - if (!actors || actors.length == 0) { - actors = src_app_Domain_Icon_Set_Configuration_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__.defaultConf.actors; - } - if (!workObjects || workObjects.length == 0) { - workObjects = src_app_Domain_Icon_Set_Configuration_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__.defaultConf.workObjects; - } - const allTypes = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - allTypes.addEach(src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_3__.allIcons); - allTypes.appendDict(this.getAppendedIconDictionary()); - this.initDictionary(actors, allTypes, this.actorIconDictionary, src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR); - this.initDictionary(workObjects, allTypes, this.workObjectDictionary, src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT); - } - initDictionary(keys, allTypes, dictionary, elementType) { - dictionary.clear(); - for (const key of keys) { - dictionary.add(allTypes.get(key), key); - } - dictionary.keysArray().forEach(name => { - this.registerIconForBPMN(name, ICON_PREFIX + (0,_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_4__.sanitizeIconName)(name.toLowerCase()), elementType); - }); - } - getCurrentIconConfigurationForBPMN() { - if (this.customConfiguration) { - return this.iconConfig.createCustomConf(this.customConfiguration); - } - return this.iconConfig.getDefaultConf(); - } - allInTypeDictionary(type, elements) { - let collection; - if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) { - collection = this.actorIconDictionary; - } else if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT) { - collection = this.workObjectDictionary; - } - let allIn = true; - if (elements) { - elements.forEach(element => { - if (!collection.has(getIconId(element.type))) { - allIn = false; - } - }); - } else { - return false; - } - return allIn; - } - /** Load Icons from Configuration **/ - addIconsFromIconSetConfiguration(dictionaryType, iconTypes) { - let collection; - if (dictionaryType === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) { - collection = this.actorIconDictionary; - } else if (dictionaryType === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT) { - collection = this.workObjectDictionary; - } - const allTypes = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - allTypes.addEach(src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_3__.allIcons); - allTypes.appendDict(src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_3__.appendedIcons); - iconTypes.forEach(name => { - if (!collection.has(name)) { - const src = allTypes.get(name); - if (src) { - this.registerIconForType(dictionaryType, name, src); - this.registerIconForBPMN(name, (0,_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_4__.sanitizeIconName)(ICON_PREFIX + name.toLowerCase()), dictionaryType); - } - } - }); - } - /** Add Icon(s) to Dictionary **/ - registerIconForBPMN(name, src, elementType) { - if (name.includes(elementType)) { - throw new Error('Should not include elementType'); - } - this.iconDictionaryForBPMN.set(`${elementType}${name}`, src); - } - addIconsToTypeDictionary(actorIcons, workObjectIcons) { - if (!this.allInTypeDictionary(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, actorIcons)) { - this.addIconsFromIconSetConfiguration(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, actorIcons.map(element => getIconId(element.type))); - } - if (!this.allInTypeDictionary(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, workObjectIcons)) { - this.addIconsFromIconSetConfiguration(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, workObjectIcons.map(element => getIconId(element.type))); - } - } - registerIconForType(type, name, src) { - if (name.includes(type)) { - throw new Error('Name should not include type!'); - } - let collection = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) { - collection = this.actorIconDictionary; - } else if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT) { - collection = this.workObjectDictionary; - } - collection.add(src, name); - } - unregisterIconForType(type, name) { - if (name.includes(type)) { - throw new Error('Name should not include type!'); - } - let collection = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) { - collection = this.actorIconDictionary; - } else if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT) { - collection = this.workObjectDictionary; - } - collection.delete(name); - } - updateIconRegistries(actors, workObjects, config) { - const elements = []; - actors.forEach(a => elements.push(a)); - workObjects.forEach(w => elements.push(w)); - const customIcons = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - const actorsDict = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - const workObjectsDict = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - config.actors.keysArray().forEach(key => { - actorsDict.set(key, config.actors.get(key)); - }); - config.workObjects.keysArray().forEach(key => { - workObjectsDict.set(key, config.workObjects.get(key)); - }); - this.extractCustomIconsFromDictionary(actorsDict, customIcons); - this.extractCustomIconsFromDictionary(workObjectsDict, customIcons); - elements.forEach(element => { - const name = (0,_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_4__.sanitizeIconName)(element.type.replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, '').replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, '')); - if ((element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) || element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT)) && !this.getFullDictionary().has(name)) { - let elementType; - if (element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR)) { - elementType = src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR; - } else { - elementType = src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT; - } - this.registerIconForBPMN(ICON_PREFIX + name.toLowerCase(), getIconId(element.type), elementType); - } - }); - this.addNewIconsToDictionary(customIcons); - this.addIconsToTypeDictionary(actors, workObjects); - } - extractCustomIconsFromDictionary(elementDictionary, customIcons) { - elementDictionary.keysArray().forEach(name => { - const sanitizedName = (0,_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_4__.sanitizeIconName)(name); - if (!this.getFullDictionary().has(sanitizedName)) { - customIcons.add(elementDictionary.get(name), sanitizedName); - } - }); - } - /** Add new Icon(s) **/ - addNewIconsToDictionary(customIcons) { - customIcons.keysArray().forEach(key => { - const custom = customIcons.get(key); - this.addIMGToIconDictionary(custom.src, key); - }); - this.addIconsToCss(customIcons); - } - addIMGToIconDictionary(input, name) { - src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_3__.appendedIcons.set(name, input); - } - addIconsToCss(customIcons) { - const sheetEl = document.getElementById('iconsCss'); - customIcons.keysArray().forEach(key => { - const src = customIcons.get(key); - const iconStyle = '.' + ICON_PREFIX + (0,_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_4__.sanitizeIconName)(key.toLowerCase()) + '::before{ content: url("data:image/svg+xml;utf8,' + this.wrapSRCInSVG(src) + '"); margin: 3px;}'; - // @ts-ignore - sheetEl?.sheet?.insertRule(iconStyle, sheetEl.sheet.cssRules.length); - }); - } - wrapSRCInSVG(src) { - return ""; - } - /** Getter & Setter **/ - getFullDictionary() { - const fullDictionary = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - fullDictionary.appendDict(this.allIconDictionary); - fullDictionary.appendDict(this.getAppendedIconDictionary()); - return fullDictionary; - } - getAppendedIconDictionary() { - const appendedDict = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_3__.appendedIcons.keysArray().forEach(key => { - if (!this.allIconDictionary.has(key)) { - appendedDict.set(key, src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_3__.appendedIcons.get(key)); - } - }); - return appendedDict; - } - getTypeDictionary(type) { - if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) { - return this.actorIconDictionary; - } else if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT) { - return this.workObjectDictionary; - } - return new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - } - getTypeDictionaryKeys(type) { - return this.getTypeDictionary(type).keysArray(); - } - getTypeIconSRC(type, name) { - if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR) { - return this.actorIconDictionary.get(name); - } else if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT) { - return this.workObjectDictionary.get(name); - } - return null; - } - getIconForBPMN(elementType, name) { - return this.iconDictionaryForBPMN.get(`${elementType}${name}`); - } - getIconSource(name) { - if (this.allIconDictionary.has(name)) { - return this.allIconDictionary.get(name); - } else if (src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_3__.appendedIcons.has(name)) { - return src_app_Domain_Icon_Set_Configuration_allIcons__WEBPACK_IMPORTED_MODULE_3__.appendedIcons.get(name); - } - return null; - } - getElementsOfType(elements, type) { - const elementOfType = []; - elements.forEach(element => { - if (element.type.includes(type)) { - elementOfType.push(element); - } - }); - return elementOfType; - } - getAllIconDictionary() { - return this.allIconDictionary; - } - getActorsDictionary() { - return this.actorIconDictionary; - } - getWorkObjectsDictionary() { - return this.workObjectDictionary; - } - getIconConfiguration() { - return this.iconConfig; - } - setCustomConfiguration(customConfiguration) { - this.customConfiguration = customConfiguration; +function countLines(str) { + return str.split(/\r\n|\r|\n/).length; +} +// determine the position of the label at the activity +function labelPosition(waypoints, lines = 1) { + let amountWaypoints = waypoints.length; + let determinedPosition; + let xPos; + let yPos; + if (amountWaypoints > 2) { + let angleActivity = new Array(amountWaypoints - 1); + for (let i = 0; i < amountWaypoints - 1; i++) { + // calculate the angles of the activities + angleActivity[i] = (0,src_app_utils_mathExtensions__WEBPACK_IMPORTED_MODULE_1__.angleBetween)(waypoints[i], waypoints[i + 1]); } - static #_ = this.ɵfac = function IconDictionaryService_Factory(t) { - return new (t || IconDictionaryService)(); + let selectedActivity = (0,_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.selectPartOfActivity)(waypoints, angleActivity); + xPos = labelPositionX(waypoints[selectedActivity], waypoints[selectedActivity + 1]); + yPos = labelPositionY(waypoints[selectedActivity], waypoints[selectedActivity + 1], lines); + determinedPosition = { + x: xPos, + y: yPos, + selected: selectedActivity }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({ - token: IconDictionaryService, - factory: IconDictionaryService.ɵfac, - providedIn: 'root' - }); + return determinedPosition; + } else { + xPos = labelPositionX(waypoints[0], waypoints[1]); + yPos = labelPositionY(waypoints[0], waypoints[1], lines); + determinedPosition = { + x: xPos, + y: yPos, + selected: 0 + }; + return determinedPosition; + } +} +// calculate the X position of the label +function labelPositionX(startPoint, endPoint) { + let angle = (0,src_app_utils_mathExtensions__WEBPACK_IMPORTED_MODULE_1__.angleBetween)(startPoint, endPoint); + let offsetX = 0; + let scaledAngle = 0; + if (angle === 0 || angle === 180 || angle === 90 || angle === 270) { + offsetX = 0; + } else if (angle > 0 && angle < 90) { + // endpoint in upper right quadrant + offsetX = 5 - angle / 6; + } else if (angle > 90 && angle < 180) { + // endpoint in upper left quadrant + scaledAngle = angle - 90; + offsetX = 5 - scaledAngle / 18; + } else if (angle > 180 && angle < 270) { + // endpoint in lower left quadrant + scaledAngle = angle - 180; + offsetX = scaledAngle / 18; + } else if (angle > 270) { + // endpoint in lower right quadrant + scaledAngle = angle - 270; + offsetX = 5 - scaledAngle / 6; } - return IconDictionaryService; -})(); + return offsetX + (startPoint.x + endPoint.x) / 2; +} +// calculate the Y position of the label +function labelPositionY(startPoint, endPoint, lines = 1) { + let angle = (0,src_app_utils_mathExtensions__WEBPACK_IMPORTED_MODULE_1__.angleBetween)(startPoint, endPoint); + let offsetY = 0; + let scaledAngle = 0; + if (angle === 0 || angle === 180) { + offsetY = 15; + } else if (angle === 90 || angle === 270) { + offsetY = 0; + } else if (angle > 0 && angle < 90) { + // endpoint in upper right quadrant + offsetY = 15 - angle / 6; + } else if (angle > 90 && angle < 180) { + // endpoint in upper left quadrant + scaledAngle = angle - 90; + offsetY = -scaledAngle / 9 * lines; + } else if (angle > 180 && angle < 270) { + // endpoint in lower left quadrant + scaledAngle = angle - 180; + offsetY = 15 - scaledAngle / 3; + } else if (angle > 270) { + // endpoint in lower right quadrant + scaledAngle = angle - 270; + offsetY = -scaledAngle / 9 * lines; + } + return offsetY + (startPoint.y + endPoint.y) / 2; +} /***/ }), -/***/ 10200: -/*!********************************************************************************!*\ - !*** ./src/app/Service/IconSetConfiguration/icon-set-configuration.service.ts ***! - \********************************************************************************/ +/***/ 63960: +/*!*******************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/modeling/dSModeling.js ***! + \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ IconSetConfigurationService: () => (/* binding */ IconSetConfigurationService) +/* harmony export */ "default": () => (/* binding */ DSModeling) /* harmony export */ }); -/* harmony import */ var src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/dictionary/dictionary */ 54972); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var _Domain_Icon_Set_Configuration_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Domain/Icon-Set-Configuration/iconConfiguration */ 69186); -/* harmony import */ var _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Domain/Common/constants */ 90816); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var src_app_Service_IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/Service/IconSetConfiguration/icon-dictionary.service */ 93689); -/* harmony import */ var src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/Service/ElementRegistry/element-registry.service */ 67613); -/* harmony import */ var _Title_title_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Title/title.service */ 69672); - - - - +/* harmony import */ var bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bpmn-js/lib/features/modeling/Modeling */ 89113); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! util */ 1525); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_0__); -let IconSetConfigurationService = /*#__PURE__*/(() => { - class IconSetConfigurationService { - constructor(iconDictionaryService, elementRegistryService, titleService) { - this.iconDictionaryService = iconDictionaryService; - this.elementRegistryService = elementRegistryService; - this.titleService = titleService; - } - setIconSetName(iconSetName) { - this.titleService.setIconSetName(iconSetName ? iconSetName : _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_3__.INITIAL_ICON_SET_NAME); - } - exportConfiguration() { - const iconSetConfiguration = this.getCurrentConfigurationForExport(); - if (!iconSetConfiguration) { - return; - } - const configJSONString = JSON.stringify(iconSetConfiguration, null, 2); - const filename = this.titleService.getIconSetName(); - const element = document.createElement('a'); - element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(configJSONString)); - element.setAttribute('download', filename + '.iconset'); - element.style.display = 'none'; - document.body.appendChild(element); - element.click(); - document.body.removeChild(element); - } - loadConfiguration(customConfig, updateIconSetName = true) { - let actorDict = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - let workObjectDict = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - if (customConfig.actors.keysArray()) { - actorDict = customConfig.actors; - workObjectDict = customConfig.workObjects; - } else { - actorDict.addEach(customConfig.actors); - workObjectDict.addEach(customConfig.workObjects); - } - const actorKeys = actorDict.keysArray(); - const workObjectKeys = workObjectDict.keysArray(); - this.iconDictionaryService.updateIconRegistries([], [], customConfig); - this.iconDictionaryService.getIconConfiguration().appendSRCFile(actorKeys, actorDict, workObjectKeys, workObjectDict); - this.iconDictionaryService.addIconsFromIconSetConfiguration(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, actorKeys.map(a => src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR + a)); - this.iconDictionaryService.addIconsFromIconSetConfiguration(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, workObjectKeys.map(w => src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT + w)); - if (updateIconSetName) { - const configurationName = customConfig.name; - this.setIconSetName(configurationName); - } - } - getCurrentConfiguration() { - const actors = this.iconDictionaryService.getActorsDictionary(); - const workObjects = this.iconDictionaryService.getWorkObjectsDictionary(); - let iconSetConfiguration; - if (actors.size() > 0 && workObjects.size() > 0) { - iconSetConfiguration = this.createConfigFromDictionaries(actors, workObjects); - } - return iconSetConfiguration; - } - getCurrentConfigurationForExport() { - const currentConfiguration = this.getCurrentConfiguration(); - if (currentConfiguration) { - const actors = {}; - const workObjects = {}; - currentConfiguration.actors.all().forEach(entry => { - actors[entry.key] = entry.value; - }); - currentConfiguration.workObjects.all().forEach(entry => { - workObjects[entry.key] = entry.value; - }); - return { - name: currentConfiguration.name, - actors: actors, - workObjects: workObjects - }; - } - return; - } - getCurrentConfigurationNamesWithoutPrefix() { - return { - name: this.titleService.getIconSetName() || _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_3__.INITIAL_ICON_SET_NAME, - actors: this.iconDictionaryService.getActorsDictionary().keysArray().map(a => a.replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, '')), - workObjects: this.iconDictionaryService.getWorkObjectsDictionary().keysArray().map(w => w.replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, '')) - }; - } - createMinimalConfigurationWithDefaultIcons() { - const minimalConfig = this.createConfigFromCanvas(); - _Domain_Icon_Set_Configuration_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__.defaultConf.actors.forEach(iconName => { - minimalConfig.actors.add(this.iconDictionaryService.getIconSource(iconName), iconName); +function DSModeling(eventBus, elementFactory, commandStack, domainStoryRules) { + bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__["default"].call(this, eventBus, elementFactory, commandStack, domainStoryRules); +} +bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.updateLabel = function (element, newLabel, newBounds) { + if (element.businessObject ? newLabel !== element.businessObject.name : newLabel !== element.name) { + if (/^domainStory:/.test(element.type)) { + this._commandStack.execute("element.updateCustomLabel", { + element: element, + newLabel: newLabel, + newBounds: newBounds }); - _Domain_Icon_Set_Configuration_iconConfiguration__WEBPACK_IMPORTED_MODULE_2__.defaultConf.workObjects.forEach(iconName => { - minimalConfig.workObjects.add(this.iconDictionaryService.getIconSource(iconName), iconName); + } else { + this._commandStack.execute("element.updateLabel", { + element: element, + newLabel: newLabel, + newBounds: newBounds }); - return minimalConfig; } - createConfigFromDictionaries(actorsDict, workObjectsDict) { - const actorNames = actorsDict.keysArray(); - const workobjectNames = workObjectsDict.keysArray(); - const newActors = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - const newWorkobjects = new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); - // Fill Configuration from Canvas-Objects - actorNames.forEach(actor => { - newActors.add(actorsDict.get(actor), actor.replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, '')); - }); - workobjectNames.forEach(workObject => { - newWorkobjects.add(workObjectsDict.get(workObject), workObject.replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, '')); + } +}; +bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.updateNumber = function (element, newNumber, newBounds) { + if (element.businessObject ? newNumber !== element.businessObject.number : newNumber !== element.number) { + if (/^domainStory:/.test(element.type)) { + this._commandStack.execute("element.updateCustomLabel", { + element: element, + newNumber: newNumber, + newBounds: newBounds }); - return { - name: this.titleService.getIconSetName(), - actors: newActors, - workObjects: newWorkobjects - }; - } - createConfigFromCanvas() { - const config = { - name: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_3__.INITIAL_ICON_SET_NAME, - actors: new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(), - workObjects: new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary() - }; - let allCanvasObjects = this.elementRegistryService.getAllCanvasObjects(); - allCanvasObjects.map(e => e.businessObject).forEach(element => { - const type = element.type.replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, '').replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, ''); - if (element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR)) { - let src = this.iconDictionaryService.getIconSource(type) || ''; - config.actors.add(src, type); - } else if (element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT)) { - let src = this.iconDictionaryService.getIconSource(type) || ''; - config.workObjects.add(src, type); - } + } else { + this._commandStack.execute("element.updateLabel", { + element: element, + newNumber: newNumber, + newBounds: newBounds }); - return config; } - static #_ = this.ɵfac = function IconSetConfigurationService_Factory(t) { - return new (t || IconSetConfigurationService)(_angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵɵinject"](src_app_Service_IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_4__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵɵinject"](src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_5__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵɵinject"](_Title_title_service__WEBPACK_IMPORTED_MODULE_6__.TitleService)); - }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵɵdefineInjectable"]({ - token: IconSetConfigurationService, - factory: IconSetConfigurationService.ɵfac, - providedIn: 'root' - }); } - return IconSetConfigurationService; -})(); +}; +bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.replaceShape = function (oldShape, newShape, hints) { + let context = { + oldShape: oldShape, + newData: newShape, + hints: hints || {} + }; + this._commandStack.execute("shape.replace", context); + return context.newShape; +}; +bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.removeGroup = function (element) { + this._commandStack.execute("shape.removeGroupWithoutChildren", { + element: element + }); + this.removeElements({ + element + }); +}; +(0,util__WEBPACK_IMPORTED_MODULE_0__.inherits)(DSModeling, bpmn_js_lib_features_modeling_Modeling__WEBPACK_IMPORTED_MODULE_1__["default"]); +DSModeling.$inject = ["eventBus", "elementFactory", "commandStack", "domainStoryRules"]; /***/ }), -/***/ 87007: -/*!********************************************************************************!*\ - !*** ./src/app/Service/IconSetConfiguration/icon-set-customization.service.ts ***! - \********************************************************************************/ +/***/ 81408: +/*!**************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/modeling/index.js ***! + \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ IconSetCustomizationService: () => (/* binding */ IconSetCustomizationService) +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ 95981); -/* harmony import */ var _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Domain/Common/constants */ 90816); -/* harmony import */ var _Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Domain/Common/dictionary/dictionary */ 54972); -/* harmony import */ var _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Domain/Common/elementTypes */ 30236); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./icon-set-configuration.service */ 10200); -/* harmony import */ var _icon_dictionary_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./icon-dictionary.service */ 93689); -/* harmony import */ var _Import_import_domain_story_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Import/import-domain-story.service */ 23779); -/* harmony import */ var _Title_title_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Title/title.service */ 69672); -/* harmony import */ var _BrowserStorage_storage_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../BrowserStorage/storage.service */ 59298); -/* harmony import */ var src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/Service/ElementRegistry/element-registry.service */ 67613); -/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); +/* harmony import */ var _palette_domainStoryPalette__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../palette/domainStoryPalette */ 60148); +/* harmony import */ var bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! bpmn-js/lib/features/modeling/ElementFactory */ 63784); +/* harmony import */ var diagram_js_lib_features_create__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! diagram-js/lib/features/create */ 31073); +/* harmony import */ var bpmn_js_lib_draw_PathMap__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! bpmn-js/lib/draw/PathMap */ 66652); +/* harmony import */ var bpmn_js_lib_features_popup_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! bpmn-js/lib/features/popup-menu */ 77029); +/* harmony import */ var diagram_js_lib_features_context_pad__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! diagram-js/lib/features/context-pad */ 64712); +/* harmony import */ var diagram_js_lib_command_CommandStack__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! diagram-js/lib/command/CommandStack */ 22205); +/* harmony import */ var _updateHandler_updateLabelHandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../updateHandler/updateLabelHandler */ 18911); +/* harmony import */ var _domainStoryUpdater__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../domainStoryUpdater */ 85918); +/* harmony import */ var _domainStoryElementFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../domainStoryElementFactory */ 44877); +/* harmony import */ var _updateHandler_headlineAndDescriptionUpdateHandler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../updateHandler/headlineAndDescriptionUpdateHandler */ 28126); +/* harmony import */ var _domainStoryRenderer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../domainStoryRenderer */ 79552); +/* harmony import */ var _dSModeling__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dSModeling */ 63960); +/* harmony import */ var _domainStoryRules__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../domainStoryRules */ 63344); +/* harmony import */ var _change_icon_replaceMenuProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../change-icon/replaceMenuProvider */ 98461); +/* harmony import */ var _context_pad_domainStoryContextPadProvider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../context-pad/domainStoryContextPadProvider */ 57218); + + + + + + + + + + + + -var getIconId = _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.getIconId; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [diagram_js_lib_features_create__WEBPACK_IMPORTED_MODULE_10__["default"], diagram_js_lib_features_context_pad__WEBPACK_IMPORTED_MODULE_11__["default"], bpmn_js_lib_features_popup_menu__WEBPACK_IMPORTED_MODULE_12__["default"]], + __init__: ["domainStoryRenderer", "paletteProvider", "domainStoryRules", "domainStoryUpdater", "contextPadProvider", "replaceMenuProvider"], + elementFactory: ["type", _domainStoryElementFactory__WEBPACK_IMPORTED_MODULE_3__["default"]], + domainStoryRenderer: ["type", _domainStoryRenderer__WEBPACK_IMPORTED_MODULE_5__["default"]], + paletteProvider: ["type", _palette_domainStoryPalette__WEBPACK_IMPORTED_MODULE_0__["default"]], + domainStoryRules: ["type", _domainStoryRules__WEBPACK_IMPORTED_MODULE_7__["default"]], + domainStoryUpdater: ["type", _domainStoryUpdater__WEBPACK_IMPORTED_MODULE_2__["default"]], + contextPadProvider: ["type", _context_pad_domainStoryContextPadProvider__WEBPACK_IMPORTED_MODULE_9__["default"]], + elementFactoryBpmn: ["type", bpmn_js_lib_features_modeling_ElementFactory__WEBPACK_IMPORTED_MODULE_13__["default"]], + pathMap: ["type", bpmn_js_lib_draw_PathMap__WEBPACK_IMPORTED_MODULE_14__["default"]], + replaceMenuProvider: ["type", _change_icon_replaceMenuProvider__WEBPACK_IMPORTED_MODULE_8__["default"]], + commandStack: ["type", diagram_js_lib_command_CommandStack__WEBPACK_IMPORTED_MODULE_15__["default"]], + updateLabelHandler: ["type", _updateHandler_updateLabelHandler__WEBPACK_IMPORTED_MODULE_1__["default"]], + headlineAndDescriptionUpdateHandler: ["type", _updateHandler_headlineAndDescriptionUpdateHandler__WEBPACK_IMPORTED_MODULE_4__["default"]], + modeling: ["type", _dSModeling__WEBPACK_IMPORTED_MODULE_6__["default"]] +}); +/***/ }), +/***/ 14945: +/*!*******************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/numbering/numbering.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addNumberToRegistry: () => (/* binding */ addNumberToRegistry), +/* harmony export */ generateAutomaticNumber: () => (/* binding */ generateAutomaticNumber), +/* harmony export */ getMultipleNumberRegistry: () => (/* binding */ getMultipleNumberRegistry), +/* harmony export */ getNumberRegistry: () => (/* binding */ getNumberRegistry), +/* harmony export */ getNumbersAndIDs: () => (/* binding */ getNumbersAndIDs), +/* harmony export */ initializeNumbering: () => (/* binding */ initializeNumbering), +/* harmony export */ numberBoxDefinitions: () => (/* binding */ numberBoxDefinitions), +/* harmony export */ setNumberIsMultiple: () => (/* binding */ setNumberIsMultiple), +/* harmony export */ updateExistingNumbersAtEditing: () => (/* binding */ updateExistingNumbersAtEditing), +/* harmony export */ updateExistingNumbersAtGeneration: () => (/* binding */ updateExistingNumbersAtGeneration), +/* harmony export */ updateMultipleNumberRegistry: () => (/* binding */ updateMultipleNumberRegistry) +/* harmony export */ }); +/* harmony import */ var src_app_utils_mathExtensions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/utils/mathExtensions */ 67858); -let IconSetCustomizationService = /*#__PURE__*/(() => { - class IconSetCustomizationService { - constructor(configurationService, iconDictionaryService, importService, titleService, storageService, elementRegistryService, snackbar) { - this.configurationService = configurationService; - this.iconDictionaryService = iconDictionaryService; - this.importService = importService; - this.titleService = titleService; - this.storageService = storageService; - this.elementRegistryService = elementRegistryService; - this.snackbar = snackbar; - this.allIconListItems = new _Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); - this.configurationHasChanged = false; - this.selectedActors$ = new rxjs__WEBPACK_IMPORTED_MODULE_9__.BehaviorSubject([]); - this.selectedWorkobjects$ = new rxjs__WEBPACK_IMPORTED_MODULE_9__.BehaviorSubject([]); - this.iconSetConfigurationTypes = new rxjs__WEBPACK_IMPORTED_MODULE_9__.BehaviorSubject(this.configurationService.getCurrentConfigurationNamesWithoutPrefix()); - this.selectedWorkobjects$.next(this.iconSetConfigurationTypes.value.workObjects); - this.selectedActors$.next(this.iconSetConfigurationTypes.value.actors); - iconDictionaryService.getAllIconDictionary().keysArray().forEach(iconName => { - this.addIconToAllIconList(iconName); - }); - importService.importedConfigurationEvent.subscribe(config => { - this.importConfiguration(config); - }); - const storedIconSetConfiguration = this.storageService.getStoredIconSetConfiguration(); - if (storedIconSetConfiguration) { - this.importConfiguration(storedIconSetConfiguration, false); - } - const importedConfiguration = this.importService.getImportedConfiguration(); - if (importedConfiguration) { - this.importConfiguration(importedConfiguration, false); - } - } - importConfiguration(customConfig, saveIconSet = true) { - const actorKeys = customConfig.actors.keysArray(); - const workObjectKeys = customConfig.workObjects.keysArray(); - this.changeName(customConfig.name); - actorKeys.forEach(iconName => { - if (!this.allIconListItems.has(iconName)) { - this.addIconToAllIconList(iconName); - } - const selectedActorNames = this.selectedActors$.value; - if (!selectedActorNames.includes(iconName)) { - this.selectActor(iconName); - } - }); - workObjectKeys.forEach(iconName => { - if (!this.allIconListItems.has(iconName)) { - this.addIconToAllIconList(iconName); - } - const selectedWorkobjectNames = this.selectedWorkobjects$.value; - if (!selectedWorkobjectNames.includes(iconName)) { - this.selectWorkObject(iconName); - } - }); - if (saveIconSet) { - this.saveIconSet(this.elementRegistryService.getUsedIcons(), true); - } - } - /** Getter & Setter **/ - getIconSetConfiguration() { - return this.iconSetConfigurationTypes; - } - getIconForName(iconName) { - return this.allIconListItems.get(iconName); - } - isIconActor(iconName) { - return this.iconSetConfigurationTypes.value.actors.filter(actor => actor === iconName).length > 0; - } - isIconWorkObject(iconName) { - return this.iconSetConfigurationTypes.value.workObjects.filter(workObject => workObject === iconName).length > 0; - } - changeName(iconSetName) { - this.titleService.setIconSetName(iconSetName); - const changedIconSet = this.iconSetConfigurationTypes.value; - changedIconSet.name = iconSetName; - this.iconSetConfigurationTypes.next(changedIconSet); - } - /** Selected Icons **/ - setAsUnassigned(iconName, isActor) { - if (isActor) { - this.deselectActor(iconName); - } else { - this.deselectWorkobject(iconName); - } - this.updateIcon(false, false, iconName); - } - setAsActor(isActor, actor) { - if (isActor) { - this.updateIcon(true, false, actor); - this.selectActor(actor); - this.deselectWorkobject(actor); - } else { - this.deselectActor(actor); - this.updateIcon(false, false, actor); - } +let numberRegistry = []; +let multipleNumberRegistry = [false]; +let canvasElementRegistry; +function initializeNumbering(canvasElementRegistryService) { + canvasElementRegistry = canvasElementRegistryService; +} +function updateMultipleNumberRegistry(activityBusinessObjects) { + activityBusinessObjects.forEach(activity => multipleNumberRegistry[activity.number] = activity.multipleNumberAllowed); +} +// defines the box for activity numbers +function numberBoxDefinitions(element) { + let alignment = "center"; + let boxWidth = 30; + let boxHeight = 30; + let angle = 0; + if (element.waypoints.length > 1) { + angle = (0,src_app_utils_mathExtensions__WEBPACK_IMPORTED_MODULE_0__.angleBetween)( + // Start of first arrow segment + element.waypoints[0], + // End of first arrow segment + element.waypoints[1]); + } + let x = element.waypoints[0].x; + let y = element.waypoints[0].y; + let fixedOffsetX = 0; + let fixedOffsetY = 0; + let angleDependantOffsetX = 0; + let angleDependantOffsetY = 0; + // Fine tune positioning of sequence number above beginning of first arrow segment + if (angle >= 0 && angle <= 45) { + fixedOffsetX = 25; + angleDependantOffsetY = 20 * (1 - angle / 45); + } else if (angle <= 90) { + fixedOffsetX = 5; + angleDependantOffsetX = 15 * (1 - (angle - 45) / 45); + } else if (angle <= 135) { + fixedOffsetX = 5; + angleDependantOffsetX = -20 * ((angle - 90) / 45); + } else if (angle <= 180) { + fixedOffsetX = -15; + angleDependantOffsetY = 20 * ((angle - 135) / 45); + } else if (angle <= 225) { + fixedOffsetX = -15; + fixedOffsetY = 15; + angleDependantOffsetY = 25 * ((angle - 180) / 45); + } else if (angle <= 270) { + fixedOffsetX = 5; + angleDependantOffsetX = -20 * (1 - (angle - 225) / 45); + fixedOffsetY = 40; + } else if (angle <= 315) { + fixedOffsetX = 5; + angleDependantOffsetX = 25 * ((angle - 270) / 45); + fixedOffsetY = 40; + } else { + fixedOffsetX = 25; + fixedOffsetY = 20; + angleDependantOffsetY = 15 * (1 - (angle - 315) / 45); + } + x = x + fixedOffsetX + angleDependantOffsetX; + y = y + fixedOffsetY + angleDependantOffsetY; + return { + textAlign: alignment, + width: boxWidth, + height: boxHeight, + x: x, + y: y + }; +} +// determine the next available number that is not yet used +function generateAutomaticNumber(elementActivity, commandStack) { + const semantic = elementActivity.businessObject; + const usedNumbers = [0]; + let wantedNumber = -1; + const activitiesFromActors = canvasElementRegistry.getActivitiesFromActors(); + activitiesFromActors.forEach(element => { + if (element.businessObject.number) { + usedNumbers.push(+element.businessObject.number); } - setAsWorkobject(isWorkobject, workobject) { - if (isWorkobject) { - this.updateIcon(false, true, workobject); - this.selectWorkObject(workobject); - this.deselectActor(workobject); - } else { - this.deselectWorkobject(workobject); - this.updateIcon(false, false, workobject); + }); + for (let i = 0; i < usedNumbers.length; i++) { + if (!usedNumbers.includes(i)) { + if (!usedNumbers.includes(i)) { + wantedNumber = i; + i = usedNumbers.length; } } - selectActor(actor) { - const value = this.iconSetConfigurationTypes.value; - if (!value.actors.includes(actor)) { - value.actors.push(actor); - this.iconSetConfigurationTypes.next(value); - this.updateActorSubject(); - } + } + if (wantedNumber === -1) { + wantedNumber = usedNumbers.length; + } + updateExistingNumbersAtGeneration(activitiesFromActors, wantedNumber, commandStack); + semantic.number = wantedNumber; + return wantedNumber; +} +// update the numbers at the activities when generating a new activity +function updateExistingNumbersAtGeneration(activitiesFromActors, wantedNumber, commandStack) { + activitiesFromActors.forEach(element => { + let number = +element.businessObject.number; + if (number >= wantedNumber) { + wantedNumber++; + setTimeout(function () { + commandStack.execute("activity.changed", { + businessObject: element.businessObject, + newLabel: element.businessObject.name, + newNumber: number, + element: element + }); + }, 10); } - selectWorkObject(workObject) { - const value = this.iconSetConfigurationTypes.value; - if (!value.workObjects.includes(workObject)) { - value.workObjects.push(workObject); - this.iconSetConfigurationTypes.next(value); - this.updateWorkObjectSubject(); - } + }); +} +// update the numbers at the activities when editing an activity +function updateExistingNumbersAtEditing(activitiesFromActors, wantedNumber, eventBus) { + // get a sorted list of all activities that could need changing + let sortedActivities = [[]]; + activitiesFromActors.forEach(activity => { + if (!sortedActivities[activity.businessObject.number]) { + sortedActivities[activity.businessObject.number] = []; } - deselectActor(actor) { - if (this.iconSetConfigurationTypes) { - this.iconSetConfigurationTypes.next({ - name: this.iconSetConfigurationTypes.value.name, - actors: this.iconSetConfigurationTypes.value.actors.filter(a => !a.includes(actor)), - workObjects: this.iconSetConfigurationTypes.value.workObjects - }); - } - this.updateActorSubject(); + sortedActivities[activity.businessObject.number].push(activity); + }); + // set the number of each activity to the next highest number, starting from the number, we overrode + let oldMultipleNumberRegistry = [...multipleNumberRegistry]; + let currentNumber = wantedNumber; + for (currentNumber; currentNumber < sortedActivities.length; currentNumber++) { + if (sortedActivities[currentNumber]) { + wantedNumber++; + multipleNumberRegistry[wantedNumber] = oldMultipleNumberRegistry[currentNumber]; + setNumberOfActivity(sortedActivities[currentNumber], wantedNumber, eventBus); } - deselectWorkobject(workobject) { - if (this.iconSetConfigurationTypes) { - this.iconSetConfigurationTypes.next({ - name: this.iconSetConfigurationTypes.value.name, - actors: this.iconSetConfigurationTypes.value.actors, - workObjects: this.iconSetConfigurationTypes.value.workObjects.filter(w => !w.includes(workobject)) + } +} +// get the IDs of activities with their associated number, only returns activities that are originating from an actor +function getNumbersAndIDs() { + let iDWithNumber = []; + let activities = canvasElementRegistry.getActivitiesFromActors(); + for (let i = activities.length - 1; i >= 0; i--) { + let id = activities[i].businessObject.id; + let number = activities[i].businessObject.number; + iDWithNumber.push({ + id: id, + number: number + }); + } + return iDWithNumber; +} +function addNumberToRegistry(renderedNumber, number) { + numberRegistry[number] = renderedNumber; +} +function setNumberIsMultiple(number, multi) { + multipleNumberRegistry[number] = multi; +} +/** + * @returns copy of registry + */ +function getNumberRegistry() { + return numberRegistry.slice(0); +} +function getMultipleNumberRegistry() { + return multipleNumberRegistry.slice(0); +} +function setNumberOfActivity(elementArray, wantedNumber, eventBus) { + if (elementArray) { + elementArray.forEach(element => { + if (element) { + let businessObject = element.businessObject; + if (businessObject) { + businessObject.number = wantedNumber; + } + eventBus.fire("element.changed", { + element }); } - this.updateWorkObjectSubject(); - } - setSelectedWorkObject(sortedList) { - const value = this.iconSetConfigurationTypes.value; - value.workObjects = sortedList; - this.iconSetConfigurationTypes.next(value); - this.updateWorkObjectSubject(); - } - setSelectedActors(sortedList) { - const value = this.iconSetConfigurationTypes.value; - value.actors = sortedList; - this.iconSetConfigurationTypes.next(value); - this.updateActorSubject(); + }); + } +} + +/***/ }), + +/***/ 60148: +/*!**************************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/palette/domainStoryPalette.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ PaletteProvider), +/* harmony export */ initializePalette: () => (/* binding */ initializePalette) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! min-dash */ 93673); +/* harmony import */ var src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/tools/icon-set-config/domain/allIcons */ 61070); +/* harmony import */ var src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/domain/entities/dictionary */ 20843); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/domain/entities/constants */ 40550); + + + + + + + +/** + * A palette that allows you to create BPMN _and_ custom elements. + */ +let iconDictionary; +let configuration; +function initializePalette(iconDictionaryService, configurationService) { + iconDictionary = iconDictionaryService; + configuration = configurationService; +} +function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool) { + this._create = create; + this._elementFactory = elementFactory; + this._spaceTool = spaceTool; + this._lassoTool = lassoTool; + palette.registerProvider(this); +} +PaletteProvider.$inject = ["palette", "create", "elementFactory", "spaceTool", "lassoTool", "modeling"]; +PaletteProvider.prototype.getPaletteEntries = function () { + let actions = {}, + create = this._create, + elementFactory = this._elementFactory, + spaceTool = this._spaceTool, + lassoTool = this._lassoTool; + function createAction(type, group, className, title, options) { + function createListener(event) { + let shape = elementFactory.createShape((0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)({ + type: type + }, options)); + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(shape.businessObject, { + id: shape.id + }); + if (options) { + shape.businessObject.di.isExpanded = options.isExpanded; + } + create.start(event, shape); } - updateActorSubject() { - this.selectedActors$.next(this.iconSetConfigurationTypes.value.actors); - this.configurationHasChanged = true; + let shortType = type.replace(/^domainStory:/, ""); + return { + group: group, + className: className, + title: "Create " + title || 0, + action: { + dragstart: createListener, + click: createListener + } + }; + } + return initPalette(actions, spaceTool, lassoTool, createAction); +}; +function appendCSSStyleCheat(customIcons) { + const sheetEl = document.createElement("style"); + document.head.appendChild(sheetEl); + let customIconDict = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); + customIconDict.appendDict(customIcons); + let customIconDictKeys = customIconDict.keysArray(); + customIconDictKeys.forEach(name => { + if (iconDictionary.getAppendedIconDictionary().has(name)) { + let src = customIconDict.get(name); + const iconStyle = ".icon-domain-story-" + name.toLowerCase() + "::before{" + " display: block;" + ' content: url("data:image/svg+xml;utf8,' + wrapSRCInSVG(src) + '");' + " margin: 3px;}"; + sheetEl.sheet.insertRule(iconStyle, sheetEl.sheet.cssRules.length); } - updateWorkObjectSubject() { - this.selectedWorkobjects$.next(this.iconSetConfigurationTypes.value.workObjects); - this.configurationHasChanged = true; + }); +} +function initPalette(actions, spaceTool, lassoTool, createAction) { + let config = iconDictionary?.getCurrentIconConfigurationForBPMN(); + let customIcons = localStorage.getItem(src_app_domain_entities_constants__WEBPACK_IMPORTED_MODULE_3__.APPENDED_ICONS_TAG); + if (customIcons) { + customIcons = JSON.parse(customIcons); + if (customIconsLegacy(customIcons)) { + customIcons = convertLegacyAppendedIconsToDict(customIcons); } - /** Revert Icon Set **/ - resetIconSet() { - const defaultConfig = this.configurationService.createMinimalConfigurationWithDefaultIcons(); - this.selectedWorkobjects$.value.forEach(workObjectName => { - if (!defaultConfig.workObjects.has(workObjectName)) { - this.deselectWorkobject(workObjectName); - } - }); - this.selectedActors$.value.forEach(actorName => { - if (!defaultConfig.actors.has(actorName)) { - this.deselectActor(actorName); - } - }); - this.iconSetConfigurationTypes.next({ - name: defaultConfig.name, - actors: defaultConfig.actors.keysArray(), - workObjects: defaultConfig.workObjects.keysArray() + if (customIcons.entries && customIcons.entries.forEach) { + const customIconsDict = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); + customIcons.entries.forEach(entry => { + customIconsDict.putEntry(entry); }); - this.updateAllIconBehaviourSubjects(); - } - cancel() { - this.iconSetConfigurationTypes.next(this.configurationService.getCurrentConfigurationNamesWithoutPrefix()); - this.updateAllIconBehaviourSubjects(); - this.resetToInitialConfiguration(); + (0,src_app_tools_icon_set_config_domain_allIcons__WEBPACK_IMPORTED_MODULE_0__.overrideAppendedIcons)(customIconsDict); + appendCSSStyleCheat(customIcons); } - resetToInitialConfiguration() { - this.updateActorSubject(); - this.updateWorkObjectSubject(); + } + iconDictionary?.initTypeDictionaries(config.actors, config.workObjects); + let actorTypes = iconDictionary?.getTypeDictionary(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR); + actorTypes?.keysArray().forEach(name => { + addCanvasObjectTypes(name, createAction, actions, "actor", src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR); + }); + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(actions, { + "actor-separator": { + group: "actor", + separator: true } - /** Persist Icon Set **/ - saveIconSet(usedIcons, imported = false) { - const changedActors = []; - const changedWorkobjects = []; - if (this.configurationHasChanged) { - const changedIconSet = this.createIconSetConfiguration(); - const configurationActors = changedIconSet.actors.keysArray(); - usedIcons?.actors.forEach(actor => { - if (!configurationActors?.includes(actor) && !changedActors.includes(actor)) { - changedActors.push(actor); - } - }); - const configurationWorkobjects = changedIconSet.workObjects.keysArray(); - usedIcons?.workobjects.forEach(workobject => { - if (!configurationWorkobjects?.includes(workobject) && !changedWorkobjects.includes(workobject)) { - changedWorkobjects.push(workobject); - } - }); - if (!changedActors.length && !changedWorkobjects.length) { - this.changedIconSetConfiguration = changedIconSet; - this.updateIcons(changedIconSet); - this.storageService.setStoredIconSetConfiguration(this.changedIconSetConfiguration); - this.snackbar.open(imported ? 'Configuration imported successfully' : 'Configuration saved successfully', undefined, { - duration: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION, - panelClass: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_SUCCESS - }); + }); + let workObjectTypes = iconDictionary?.getTypeDictionary(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT); + workObjectTypes?.keysArray().forEach(name => { + addCanvasObjectTypes(name, createAction, actions, "actor", src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT); + }); + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(actions, { + "workObject-separator": { + group: "workObject", + separator: true + }, + "domainStory-group": createAction(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.GROUP, "group", "icon-domain-story-tool-group", "group"), + "group-separator": { + group: "group", + separator: true + }, + "lasso-tool": { + group: "tools", + className: "bpmn-icon-lasso-tool", + title: "Activate the lasso tool", + action: { + click: function (event) { + lassoTool.activateSelection(event); } - } else { - this.snackbar.open(imported ? 'No configuration to be imported' : 'No configuration to be saved', undefined, { - duration: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION, - panelClass: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_INFO - }); } - if (changedActors.length || changedWorkobjects.length) { - if (changedActors.length) { - const actors = changedActors.join(', '); - this.snackbar.open(`The following icons are already in use as actors and cannot be changed: ${actors}`, undefined, { - duration: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION * 3, - panelClass: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_INFO - }); - } - if (changedWorkobjects.length) { - const workobjects = changedWorkobjects.join(', '); - this.snackbar.open(`The following icons are already in use as workobjects and cannot be changed: ${workobjects}`, undefined, { - duration: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION * 3, - panelClass: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_INFO - }); + }, + "space-tool": { + group: "tools", + className: "bpmn-icon-space-tool", + title: "Activate the create/remove space tool", + action: { + click: function (event) { + spaceTool.activateSelection(event); } } } - exportIconSet() { - this.configurationService.exportConfiguration(); - } - getAndClearSavedConfiguration() { - const temp = this.changedIconSetConfiguration; - this.changedIconSetConfiguration = undefined; - return temp; - } - createIconSetConfiguration() { - const actors = new _Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); - const workObjects = new _Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); - this.iconSetConfigurationTypes.value.actors.forEach(name => { - actors.add(this.iconDictionaryService.getIconSource(name), name); - }); - this.iconSetConfigurationTypes.value.workObjects.forEach(name => { - workObjects.add(this.iconDictionaryService.getIconSource(name), name); + }); + return actions; +} +function addCanvasObjectTypes(name, createAction, actions, className, elementType) { + let icon = iconDictionary.getIconForBPMN(elementType, name); + let action = []; + action["domainStory-" + className + name] = createAction(`${elementType}${name}`, className, icon, name); + (0,min_dash__WEBPACK_IMPORTED_MODULE_4__.assign)(actions, action); +} +function customIconsLegacy(customIcons) { + return !(Object.keys(customIcons).length === 1 && Object.keys(customIcons)[0] === "entries"); +} +function convertLegacyAppendedIconsToDict(customIcons) { + let dict = new src_app_domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); + Object.keys(customIcons).forEach(key => { + dict.set(key, customIcons[key]); + }); + return dict; +} +// For some reason its important to use ' in the content for the Palette and ContextPad +// Do not change! +function wrapSRCInSVG(src) { + return "" + ""; +} + +/***/ }), + +/***/ 56185: +/*!************************************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/updateHandler/activityUpdateHandlers.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ activityUpdateHandler), +/* harmony export */ initializeActivityUpdateHandler: () => (/* binding */ initializeActivityUpdateHandler) +/* harmony export */ }); +/* harmony import */ var _numbering_numbering__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../numbering/numbering */ 14945); + + + +/** + * commandStack Handler for changes at activities + */ +let canvasElementRegistry; +function initializeActivityUpdateHandler(canvasElementRegistryService) { + canvasElementRegistry = canvasElementRegistryService; +} +function activityUpdateHandler(commandStack, eventBus) { + commandStack.registerHandler("activity.directionChange", activity_directionChange); + commandStack.registerHandler("activity.changed", activity_changed); + // update the activity from the activity-dialog, either with or without number + // and change other activities too, to keep the numbers consistent + function activity_changed(modeling) { + this.preExecute = function (context) { + context.oldLabel = context.businessObject.name || " "; + let oldNumbersWithIDs = (0,_numbering_numbering__WEBPACK_IMPORTED_MODULE_0__.getNumbersAndIDs)(); + modeling.updateLabel(context.businessObject, context.newLabel); + modeling.updateNumber(context.businessObject, context.newNumber); + context.oldNumber = context.businessObject.number; + context.oldNumbersWithIDs = oldNumbersWithIDs; + }; + this.execute = function (context) { + let businessObject = context.businessObject; + let element = context.element; + if (context.newLabel && context.newLabel.length < 1) { + context.newLabel = " "; + } + businessObject.name = context.newLabel; + businessObject.number = context.newNumber; + eventBus.fire("element.changed", { + element }); - return { - name: this.iconSetConfigurationTypes.value.name || '', - actors, - workObjects - }; - } - /** Update Icons **/ - addNewIcon(iconName) { - const iconDict = new _Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_1__.Dictionary(); - iconDict.add(this.getSrcForIcon(iconName), iconName); - this.iconDictionaryService.addIconsToCss(iconDict); - this.addIconToAllIconList(iconName); - } - addIconToAllIconList(iconName) { - this.allIconListItems.add(new rxjs__WEBPACK_IMPORTED_MODULE_9__.BehaviorSubject({ - name: iconName, - svg: this.getSrcForIcon(iconName), - isActor: this.isIconActor(iconName), - isWorkObject: this.isIconWorkObject(iconName) - }), iconName); - } - updateIcon(isActor, isWorkobject, iconName) { - const iconBehaviourSubject = this.getIconForName(iconName); - const icon = iconBehaviourSubject.value; - icon.isActor = isActor; - icon.isWorkObject = isWorkobject; - iconBehaviourSubject.next(icon); - } - updateAllIconBehaviourSubjects() { - const customIconSetConfiguration = this.iconSetConfigurationTypes.value; - this.allIconListItems.keysArray().forEach(iconName => { - if (customIconSetConfiguration.actors.includes(iconName)) { - this.updateIcon(true, false, iconName); - } else if (customIconSetConfiguration.workObjects.includes(iconName)) { - this.updateIcon(false, true, iconName); - } else { - this.updateIcon(false, false, iconName); - } + }; + this.revert = function (context) { + let semantic = context.businessObject; + let element = context.element; + semantic.name = context.oldLabel; + semantic.number = context.oldNumber; + revertAutomaticNumberGenerationChange(context.oldNumbersWithIDs, eventBus); + eventBus.fire("element.changed", { + element }); - } - getSrcForIcon(name) { - let iconName; - if (name.includes(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.DOMAINSTORY)) { - // TODO: td: This returns empty every time! - iconName = getIconId(name); - } else { - iconName = name; + }; + } + // change the direction of a single activity without affecting other activities + function activity_directionChange(modeling) { + this.preExecute = function (context) { + context.oldNumber = context.businessObject.number; + context.oldWaypoints = context.element.waypoints; + context.name = context.businessObject.name; + if (!context.oldNumber) { + context.oldNumber = 0; } - const rawSrc = this.iconDictionaryService.getIconSource(iconName); - if (!rawSrc) { - return ''; + modeling.updateNumber(context.businessObject, context.newNumber); + }; + this.execute = function (context) { + let businessObject = context.businessObject; + let element = context.element; + let swapSource = element.source; + let newWaypoints = []; + let waypoints = element.waypoints; + for (let i = waypoints.length - 1; i >= 0; i--) { + newWaypoints.push(waypoints[i]); } - if (rawSrc.startsWith('data')) { - return rawSrc; - } else { - return 'data:image/svg+xml,' + rawSrc; + element.source = element.target; + businessObject.source = businessObject.target; + element.target = swapSource; + businessObject.target = swapSource.id; + businessObject.name = context.name; + businessObject.number = context.newNumber; + element.waypoints = newWaypoints; + eventBus.fire("element.changed", { + element + }); + }; + this.revert = function (context) { + let semantic = context.businessObject; + let element = context.element; + let swapSource = element.source; + element.source = element.target; + semantic.source = semantic.target; + element.target = swapSource; + semantic.target = swapSource.id; + semantic.name = context.name; + semantic.number = context.oldNumber; + element.waypoints = context.oldWaypoints; + eventBus.fire("element.changed", { + element + }); + }; + } +} +// reverts the automatic changed done by the automatic number-generation at editing +function revertAutomaticNumberGenerationChange(iDWithNumber, eventBus) { + let activities = canvasElementRegistry?.getActivitesFromActors(); + for (let i = activities.length - 1; i >= 0; i--) { + for (let j = iDWithNumber.length - 1; j >= 0; j--) { + if (iDWithNumber[j].id.includes(activities[i].businessObject.id)) { + let element = activities[i]; + element.businessObject.number = iDWithNumber[j].number; + j = -5; + eventBus.fire("element.changed", { + element + }); + iDWithNumber.splice(j, 1); } } - updateIcons(changedIconSet) { - this.allIconListItems.keysArray().forEach(item => this.setAsUnassigned(item, this.isIconActor(item))); - changedIconSet.actors.keysArray().forEach(actor => { - this.iconDictionaryService.registerIconForType(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR, actor, this.iconDictionaryService.getFullDictionary().get(actor)); - this.iconDictionaryService.unregisterIconForType(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT, actor); - this.setAsActor(true, actor); + } +} + +/***/ }), + +/***/ 87147: +/*!**********************************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/updateHandler/elementUpdateHandler.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ elementUpdateHandler) +/* harmony export */ }); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ 20580); + + + +function elementUpdateHandler(commandStack, eventBus) { + commandStack.registerHandler("element.colorChange", element_colorChange); + commandStack.registerHandler("shape.removeGroupWithoutChildren", removeGroupWithoutChildren); + function element_colorChange() { + this.preExecute = function (context) { + context.oldColor = context.businessObject.pickedColor; + }; + this.execute = function (context) { + let semantic = context.businessObject; + let element = context.element; + semantic.pickedColor = context.newColor; + eventBus.fire("element.changed", { + element + }); + }; + this.revert = function (context) { + let semantic = context.businessObject; + let element = context.element; + semantic.pickedColor = context.oldColor; + eventBus.fire("element.changed", { + element + }); + }; + } + function removeGroupWithoutChildren() { + this.preExecute = function (ctx) { + ctx.parent = ctx.element.parent; + ctx.children = ctx.element.children.slice(); + }; + this.execute = function (ctx) { + let element = ctx.element; + ctx.children.forEach(child => { + (0,_util__WEBPACK_IMPORTED_MODULE_0__.undoGroupRework)(element, child); + eventBus.fire("element.changed", { + element: child + }); }); - changedIconSet.workObjects.keysArray().forEach(workObject => { - this.iconDictionaryService.registerIconForType(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.WORKOBJECT, workObject, this.iconDictionaryService.getFullDictionary().get(workObject)); - this.iconDictionaryService.unregisterIconForType(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_2__.ElementTypes.ACTOR, workObject); - this.setAsWorkobject(true, workObject); + eventBus.fire("shape.remove", { + element + }); + }; + this.revert = function (ctx) { + let element = ctx.element; + eventBus.fire("shape.added", { + element + }); + ctx.element.children.forEach(child => { + reworkGroupElements(element, child); }); - } - static #_ = this.ɵfac = function IconSetCustomizationService_Factory(t) { - return new (t || IconSetCustomizationService)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_3__.IconSetConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_4__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_Import_import_domain_story_service__WEBPACK_IMPORTED_MODULE_5__.ImportDomainStoryService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_Title_title_service__WEBPACK_IMPORTED_MODULE_6__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_BrowserStorage_storage_service__WEBPACK_IMPORTED_MODULE_7__.StorageService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_8__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__.MatSnackBar)); }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineInjectable"]({ - token: IconSetCustomizationService, - factory: IconSetCustomizationService.ɵfac, - providedIn: 'root' - }); } - return IconSetCustomizationService; -})(); +} /***/ }), -/***/ 23779: -/*!***************************************************************!*\ - !*** ./src/app/Service/Import/import-domain-story.service.ts ***! - \***************************************************************/ +/***/ 28126: +/*!*************************************************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/updateHandler/headlineAndDescriptionUpdateHandler.js ***! + \*************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ImportDomainStoryService: () => (/* binding */ ImportDomainStoryService) +/* harmony export */ "default": () => (/* binding */ headlineAndDescriptionUpdateHandler) /* harmony export */ }); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/dictionary/dictionary */ 54972); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var src_app_Domain_Icon_Set_Configuration_iconSetConfiguration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/Domain/Icon-Set-Configuration/iconSetConfiguration */ 77044); -/* harmony import */ var _Presentation_Dialog_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Presentation/Dialog/info-dialog/info-dialog.component */ 16266); -/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -/* harmony import */ var _Domain_Dialog_infoDialogData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Domain/Dialog/infoDialogData */ 45574); -/* harmony import */ var _Utils_sanitizer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Utils/sanitizer */ 66107); -/* harmony import */ var _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../Domain/Common/constants */ 90816); -/* harmony import */ var src_app_Service_IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/Service/IconSetConfiguration/icon-dictionary.service */ 93689); -/* harmony import */ var src_app_Service_Import_import_repair_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/Service/Import/import-repair.service */ 75158); -/* harmony import */ var src_app_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/Service/Title/title.service */ 69672); -/* harmony import */ var src_app_Service_Renderer_renderer_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! src/app/Service/Renderer/renderer.service */ 94896); -/* harmony import */ var _Dialog_dialog_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../Dialog/dialog.service */ 4730); -/* harmony import */ var _IconSetConfiguration_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../IconSetConfiguration/icon-set-configuration.service */ 10200); -/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); - - - - - - - - - - - - +/** + * a handler that updates the text of a BPMN element. + */ +function headlineAndDescriptionUpdateHandler(commandStack, titleService) { + commandStack.registerHandler("story.updateHeadlineAndDescription", handlerFunction); + function handlerFunction() { + this.execute = function (ctx) { + ctx.oldTitle = titleService.getTitle(); + ctx.oldDescription = titleService.getDescription(); + titleService.updateTitleAndDescription(ctx.newTitle, ctx.newDescription, false); + }; + this.revert = function (ctx) { + titleService.updateTitleAndDescription(ctx.oldTitle, ctx.oldDescription, false); + }; + } +} +/***/ }), +/***/ 16524: +/*!*******************************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/updateHandler/massRenameHandler.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ DSMassRenameHandler) +/* harmony export */ }); -let ImportDomainStoryService = /*#__PURE__*/(() => { - class ImportDomainStoryService { - constructor(iconDictionaryService, importRepairService, titleService, rendererService, dialogService, iconSetConfigurationService, snackbar) { - this.iconDictionaryService = iconDictionaryService; - this.importRepairService = importRepairService; - this.titleService = titleService; - this.rendererService = rendererService; - this.dialogService = dialogService; - this.iconSetConfigurationService = iconSetConfigurationService; - this.snackbar = snackbar; - this.title = _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_6__.INITIAL_TITLE; - this.description = _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_6__.INITIAL_DESCRIPTION; - this.importedConfiguration = null; - this.importedConfigurationEmitter = new _angular_core__WEBPACK_IMPORTED_MODULE_13__.EventEmitter(); - this.titleSubscription = this.titleService.title$.subscribe(title => { - this.title = title; - }); - this.descriptionSubscription = this.titleService.description$.subscribe(description => { - this.description = description; - }); - } - ngOnDestroy() { - this.titleSubscription.unsubscribe(); - this.descriptionSubscription.unsubscribe(); - } - get importedConfigurationEvent() { - return this.importedConfigurationEmitter.asObservable(); - } - getImportedConfiguration() { - const config = { - name: this.importedConfiguration?.name || '', - actors: this.importedConfiguration?.actors || new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(), - workObjects: this.importedConfiguration?.workObjects || new src_app_Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary() - }; - this.importedConfiguration = null; - return config; - } - importDST(input, filename, isSVG) { - const fileReader = new FileReader(); - const titleText = (0,_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_5__.restoreTitleFromFileName)(filename, isSVG); - // no need to put this on the commandStack - this.titleService.updateTitleAndDescription(titleText, null, false); - fileReader.onloadend = e => { - if (e && e.target) { - this.fileReaderFunction(e.target.result, isSVG, false); - } - }; - fileReader.readAsText(input); - } - importEGN(input, filename, isSVG) { - const fileReader = new FileReader(); - const titleText = (0,_Utils_sanitizer__WEBPACK_IMPORTED_MODULE_5__.restoreTitleFromFileName)(filename, isSVG); - // no need to put this on the commandStack - this.titleService.updateTitleAndDescription(titleText, null, false); - fileReader.onloadend = e => { - if (e && e.target) { - this.fileReaderFunction(e.target.result, isSVG, true); - } - }; - fileReader.readAsText(input); - } - fileReaderFunction(text, isSVG, isEGN) { - let dstText; - if (typeof text === 'string') { - if (isSVG) { - dstText = this.removeXMLComments(text); - } else { - dstText = text; - } - let elements; - let config; - let configFromFile; - let dstAndConfig = this.extractDstAndConfig(dstText, isSVG); - if (dstAndConfig == null) { - return; - } - // current implementation - if (dstAndConfig.domain) { - configFromFile = isEGN ? dstAndConfig.domain : JSON.parse(dstAndConfig.domain); - config = (0,src_app_Domain_Icon_Set_Configuration_iconSetConfiguration__WEBPACK_IMPORTED_MODULE_2__.fromConfigurationFromFile)(configFromFile); - elements = isEGN ? dstAndConfig.dst : JSON.parse(dstAndConfig.dst); - } else { - // legacy implementation - if (dstAndConfig.config) { - configFromFile = JSON.parse(dstAndConfig.config); - config = (0,src_app_Domain_Icon_Set_Configuration_iconSetConfiguration__WEBPACK_IMPORTED_MODULE_2__.fromConfigurationFromFile)(configFromFile); - elements = JSON.parse(dstAndConfig.dst); - } else { - // implementation prior to configuration - elements = JSON.parse(dstText); - config = this.iconSetConfigurationService.createMinimalConfigurationWithDefaultIcons(); - } - } - const configChanged = this.checkConfigForChanges(config); - let lastElement = elements[elements.length - 1]; - if (!lastElement.id) { - lastElement = elements.pop(); - let importVersionNumber = lastElement; - // if the last element has the importedVersionNumber has the tag version, - // then there exists another meta tag 'info' for the description - if (importVersionNumber.version) { - lastElement = elements.pop(); - } - if (importVersionNumber.version) { - importVersionNumber = importVersionNumber.version; - } else { - importVersionNumber = '?'; - this.snackbar.open(`The version number is unreadable.`, undefined, { - duration: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_6__.SNACKBAR_DURATION, - panelClass: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_6__.SNACKBAR_ERROR - }); - } - elements = this.handleVersionNumber(importVersionNumber, elements); - } - if (!this.importRepairService.checkForUnreferencedElementsInActivitiesAndRepair(elements)) { - this.showBrokenImportDialog(isSVG ? 'SVG' : 'DST'); - } - this.titleService.updateTitleAndDescription(this.title, lastElement.info, false); - this.importRepairService.adjustPositions(elements); - this.updateIconRegistries(elements, config); - this.rendererService.importStory(elements, configChanged, config); - } - } - handleVersionNumber(importVersionNumber, elements) { - const versionPrefix = +importVersionNumber.substring(0, importVersionNumber.lastIndexOf('.')); - if (versionPrefix <= 0.5) { - elements = this.importRepairService.updateCustomElementsPreviousV050(elements); - this.showPreviousV050Dialog(versionPrefix); - } - return elements; - } - extractDstAndConfig(dstText, isSVG) { - let dstAndConfig = null; - try { - dstAndConfig = JSON.parse(dstText); - } catch (e) { - this.showBrokenImportDialog(isSVG ? 'SVG' : 'DST'); - } - return dstAndConfig; - } - removeXMLComments(xmlText) { - xmlText = xmlText.substring(xmlText.indexOf('')); - while (xmlText.includes('')) { - xmlText = xmlText.replace('', ''); - } - xmlText = xmlText.replace('', ''); - xmlText = xmlText.replace('', ''); - return xmlText; - } - checkConfigForChanges(iconSetConfiguration) { - const newActorKeys = iconSetConfiguration.actors.keysArray(); - const newWorkObjectKeys = iconSetConfiguration.workObjects.keysArray(); - const currentActorKeys = this.iconDictionaryService.getTypeDictionaryKeys(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR); - const currentWorkobjectKeys = this.iconDictionaryService.getTypeDictionaryKeys(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT); - let changed = false; - if (newActorKeys.length !== currentActorKeys.length || newWorkObjectKeys.length !== currentWorkobjectKeys.length) { - return true; - } - for (let i = 0; i < newActorKeys.length; i++) { - changed = this.clearName(currentActorKeys[i]) !== this.clearName(newActorKeys[i]); - if (changed) { - i = newActorKeys.length; - } - } - if (changed) { - return changed; - } - for (let i = 0; i < newWorkObjectKeys.length; i++) { - changed = this.clearName(currentWorkobjectKeys[i]) !== this.clearName(newWorkObjectKeys[i]); - if (changed) { - i = newWorkObjectKeys.length; - } - } - return changed; - } - clearName(name) { - return name.replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR, '').replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT, ''); - } - updateIconRegistries(elements, config) { - const actorIcons = this.iconDictionaryService.getElementsOfType(elements, src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.ACTOR); - const workObjectIcons = this.iconDictionaryService.getElementsOfType(elements, src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.WORKOBJECT); - this.iconDictionaryService.updateIconRegistries(actorIcons, workObjectIcons, config); - this.setImportedConfigurationAndEmit(config); - } - showPreviousV050Dialog(version) { - const title = 'Compatability-Warning'; - const text = 'The uploaded Domain-Story is from version ' + version + '. There may be problems with the default actors or workobjects contained in the story.'; - const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_14__.MatDialogConfig(); - config.disableClose = false; - config.autoFocus = true; - config.data = new _Domain_Dialog_infoDialogData__WEBPACK_IMPORTED_MODULE_4__.InfoDialogData(title, text, true); - this.dialogService.openDialog(_Presentation_Dialog_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_3__.InfoDialogComponent, config); - } - setImportedConfigurationAndEmit(config) { - this.importedConfiguration = config; - this.importedConfigurationEmitter.emit(config); - } - showBrokenImportDialog(type) { - const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_14__.MatDialogConfig(); - config.disableClose = false; - config.autoFocus = true; - config.data = new _Domain_Dialog_infoDialogData__WEBPACK_IMPORTED_MODULE_4__.InfoDialogData('Error during import', 'The uploaded ' + type + ' is not complete, there could be elements missing from the canvas.', true, false); - this.dialogService.openDialog(_Presentation_Dialog_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_3__.InfoDialogComponent, config); - } - static #_ = this.ɵfac = function ImportDomainStoryService_Factory(t) { - return new (t || ImportDomainStoryService)(_angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵinject"](src_app_Service_IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_7__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵinject"](src_app_Service_Import_import_repair_service__WEBPACK_IMPORTED_MODULE_8__.ImportRepairService), _angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵinject"](src_app_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_9__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵinject"](src_app_Service_Renderer_renderer_service__WEBPACK_IMPORTED_MODULE_10__.RendererService), _angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵinject"](_Dialog_dialog_service__WEBPACK_IMPORTED_MODULE_11__.DialogService), _angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵinject"](_IconSetConfiguration_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_12__.IconSetConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵinject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_15__.MatSnackBar)); +function DSMassRenameHandler(commandStack, eventBus) { + commandStack.registerHandler("domainStoryObjects.massRename", massRename); + function massRename(modeling) { + this.preExecute = function (context) { + let relevantElements = context.elements; + context.oldLabel = relevantElements[0].businessObject.name; + relevantElements.forEach(element => { + modeling.updateLabel(element.businessObject, confirm.newValue); + }); + }; + this.execute = function (context) { + let relevantElements = context.elements; + relevantElements.forEach(element => { + let semantic = element.businessObject; + semantic.name = context.newValue; + eventBus.fire("element.changed", { + element + }); + }); + }; + this.revert = function (context) { + let relevantElements = context.elements; + relevantElements.forEach(element => { + let semantic = element.businessObject; + semantic.name = context.oldLabel; + eventBus.fire("element.changed", { + element + }); + }); }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵdefineInjectable"]({ - token: ImportDomainStoryService, - factory: ImportDomainStoryService.ɵfac, - providedIn: 'root' - }); } - return ImportDomainStoryService; -})(); +} /***/ }), -/***/ 75158: -/*!*********************************************************!*\ - !*** ./src/app/Service/Import/import-repair.service.ts ***! - \*********************************************************/ +/***/ 18911: +/*!********************************************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/updateHandler/updateLabelHandler.js ***! + \********************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ImportRepairService: () => (/* binding */ ImportRepairService) +/* harmony export */ "default": () => (/* binding */ UpdateLabelHandler) /* harmony export */ }); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../labeling/dsLabelUtil */ 13224); +/* harmony import */ var bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bpmn-js/lib/util/LabelUtil */ 50815); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util */ 20580); + + + + +const NULL_DIMENSIONS = { + width: 0, + height: 0 +}; /** - * Repairs broken Domain Stories so that it can be rendered onto the canvas - * by removing activities and connections that reference elements that don't exists + * a handler that updates the text of a BPMN element. */ -let ImportRepairService = /*#__PURE__*/(() => { - class ImportRepairService { - checkForUnreferencedElementsInActivitiesAndRepair(elements) { - const activities = []; - const objectIDs = []; - let complete = true; - elements.forEach(element => { - const type = element.type; - if (type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY || type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.CONNECTION) { - activities.push(element); - } else { - objectIDs.push(element.id); - } - }); - activities.forEach(activity => { - const source = activity.source; - const target = activity.target; - if (!objectIDs.includes(source) || !objectIDs.includes(target)) { - complete = false; - const activityIndex = elements.indexOf(activity); - elements = elements.splice(activityIndex, 1); - } - }); - return complete; - } +function UpdateLabelHandler(modeling, textRenderer, commandStack) { + commandStack.registerHandler("element.updateCustomLabel", handlerFunction); + function handlerFunction() { /** - * Ensure backwards compatibility. - * Previously Document had no special name and was just addressed as workObject - * Bubble was renamed to Conversation + * Set the label and return the changed elements. + * + * Element parameter can be label itself or connection (i.e. sequence flow). + * + * @param {djs.model.Base} element + * @param {String} text */ - updateCustomElementsPreviousV050(elements) { - for (const element of elements) { - if (element.type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT) { - element.type = src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT + 'Document'; - } else if (element.type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT + 'Bubble') { - element.type = src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT + 'Conversation'; - } + this.preExecute = function (ctx) { + let element = ctx.element, + businessObject = element.businessObject, + newLabel = ctx.newLabel, + newNumber = ctx.newNumber; + if (!(0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.isLabel)(element) && (0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.isLabelExternal)(element) && !(0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.hasExternalLabel)(element) && (newLabel !== "" || newNumber !== "")) { + // create label + let paddingTop = 7; + let labelCenter = (0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.getExternalLabelMid)(element); + labelCenter = { + x: labelCenter.x, + y: labelCenter.y + paddingTop + }; + modeling.createLabel(element, labelCenter, { + id: businessObject.id + "_label", + businessObject: businessObject + }); } - return elements; - } - /** - * Adjusts Positions of Elements to ensure the Domain Story starts in the visible parts of the canvas - */ - adjustPositions(elements) { - let xLeft = 0; - let yUp = 0; - let isFirst = true; - this.findFirstElement(elements, isFirst, xLeft, yUp); - if (xLeft < 75 || xLeft > 150 || yUp < 0 || yUp > 50) { - // add Padding for the Palette and the top - xLeft -= 75; - yUp -= 50; - elements.forEach(element => this.adjustElementPosition(element, xLeft, yUp)); + }; + this.execute = function (ctx) { + ctx.oldLabel = (0,_labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.getLabel)(ctx.element); + ctx.oldNumber = (0,_labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.getNumber)(ctx.element); + return setText(ctx.element, ctx.newLabel, ctx.newNumber); + }; + this.revert = function (ctx) { + return setText(ctx.element, ctx.oldLabel, ctx.oldNumber); + }; + this.postExecute = function (ctx) { + let element = ctx.element, + label = element.label || element, + newLabel = ctx.newLabel, + newBounds = ctx.newBounds; + if ((0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.isLabel)(label) && newLabel.trim() === "") { + modeling.removeShape(label); + return; } - } - adjustElementPosition(element, xLeft, yUp) { - if (element.type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY || element.type === src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.CONNECTION) { - const waypoints = element.waypoints; - waypoints.forEach(point => { - point.x -= xLeft; - point.y -= yUp; - if (point.original) { - point.original.x = point.x; - point.original.y = point.y; - } - }); - } else { - element.x -= xLeft; - element.y -= yUp; + // ignore internal labels for elements except text annotations + if (!(0,bpmn_js_lib_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.isLabelExternal)(element) && !(0,_util__WEBPACK_IMPORTED_MODULE_2__.is)(element, src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_1__.ElementTypes.TEXTANNOTATION)) { + return; } - } - findFirstElement(elements, isFirst, xLeft, yUp) { - elements.forEach(element => { - let elXLeft; - let elYUp; - if (element.type !== src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY && element.type !== src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.CONNECTION) { - if (isFirst) { - xLeft = element.x; - yUp = element.y; - isFirst = false; - } - elXLeft = element.x; - elYUp = element.y; - if (elXLeft < xLeft) { - xLeft = elXLeft; - } - if (elYUp < yUp) { - yUp = elYUp; + let bo = (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(label); + let text = bo.name || bo.text; + // don't resize without text + if (!text) { + return; + } + // resize element based on label _or_ pre-defined bounds + if (typeof newBounds === "undefined") { + newBounds = textRenderer.getLayoutedBounds(label, text); + } + // setting newBounds to false or _null_ will + // disable the postExecute resize operation + if (newBounds) { + modeling.resizeShape(label, newBounds, NULL_DIMENSIONS); + } + }; + } +} +function setText(element, text, textNumber) { + // external label if present + let label = element.label || element; + let number = element.number || element; + let labelTarget = element.labelTarget || element; + let numberTarget = element.numberTarget || element; + (0,_labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.setLabel)(label, text); + (0,_labeling_dsLabelUtil__WEBPACK_IMPORTED_MODULE_0__.setNumber)(number, textNumber); + return [label, labelTarget, number, numberTarget]; +} +UpdateLabelHandler.$inject = ["modeling", "textRenderer", "commandStack"]; + +/***/ }), + +/***/ 20580: +/*!****************************************************!*\ + !*** ./src/app/tools/modeler/bpmn/modeler/util.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getBusinessObject: () => (/* binding */ getBusinessObject), +/* harmony export */ is: () => (/* binding */ is), +/* harmony export */ isAny: () => (/* binding */ isAny), +/* harmony export */ isCustomIcon: () => (/* binding */ isCustomIcon), +/* harmony export */ isCustomSvgIcon: () => (/* binding */ isCustomSvgIcon), +/* harmony export */ reworkGroupElements: () => (/* binding */ reworkGroupElements), +/* harmony export */ undoGroupRework: () => (/* binding */ undoGroupRework) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ 93673); + +function is(element, type) { + const bo = getBusinessObject(element); + return bo && typeof bo.$instanceOf == "function" && bo.$instanceOf(type); +} +function getBusinessObject(element) { + return element && element.businessObject || element; +} +function isAny(element, types) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.some)(types, function (t) { + return is(element, t); + }); +} +function reworkGroupElements(parent, shape) { + parent.children.slice().forEach(innerShape => { + if (innerShape.id !== shape.id) { + if (innerShape.x >= shape.x && innerShape.x <= shape.x + shape.width) { + if (innerShape.y >= shape.y && innerShape.y <= shape.y + shape.height) { + innerShape.parent = shape; + if (!shape.children.includes(innerShape)) { + shape.children.push(innerShape); } } - }); + } } - static #_ = this.ɵfac = function ImportRepairService_Factory(t) { - return new (t || ImportRepairService)(); - }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ - token: ImportRepairService, - factory: ImportRepairService.ɵfac, - providedIn: 'root' + }); +} +function undoGroupRework(parent, shape) { + const superParent = parent.parent; + parent.children.remove(shape); + superParent.children.add(shape); + shape.parent = superParent; + const svgShape = document.querySelector("[data-element-id=" + shape.id + "]").parentElement; + const svgGroup = svgShape.parentElement; + const svgGroupParent = svgGroup.parentElement.parentElement; + svgGroup.removeChild(svgShape); + svgGroupParent.appendChild(svgShape); +} +function isCustomIcon(icon) { + // default icons are provided as SVG + // custom icons are provided as "Data URL" with a base64-encoded image as payload + return icon.startsWith("data"); +} +function isCustomSvgIcon(icon) { + // default icons are provided as SVG + // custom icons are provided as "Data URL" with a base64-encoded image as payload + return icon.startsWith("data:image/svg"); +} + +/***/ }), + +/***/ 40955: +/*!**************************************************************!*\ + !*** ./src/app/tools/modeler/domain/activity-dialog-form.ts ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ ActivityDialogForm: () => (/* binding */ ActivityDialogForm) +/* harmony export */ }); +/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/forms */ 37222); + +var ActivityDialogForm; +(function (ActivityDialogForm) { + function create(activityLabel, activityNumber, numberIsAllowedMultipleTimes) { + return new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormGroup({ + activityLabel: new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormControl(activityLabel, { + nonNullable: true + }), + activityNumber: new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormControl(activityNumber, [_angular_forms__WEBPACK_IMPORTED_MODULE_0__.Validators.required]), + multipleNumbers: new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormControl(numberIsAllowedMultipleTimes, { + nonNullable: true + }) }); } - return ImportRepairService; -})(); + ActivityDialogForm.create = create; +})(ActivityDialogForm || (ActivityDialogForm = {})); /***/ }), -/***/ 59783: -/*!*********************************************************************!*\ - !*** ./src/app/Service/LabelDictionary/label-dictionary.service.ts ***! - \*********************************************************************/ +/***/ 13547: +/*!************************************************************!*\ + !*** ./src/app/tools/modeler/domain/activityDialogData.ts ***! + \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ LabelDictionaryService: () => (/* binding */ LabelDictionaryService) +/* harmony export */ ActivityDialogData: () => (/* binding */ ActivityDialogData) /* harmony export */ }); -/* harmony import */ var src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Domain/Common/elementTypes */ 30236); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var src_app_Service_LabelDictionary_mass_naming_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Service/LabelDictionary/mass-naming.service */ 37509); -/* harmony import */ var src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/Service/ElementRegistry/element-registry.service */ 67613); -/* harmony import */ var _IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../IconSetConfiguration/icon-dictionary.service */ 93689); +class ActivityDialogData { + constructor(activity, numberIsAllowedMultipleTimes, showNumberFields, saveFN) { + this.activity = activity; + this.numberIsAllowedMultipleTimes = numberIsAllowedMultipleTimes; + this.showNumberFields = showNumberFields; + this.saveFN = saveFN; + } +} + +/***/ }), + +/***/ 89142: +/*!*****************************************************************************************!*\ + !*** ./src/app/tools/modeler/presentation/activity-dialog/activity-dialog.component.ts ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ ActivityDialogComponent: () => (/* binding */ ActivityDialogComponent) +/* harmony export */ }); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +/* harmony import */ var _domain_activity_dialog_form__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../domain/activity-dialog-form */ 40955); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/forms */ 37222); +/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/button */ 72221); +/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/form-field */ 29344); +/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/input */ 92583); +/* harmony import */ var src_app_tools_modeler_domain_activityDialogData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/tools/modeler/domain/activityDialogData */ 13547); -let LabelDictionaryService = /*#__PURE__*/(() => { - class LabelDictionaryService { - constructor(massNamingService, elementRegistryService, iconDictionaryService) { - this.massNamingService = massNamingService; - this.elementRegistryService = elementRegistryService; - this.iconDictionaryService = iconDictionaryService; - this.activityLabels = []; - this.workObjektLabels = []; - } - createLabelDictionaries() { - this.activityLabels = []; - this.workObjektLabels = []; - const allObjects = this.elementRegistryService.getAllCanvasObjects(); - allObjects.forEach(element => { - const name = element.businessObject.name; - if (name && name.length > 0 && element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY) && !this.activityLabels.map(a => a.name).includes(name)) { - this.activityLabels.push({ - name, - originalName: name - }); - } else if (name && name.length > 0 && element.type.includes(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT) && !this.workObjektLabels.map(e => e.name).includes(name)) { - const iconName = element.type.replace(src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT, ''); - let icon = this.iconDictionaryService.getIconSource(iconName); - if (!icon) { - return; - } - if (!icon.startsWith('data')) { - icon = 'data:image/svg+xml,' + icon; + + + + +let ActivityDialogComponent = /*#__PURE__*/(() => { + class ActivityDialogComponent { + constructor(dialogRef, data) { + this.dialogRef = dialogRef; + this.activity = data.activity; + this.activityLabel = data.activity.businessObject.name; + this.numberIsAllowedMultipleTimes = data.numberIsAllowedMultipleTimes; + this.activityNumber = data.activity.businessObject.number ?? null; + this.showNumberFields = data.showNumberFields; + this.saveFN = data.saveFN; + this.form = _domain_activity_dialog_form__WEBPACK_IMPORTED_MODULE_0__.ActivityDialogForm.create(this.activityLabel, this.activityNumber, this.numberIsAllowedMultipleTimes); + this.form.controls.activityNumber.valueChanges.subscribe(activityNumber => { + if (activityNumber !== null) { + if (activityNumber < 1) { + this.form.controls.activityNumber.setValue(1); } - this.workObjektLabels.push({ - name, - originalName: name, - icon - }); } }); - this.activityLabels.sort((a, b) => { - return a.name.toLowerCase().localeCompare(b.name.toLowerCase()); - }); - this.workObjektLabels.sort((a, b) => { - return a.name.toLowerCase().localeCompare(b.name.toLowerCase()); + } + onSubmit() { + this.numberIsAllowedMultipleTimes = !this.numberIsAllowedMultipleTimes; + this.form.patchValue({ + multipleNumbers: this.numberIsAllowedMultipleTimes }); } - getActivityLabels() { - return this.activityLabels.slice(); + save() { + this.saveFN({ + activity: this.activity, + ...this.form.value + }); + this.dialogRef.close(); } - getWorkObjectLabels() { - return this.workObjektLabels.slice(); + close() { + this.dialogRef.close(); } - getUniqueWorkObjectNames() { - const workObjects = this.elementRegistryService.getAllWorkobjects(); - return [...new Set(workObjects.filter(workObject => { - return !!workObject.businessObject.name; - }).map(workObject => workObject.businessObject.name))]; + preventDefault(event) { + event.preventDefault(); } - massRenameLabels(activityNames, originalActivityNames, workObjectNames, originalWorkObjectNames) { - for (let i = 0; i < originalActivityNames.length; i++) { - if (!activityNames[i]) { - activityNames[i] = ''; - } - if (!(activityNames[i] == originalActivityNames[i])) { - this.massNamingService.massChangeNames(originalActivityNames[i], activityNames[i], src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY); - } - } - for (let i = 0; i < originalWorkObjectNames.length; i++) { - if (!workObjectNames[i]) { - workObjectNames[i] = ''; + static #_ = this.ɵfac = function ActivityDialogComponent_Factory(t) { + return new (t || ActivityDialogComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MatDialogRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MAT_DIALOG_DATA)); + }; + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ + type: ActivityDialogComponent, + selectors: [["app-activity-dialog"]], + decls: 20, + vars: 2, + consts: [[3, "formGroup"], [3, "hidden"], [1, "shortWidth"], ["matInput", "", "type", "number", "formControlName", "activityNumber"], ["type", "checkbox", "formControlName", "multipleNumbers", 3, "change"], [1, "fullWidth"], ["matInput", "", "type", "text", "formControlName", "activityLabel", "autofocus", "", "cdkFocusInitial", "", 3, "keydown.enter", "keyup.enter", "keyup.escape"], ["mat-flat-button", "", 3, "click"], ["mat-flat-button", "", "color", "primary", 3, "click"]], + template: function ActivityDialogComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "mat-dialog-content")(1, "h2"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](2, "Edit Activity"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](3, "form", 0)(4, "div", 1)(5, "mat-form-field", 2)(6, "mat-label"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](7, "Number"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](8, "input", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](9, "input", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("change", function ActivityDialogComponent_Template_input_change_9_listener() { + return ctx.onSubmit(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](10, " multiple "); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](11, "mat-form-field", 5)(12, "mat-label"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](13, "Label"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](14, "textarea", 6); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("keydown.enter", function ActivityDialogComponent_Template_textarea_keydown_enter_14_listener($event) { + return ctx.preventDefault($event); + })("keyup.enter", function ActivityDialogComponent_Template_textarea_keyup_enter_14_listener() { + return ctx.save(); + })("keyup.escape", function ActivityDialogComponent_Template_textarea_keyup_escape_14_listener() { + return ctx.close(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()()()(); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](15, "mat-dialog-actions")(16, "button", 7); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function ActivityDialogComponent_Template_button_click_16_listener() { + return ctx.close(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](17, "Cancel"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](18, "button", 8); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function ActivityDialogComponent_Template_button_click_18_listener() { + return ctx.save(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](19, "Save"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); } - if (!(workObjectNames[i] == originalWorkObjectNames[i])) { - this.massNamingService.massChangeNames(originalWorkObjectNames[i], workObjectNames[i], src_app_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT); + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("formGroup", ctx.form); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("hidden", !ctx.showNumberFields); } - } - } - static #_ = this.ɵfac = function LabelDictionaryService_Factory(t) { - return new (t || LabelDictionaryService)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](src_app_Service_LabelDictionary_mass_naming_service__WEBPACK_IMPORTED_MODULE_1__.MassNamingService), _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_2__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](_IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_3__.IconDictionaryService)); - }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ - token: LabelDictionaryService, - factory: LabelDictionaryService.ɵfac, - providedIn: 'root' + }, + dependencies: [_angular_forms__WEBPACK_IMPORTED_MODULE_4__["ɵNgNoValidate"], _angular_forms__WEBPACK_IMPORTED_MODULE_4__.DefaultValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NumberValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.CheckboxControlValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NgControlStatusGroup, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.FormGroupDirective, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.FormControlName, _angular_material_button__WEBPACK_IMPORTED_MODULE_5__.MatButton, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MatDialogActions, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_3__.MatDialogContent, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatFormField, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatLabel, _angular_material_input__WEBPACK_IMPORTED_MODULE_7__.MatInput], + styles: [".shortWidth[_ngcontent-%COMP%] {\n width: 200px;\n}\n\n.fullWidth[_ngcontent-%COMP%] {\n width: 100%;\n}\n\n .mat-form-field-label {\n font-size: 12pt !important;\n}"] }); } - return LabelDictionaryService; + return ActivityDialogComponent; })(); /***/ }), -/***/ 37509: -/*!****************************************************************!*\ - !*** ./src/app/Service/LabelDictionary/mass-naming.service.ts ***! - \****************************************************************/ +/***/ 87286: +/*!*************************************************************************!*\ + !*** ./src/app/tools/modeler/presentation/modeler/modeler.component.ts ***! + \*************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ MassNamingService: () => (/* binding */ MassNamingService) +/* harmony export */ ModelerComponent: () => (/* binding */ ModelerComponent) /* harmony export */ }); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Service/ElementRegistry/element-registry.service */ 67613); -/* harmony import */ var _CommandStack_command_stack_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../CommandStack/command-stack.service */ 19381); - +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _services_modeler_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/modeler.service */ 40439); -let MassNamingService = /*#__PURE__*/(() => { - class MassNamingService { - constructor(elementRegistryService, commandStackService) { - this.elementRegistryService = elementRegistryService; - this.commandStackService = commandStackService; +let ModelerComponent = /*#__PURE__*/(() => { + class ModelerComponent { + constructor(modelerService) { + this.modelerService = modelerService; } - massChangeNames(oldValue, newValue, type) { - const allRelevantObjects = []; - this.elementRegistryService.getAllCanvasObjects().forEach(element => { - if (element.type.includes(type) && element.businessObject.name === oldValue) { - allRelevantObjects.push(element); - } - }); - const context = { - elements: allRelevantObjects, - newValue - }; - this.commandStackService.execute('domainStoryObjects.massRename', context); + ngOnInit() { + this.modelerService.postInit(); } - static #_ = this.ɵfac = function MassNamingService_Factory(t) { - return new (t || MassNamingService)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_0__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_CommandStack_command_stack_service__WEBPACK_IMPORTED_MODULE_1__.CommandStackService)); + static #_ = this.ɵfac = function ModelerComponent_Factory(t) { + return new (t || ModelerComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_services_modeler_service__WEBPACK_IMPORTED_MODULE_0__.ModelerService)); }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ - token: MassNamingService, - factory: MassNamingService.ɵfac, - providedIn: 'root' + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ + type: ModelerComponent, + selectors: [["app-modeler"]], + decls: 1, + vars: 0, + consts: [["id", "canvas"]], + template: function ModelerComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](0, "div", 0); + } + }, + styles: ["#canvas[_ngcontent-%COMP%], #canvas[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] {\n top: 0;\n width: 100%;\n height: 100%;\n position: relative;\n bottom: 0;\n overflow: hidden;\n}"] }); } - return MassNamingService; + return ModelerComponent; })(); /***/ }), -/***/ 33666: -/*!********************************************************!*\ - !*** ./src/app/Service/Modeler/initializer.service.ts ***! - \********************************************************/ +/***/ 52317: +/*!***************************************************************!*\ + !*** ./src/app/tools/modeler/services/initializer.service.ts ***! + \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -73519,41 +72957,23 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ InitializerService: () => (/* binding */ InitializerService) /* harmony export */ }); -/* harmony import */ var _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Domain/Common/elementTypes */ 30236); -/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -/* harmony import */ var _Domain_Dialog_activityDialogData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Domain/Dialog/activityDialogData */ 93703); -/* harmony import */ var _Presentation_Dialog_activity_dialog_activity_dialog_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Presentation/Dialog/activity-dialog/activity-dialog.component */ 63954); -/* harmony import */ var _Utils_mathExtensions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Utils/mathExtensions */ 114); -/* harmony import */ var _BPMN_JS_modeler_context_pad_domainStoryContextPadProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../BPMN-JS/modeler/context-pad/domainStoryContextPadProvider */ 74669); -/* harmony import */ var _BPMN_JS_modeler_updateHandler_activityUpdateHandlers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../BPMN-JS/modeler/updateHandler/activityUpdateHandlers */ 96588); -/* harmony import */ var _BPMN_JS_modeler_updateHandler_elementUpdateHandler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../BPMN-JS/modeler/updateHandler/elementUpdateHandler */ 11118); -/* harmony import */ var _BPMN_JS_modeler_updateHandler_headlineAndDescriptionUpdateHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../BPMN-JS/modeler/updateHandler/headlineAndDescriptionUpdateHandler */ 65501); -/* harmony import */ var _BPMN_JS_modeler_palette_domainStoryPalette__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../BPMN-JS/modeler/palette/domainStoryPalette */ 84277); -/* harmony import */ var _BPMN_JS_modeler_domainStoryRenderer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../BPMN-JS/modeler/domainStoryRenderer */ 37751); -/* harmony import */ var _BPMN_JS_modeler_labeling_dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../BPMN-JS/modeler/labeling/dsLabelEditingProvider */ 50572); -/* harmony import */ var _BPMN_JS_modeler_change_icon_replaceOptions__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../BPMN-JS/modeler/change-icon/replaceOptions */ 66252); -/* harmony import */ var _BPMN_JS_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../BPMN-JS/modeler/numbering/numbering */ 37126); -/* harmony import */ var _BPMN_JS_modeler_updateHandler_massRenameHandler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../BPMN-JS/modeler/updateHandler/massRenameHandler */ 74431); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _DirtyFlag_dirty_flag_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../DirtyFlag/dirty-flag.service */ 89791); -/* harmony import */ var _IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../IconSetConfiguration/icon-dictionary.service */ 93689); -/* harmony import */ var _ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../ElementRegistry/element-registry.service */ 67613); -/* harmony import */ var _IconSetConfiguration_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../IconSetConfiguration/icon-set-configuration.service */ 10200); -/* harmony import */ var _LabelDictionary_label_dictionary_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../LabelDictionary/label-dictionary.service */ 59783); -/* harmony import */ var _Replay_replay_state_service__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../Replay/replay-state.service */ 67820); -/* harmony import */ var _Dialog_dialog_service__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../Dialog/dialog.service */ 4730); -/* harmony import */ var _CommandStack_command_stack_service__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../CommandStack/command-stack.service */ 19381); -/* harmony import */ var _Title_title_service__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../Title/title.service */ 69672); -/* harmony import */ var _Export_html_presentation_service__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../Export/html-presentation.service */ 72680); - - - - - - - - - +/* harmony import */ var _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../domain/entities/elementTypes */ 73190); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +/* harmony import */ var _domain_activityDialogData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../domain/activityDialogData */ 13547); +/* harmony import */ var _presentation_activity_dialog_activity_dialog_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../presentation/activity-dialog/activity-dialog.component */ 89142); +/* harmony import */ var _utils_mathExtensions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/mathExtensions */ 67858); +/* harmony import */ var _bpmn_modeler_labeling_dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../bpmn/modeler/labeling/dsLabelEditingProvider */ 64467); +/* harmony import */ var _bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../bpmn/modeler/numbering/numbering */ 14945); +/* harmony import */ var _bpmn_modeler_updateHandler_activityUpdateHandlers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../bpmn/modeler/updateHandler/activityUpdateHandlers */ 56185); +/* harmony import */ var _bpmn_modeler_updateHandler_massRenameHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../bpmn/modeler/updateHandler/massRenameHandler */ 16524); +/* harmony import */ var _bpmn_modeler_updateHandler_elementUpdateHandler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../bpmn/modeler/updateHandler/elementUpdateHandler */ 87147); +/* harmony import */ var _bpmn_modeler_updateHandler_headlineAndDescriptionUpdateHandler__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../bpmn/modeler/updateHandler/headlineAndDescriptionUpdateHandler */ 28126); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../domain/services/element-registry.service */ 85511); +/* harmony import */ var _replay_services_replay_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../replay/services/replay.service */ 3687); +/* harmony import */ var _domain_services_dialog_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../domain/services/dialog.service */ 12855); +/* harmony import */ var _domain_services_command_stack_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../domain/services/command-stack.service */ 96445); +/* harmony import */ var _title_services_title_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../title/services/title.service */ 41535); @@ -73573,49 +72993,32 @@ __webpack_require__.r(__webpack_exports__); let InitializerService = /*#__PURE__*/(() => { class InitializerService { - constructor(dirtyFlagService, iconDictionaryService, elementRegistryService, configurationService, labelDictionaryService, replayStateService, dialogService, commandStackService, titleService, htmlPresentationService) { - this.dirtyFlagService = dirtyFlagService; - this.iconDictionaryService = iconDictionaryService; + constructor(elementRegistryService, replayService, dialogService, commandStackService, titleService) { this.elementRegistryService = elementRegistryService; - this.configurationService = configurationService; - this.labelDictionaryService = labelDictionaryService; - this.replayStateService = replayStateService; + this.replayService = replayService; this.dialogService = dialogService; this.commandStackService = commandStackService; this.titleService = titleService; - this.htmlPresentationService = htmlPresentationService; - } - initializeDomainStoryModelerClasses() { - (0,_BPMN_JS_modeler_context_pad_domainStoryContextPadProvider__WEBPACK_IMPORTED_MODULE_4__.initializeContextPadProvider)(this.dirtyFlagService, this.iconDictionaryService); - /** The Palette and the Context Menu need the Icons present in the Domain, - * so the IconDictionaryService and the IconSetConfigurationService needs to be given to the Palette **/ - (0,_BPMN_JS_modeler_palette_domainStoryPalette__WEBPACK_IMPORTED_MODULE_8__.initializePalette)(this.iconDictionaryService, this.configurationService); - (0,_BPMN_JS_modeler_domainStoryRenderer__WEBPACK_IMPORTED_MODULE_9__.initializeRenderer)(this.iconDictionaryService, this.elementRegistryService, this.dirtyFlagService); - (0,_BPMN_JS_modeler_labeling_dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_10__.initializeLabelEditingProvider)(this.labelDictionaryService); - (0,_BPMN_JS_modeler_change_icon_replaceOptions__WEBPACK_IMPORTED_MODULE_11__.initializeReplaceOptions)(this.iconDictionaryService); - (0,_BPMN_JS_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_12__.initializeNumbering)(this.elementRegistryService); - (0,_BPMN_JS_modeler_updateHandler_activityUpdateHandlers__WEBPACK_IMPORTED_MODULE_5__.initializeActivityUpdateHandler)(this.elementRegistryService); } propagateDomainStoryModelerClassesToServices(commandStack, elementRegistry, canvas, selection, modeler) { this.commandStackService.setCommandStack(commandStack); this.elementRegistryService.setElementRegistry(elementRegistry); - this.htmlPresentationService.setModelerClasses(canvas, selection, modeler); } initializeDomainStoryModelerEventHandlers(commandStack, eventBus) { - (0,_BPMN_JS_modeler_updateHandler_activityUpdateHandlers__WEBPACK_IMPORTED_MODULE_5__["default"])(commandStack, eventBus); - (0,_BPMN_JS_modeler_updateHandler_massRenameHandler__WEBPACK_IMPORTED_MODULE_13__["default"])(commandStack, eventBus); - (0,_BPMN_JS_modeler_updateHandler_elementUpdateHandler__WEBPACK_IMPORTED_MODULE_6__["default"])(commandStack, eventBus); - (0,_BPMN_JS_modeler_updateHandler_headlineAndDescriptionUpdateHandler__WEBPACK_IMPORTED_MODULE_7__["default"])(commandStack, this.titleService); + (0,_bpmn_modeler_updateHandler_activityUpdateHandlers__WEBPACK_IMPORTED_MODULE_6__["default"])(commandStack, eventBus); + (0,_bpmn_modeler_updateHandler_massRenameHandler__WEBPACK_IMPORTED_MODULE_7__["default"])(commandStack, eventBus); + (0,_bpmn_modeler_updateHandler_elementUpdateHandler__WEBPACK_IMPORTED_MODULE_8__["default"])(commandStack, eventBus); + (0,_bpmn_modeler_updateHandler_headlineAndDescriptionUpdateHandler__WEBPACK_IMPORTED_MODULE_9__["default"])(commandStack, this.titleService); } initiateEventBusListeners(eventBus, commandStack) { eventBus.on('element.dblclick', e => { - if (!this.replayStateService.getReplayOn()) { + if (!this.replayService.getReplayOn()) { const element = e.element; - if (element.type === _Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY) { + if (element.type === _domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY) { // override the doubleClickListener on activities this.activityDoubleClick(element, eventBus, commandStack); } else { - const renderedNumberRegistry = (0,_BPMN_JS_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_12__.getNumberRegistry)(); + const renderedNumberRegistry = (0,_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_5__.getNumberRegistry)(); // add a DoubleClickListener to the number on activities if (renderedNumberRegistry.length > 1) { const allActivities = this.elementRegistryService.getActivitiesFromActors(); @@ -73658,7 +73061,7 @@ let InitializerService = /*#__PURE__*/(() => { allActivities.forEach(activity => { const activityNumber = activity.businessObject.number; if (activityNumber === tNumber) { - if ((0,_Utils_mathExtensions__WEBPACK_IMPORTED_MODULE_3__.positionsMatch)(width, height, elementX, elementY, clickX, clickY)) { + if ((0,_utils_mathExtensions__WEBPACK_IMPORTED_MODULE_3__.positionsMatch)(width, height, elementX, elementY, clickX, clickY)) { this.activityDoubleClick(activity, eventBus, commandStack); } } @@ -73673,7 +73076,7 @@ let InitializerService = /*#__PURE__*/(() => { }); // when in replay, do not allow any interaction on the canvas eventBus.on(['element.click', 'element.dblclick', 'element.mousedown', 'drag.init', 'canvas.viewbox.changing', 'autoPlace', 'popupMenu.open'], 10000000000, event => { - if (this.replayStateService.getReplayOn()) { + if (this.replayService.getReplayOn()) { event.stopPropagation(); event.preventDefault(); } @@ -73683,16 +73086,16 @@ let InitializerService = /*#__PURE__*/(() => { activityDoubleClick(activity, eventBus, commandStack) { const source = activity.source; // ensure the right number when changing the direction of an activity - (0,_BPMN_JS_modeler_labeling_dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_10__.toggleStashUse)(false); - const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_24__.MatDialogConfig(); + (0,_bpmn_modeler_labeling_dsLabelEditingProvider__WEBPACK_IMPORTED_MODULE_4__.toggleStashUse)(false); + const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_15__.MatDialogConfig(); config.disableClose = false; config.autoFocus = true; - if (activity.businessObject.number && source && source.type.includes(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR)) { - config.data = new _Domain_Dialog_activityDialogData__WEBPACK_IMPORTED_MODULE_1__.ActivityDialogData(activity, (0,_BPMN_JS_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_12__.getMultipleNumberRegistry)()[activity.businessObject.number], true, data => this.saveActivityInputLabel(data, eventBus, commandStack)); - } else if (source && source.type.includes(_Domain_Common_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT)) { - config.data = new _Domain_Dialog_activityDialogData__WEBPACK_IMPORTED_MODULE_1__.ActivityDialogData(activity, false, false, activityData => this.saveActivityInputLabel(activityData, eventBus, commandStack)); + if (activity.businessObject.number && source && source.type.includes(_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTOR)) { + config.data = new _domain_activityDialogData__WEBPACK_IMPORTED_MODULE_1__.ActivityDialogData(activity, (0,_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_5__.getMultipleNumberRegistry)()[activity.businessObject.number], true, data => this.saveActivityInputLabel(data, eventBus, commandStack)); + } else if (source && source.type.includes(_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.WORKOBJECT)) { + config.data = new _domain_activityDialogData__WEBPACK_IMPORTED_MODULE_1__.ActivityDialogData(activity, false, false, activityData => this.saveActivityInputLabel(activityData, eventBus, commandStack)); } - this.dialogService.openDialog(_Presentation_Dialog_activity_dialog_activity_dialog_component__WEBPACK_IMPORTED_MODULE_2__.ActivityDialogComponent, config); + this.dialogService.openDialog(_presentation_activity_dialog_activity_dialog_component__WEBPACK_IMPORTED_MODULE_2__.ActivityDialogComponent, config); } saveActivityInputLabel(activityData, eventBus, commandStack) { const label = activityData.activityLabel; @@ -73704,7 +73107,7 @@ let InitializerService = /*#__PURE__*/(() => { const index = activitiesFromActors.indexOf(element); activitiesFromActors.splice(index, 1); if (hasNumber) { - (0,_BPMN_JS_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_12__.setNumberIsMultiple)(activityNumber, multipleNumberAllowed); + (0,_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_5__.setNumberIsMultiple)(activityNumber, multipleNumberAllowed); } element.businessObject.multipleNumberAllowed = multipleNumberAllowed; let options; @@ -73724,17 +73127,17 @@ let InitializerService = /*#__PURE__*/(() => { } commandStack.execute('activity.changed', options); if (element.businessObject.multipleNumberAllowed !== false) { - if ((0,_BPMN_JS_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_12__.getMultipleNumberRegistry)()[activityNumber] === false) { - (0,_BPMN_JS_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_12__.updateExistingNumbersAtEditing)(activitiesFromActors, activityNumber, eventBus); + if ((0,_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_5__.getMultipleNumberRegistry)()[activityNumber] === false) { + (0,_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_5__.updateExistingNumbersAtEditing)(activitiesFromActors, activityNumber, eventBus); } } else if (element.businessObject.multipleNumberAllowed === false) { - (0,_BPMN_JS_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_12__.updateExistingNumbersAtEditing)(activitiesFromActors, activityNumber, eventBus); + (0,_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_5__.updateExistingNumbersAtEditing)(activitiesFromActors, activityNumber, eventBus); } } static #_ = this.ɵfac = function InitializerService_Factory(t) { - return new (t || InitializerService)(_angular_core__WEBPACK_IMPORTED_MODULE_25__["ɵɵinject"](_DirtyFlag_dirty_flag_service__WEBPACK_IMPORTED_MODULE_14__.DirtyFlagService), _angular_core__WEBPACK_IMPORTED_MODULE_25__["ɵɵinject"](_IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_15__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_25__["ɵɵinject"](_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_16__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_25__["ɵɵinject"](_IconSetConfiguration_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_17__.IconSetConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_25__["ɵɵinject"](_LabelDictionary_label_dictionary_service__WEBPACK_IMPORTED_MODULE_18__.LabelDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_25__["ɵɵinject"](_Replay_replay_state_service__WEBPACK_IMPORTED_MODULE_19__.ReplayStateService), _angular_core__WEBPACK_IMPORTED_MODULE_25__["ɵɵinject"](_Dialog_dialog_service__WEBPACK_IMPORTED_MODULE_20__.DialogService), _angular_core__WEBPACK_IMPORTED_MODULE_25__["ɵɵinject"](_CommandStack_command_stack_service__WEBPACK_IMPORTED_MODULE_21__.CommandStackService), _angular_core__WEBPACK_IMPORTED_MODULE_25__["ɵɵinject"](_Title_title_service__WEBPACK_IMPORTED_MODULE_22__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_25__["ɵɵinject"](_Export_html_presentation_service__WEBPACK_IMPORTED_MODULE_23__.HtmlPresentationService)); + return new (t || InitializerService)(_angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵinject"](_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_10__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵinject"](_replay_services_replay_service__WEBPACK_IMPORTED_MODULE_11__.ReplayService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵinject"](_domain_services_dialog_service__WEBPACK_IMPORTED_MODULE_12__.DialogService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵinject"](_domain_services_command_stack_service__WEBPACK_IMPORTED_MODULE_13__.CommandStackService), _angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵinject"](_title_services_title_service__WEBPACK_IMPORTED_MODULE_14__.TitleService)); }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_25__["ɵɵdefineInjectable"]({ + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_16__["ɵɵdefineInjectable"]({ token: InitializerService, factory: InitializerService.ɵfac, providedIn: 'root' @@ -73745,10 +73148,10 @@ let InitializerService = /*#__PURE__*/(() => { /***/ }), -/***/ 74676: -/*!****************************************************!*\ - !*** ./src/app/Service/Modeler/modeler.service.ts ***! - \****************************************************/ +/***/ 40439: +/*!***********************************************************!*\ + !*** ./src/app/tools/modeler/services/modeler.service.ts ***! + \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -73757,16 +73160,14 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ ModelerService: () => (/* binding */ ModelerService) /* harmony export */ }); /* harmony import */ var _home_runner_work_egon_io_egon_io_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 73308); -/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! min-dash */ 93673); -/* harmony import */ var src_app_BPMN_JS__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/BPMN-JS */ 90080); -/* harmony import */ var _BPMN_JS_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../BPMN-JS/modeler/numbering/numbering */ 37126); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _initializer_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./initializer.service */ 33666); -/* harmony import */ var _ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ElementRegistry/element-registry.service */ 67613); -/* harmony import */ var _IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../IconSetConfiguration/icon-dictionary.service */ 93689); -/* harmony import */ var _IconSetConfiguration_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../IconSetConfiguration/icon-set-configuration.service */ 10200); -/* harmony import */ var _BrowserStorage_storage_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../BrowserStorage/storage.service */ 59298); - +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! min-dash */ 93673); +/* harmony import */ var src_app_tools_modeler_bpmn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/tools/modeler/bpmn */ 95715); +/* harmony import */ var _bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../bpmn/modeler/numbering/numbering */ 14945); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _initializer_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./initializer.service */ 52317); +/* harmony import */ var _domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../domain/services/element-registry.service */ 85511); +/* harmony import */ var _icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../icon-set-config/services/icon-dictionary.service */ 6932); +/* harmony import */ var _icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../icon-set-config/services/icon-set-configuration.service */ 46527); @@ -73778,21 +73179,20 @@ __webpack_require__.r(__webpack_exports__); let ModelerService = /*#__PURE__*/(() => { class ModelerService { - constructor(initializerService, elementRegistryService, iconDictionaryService, iconSetConfigurationService, storageService) { + constructor(initializerService, elementRegistryService, iconDictionaryService, iconSetConfigurationService) { this.initializerService = initializerService; this.elementRegistryService = elementRegistryService; this.iconDictionaryService = iconDictionaryService; this.iconSetConfigurationService = iconSetConfigurationService; - this.storageService = storageService; } postInit() { - const storedIconSetConfiguration = this.storageService.getStoredIconSetConfiguration(); + const storedIconSetConfiguration = this.iconSetConfigurationService.getStoredIconSetConfiguration(); if (storedIconSetConfiguration) { this.iconDictionaryService.setCustomConfiguration(storedIconSetConfiguration); this.iconSetConfigurationService.loadConfiguration(storedIconSetConfiguration); } - this.initializerService.initializeDomainStoryModelerClasses(); - this.modeler = new src_app_BPMN_JS__WEBPACK_IMPORTED_MODULE_1__["default"]({ + // this.initializerService.initializeDomainStoryModelerClasses(); + this.modeler = new src_app_tools_modeler_bpmn__WEBPACK_IMPORTED_MODULE_1__["default"]({ container: '#canvas', keyboard: { bindTo: document @@ -73818,7 +73218,7 @@ let ModelerService = /*#__PURE__*/(() => { this.initializerService.initiateEventBusListeners(this.eventBus, this.commandStack); this.modeler.createDiagram(); // expose bpmnjs to window for debugging purposes - (0,min_dash__WEBPACK_IMPORTED_MODULE_8__.assign)(window, { + (0,min_dash__WEBPACK_IMPORTED_MODULE_7__.assign)(window, { bpmnjs: this.modeler }); this.startDebounce(); @@ -73826,17 +73226,17 @@ let ModelerService = /*#__PURE__*/(() => { restart(iconSetConfiguration, domainStory) { const currentStory = domainStory != undefined ? domainStory : this.elementRegistryService.createObjectListForDSTDownload().map(e => e.businessObject); if (!iconSetConfiguration) { - iconSetConfiguration = this.storageService.getStoredIconSetConfiguration(); + iconSetConfiguration = this.iconSetConfigurationService.getStoredIconSetConfiguration(); } if (iconSetConfiguration) { - this.storageService.setStoredIconSetConfiguration(iconSetConfiguration); + this.iconSetConfigurationService.setStoredIconSetConfiguration(iconSetConfiguration); this.iconDictionaryService.setCustomConfiguration(iconSetConfiguration); this.iconSetConfigurationService.loadConfiguration(iconSetConfiguration); } this.elementRegistryService.clear(); this.modeler?.destroy(); this.postInit(); - (0,_BPMN_JS_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_2__.updateMultipleNumberRegistry)(currentStory.filter(bo => bo.type === 'domainStory:activity').map(bo => bo).filter(bo => bo.number !== null)); + (0,_bpmn_modeler_numbering_numbering__WEBPACK_IMPORTED_MODULE_2__.updateMultipleNumberRegistry)(currentStory.filter(bo => bo.type === 'domainStory:activity').map(bo => bo).filter(bo => bo.number !== null)); if (currentStory && this.modeler.get) { this.modeler.importCustomElements(currentStory); } @@ -73880,9 +73280,9 @@ let ModelerService = /*#__PURE__*/(() => { })(); } static #_ = this.ɵfac = function ModelerService_Factory(t) { - return new (t || ModelerService)(_angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵinject"](_initializer_service__WEBPACK_IMPORTED_MODULE_3__.InitializerService), _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵinject"](_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_4__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵinject"](_IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_5__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵinject"](_IconSetConfiguration_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_6__.IconSetConfigurationService), _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵinject"](_BrowserStorage_storage_service__WEBPACK_IMPORTED_MODULE_7__.StorageService)); + return new (t || ModelerService)(_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_initializer_service__WEBPACK_IMPORTED_MODULE_3__.InitializerService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_4__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_icon_set_config_services_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_5__.IconDictionaryService), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_icon_set_config_services_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_6__.IconSetConfigurationService)); }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵdefineInjectable"]({ + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdefineInjectable"]({ token: ModelerService, factory: ModelerService.ɵfac, providedIn: 'root' @@ -73893,10 +73293,10 @@ let ModelerService = /*#__PURE__*/(() => { /***/ }), -/***/ 94896: -/*!******************************************************!*\ - !*** ./src/app/Service/Renderer/renderer.service.ts ***! - \******************************************************/ +/***/ 63812: +/*!************************************************************!*\ + !*** ./src/app/tools/modeler/services/renderer.service.ts ***! + \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -73905,9 +73305,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ RendererService: () => (/* binding */ RendererService) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var src_app_Service_Modeler_modeler_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Service/Modeler/modeler.service */ 74676); -/* harmony import */ var src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Service/ElementRegistry/element-registry.service */ 67613); -/* harmony import */ var src_app_Service_DirtyFlag_dirty_flag_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/Service/DirtyFlag/dirty-flag.service */ 89791); +/* harmony import */ var src_app_tools_modeler_services_modeler_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/tools/modeler/services/modeler.service */ 40439); +/* harmony import */ var src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/domain/services/element-registry.service */ 85511); +/* harmony import */ var src_app_domain_services_dirty_flag_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/domain/services/dirty-flag.service */ 94658); @@ -73924,6 +73324,7 @@ let RendererService = /*#__PURE__*/(() => { } reset() { this.renderStory([]); + this.dirtyFlagService.makeClean(); } importStory(domainStory, configurationChange, config, makeClean = true) { this.modelerService.restart(config, domainStory); @@ -73939,7 +73340,7 @@ let RendererService = /*#__PURE__*/(() => { return this.elementRegistryService.createObjectListForDSTDownload().map(c => c.businessObject); } static #_ = this.ɵfac = function RendererService_Factory(t) { - return new (t || RendererService)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](src_app_Service_Modeler_modeler_service__WEBPACK_IMPORTED_MODULE_0__.ModelerService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_1__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](src_app_Service_DirtyFlag_dirty_flag_service__WEBPACK_IMPORTED_MODULE_2__.DirtyFlagService)); + return new (t || RendererService)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](src_app_tools_modeler_services_modeler_service__WEBPACK_IMPORTED_MODULE_0__.ModelerService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_1__.ElementRegistryService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](src_app_domain_services_dirty_flag_service__WEBPACK_IMPORTED_MODULE_2__.DirtyFlagService)); }; static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjectable"]({ token: RendererService, @@ -73952,51 +73353,174 @@ let RendererService = /*#__PURE__*/(() => { /***/ }), -/***/ 67820: +/***/ 97961: /*!********************************************************!*\ - !*** ./src/app/Service/Replay/replay-state.service.ts ***! + !*** ./src/app/tools/replay/domain/replayConstants.ts ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ReplayStateService: () => (/* binding */ ReplayStateService) +/* harmony export */ HIGHLIGHT_NUMBER_BACKGROUNG_COLOR: () => (/* binding */ HIGHLIGHT_NUMBER_BACKGROUNG_COLOR), +/* harmony export */ HIGHLIGHT_NUMBER_COLOR: () => (/* binding */ HIGHLIGHT_NUMBER_COLOR), +/* harmony export */ HIGHLIGHT_STROKE_WIDTH: () => (/* binding */ HIGHLIGHT_STROKE_WIDTH), +/* harmony export */ NUMBER_BACKGROUND_COLOR: () => (/* binding */ NUMBER_BACKGROUND_COLOR), +/* harmony export */ NUMBER_COLOR: () => (/* binding */ NUMBER_COLOR), +/* harmony export */ STROKE_WIDTH: () => (/* binding */ STROKE_WIDTH) /* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 95981); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); +const NUMBER_BACKGROUND_COLOR = 'white'; +const NUMBER_COLOR = 'black'; +const STROKE_WIDTH = '1.5'; +const HIGHLIGHT_NUMBER_BACKGROUNG_COLOR = '#43acbf'; +const HIGHLIGHT_NUMBER_COLOR = 'black'; +const HIGHLIGHT_STROKE_WIDTH = '4'; +/***/ }), -let ReplayStateService = /*#__PURE__*/(() => { - class ReplayStateService { - constructor() { - this.replayOnSubject = new rxjs__WEBPACK_IMPORTED_MODULE_0__.BehaviorSubject(false); - this.replayOn$ = this.replayOnSubject.asObservable(); +/***/ 95802: +/*!*******************************************************************!*\ + !*** ./src/app/tools/replay/services/dom-manipulation.service.ts ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DomManipulationService: () => (/* binding */ DomManipulationService) +/* harmony export */ }); +/* harmony import */ var src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/domain/entities/elementTypes */ 73190); +/* harmony import */ var _domain_replayConstants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../domain/replayConstants */ 97961); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/domain/services/element-registry.service */ 85511); + + + + +/** + * Manipulates the DOM during replay to only show the elements of the current Sentence + */ +let DomManipulationService = /*#__PURE__*/(() => { + class DomManipulationService { + constructor(elementRegistryService) { + this.elementRegistryService = elementRegistryService; } - setReplayState(state) { - this.replayOnSubject.next(state); + showAll() { + this.removeHighlights(); + this.elementRegistryService.getAllCanvasObjects().slice().concat(this.elementRegistryService.getAllGroups().slice()).map(e => e.businessObject).forEach(element => { + const domObject = document.querySelector('[data-element-id=' + element.id + ']'); + // @ts-ignore + domObject.style.display = 'block'; + }); } - getReplayOn() { - return this.replayOnSubject.value; + showSentence(replaySentence, previousSentence) { + this.removeHighlights(); + const notShown = this.getAllNotShown(replaySentence.objects); + notShown.forEach(element => { + const domObject = document.querySelector('[data-element-id=' + element.id + ']'); + if (domObject) { + // @ts-ignore + domObject.style.display = 'none'; + } + }); + this.highlightSentence(previousSentence ? replaySentence.objects.filter(o => !previousSentence.objects.includes(o)) : replaySentence.objects); + replaySentence.objects.forEach(element => { + const domObject = document.querySelector('[data-element-id=' + element.id + ']'); + if (domObject) { + // @ts-ignore + domObject.style.display = 'block'; + } + }); + } + getNumberDomForActivity(activity) { + const numberText = activity.parentElement?.getElementsByClassName('djs-labelNumber')[0] ?? ''; + const circle = numberText?.previousSibling ?? ''; + return { + numberBackgroundDom: circle, + numberTextDom: numberText + }; + } + removeHighlights() { + const allActivities = this.elementRegistryService.getAllActivities(); + const allConnections = this.elementRegistryService.getAllConnections(); + allActivities.forEach(activity => { + const querySelector = document.querySelector('[data-element-id=' + activity.id + ']'); + if (querySelector) { + const activityDomObject = querySelector.getElementsByTagName('polyline')[0]; + activityDomObject.style.stroke = activity.businessObject.pickedColor || 'black'; + activityDomObject.style.strokeWidth = _domain_replayConstants__WEBPACK_IMPORTED_MODULE_1__.STROKE_WIDTH; + const { + numberBackgroundDom, + numberTextDom + } = this.getNumberDomForActivity(activityDomObject); + if (numberBackgroundDom && numberTextDom) { + numberBackgroundDom.style.fill = _domain_replayConstants__WEBPACK_IMPORTED_MODULE_1__.NUMBER_BACKGROUND_COLOR; + numberTextDom.style.fill = _domain_replayConstants__WEBPACK_IMPORTED_MODULE_1__.NUMBER_COLOR; + } + } + }); + allConnections.forEach(connection => { + // @ts-ignore + const connectionDomObject = document.querySelector('[data-element-id=' + connection.id + ']').getElementsByTagName('polyline')[0]; + connectionDomObject.style.stroke = connection.businessObject.pickedColor || 'black'; + connectionDomObject.style.strokeWidth = '1.5'; + }); + } + highlightSentence(sentenceObjects) { + sentenceObjects.filter(e => e.type === src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.ACTIVITY).forEach(activity => { + const querySelector = document.querySelector('[data-element-id=' + activity.id + ']'); + if (querySelector) { + const activityDomObject = querySelector.getElementsByTagName('polyline')[0]; + activityDomObject.style.strokeWidth = _domain_replayConstants__WEBPACK_IMPORTED_MODULE_1__.HIGHLIGHT_STROKE_WIDTH; + const { + numberBackgroundDom, + numberTextDom + } = this.getNumberDomForActivity(activityDomObject); + if (numberTextDom && numberBackgroundDom) { + numberBackgroundDom.style.fill = _domain_replayConstants__WEBPACK_IMPORTED_MODULE_1__.HIGHLIGHT_NUMBER_BACKGROUNG_COLOR; + numberTextDom.style.fill = _domain_replayConstants__WEBPACK_IMPORTED_MODULE_1__.HIGHLIGHT_NUMBER_COLOR; + } + } + }); + } + getAllNotShown(shownElements) { + const notShownElements = []; + const allObjects = this.elementRegistryService.getAllCanvasObjects().concat(this.elementRegistryService.getAllGroups()); + allObjects.forEach(element => { + if (!shownElements.includes(element.businessObject)) { + if (element.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.CONNECTION)) { + // @ts-ignore + if (!element.source.type.includes(src_app_domain_entities_elementTypes__WEBPACK_IMPORTED_MODULE_0__.ElementTypes.GROUP)) { + notShownElements.push(element.businessObject); + } else { + // @ts-ignore + shownElements.push(element.target); + } + } else { + notShownElements.push(element.businessObject); + } + } + }); + return notShownElements; } - static #_ = this.ɵfac = function ReplayStateService_Factory(t) { - return new (t || ReplayStateService)(); + static #_ = this.ɵfac = function DomManipulationService_Factory(t) { + return new (t || DomManipulationService)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵinject"](src_app_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_2__.ElementRegistryService)); }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ - token: ReplayStateService, - factory: ReplayStateService.ɵfac, + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjectable"]({ + token: DomManipulationService, + factory: DomManipulationService.ɵfac, providedIn: 'root' }); } - return ReplayStateService; + return DomManipulationService; })(); /***/ }), -/***/ 94788: -/*!**************************************************!*\ - !*** ./src/app/Service/Replay/replay.service.ts ***! - \**************************************************/ +/***/ 3687: +/*!*********************************************************!*\ + !*** ./src/app/tools/replay/services/replay.service.ts ***! + \*********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -74004,14 +73528,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ReplayService: () => (/* binding */ ReplayService) /* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 95981); -/* harmony import */ var _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Domain/Common/constants */ 90816); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var src_app_Service_Replay_replay_state_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Service/Replay/replay-state.service */ 67820); -/* harmony import */ var src_app_Service_DomManipulation_dom_manipulation_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/Service/DomManipulation/dom-manipulation.service */ 63149); -/* harmony import */ var _storyCreator_story_creator_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./storyCreator/story-creator.service */ 24127); -/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); - +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 95981); +/* harmony import */ var _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../domain/entities/constants */ 40550); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_tools_replay_services_dom_manipulation_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/tools/replay/services/dom-manipulation.service */ 95802); +/* harmony import */ var _story_creator_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./story-creator.service */ 97720); +/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); @@ -74020,23 +73542,30 @@ __webpack_require__.r(__webpack_exports__); let ReplayService = /*#__PURE__*/(() => { class ReplayService { - constructor(replayStateService, domManipulationService, storyCreatorService, snackbar) { - this.replayStateService = replayStateService; + constructor(domManipulationService, storyCreatorService, snackbar) { this.domManipulationService = domManipulationService; this.storyCreatorService = storyCreatorService; this.snackbar = snackbar; this.story = []; - this.currentSentence = new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject(-1); - this.maxSentenceNumber = new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject(0); + this.currentSentence = new rxjs__WEBPACK_IMPORTED_MODULE_3__.BehaviorSubject(-1); + this.maxSentenceNumber = new rxjs__WEBPACK_IMPORTED_MODULE_3__.BehaviorSubject(0); + this.replayOnSubject = new rxjs__WEBPACK_IMPORTED_MODULE_3__.BehaviorSubject(false); this.currentSentence$ = this.currentSentence.asObservable(); this.maxSentenceNumber$ = this.maxSentenceNumber.asObservable(); + this.replayOn$ = this.replayOnSubject.asObservable(); + } + setReplayState(state) { + this.replayOnSubject.next(state); + } + getReplayOn() { + return this.replayOnSubject.value; } isReplayable() { return this.storyCreatorService.traceActivitiesAndCreateStory().length > 0; } - initializeReplay() { + initializeReplay(story) { this.currentSentence.next(1); - this.story = this.storyCreatorService.traceActivitiesAndCreateStory(); + this.story = story; this.maxSentenceNumber.next(this.story.length); } getCurrentSentenceNumber() { @@ -74060,37 +73589,40 @@ let ReplayService = /*#__PURE__*/(() => { showCurrentSentence() { this.domManipulationService.showSentence(this.story[this.currentSentence.value - 1], this.currentSentence.value > 1 ? this.story[this.currentSentence.value - 2] : undefined); } - startReplay() { - this.initializeReplay(); - if (this.story.length > 0) { - const missingSentences = this.storyCreatorService.getMissingSentences(this.story); - if (missingSentences.length === 0) { - this.replayStateService.setReplayState(true); - this.domManipulationService.showSentence(this.story[this.currentSentence.getValue() - 1]); - } else { + startReplay(checkSequenceNumbers = false) { + const story = this.storyCreatorService.traceActivitiesAndCreateStory(); + if (checkSequenceNumbers) { + const missingSentences = this.storyCreatorService.getMissingSentences(story); + if (missingSentences.length > 0) { const sentence = missingSentences.join(', '); this.snackbar.open(missingSentences.length === 1 ? `The Domain Story is not complete. Sentence ${sentence} is missing.` : `The Domain Story is not complete. Sentences ${sentence} are missing.`, undefined, { - duration: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION * 2, - panelClass: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_INFO + duration: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION * 2, + panelClass: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_INFO }); + return; } + } + this.initializeReplay(story); + if (this.story.length > 0) { + this.setReplayState(true); + this.domManipulationService.showSentence(this.story[this.currentSentence.getValue() - 1]); } else { this.snackbar.open('You need a Domain Story for replay.', undefined, { - duration: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION * 2, - panelClass: _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_INFO + duration: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_DURATION * 2, + panelClass: _domain_entities_constants__WEBPACK_IMPORTED_MODULE_0__.SNACKBAR_INFO }); } } stopReplay() { this.currentSentence.next(-1); this.maxSentenceNumber.next(0); - this.replayStateService.setReplayState(false); + this.setReplayState(false); this.domManipulationService.showAll(); } static #_ = this.ɵfac = function ReplayService_Factory(t) { - return new (t || ReplayService)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](src_app_Service_Replay_replay_state_service__WEBPACK_IMPORTED_MODULE_1__.ReplayStateService), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](src_app_Service_DomManipulation_dom_manipulation_service__WEBPACK_IMPORTED_MODULE_2__.DomManipulationService), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_storyCreator_story_creator_service__WEBPACK_IMPORTED_MODULE_3__.StoryCreatorService), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_6__.MatSnackBar)); + return new (t || ReplayService)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](src_app_tools_replay_services_dom_manipulation_service__WEBPACK_IMPORTED_MODULE_1__.DomManipulationService), _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](_story_creator_service__WEBPACK_IMPORTED_MODULE_2__.StoryCreatorService), _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](_angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_5__.MatSnackBar)); }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({ + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ token: ReplayService, factory: ReplayService.ɵfac, providedIn: 'root' @@ -74101,10 +73633,10 @@ let ReplayService = /*#__PURE__*/(() => { /***/ }), -/***/ 24127: -/*!**********************************************************************!*\ - !*** ./src/app/Service/Replay/storyCreator/story-creator.service.ts ***! - \**********************************************************************/ +/***/ 97720: +/*!****************************************************************!*\ + !*** ./src/app/tools/replay/services/story-creator.service.ts ***! + \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -74112,9 +73644,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ StoryCreatorService: () => (/* binding */ StoryCreatorService) /* harmony export */ }); -/* harmony import */ var _Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Domain/Common/dictionary/dictionary */ 54972); +/* harmony import */ var _domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../domain/entities/dictionary */ 20843); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ElementRegistry/element-registry.service */ 67613); +/* harmony import */ var _domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../domain/services/element-registry.service */ 85511); @@ -74124,7 +73656,7 @@ let StoryCreatorService = /*#__PURE__*/(() => { this.elementRegistryService = elementRegistryService; } traceActivitiesAndCreateStory() { - const tracedActivityMap = new _Domain_Common_dictionary_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); + const tracedActivityMap = new _domain_entities_dictionary__WEBPACK_IMPORTED_MODULE_0__.Dictionary(); const story = []; const activities = this.elementRegistryService.getActivitiesFromActors(); const tracedActivityMapKeys = []; @@ -74222,7 +73754,7 @@ let StoryCreatorService = /*#__PURE__*/(() => { } } static #_ = this.ɵfac = function StoryCreatorService_Factory(t) { - return new (t || StoryCreatorService)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_1__.ElementRegistryService)); + return new (t || StoryCreatorService)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_domain_services_element_registry_service__WEBPACK_IMPORTED_MODULE_1__.ElementRegistryService)); }; static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ token: StoryCreatorService, @@ -74235,51 +73767,146 @@ let StoryCreatorService = /*#__PURE__*/(() => { /***/ }), -/***/ 58124: -/*!******************************************************!*\ - !*** ./src/app/Service/Settings/settings.service.ts ***! - \******************************************************/ +/***/ 86322: +/*!*********************************************************!*\ + !*** ./src/app/tools/title/domain/title-dialog-form.ts ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ TitleDialogForm: () => (/* binding */ TitleDialogForm) +/* harmony export */ }); +/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/forms */ 37222); + +var TitleDialogForm; +(function (TitleDialogForm) { + function create(titel, description) { + return new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormGroup({ + title: new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormControl(titel), + description: new _angular_forms__WEBPACK_IMPORTED_MODULE_0__.FormControl(description) + }); + } + TitleDialogForm.create = create; +})(TitleDialogForm || (TitleDialogForm = {})); + +/***/ }), + +/***/ 35458: +/*!*********************************************************************************!*\ + !*** ./src/app/tools/title/presentation/title-dialog/title-dialog.component.ts ***! + \*********************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ SettingsService: () => (/* binding */ SettingsService) -/* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 95981); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ TitleDialogComponent: () => (/* binding */ TitleDialogComponent) +/* harmony export */ }); +/* harmony import */ var _domain_title_dialog_form__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../domain/title-dialog-form */ 86322); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +/* harmony import */ var src_app_tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/tools/title/services/title.service */ 41535); +/* harmony import */ var _domain_services_dirty_flag_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../domain/services/dirty-flag.service */ 94658); +/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/forms */ 37222); +/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/button */ 72221); +/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/form-field */ 29344); +/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/input */ 92583); + + + + + -let SettingsService = /*#__PURE__*/(() => { - class SettingsService { - constructor() { - this.showSettings = new rxjs__WEBPACK_IMPORTED_MODULE_0__.BehaviorSubject(false); - this.showSettings$ = this.showSettings.asObservable(); + + +let TitleDialogComponent = /*#__PURE__*/(() => { + class TitleDialogComponent { + constructor(dialogRef, titleService, dirtyFlagService) { + this.dialogRef = dialogRef; + this.titleService = titleService; + this.dirtyFlagService = dirtyFlagService; + } + ngOnInit() { + const title = this.titleService.getTitle(); + const description = this.titleService.getDescription(); + this.form = _domain_title_dialog_form__WEBPACK_IMPORTED_MODULE_0__.TitleDialogForm.create(title, description); + } + save() { + if (this.form.dirty) { + this.dirtyFlagService.makeDirty(); + this.titleService.updateTitleAndDescription(this.form.getRawValue().title, this.form.getRawValue().description, true); + } + this.dialogRef.close(); } close() { - this.showSettings.next(false); + this.dialogRef.close(); } - open() { - this.showSettings.next(true); + preventDefault(event) { + event.preventDefault(); } - static #_ = this.ɵfac = function SettingsService_Factory(t) { - return new (t || SettingsService)(); + static #_ = this.ɵfac = function TitleDialogComponent_Factory(t) { + return new (t || TitleDialogComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_angular_material_dialog__WEBPACK_IMPORTED_MODULE_4__.MatDialogRef), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](src_app_tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_1__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_domain_services_dirty_flag_service__WEBPACK_IMPORTED_MODULE_2__.DirtyFlagService)); }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ - token: SettingsService, - factory: SettingsService.ɵfac, - providedIn: 'root' + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineComponent"]({ + type: TitleDialogComponent, + selectors: [["app-header-dialog"]], + decls: 16, + vars: 1, + consts: [[3, "formGroup"], [1, "dialogWidth"], ["matInput", "", "type", "text", "formControlName", "title"], ["maxlength", "2000", "matInput", "", "formControlName", "description", 1, "descriptionInput", 3, "keydown.enter", "keyup.enter", "keyup.escape"], ["mat-flat-button", "", 3, "click"], ["mat-flat-button", "", "color", "primary", 3, "click"]], + template: function TitleDialogComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](0, "mat-dialog-content")(1, "form", 0)(2, "mat-form-field", 1)(3, "mat-label"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](4, "Title"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelement"](5, "input", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelement"](6, "br"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](7, "mat-form-field", 1)(8, "mat-label"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](9, "Description"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](10, "textarea", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("keydown.enter", function TitleDialogComponent_Template_textarea_keydown_enter_10_listener($event) { + return ctx.preventDefault($event); + })("keyup.enter", function TitleDialogComponent_Template_textarea_keyup_enter_10_listener() { + return ctx.save(); + })("keyup.escape", function TitleDialogComponent_Template_textarea_keyup_escape_10_listener() { + return ctx.close(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()()()(); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](11, "mat-dialog-actions")(12, "button", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("click", function TitleDialogComponent_Template_button_click_12_listener() { + return ctx.close(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](13, "Cancel"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](14, "button", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("click", function TitleDialogComponent_Template_button_click_14_listener() { + return ctx.save(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](15, "Save"); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("formGroup", ctx.form); + } + }, + dependencies: [_angular_forms__WEBPACK_IMPORTED_MODULE_5__["ɵNgNoValidate"], _angular_forms__WEBPACK_IMPORTED_MODULE_5__.DefaultValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_5__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_5__.NgControlStatusGroup, _angular_forms__WEBPACK_IMPORTED_MODULE_5__.MaxLengthValidator, _angular_forms__WEBPACK_IMPORTED_MODULE_5__.FormGroupDirective, _angular_forms__WEBPACK_IMPORTED_MODULE_5__.FormControlName, _angular_material_button__WEBPACK_IMPORTED_MODULE_6__.MatButton, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_4__.MatDialogActions, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_4__.MatDialogContent, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__.MatFormField, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__.MatLabel, _angular_material_input__WEBPACK_IMPORTED_MODULE_8__.MatInput], + styles: [".dialogWidth[_ngcontent-%COMP%] {\n width: 50vw;\n}\n.dialogWidth[_ngcontent-%COMP%] mat-label[_ngcontent-%COMP%] {\n font-size: 12pt;\n}\n\n.descriptionInput[_ngcontent-%COMP%] {\n min-height: 75px;\n}"] }); } - return SettingsService; + return TitleDialogComponent; })(); /***/ }), -/***/ 69672: -/*!************************************************!*\ - !*** ./src/app/Service/Title/title.service.ts ***! - \************************************************/ +/***/ 41535: +/*!*******************************************************!*\ + !*** ./src/app/tools/title/services/title.service.ts ***! + \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -74287,11 +73914,17 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TitleService: () => (/* binding */ TitleService) /* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 95981); -/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../environments/environment */ 45312); -/* harmony import */ var _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Domain/Common/constants */ 90816); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var _CommandStack_command_stack_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../CommandStack/command-stack.service */ 19381); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 95981); +/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../environments/environment */ 45312); +/* harmony import */ var _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../domain/entities/constants */ 40550); +/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/dialog */ 44053); +/* harmony import */ var _presentation_title_dialog_title_dialog_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../presentation/title-dialog/title-dialog.component */ 35458); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _domain_services_command_stack_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../domain/services/command-stack.service */ 96445); +/* harmony import */ var _domain_services_dialog_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../domain/services/dialog.service */ 12855); + + + @@ -74299,17 +73932,24 @@ __webpack_require__.r(__webpack_exports__); let TitleService = /*#__PURE__*/(() => { class TitleService { - constructor(commandStackService) { + constructor(commandStackService, dialogService) { this.commandStackService = commandStackService; - this.titleSubject = new rxjs__WEBPACK_IMPORTED_MODULE_3__.BehaviorSubject(_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_TITLE); - this.descriptionSubject = new rxjs__WEBPACK_IMPORTED_MODULE_3__.BehaviorSubject(_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_DESCRIPTION); - this.iconSetNameSubject = new rxjs__WEBPACK_IMPORTED_MODULE_3__.BehaviorSubject(_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_ICON_SET_NAME); - this.showDescriptionSubject = new rxjs__WEBPACK_IMPORTED_MODULE_3__.BehaviorSubject(true); + this.dialogService = dialogService; + this.titleSubject = new rxjs__WEBPACK_IMPORTED_MODULE_5__.BehaviorSubject(_domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_TITLE); + this.descriptionSubject = new rxjs__WEBPACK_IMPORTED_MODULE_5__.BehaviorSubject(_domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_DESCRIPTION); + this.iconSetNameSubject = new rxjs__WEBPACK_IMPORTED_MODULE_5__.BehaviorSubject(_domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_ICON_SET_NAME); + this.showDescriptionSubject = new rxjs__WEBPACK_IMPORTED_MODULE_5__.BehaviorSubject(true); this.title$ = this.titleSubject.asObservable(); this.description$ = this.descriptionSubject.asObservable(); this.showDescription$ = this.showDescriptionSubject.asObservable(); this.iconSetName$ = this.iconSetNameSubject.asObservable(); } + openHeaderDialog() { + const config = new _angular_material_dialog__WEBPACK_IMPORTED_MODULE_6__.MatDialogConfig(); + config.disableClose = false; + config.autoFocus = true; + this.dialogService.openDialog(_presentation_title_dialog_title_dialog_component__WEBPACK_IMPORTED_MODULE_2__.TitleDialogComponent, config); + } updateTitleAndDescription(title, description, allowUndo) { if (allowUndo) { this.fireTitleAndDescriptionUpdate(title, description); @@ -74319,12 +73959,12 @@ let TitleService = /*#__PURE__*/(() => { } } reset() { - this.updateTitleAndDescription(_Domain_Common_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_TITLE, _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_DESCRIPTION, false); + this.updateTitleAndDescription(_domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_TITLE, _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_DESCRIPTION, false); } updateTitle(inputTitle) { - const title = !inputTitle || inputTitle.trim().length === 0 ? _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_TITLE : inputTitle; + const title = !inputTitle || inputTitle.trim().length === 0 ? _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_TITLE : inputTitle; this.titleSubject.next(title); - document.title = title === _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_TITLE ? 'egon.io' : title; + document.title = title === _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_TITLE ? 'egon.io' : title; } updateDescription(description) { this.descriptionSubject.next(description ?? this.descriptionSubject.value); @@ -74348,7 +73988,7 @@ let TitleService = /*#__PURE__*/(() => { return _environments_environment__WEBPACK_IMPORTED_MODULE_0__.environment.version; } hasTitleOrDescription() { - return this.getTitle().trim().length > 0 && this.getTitle() !== _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_TITLE || this.getDescription().trim().length > 0 && this.getDescription() !== _Domain_Common_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_DESCRIPTION; + return this.getTitle().trim().length > 0 && this.getTitle() !== _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_TITLE || this.getDescription().trim().length > 0 && this.getDescription() !== _domain_entities_constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL_DESCRIPTION; } fireTitleAndDescriptionUpdate(newTitle, newDescription) { const context = { @@ -74358,9 +73998,9 @@ let TitleService = /*#__PURE__*/(() => { this.commandStackService.execute('story.updateHeadlineAndDescription', context); } static #_ = this.ɵfac = function TitleService_Factory(t) { - return new (t || TitleService)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](_CommandStack_command_stack_service__WEBPACK_IMPORTED_MODULE_2__.CommandStackService)); + return new (t || TitleService)(_angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵɵinject"](_domain_services_command_stack_service__WEBPACK_IMPORTED_MODULE_3__.CommandStackService), _angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵɵinject"](_domain_services_dialog_service__WEBPACK_IMPORTED_MODULE_4__.DialogService)); }; - static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵɵdefineInjectable"]({ token: TitleService, factory: TitleService.ɵfac, providedIn: 'root' @@ -74371,9 +74011,9 @@ let TitleService = /*#__PURE__*/(() => { /***/ }), -/***/ 114: +/***/ 67858: /*!*****************************************!*\ - !*** ./src/app/Utils/mathExtensions.ts ***! + !*** ./src/app/utils/mathExtensions.ts ***! \*****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { @@ -74423,122 +74063,362 @@ function angleBetween(startPoint, endPoint) { if (quadrant === 2) { return 270 - degrees(Math.atan2(opposite, adjacent)); } - if (quadrant === 3) { - return 270 + degrees(Math.atan2(opposite, adjacent)); + if (quadrant === 3) { + return 270 + degrees(Math.atan2(opposite, adjacent)); + } + return undefined; +} +function positionsMatch(width, height, elementX, elementY, clickX, clickY) { + if (clickX > elementX && clickX < elementX + width) { + if (clickY > elementY && clickY < elementY + height) { + return true; + } + } + return false; +} +class Point { + constructor() { + this.y = 0; + this.x = 0; + } +} + +/***/ }), + +/***/ 43515: +/*!************************************!*\ + !*** ./src/app/utils/sanitizer.ts ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ sanitizeForDesktop: () => (/* binding */ sanitizeForDesktop), +/* harmony export */ sanitizeIconName: () => (/* binding */ sanitizeIconName) +/* harmony export */ }); + + +// sanitize user-Input to be Desktop-Filename safe +function sanitizeForDesktop(str) { + const map = { + '/': '', + '\\': '', + ':': '', + '*': '', + '?': '', + '"': '', + '<': '', + '>': '', + '|': '' + }; + const reg = /[/\\:*?"<>|]/gi; + return str ? str.replace(reg, match => map[match]) : ''; +} +function sanitizeIconName(name) { + if (!name) { + return ''; + } + let nameWithoutFileEnding = name.lastIndexOf('.') > 0 ? name.substring(0, name.lastIndexOf('.')) : name; + const map = { + '/': '', + '\\': '', + ':': '', + '*': '', + '?': '', + '"': '', + '<': '', + '>': '', + '|': '', + '(': '', + ')': '', + ' ': '-' + }; + const reg = /[/\\:*?"<>|() ]/gi; + return nameWithoutFileEnding.trim().replace(reg, match => map[match]); +} + +/***/ }), + +/***/ 78435: +/*!*************************************************************************************!*\ + !*** ./src/app/workbench/presentation/header/domain-story-modeler-module.module.ts ***! + \*************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DomainStoryModelerModuleModule: () => (/* binding */ DomainStoryModelerModuleModule) +/* harmony export */ }); +/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ 56610); +/* harmony import */ var _header_buttons_header_buttons_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./header-buttons/header-buttons.component */ 4225); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); + + + +let DomainStoryModelerModuleModule = /*#__PURE__*/(() => { + class DomainStoryModelerModuleModule { + static #_ = this.ɵfac = function DomainStoryModelerModuleModule_Factory(t) { + return new (t || DomainStoryModelerModuleModule)(); + }; + static #_2 = this.ɵmod = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ + type: DomainStoryModelerModuleModule + }); + static #_3 = this.ɵinj = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ + imports: [_angular_common__WEBPACK_IMPORTED_MODULE_2__.CommonModule] + }); + } + return DomainStoryModelerModuleModule; +})(); +(function () { + (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsetNgModuleScope"](DomainStoryModelerModuleModule, { + declarations: [_header_buttons_header_buttons_component__WEBPACK_IMPORTED_MODULE_0__.HeaderButtonsComponent], + imports: [_angular_common__WEBPACK_IMPORTED_MODULE_2__.CommonModule], + exports: [_header_buttons_header_buttons_component__WEBPACK_IMPORTED_MODULE_0__.HeaderButtonsComponent] + }); +})(); + +/***/ }), + +/***/ 4225: +/*!******************************************************************************************!*\ + !*** ./src/app/workbench/presentation/header/header-buttons/header-buttons.component.ts ***! + \******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ HeaderButtonsComponent: () => (/* binding */ HeaderButtonsComponent) +/* harmony export */ }); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2978); + + +function HeaderButtonsComponent_Conditional_0_Conditional_9_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "span", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1, " archive "); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + } +} +function HeaderButtonsComponent_Conditional_0_Conditional_10_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "span", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1, " archive "); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + } +} +function HeaderButtonsComponent_Conditional_0_Template(rf, ctx) { + if (rf & 1) { + const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div")(1, "button", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function HeaderButtonsComponent_Conditional_0_Template_button_click_1_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r1); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r1.startReplay.emit()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "span", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](3, " play_arrow "); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](4, "button", 2)(5, "span", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](6, " unarchive "); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](7, "input", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("change", function HeaderButtonsComponent_Conditional_0_Template_input_change_7_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r1); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r1.import.emit()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](8, "button", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function HeaderButtonsComponent_Conditional_0_Template_button_click_8_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r1); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r1.openDownloadDialog.emit()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](9, HeaderButtonsComponent_Conditional_0_Conditional_9_Template, 2, 0, "span", 5)(10, HeaderButtonsComponent_Conditional_0_Conditional_10_Template, 2, 0, "span", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](11, "button", 6); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function HeaderButtonsComponent_Conditional_0_Template_button_click_11_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r1); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r1.openLabelDictionary.emit()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](12, "span", 7); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](13, " spellcheck "); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](14, "button", 8); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function HeaderButtonsComponent_Conditional_0_Template_button_click_14_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r1); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r1.openSettings.emit()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](15, "span", 9); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](16, " settings "); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](17, "button", 10); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function HeaderButtonsComponent_Conditional_0_Template_button_click_17_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r1); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r1.showKeyboardShortCuts.emit()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](18, "span", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](19, " keyboard "); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](20, "button", 11); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function HeaderButtonsComponent_Conditional_0_Template_button_click_20_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r1); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r1.newStory.emit()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](21, "span", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](22, " note_add "); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()()(); + } + if (rf & 2) { + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("disabled", !ctx_r1.isReplayable); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("disabled", !ctx_r1.isReplayable); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](7); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("disabled", !ctx_r1.hasDomainStory && !ctx_r1.hasTitle); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("disabled", !ctx_r1.hasDomainStory && !ctx_r1.hasTitle); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵconditional"](9, !ctx_r1.isDirty ? 9 : -1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵconditional"](10, ctx_r1.isDirty ? 10 : -1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("disabled", !ctx_r1.hasDomainStory); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("disabled", !ctx_r1.hasDomainStory); } - return undefined; } -function positionsMatch(width, height, elementX, elementY, clickX, clickY) { - if (clickX > elementX && clickX < elementX + width) { - if (clickY > elementY && clickY < elementY + height) { - return true; - } +function HeaderButtonsComponent_Conditional_1_Template(rf, ctx) { + if (rf & 1) { + const _r3 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div")(1, "button", 12); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function HeaderButtonsComponent_Conditional_1_Template_button_click_1_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r3); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r1.previousSentence.emit()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "span", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](3, " skip_previous "); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](4, "button", 13); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function HeaderButtonsComponent_Conditional_1_Template_button_click_4_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r3); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r1.nextSentence.emit()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](5, "span", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](6, " skip_next "); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](7, "button", 14); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function HeaderButtonsComponent_Conditional_1_Template_button_click_7_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r3); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r1.stopReplay.emit()); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](8, "span", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](9, " stop "); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()()(); } - return false; } -class Point { - constructor() { - this.y = 0; - this.x = 0; +let HeaderButtonsComponent = /*#__PURE__*/(() => { + class HeaderButtonsComponent { + constructor() { + this.hasDomainStory = false; + this.hasTitle = false; + this.isReplaying = false; + this.isDirty = false; + this.isReplayable = false; + this.import = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); + this.openSettings = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); + this.startReplay = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); + this.stopReplay = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); + this.previousSentence = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); + this.nextSentence = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); + this.newStory = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); + this.showKeyboardShortCuts = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); + this.openLabelDictionary = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); + this.openDownloadDialog = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); + } + static #_ = this.ɵfac = function HeaderButtonsComponent_Factory(t) { + return new (t || HeaderButtonsComponent)(); + }; + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ + type: HeaderButtonsComponent, + selectors: [["app-header-buttons"]], + inputs: { + hasDomainStory: "hasDomainStory", + hasTitle: "hasTitle", + isReplaying: "isReplaying", + isDirty: "isDirty", + isReplayable: "isReplayable" + }, + outputs: { + import: "import", + openSettings: "openSettings", + startReplay: "startReplay", + stopReplay: "stopReplay", + previousSentence: "previousSentence", + nextSentence: "nextSentence", + newStory: "newStory", + showKeyboardShortCuts: "showKeyboardShortCuts", + openLabelDictionary: "openLabelDictionary", + openDownloadDialog: "openDownloadDialog" + }, + decls: 2, + vars: 2, + consts: [["id", "buttonStartReplay", "title", "Start replay", 1, "headerButton", 3, "click", "disabled"], [1, "material-icons", "materialIconButton"], ["id", "buttonImport", "title", "Import story from file", "onclick", "document.getElementById('import').click();", 1, "headerButton"], ["type", "file", "accept", ".dst, .svg, .egn, .svg", "id", "import", "onclick", "this.value=null;", "name", "file", 2, "display", "none", 3, "change"], ["id", "export", "title", "Export story as .egn, .svg or .png file", 1, "headerButton", 3, "click", "disabled"], [1, "material-icons-outlined", "materialIconButton"], ["title", "Label Dictionary", 1, "headerButton", 3, "click", "disabled"], ["title", "Label Dictionary", 1, "material-icons", "materialIconButton"], ["title", "Settings", 1, "headerButton", 3, "click"], ["title", "Change Icons and Settings", 1, "material-icons", "materialIconButton"], ["title", "Show keyboard shortcuts", 1, "headerButton", 3, "click"], ["title", "Create a new domain story", 1, "headerButton", 3, "click"], ["title", "Previous sentence", 1, "headerButton", 3, "click"], ["title", "Next sentence", 1, "headerButton", 3, "click"], ["title", "Stop replay", 1, "headerButton", 3, "click"]], + template: function HeaderButtonsComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, HeaderButtonsComponent_Conditional_0_Template, 23, 11, "div")(1, HeaderButtonsComponent_Conditional_1_Template, 10, 0, "div"); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵconditional"](0, !ctx.isReplaying ? 0 : -1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵconditional"](1, ctx.isReplaying ? 1 : -1); + } + }, + styles: ["span[_ngcontent-%COMP%] {\n font-size: 15pt;\n color: white;\n}\n\n#dictionaryButton[_ngcontent-%COMP%] {\n opacity: 0.2;\n pointer-events: none;\n}\n\n.headerButton[_ngcontent-%COMP%]:hover {\n cursor: pointer;\n}\n.headerButton[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%] {\n color: white;\n}\n\n.disabled[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .disabled[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%] {\n cursor: initial;\n color: gray;\n}\n\n.materialIconButton[_ngcontent-%COMP%]:hover {\n color: lightgrey;\n}"] + }); } -} + return HeaderButtonsComponent; +})(); /***/ }), -/***/ 66107: -/*!************************************!*\ - !*** ./src/app/Utils/sanitizer.ts ***! - \************************************/ +/***/ 38361: +/*!**************************************************************************!*\ + !*** ./src/app/workbench/presentation/header/header/header.component.ts ***! + \**************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ restoreTitleFromFileName: () => (/* binding */ restoreTitleFromFileName), -/* harmony export */ sanitizeForDesktop: () => (/* binding */ sanitizeForDesktop), -/* harmony export */ sanitizeIconName: () => (/* binding */ sanitizeIconName) +/* harmony export */ HeaderComponent: () => (/* binding */ HeaderComponent) /* harmony export */ }); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs */ 199); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs */ 93527); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../tools/title/services/title.service */ 41535); +/* harmony import */ var _tools_replay_services_replay_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../tools/replay/services/replay.service */ 3687); +/* harmony import */ var _tools_import_services_import_domain_story_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../tools/import/services/import-domain-story.service */ 93586); +/* harmony import */ var _services_settings_settings_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../services/settings/settings.service */ 1299); +/* harmony import */ var _tools_modeler_services_renderer_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../tools/modeler/services/renderer.service */ 63812); +/* harmony import */ var _domain_services_dirty_flag_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../domain/services/dirty-flag.service */ 94658); +/* harmony import */ var _domain_services_dialog_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../domain/services/dialog.service */ 12855); +/* harmony import */ var _tools_export_services_export_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../tools/export/services/export.service */ 39595); +/* harmony import */ var _tools_label_dictionary_services_label_dictionary_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../tools/label-dictionary/services/label-dictionary.service */ 69731); +/* harmony import */ var _header_buttons_header_buttons_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../header-buttons/header-buttons.component */ 4225); +/* harmony import */ var _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/material/toolbar */ 23550); +/* harmony import */ var _angular_material_card__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @angular/material/card */ 90643); +/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @angular/common */ 56610); -// sanitize user-Input to be Desktop-Filename safe -function sanitizeForDesktop(str) { - const map = { - '/': '', - '\\': '', - ':': '', - '*': '', - '?': '', - '"': '', - '<': '', - '>': '', - '|': '' - }; - const reg = /[/\\:*?"<>|]/gi; - return str ? str.replace(reg, match => map[match]) : ''; -} -function sanitizeIconName(name) { - const map = { - '/': '', - '\\': '', - ':': '', - '*': '', - '?': '', - '"': '', - '<': '', - '>': '', - '|': '', - '(': '', - ')': '', - ' ': '-', - '.': '_' - }; - const reg = /[/\\:*?"<>|() .]/gi; - return name ? name.replace(reg, match => { - return map[match]; - }) : ''; -} -function restoreTitleFromFileName(filename, isSVG) { - let title; - const domainStoryRegex = /_\d+-\d+-\d+( ?_?-?\(\d+\))?(-?\d)?(.dst|.egn)/; - const svgRegex = /_\d+-\d+-\d+( ?_?-?\(\d+\))?(-?\d)?(.dst|.egn).svg/; - const egnSuffix = '.egn'; - const dstSuffix = '.dst'; - const svgSuffix = '.svg'; - let filenameWithoutDateSuffix = filename.replace(isSVG ? svgRegex : domainStoryRegex, ''); - if (filenameWithoutDateSuffix.includes(isSVG ? svgSuffix : dstSuffix)) { - filenameWithoutDateSuffix = filenameWithoutDateSuffix.replace(svgSuffix, '').replace(dstSuffix, '').replace(egnSuffix, ''); - } - title = filenameWithoutDateSuffix; - return title; -} - -/***/ }), - -/***/ 20092: -/*!**********************************!*\ - !*** ./src/app/app.component.ts ***! - \**********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AppComponent: () => (/* binding */ AppComponent) -/* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs */ 95981); -/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../environments/environment */ 45312); -/* harmony import */ var ngx_color_picker__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ngx-color-picker */ 54743); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/core */ 2978); -/* harmony import */ var src_app_Service_Settings_settings_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Service/Settings/settings.service */ 58124); -/* harmony import */ var _Service_Title_title_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Service/Title/title.service */ 69672); -/* harmony import */ var _Service_Export_export_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Service/Export/export.service */ 98106); -/* harmony import */ var _Service_Replay_replay_state_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Service/Replay/replay-state.service */ 67820); -/* harmony import */ var _Service_Replay_replay_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Service/Replay/replay.service */ 94788); -/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/common */ 56610); -/* harmony import */ var src_app_Presentation_Header_header_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/Presentation/Header/header.component */ 91729); -/* harmony import */ var src_app_Presentation_Settings_settings_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/Presentation/Settings/settings.component */ 1261); -/* harmony import */ var src_app_Presentation_Canvas_modeler_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/Presentation/Canvas/modeler.component */ 29383); - @@ -74552,247 +74432,270 @@ __webpack_require__.r(__webpack_exports__); -function AppComponent_app_settings_2_Template(rf, ctx) { +function HeaderComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelement"](0, "app-settings"); + const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](0, "button", 11); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("click", function HeaderComponent_Conditional_2_Template_button_click_0_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵrestoreView"](_r1); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵresetView"](ctx_r1.setShowDescription(false)); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](1, "span", 12); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](2, " expand_less "); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); } } -let AppComponent = /*#__PURE__*/(() => { - class AppComponent { - constructor(settingsService, titleService, exportService, replayStateService, replayService) { - this.settingsService = settingsService; +function HeaderComponent_Conditional_4_Template(rf, ctx) { + if (rf & 1) { + const _r3 = _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](0, "button", 13); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("click", function HeaderComponent_Conditional_4_Template_button_click_0_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵrestoreView"](_r3); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵresetView"](ctx_r1.setShowDescription(true)); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](1, "span", 12); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](2, " expand_more"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); + } +} +function HeaderComponent_Conditional_13_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](0, "span", 7); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](2, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"](); + } + if (rf & 2) { + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵnextContext"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtextInterpolate1"](" Sentence: ", _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](2, 1, ctx_r1.sentenceDescription$), ""); + } +} +function HeaderComponent_Conditional_19_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](0, "mat-card", 10)(1, "span", 14); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](3, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()(); + } + if (rf & 2) { + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵnextContext"](); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtextInterpolate"](_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](3, 1, ctx_r1.description$)); + } +} +let HeaderComponent = /*#__PURE__*/(() => { + class HeaderComponent { + constructor(titleService, replayService, importService, settingsService, renderService, dirtyFlagService, dialogService, exportService, labelDictionaryService) { this.titleService = titleService; + this.replayService = replayService; + this.importService = importService; + this.settingsService = settingsService; + this.renderService = renderService; + this.dirtyFlagService = dirtyFlagService; + this.dialogService = dialogService; this.exportService = exportService; - this.replayStateService = replayStateService; - this.version = _environments_environment__WEBPACK_IMPORTED_MODULE_0__.environment.version; - this.color = '#000000'; - this.skipNextColorUpdate = false; - // define preset colors that have good contrast on white background and are compatible to EventStorming notation - this.colorBox = ['#FDD835', - // yellow - '#FB8C00', - // orange - '#D32F2F', - // red - '#F48FB1', - // light pink - '#EC407A', - // dark pink - '#8E24AA', - // purple - '#1E88E5', - // blue - '#00ACC1', - // cyan - '#43A047', - // green - '#C0CA33', - // lime - '#9E9E9E', - // grey - '#000000' // black - ]; - - this.showSettings$ = new rxjs__WEBPACK_IMPORTED_MODULE_10__.BehaviorSubject(false); - this.showDescription$ = new rxjs__WEBPACK_IMPORTED_MODULE_10__.BehaviorSubject(true); - document.addEventListener('keydown', e => { - if (e.ctrlKey && e.key === 's') { - e.preventDefault(); - e.stopPropagation(); - if (this.exportService.isDomainStoryExportable()) { - this.exportService.downloadDST(); - } - } - if (e.ctrlKey && e.key === 'l') { - e.preventDefault(); - e.stopPropagation(); - document.getElementById('import')?.click(); - } - if ((e.key === 'ArrowRight' || e.key === 'ArrowUp') && this.replayStateService.getReplayOn()) { - e.preventDefault(); - e.stopPropagation(); - replayService.nextSentence(); - } - if ((e.key === 'ArrowLeft' || e.key === 'ArrowDown') && this.replayStateService.getReplayOn()) { - e.preventDefault(); - e.stopPropagation(); - replayService.previousSentence(); - } - if (e.key === 'Escape') { - e.preventDefault(); - e.stopPropagation(); - this.skipNextColorUpdate = true; - this.colorPicker.closeDialog(); - } - }); - } - ngOnInit() { + this.labelDictionaryService = labelDictionaryService; + this.title$ = this.titleService.title$; + this.description$ = this.titleService.description$; this.showDescription$ = this.titleService.showDescription$; - this.showSettings$ = this.settingsService.showSettings$; - document.addEventListener('defaultColor', event => { - const customEvent = event; - this.color = customEvent.detail.color; - }); - document.addEventListener('openColorPicker', () => { - this.colorPicker.openDialog(); - }); + this.isReplay$ = this.replayService.replayOn$; + this.isDirty$ = this.dirtyFlagService.dirty$; + this.sentenceDescription$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.combineLatest)([this.replayService.currentSentence$, this.replayService.maxSentenceNumber$]).pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_12__.map)(([sentence, count]) => `${sentence}/${count}`)); + this.showDescription = this.titleService.showDescription$; } - onColorChanged(color) { - if (this.skipNextColorUpdate) { - this.skipNextColorUpdate = false; - return; - } - document.dispatchEvent(new CustomEvent('pickedColor', { - detail: { - color: color - } - })); + openHeaderDialog() { + this.titleService.openHeaderDialog(); } - static #_ = this.ɵfac = function AppComponent_Factory(t) { - return new (t || AppComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵdirectiveInject"](src_app_Service_Settings_settings_service__WEBPACK_IMPORTED_MODULE_1__.SettingsService), _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵdirectiveInject"](_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_2__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵdirectiveInject"](_Service_Export_export_service__WEBPACK_IMPORTED_MODULE_3__.ExportService), _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵdirectiveInject"](_Service_Replay_replay_state_service__WEBPACK_IMPORTED_MODULE_4__.ReplayStateService), _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵdirectiveInject"](_Service_Replay_replay_service__WEBPACK_IMPORTED_MODULE_5__.ReplayService)); + openSettings() { + this.settingsService.open(); + } + setShowDescription(show) { + this.titleService.setShowDescription(show); + } + createNewDomainStory() { + this.titleService.reset(); + this.renderService.reset(); + } + onImport() { + this.importService.performImport(); + } + startReplay() { + this.replayService.startReplay(true); + } + stopReplay() { + this.replayService.stopReplay(); + } + previousSentence() { + this.replayService.previousSentence(); + } + nextSentence() { + this.replayService.nextSentence(); + } + openKeyboardShortcutsDialog() { + this.dialogService.openKeyboardShortcutsDialog(); + } + openLabelDictionary() { + this.labelDictionaryService.openLabelDictionary(); + } + openDownloadDialog() { + this.exportService.openDownloadDialog(); + } + get hasDomainStory() { + return this.exportService.isDomainStoryExportable(); + } + get hasTitle() { + return this.titleService.hasTitleOrDescription(); + } + get isReplayable() { + return this.replayService.isReplayable(); + } + static #_ = this.ɵfac = function HeaderComponent_Factory(t) { + return new (t || HeaderComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_tools_title_services_title_service__WEBPACK_IMPORTED_MODULE_0__.TitleService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_tools_replay_services_replay_service__WEBPACK_IMPORTED_MODULE_1__.ReplayService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_tools_import_services_import_domain_story_service__WEBPACK_IMPORTED_MODULE_2__.ImportDomainStoryService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_services_settings_settings_service__WEBPACK_IMPORTED_MODULE_3__.SettingsService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_tools_modeler_services_renderer_service__WEBPACK_IMPORTED_MODULE_4__.RendererService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_domain_services_dirty_flag_service__WEBPACK_IMPORTED_MODULE_5__.DirtyFlagService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_domain_services_dialog_service__WEBPACK_IMPORTED_MODULE_6__.DialogService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_tools_export_services_export_service__WEBPACK_IMPORTED_MODULE_7__.ExportService), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_tools_label_dictionary_services_label_dictionary_service__WEBPACK_IMPORTED_MODULE_8__.LabelDictionaryService)); }; - static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵdefineComponent"]({ - type: AppComponent, - selectors: [["app-root"]], - viewQuery: function AppComponent_Query(rf, ctx) { - if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵviewQuery"](ngx_color_picker__WEBPACK_IMPORTED_MODULE_11__.ColorPickerDirective, 5); - } - if (rf & 2) { - let _t; - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵloadQuery"]()) && (ctx.colorPicker = _t.first); - } - }, - decls: 36, - vars: 40, - consts: [["role", "main", 1, "content"], ["id", "colorPicker", 2, "display", "none", "height", "0", 3, "colorPickerChange", "colorPickerClose", "cpPresetColors", "colorPicker"], [4, "ngIf"], ["src", "./favicon.ico", "height", "24", "alt", "Egon Logo"], ["href", "https://egon.io", "target", "_blank"], ["href", "https://egon.io/changelog", "target", "_blank"], ["src", "./assets/logo/wps-icon.ico", "height", "24", "alt", "WPS Logo"], ["href", "https://www.wps.de/", "target", "_blank"], ["href", "https://www.wps.de/datenschutz/", "target", "_blank"], ["href", "https://www.wps.de/impressum/", "target", "_blank"]], - template: function AppComponent_Template(rf, ctx) { + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineComponent"]({ + type: HeaderComponent, + selectors: [["app-header"]], + decls: 21, + vars: 24, + consts: [["color", "primary"], ["title", "Hide Description", 1, "headerButton"], ["title", "Show Description", 1, "headerButton"], [1, "mr-10", "titel-scrollbar"], ["title", "Edit Title and Description", 1, "headline", 3, "click"], [1, "material-icons", "materialIconButton", "editIcon"], [1, "titleSpacer"], ["title", "Replay Sentence"], [1, "buttonSpacer"], [1, "nowrap", 3, "import", "openSettings", "startReplay", "stopReplay", "nextSentence", "previousSentence", "newStory", "showKeyboardShortCuts", "openLabelDictionary", "openDownloadDialog", "hasDomainStory", "hasTitle", "isDirty", "isReplayable", "isReplaying"], [1, "smallScrollbar", "description"], ["title", "Hide Description", 1, "headerButton", 3, "click"], [1, "material-icons", "materialIconButton", "toggle"], ["title", "Show Description", 1, "headerButton", 3, "click"], [1, "descriptionText"]], + template: function HeaderComponent_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](0, "div", 0)(1, "input", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtwoWayListener"]("colorPickerChange", function AppComponent_Template_input_colorPickerChange_1_listener($event) { - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtwoWayBindingSet"](ctx.color, $event) || (ctx.color = $event); - return $event; + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](0, "mat-toolbar", 0)(1, "mat-toolbar-row"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtemplate"](2, HeaderComponent_Conditional_2_Template, 3, 0, "button", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](3, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtemplate"](4, HeaderComponent_Conditional_4_Template, 3, 0, "button", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](5, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](6, "div", 3)(7, "span", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("click", function HeaderComponent_Template_span_click_7_listener() { + return ctx.openHeaderDialog(); }); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵlistener"]("colorPickerClose", function AppComponent_Template_input_colorPickerClose_1_listener($event) { - return ctx.onColorChanged($event); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](8); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](9, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](10, "span", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtext"](11, " edit "); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()()(); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelement"](12, "span", 6); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtemplate"](13, HeaderComponent_Conditional_13_Template, 3, 3, "span", 7); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](14, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelement"](15, "span", 8); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementStart"](16, "app-header-buttons", 9); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](17, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](18, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵlistener"]("import", function HeaderComponent_Template_app_header_buttons_import_16_listener() { + return ctx.onImport(); + })("openSettings", function HeaderComponent_Template_app_header_buttons_openSettings_16_listener() { + return ctx.openSettings(); + })("startReplay", function HeaderComponent_Template_app_header_buttons_startReplay_16_listener() { + return ctx.startReplay(); + })("stopReplay", function HeaderComponent_Template_app_header_buttons_stopReplay_16_listener() { + return ctx.stopReplay(); + })("nextSentence", function HeaderComponent_Template_app_header_buttons_nextSentence_16_listener() { + return ctx.nextSentence(); + })("previousSentence", function HeaderComponent_Template_app_header_buttons_previousSentence_16_listener() { + return ctx.previousSentence(); + })("newStory", function HeaderComponent_Template_app_header_buttons_newStory_16_listener() { + return ctx.createNewDomainStory(); + })("showKeyboardShortCuts", function HeaderComponent_Template_app_header_buttons_showKeyboardShortCuts_16_listener() { + return ctx.openKeyboardShortcutsDialog(); + })("openLabelDictionary", function HeaderComponent_Template_app_header_buttons_openLabelDictionary_16_listener() { + return ctx.openLabelDictionary(); + })("openDownloadDialog", function HeaderComponent_Template_app_header_buttons_openDownloadDialog_16_listener() { + return ctx.openDownloadDialog(); }); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtemplate"](2, AppComponent_app_settings_2_Template, 1, 0, "app-settings", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](3, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](4, "div"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](5, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](6, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](7, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](8, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](9, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelement"](10, "app-header"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](11, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](12, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelement"](13, "app-modeler"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](14, "div"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](15, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipe"](16, "async"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](17, "span"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelement"](18, "img", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](19, "a", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](20, " egon.io"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](21, "span"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](22, "version: "); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](23, "a", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](24); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](25, "span"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](26, "by "); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelement"](27, "img", 6); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](28, "a", 7); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](29, "WPS"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](30, "span")(31, "a", 8); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](32, "Privacy"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementStart"](33, "span")(34, "a", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtext"](35, "Imprint"); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵelementEnd"]()()()(); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵelementEnd"]()()(); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtemplate"](19, HeaderComponent_Conditional_19_Template, 4, 3, "mat-card", 10); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipe"](20, "async"); } if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵstyleProp"]("background", ctx.color); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵproperty"]("cpPresetColors", ctx.colorBox); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtwoWayProperty"]("colorPicker", ctx.color); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵadvance"](); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](3, 20, ctx.showSettings$)); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵclassProp"]("headerAndCanvas", !_angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](5, 22, ctx.showSettings$) && _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](6, 24, ctx.showDescription$))("headerAndCanvasCollapsed", !_angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](7, 26, ctx.showSettings$) && !_angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](8, 28, ctx.showDescription$))("hidden", _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](9, 30, ctx.showSettings$)); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵadvance"](6); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵclassProp"]("header", _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](11, 32, ctx.showDescription$))("headerCollapsed", !_angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](12, 34, ctx.showDescription$)); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵclassProp"]("logoContainer", !_angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](15, 36, ctx.showSettings$))("hidden", _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵpipeBind1"](16, 38, ctx.showSettings$)); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵadvance"](10); - _angular_core__WEBPACK_IMPORTED_MODULE_9__["ɵɵtextInterpolate"](ctx.version); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵconditional"](2, _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](3, 10, ctx.showDescription) ? 2 : -1); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵconditional"](4, !_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](5, 12, ctx.showDescription) ? 4 : -1); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](9, 14, ctx.title$), " "); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](5); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵconditional"](13, _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](14, 16, ctx.isReplay$) ? 13 : -1); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](3); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵproperty"]("hasDomainStory", ctx.hasDomainStory)("hasTitle", ctx.hasTitle)("isDirty", _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](17, 18, ctx.isDirty$))("isReplayable", ctx.isReplayable)("isReplaying", _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](18, 20, ctx.isReplay$)); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵadvance"](3); + _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵconditional"](19, _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵpipeBind1"](20, 22, ctx.showDescription$) ? 19 : -1); } }, - dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_12__.NgIf, ngx_color_picker__WEBPACK_IMPORTED_MODULE_11__.ColorPickerDirective, src_app_Presentation_Header_header_component__WEBPACK_IMPORTED_MODULE_6__.HeaderComponent, src_app_Presentation_Settings_settings_component__WEBPACK_IMPORTED_MODULE_7__.SettingsComponent, src_app_Presentation_Canvas_modeler_component__WEBPACK_IMPORTED_MODULE_8__.ModelerComponent, _angular_common__WEBPACK_IMPORTED_MODULE_12__.AsyncPipe], - styles: [".content[_ngcontent-%COMP%] {\n height: 100%;\n overflow: hidden;\n}\n\n\n\n.headerAndCanvas[_ngcontent-%COMP%] {\n height: 100%;\n width: 100%;\n display: grid;\n grid-template-rows: min-content auto;\n overflow: hidden;\n}\n\n.headerAndCanvasCollapsed[_ngcontent-%COMP%] {\n height: 100%;\n width: 100%;\n display: grid;\n grid-template-rows: min-content auto;\n overflow: hidden;\n}\n\n.settings[_ngcontent-%COMP%] {\n height: 100%;\n}\n\n.header[_ngcontent-%COMP%] {\n display: grid;\n grid-template-rows: min-content 155px;\n}\n\n\n\n.logoContainer[_ngcontent-%COMP%] {\n display: flex;\n position: absolute;\n bottom: 0;\n right: 100px;\n align-items: flex-end;\n}\n.logoContainer[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n margin-left: 16px;\n margin-bottom: 14px;\n align-items: center;\n}\n\n.hidden[_ngcontent-%COMP%] {\n height: 1px;\n width: 1px;\n}\n\n#wrapper[_ngcontent-%COMP%] {\n padding: 16px;\n min-height: 100%;\n height: 100%;\n box-sizing: border-box; \n\n}\n\n#tab-group[_ngcontent-%COMP%] {\n height: 100%;\n}\n\n#tab-group[_ngcontent-%COMP%] mat-tab-body[_ngcontent-%COMP%] {\n flex-grow: 1;\n}\n\n.mat-button-toggle-label-content[_ngcontent-%COMP%] {\n font-size: 10pt !important;\n padding: 0 5px !important;\n line-height: inherit !important;\n}\n\n .mdc-text-field--filled:not(.mdc-text-field--disabled) {\n background-color: white;\n}\n\nspan[_ngcontent-%COMP%] *[_ngcontent-%COMP%] {\n vertical-align: middle;\n}\n\nspan[_ngcontent-%COMP%] {\n height: 24px;\n}"] + dependencies: [_header_buttons_header_buttons_component__WEBPACK_IMPORTED_MODULE_9__.HeaderButtonsComponent, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_13__.MatToolbar, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_13__.MatToolbarRow, _angular_material_card__WEBPACK_IMPORTED_MODULE_14__.MatCard, _angular_common__WEBPACK_IMPORTED_MODULE_15__.AsyncPipe], + styles: [".description[_ngcontent-%COMP%] {\n top: 0;\n max-width: 100vw;\n overflow-y: scroll;\n display: grid;\n}\n\n.descriptionText[_ngcontent-%COMP%] {\n position: relative;\n font-size: 10pt;\n overflow-wrap: anywhere;\n word-wrap: anywhere;\n white-space: pre-wrap;\n padding-top: 15px;\n padding-left: 15px;\n padding-right: 15px;\n line-height: 12pt;\n}\n\n.description[_ngcontent-%COMP%]:hover {\n cursor: default;\n}\n\n.titleSpacer[_ngcontent-%COMP%] {\n flex: 1 1 auto;\n}\n\n.buttonSpacer[_ngcontent-%COMP%] {\n margin-right: 15px;\n}\n\n.headline[_ngcontent-%COMP%]:hover > .editIcon[_ngcontent-%COMP%] {\n display: contents;\n}\n\n.headline[_ngcontent-%COMP%] > .editIcon[_ngcontent-%COMP%] {\n display: none;\n}\n\n.headerButton[_ngcontent-%COMP%] {\n color: white;\n}\n\n.headerButton[_ngcontent-%COMP%]:hover {\n cursor: pointer;\n}\n\n.nowrap[_ngcontent-%COMP%] {\n white-space: nowrap;\n}\n\n.mat-toolbar-row[_ngcontent-%COMP%] {\n white-space: normal;\n height: min-content;\n min-height: 5rem;\n}\n\n.titel-scrollbar[_ngcontent-%COMP%] {\n max-height: 10rem;\n overflow: auto;\n scrollbar-width: none;\n max-width: 100rem;\n}"] }); } - return AppComponent; + return HeaderComponent; })(); /***/ }), -/***/ 50635: -/*!*******************************!*\ - !*** ./src/app/app.module.ts ***! - \*******************************/ +/***/ 94781: +/*!***************************************************************************************!*\ + !*** ./src/app/workbench/presentation/settings/general/general-settings.component.ts ***! + \***************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AppModule: () => (/* binding */ AppModule) +/* harmony export */ GeneralSettingsComponent: () => (/* binding */ GeneralSettingsComponent) /* harmony export */ }); -/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @angular/platform-browser */ 76098); -/* harmony import */ var _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @angular/material/checkbox */ 63422); -/* harmony import */ var _angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @angular/platform-browser/animations */ 7573); -/* harmony import */ var src_app_Presentation_Header_header_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/Presentation/Header/header.component */ 91729); -/* harmony import */ var src_app_Presentation_Settings_settings_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/Presentation/Settings/settings.component */ 1261); -/* harmony import */ var src_app_app_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/app.component */ 20092); -/* harmony import */ var src_app_Service_Export_export_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/Service/Export/export.service */ 98106); -/* harmony import */ var src_app_Service_Import_import_domain_story_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/Service/Import/import-domain-story.service */ 23779); -/* harmony import */ var src_app_Service_Import_import_repair_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/Service/Import/import-repair.service */ 75158); -/* harmony import */ var src_app_Service_Modeler_modeler_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/Service/Modeler/modeler.service */ 74676); -/* harmony import */ var src_app_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/Service/Title/title.service */ 69672); -/* harmony import */ var src_app_Service_LabelDictionary_label_dictionary_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/Service/LabelDictionary/label-dictionary.service */ 59783); -/* harmony import */ var src_app_Service_Replay_replay_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/Service/Replay/replay.service */ 94788); -/* harmony import */ var src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! src/app/Service/ElementRegistry/element-registry.service */ 67613); -/* harmony import */ var src_app_Service_IconSetConfiguration_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! src/app/Service/IconSetConfiguration/icon-set-configuration.service */ 10200); -/* harmony import */ var src_app_Service_LabelDictionary_mass_naming_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! src/app/Service/LabelDictionary/mass-naming.service */ 37509); -/* harmony import */ var src_app_Presentation_Dialog_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! src/app/Presentation/Dialog/info-dialog/info-dialog.component */ 16266); -/* harmony import */ var src_app_Presentation_Dialog_export_dialog_export_dialog_component__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! src/app/Presentation/Dialog/export-dialog/export-dialog.component */ 97218); -/* harmony import */ var src_app_Presentation_Dialog_activity_dialog_activity_dialog_component__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! src/app/Presentation/Dialog/activity-dialog/activity-dialog.component */ 63954); -/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @angular/forms */ 37222); -/* harmony import */ var src_app_Presentation_Dialog_header_dialog_header_dialog_component__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! src/app/Presentation/Dialog/header-dialog/header-dialog.component */ 21270); -/* harmony import */ var src_app_Service_IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! src/app/Service/IconSetConfiguration/icon-dictionary.service */ 93689); -/* harmony import */ var src_app_Presentation_Canvas_modeler_component__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! src/app/Presentation/Canvas/modeler.component */ 29383); -/* harmony import */ var src_app_Modules_settings_module__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! src/app/Modules/settings.module */ 47261); -/* harmony import */ var _Service_Autosave_autosave_service__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Service/Autosave/autosave.service */ 30534); -/* harmony import */ var _Modules_domain_story_modeler_module_module__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./Modules/domain-story-modeler-module.module */ 76330); -/* harmony import */ var _Presentation_Dialog_label_dictionary_dialog_label_dictionary_dialog_component__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Presentation/Dialog/label-dictionary-dialog/label-dictionary-dialog.component */ 23958); -/* harmony import */ var _material_module__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./material.module */ 89439); -/* harmony import */ var ngx_color_picker__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ngx-color-picker */ 54743); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @angular/core */ 2978); - - - +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var _tools_autosave_presentation_AutosaveSettings_autosave_settings_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../tools/autosave/presentation/AutosaveSettings/autosave-settings.component */ 91525); +let GeneralSettingsComponent = /*#__PURE__*/(() => { + class GeneralSettingsComponent { + static #_ = this.ɵfac = function GeneralSettingsComponent_Factory(t) { + return new (t || GeneralSettingsComponent)(); + }; + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ + type: GeneralSettingsComponent, + selectors: [["app-general-settings"]], + decls: 2, + vars: 0, + consts: [[1, "content"]], + template: function GeneralSettingsComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "div", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](1, "app-autosave-settings"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + } + }, + dependencies: [_tools_autosave_presentation_AutosaveSettings_autosave_settings_component__WEBPACK_IMPORTED_MODULE_0__.AutosaveSettingsComponent], + styles: [".content[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: 450px auto;\n}"] + }); + } + return GeneralSettingsComponent; +})(); +/***/ }), +/***/ 45263: +/*!***********************************************************************!*\ + !*** ./src/app/workbench/presentation/settings/settings.component.ts ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SettingsComponent: () => (/* binding */ SettingsComponent) +/* harmony export */ }); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 95981); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 2978); +/* harmony import */ var src_app_workbench_services_settings_settings_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/workbench/services/settings/settings.service */ 1299); +/* harmony import */ var src_app_tools_modeler_services_modeler_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/tools/modeler/services/modeler.service */ 40439); +/* harmony import */ var _tools_icon_set_config_services_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../tools/icon-set-config/services/icon-set-customization.service */ 46252); +/* harmony import */ var _general_general_settings_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./general/general-settings.component */ 94781); +/* harmony import */ var src_app_tools_icon_set_config_presentation_icon_set_configuration_icon_set_configuration_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/tools/icon-set-config/presentation/icon-set-configuration/icon-set-configuration.component */ 26103); +/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/button */ 72221); +/* harmony import */ var _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/toolbar */ 23550); +/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ 56610); @@ -74803,9 +74706,122 @@ __webpack_require__.r(__webpack_exports__); +function SettingsComponent_Conditional_15_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelement"](0, "app-general-settings"); + } +} +function SettingsComponent_Conditional_17_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelement"](0, "app-icon-set-configuration"); + } +} +let SettingsComponent = /*#__PURE__*/(() => { + class SettingsComponent { + constructor(settingsService, modelerService, iconSetCustomizationService) { + this.settingsService = settingsService; + this.modelerService = modelerService; + this.iconSetCustomizationService = iconSetCustomizationService; + this.showGeneralSettings = new rxjs__WEBPACK_IMPORTED_MODULE_6__.BehaviorSubject(false); + this.showIconSetCustomization = new rxjs__WEBPACK_IMPORTED_MODULE_6__.BehaviorSubject(true); + } + close() { + const savedConfiguration = this.iconSetCustomizationService.getAndClearSavedConfiguration(); + if (savedConfiguration) { + this.modelerService.restart(savedConfiguration); + } + this.settingsService.close(); + } + openGeneralSettings() { + this.showGeneralSettings.next(true); + this.showIconSetCustomization.next(false); + } + openIconSetCustomization() { + this.showGeneralSettings.next(false); + this.showIconSetCustomization.next(true); + } + static #_ = this.ɵfac = function SettingsComponent_Factory(t) { + return new (t || SettingsComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdirectiveInject"](src_app_workbench_services_settings_settings_service__WEBPACK_IMPORTED_MODULE_0__.SettingsService), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdirectiveInject"](src_app_tools_modeler_services_modeler_service__WEBPACK_IMPORTED_MODULE_1__.ModelerService), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdirectiveInject"](_tools_icon_set_config_services_icon_set_customization_service__WEBPACK_IMPORTED_MODULE_2__.IconSetCustomizationService)); + }; + static #_2 = this.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineComponent"]({ + type: SettingsComponent, + selectors: [["app-settings"]], + decls: 19, + vars: 14, + consts: [[1, "settings"], ["color", "primary", 1, "toolbar"], ["mat-icon-button", "", 1, "headerButton", "noPadding", 3, "click"], [1, "material-icons-outlined", "materialIconButton"], [1, "paddedButton"], ["mat-button", "", 1, "headerButton", "mr-10", 3, "click"], [1, "headline"], ["mat-button", "", 1, "headerButton", 3, "click"]], + template: function SettingsComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementStart"](0, "div", 0)(1, "mat-toolbar", 1)(2, "mat-toolbar-row")(3, "button", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵlistener"]("click", function SettingsComponent_Template_button_click_3_listener() { + return ctx.close(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementStart"](4, "span", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵtext"](5, " arrow_back"); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementStart"](6, "div", 4)(7, "button", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipe"](8, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵlistener"]("click", function SettingsComponent_Template_button_click_7_listener() { + return ctx.openIconSetCustomization(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementStart"](9, "span", 6); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵtext"](10, "Customize Icons for Your Domain"); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementStart"](11, "button", 7); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipe"](12, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵlistener"]("click", function SettingsComponent_Template_button_click_11_listener() { + return ctx.openGeneralSettings(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementStart"](13, "span", 6); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵtext"](14, "General Settings"); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementEnd"]()()()()(); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵtemplate"](15, SettingsComponent_Conditional_15_Template, 1, 0, "app-general-settings"); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipe"](16, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵtemplate"](17, SettingsComponent_Conditional_17_Template, 1, 0, "app-icon-set-configuration"); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipe"](18, "async"); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵelementEnd"](); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵadvance"](7); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵclassProp"]("highlight", _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipeBind1"](8, 6, ctx.showIconSetCustomization)); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵadvance"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵclassProp"]("highlight", _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipeBind1"](12, 8, ctx.showGeneralSettings)); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵadvance"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵconditional"](15, _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipeBind1"](16, 10, ctx.showGeneralSettings) ? 15 : -1); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵconditional"](17, _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵpipeBind1"](18, 12, ctx.showIconSetCustomization) ? 17 : -1); + } + }, + dependencies: [_general_general_settings_component__WEBPACK_IMPORTED_MODULE_3__.GeneralSettingsComponent, src_app_tools_icon_set_config_presentation_icon_set_configuration_icon_set_configuration_component__WEBPACK_IMPORTED_MODULE_4__.IconSetConfigurationComponent, _angular_material_button__WEBPACK_IMPORTED_MODULE_7__.MatButton, _angular_material_button__WEBPACK_IMPORTED_MODULE_7__.MatIconButton, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_8__.MatToolbar, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_8__.MatToolbarRow, _angular_common__WEBPACK_IMPORTED_MODULE_9__.AsyncPipe], + styles: ["mat-toolbar[_ngcontent-%COMP%] *[_ngcontent-%COMP%] {\n color: white;\n}\n\napp-general-settings[_ngcontent-%COMP%] {\n overflow-y: auto;\n}\n\n.settings[_ngcontent-%COMP%] {\n display: grid;\n grid-template-rows: 65px auto;\n width: 100%;\n height: 100%;\n}\n.settings[_ngcontent-%COMP%] .mat-button {\n padding: 0;\n}\n.settings[_ngcontent-%COMP%] .materialIconButton[_ngcontent-%COMP%] {\n margin-top: 0;\n margin-right: 5px;\n padding: 0;\n}\n\n.highlight[_ngcontent-%COMP%] {\n border: 2px solid white;\n}\n\n .mat-tab-label, .mat-tab-label-active {\n height: 30px !important;\n}"] + }); + } + return SettingsComponent; +})(); +/***/ }), +/***/ 98830: +/*!********************************************************************!*\ + !*** ./src/app/workbench/presentation/settings/settings.module.ts ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SettingsModule: () => (/* binding */ SettingsModule) +/* harmony export */ }); +/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ 56610); +/* harmony import */ var src_app_tools_icon_set_config_presentation_icon_set_configuration_icon_set_configuration_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! src/app/tools/icon-set-config/presentation/icon-set-configuration/icon-set-configuration.component */ 26103); +/* harmony import */ var _tools_icon_set_config_presentation_icon_list_item_icon_list_item_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../tools/icon-set-config/presentation/icon-list-item/icon-list-item.component */ 10665); +/* harmony import */ var _tools_icon_set_config_presentation_details_list_item_details_list_item_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../tools/icon-set-config/presentation/details-list-item/details-list-item.component */ 21135); +/* harmony import */ var _tools_icon_set_config_presentation_icon_set_details_icon_set_details_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../tools/icon-set-config/presentation/icon-set-details/icon-set-details.component */ 31415); +/* harmony import */ var _general_general_settings_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./general/general-settings.component */ 94781); +/* harmony import */ var _tools_label_dictionary_presentation_label_dictionary_label_dictionary_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../tools/label-dictionary/presentation/label-dictionary/label-dictionary.component */ 36921); +/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/forms */ 37222); +/* harmony import */ var _material_module__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../material.module */ 89439); +/* harmony import */ var _tools_autosave_presentation_autosave_settings_module__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../tools/autosave/presentation/autosave-settings.module */ 63246); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/core */ 2978); @@ -74816,101 +74832,68 @@ __webpack_require__.r(__webpack_exports__); -let AppModule = /*#__PURE__*/(() => { - class AppModule { - constructor(autosaveService) { - this.autosaveService = autosaveService; - // autosaveService wird so automatisch initialisiert, auf keinen Fall entfernen! - } - ngDoBootstrap(app) { - const componentElement = document.createElement('app-root'); - document.body.append(componentElement); - app.bootstrap(src_app_app_component__WEBPACK_IMPORTED_MODULE_2__.AppComponent); - } - static #_ = this.ɵfac = function AppModule_Factory(t) { - return new (t || AppModule)(_angular_core__WEBPACK_IMPORTED_MODULE_24__["ɵɵinject"](_Service_Autosave_autosave_service__WEBPACK_IMPORTED_MODULE_20__.AutosaveService)); +let SettingsModule = /*#__PURE__*/(() => { + class SettingsModule { + static #_ = this.ɵfac = function SettingsModule_Factory(t) { + return new (t || SettingsModule)(); }; - static #_2 = this.ɵmod = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_24__["ɵɵdefineNgModule"]({ - type: AppModule + static #_2 = this.ɵmod = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdefineNgModule"]({ + type: SettingsModule }); - static #_3 = this.ɵinj = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_24__["ɵɵdefineInjector"]({ - providers: [_Service_Autosave_autosave_service__WEBPACK_IMPORTED_MODULE_20__.AutosaveService, src_app_Service_Export_export_service__WEBPACK_IMPORTED_MODULE_3__.ExportService, src_app_Service_Import_import_domain_story_service__WEBPACK_IMPORTED_MODULE_4__.ImportDomainStoryService, src_app_Service_Import_import_repair_service__WEBPACK_IMPORTED_MODULE_5__.ImportRepairService, src_app_Service_IconSetConfiguration_icon_dictionary_service__WEBPACK_IMPORTED_MODULE_17__.IconDictionaryService, src_app_Service_Title_title_service__WEBPACK_IMPORTED_MODULE_7__.TitleService, src_app_Service_LabelDictionary_label_dictionary_service__WEBPACK_IMPORTED_MODULE_8__.LabelDictionaryService, src_app_Service_Replay_replay_service__WEBPACK_IMPORTED_MODULE_9__.ReplayService, src_app_Service_ElementRegistry_element_registry_service__WEBPACK_IMPORTED_MODULE_10__.ElementRegistryService, src_app_Service_IconSetConfiguration_icon_set_configuration_service__WEBPACK_IMPORTED_MODULE_11__.IconSetConfigurationService, src_app_Service_Modeler_modeler_service__WEBPACK_IMPORTED_MODULE_6__.ModelerService, src_app_Service_LabelDictionary_mass_naming_service__WEBPACK_IMPORTED_MODULE_12__.MassNamingService, _angular_forms__WEBPACK_IMPORTED_MODULE_25__.UntypedFormBuilder, { - provide: _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_26__.MAT_CHECKBOX_DEFAULT_OPTIONS, - useValue: { - clickAction: 'noop' - } - }], - imports: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_27__.BrowserModule, _angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_28__.NoopAnimationsModule, _angular_forms__WEBPACK_IMPORTED_MODULE_25__.ReactiveFormsModule, src_app_Modules_settings_module__WEBPACK_IMPORTED_MODULE_19__.SettingsModule, _Modules_domain_story_modeler_module_module__WEBPACK_IMPORTED_MODULE_21__.DomainStoryModelerModuleModule, _material_module__WEBPACK_IMPORTED_MODULE_23__.MaterialModule, ngx_color_picker__WEBPACK_IMPORTED_MODULE_29__.ColorPickerModule] + static #_3 = this.ɵinj = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdefineInjector"]({ + imports: [_tools_autosave_presentation_autosave_settings_module__WEBPACK_IMPORTED_MODULE_7__.AutosaveSettingsModule, _angular_common__WEBPACK_IMPORTED_MODULE_9__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_10__.FormsModule, _material_module__WEBPACK_IMPORTED_MODULE_6__.MaterialModule] }); } - return AppModule; + return SettingsModule; })(); (function () { - (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_24__["ɵɵsetNgModuleScope"](AppModule, { - declarations: [src_app_Presentation_Header_header_component__WEBPACK_IMPORTED_MODULE_0__.HeaderComponent, src_app_Presentation_Settings_settings_component__WEBPACK_IMPORTED_MODULE_1__.SettingsComponent, src_app_app_component__WEBPACK_IMPORTED_MODULE_2__.AppComponent, src_app_Presentation_Dialog_info_dialog_info_dialog_component__WEBPACK_IMPORTED_MODULE_13__.InfoDialogComponent, src_app_Presentation_Dialog_export_dialog_export_dialog_component__WEBPACK_IMPORTED_MODULE_14__.ExportDialogComponent, src_app_Presentation_Dialog_activity_dialog_activity_dialog_component__WEBPACK_IMPORTED_MODULE_15__.ActivityDialogComponent, src_app_Presentation_Dialog_header_dialog_header_dialog_component__WEBPACK_IMPORTED_MODULE_16__.HeaderDialogComponent, src_app_Presentation_Canvas_modeler_component__WEBPACK_IMPORTED_MODULE_18__.ModelerComponent, _Presentation_Dialog_label_dictionary_dialog_label_dictionary_dialog_component__WEBPACK_IMPORTED_MODULE_22__.LabelDictionaryDialogComponent], - imports: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_27__.BrowserModule, _angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_28__.NoopAnimationsModule, _angular_forms__WEBPACK_IMPORTED_MODULE_25__.ReactiveFormsModule, src_app_Modules_settings_module__WEBPACK_IMPORTED_MODULE_19__.SettingsModule, _Modules_domain_story_modeler_module_module__WEBPACK_IMPORTED_MODULE_21__.DomainStoryModelerModuleModule, _material_module__WEBPACK_IMPORTED_MODULE_23__.MaterialModule, ngx_color_picker__WEBPACK_IMPORTED_MODULE_29__.ColorPickerModule] + (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵsetNgModuleScope"](SettingsModule, { + declarations: [src_app_tools_icon_set_config_presentation_icon_set_configuration_icon_set_configuration_component__WEBPACK_IMPORTED_MODULE_0__.IconSetConfigurationComponent, _general_general_settings_component__WEBPACK_IMPORTED_MODULE_4__.GeneralSettingsComponent, _tools_label_dictionary_presentation_label_dictionary_label_dictionary_component__WEBPACK_IMPORTED_MODULE_5__.LabelDictionaryComponent, _tools_icon_set_config_presentation_icon_list_item_icon_list_item_component__WEBPACK_IMPORTED_MODULE_1__.IconListItemComponent, _tools_icon_set_config_presentation_details_list_item_details_list_item_component__WEBPACK_IMPORTED_MODULE_2__.DetailsListItemComponent, _tools_icon_set_config_presentation_icon_set_details_icon_set_details_component__WEBPACK_IMPORTED_MODULE_3__.IconSetDetailsComponent], + imports: [_tools_autosave_presentation_autosave_settings_module__WEBPACK_IMPORTED_MODULE_7__.AutosaveSettingsModule, _angular_common__WEBPACK_IMPORTED_MODULE_9__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_10__.FormsModule, _material_module__WEBPACK_IMPORTED_MODULE_6__.MaterialModule], + exports: [_general_general_settings_component__WEBPACK_IMPORTED_MODULE_4__.GeneralSettingsComponent, src_app_tools_icon_set_config_presentation_icon_set_configuration_icon_set_configuration_component__WEBPACK_IMPORTED_MODULE_0__.IconSetConfigurationComponent, _tools_label_dictionary_presentation_label_dictionary_label_dictionary_component__WEBPACK_IMPORTED_MODULE_5__.LabelDictionaryComponent] }); })(); /***/ }), -/***/ 89439: -/*!************************************!*\ - !*** ./src/app/material.module.ts ***! - \************************************/ +/***/ 1299: +/*!*****************************************************************!*\ + !*** ./src/app/workbench/services/settings/settings.service.ts ***! + \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ MaterialModule: () => (/* binding */ MaterialModule) +/* harmony export */ SettingsService: () => (/* binding */ SettingsService) /* harmony export */ }); -/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/dialog */ 44053); -/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/form-field */ 29344); -/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/input */ 92583); -/* harmony import */ var _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/material/toolbar */ 23550); -/* harmony import */ var _angular_material_expansion__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/material/expansion */ 71288); -/* harmony import */ var _angular_material_card__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/material/card */ 90643); -/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/snack-bar */ 93289); -/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/material/button */ 72221); -/* harmony import */ var _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/grid-list */ 81322); -/* harmony import */ var _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/button-toggle */ 26470); -/* harmony import */ var _angular_material_list__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/list */ 93901); -/* harmony import */ var _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/checkbox */ 63422); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2978); - - - - - - - - - - - +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 95981); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 2978); -let MaterialModule = /*#__PURE__*/(() => { - class MaterialModule { - static #_ = this.ɵfac = function MaterialModule_Factory(t) { - return new (t || MaterialModule)(); +let SettingsService = /*#__PURE__*/(() => { + class SettingsService { + constructor() { + this.showSettings = new rxjs__WEBPACK_IMPORTED_MODULE_0__.BehaviorSubject(false); + this.showSettings$ = this.showSettings.asObservable(); + } + close() { + this.showSettings.next(false); + } + open() { + this.showSettings.next(true); + } + static #_ = this.ɵfac = function SettingsService_Factory(t) { + return new (t || SettingsService)(); }; - static #_2 = this.ɵmod = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ - type: MaterialModule - }); - static #_3 = this.ɵinj = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ - imports: [_angular_material_button__WEBPACK_IMPORTED_MODULE_1__.MatButtonModule, _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_2__.MatButtonToggleModule, _angular_material_list__WEBPACK_IMPORTED_MODULE_3__.MatListModule, _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_4__.MatCheckboxModule, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__.MatDialogModule, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatFormFieldModule, _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_7__.MatGridListModule, _angular_material_input__WEBPACK_IMPORTED_MODULE_8__.MatInputModule, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__.MatToolbarModule, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_10__.MatExpansionModule, _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__.MatSnackBarModule, _angular_material_card__WEBPACK_IMPORTED_MODULE_12__.MatCardModule, _angular_material_button__WEBPACK_IMPORTED_MODULE_1__.MatButtonModule, _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_2__.MatButtonToggleModule, _angular_material_list__WEBPACK_IMPORTED_MODULE_3__.MatListModule, _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_4__.MatCheckboxModule, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__.MatDialogModule, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatFormFieldModule, _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_7__.MatGridListModule, _angular_material_input__WEBPACK_IMPORTED_MODULE_8__.MatInputModule, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__.MatToolbarModule, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_10__.MatExpansionModule, _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__.MatSnackBarModule, _angular_material_card__WEBPACK_IMPORTED_MODULE_12__.MatCardModule] + static #_2 = this.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ + token: SettingsService, + factory: SettingsService.ɵfac, + providedIn: 'root' }); } - return MaterialModule; -})(); -(function () { - (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsetNgModuleScope"](MaterialModule, { - imports: [_angular_material_button__WEBPACK_IMPORTED_MODULE_1__.MatButtonModule, _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_2__.MatButtonToggleModule, _angular_material_list__WEBPACK_IMPORTED_MODULE_3__.MatListModule, _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_4__.MatCheckboxModule, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__.MatDialogModule, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatFormFieldModule, _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_7__.MatGridListModule, _angular_material_input__WEBPACK_IMPORTED_MODULE_8__.MatInputModule, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__.MatToolbarModule, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_10__.MatExpansionModule, _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__.MatSnackBarModule, _angular_material_card__WEBPACK_IMPORTED_MODULE_12__.MatCardModule], - exports: [_angular_material_button__WEBPACK_IMPORTED_MODULE_1__.MatButtonModule, _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_2__.MatButtonToggleModule, _angular_material_list__WEBPACK_IMPORTED_MODULE_3__.MatListModule, _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_4__.MatCheckboxModule, _angular_material_dialog__WEBPACK_IMPORTED_MODULE_5__.MatDialogModule, _angular_material_form_field__WEBPACK_IMPORTED_MODULE_6__.MatFormFieldModule, _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_7__.MatGridListModule, _angular_material_input__WEBPACK_IMPORTED_MODULE_8__.MatInputModule, _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_9__.MatToolbarModule, _angular_material_expansion__WEBPACK_IMPORTED_MODULE_10__.MatExpansionModule, _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_11__.MatSnackBarModule, _angular_material_card__WEBPACK_IMPORTED_MODULE_12__.MatCardModule] - }); + return SettingsService; })(); /***/ }), @@ -74928,7 +74911,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); const environment = { production: true, - version: '2.0.0-beta7' + version: '2.0.0' }; /***/ }), diff --git a/app-v2/styles.8026ff48f3925111.css b/app-v2/styles.f399a54f2c7a2e02.css similarity index 99% rename from app-v2/styles.8026ff48f3925111.css rename to app-v2/styles.f399a54f2c7a2e02.css index d30ee5b..f7cf66e 100644 --- a/app-v2/styles.8026ff48f3925111.css +++ b/app-v2/styles.f399a54f2c7a2e02.css @@ -3568,9 +3568,8 @@ mat-dialog-actions.mdc-dialog__actions { /* BPMN elements */ .djs-overlay-context-pad { - width: 120px; - height: 238px; - overflow-y: auto; + min-width: 7.5rem; + height: auto; } .djs-context-pad.open {