File tree Expand file tree Collapse file tree 4 files changed +27
-13
lines changed Expand file tree Collapse file tree 4 files changed +27
-13
lines changed Original file line number Diff line number Diff line change 11
11
[renderer.snap.handlers :as snap.handlers]
12
12
[renderer.utils.vec :as utils.vec]))
13
13
14
- (m/=> path [:-> App [:* [:or keyword? uuid?]] vector?])
14
+ (m/=> path [:function
15
+ [:-> App vector?]
16
+ [:-> App keyword? vector?]
17
+ [:-> App keyword? [:* any?] vector?]])
15
18
(defn path
16
- [db & more]
17
- (apply conj [:documents (:active-document db)] more))
19
+ ([db]
20
+ [:documents (:active-document db)])
21
+ ([db k]
22
+ (conj (path db) k))
23
+ ([db k & more]
24
+ (apply conj (path db) k more)))
18
25
19
26
(m/=> active [:-> App Document])
20
27
(defn active
Original file line number Diff line number Diff line change 250
250
(m/=> update-prop [:-> App uuid? ifn? [:* any?] App])
251
251
(defn update-prop
252
252
[db id k & more]
253
- (-> (apply update-in db (path db id k) more)
254
- (refresh-bbox id)))
253
+ (apply update-in db (path db id k) more))
255
254
256
255
(m/=> assoc-prop [:function
257
256
[:-> App keyword? any? App]
260
259
([db k v]
261
260
(reduce (partial-right assoc-prop k v) db (selected-ids db)))
262
261
([db id k v]
263
- (-> (if (string/blank? v)
264
- (update-in db (path db id) dissoc k)
265
- (assoc-in db (path db id k) v))
266
- (refresh-bbox id))))
262
+ (if (string/blank? v)
263
+ (update-in db (path db id) dissoc k)
264
+ (assoc-in db (path db id k) v))))
267
265
268
266
(m/=> dissoc-attr [:function
269
267
[:-> App keyword? App]
274
272
([db id k]
275
273
(cond-> db
276
274
(not (locked? db id))
277
- (update-prop id :attrs dissoc k))))
275
+ (-> (update-prop id :attrs dissoc k)
276
+ (refresh-bbox id)))))
278
277
279
278
(m/=> assoc-attr [:function
280
279
[:-> App keyword? string? App]
Original file line number Diff line number Diff line change 68
68
(-> (element.handlers/delete db id)
69
69
(history.handlers/finalize " Remove text" ))
70
70
(-> (element.handlers/assoc-prop db id :content s)
71
+ (element.handlers/refresh-bbox id)
71
72
(history.handlers/finalize " Set text" )))
72
73
(tool.handlers/activate :transform ))))
73
74
Original file line number Diff line number Diff line change 12
12
[renderer.utils.math :refer [Vec2]]
13
13
[renderer.utils.vec :as utils.vec]))
14
14
15
- (m/=> path [:-> App [:* [:or keyword? uuid?]] vector?])
15
+ (m/=> path [:function
16
+ [:-> App vector?]
17
+ [:-> App keyword? vector?]
18
+ [:-> App keyword? [:* any?] vector?]])
16
19
(defn path
17
- [db & more]
18
- (apply conj [:documents (:active-document db) :history ] more))
20
+ ([db]
21
+ [:documents (:active-document db) :history ])
22
+ ([db k]
23
+ (conj (path db) k))
24
+ ([db k & more]
25
+ (apply conj (path db) k more)))
19
26
20
27
(m/=> history [:-> App [:maybe History]])
21
28
(defn history
You can’t perform that action at this time.
0 commit comments