From 44e3e4a6418c66e9e0495e4173cea6fabe34e100 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 7 Jul 2025 11:42:09 +0200 Subject: [PATCH] :fire: Remove image shape inspect pannel Image shapes are long ago deprecated not used on penpot --- .../src/app/main/ui/inspect/attributes.cljs | 2 - .../app/main/ui/inspect/attributes/image.cljs | 51 ------------------- 2 files changed, 53 deletions(-) delete mode 100644 frontend/src/app/main/ui/inspect/attributes/image.cljs diff --git a/frontend/src/app/main/ui/inspect/attributes.cljs b/frontend/src/app/main/ui/inspect/attributes.cljs index 107010049e..831860480f 100644 --- a/frontend/src/app/main/ui/inspect/attributes.cljs +++ b/frontend/src/app/main/ui/inspect/attributes.cljs @@ -15,7 +15,6 @@ [app.main.ui.inspect.attributes.blur :refer [blur-panel]] [app.main.ui.inspect.attributes.fill :refer [fill-panel]] [app.main.ui.inspect.attributes.geometry :refer [geometry-panel]] - [app.main.ui.inspect.attributes.image :refer [image-panel]] [app.main.ui.inspect.attributes.layout :refer [layout-panel]] [app.main.ui.inspect.attributes.layout-element :refer [layout-element-panel]] [app.main.ui.inspect.attributes.shadow :refer [shadow-panel]] @@ -69,7 +68,6 @@ :stroke stroke-panel :shadow shadow-panel :blur blur-panel - :image image-panel :text text-panel :svg svg-panel :variant variant-panel*) diff --git a/frontend/src/app/main/ui/inspect/attributes/image.cljs b/frontend/src/app/main/ui/inspect/attributes/image.cljs deleted file mode 100644 index bdf38f0b9a..0000000000 --- a/frontend/src/app/main/ui/inspect/attributes/image.cljs +++ /dev/null @@ -1,51 +0,0 @@ -;; This Source Code Form is subject to the terms of the Mozilla Public -;; License, v. 2.0. If a copy of the MPL was not distributed with this -;; file, You can obtain one at http://mozilla.org/MPL/2.0/. -;; -;; Copyright (c) KALEIDOS INC - -(ns app.main.ui.inspect.attributes.image - (:require-macros [app.main.style :as stl]) - (:require - [app.common.files.helpers :as cfh] - [app.common.media :as cm] - [app.config :as cf] - [app.main.ui.components.copy-button :refer [copy-button*]] - [app.util.code-gen.style-css :as css] - [app.util.i18n :refer [tr]] - [cuerdas.core :as str] - [rumext.v2 :as mf])) - -(defn has-image? [shape] - (= (:type shape) :image)) - -(mf/defc image-panel - [{:keys [objects shapes]}] - (for [shape (filter cfh/image-shape? shapes)] - [:div {:class (stl/css :attributes-block) - :key (str "image-" (:id shape))} - [:div {:class (stl/css :image-wrapper)} - [:img {:src (cf/resolve-file-media (-> shape :metadata))}]] - - [:div {:class (stl/css :image-row)} - [:div {:class (stl/css :global/attr-label)} - (tr "inspect.attributes.image.width")] - [:div {:class (stl/css :global/attr-value)} - [:> copy-button* {:data (css/get-css-property objects (:metadata shape) :width)} - [:div {:class (stl/css :button-children)} (css/get-css-value objects (:metadata shape) :width)]]]] - - [:div {:class (stl/css :image-row)} - [:div {:class (stl/css :global/attr-label)} - (tr "inspect.attributes.image.height")] - [:div {:class (stl/css :global/attr-value)} - [:> copy-button* {:data (css/get-css-property objects (:metadata shape) :height)} - [:div {:class (stl/css :button-children)} (css/get-css-value objects (:metadata shape) :height)]]]] - - (let [mtype (-> shape :metadata :mtype) - name (:name shape) - extension (cm/mtype->extension mtype)] - [:a {:class (stl/css :download-button) - :target "_blank" - :download (cond-> name extension (str/concat extension)) - :href (cf/resolve-file-media (-> shape :metadata))} - (tr "inspect.attributes.image.download")])]))