♻️ Make svg to shapes conversion code multiplatform

- Move clojure code to common
- Rewrite some native-js code into optimized clojure
This commit is contained in:
Andrey Antukh
2023-10-11 13:39:56 +02:00
committed by Andrés Moya
parent 44845d5d94
commit 3ceb4cf895
62 changed files with 2037 additions and 1011 deletions

View File

@@ -7,9 +7,13 @@
(ns frontend-tests.helpers.pages
(:require
[app.common.data :as d]
[app.common.files.libraries-helpers :as cflh]
[app.common.files.shapes-helpers :as cfsh]
[app.common.geom.point :as gpt]
[app.common.pages :as cp]
[app.common.pages.changes-builder :as pcb]
[app.common.files.libraries-helpers :as cflh]
[app.common.files.shapes-helpers :as cfsh]
[app.common.pages.helpers :as cph]
[app.common.types.shape :as cts]
[app.common.uuid :as uuid]
@@ -113,7 +117,7 @@
(if (empty? shapes)
state
(let [[frame changes]
(dwsh/prepare-create-artboard-from-selection changes
(cfsh/prepare-create-artboard-from-selection changes
nil
nil
(:objects page)
@@ -133,14 +137,14 @@
shapes (dwg/shapes-for-grouping objects shape-ids)
[group component-id changes]
(dwlh/generate-add-component nil
(cflh/generate-add-component nil
shapes
(:objects page)
(:id page)
current-file-id
true
dwg/prepare-create-group
dwsh/prepare-create-artboard-from-selection)]
cfsh/prepare-create-artboard-from-selection)]
(swap! idmap assoc instance-label (:id group)
component-label component-id)

View File

@@ -201,7 +201,9 @@
(t/is (= (:shape-ref c-shape1) nil))
(t/is (= (:name c-shape2) "Rect 2"))
(t/is (= (:touched c-shape2) nil))
(t/is (= (:shape-ref c-shape2) nil)))))]
(t/is (= (:shape-ref c-shape2) nil))
)))]
(ptk/emit!
store