From 031769fb173001683f942add2ea37bf705f00026 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Mon, 31 Aug 2020 20:41:17 +0200 Subject: [PATCH] V8.7RC Block list adjustments (#8763) --- .../blockeditormodelobject.service.js | 7 ++--- .../inlineblock/inlineblock.editor.html | 2 +- .../labelblock/labelblock.editor.html | 2 +- .../unsupportedblock.editor.html | 4 +-- .../umb-block-list-property-editor.html | 2 +- .../umb-block-list-property-editor.less | 29 ++++++++++--------- .../umbBlockListPropertyEditor.component.js | 22 +++++++------- 7 files changed, 35 insertions(+), 33 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js b/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js index 86b5bdd0d0..920ba1c58d 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js @@ -543,7 +543,6 @@ unsupported: true }; contentScaffold = {}; - } var blockObject = {}; @@ -614,8 +613,7 @@ if (this.config.settingsElementTypeKey !== null) { mapElementValues(settings, this.settings); } - } - + }; blockObject.sync = function () { if (this.content !== null) { @@ -624,7 +622,7 @@ if (this.config.settingsElementTypeKey !== null) { mapToPropertyModel(this.settings, this.settingsData); } - } + }; // first time instant update of label. blockObject.label = getBlockLabel(blockObject); @@ -663,7 +661,6 @@ } return blockObject; - }, /** diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/inlineblock/inlineblock.editor.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/inlineblock/inlineblock.editor.html index e5a46cbdeb..6cf717df81 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/inlineblock/inlineblock.editor.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/inlineblock/inlineblock.editor.html @@ -5,7 +5,7 @@ ng-click="vm.openBlock(block)" ng-focus="block.focus"> - + {{block.label}}
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/labelblock/labelblock.editor.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/labelblock/labelblock.editor.html index 4aacc32c62..5e81efec8b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/labelblock/labelblock.editor.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/labelblock/labelblock.editor.html @@ -3,6 +3,6 @@ ng-focus="block.focus" ng-class="{ '--active': block.active, '--error': parentForm.$invalid && valFormManager.isShowingValidation() }" val-server-property-class=""> - + {{block.label}} diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/unsupportedblock/unsupportedblock.editor.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/unsupportedblock/unsupportedblock.editor.html index 84d5dd17b7..d860b44b60 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/unsupportedblock/unsupportedblock.editor.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/unsupportedblock/unsupportedblock.editor.html @@ -1,12 +1,12 @@
- + {{block.label}}
This Block is no longer supported in this context.
You might want to remove this block, or contact your developer to take actions for making this block available again.

- Learn about this circumstance + Learn about this circumstance
Block data:

     
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umb-block-list-property-editor.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umb-block-list-property-editor.html index aa16e6e9a8..4d3031602a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umb-block-list-property-editor.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umb-block-list-property-editor.html @@ -30,7 +30,7 @@ class="btn-reset umb-block-list__create-button umb-outline" ng-class="{ '--disabled': vm.availableBlockTypes.length === 0 }" ng-click="vm.showCreateDialog(vm.layout.length, $event)"> - + Add content diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umb-block-list-property-editor.less b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umb-block-list-property-editor.less index 0c7d58d245..a2c124a6ea 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umb-block-list-property-editor.less +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umb-block-list-property-editor.less @@ -157,7 +157,7 @@ ng-form.ng-invalid-val-server-match-settings > .umb-block-list__block > .umb-blo .umb-block-list__block--create-button { position: absolute; width: 100%; - z-index:1; + z-index: 1; opacity: 0; outline: none; height: 12px; @@ -170,28 +170,27 @@ ng-form.ng-invalid-val-server-match-settings > .umb-block-list__block > .umb-blo content: ''; position: absolute; background-color: @blueMid; - border-top:1px solid white; - border-bottom:1px solid white; + border-top: 1px solid white; + border-bottom: 1px solid white; border-radius: 2px; - top:5px; + top: 5px; right: 0; left: 0; height: 2px; animation: umb-block-list__block--create-button_before 400ms ease-in-out alternate infinite; + @keyframes umb-block-list__block--create-button_before { 0% { opacity: 1; } 100% { opacity: 0.5; } } } + > .__plus { position: absolute; - pointer-events: none;// lets stop avoiding the mouse values in JS move event. - margin-left: -18px - 10px; - margin-top: -18px; - margin-bottom: -18px; - width: 28px; - height: 25px; - padding-bottom: 3px; + pointer-events: none; // lets stop avoiding the mouse values in JS move event. + width: 24px; + height: 24px; + padding: 0; border-radius: 3em; border: 2px solid @blueMid; display: flex; @@ -202,25 +201,29 @@ ng-form.ng-invalid-val-server-match-settings > .umb-block-list__block > .umb-blo font-weight: 800; background-color: rgba(255, 255, 255, .96); box-shadow: 0 0 0 2px rgba(255, 255, 255, .96); - transform: scale(0); + transform: scale(0) translate(-80%, -50%); transition: transform 240ms ease-in; animation: umb-block-list__block--create-button_after 800ms ease-in-out infinite; + @keyframes umb-block-list__block--create-button_after { 0% { color: rgba(@blueMid, 0.8); } 50% { color: rgba(@blueMid, 1); } 100% { color: rgba(@blueMid, 0.8); } } } + &:focus { > .__plus { border: 2px solid @ui-outline; } } + &:hover, &:focus { opacity: 1; transition-duration: 120ms; + > .__plus { - transform: scale(1); + transform: scale(1) translate(-80%, -50%); transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); } } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js index 4ffca6568d..bfe5b43521 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js @@ -44,23 +44,23 @@ vm.loading = true; vm.currentBlockInFocus = null; - vm.setBlockFocus = function(block) { - if(vm.currentBlockInFocus !== null) { + vm.setBlockFocus = function (block) { + if (vm.currentBlockInFocus !== null) { vm.currentBlockInFocus.focus = false; } vm.currentBlockInFocus = block; block.focus = true; - } + }; + vm.supportCopy = clipboardService.isSupported(); vm.layout = []; // The layout object specific to this Block Editor, will be a direct reference from Property Model. vm.availableBlockTypes = []; // Available block entries of this property editor. + vm.labels = {}; - var labels = {}; - vm.labels = labels; localizationService.localizeMany(["grid_addElement", "content_createEmpty"]).then(function (data) { - labels.grid_addElement = data[0]; - labels.content_createEmpty = data[1]; + vm.labels.grid_addElement = data[0]; + vm.labels.content_createEmpty = data[1]; }); vm.$onInit = function() { @@ -195,12 +195,14 @@ function getDefaultViewForBlock(block) { + var defaultViewFolderPath = "views/propertyeditors/blocklist/blocklistentryeditors/"; + if (block.config.unsupported === true) - return "views/propertyeditors/blocklist/blocklistentryeditors/unsupportedblock/unsupportedblock.editor.html"; + return defaultViewFolderPath + "unsupportedblock/unsupportedblock.editor.html"; if (inlineEditing === true) - return "views/propertyeditors/blocklist/blocklistentryeditors/inlineblock/inlineblock.editor.html"; - return "views/propertyeditors/blocklist/blocklistentryeditors/labelblock/labelblock.editor.html"; + return defaultViewFolderPath + "inlineblock/inlineblock.editor.html"; + return defaultViewFolderPath + "labelblock/labelblock.editor.html"; } /**