Pārlūkot izejas kodu

chore: upgrade excalidraw

Konstantinos Kaloutas 3 gadi atpakaļ
vecāks
revīzija
42f2910a0e
3 mainītis faili ar 15 papildinājumiem un 9 dzēšanām
  1. 1 1
      package.json
  2. 3 4
      src/main/frontend/extensions/excalidraw.cljs
  3. 11 4
      yarn.lock

+ 1 - 1
package.json

@@ -81,7 +81,7 @@
         "@capacitor/share": "^4.0.0",
         "@capacitor/splash-screen": "^4.0.0",
         "@capacitor/status-bar": "^4.0.0",
-        "@excalidraw/excalidraw": "0.10.0",
+        "@excalidraw/excalidraw": "0.12.0",
         "@kanru/rage-wasm": "^0.3.0",
         "@logseq/capacitor-file-sync": "0.0.11",
         "@logseq/react-tweet-embed": "1.3.1-1",

+ 3 - 4
src/main/frontend/extensions/excalidraw.cljs

@@ -3,7 +3,7 @@
             [clojure.string :as string]
             ;; NOTE: Always use production build of excalidraw
             ;; See-also: https://github.com/excalidraw/excalidraw/pull/3330
-            ["@excalidraw/excalidraw/dist/excalidraw.production.min" :as Excalidraw]
+            ["@excalidraw/excalidraw/dist/excalidraw.production.min.js" :refer [Excalidraw serializeAsJSON]]
             [frontend.config :as config]
             [frontend.db :as db]
             [frontend.handler.editor :as editor-handler]
@@ -18,8 +18,7 @@
             [rum.core :as rum]
             [frontend.mobile.util :as mobile-util]))
 
-(def excalidraw (r/adapt-class (gobj/get Excalidraw "default")))
-(def serialize-as-json (gobj/get Excalidraw "serializeAsJSON"))
+(def excalidraw (r/adapt-class Excalidraw))
 
 (defn from-json
   [text]
@@ -109,7 +108,7 @@
                               (reset! *elements elements->clj)
                               (draw/save-excalidraw!
                                file
-                               (serialize-as-json elements app-state))))))
+                               (serializeAsJSON elements app-state))))))
            
            :zen-mode-enabled @*zen-mode?
            :view-mode-enabled @*view-mode?

+ 11 - 4
yarn.lock

@@ -346,10 +346,12 @@
     global-agent "^3.0.0"
     global-tunnel-ng "^2.7.1"
 
-"@excalidraw/[email protected]":
-  version "0.10.0"
-  resolved "https://registry.yarnpkg.com/@excalidraw/excalidraw/-/excalidraw-0.10.0.tgz#5329d6fb1b0cca068e2cd34da6d648dd6d0d3fec"
-  integrity sha512-0fHc/oX394dHAT7LEacwZ0vh8aeI179plYnfaeLeRHBtHARgmtlmvxcnxd2pxJ0Z1Uj/Cy76oK9MVw/y8P1HhQ==
+"@excalidraw/[email protected]":
+  version "0.12.0"
+  resolved "https://registry.yarnpkg.com/@excalidraw/excalidraw/-/excalidraw-0.12.0.tgz#0c281624f29aa7834a015035b21dfd928be861d4"
+  integrity sha512-xMPmKmOEgKij43k5m6Koaevb+SBw6La7MT9UDY8Iq7nQCMhA1HQwcUURfSkZ3ERibdQmMsAGtjSLbkX7hrA3+A==
+  dependencies:
+    dotenv "10.0.0"
 
 "@ionic/cli-framework-output@^2.2.1", "@ionic/cli-framework-output@^2.2.5":
   version "2.2.5"
@@ -2466,6 +2468,11 @@ domutils@^2.8.0:
     domelementtype "^2.2.0"
     domhandler "^4.2.0"
 
[email protected]:
+  version "10.0.0"
+  resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
+  integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==
+
 duplexer3@^0.1.4:
   version "0.1.5"
   resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.5.tgz#0b5e4d7bad5de8901ea4440624c8e1d20099217e"