improve(ui): details for block container

pull/7492/head
charlie 2022-11-25 12:41:57 +08:00
parent 7c0d3cb075
commit 748fa46dda
3 changed files with 30 additions and 20 deletions

View File

@ -1677,23 +1677,22 @@
(when (and (coll? children)
(seq children)
(not collapsed?))
(let [doc-mode? (state/sub :document/mode?)]
[:div.block-children-container.flex {:style {:margin-left (if doc-mode? 18 29)}}
[:div.block-children-left-border
{:on-click (fn [_]
(editor-handler/toggle-open-block-children! (:block/uuid block)))}]
[:div.block-children.w-full {:style {:display (if collapsed? "none" "")}}
(for [child children]
(when (map? child)
(let [child (dissoc child :block/meta)
config (cond->
(-> config
(assoc :block/uuid (:block/uuid child))
(dissoc :breadcrumb-show? :embed-parent))
(or ref? query?)
(assoc :ref-query-child? true))]
(rum/with-key (block-container config child)
(:block/uuid child)))))]]))))
[:div.block-children-container.flex
[:div.block-children-left-border
{:on-click (fn [_]
(editor-handler/toggle-open-block-children! (:block/uuid block)))}]
[:div.block-children.w-full {:style {:display (if collapsed? "none" "")}}
(for [child children]
(when (map? child)
(let [child (dissoc child :block/meta)
config (cond->
(-> config
(assoc :block/uuid (:block/uuid child))
(dissoc :breadcrumb-show? :embed-parent))
(or ref? query?)
(assoc :ref-query-child? true))]
(rum/with-key (block-container config child)
(:block/uuid child)))))]])))
(defn- block-content-empty?
[{:block/keys [properties title body]}]

View File

@ -137,6 +137,7 @@
.block-children-container {
position: relative;
margin-left: 29px;
}
.block-children-left-border {
@ -323,8 +324,6 @@
}
.ls-block {
@apply border border-dashed border-green-600;
position: relative;
min-height: 24px;
padding: 2px 0;
@ -517,7 +516,7 @@ a:hover > .bullet-container {
background-color: var(--ls-block-bullet-border-color, #ced9e0);
}
.doc-mode {
.content.doc-mode {
margin-left: -16px;
.block-children-left-border {
@ -527,6 +526,10 @@ a:hover > .bullet-container {
.hide-inner-bullet .bullet {
display: none;
}
.block-children-container {
margin-left: 18px;
}
}
/* copied from https://github.com/drdogbot7/tailwindcss-responsive-embed */

View File

@ -151,4 +151,12 @@ main.ls-fold-button-on-right {
width: 100%;
}
}
.block-children-container {
margin-left: 7px;
.block-children {
padding-left: 10px;
}
}
}