Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Andrey Antukh 2024-11-19 19:20:39 +01:00
commit 5420e0e06d
73 changed files with 11203 additions and 28 deletions

View file

@ -15,6 +15,7 @@
[app.main.data.changes :as dch]
[app.main.data.comments :as dcm]
[app.main.data.events :as ev]
[app.main.data.workspace :as dw]
[app.main.data.workspace.common :as dwco]
[app.main.data.workspace.drawing :as dwd]
[app.main.data.workspace.state-helpers :as wsh]
@ -60,7 +61,11 @@
(let [local (:comments-local state)]
(cond
(:draft local) (rx/of (dcm/close-thread))
(:open local) (rx/of (dcm/close-thread)))))))
(:open local) (rx/of (dcm/close-thread))
:else
(rx/of (dw/clear-edition-mode)
(dw/deselect-all true)))))))
;; Event responsible of the what should be executed when user clicked
;; on the comments layer. An option can be create a new draft thread,

View file

@ -12,6 +12,7 @@
[app.main.data.shortcuts :as ds]
[app.main.data.workspace.texts :as dwt]
[app.main.data.workspace.undo :as dwu]
[app.main.features :as features]
[app.main.fonts :as fonts]
[app.main.refs :as refs]
[app.main.store :as st]
@ -113,18 +114,24 @@
(defn calculate-text-values
[shape]
(let [state-map (deref refs/workspace-editor-state)
editor-state (get state-map (:id shape))]
(let [state-map (if (features/active-feature? @st/state "text-editor/v2")
(deref refs/workspace-v2-editor-state)
(deref refs/workspace-editor-state))
editor-state (get state-map (:id shape))
editor-instance (when (features/active-feature? @st/state "text-editor/v2")
(deref refs/workspace-editor))]
(d/merge
(dwt/current-root-values
{:shape shape
:attrs txt/root-attrs})
(dwt/current-paragraph-values
{:editor-state editor-state
:editor-instance editor-instance
:shape shape
:attrs txt/paragraph-attrs})
(dwt/current-text-values
{:editor-state editor-state
:editor-instance editor-instance
:shape shape
:attrs txt/text-node-attrs}))))

View file

@ -171,6 +171,7 @@
(and (some? drawing-obj) (= :path (:type drawing-obj))))
node-editing? (and edition (= :path (get-in base-objects [edition :type])))
text-editing? (and edition (= :text (get-in base-objects [edition :type])))
grid-editing? (and edition (ctl/grid-layout? base-objects edition))
mode-inspect? (= options-mode :inspect)

View file

@ -16,7 +16,7 @@
(defn v2-closest-text-editor-content
[target]
(.closest ^js target ".text-editor-content"))
(.closest ^js target "[data-itype=\"editor\"]"))
(defn closest-text-editor-content
[target]
@ -34,7 +34,7 @@
(defn v2-get-text-editor-content
[]
(dom/get-element-by-class "text-editor-content"))
(dom/query "[data-itype=\"editor\"]"))
(defn get-text-editor-content
[]