🔧 Show label if wasm text editor is enabled

This commit is contained in:
Belén Albeza
2026-03-17 16:47:05 +01:00
parent 802cec1ee4
commit c8b3407acd
5 changed files with 29 additions and 8 deletions

View File

@@ -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]

View File

@@ -25,6 +25,7 @@
(defonce context-initialized? false)
(defonce context-lost? (atom false))
(defonce serializers
#js {:blur-type shared/RawBlurType
:blend-mode shared/RawBlendMode