fix(pdf): support browser to insert pdf highlight into page blocks

This commit is contained in:
charlie
2024-06-12 13:45:46 +08:00
parent d4f21e4c22
commit c38679ff45
6 changed files with 81 additions and 67 deletions

View File

@@ -2,6 +2,8 @@
(:require [promesa.core :as p]
[cljs-bean.core :as bean]
[frontend.util :as util]
[frontend.config :as config]
[frontend.state :as state]
["/frontend/extensions/pdf/utils" :as js-utils]
[datascript.core :as d]
[clojure.string :as string]))
@@ -14,6 +16,11 @@
[filename]
(and filename (string? filename) (string/starts-with? filename "hls__")))
(defn support-area?
[]
(and (util/electron?)
(not (config/db-based-graph? (state/get-current-repo)))))
(defn get-bounding-rect
[rects]
(bean/->clj (js-utils/getBoundingRect (bean/->js rects))))