mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 14:12:36 -05:00
Merge pull request #5046 from penpot/alotor-plugins-fixes
Plugins small fixes
This commit is contained in:
commit
1f8cfde1cf
4 changed files with 14 additions and 12 deletions
|
@ -10,8 +10,13 @@
|
||||||
[app.main.features :as features]
|
[app.main.features :as features]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[app.plugins.api :as api]
|
[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.public-utils]
|
||||||
[app.plugins.register :as register]
|
[app.plugins.register :as register]
|
||||||
|
[app.plugins.shape :as shape]
|
||||||
[app.util.globals :refer [global]]
|
[app.util.globals :refer [global]]
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
[beicon.v2.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
|
@ -36,3 +41,10 @@
|
||||||
(rx/tap init-plugins-runtime!)
|
(rx/tap init-plugins-runtime!)
|
||||||
(rx/ignore)))))
|
(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)
|
||||||
|
|
|
@ -413,8 +413,6 @@
|
||||||
(defn lib-typography-proxy? [p]
|
(defn lib-typography-proxy? [p]
|
||||||
(instance? LibraryTypographyProxy p))
|
(instance? LibraryTypographyProxy p))
|
||||||
|
|
||||||
(set! shape/lib-typography-proxy? lib-typography-proxy?)
|
|
||||||
|
|
||||||
(defn lib-typography-proxy
|
(defn lib-typography-proxy
|
||||||
[plugin-id file-id id]
|
[plugin-id file-id id]
|
||||||
(assert (uuid? file-id))
|
(assert (uuid? file-id))
|
||||||
|
@ -758,8 +756,6 @@
|
||||||
value (dm/str value " / " (:name component))]
|
value (dm/str value " / " (:name component))]
|
||||||
(st/emit! (dwl/rename-component id value)))))}))
|
(st/emit! (dwl/rename-component id value)))))}))
|
||||||
|
|
||||||
(set! shape/lib-component-proxy lib-component-proxy)
|
|
||||||
|
|
||||||
(deftype Library [$plugin $id]
|
(deftype Library [$plugin $id]
|
||||||
Object
|
Object
|
||||||
|
|
||||||
|
|
|
@ -576,12 +576,6 @@
|
||||||
(defn shape-proxy? [p]
|
(defn shape-proxy? [p]
|
||||||
(instance? ShapeProxy 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!
|
(crc/define-properties!
|
||||||
ShapeProxy
|
ShapeProxy
|
||||||
{:name js/Symbol.toStringTag
|
{:name js/Symbol.toStringTag
|
||||||
|
|
|
@ -193,7 +193,7 @@
|
||||||
:set
|
:set
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [font (fonts/get-font-data (obj/get self "fontId"))
|
(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
|
(cond
|
||||||
(nil? variant)
|
(nil? variant)
|
||||||
(u/display-not-valid :fontStyle (dm/str "Font style '" value "' not supported for the current font"))
|
(u/display-not-valid :fontStyle (dm/str "Font style '" value "' not supported for the current font"))
|
||||||
|
@ -456,7 +456,7 @@
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [id (obj/get self "$id")
|
(let [id (obj/get self "$id")
|
||||||
font (fonts/get-font-data (obj/get self "fontId"))
|
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
|
(cond
|
||||||
(nil? variant)
|
(nil? variant)
|
||||||
(u/display-not-valid :fontStyle (dm/str "Font style '" value "' not supported for the current font"))
|
(u/display-not-valid :fontStyle (dm/str "Font style '" value "' not supported for the current font"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue