mirror of
https://github.com/penpot/penpot.git
synced 2026-05-19 15:03:45 +00:00
30 lines
811 B
Clojure
30 lines
811 B
Clojure
;; 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.data.workspace.highlight
|
|
(:require
|
|
[app.common.spec :as us]
|
|
[clojure.set :as set]
|
|
[potok.core :as ptk]))
|
|
|
|
;; --- Manage shape's highlight status
|
|
|
|
(defn highlight-shape
|
|
[id]
|
|
(us/verify ::us/uuid id)
|
|
(ptk/reify ::highlight-shape
|
|
ptk/UpdateEvent
|
|
(update [_ state]
|
|
(update-in state [:workspace-local :highlighted] set/union #{id}))))
|
|
|
|
(defn dehighlight-shape
|
|
[id]
|
|
(us/verify ::us/uuid id)
|
|
(ptk/reify ::dehighlight-shape
|
|
ptk/UpdateEvent
|
|
(update [_ state]
|
|
(update-in state [:workspace-local :highlighted] disj id))))
|