mirror of
https://github.com/penpot/penpot.git
synced 2026-03-21 01:43:43 +00:00
🔧 Show label if wasm text editor is enabled
This commit is contained in:
@@ -53,6 +53,13 @@
|
||||
[rumext.v2 :as mf]))
|
||||
(def use-dpr? (contains? cf/flags :render-wasm-dpr))
|
||||
|
||||
(defn text-editor-wasm?
|
||||
[]
|
||||
(let [runtime-features (get @st/state :features-runtime)
|
||||
enabled-features (get @st/state :features)]
|
||||
(or (contains? runtime-features "text-editor-wasm/v1")
|
||||
(contains? enabled-features "text-editor-wasm/v1"))))
|
||||
|
||||
(def ^:const UUID-U8-SIZE 16)
|
||||
(def ^:const UUID-U32-SIZE (/ UUID-U8-SIZE 4))
|
||||
|
||||
@@ -149,11 +156,8 @@
|
||||
;; Determine if text-editor-wasm feature is active without requiring
|
||||
;; app.main.features to avoid circular dependency: check runtime and
|
||||
;; persisted feature sets in the store state.
|
||||
(let [runtime-features (get @st/state :features-runtime)
|
||||
enabled-features (get @st/state :features)]
|
||||
(when (or (contains? runtime-features "text-editor-wasm/v1")
|
||||
(contains? enabled-features "text-editor-wasm/v1"))
|
||||
(text-editor/text-editor-render-overlay)))
|
||||
(when (text-editor-wasm?)
|
||||
(text-editor/text-editor-render-overlay))
|
||||
;; Poll for editor events; if any event occurs, trigger a re-render
|
||||
(let [ev (text-editor/text-editor-poll-event)]
|
||||
(when (and ev (not= ev 0))
|
||||
@@ -1395,7 +1399,9 @@
|
||||
[]
|
||||
(cond-> 0
|
||||
(dbg/enabled? :wasm-viewbox)
|
||||
(bit-or 2r00000000000000000000000000000001)))
|
||||
(bit-or 2r00000000000000000000000000000001)
|
||||
(text-editor-wasm?)
|
||||
(bit-or 2r00000000000000000000000000001000)))
|
||||
|
||||
(defn set-canvas-size
|
||||
[canvas]
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
(defonce context-initialized? false)
|
||||
(defonce context-lost? (atom false))
|
||||
|
||||
|
||||
(defonce serializers
|
||||
#js {:blur-type shared/RawBlurType
|
||||
:blend-mode shared/RawBlendMode
|
||||
|
||||
Reference in New Issue
Block a user