From be84b1cb01c408b785e628b3c743bba6fe7358d1 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 3 Sep 2024 11:16:34 +0200 Subject: [PATCH 1/2] :bug: Change place for circular dependency workaround --- frontend/src/app/plugins.cljs | 12 ++++++++++++ frontend/src/app/plugins/library.cljs | 4 ---- frontend/src/app/plugins/shape.cljs | 6 ------ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/plugins.cljs b/frontend/src/app/plugins.cljs index d3a4872a7..8fccc0dcb 100644 --- a/frontend/src/app/plugins.cljs +++ b/frontend/src/app/plugins.cljs @@ -10,8 +10,13 @@ [app.main.features :as features] [app.main.store :as st] [app.plugins.api :as api] + [app.plugins.flex :as flex] + [app.plugins.format :as format] + [app.plugins.grid :as grid] + [app.plugins.library :as library] [app.plugins.public-utils] [app.plugins.register :as register] + [app.plugins.shape :as shape] [app.util.globals :refer [global]] [app.util.object :as obj] [beicon.v2.core :as rx] @@ -36,3 +41,10 @@ (rx/tap init-plugins-runtime!) (rx/ignore))))) +;; Prevent circular dependency +(set! flex/shape-proxy? shape/shape-proxy?) +(set! grid/shape-proxy? shape/shape-proxy?) +(set! format/shape-proxy shape/shape-proxy) + +(set! shape/lib-typography-proxy? library/lib-typography-proxy?) +(set! shape/lib-component-proxy library/lib-component-proxy) diff --git a/frontend/src/app/plugins/library.cljs b/frontend/src/app/plugins/library.cljs index 1e00d27f3..31080c720 100644 --- a/frontend/src/app/plugins/library.cljs +++ b/frontend/src/app/plugins/library.cljs @@ -413,8 +413,6 @@ (defn lib-typography-proxy? [p] (instance? LibraryTypographyProxy p)) -(set! shape/lib-typography-proxy? lib-typography-proxy?) - (defn lib-typography-proxy [plugin-id file-id id] (assert (uuid? file-id)) @@ -758,8 +756,6 @@ value (dm/str value " / " (:name component))] (st/emit! (dwl/rename-component id value)))))})) -(set! shape/lib-component-proxy lib-component-proxy) - (deftype Library [$plugin $id] Object diff --git a/frontend/src/app/plugins/shape.cljs b/frontend/src/app/plugins/shape.cljs index 1a8bb3e63..a6a1730be 100644 --- a/frontend/src/app/plugins/shape.cljs +++ b/frontend/src/app/plugins/shape.cljs @@ -576,12 +576,6 @@ (defn shape-proxy? [p] (instance? ShapeProxy p)) -;; Prevent circular dependency -(do (set! flex/shape-proxy? shape-proxy?) - (set! grid/shape-proxy? shape-proxy?)) - -(set! format/shape-proxy shape-proxy) - (crc/define-properties! ShapeProxy {:name js/Symbol.toStringTag From 37a6446e323430a9ef1430ca5deb8f75ae1e5c21 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 3 Sep 2024 11:17:05 +0200 Subject: [PATCH 2/2] :bug: Fix problem with font style --- frontend/src/app/plugins/text.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/plugins/text.cljs b/frontend/src/app/plugins/text.cljs index b5e398d65..bdcc67b04 100644 --- a/frontend/src/app/plugins/text.cljs +++ b/frontend/src/app/plugins/text.cljs @@ -193,7 +193,7 @@ :set (fn [self value] (let [font (fonts/get-font-data (obj/get self "fontId")) - variant (fonts/find-variant font {:weight (dm/str value)})] + variant (fonts/find-variant font {:style (dm/str value)})] (cond (nil? variant) (u/display-not-valid :fontStyle (dm/str "Font style '" value "' not supported for the current font")) @@ -456,7 +456,7 @@ (fn [self value] (let [id (obj/get self "$id") font (fonts/get-font-data (obj/get self "fontId")) - variant (fonts/find-variant font {:weight (dm/str value)})] + variant (fonts/find-variant font {:style (dm/str value)})] (cond (nil? variant) (u/display-not-valid :fontStyle (dm/str "Font style '" value "' not supported for the current font"))