Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bad3r committed Aug 4, 2023
2 parents 7ff2d2e + 5d9861a commit 882a662
Show file tree
Hide file tree
Showing 19 changed files with 1,339 additions and 1,028 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "com.logseq.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 64
versionName "0.9.11"
versionCode 66
versionName "0.9.13"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
8 changes: 4 additions & 4 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.9.12;
MARKETING_VERSION = 0.9.13;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.logseq.logseq;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -546,7 +546,7 @@
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.9.12;
MARKETING_VERSION = 0.9.13;
PRODUCT_BUNDLE_IDENTIFIER = com.logseq.logseq;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
Expand All @@ -571,7 +571,7 @@
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 0.9.12;
MARKETING_VERSION = 0.9.13;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.logseq.logseq.ShareViewController;
Expand All @@ -598,7 +598,7 @@
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 0.9.12;
MARKETING_VERSION = 0.9.13;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.logseq.logseq.ShareViewController;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"mldoc": "1.5.7",
"path": "0.12.7",
"path-complete-extname": "1.0.0",
"pdfjs-dist": "2.14.305",
"pdfjs-dist": "^3.9.179",
"photoswipe": "^5.3.7",
"pixi-graph-fork": "0.2.0",
"pixi.js": "6.2.0",
Expand Down
2 changes: 1 addition & 1 deletion resources/forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
packagerConfig: {
name: 'Logseq',
icon: './icons/logseq_big_sur.icns',
buildVersion: 64,
buildVersion: 66,
protocols: [
{
"protocol": "logseq",
Expand Down
2 changes: 1 addition & 1 deletion resources/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Logseq",
"productName": "Logseq",
"version": "0.9.11",
"version": "0.9.13",
"main": "electron.js",
"author": "Logseq",
"license": "AGPL-3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/components/container.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@
(let [page (util/safe-page-name-sanity-lc page)
[db-id block-type] (if (= page "contents")
["contents" :contents]
[page :page])]
[(:db/id (db/pull [:block/name page])) :page])]
(state/sidebar-add-block! current-repo db-id block-type)))
(reset! sidebar-inited? true))))
(when (state/mobile?)
Expand Down
2 changes: 0 additions & 2 deletions src/main/frontend/components/container.css
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,6 @@ html[data-theme='dark'] {
@apply relative;
flex: 1 1;
min-height: 100px;
border: 1px solid transparent;
transition: border-color 0.1s;

.sidebar-item-header {
white-space: nowrap;
Expand Down
27 changes: 16 additions & 11 deletions src/main/frontend/components/right_sidebar.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -176,24 +176,24 @@
[db-id idx type collapsed? block-count toggle-fn]
[:.menu-links-wrapper.text-left
{:on-click toggle-fn}
(ui/menu-link {:on-click #(state/sidebar-remove-block! idx)} (t :right-side-bar/pane-close))
(when (> block-count 1) (ui/menu-link {:on-click #(state/sidebar-remove-rest! db-id)} (t :right-side-bar/pane-clese-others)))
(ui/menu-link {:on-click #(state/sidebar-remove-block! idx)} (t :right-side-bar/pane-close) nil)
(when (> block-count 1) (ui/menu-link {:on-click #(state/sidebar-remove-rest! db-id)} (t :right-side-bar/pane-clese-others) nil))
(when (> block-count 1) (ui/menu-link {:on-click (fn []
(state/clear-sidebar-blocks!)
(state/hide-right-sidebar!))} (t :right-side-bar/pane-clese-all)))
(state/hide-right-sidebar!))} (t :right-side-bar/pane-clese-all) nil))
(when (or (not collapsed?) (> block-count 1)) [:hr.menu-separator])
(when-not collapsed? (ui/menu-link {:on-click #(state/sidebar-block-toggle-collapse! db-id)} (t :right-side-bar/pane-collapse)))
(when (> block-count 1) (ui/menu-link {:on-click #(state/sidebar-block-collapse-rest! db-id)} (t :right-side-bar/pane-collapse-others)))
(when (> block-count 1) (ui/menu-link {:on-click #(state/sidebar-block-set-collapsed-all! true)} (t :right-side-bar/pane-collapse-all)))
(when-not collapsed? (ui/menu-link {:on-click #(state/sidebar-block-toggle-collapse! db-id)} (t :right-side-bar/pane-collapse) nil))
(when (> block-count 1) (ui/menu-link {:on-click #(state/sidebar-block-collapse-rest! db-id)} (t :right-side-bar/pane-collapse-others) nil))
(when (> block-count 1) (ui/menu-link {:on-click #(state/sidebar-block-set-collapsed-all! true)} (t :right-side-bar/pane-collapse-all) nil))
(when (or collapsed? (> block-count 1)) [:hr.menu-separator])
(when collapsed? (ui/menu-link {:on-click #(state/sidebar-block-toggle-collapse! db-id)} (t :right-side-bar/pane-expand)))
(when (> block-count 1) (ui/menu-link {:on-click #(state/sidebar-block-set-collapsed-all! false)} (t :right-side-bar/pane-expand-all)))
(when collapsed? (ui/menu-link {:on-click #(state/sidebar-block-toggle-collapse! db-id)} (t :right-side-bar/pane-expand) nil))
(when (> block-count 1) (ui/menu-link {:on-click #(state/sidebar-block-set-collapsed-all! false)} (t :right-side-bar/pane-expand-all) nil))
(when (= type :page) [:hr.menu-separator])
(when (= type :page)
(let [name (:block/name (db/entity db-id))]
(ui/menu-link {:href (if (db-model/whiteboard-page? name)
(rfe/href :whiteboard {:name name})
(rfe/href :page {:name name}))} (t :right-side-bar/pane-open-as-page))))])
(rfe/href :page {:name name}))} (t :right-side-bar/pane-open-as-page) nil)))])

(rum/defc drop-indicator
[idx drag-to]
Expand Down Expand Up @@ -229,8 +229,9 @@
(when collapsed? "collapsed")]}
(let [[title component] item]
[:div.flex.flex-col.w-full.relative
[:.flex.flex-row.justify-between.pr-2.sidebar-item-header.color-level
{:draggable true
[:.flex.flex-row.justify-between.pr-2.sidebar-item-header.color-level.rounded-t-md
{:class (when collapsed? "rounded-b-md")
:draggable true
:on-drag-start (fn [event]
(editor-handler/block->data-transfer! (:block/name (db/entity db-id)) event)
(reset! *drag-from idx))
Expand Down Expand Up @@ -388,6 +389,7 @@
[:div.cp__right-sidebar-inner.flex.flex-col.h-full#right-sidebar-container

[:div.cp__right-sidebar-scrollable
{:on-drag-over util/stop}
[:div.cp__right-sidebar-topbar.flex.flex-row.justify-between.items-center.px-2.h-12
[:div.cp__right-sidebar-settings.hide-scrollbar.gap-1 {:key "right-sidebar-settings"}
[:div.text-sm
Expand Down Expand Up @@ -427,6 +429,9 @@
(rum/defcs sidebar < rum/reactive
[state]
(let [blocks (state/sub-right-sidebar-blocks)
blocks (if (empty? blocks)
[[(state/get-current-repo) "contents" :contents nil]]
blocks)
sidebar-open? (state/sub :ui/sidebar-open?)
width (state/sub :ui/sidebar-width)
repo (state/sub :git/current-repo)]
Expand Down
5 changes: 4 additions & 1 deletion src/main/frontend/extensions/excalidraw.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
nil

(.. el -classList (contains "block-content"))
(let [width (.-clientWidth el)]
(let [client-width (.-clientWidth el)
width (if (zero? client-width)
(.-width (.-getBoundingClientRect el))
client-width)]
(reset! (::draw-width state) width))

:else
Expand Down
36 changes: 22 additions & 14 deletions src/main/frontend/extensions/pdf/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,12 @@
rects)]))

(rum/defc ^:large-vars/cleanup-todo pdf-highlight-area-region
[^js viewer vw-hl hl {:keys [show-ctx-menu! upd-hl!]}]
[^js viewer vw-hl hl {:keys [show-ctx-menu!] :as ops}]

(let [{:keys [id]} hl
(let [{:keys [id]} hl
*el (rum/use-ref nil)
*dirty (rum/use-ref nil)
*ops-ref (rum/use-ref ops)
open-ctx-menu! (fn [^js/MouseEvent e]
(.preventDefault e)
(when-not (rum/deref *dirty)
Expand All @@ -275,7 +276,13 @@

dragstart-handle! (fn [^js e]
(when-let [^js dt (and id (.-dataTransfer e))]
(.setData dt "text/plain" (str "((" id "))"))))]
(.setData dt "text/plain" (str "((" id "))"))))
update-hl! (fn [hl] (some-> (rum/deref *ops-ref) (:upd-hl!) (apply [hl])))]

(rum/use-effect!
(fn []
(rum/set-ref! *ops-ref ops))
[ops])

;; resizable
(rum/use-effect!
Expand Down Expand Up @@ -321,7 +328,7 @@
(.removeAttribute target "data-x")
(.removeAttribute target "data-y")

(upd-hl! hl')) 200))))
(update-hl! hl')) 200))))


(js/setTimeout #(rum/set-ref! *dirty false))))
Expand Down Expand Up @@ -541,16 +548,17 @@
(let [vw-pos (pdf-utils/scaled-to-vw-pos viewer (:position hl))]
(set-ctx-menu-state! (apply merge (list* {:highlight hl :vw-pos vw-pos :point point} ops)))))

add-hl! (fn [hl] (when (:id hl)
;; fix js object
(let [highlights (pdf-utils/fix-nested-js highlights)]
(set-highlights! (conj highlights hl)))

(when-let [vw-pos (and (pdf-assets/area-highlight? hl)
(pdf-utils/scaled-to-vw-pos viewer (:position hl)))]
;; exceptions
(pdf-assets/persist-hl-area-image$ viewer (:pdf/current @state/state)
hl nil (:bounding vw-pos)))))
add-hl! (fn [hl]
(when (:id hl)
;; fix js object
(let [highlights (pdf-utils/fix-nested-js highlights)]
(set-highlights! (conj highlights hl)))

(when-let [vw-pos (and (pdf-assets/area-highlight? hl)
(pdf-utils/scaled-to-vw-pos viewer (:position hl)))]
;; exceptions
(pdf-assets/persist-hl-area-image$ viewer (:pdf/current @state/state)
hl nil (:bounding vw-pos)))))

upd-hl! (fn [hl]
(let [highlights (pdf-utils/fix-nested-js highlights)]
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/extensions/pdf/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
(defn resolve-hls-layer!
[^js viewer page]
(when-let [^js text-layer (.. viewer (getPageView (dec page)) -textLayer)]
(let [cnt (.-textLayerDiv text-layer)
(let [cnt (.-div text-layer)
cls "extensions__pdf-hls-layer"
doc js/document
layer (.querySelector cnt (str "." cls))]
Expand Down
6 changes: 4 additions & 2 deletions src/main/frontend/modules/file/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@
(str content "\n"))

:else
(let [markdown-top-heading? (and markdown?
(= parent page)
(let [
;; first block is a heading, Markdown users prefer to remove the `-` before the content
markdown-top-heading? (and markdown?
(= parent page left)
heading)
[prefix spaces-tabs]
(cond
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/version.cljs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(ns ^:no-doc frontend.version)

(defonce version "0.9.11")
(defonce version "0.9.13")
Loading

0 comments on commit 882a662

Please sign in to comment.