fix: merge issues

pull/6825/head
Peng Xiao 2022-09-24 10:16:19 +08:00
parent fd94862312
commit 526a8d99c8
6 changed files with 66 additions and 52 deletions

View File

@ -241,21 +241,14 @@
Whiteboard page edn is a subset of page schema
- it will only contain a single page (for now). The page properties contains 'bindings' etc
- blocks will be adapted to tldraw shapes. All blocks's parent is the given page."
[file content {:keys [verbose] :or {verbose true} :as options}]
[file content {:keys [verbose] :or {verbose true}}]
(let [_ (when verbose (println "Parsing start: " file))
{:keys [pages blocks]} (gp-util/safe-read-string content)
page-block (first pages)
page-name (or (:block/original-name page-block)
(:block/name page-block)
(filepath->page-name file))
page-original-name (-> (:block/original-name page-block)
(#(cond (nil? %) page-name
(= (gp-util/page-name-sanity-lc %)
(gp-util/page-name-sanity-lc page-name)) page-name
:else %)))
page-name (gp-util/page-name-sanity-lc page-name)
page-entity (build-page-entity (:block/properties page-block) file page-name page-original-name nil options)
page-block (merge page-block page-entity (when-not (:block/uuid page-block) {:block/uuid (d/squuid)}))
page-block (merge page-block (when-not (:block/uuid page-block) {:block/uuid (d/squuid)}))
blocks (->> blocks
(map #(merge % {:block/uuid (or (:block/uuid %)
(gp-block/get-custom-id-or-new-id (:block/properties %)))}

View File

@ -234,7 +234,7 @@
[:button#create-button
{:on-click toggle-fn}
[:<>
(ui/icon "plus")
(ui/icon "plus" {:font? true})
[:span.mx-1 (t :left-side-bar/create)]]])
(->>
[{:title (t :left-side-bar/new-page)
@ -347,10 +347,11 @@
(if enable-whiteboards?
(create-dropdown)
[:a.item.group.flex.items-center.px-2.py-2.text-sm.font-medium.rounded-md.new-page-link
{:on-click #((close-sidebar-on-mobile!)
{:on-click (fn []
(and (util/sm-breakpoint?)
(state/toggle-left-sidebar!))
(state/pub-event! [:go/search]))}
;; TODO: check following line
(ui/icon "circle-plus mr-3" {:style {:font-size 20}})
(ui/icon "circle-plus" {:style {:font-size 20}})
[:span.flex-1 (t :right-side-bar/new-page)]]))]]]))
(rum/defc left-sidebar < rum/reactive

View File

@ -304,7 +304,7 @@
}
#create-button {
@apply p-2 text-sm font-medium rounded-md w-full border;
@apply flex items-center justify-center p-2 text-sm font-medium rounded-md w-full border;
background-color: var(--ls-secondary-background-color) !important;
border-color: transparent;

View File

@ -5,6 +5,7 @@
["react-textarea-autosize" :as TextareaAutosize]
["react-tippy" :as react-tippy]
["react-transition-group" :refer [CSSTransition TransitionGroup]]
[camel-snake-kebab.core :as csk]
[cljs-bean.core :as bean]
[clojure.string :as string]
[datascript.core :as d]
@ -30,18 +31,8 @@
[goog.object :as gobj]
[lambdaisland.glogi :as log]
[medley.core :as medley]
[electron.ipc :as ipc]
["react-resize-context" :as Resize]
["react-textarea-autosize" :as TextareaAutosize]
["react-tippy" :as react-tippy]
["react-transition-group" :refer [CSSTransition TransitionGroup]]
["@logseq/react-tweet-embed" :as react-tweet-embed]
["react-intersection-observer" :as react-intersection-observer]
[rum.core :as rum]
[camel-snake-kebab.core :as csk]
[frontend.db-mixins :as db-mixins]
[frontend.mobile.util :as mobile-util]
[goog.functions :refer [debounce]]))
[promesa.core :as p]
[rum.core :as rum]))
(defonce transition-group (r/adapt-class TransitionGroup))
(defonce css-transition (r/adapt-class CSSTransition))
@ -970,6 +961,12 @@
{:class (str "ls-icon-" class)}
(f (merge {:size 18} (r/map-keys->camel-case opts)))])))))))
(rum/defc type-icon
[{:keys [name class title extension?]}]
[:.type-icon {:class class
:title title}
(icon name {:extension? extension?})])
(rum/defc with-shortcut < rum/reactive
< {:key-fn (fn [key pos] (str "shortcut-" key pos))}
[shortcut-key position content]

View File

@ -353,6 +353,34 @@ html.is-mobile {
background-color: var(--ls-quaternary-background-color);
}
.ui__icon {
display: inline-block;
.type-icon {
@apply text-xs text-center flex items-center justify-center rounded border mr-2 relative;
width: 1.5rem;
height: 1.5rem;
flex-shrink: 0;
border-color: var(--ls-primary-background-color);
overflow: hidden;
color: var(--ls-primary-text-color);
.ti,
.tie {
z-index: 1;
}
&:before {
@apply block absolute inset-0 ;
background: var(--ls-primary-background-color);
content: " ";
}
&.highlight {
color: var(--ls-selection-text-color);
border-color: var(--ls-selection-background-color);
&:before {
opacity: 0.5;
background: var(--ls-selection-background-color);
}
}
}

View File

@ -4709,11 +4709,6 @@ mldoc@^1.4.9:
dependencies:
yargs "^12.0.2"
mobx@^6.5.0:
version "6.5.0"
resolved "https://registry.yarnpkg.com/mobx/-/mobx-6.5.0.tgz#dc2d028b1882737f6e813fc92454381e438b7ad3"
integrity sha512-pHZ/cySF00FVENDWIDzJyoObFahK6Eg4d0papqm6d7yMkxWTZ/S/csqJX1A3PsYy4t5k3z2QnlwuCfMW5lSEwA==
modern-normalize@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/modern-normalize/-/modern-normalize-1.1.0.tgz#da8e80140d9221426bd4f725c6e11283d34f90b7"