From ed0c84a069cbc4266ae32bcdf0218a1f70a196e6 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 9 Jun 2025 12:37:34 +0200 Subject: [PATCH] :sparkles: Exposes board clipContent and showInViewMode properties in plugins --- frontend/src/app/plugins/shape.cljs | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/frontend/src/app/plugins/shape.cljs b/frontend/src/app/plugins/shape.cljs index 8e1548ad2..2af568199 100644 --- a/frontend/src/app/plugins/shape.cljs +++ b/frontend/src/app/plugins/shape.cljs @@ -1231,6 +1231,39 @@ (cond-> (cfh/frame-shape? data) (-> (crc/add-properties! + {:name "clipContent" + :get + (fn [self] + (-> self u/proxy->shape :show-content not)) + + :set + (fn [_ value] + (cond + (not (boolean? value)) + (u/display-not-valid :clipContent value) + + (not (r/check-permission plugin-id "content:write")) + (u/display-not-valid :clipContent "Plugin doesn't have 'content:write' permission") + + :else + (st/emit! (dwsh/update-shapes [id] #(assoc % :show-content (not value))))))} + + {:name "showInViewMode" + :get + (fn [self] + (-> self u/proxy->shape :hide-in-viewer not)) + :set + (fn [_ value] + (cond + (not (boolean? value)) + (u/display-not-valid :showInViewMode value) + + (not (r/check-permission plugin-id "content:write")) + (u/display-not-valid :showInViewMode "Plugin doesn't have 'content:write' permission") + + :else + (st/emit! (dwsh/update-shapes [id] #(assoc % :hide-in-viewer (not value))))))} + {:name "grid" :get (fn [self]