From f3e0dcb9fa543db21517e8bbff6a72f5e9dbe903 Mon Sep 17 00:00:00 2001 From: German Bisurgi Date: Wed, 26 Jun 2024 19:33:01 +0200 Subject: [PATCH] UI improvements and cleanup --- dist/jedi.js | 126 +++++++++++++++++++++++++------------- docs/js/jedi.js | 126 +++++++++++++++++++++++++------------- src/editors/array.js | 8 ++- src/themes/bootstrap3.js | 15 +++-- src/themes/bootstrap4.js | 16 ++--- src/themes/bootstrap5.js | 17 +++-- src/themes/icons/icons.js | 6 -- src/themes/theme.js | 62 ++++++++++++++++--- todo.md | 12 +--- 9 files changed, 251 insertions(+), 137 deletions(-) diff --git a/dist/jedi.js b/dist/jedi.js index 45b3698..3e44b14 100644 --- a/dist/jedi.js +++ b/dist/jedi.js @@ -222,11 +222,13 @@ class EditorArray extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { const deleteBtn = this.theme.getDeleteItemBtn() const moveUpBtn = this.theme.getMoveUpItemBtn() const moveDownBtn = this.theme.getMoveDownItemBtn() + const btnGroup = this.theme.getBtnGroup() child.ui.control.arrayActions.innerHTML = '' - child.ui.control.arrayActions.appendChild(deleteBtn) - child.ui.control.arrayActions.appendChild(moveUpBtn) - child.ui.control.arrayActions.appendChild(moveDownBtn) + child.ui.control.arrayActions.appendChild(btnGroup) + btnGroup.appendChild(deleteBtn) + btnGroup.appendChild(moveUpBtn) + btnGroup.appendChild(moveDownBtn) this.control.childrenSlot.appendChild(child.ui.control.container) @@ -4026,6 +4028,13 @@ class ThemeBootstrap3 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] this.useToggleEvents = false } + getAddPropertyButton () { + const btn = super.getAddPropertyButton() + btn.classList.add('btn-primary') + btn.classList.add('btn-block') + return btn + } + getCollapseToggle (config) { const toggle = super.getCollapseToggle(config) toggle.setAttribute('href', '#' + config.collapseId) @@ -4173,14 +4182,6 @@ class ThemeBootstrap3 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] return control } - getSwitcher (config) { - const control = super.getSwitcher(config) - const { container, input } = control - container.classList.remove('form-group') - input.classList.remove('form-control') - return control - } - getAlert (config) { const html = super.getAlert(config) html.classList.add('alert') @@ -4288,6 +4289,13 @@ class ThemeBootstrap4 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] this.useToggleEvents = false } + getAddPropertyButton () { + const btn = super.getAddPropertyButton() + btn.classList.add('btn-primary') + btn.classList.add('btn-block') + return btn + } + getCollapseToggle (config) { const toggle = super.getCollapseToggle(config) toggle.setAttribute('href', '#' + config.collapseId) @@ -4345,6 +4353,7 @@ class ThemeBootstrap4 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] getCardBody () { const html = super.getCardBody() html.classList.add('card-body') + html.classList.add('pb-0') return html } @@ -4440,14 +4449,6 @@ class ThemeBootstrap4 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] return control } - getSwitcher (config) { - const control = super.getSwitcher(config) - const { container, input } = control - container.classList.remove('form-group') - input.classList.remove('form-control') - return control - } - getAlert (config) { const html = super.getAlert(config) html.classList.add('alert') @@ -4563,6 +4564,13 @@ class ThemeBootstrap5 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] this.useToggleEvents = false } + getAddPropertyButton () { + const btn = super.getAddPropertyButton() + btn.classList.add('btn-primary') + btn.classList.add('w-100') + return btn + } + getCollapseToggle (config) { const toggle = super.getCollapseToggle(config) toggle.setAttribute('href', '#' + config.collapseId) @@ -4619,6 +4627,7 @@ class ThemeBootstrap5 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] getCardBody () { const html = super.getCardBody() html.classList.add('card-body') + html.classList.add('pb-0') return html } @@ -4724,15 +4733,6 @@ class ThemeBootstrap5 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] return control } - getSwitcher (config) { - const control = super.getSwitcher(config) - const { container, input, label } = control - container.classList.remove('mb-3') - input.classList.remove('form-select') - this.visuallyHidden(label) - return control - } - getAlert (config) { const html = super.getAlert(config) html.classList.add('alert') @@ -4853,7 +4853,6 @@ const glyphicons = { add: 'glyphicon glyphicon-plus', moveUp: 'glyphicon glyphicon-arrow-up', moveDown: 'glyphicon glyphicon-arrow-down', - expand: 'glyphicon glyphicon-chevron-right', collapse: 'glyphicon glyphicon-chevron-down' } @@ -4867,7 +4866,6 @@ const bootstrapIcons = { add: 'bi bi-plus', moveUp: 'bi bi-arrow-up', moveDown: 'bi bi-arrow-down', - expand: 'bi bi-chevron-right', collapse: 'bi bi-chevron-down' } @@ -4881,7 +4879,6 @@ const fontAwesome3 = { add: 'icon-plus', moveUp: 'icon-arrow-up', moveDown: 'icon-arrow-down', - expand: 'icon-chevron-right', collapse: 'icon-chevron-down' } @@ -4895,7 +4892,6 @@ const fontAwesome4 = { add: 'fa fa-plus', moveUp: 'fa fa-arrow-up', moveDown: 'fa fa-arrow-down', - expand: 'fa fa-chevron-right', collapse: 'fa fa-chevron-down' } @@ -4909,7 +4905,6 @@ const fontAwesome5 = { add: 'fas fa-plus', moveUp: 'fas fa-arrow-up', moveDown: 'fas fa-arrow-down', - expand: 'fas fa-chevron-right', collapse: 'fas fa-chevron-down' } @@ -4923,7 +4918,6 @@ const fontAwesome6 = { add: 'fa-solid fa-plus', moveUp: 'fa-solid fa-arrow-up', moveDown: 'fa-solid fa-arrow-down', - expand: 'fa-solid fa-chevron-right', collapse: 'fa-solid fa-chevron-down' } @@ -5056,7 +5050,7 @@ class Theme { * @private */ getArrayActionsSlot () { - const html = this.getBtnGroup() + const html = document.createElement('span') html.classList.add('jedi-array-actions-slot') return html } @@ -5153,6 +5147,24 @@ class Theme { }) } + let collapsed = config.startCollapsed + + toggle.style.transition = 'transform 0.1s ease' + + if (collapsed) { + toggle.style.transform = 'rotate(90deg)' + } + + toggle.addEventListener('click', () => { + if (collapsed) { + toggle.style.transform = 'rotate(0deg)' + } else { + toggle.style.transform = 'rotate(90deg)' + } + + collapsed = !collapsed + }) + return toggle } @@ -5215,7 +5227,6 @@ class Theme { getBtnGroup () { const html = document.createElement('span') html.classList.add('jedi-btn-group') - html.style.display = 'initial' return html } @@ -5258,7 +5269,7 @@ class Theme { */ getArrayBtnAdd () { const html = this.getButton({ - textContent: 'Add item into', + textContent: 'Add item', icon: 'add' }) html.classList.add('jedi-array-add') @@ -5380,7 +5391,8 @@ class Theme { id: 'collapse-toggle-' + config.id, icon: 'collapse', collapseId: collapseId, - collapse: collapse + collapse: collapse, + startCollapsed: config.startCollapsed }) const propertiesActivators = this.getPropertiesActivators() @@ -5415,6 +5427,7 @@ class Theme { if (config.addProperty) { propertiesContainer.appendChild(addPropertyControl.container) propertiesContainer.appendChild(addPropertyBtn) + propertiesContainer.appendChild(document.createElement('hr')) } if (config.enablePropertiesToggle) { @@ -5482,7 +5495,8 @@ class Theme { id: 'collapse-toggle-' + config.id, icon: 'collapse', collapseId: collapseId, - collapse: collapse + collapse: collapse, + startCollapsed: config.startCollapsed }) container.appendChild(fieldset) @@ -5558,8 +5572,8 @@ class Theme { card.appendChild(header) card.appendChild(body) header.appendChild(actions) - actions.appendChild(arrayActions) actions.appendChild(switcher.container) + actions.appendChild(arrayActions) body.appendChild(messages) body.appendChild(childrenSlot) @@ -5865,7 +5879,6 @@ class Theme { const input = document.createElement('select') input.setAttribute('id', config.id) - input.style.width = '100%' config.values.forEach((value, index) => { const option = document.createElement('option') @@ -5918,7 +5931,34 @@ class Theme { * @private */ getSwitcher (config) { - return this.getSelectControl(config) + const container = document.createElement('span') + const input = document.createElement('select') + input.setAttribute('id', config.id) + + config.values.forEach((value, index) => { + const option = document.createElement('option') + option.setAttribute('value', value) + + if (config.titles && config.titles[index]) { + option.textContent = config.titles[index] + } + + input.appendChild(option) + }) + + const label = document.createElement('label') + label.setAttribute('for', config.id) + + const labelText = document.createElement('span') + labelText.textContent = config.label + + this.visuallyHidden(label) + + container.appendChild(label) + container.appendChild(input) + label.appendChild(labelText) + + return { container, input, label, labelText } } /** @@ -8433,4 +8473,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -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2hVSSgpXG4gICAgICBjb25zdCBlcnJvcnMgPSB0aGlzLmluc3RhbmNlLmdldEVycm9ycygpXG4gICAgICB0aGlzLnNob3dWYWxpZGF0aW9uRXJyb3JzKGVycm9ycylcbiAgICB9KVxuXG4gICAgdGhpcy5pbnN0YW5jZS5vbignY2hhbmdlJywgKCkgPT4ge1xuICAgICAgdGhpcy5yZWZyZXNoVUkoKVxuICAgICAgY29uc3QgZXJyb3JzID0gdGhpcy5pbnN0YW5jZS5nZXRFcnJvcnMoKVxuICAgICAgdGhpcy5zaG93VmFsaWRhdGlvbkVycm9ycyhlcnJvcnMpXG4gICAgfSlcbiAgfVxuXG4gIC8qKlxuICAgKiBJbml0aWFsaXplcyB0aGUgZWRpdG9yXG4gICAqIEBwcml2YXRlXG4gICAqL1xuICBpbml0ICgpIHtcbiAgICBsZXQgaWNvbnMgPSBudWxsXG5cbiAgICBpZiAoaXNTZXQodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikpIHtcbiAgICAgIHN3aXRjaCAodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikge1xuICAgICAgICBjYXNlICdnbHlwaGljb25zJzpcbiAgICAgICAgICBpY29ucyA9IGdseXBoaWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdib290c3RyYXAtaWNvbnMnOlxuICAgICAgICAgIGljb25zID0gYm9vdHN0cmFwSWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTMnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWUzXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnZm9udGF3ZXNvbWU0JzpcbiAgICAgICAgICBpY29ucyA9IGZvbnRBd2Vzb21lNFxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIGNhc2UgJ2ZvbnRhd2Vzb21lNSc6XG4gICAgICAgICAgaWNvbnMgPSBmb250QXdlc29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WFUaXRsZShzY2hlbWEpXG4gICAgICAgIGNvbnN0IHBhdGggPSB0aGlzLmluc3RhbmNlLnBhdGggKyB0aGlzLmluc3RhbmNlLmplZGkucGF0aFNlcGFyYXRvciArIHByb3BlcnR5XG4gICAgICAgIGNvbnN0IGlkID0gcGF0aFRvQXR0cmlidXRlKHBhdGgpICsgJy1hY3RpdmF0b3InXG4gICAgICAgIGNvbnN0IGxhYmVsID0gaXNTZXQoc2NoZW1hVGl0bGUpID8gc2NoZW1hVGl0bGUgOiBwcm9wZXJ0eVxuXG4gICAgICAgIGlmIChub3RSZXF1aXJlZCAmJiAhYWN0aXZhdG9ySW5Eb20pIHtcbiAgICAgICAgICBjb25zdCBjaGVja2JveENvbnRyb2wgPSB0aGlzLnRoZW1lLmdldENoZWNrYm94Q29udHJvbCh7XG4gICAgICAgICAgICBpZDogaWQsXG4gICAgICAgICAgICBsYWJlbDogbGFiZWwsXG4gICAgICAgICAgICB0aXRsZUhpZGRlbjogZmFsc2VcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgY29uc3QgY2hlY2tib3ggPSBjaGVja2JveENvbnRyb2wuaW5wdXRcbiAgICAgICAgICB0aGlzLnByb3BlcnR5QWN0aXZhdG9yc1twcm9wZXJ0eV0gPSBjaGVja2JveFxuXG4gICAgICAgICAgY2hlY2tib3guYWRkRXZlbnRMaXN0ZW5lcignY2hhbmdlJywgKCkgPT4ge1xuICAgICAgICAgICAgYXJpYUxpdmUuaW5uZXJIVE1MID0gJydcbiAgICAgICAgICAgIGNvbnN0IGFyaWFMaXZlTWVzc2FnZSA9IHRoaXMudGhlbWUuZ2V0QXJpYUxpdmVNZXNzYWdlKClcblxuICAgICAgICAgICAgaWYgKGNoZWNrYm94LmNoZWNrZWQpIHtcbiAgICAgICAgICAgICAgY29uc3QgY2hpbGQgPSB0aGlzLmluc3RhbmNlLmdldENoaWxkKHByb3BlcnR5KVxuXG4gICAgICAgICAgICAgIGlmICghY2hpbGQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmluc3RhbmNlLmNyZWF0ZUNoaWxkKHNjaGVtYSwgcHJvcGVydHkpXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB0aGlzLmluc3RhbmNlLmdldENoaWxkKHByb3BlcnR5KS5hY3RpdmF0ZSgpXG4gICAgICAgICAgICAgIGFyaWFMaXZlTWVzc2FnZS50ZXh0Q29udGVudCA9IGxhYmVsICsgJyBmaWVsZCB3YXMgYWRkZWQgdG8gdGhlIGZvcm0nXG4gICAgICAgICAgICAgIGFyaWFMaXZlLmFwcGVuZENoaWxkKGFyaWFMaXZlTWVzc2FnZSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHRoaXMuaW5zdGFuY2UuZ2V0Q2hpbGQocHJvcGVydHkpLmRlYWN0aXZhdGUoKVxuICAgICAgICAgICAgICBhcmlhTGl2ZU1lc3NhZ2UudGV4dENvbnRlbnQgPSBsYWJlbCArICcgZmllbGQgd2FzIHJlbW92ZWQgZnJvbSB0aGUgZm9ybSdcbiAgICAgICAgICAgICAgYXJpYUxpdmUuYXBwZW5kQ2hpbGQoYXJpYUxpdmVNZXNzYWdlKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBrZWVwcyBkaWFsb2cgb3BlblxuICAgICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNDb250YWluZXIuY2xvc2UoKVxuICAgICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNDb250YWluZXIuc2hvd01vZGFsKClcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNBY3RpdmF0b3JzLmFwcGVuZENoaWxkKGNoZWNrYm94Q29udHJvbC5jb250YWluZXIpXG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBjaGVja2JveCA9IHRoaXMucHJvcGVydHlBY3RpdmF0b3JzW3Byb3BlcnR5XVxuICAgICAgICBpZiAoY2hlY2tib3gpIHtcbiAgICAgICAgICBjaGVja2JveC5kaXNhYmxlZCA9IHRoaXMuZGlzYWJsZWRcbiAgICAgICAgICBjaGVja2JveC5jaGVja2VkID0gaGFzT3duKHRoaXMuaW5zdGFuY2UuZ2V0VmFsdWUoKSwgcHJvcGVydHkpXG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgfVxuICB9XG5cbiAgcmVmcmVzaEVkaXRvcnMgKCkge1xuICAgIHRoaXMuaW5zdGFuY2UuY2hpbGRyZW4uZm9yRWFjaCgoY2hpbGQpID0+IHtcbiAgICAgIGlmIChjaGlsZC5pc0FjdGl2ZSkge1xuICAgICAgICBpZiAoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIucGFyZW50Tm9kZSA9PT0gbnVsbCkge1xuICAgICAgICAgIHRoaXMuY29udHJvbC5jaGlsZHJlblNsb3QuYXBwZW5kQ2hpbGQoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIpXG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5kaXNhYmxlZCB8fCB0aGlzLmluc3RhbmNlLmlzUmVhZE9ubHkoKSkge1xuICAgICAgICAgIGNoaWxkLnVpLmRpc2FibGUoKVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNoaWxkLnVpLmVuYWJsZSgpXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChjaGlsZC51aS5jb250cm9sLmNvbnRhaW5lci5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgY2hpbGQudWkuY29udHJvbC5jb250YWluZXIucGFyZW50Tm9kZS5yZW1vdmVDaGlsZChjaGlsZC51aS5jb250cm9sLmNvbnRhaW5lcilcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pXG4gIH1cblxuICByZWZyZXNoVUkgKCkge1xuICAgIHRoaXMucmVmcmVzaEludGVyYWN0aXZlRWxlbWVudHMoKVxuICAgIHRoaXMucmVmcmVzaFByb3BlcnRpZXNTbG90KClcbiAgICB0aGl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gIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIGFkZGl0aW9uYWxQcm9wZXJ0aWVzID09PSBmYWxzZSAmJiAhaGFzT3duKHByb3BlcnRpZXMsIHByb3BlcnR5KSkge1xuICAgICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICAgIG1lc3NhZ2VzOiBbXG4gICAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yQWRkaXRpb25hbFByb3BlcnRpZXMsIHtcbiAgICAgICAgICAgICAgICBwcm9wZXJ0eTogcHJvcGVydHlcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgICAgY29uc3RyYWluOiAnYWRkaXRpb25hbFByb3BlcnRpZXMnXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIGlzT2JqZWN0KGFkZGl0aW9uYWxQcm9wZXJ0aWVzKSAmJiAhaGFzT3duKHByb3BlcnRpZXMsIHByb3BlcnR5KSkge1xuICAgICAgICAgIGNvbnN0IGVkaXRvciA9IG5ldyBKZWRpKHtcbiAgICAgICAgICAgIHJlZlBhcnNlcjogdmFsaWRhdG9yLnJlZlBhcnNlcixcbiAgICAgICAgICAgIHNjaGVtYTogYWRkaXRpb25hbFByb3BlcnRpZXMsXG4gICAgICAgICAgICBkYXRhOiB2YWx1ZVtwcm9wZXJ0eV1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgY29uc3QgYWRkaXRpb25hbFByb3BlcnR5RXJyb3JzID0gZWRpdG9yLmdldEVycm9ycygpLm1hcCgoZXJyb3IpID0+IHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgIG1lc3NhZ2VzOiBlcnJvci5tZXNzYWdlcyxcbiAgICAgICAgICAgICAgcGF0aDogcHJvcGVydHksXG4gICAgICAg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A9PT0gMCkge1xuICAgICAgICBjb3VudGVyKytcbiAgICAgIH1cblxuICAgICAgY29udGFpbnNFZGl0b3IuZGVzdHJveSgpXG4gICAgfSlcblxuICAgIGNvbnN0IGNvbnRhaW5zSW52YWxpZCA9IChjb3VudGVyID09PSAwKVxuXG4gICAgaWYgKGlzU2V0KG1pbkNvbnRhaW5zKSkge1xuICAgICAgY29uc3QgbWluQ29udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPCBtaW5Db250YWlucylcblxuICAgICAgaWYgKG1pbkNvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yTWluQ29udGFpbnMsIHtcbiAgICAgICAgICAgICAgY291bnRlcjogY291bnRlcixcbiAgICAgICAgICAgICAgbWluQ29udGFpbnM6IG1pbkNvbnRhaW5zXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIF0sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdtaW5Db250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKGNvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtpMThuLmVycm9yQ29udGFpbnNdLFxuICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgY29uc3RyYWluOiAnY29udGFpbnMnXG4gICAgICAgIH0pXG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGlzU2V0KG1heENvbnRhaW5zKSkge1xuICAgICAgY29uc3QgbWF4Q29udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPiBtYXhDb250YWlucylcblxuICAgICAgaWYgKG1heENvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yTWF4Q29udGFpbnMsIHtcbiAgICAgICAgICAgICAgY291bnRlcjogY291bnRlcixcbiAgICAgICAgICAgICAgbWF4Q29udGFpbnM6IG1heENvbnRhaW5zXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIF0sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdtYXhDb250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICByZXR1cm4gZXJyb3JzXG59XG4iLCJpbXBvcnQgeyBjb21waWxlVGVtcGxhdGUsIGhhc093biwgaXNPYmplY3QsIGlzU2V0IH0gZnJvbSAnLi4vLi4vaGVscGVycy91dGlscy5qcydcbmltcG9ydCB7IGdldFNjaGVtYURlcGVuZGVudFJlcXVpcmVkIH0gZnJvbSAnLi4vLi4vaGVscGVycy9zY2hlbWEuanMnXG5pbXBvcnQgeyBpMThuIH0gZnJvbSAnLi4vLi4vaTE4bi5qcydcblxuZXhwb3J0IGZ1bmN0aW9uIGRlcGVuZGVudFJlcXVpcmVkICh2YWxpZGF0b3IsIHZhbHVlLCBzY2hlbWEsIGtleSwgcGF0aCkge1xuICBjb25zdCBlcnJvcnMgPSBbXVxuICBjb25zdCBkZXBlbmRlbnRSZXF1aXJlZCA9IGdldFNjaGVtYURlcGVuZGVudFJlcXVpcmVkKHNjaGVtYSlcblxuICBpZiAoaXNPYmplY3QodmFsdWUpICYmIGlzU2V0KGRlcGVuZGVudFJlcXVpcmVkKSkge1xuICAgIGxldCBtaXNzaW5nUHJvcGVydGllcyA9IFtdXG5cbiAgICBPYmplY3Qua2V5cyhkZXBlbmRlbnRSZXF1aXJlZCkuZm9yRWFjaCgoa2V5KSA9PiB7XG4gICAgICBpZiAoaXNTZXQodmFsdWVba2V5XSkpIHtcbiAgICAgICAgY29uc3QgcmVx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Y2hlbWFPbmVPZlxuICAgIF1cblxuICAgIG9mU2NoZW1hcy5mb3JFYWNoKChzdWJTY2hlbWEpID0+IHtcbiAgICAgIGlmIChpc1NldChzdWJTY2hlbWEpKSB7XG4gICAgICAgIHN1YlNjaGVtYS5mb3JFYWNoKChzdWJzY2hlbWEpID0+IHtcbiAgICAgICAgICBpZiAoaXNTZXQoc3Vic2NoZW1hWydwcm9wZXJ0aWVzJ10pKSB7XG4gICAgICAgICAgICBwcm9wZXJ0aWVzID0geyAuLi5wcm9wZXJ0aWVzLCAuLi5zdWJzY2hlbWFbJ3Byb3BlcnRpZXMnXSB9XG4gICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgfVxuICAgIH0pXG5cbiAgICBpZiAocHJvcGVydGllcykge1xuICAgICAgT2JqZWN0LmtleXModmFsdWUpLmZvckVhY2goKHByb3BlcnR5KSA9PiB7XG4gICAgICAgIGxldCBkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgPSBmYWxzZVxuXG4gICAgICAgIGlmIChpc1NldChwYXR0ZXJuUHJvcGVydGllcykpIHtcbiAgICAgICAgICBPYmplY3Qua2V5cyhwYXR0ZXJuUHJvcGVydGllcykuZm9yRWFjaCgocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgY29uc3QgcmVnZXhwID0gbmV3IFJlZ0V4cChwYXR0ZXJuKVxuICAgICAgICAgICAgZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ID0gcmVnZXhwLnRlc3QocHJvcGVydHkpXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIHVuZXZhbHVhdGVkUHJvcGVydGllcyA9PT0gZmFsc2UgJiYgIWhhc093bihwcm9wZXJ0aWVzLCBwcm9wZXJ0eSkpIHtcbiAgICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5lcnJvclVuZXZhbHVhdGVkUHJvcGVydGllcywge1xuICAgICAgICAgICAgICAgIHByb3BlcnR5OiBwcm9wZXJ0eVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgICBjb25zdHJhaW46ICd1bmV2YWx1YXRlZFByb3BlcnRpZXMnXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIGlzT2JqZWN0KHVuZXZhbHVhdGVkUHJvcGVydGllcykgJiYgIWhhc093bihwcm9wZXJ0aWVzLCBwcm9wZXJ0eSkpIHtcbiAgICAgICAgICBjb25zdCBlZGl0b3IgPSBuZXcgSmVkaSh7XG4gICAgICAgICAgICByZWZQYXJzZXI6IHZhbGlkYXRvci5yZWZQYXJzZXIsXG4gICAgICAgICAgICBzY2hlbWE6IHVuZXZhbHVhdGVkUHJvcGVydGllcyxcbiAgICAgICAgICAgIGRhdGE6IHZhbHVlW3Byb3BlcnR5XVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBjb25zdCB1bmV2YWx1YXRlZFByb3BlcnRpZXNFcnJvcnMgPSBlZGl0b3IuZ2V0RXJyb3JzKCkubWFwKChlcnJvcikgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgbWVzc2FnZXM6IGVycm9yLm1lc3NhZ2VzLFxuICAgICAgICAgICAgICBwYXRoOiBwcm9wZXJ0eSxcbiAgICAgICAgICAgICAgY29uc3RyYWluOiAndW5ldmFsdWF0ZWRQcm9wZXJ0aWVzJ1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBlcnJvcnMgPSBbLi4uZXJyb3JzLCAuLi51bmV2YWx1YXRlZFByb3BlcnRpZXNFcnJvcnNdXG5cbiAgICAgICAgICBlZGl0b3IuZGVzdHJve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5kcyBFdmVudEVtaXR0ZXJcbiAqL1xuY2xhc3MgRWRpdG9yIHtcbiAgY29uc3RydWN0b3IgKGluc3RhbmNlKSB7XG4gICAgLyoqXG4gICAgICogQSByZWZlcmVuY2UgdG8gdGhlIEluc3RhbmNlIGJlaW5nIGNvbnRyb2xsZWQgYnkgdGhpcyBlZGl0b3IuXG4gICAgICogQHR5cGUge0luc3RhbmNlfVxuICAgICAqIEBwcml2YXRlXG4gICAgICovXG4gICAgdGhpcy5pbnN0YW5jZSA9IGluc3RhbmNlXG5cbiAgICAvKipcbiAgICAgKiBUaGVtZSBpbnN0YW5jZSB1c2VkIHRvIGJ1aWxkIHRoZSBFZGl0b3IgdXNlciBpbnRlcmZhY2UuXG4gICAgICogQHR5cGUge1RoZW1lfVxuICAgICAqIEBwcml2YXRlXG4gICAgICovXG4gICAgdGhpcy50aGVtZSA9IG51bGxcblxuICAgIC8qKlxuICAgICAqIFRoZSB1c2VyIGludGVyZmFjZSBodG1sIGZvciB0aGlzIGVkaXRvclxuICAgICAqIEB0eXBlIHtIVE1MRWxlbWVudH1cbiAgICAgKiBAcHJvdGVjdGVkXG4gICAgICovXG4gICAgdGhpcy5jb250cm9sID0gbnVsbFxuXG4gICAgLyoqXG4gICAgICogRGlzYWJsZWQgc3RhdHVzIGZvciB0aGlzIGVkaXRvciB1c2VyIGludGVyZmFjZVxuICAgICAqIEB0eXBlIHtib29sZWFufVxuICAgICAqIEBwcml2YXRlXG4gICAgICovXG4gICAgdGhpcy5kaXNhYmxlZCA9IGZhbHNlXG5cbiAgICAvKipcbiAgICAgKiBSZWFkIG9ubHkgc3RhdHVzIGZvciB0aGlzIGVkaXRvciB1c2VyIGludGVyZmFjZVxuICAgICAqIEB0eXBlIHtib29sZWFufVxuICAgICAqIEBwcml2YXRlXG4gICAgICovXG4gICAgdGhpcy5yZWFkT25seSA9IHRoaXMuaW5zdGFuY2UuaXNSZWFkT25seSgpXG5cbiAgICB0aGlzLmluaXQoKVxuICAgIHRoaX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WxsXG5cbiAgICBpZiAoaXNTZXQodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikpIHtcbiAgICAgIHN3aXRjaCAodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikge1xuICAgICAgICBjYXNlICdnbHlwaGljb25zJzpcbiAgICAgICAgICBpY29ucyA9IGdseXBoaWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdib290c3RyYXAtaWNvbnMnOlxuICAgICAgICAgIGljb25zID0gYm9vdHN0cmFwSWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTMnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWUzXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnZm9udGF3ZXNvbWU0JzpcbiAgICAgICAgICBpY29ucyA9IGZvbnRBd2Vzb21lNFxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIGNhc2UgJ2ZvbnRhd2Vzb21lNSc6XG4gICAgICAgICAgaWNvbnMgPSBmb250QXdlc29tZTVcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTYnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWU2XG4gICAgICAgICAgYnJlYWtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBzd2l0Y2ggKHRoaXMuaW5zdGFuY2UuamVkaS5vcHRpb25zLnRoZW1lKSB7XG4gICAgICBjYXNlICdib290c3RyYXAzJzpcbiAgICAgICAgdGhpcy50aGVtZSA9IG5ldyBUaGVtZUJvb3RzdHJhcDMoaWNvbnMpXG4gICAgICAgIGJyZWFrXG4gICAgICBjYXNlICdib290c3RyYXA0JzpcbiAgICAgICAgdGhpcy50aGVtZSA9IG5ldyBUaGVtZUJvb3RzdHJhcDQoaWNvbnMpXG4gICAgICAgIGJyZWFrXG4gICAgICBjYXNlICdib290c3RyYXA1Jzpcbi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ICAgICAgICAgICBsYWJlbDogbGFiZWwsXG4gICAgICAgICAgICB0aXRsZUhpZGRlbjogZmFsc2VcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgY29uc3QgY2hlY2tib3ggPSBjaGVja2JveENvbnRyb2wuaW5wdXRcbiAgICAgICAgICB0aGlzLnByb3BlcnR5QWN0aXZhdG9yc1twcm9wZXJ0eV0gPSBjaGVja2JveFxuXG4gICAgICAgICAgY2hlY2tib3guYWRkRXZlbnRMaXN0ZW5lcignY2hhbmdlJywgKCkgPT4ge1xuICAgICAgICAgICAgYXJpYUxpdmUuaW5uZXJIVE1MID0gJydcbiAgICAgICAgICAgIGNvbnN0IGFyaWFMaXZlTWVzc2FnZSA9IHRoaXMudGhlbWUuZ2V0QXJpYUxpdmVNZXNzYWdlKClcblxuICAgICAgICAgICAgaWYgKGNoZWNrYm94LmNoZWNrZWQpIHtcbiAgICAgICAgICAgICAgY29uc3QgY2hpbGQgPSB0aGlzLmluc3RhbmNlLmdldENoaWxkKHByb3BlcnR5KVxuXG4gICAgICAgICAgICAgIGlmICghY2hpbGQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmluc3RhbmNlLmNyZWF0ZUNoaWxkKHNjaGVtYSwgcHJvcGVydHkpXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB0aGlzLmluc3RhbmNlLmdldENoaWxkKHByb3BlcnR5KS5hY3RpdmF0ZSgpXG4gICAgICAgICAgICAgIGFyaWFMaXZlTWVzc2FnZS50ZXh0Q29udGVudCA9IGxhYmVsICsgJyBmaWVsZCB3YXMgYWRkZWQgdG8gdGhlIGZvcm0nXG4gICAgICAgICAgICAgIGFyaWFMaXZlLmFwcGVuZENoaWxkKGFyaWFMaXZlTWVzc2FnZSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHRoaXMuaW5zdGFuY2UuZ2V0Q2hpbGQocHJvcGVydHkpLmRlYWN0aXZhdGUoKVxuICAgICAgICAgICAgICBhcmlhTGl2ZU1lc3NhZ2UudGV4dENvbnRlbnQgPSBsYWJlbCArICcgZmllbGQgd2FzIHJlbW92ZWQgZnJvbSB0aGUgZm9ybSdcbiAgICAgICAgICAgICAgYXJpYUxpdmUuYXBwZW5kQ2hpbGQoYXJpYUxpdmVNZXNzYWdlKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBrZWVwcyBkaWFsb2cgb3BlblxuICAgICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNDb250YWluZXIuY2xvc2UoKVxuICAgICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNDb250YWluZXIuc2hvd01vZGFsKClcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNBY3RpdmF0b3JzLmFwcGVuZENoaWxkKGNoZWNrYm94Q29udHJvbC5jb250YWluZXIpXG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBjaGVja2JveCA9IHRoaXMucHJvcGVydHlBY3RpdmF0b3JzW3Byb3BlcnR5XVxuICAgICAgICBpZiAoY2hlY2tib3gpIHtcbiAgICAgICAgICBjaGVja2JveC5kaXNhYmxlZCA9IHRoaXMuZGlzYWJsZWRcbiAgICAgICAgICBjaGVja2JveC5jaGVja2VkID0gaGFzT3duKHRoaXMuaW5zdGFuY2UuZ2V0VmFsdWUoKSwgcHJvcGVydHkpXG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgfVxuICB9XG5cbiAgcmVmcmVzaEVkaXRvcnMgKCkge1xuICAgIHRoaXMuaW5zdGFuY2UuY2hpbGRyZW4uZm9yRWFjaCgoY2hpbGQpID0+IHtcbiAgICAgIGlmIChjaGlsZC5pc0FjdGl2ZSkge1xuICAgICAgICBpZiAoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIucGFyZW50Tm9kZSA9PT0gbnVsbCkge1xuICAgICAgICAgIHRoaXMuY29udHJvbC5jaGlsZHJlblNsb3QuYXBwZW5kQ2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uVmFsdWVzLFxuICAgICAgdGl0bGVzOiBjb25maWcuc3dpdGNoZXJPcHRpb25zTGFiZWxzLFxuICAgICAgaWQ6IGNvbmZpZy5pZCArICctc3dpdGNoZXInLFxuICAgICAgbGFiZWw6IGNvbmZpZy5pZCArICctc3dpdGNoZXInLFxuICAgICAgdGl0bGVIaWRkZW46IHRydWUsXG4gICAgICByZWFkT25seTogY29uZmlnLnJlYWRPbmx5XG4gICAgfSlcblxuICAgIHN3aXRjaGVyLmNvbnRhaW5lci5jbGFzc0xpc3QuYWRkKCdqZWRpLXN3aXRjaGVyJylcblxuICAgIGNvbnRhaW5lci5hcHBlbmRDaGlsZChkZXNjcmlwdGlvbilcbiAgICBjb250YWluZXIuYXBwZW5kQ2hpbGQoY2FyZClcbiAgICBjYXJkLmFwcGVuZENoaWxkKGhlYWRlcilcbiAgICBjYXJkLmFwcGVuZENoaWxkKGJvZHkpXG4gICAgaGVhZGVyLmFwcGVuZENoaWxkKGFjdGlvbnMpXG4gICAgYWN0aW9ucy5hcHBlbmRDaGlsZChzd2l0Y2hlci5jb250YWluZXIpXG4gICAgYWN0aW9ucy5hcHBlbmRDaGlsZChhcnJheUFjdGlvbnMpXG4gICAgYm9keS5hcHBlbmRDaGlsZChtZXNzYWdlcylcbiAgICBib2R5LmFwcGVuZENoaWxkKGNoaWxkcmVuU2xvdClcblxuICAgIHJldHVybiB7XG4gICAgICBjb250YWluZXIsXG4gICAgICBjYXJkLFxuICAgICAgaGVhZGVyLFxuICAgICAgYm9keSxcbiAgICAgIGFjdGlvbnMsXG4gICAgICBtZXNzYWdlcyxcbiAgICAgIGNoaWxkcmVuU2xvdCxcbiAgICAgIHN3aXRjaGVyLFxuICAgICAgYXJyYXlBY3Rpb25zXG4gICAgfVxuICB9XG5cbiAgLyoqXG4gICAqIENvbnRyb2wgZm9yIE51bGxFZGl0b3JcbiAgICogQHByaXZhdGVcbiAgICovXG4gIGdldE51bGxDb250cm9sIChjb25maWcpIHtcbiAgICBjb25zd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gICAgICAgICAgICAgIHByb3BlcnR5OiBwcm9wZXJ0eVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgICBjb25zdHJhaW46ICdhZGRpdGlvbmFsUHJvcGVydGllcydcbiAgICAgICAgICB9KVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgJiYgaXNPYmplY3QoYWRkaXRpb25hbFByb3BlcnRpZXMpICYmICFoYXNPd24ocHJvcGVydGllcywgcHJvcGVydHkpKSB7XG4gICAgICAgICAgY29uc3QgZWRpdG9yID0gbmV3IEplZGkoe1xuICAgICAgICAgICAgcmVmUGFyc2VyOiB2YWxpZGF0b3IucmVmUGFyc2VyLFxuICAgICAgICAgICAgc2NoZW1hOiBhZGRpdGlvbmFsUHJvcGVydGllcyxcbiAgICAgICAgICAgIGRhdGE6IHZhbHVlW3Byb3BlcnR5XVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBjb25zdCBhZGRpdGlvbmFsUHJvcGVydHlFcnJvcnMgPSBlZGl0b3IuZ2V0RXJyb3JzKCkubWFwKChlcnJvcikgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgbWVzc2FnZXM6IGVycm9yLm1lc3NhZ2VzLFxuICAgICAgICAgICAgICBwYXRoOiBwcm9wZXJ0eSxcbiAgICAgICAgICAgICAgY29uc3RyYWluOiAnYWRkaXRpb25hbFByb3BlcnRpZXMnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcblxuICAgICAgICAgIGVycm9ycyA9IFsuLi5lcnJvcnMsIC4uLmFkZGl0aW9uYWxQcm9wZXJ0eUVycm9yc11cblxuICAgICAgICAgIGVkaXRvci5kZXN0cm95KClcbiAgICAgICAgfVxuICAgICAgfSlcbiAgICB9XG4gIH1cblxuICByZXR1cm4gZXJyb3JzXG59XG4iLCJpbXBvc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XNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JNaW5Db250YWlucywge1xuICAgICAgICAgICAgICBjb3VudGVyOiBjb3VudGVyLFxuICAgICAgICAgICAgICBtaW5Db250YWluczogbWluQ29udGFpbnNcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgXSxcbiAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgIGNvbnN0cmFpbjogJ21pbkNvbnRhaW5zJ1xuICAgICAgICB9KVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAoY29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW2kxOG4uZXJyb3JDb250YWluc10sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdjb250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoaXNTZXQobWF4Q29udGFpbnMpKSB7XG4gICAgICBjb25zdCBtYXhDb250YWluc0ludmFsaWQgPSAoY291bnRlciA+IG1heENvbnRhaW5zKVxuXG4gICAgICBpZiAobWF4Q29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JNYXhDb250YWlucywge1xuICAgICAgICAgICAgICBjb3VudGVyOiBjb3VudGVyLFxuICAgICAgICAgICAgICBtYXhDb250YWluczogbWF4Q29udGFpbnNcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgXSxcbiAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgIGNvbnN0cmFpbjogJ21heENvbnRhaW5zJ1xuICAgICAgICB9KVxuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIHJldH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uXG5leHBvcnQgZGVmYXVsdCB7XG4gIEplZGksXG4gIFJlZlBhcnNlclxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file diff --git a/docs/js/jedi.js b/docs/js/jedi.js index 45b3698..3e44b14 100644 --- a/docs/js/jedi.js +++ b/docs/js/jedi.js @@ -222,11 +222,13 @@ class EditorArray extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { const deleteBtn = this.theme.getDeleteItemBtn() const moveUpBtn = this.theme.getMoveUpItemBtn() const moveDownBtn = this.theme.getMoveDownItemBtn() + const btnGroup = this.theme.getBtnGroup() child.ui.control.arrayActions.innerHTML = '' - child.ui.control.arrayActions.appendChild(deleteBtn) - child.ui.control.arrayActions.appendChild(moveUpBtn) - child.ui.control.arrayActions.appendChild(moveDownBtn) + child.ui.control.arrayActions.appendChild(btnGroup) + btnGroup.appendChild(deleteBtn) + btnGroup.appendChild(moveUpBtn) + btnGroup.appendChild(moveDownBtn) this.control.childrenSlot.appendChild(child.ui.control.container) @@ -4026,6 +4028,13 @@ class ThemeBootstrap3 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] this.useToggleEvents = false } + getAddPropertyButton () { + const btn = super.getAddPropertyButton() + btn.classList.add('btn-primary') + btn.classList.add('btn-block') + return btn + } + getCollapseToggle (config) { const toggle = super.getCollapseToggle(config) toggle.setAttribute('href', '#' + config.collapseId) @@ -4173,14 +4182,6 @@ class ThemeBootstrap3 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] return control } - getSwitcher (config) { - const control = super.getSwitcher(config) - const { container, input } = control - container.classList.remove('form-group') - input.classList.remove('form-control') - return control - } - getAlert (config) { const html = super.getAlert(config) html.classList.add('alert') @@ -4288,6 +4289,13 @@ class ThemeBootstrap4 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] this.useToggleEvents = false } + getAddPropertyButton () { + const btn = super.getAddPropertyButton() + btn.classList.add('btn-primary') + btn.classList.add('btn-block') + return btn + } + getCollapseToggle (config) { const toggle = super.getCollapseToggle(config) toggle.setAttribute('href', '#' + config.collapseId) @@ -4345,6 +4353,7 @@ class ThemeBootstrap4 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] getCardBody () { const html = super.getCardBody() html.classList.add('card-body') + html.classList.add('pb-0') return html } @@ -4440,14 +4449,6 @@ class ThemeBootstrap4 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] return control } - getSwitcher (config) { - const control = super.getSwitcher(config) - const { container, input } = control - container.classList.remove('form-group') - input.classList.remove('form-control') - return control - } - getAlert (config) { const html = super.getAlert(config) html.classList.add('alert') @@ -4563,6 +4564,13 @@ class ThemeBootstrap5 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] this.useToggleEvents = false } + getAddPropertyButton () { + const btn = super.getAddPropertyButton() + btn.classList.add('btn-primary') + btn.classList.add('w-100') + return btn + } + getCollapseToggle (config) { const toggle = super.getCollapseToggle(config) toggle.setAttribute('href', '#' + config.collapseId) @@ -4619,6 +4627,7 @@ class ThemeBootstrap5 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] getCardBody () { const html = super.getCardBody() html.classList.add('card-body') + html.classList.add('pb-0') return html } @@ -4724,15 +4733,6 @@ class ThemeBootstrap5 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] return control } - getSwitcher (config) { - const control = super.getSwitcher(config) - const { container, input, label } = control - container.classList.remove('mb-3') - input.classList.remove('form-select') - this.visuallyHidden(label) - return control - } - getAlert (config) { const html = super.getAlert(config) html.classList.add('alert') @@ -4853,7 +4853,6 @@ const glyphicons = { add: 'glyphicon glyphicon-plus', moveUp: 'glyphicon glyphicon-arrow-up', moveDown: 'glyphicon glyphicon-arrow-down', - expand: 'glyphicon glyphicon-chevron-right', collapse: 'glyphicon glyphicon-chevron-down' } @@ -4867,7 +4866,6 @@ const bootstrapIcons = { add: 'bi bi-plus', moveUp: 'bi bi-arrow-up', moveDown: 'bi bi-arrow-down', - expand: 'bi bi-chevron-right', collapse: 'bi bi-chevron-down' } @@ -4881,7 +4879,6 @@ const fontAwesome3 = { add: 'icon-plus', moveUp: 'icon-arrow-up', moveDown: 'icon-arrow-down', - expand: 'icon-chevron-right', collapse: 'icon-chevron-down' } @@ -4895,7 +4892,6 @@ const fontAwesome4 = { add: 'fa fa-plus', moveUp: 'fa fa-arrow-up', moveDown: 'fa fa-arrow-down', - expand: 'fa fa-chevron-right', collapse: 'fa fa-chevron-down' } @@ -4909,7 +4905,6 @@ const fontAwesome5 = { add: 'fas fa-plus', moveUp: 'fas fa-arrow-up', moveDown: 'fas fa-arrow-down', - expand: 'fas fa-chevron-right', collapse: 'fas fa-chevron-down' } @@ -4923,7 +4918,6 @@ const fontAwesome6 = { add: 'fa-solid fa-plus', moveUp: 'fa-solid fa-arrow-up', moveDown: 'fa-solid fa-arrow-down', - expand: 'fa-solid fa-chevron-right', collapse: 'fa-solid fa-chevron-down' } @@ -5056,7 +5050,7 @@ class Theme { * @private */ getArrayActionsSlot () { - const html = this.getBtnGroup() + const html = document.createElement('span') html.classList.add('jedi-array-actions-slot') return html } @@ -5153,6 +5147,24 @@ class Theme { }) } + let collapsed = config.startCollapsed + + toggle.style.transition = 'transform 0.1s ease' + + if (collapsed) { + toggle.style.transform = 'rotate(90deg)' + } + + toggle.addEventListener('click', () => { + if (collapsed) { + toggle.style.transform = 'rotate(0deg)' + } else { + toggle.style.transform = 'rotate(90deg)' + } + + collapsed = !collapsed + }) + return toggle } @@ -5215,7 +5227,6 @@ class Theme { getBtnGroup () { const html = document.createElement('span') html.classList.add('jedi-btn-group') - html.style.display = 'initial' return html } @@ -5258,7 +5269,7 @@ class Theme { */ getArrayBtnAdd () { const html = this.getButton({ - textContent: 'Add item into', + textContent: 'Add item', icon: 'add' }) html.classList.add('jedi-array-add') @@ -5380,7 +5391,8 @@ class Theme { id: 'collapse-toggle-' + config.id, icon: 'collapse', collapseId: collapseId, - collapse: collapse + collapse: collapse, + startCollapsed: config.startCollapsed }) const propertiesActivators = this.getPropertiesActivators() @@ -5415,6 +5427,7 @@ class Theme { if (config.addProperty) { propertiesContainer.appendChild(addPropertyControl.container) propertiesContainer.appendChild(addPropertyBtn) + propertiesContainer.appendChild(document.createElement('hr')) } if (config.enablePropertiesToggle) { @@ -5482,7 +5495,8 @@ class Theme { id: 'collapse-toggle-' + config.id, icon: 'collapse', collapseId: collapseId, - collapse: collapse + collapse: collapse, + startCollapsed: config.startCollapsed }) container.appendChild(fieldset) @@ -5558,8 +5572,8 @@ class Theme { card.appendChild(header) card.appendChild(body) header.appendChild(actions) - actions.appendChild(arrayActions) actions.appendChild(switcher.container) + actions.appendChild(arrayActions) body.appendChild(messages) body.appendChild(childrenSlot) @@ -5865,7 +5879,6 @@ class Theme { const input = document.createElement('select') input.setAttribute('id', config.id) - input.style.width = '100%' config.values.forEach((value, index) => { const option = document.createElement('option') @@ -5918,7 +5931,34 @@ class Theme { * @private */ getSwitcher (config) { - return this.getSelectControl(config) + const container = document.createElement('span') + const input = document.createElement('select') + input.setAttribute('id', config.id) + + config.values.forEach((value, index) => { + const option = document.createElement('option') + option.setAttribute('value', value) + + if (config.titles && config.titles[index]) { + option.textContent = config.titles[index] + } + + input.appendChild(option) + }) + + const label = document.createElement('label') + label.setAttribute('for', config.id) + + const labelText = document.createElement('span') + labelText.textContent = config.label + + this.visuallyHidden(label) + + container.appendChild(label) + container.appendChild(input) + label.appendChild(labelText) + + return { container, input, label, labelText } } /** @@ -8433,4 +8473,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiamVkaS5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDO0FBQ0QsTzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWb0M7QUFDZ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gICAgY29uc3QgZXJyb3JzID0gdGhpcy5pbnN0YW5jZS5nZXRFcnJvcnMoKVxuICAgICAgdGhpcy5zaG93VmFsaWRhdGlvbkVycm9ycyhlcnJvcnMpXG4gICAgfSlcbiAgfVxuXG4gIC8qKlxuICAgKiBJbml0aWFsaXplcyB0aGUgZWRpdG9yXG4gICAqIEBwcml2YXRlXG4gICAqL1xuICBpbml0ICgpIHtcbiAgICBsZXQgaWNvbnMgPSBudWxsXG5cbiAgICBpZiAoaXNTZXQodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikpIHtcbiAgICAgIHN3aXRjaCAodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikge1xuICAgICAgICBjYXNlICdnbHlwaGljb25zJzpcbiAgICAgICAgICBpY29ucyA9IGdseXBoaWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdib290c3RyYXAtaWNvbnMnOlxuICAgICAgICAgIGljb25zID0gYm9vdHN0cmFwSWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTMnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWUzXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnZm9udGF3ZXNvbWU0JzpcbiAgICAgICAgICBpY29ucyA9IGZvbnRBd2Vzb21lNFxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIGNhc2UgJ2ZvbnRhd2Vzb21lNSc6XG4gICAgICAgICAgaWNvbnMgPSBmb250QXdlc29tZTVcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTYnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWU2XG4gICAgICAgICAgYnJlYWtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBzd2l0Y2ggKHRoaXMuaW5zdGFuY2UuamVkaS5vcHRpb25zLnRoZW1lKSB7XG4gICAgICBjYXNl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0IGxhYmVsID0gaXNTZXQoc2NoZW1hVGl0bGUpID8gc2NoZW1hVGl0bGUgOiBwcm9wZXJ0eVxuXG4gICAgICAgIGlmIChub3RSZXF1aXJlZCAmJiAhYWN0aXZhdG9ySW5Eb20pIHtcbiAgICAgICAgICBjb25zdCBjaGVja2JveENvbnRyb2wgPSB0aGlzLnRoZW1lLmdldENoZWNrYm94Q29udHJvbCh7XG4gICAgICAgICAgICBpZDogaWQsXG4gICAgICAgICAgICBsYWJlbDogbGFiZWwsXG4gICAgICAgICAgICB0aXRsZUhpZGRlbjogZmFsc2VcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgY29uc3QgY2hlY2tib3ggPSBjaGVja2JveENvbnRyb2wuaW5wdXRcbiAgICAgICAgICB0aGlzLnByb3BlcnR5QWN0aXZhdG9yc1twcm9wZXJ0eV0gPSBjaGVja2JveFxuXG4gICAgICAgICAgY2hlY2tib3guYWRkRXZlbnRMaXN0ZW5lcignY2hhbmdlJywgKCkgPT4ge1xuICAgICAgICAgICAgYXJpYUxpdmUuaW5uZXJIVE1MID0gJydcbiAgICAgICAgICAgIGNvbnN0IGFyaWFMaXZlTWVzc2FnZSA9IHRoaXMudGhlbWUuZ2V0QXJpYUxpdmVNZXNzYWdlKClcblxuICAgICAgICAgICAgaWYgKGNoZWNrYm94LmNoZWNrZWQpIHtcbiAgICAgICAgICAgICAgY29uc3QgY2hpbGQgPSB0aGlzLmluc3RhbmNlLmdldENoaWxkKHByb3BlcnR5KVxuXG4gICAgICAgICAgICAgIGlmICghY2hpbGQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmluc3RhbmNlLmNyZWF0ZUNoaWxkKHNjaGVtYSwgcHJvcGVydHkpXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB0aGlzLmluc3RhbmNlLmdldENoaWxkKHByb3BlcnR5KS5hY3RpdmF0ZSgpXG4gICAgICAgICAgICAgIGFyaWFMaXZlTWVzc2FnZS50ZXh0Q29udGVudCA9IGxhYmVsICsgJyBmaWVsZCB3YXMgYWRkZWQgdG8gdGhlIGZvcm0nXG4gICAgICAgICAgICAgIGFyaWFMaXZlLmFwcGVuZENoaWxkKGFyaWFMaXZlTWVzc2FnZSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHRoaXMuaW5zdGFuY2UuZ2V0Q2hpbGQocHJvcGVydHkpLmRlYWN0aXZhdGUoKVxuICAgICAgICAgICAgICBhcmlhTGl2ZU1lc3NhZ2UudGV4dENvbnRlbnQgPSBsYWJlbCArICcgZmllbGQgd2FzIHJlbW92ZWQgZnJvbSB0aGUgZm9ybSdcbiAgICAgICAgICAgICAgYXJpYUxpdmUuYXBwZW5kQ2hpbGQoYXJpYUxpdmVNZXNzYWdlKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBrZWVwcyBkaWFsb2cgb3BlblxuICAgICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNDb250YWluZXIuY2xvc2UoKVxuICAgICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNDb250YWluZXIuc2hvd01vZGFsKClcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNBY3RpdmF0b3JzLmFwcGVuZENoaWxkKGNoZWNrYm94Q29udHJvbC5jb250YWluZXIpXG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBjaGVja2JveCA9IHRoaXMucHJvcGVydHlBY3RpdmF0b3JzW3Byb3BlcnR5XVxuICAgICAgICBpZiAoY2hlY2tib3gpIHtcbiAgICAgICAgICBjaGVja2JveC5kaXNhYmxlZCA9IHRoaXMuZGlzYWJsZWRcbiAgICAgICAgICBjaGVja2JveC5jaGVja2VkID0gaGFzT3duKHRoaXMuaW5zdGFuY2UuZ2V0VmFsdWUoKSwgcHJvcGVydHkpXG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgfVxuICB9XG5cbiAgcmVmcmVzaEVkaXRvc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GVUZW1wbGF0ZShpMThuLmVycm9yQWRkaXRpb25hbFByb3BlcnRpZXMsIHtcbiAgICAgICAgICAgICAgICBwcm9wZXJ0eTogcHJvcGVydHlcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgICAgY29uc3RyYWluOiAnYWRkaXRpb25hbFByb3BlcnRpZXMnXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIGlzT2JqZWN0KGFkZGl0aW9uYWxQcm9wZXJ0aWVzKSAmJiAhaGFzT3duKHByb3BlcnRpZXMsIHByb3BlcnR5KSkge1xuICAgICAgICAgIGNvbnN0IGVkaXRvciA9IG5ldyBKZWRpKHtcbiAgICAgICAgICAgIHJlZlBhcnNlcjogdmFsaWRhdG9yLnJlZlBhcnNlcixcbiAgICAgICAgICAgIHNjaGVtYTogYWRkaXRpb25hbFByb3BlcnRpZXMsXG4gICAgICAgICAgICBkYXRhOiB2YWx1ZVtwcm9wZXJ0eV1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgY29uc3QgYWRkaXRpb25hbFByb3BlcnR5RXJyb3JzID0gZWRpdG9yLmdldEVycm9ycygpLm1hcCgoZXJyb3IpID0+IHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgIG1lc3NhZ2VzOiBlcnJvci5tZXNzYWdlcyxcbiAgICAgICAgICAgICAgcGF0aDogcHJvcGVydHksXG4gICAgICAgICAgICAgIGNvbnN0cmFpbjogJ2FkZGl0aW9uYWxQcm9wZXJ0aWVzJ1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBlcnJvcnMgPSBbLi4uZXJyb3JzLCAuLi5hZGRpdGlvbmFsUHJvcGVydHlFcnJvcnNdXG5cbiAgICAgICAgICBlZGl0b3IuZGVzdHJveSgpXG4gICAgICA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udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPCBtaW5Db250YWlucylcblxuICAgICAgaWYgKG1pbkNvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yTWluQ29udGFpbnMsIHtcbiAgICAgICAgICAgICAgY291bnRlcjogY291bnRlcixcbiAgICAgICAgICAgICAgbWluQ29udGFpbnM6IG1pbkNvbnRhaW5zXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIF0sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdtaW5Db250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKGNvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtpMThuLmVycm9yQ29udGFpbnNdLFxuICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgY29uc3RyYWluOiAnY29udGFpbnMnXG4gICAgICAgIH0pXG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGlzU2V0KG1heENvbnRhaW5zKSkge1xuICAgICAgY29uc3QgbWF4Q29udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPiBtYXhDb250YWlucylcblxuICAgICAgaWYgKG1heENvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yTWF4Q29udGFpbnMsIHtcbiAgICAgICAgICAgICAgY291bnRlcjogY291bnRlcixcbiAgICAgICAgICAgICAgbWF4Q29udGFpbnM6IG1heENvbnRhaW5zXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIF0sXG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wZXJ0aWVzJ10pKSB7XG4gICAgICAgICAgICBwcm9wZXJ0aWVzID0geyAuLi5wcm9wZXJ0aWVzLCAuLi5zdWJzY2hlbWFbJ3Byb3BlcnRpZXMnXSB9XG4gICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgfVxuICAgIH0pXG5cbiAgICBpZiAocHJvcGVydGllcykge1xuICAgICAgT2JqZWN0LmtleXModmFsdWUpLmZvckVhY2goKHByb3BlcnR5KSA9PiB7XG4gICAgICAgIGxldCBkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgPSBmYWxzZVxuXG4gICAgICAgIGlmIChpc1NldChwYXR0ZXJuUHJvcGVydGllcykpIHtcbiAgICAgICAgICBPYmplY3Qua2V5cyhwYXR0ZXJuUHJvcGVydGllcykuZm9yRWFjaCgocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgY29uc3QgcmVnZXhwID0gbmV3IFJlZ0V4cChwYXR0ZXJuKVxuICAgICAgICAgICAgZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ID0gcmVnZXhwLnRlc3QocHJvcGVydHkpXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIHVuZXZhbHVhdGVkUHJvcGVydGllcyA9PT0gZmFsc2UgJiYgIWhhc093bihwcm9wZXJ0aWVzLCBwcm9wZXJ0eSkpIHtcbiAgICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5lcnJvclVuZXZhbHVhdGVkUHJvcGVydGllcywge1xuICAgICAgICAgICAgICAgIHByb3BlcnR5OiBwcm9wZXJ0eVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgICBjb25zdHJhaW46ICd1bmV2YWx1YXRlZFByb3Blcn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iAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdib290c3RyYXAtaWNvbnMnOlxuICAgICAgICAgIGljb25zID0gYm9vdHN0cmFwSWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTMnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWUzXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnZm9udGF3ZXNvbWU0JzpcbiAgICAgICAgICBpY29ucyA9IGZvbnRBd2Vzb21lNFxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIGNhc2UgJ2ZvbnRhd2Vzb21lNSc6XG4gICAgICAgICAgaWNvbnMgPSBmb250QXdlc29tZTVcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTYnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWU2XG4gICAgICAgICAgYnJlYWtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBzd2l0Y2ggKHRoaXMuaW5zdGFuY2UuamVkaS5vcHRpb25zLnRoZW1lKSB7XG4gICAgICBjYXNlICdib290c3RyYXAzJzpcbiAgICAgICAgdGhpcy50aGVtZSA9IG5ldyBUaGVtZUJvb3RzdHJhcDMoaWNvbnMpXG4gICAgICAgIGJyZWFrXG4gICAgICBjYXNlICdib290c3RyYXA0JzpcbiAgICAgICAgdGhpcy50aGVtZSA9IG5ldyBUaGVtZUJvb3RzdHJhcDQoaWNvbnMpXG4gICAgICAgIGJyZWFrXG4gICAgICBjYXNlICdib290c3RyYXA1JzpcbiAgICAgICAgdGhpcy50aGVtZSA9IG5ldyBUaGVtZUJvb3RzdHJhcDUoaWNvbnMpXG4gICAgICAgIGJyZWFrXG4gICAgICBkZWZhdWx0OlxuICAgICAgICB0aGlzLnRoZW1lID0gbmV3IFRoZW1lKGljb25zKVxuICAgIH1cbiAgfVxuXG4gIC8qKlxuICAgKiBTZXRzIGNvbnRhaW5lciBhdHRyaWJ1dGV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b2cgb3BlblxuICAgICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNDb250YWluZXIuY2xvc2UoKVxuICAgICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNDb250YWluZXIuc2hvd01vZGFsKClcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNBY3RpdmF0b3JzLmFwcGVuZENoaWxkKGNoZWNrYm94Q29udHJvbC5jb250YWluZXIpXG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBjaGVja2JveCA9IHRoaXMucHJvcGVydHlBY3RpdmF0b3JzW3Byb3BlcnR5XVxuICAgICAgICBpZiAoY2hlY2tib3gpIHtcbiAgICAgICAgICBjaGVja2JveC5kaXNhYmxlZCA9IHRoaXMuZGlzYWJsZWRcbiAgICAgICAgICBjaGVja2JveC5jaGVja2VkID0gaGFzT3duKHRoaXMuaW5zdGFuY2UuZ2V0VmFsdWUoKSwgcHJvcGVydHkpXG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgfVxuICB9XG5cbiAgcmVmcmVzaEVkaXRvcnMgKCkge1xuICAgIHRoaXMuaW5zdGFuY2UuY2hpbGRyZW4uZm9yRWFjaCgoY2hpbGQpID0+IHtcbiAgICAgIGlmIChjaGlsZC5pc0FjdGl2ZSkge1xuICAgICAgICBpZiAoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIucGFyZW50Tm9kZSA9PT0gbnVsbCkge1xuICAgICAgICAgIHRoaXMuY29udHJvbC5jaGlsZHJlblNsb3QuYXBwZW5kQ2hpbGQoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIpXG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5kaXNhYmxlZCB8fCB0aGlzLmluc3RhbmNlLmlzUmVhZE9ubHkoKSkge1xuICAgICAgICAgIGNoaWxkLnVpLmRpc2FibGUoKVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNoaWxkLnVpLmVuY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oZW1hKVxuICBjb25zdCBtaW5Db250YWlucyA9IGdldFNjaGVtYU1pbkNvbnRhaW5zKHNjaGVtYSlcbiAgY29uc3QgbWF4Q29udGFpbnMgPSBnZXRTY2hlbWFNYXhDb250YWlucyhzY2hlbWEpXG5cbiAgaWYgKGlzQXJyYXkodmFsdWUpICYmIGlzU2V0KGNvbnRhaW5zKSkge1xuICAgIGxldCBjb3VudGVyID0gMFxuXG4gICAgdmFsdWUuZm9yRWFjaCgoaXRlbSkgPT4ge1xuICAgICAgY29uc3QgY29udGFpbnNFZGl0b3IgPSBuZXcgSmVkaSh7IHJlZlBhcnNlcjogdmFsaWRhdG9yLnJlZlBhcnNlciwgc2NoZW1hOiBjb250YWlucywgZGF0YTogaXRlbSB9KVxuICAgICAgY29uc3QgY29udGFpbnNFcnJvcnMgPSBjb250YWluc0VkaXRvci5nZXRFcnJvcnMoKVxuXG4gICAgICBpZiAoY29udGFpbnNFcnJvcnMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgIGNvdW50ZXIrK1xuICAgICAgfVxuXG4gICAgICBjb250YWluc0VkaXRvci5kZXN0cm95KClcbiAgICB9KVxuXG4gICAgY29uc3QgY29udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPT09IDApXG5cbiAgICBpZiAoaXNTZXQobWluQ29udGFpbnMpKSB7XG4gICAgICBjb25zdCBtaW5Db250YWluc0ludmFsaWQgPSAoY291bnRlciA8IG1pbkNvbnRhaW5zKVxuXG4gICAgICBpZiAobWluQ29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JNaW5Db250YWlucywge1xuICAgICAgICAgICAgICBjb3VudGVyOiBjb3VudGVyLFxuICAgICAgICAgICAgICBtaW5Db250YWluczogbWluQ29udGFpbnNcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgXSxcbiAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgIGNvbnN0cmFpbjogJ21pbkNvbnRhaW5zJ1xuICAgICAgICB9KVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAoY29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW2kxOG4uZXJyb3JDb250YWluc10sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdjb250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoaXNTZXQobWF4Q29udGFpbnMpKSB7XG4gICAgICBjb25zdCBtYXhDb250YWluc0ludmFsaWQgPSAoY291bnRlciA+IG1heENvbnRhaW5zKVxuXG4gICAgICBpZiAobWF4Q29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JNYXhDb250YWlucywge1xuICAgICAgICAgICAgICBjb3VudGVyOiBjb3VudGVyLFxuICAgICAgICAgICAgICBtYXhDb250YWluczogbWF4Q29udGFpbnNcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgXSxcbiAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgIGNvbnN0cmFpbjogJ21heENvbnRhaW5zJ1xuICAgICAgICB9KVxuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIHJldHVybiBlcnJvcnNcbn1cbiIsImltcG9ydCB7IGNvbXBpbGVUZW1wbGF0ZSwgaGFzT3duLCBpc09iamVjdCwgaXNTZXQgfSBmcm9tICcuLi8uLi9oZWxwZXJzL3V0aWxzLmpzJ1xuaW1wb3J0IHsgZ2V0U2NoZW1hRGVwZW5kZW50UmVxdWlyZWQgfSBmcm9tICcuLi8uLi9oZWxwZXJzL3NjaG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dlYnBhY2tfcmVxdWlyZV9fLm8oZGVmaW5pdGlvbiwga2V5KSAmJiAhX193ZWJwYWNrX3JlcXVpcmVfXy5vKGV4cG9ydHMsIGtleSkpIHtcblx0XHRcdE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBrZXksIHsgZW51bWVyYWJsZTogdHJ1ZSwgZ2V0OiBkZWZpbml0aW9uW2tleV0gfSk7XG5cdFx0fVxuXHR9XG59OyIsIl9fd2VicGFja19yZXF1aXJlX18ubyA9IChvYmosIHByb3ApID0+IChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwob2JqLCBwcm9wKSkiLCIvLyBkZWZpbmUgX19lc01vZHVsZSBvbiBleHBvcnRzXG5fX3dlYnBhY2tfcmVxdWlyZV9fLnIgPSAoZXhwb3J0cykgPT4ge1xuXHRpZih0eXBlb2YgU3ltYm9sICE9PSAndW5kZWZpbmVkJyAmJiBTeW1ib2wudG9TdHJpbmdUYWcpIHtcblx0XHRPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgU3ltYm9sLnRvU3RyaW5nVGFnLCB7IHZhbHVlOiAnTW9kdWxlJyB9KTtcblx0fVxuXHRPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgJ19fZXNNb2R1bGUnLCB7IHZhbHVlOiB0cnVlIH0pO1xufTsiLCJpbXBvcnQgSmVkaSBmcm9tICcuL2plZGkuanMnXG5pbXBvcnQgUmVmUGFyc2VyIGZyb20gJy4vcmVmLXBhcnNlci9yZWYtcGFyc2VyLmpzJ1xuXG5leHBvcnQgZGVmYXVsdCB7XG4gIEplZGksXG4gIFJlZlBhcnNlclxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file diff --git a/src/editors/array.js b/src/editors/array.js index 8ed7f2b..4c63d95 100644 --- a/src/editors/array.js +++ b/src/editors/array.js @@ -59,11 +59,13 @@ class EditorArray extends Editor { const deleteBtn = this.theme.getDeleteItemBtn() const moveUpBtn = this.theme.getMoveUpItemBtn() const moveDownBtn = this.theme.getMoveDownItemBtn() + const btnGroup = this.theme.getBtnGroup() child.ui.control.arrayActions.innerHTML = '' - child.ui.control.arrayActions.appendChild(deleteBtn) - child.ui.control.arrayActions.appendChild(moveUpBtn) - child.ui.control.arrayActions.appendChild(moveDownBtn) + child.ui.control.arrayActions.appendChild(btnGroup) + btnGroup.appendChild(deleteBtn) + btnGroup.appendChild(moveUpBtn) + btnGroup.appendChild(moveDownBtn) this.control.childrenSlot.appendChild(child.ui.control.container) diff --git a/src/themes/bootstrap3.js b/src/themes/bootstrap3.js index 49f3b67..3d6d1ea 100644 --- a/src/themes/bootstrap3.js +++ b/src/themes/bootstrap3.js @@ -9,6 +9,13 @@ class ThemeBootstrap3 extends Theme { this.useToggleEvents = false } + getAddPropertyButton () { + const btn = super.getAddPropertyButton() + btn.classList.add('btn-primary') + btn.classList.add('btn-block') + return btn + } + getCollapseToggle (config) { const toggle = super.getCollapseToggle(config) toggle.setAttribute('href', '#' + config.collapseId) @@ -156,14 +163,6 @@ class ThemeBootstrap3 extends Theme { return control } - getSwitcher (config) { - const control = super.getSwitcher(config) - const { container, input } = control - container.classList.remove('form-group') - input.classList.remove('form-control') - return control - } - getAlert (config) { const html = super.getAlert(config) html.classList.add('alert') diff --git a/src/themes/bootstrap4.js b/src/themes/bootstrap4.js index 8bb4dbb..e0ed75c 100644 --- a/src/themes/bootstrap4.js +++ b/src/themes/bootstrap4.js @@ -9,6 +9,13 @@ class ThemeBootstrap4 extends Theme { this.useToggleEvents = false } + getAddPropertyButton () { + const btn = super.getAddPropertyButton() + btn.classList.add('btn-primary') + btn.classList.add('btn-block') + return btn + } + getCollapseToggle (config) { const toggle = super.getCollapseToggle(config) toggle.setAttribute('href', '#' + config.collapseId) @@ -66,6 +73,7 @@ class ThemeBootstrap4 extends Theme { getCardBody () { const html = super.getCardBody() html.classList.add('card-body') + html.classList.add('pb-0') return html } @@ -161,14 +169,6 @@ class ThemeBootstrap4 extends Theme { return control } - getSwitcher (config) { - const control = super.getSwitcher(config) - const { container, input } = control - container.classList.remove('form-group') - input.classList.remove('form-control') - return control - } - getAlert (config) { const html = super.getAlert(config) html.classList.add('alert') diff --git a/src/themes/bootstrap5.js b/src/themes/bootstrap5.js index c7b5a43..af214f1 100644 --- a/src/themes/bootstrap5.js +++ b/src/themes/bootstrap5.js @@ -9,6 +9,13 @@ class ThemeBootstrap5 extends Theme { this.useToggleEvents = false } + getAddPropertyButton () { + const btn = super.getAddPropertyButton() + btn.classList.add('btn-primary') + btn.classList.add('w-100') + return btn + } + getCollapseToggle (config) { const toggle = super.getCollapseToggle(config) toggle.setAttribute('href', '#' + config.collapseId) @@ -65,6 +72,7 @@ class ThemeBootstrap5 extends Theme { getCardBody () { const html = super.getCardBody() html.classList.add('card-body') + html.classList.add('pb-0') return html } @@ -170,15 +178,6 @@ class ThemeBootstrap5 extends Theme { return control } - getSwitcher (config) { - const control = super.getSwitcher(config) - const { container, input, label } = control - container.classList.remove('mb-3') - input.classList.remove('form-select') - this.visuallyHidden(label) - return control - } - getAlert (config) { const html = super.getAlert(config) html.classList.add('alert') diff --git a/src/themes/icons/icons.js b/src/themes/icons/icons.js index eb5173f..3ef2c79 100644 --- a/src/themes/icons/icons.js +++ b/src/themes/icons/icons.js @@ -13,7 +13,6 @@ export const glyphicons = { add: 'glyphicon glyphicon-plus', moveUp: 'glyphicon glyphicon-arrow-up', moveDown: 'glyphicon glyphicon-arrow-down', - expand: 'glyphicon glyphicon-chevron-right', collapse: 'glyphicon glyphicon-chevron-down' } @@ -27,7 +26,6 @@ export const bootstrapIcons = { add: 'bi bi-plus', moveUp: 'bi bi-arrow-up', moveDown: 'bi bi-arrow-down', - expand: 'bi bi-chevron-right', collapse: 'bi bi-chevron-down' } @@ -41,7 +39,6 @@ export const fontAwesome3 = { add: 'icon-plus', moveUp: 'icon-arrow-up', moveDown: 'icon-arrow-down', - expand: 'icon-chevron-right', collapse: 'icon-chevron-down' } @@ -55,7 +52,6 @@ export const fontAwesome4 = { add: 'fa fa-plus', moveUp: 'fa fa-arrow-up', moveDown: 'fa fa-arrow-down', - expand: 'fa fa-chevron-right', collapse: 'fa fa-chevron-down' } @@ -69,7 +65,6 @@ export const fontAwesome5 = { add: 'fas fa-plus', moveUp: 'fas fa-arrow-up', moveDown: 'fas fa-arrow-down', - expand: 'fas fa-chevron-right', collapse: 'fas fa-chevron-down' } @@ -83,6 +78,5 @@ export const fontAwesome6 = { add: 'fa-solid fa-plus', moveUp: 'fa-solid fa-arrow-up', moveDown: 'fa-solid fa-arrow-down', - expand: 'fa-solid fa-chevron-right', collapse: 'fa-solid fa-chevron-down' } diff --git a/src/themes/theme.js b/src/themes/theme.js index 7b5cd40..6f6e218 100644 --- a/src/themes/theme.js +++ b/src/themes/theme.js @@ -114,7 +114,7 @@ class Theme { * @private */ getArrayActionsSlot () { - const html = this.getBtnGroup() + const html = document.createElement('span') html.classList.add('jedi-array-actions-slot') return html } @@ -211,6 +211,24 @@ class Theme { }) } + let collapsed = config.startCollapsed + + toggle.style.transition = 'transform 0.1s ease' + + if (collapsed) { + toggle.style.transform = 'rotate(90deg)' + } + + toggle.addEventListener('click', () => { + if (collapsed) { + toggle.style.transform = 'rotate(0deg)' + } else { + toggle.style.transform = 'rotate(90deg)' + } + + collapsed = !collapsed + }) + return toggle } @@ -273,7 +291,6 @@ class Theme { getBtnGroup () { const html = document.createElement('span') html.classList.add('jedi-btn-group') - html.style.display = 'initial' return html } @@ -316,7 +333,7 @@ class Theme { */ getArrayBtnAdd () { const html = this.getButton({ - textContent: 'Add item into', + textContent: 'Add item', icon: 'add' }) html.classList.add('jedi-array-add') @@ -438,7 +455,8 @@ class Theme { id: 'collapse-toggle-' + config.id, icon: 'collapse', collapseId: collapseId, - collapse: collapse + collapse: collapse, + startCollapsed: config.startCollapsed }) const propertiesActivators = this.getPropertiesActivators() @@ -473,6 +491,7 @@ class Theme { if (config.addProperty) { propertiesContainer.appendChild(addPropertyControl.container) propertiesContainer.appendChild(addPropertyBtn) + propertiesContainer.appendChild(document.createElement('hr')) } if (config.enablePropertiesToggle) { @@ -540,7 +559,8 @@ class Theme { id: 'collapse-toggle-' + config.id, icon: 'collapse', collapseId: collapseId, - collapse: collapse + collapse: collapse, + startCollapsed: config.startCollapsed }) container.appendChild(fieldset) @@ -616,8 +636,8 @@ class Theme { card.appendChild(header) card.appendChild(body) header.appendChild(actions) - actions.appendChild(arrayActions) actions.appendChild(switcher.container) + actions.appendChild(arrayActions) body.appendChild(messages) body.appendChild(childrenSlot) @@ -923,7 +943,6 @@ class Theme { const input = document.createElement('select') input.setAttribute('id', config.id) - input.style.width = '100%' config.values.forEach((value, index) => { const option = document.createElement('option') @@ -976,7 +995,34 @@ class Theme { * @private */ getSwitcher (config) { - return this.getSelectControl(config) + const container = document.createElement('span') + const input = document.createElement('select') + input.setAttribute('id', config.id) + + config.values.forEach((value, index) => { + const option = document.createElement('option') + option.setAttribute('value', value) + + if (config.titles && config.titles[index]) { + option.textContent = config.titles[index] + } + + input.appendChild(option) + }) + + const label = document.createElement('label') + label.setAttribute('for', config.id) + + const labelText = document.createElement('span') + labelText.textContent = config.label + + this.visuallyHidden(label) + + container.appendChild(label) + container.appendChild(input) + label.appendChild(labelText) + + return { container, input, label, labelText } } /** diff --git a/todo.md b/todo.md index ff60ab3..d4e4dbe 100644 --- a/todo.md +++ b/todo.md @@ -1,12 +1,12 @@ ## Todo -- merge schema into own oneOf schemas https://json.schemastore.org/geojson.json +- getButton exports object { button, text, icon } +- x- prefix +- compact descriptions - additionalItems with prefixItems validation and editing https://json-schema.org/understanding-json-schema/reference/array#additionalitems - multiple instance: do not transfer values between editors - append descriptions if set and not hidden - type hidden description -- enforce margin-bottom -- add property separated from edit properties - editor hidden description - hide if-then-else headers - better elements class names @@ -24,20 +24,14 @@ - placeholderOption - array copy button - ?can not set value if enum and not in enum? -- close on escape -- compact descriptions - aria live for multiple - aria live for arrays -- empty jedi-actions-slot weird margins (.btn-group) - use same invalid feedback (no alerts) - editor method refreshDisableState() to avoid calling refreshUI when enabling / disabling editor (to avoid re-appending editors) -- array button accessibility for screen reader - anyOf, oneOf accessibility switcher (radios are better) - position and dry of errors (not, patternProperties) -- items validation message - Configurable i18n via options - multiple error messages (oneOf, anyOf, not, any, type undefined, etc.) -- prefixItems test and error messages - move switcher options and titles in editors and not in instances - template / titles / descriptions as html with xss lib option - active item after array add/move/etc. (min and max items) + test