From 7a390fce5e121ae83ca85627970b5a2c4c012e00 Mon Sep 17 00:00:00 2001 From: James Koster Date: Tue, 4 May 2021 13:50:55 +0100 Subject: [PATCH 1/3] Obscure edit-ability of post content blocks in the template editor --- .../src/components/visual-editor/style.scss | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/packages/edit-post/src/components/visual-editor/style.scss b/packages/edit-post/src/components/visual-editor/style.scss index 79e1d43e8f7626..924472f1a77ce6 100644 --- a/packages/edit-post/src/components/visual-editor/style.scss +++ b/packages/edit-post/src/components/visual-editor/style.scss @@ -73,3 +73,41 @@ color: $gray-100; } } + + +// Begin proof of concept +.is-template-mode { + // Hide editability of all blocks inside the Post Content block + .wp-block-post-content { + > * { + pointer-events: none; + } + } + + // Hide inline inserters + .popover-slot { + .block-editor-block-list__insertion-point { + display: none !important; + } + } + + // Hide editability of text based post blocks + .wp-block-post-title, + .wp-block-post-author, + .wp-block-post-date, + .wp-block-post-hierarchical-terms, + .wp-block-post-tags, + .wp-block-post-comments, + .wp-block-post-comments-link, + .wp-block-post-excerpt { + cursor: default !important; + caret-color: transparent; + } + + // Disable featured image uploading + .wp-block-post-featured-image { + .components-placeholder__fieldset { + display: none; + } + } +} From e8b0161eae21b772210d01d9f39b18850d648636 Mon Sep 17 00:00:00 2001 From: James Koster Date: Tue, 4 May 2021 14:56:22 +0100 Subject: [PATCH 2/3] hide text selection highlight --- packages/edit-post/src/components/visual-editor/style.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/edit-post/src/components/visual-editor/style.scss b/packages/edit-post/src/components/visual-editor/style.scss index 924472f1a77ce6..da5612c4b18035 100644 --- a/packages/edit-post/src/components/visual-editor/style.scss +++ b/packages/edit-post/src/components/visual-editor/style.scss @@ -102,6 +102,10 @@ .wp-block-post-excerpt { cursor: default !important; caret-color: transparent; + + &::selection { + background: transparent; + } } // Disable featured image uploading From 9e05a7e36a5a0a53b87ece3fb192c6fa07a618d5 Mon Sep 17 00:00:00 2001 From: James Koster Date: Tue, 4 May 2021 15:01:27 +0100 Subject: [PATCH 3/3] Try a pseudo overlay --- .../src/components/visual-editor/style.scss | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/edit-post/src/components/visual-editor/style.scss b/packages/edit-post/src/components/visual-editor/style.scss index da5612c4b18035..8d8ec2e3cef67a 100644 --- a/packages/edit-post/src/components/visual-editor/style.scss +++ b/packages/edit-post/src/components/visual-editor/style.scss @@ -82,6 +82,14 @@ > * { pointer-events: none; } + + &.is-selected, + &.is-hovered { + &::after { + background: rgba(#007cba, 0.2); + z-index: 1; + } + } } // Hide inline inserters @@ -106,6 +114,14 @@ &::selection { background: transparent; } + + &.is-selected, + &.is-hovered { + &::after { + background: rgba(#007cba, 0.2); + z-index: 1; + } + } } // Disable featured image uploading