mirror of
https://github.com/penpot/penpot.git
synced 2025-06-03 22:41:38 +02:00
✨ SVG generation first version
This commit is contained in:
parent
28f90da70e
commit
96098be5ae
19 changed files with 104 additions and 99 deletions
|
@ -30,6 +30,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"date-fns": "^2.15.0",
|
"date-fns": "^2.15.0",
|
||||||
"highlight.js": "^10.3.1",
|
"highlight.js": "^10.3.1",
|
||||||
|
"js-beautify": "^1.13.0",
|
||||||
"map-stream": "0.0.7",
|
"map-stream": "0.0.7",
|
||||||
"mousetrap": "^1.6.5",
|
"mousetrap": "^1.6.5",
|
||||||
"randomcolor": "^0.6.2",
|
"randomcolor": "^0.6.2",
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
[app.main.ui.shapes.filters :as filters]
|
[app.main.ui.shapes.filters :as filters]
|
||||||
[app.main.ui.shapes.frame :as frame]
|
[app.main.ui.shapes.frame :as frame]
|
||||||
[app.main.ui.shapes.circle :as circle]
|
[app.main.ui.shapes.circle :as circle]
|
||||||
[app.main.ui.shapes.icon :as icon]
|
|
||||||
[app.main.ui.shapes.image :as image]
|
[app.main.ui.shapes.image :as image]
|
||||||
[app.main.ui.shapes.path :as path]
|
[app.main.ui.shapes.path :as path]
|
||||||
[app.main.ui.shapes.rect :as rect]
|
[app.main.ui.shapes.rect :as rect]
|
||||||
|
@ -85,7 +84,6 @@
|
||||||
(case (:type shape)
|
(case (:type shape)
|
||||||
:curve [:> path/path-shape opts]
|
:curve [:> path/path-shape opts]
|
||||||
:text [:> text/text-shape opts]
|
:text [:> text/text-shape opts]
|
||||||
:icon [:> icon/icon-shape opts]
|
|
||||||
:rect [:> rect/rect-shape opts]
|
:rect [:> rect/rect-shape opts]
|
||||||
:path [:> path/path-shape opts]
|
:path [:> path/path-shape opts]
|
||||||
:image [:> image/image-shape opts]
|
:image [:> image/image-shape opts]
|
||||||
|
|
|
@ -33,8 +33,7 @@
|
||||||
:cy cy
|
:cy cy
|
||||||
:rx rx
|
:rx rx
|
||||||
:ry ry
|
:ry ry
|
||||||
:transform transform
|
:transform transform}))]
|
||||||
:id (str "shape-" id)}))]
|
|
||||||
|
|
||||||
[:& shape-custom-stroke {:shape shape
|
[:& shape-custom-stroke {:shape shape
|
||||||
:base-props props
|
:base-props props
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
(obj/merge!
|
(obj/merge!
|
||||||
#js {:x 0
|
#js {:x 0
|
||||||
:y 0
|
:y 0
|
||||||
:id (str "shape-" id)
|
|
||||||
:width width
|
:width width
|
||||||
:height height}))]
|
:height height}))]
|
||||||
[:svg {:x x :y y :width width :height height
|
[:svg {:x x :y y :width width :height height
|
||||||
|
|
|
@ -54,7 +54,6 @@
|
||||||
:y y
|
:y y
|
||||||
:fill (if (debug? :group) "red" "transparent")
|
:fill (if (debug? :group) "red" "transparent")
|
||||||
:opacity 0.5
|
:opacity 0.5
|
||||||
:id (str "group-" id)
|
|
||||||
:width width
|
:width width
|
||||||
:height height}])])))
|
:height height}])])))
|
||||||
|
|
||||||
|
|
|
@ -1,52 +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/.
|
|
||||||
;;
|
|
||||||
;; This Source Code Form is "Incompatible With Secondary Licenses", as
|
|
||||||
;; defined by the Mozilla Public License, v. 2.0.
|
|
||||||
;;
|
|
||||||
;; Copyright (c) 2020 UXBOX Labs SL
|
|
||||||
|
|
||||||
(ns app.main.ui.shapes.icon
|
|
||||||
(:require
|
|
||||||
[rumext.alpha :as mf]
|
|
||||||
[app.common.geom.shapes :as geom]
|
|
||||||
[app.main.ui.shapes.attrs :as attrs]
|
|
||||||
[app.main.ui.shapes.group :refer [mask-id-ctx]]
|
|
||||||
[app.util.object :as obj]))
|
|
||||||
|
|
||||||
(mf/defc icon-shape
|
|
||||||
{::mf/wrap-props false}
|
|
||||||
[props]
|
|
||||||
(let [shape (unchecked-get props "shape")
|
|
||||||
{:keys [id x y width height metadata rotation content]} shape
|
|
||||||
|
|
||||||
mask-id (mf/use-ctx mask-id-ctx)
|
|
||||||
transform (geom/transform-matrix shape)
|
|
||||||
vbox (apply str (interpose " " (:view-box metadata)))
|
|
||||||
|
|
||||||
props (-> (attrs/extract-style-attrs shape)
|
|
||||||
(obj/merge!
|
|
||||||
#js {:x x
|
|
||||||
:y y
|
|
||||||
:transform transform
|
|
||||||
:id (str "shape-" id)
|
|
||||||
:width width
|
|
||||||
:height height
|
|
||||||
:viewBox vbox
|
|
||||||
:preserveAspectRatio "none"
|
|
||||||
:mask mask-id
|
|
||||||
:dangerouslySetInnerHTML #js {:__html content}}))]
|
|
||||||
[:g {:transform transform}
|
|
||||||
[:> "svg" props]]))
|
|
||||||
|
|
||||||
(mf/defc icon-svg
|
|
||||||
[{:keys [shape] :as props}]
|
|
||||||
(let [{:keys [content id metadata]} shape
|
|
||||||
view-box (apply str (interpose " " (:view-box metadata)))
|
|
||||||
mask-id (mf/use-ctx mask-id-ctx)
|
|
||||||
props {:viewBox view-box
|
|
||||||
:id (str "shape-" id)
|
|
||||||
:mask mask-id
|
|
||||||
:dangerouslySetInnerHTML #js {:__html content}}]
|
|
||||||
[:& "svg" props]))
|
|
|
@ -43,7 +43,6 @@
|
||||||
#js {:x x
|
#js {:x x
|
||||||
:y y
|
:y y
|
||||||
:transform transform
|
:transform transform
|
||||||
:id (str "shape-" id)
|
|
||||||
:width width
|
:width width
|
||||||
:height height
|
:height height
|
||||||
:preserveAspectRatio "none"
|
:preserveAspectRatio "none"
|
||||||
|
|
|
@ -52,7 +52,6 @@
|
||||||
props (-> (attrs/extract-style-attrs shape)
|
props (-> (attrs/extract-style-attrs shape)
|
||||||
(obj/merge!
|
(obj/merge!
|
||||||
#js {:transform transform
|
#js {:transform transform
|
||||||
:id (str "shape-" id)
|
|
||||||
:d pdata}))]
|
:d pdata}))]
|
||||||
(if background?
|
(if background?
|
||||||
[:g {:mask mask-id}
|
[:g {:mask mask-id}
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#js {:x x
|
#js {:x x
|
||||||
:y y
|
:y y
|
||||||
:transform transform
|
:transform transform
|
||||||
:id (str "shape-" id)
|
|
||||||
:width width
|
:width width
|
||||||
:height height}))]
|
:height height}))]
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
group-props (-> props
|
group-props (-> props
|
||||||
(obj/clone)
|
(obj/clone)
|
||||||
(obj/without ["shape" "children"])
|
(obj/without ["shape" "children"])
|
||||||
|
(obj/set! "id" (str "shape-" (:id shape)))
|
||||||
(obj/set! "className" "shape")
|
(obj/set! "className" "shape")
|
||||||
(obj/set! "filter" (filters/filter-str filter-id shape)))]
|
(obj/set! "filter" (filters/filter-str filter-id shape)))]
|
||||||
[:& (mf/provider muc/render-ctx) {:value render-id}
|
[:& (mf/provider muc/render-ctx) {:value render-id}
|
||||||
|
|
|
@ -231,7 +231,6 @@
|
||||||
:y y
|
:y y
|
||||||
:data-colors (retrieve-colors shape)
|
:data-colors (retrieve-colors shape)
|
||||||
:transform (geom/transform-matrix shape)
|
:transform (geom/transform-matrix shape)
|
||||||
:id (str id)
|
|
||||||
:width width
|
:width width
|
||||||
:height height
|
:height height
|
||||||
:mask mask-id}
|
:mask mask-id}
|
||||||
|
|
|
@ -10,31 +10,38 @@
|
||||||
(ns app.main.ui.viewer.handoff.code
|
(ns app.main.ui.viewer.handoff.code
|
||||||
(:require
|
(:require
|
||||||
["highlight.js" :as hljs]
|
["highlight.js" :as hljs]
|
||||||
|
["js-beautify" :as beautify]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[rumext.alpha :as mf]
|
[rumext.alpha :as mf]
|
||||||
[app.util.i18n :as i18n]
|
[app.util.i18n :as i18n]
|
||||||
[app.util.color :as uc]
|
[app.util.color :as uc]
|
||||||
|
[app.util.dom :as dom]
|
||||||
[app.util.webapi :as wapi]
|
[app.util.webapi :as wapi]
|
||||||
[app.util.code-gen :as cg]
|
[app.util.code-gen :as cg]
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
[app.common.geom.shapes :as gsh]))
|
[app.common.geom.shapes :as gsh]))
|
||||||
|
|
||||||
(def svg-example
|
|
||||||
"<rect
|
|
||||||
x=\"629\"
|
|
||||||
y=\"169\"
|
|
||||||
width=\"176\"
|
|
||||||
height=\"211\"
|
|
||||||
fill=\"#ffffff\"
|
|
||||||
fill-opacity=\"1\">
|
|
||||||
</rect>")
|
|
||||||
|
|
||||||
|
|
||||||
(defn generate-markup-code [type shapes]
|
(defn generate-markup-code [type shapes]
|
||||||
svg-example)
|
(let [frame (dom/query js/document "#svg-frame")
|
||||||
|
markup-shape
|
||||||
|
(fn [shape]
|
||||||
|
(let [selector (str "#shape-" (:id shape) (when (= :text (:type shape)) " .root"))]
|
||||||
|
(when-let [el (and frame (dom/query frame selector))]
|
||||||
|
(str
|
||||||
|
(str/fmt "<!-- %s -->" (:name shape))
|
||||||
|
(.-outerHTML el)))))]
|
||||||
|
(->> shapes
|
||||||
|
(map markup-shape )
|
||||||
|
(remove nil?)
|
||||||
|
(str/join "\n\n"))))
|
||||||
|
|
||||||
(mf/defc code-block [{:keys [code type]}]
|
(mf/defc code-block [{:keys [code type]}]
|
||||||
(let [block-ref (mf/use-ref)]
|
(let [code (-> code
|
||||||
|
(str/replace "<defs></defs>" "")
|
||||||
|
(str/replace "><" ">\n<"))
|
||||||
|
code (cond-> code
|
||||||
|
(= type "svg") (beautify/html #js {"indent_size" 2}))
|
||||||
|
block-ref (mf/use-ref)]
|
||||||
(mf/use-effect
|
(mf/use-effect
|
||||||
(mf/deps code type block-ref)
|
(mf/deps code type block-ref)
|
||||||
(fn []
|
(fn []
|
||||||
|
@ -52,7 +59,7 @@
|
||||||
(map #(gsh/translate-to-frame % frame)))
|
(map #(gsh/translate-to-frame % frame)))
|
||||||
|
|
||||||
style-code (cg/generate-style-code @style-type shapes)
|
style-code (cg/generate-style-code @style-type shapes)
|
||||||
markup-code (generate-markup-code @markup-type shapes)]
|
markup-code (mf/use-memo (mf/deps shapes) #(generate-markup-code @markup-type shapes))]
|
||||||
[:div.element-options
|
[:div.element-options
|
||||||
[:div.code-block
|
[:div.code-block
|
||||||
[:div.code-row-lang
|
[:div.code-row-lang
|
||||||
|
@ -74,7 +81,7 @@
|
||||||
[:div.code-row-lang
|
[:div.code-row-lang
|
||||||
[:select.code-selection
|
[:select.code-selection
|
||||||
[:option "SVG"]
|
[:option "SVG"]
|
||||||
#_[:option "HTML"]]
|
[:option "HTML"]]
|
||||||
|
|
||||||
[:button.attributes-copy-button
|
[:button.attributes-copy-button
|
||||||
{:on-click #(wapi/write-to-clipboard markup-code)}
|
{:on-click #(wapi/write-to-clipboard markup-code)}
|
||||||
|
@ -85,5 +92,3 @@
|
||||||
:code markup-code}]]]
|
:code markup-code}]]]
|
||||||
|
|
||||||
]))
|
]))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
[app.main.ui.shapes.circle :as circle]
|
[app.main.ui.shapes.circle :as circle]
|
||||||
[app.main.ui.shapes.frame :as frame]
|
[app.main.ui.shapes.frame :as frame]
|
||||||
[app.main.ui.shapes.group :as group]
|
[app.main.ui.shapes.group :as group]
|
||||||
[app.main.ui.shapes.icon :as icon]
|
|
||||||
[app.main.ui.shapes.image :as image]
|
[app.main.ui.shapes.image :as image]
|
||||||
[app.main.ui.shapes.path :as path]
|
[app.main.ui.shapes.path :as path]
|
||||||
[app.main.ui.shapes.rect :as rect]
|
[app.main.ui.shapes.rect :as rect]
|
||||||
|
@ -111,7 +110,6 @@
|
||||||
[objects show-interactions?]
|
[objects show-interactions?]
|
||||||
(let [path-wrapper (shape-wrapper-factory path/path-shape)
|
(let [path-wrapper (shape-wrapper-factory path/path-shape)
|
||||||
text-wrapper (shape-wrapper-factory text/text-shape)
|
text-wrapper (shape-wrapper-factory text/text-shape)
|
||||||
icon-wrapper (shape-wrapper-factory icon/icon-shape)
|
|
||||||
rect-wrapper (shape-wrapper-factory rect/rect-shape)
|
rect-wrapper (shape-wrapper-factory rect/rect-shape)
|
||||||
image-wrapper (shape-wrapper-factory image/image-shape)
|
image-wrapper (shape-wrapper-factory image/image-shape)
|
||||||
circle-wrapper (shape-wrapper-factory circle/circle-shape)]
|
circle-wrapper (shape-wrapper-factory circle/circle-shape)]
|
||||||
|
@ -130,7 +128,6 @@
|
||||||
(case (:type shape)
|
(case (:type shape)
|
||||||
:curve [:> path-wrapper opts]
|
:curve [:> path-wrapper opts]
|
||||||
:text [:> text-wrapper opts]
|
:text [:> text-wrapper opts]
|
||||||
:icon [:> icon-wrapper opts]
|
|
||||||
:rect [:> rect-wrapper opts]
|
:rect [:> rect-wrapper opts]
|
||||||
:path [:> path-wrapper opts]
|
:path [:> path-wrapper opts]
|
||||||
:image [:> image-wrapper opts]
|
:image [:> image-wrapper opts]
|
||||||
|
@ -163,7 +160,8 @@
|
||||||
(mf/deps objects)
|
(mf/deps objects)
|
||||||
#(frame-container-factory objects))]
|
#(frame-container-factory objects))]
|
||||||
|
|
||||||
[:svg {:view-box vbox
|
[:svg {:id "svg-frame"
|
||||||
|
:view-box vbox
|
||||||
:width width
|
:width width
|
||||||
:height height
|
:height height
|
||||||
:version "1.1"
|
:version "1.1"
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
[app.main.ui.shapes.circle :as circle]
|
[app.main.ui.shapes.circle :as circle]
|
||||||
[app.main.ui.shapes.frame :as frame]
|
[app.main.ui.shapes.frame :as frame]
|
||||||
[app.main.ui.shapes.group :as group]
|
[app.main.ui.shapes.group :as group]
|
||||||
[app.main.ui.shapes.icon :as icon]
|
|
||||||
[app.main.ui.shapes.image :as image]
|
[app.main.ui.shapes.image :as image]
|
||||||
[app.main.ui.shapes.path :as path]
|
[app.main.ui.shapes.path :as path]
|
||||||
[app.main.ui.shapes.rect :as rect]
|
[app.main.ui.shapes.rect :as rect]
|
||||||
|
@ -86,10 +85,6 @@
|
||||||
[show-interactions?]
|
[show-interactions?]
|
||||||
(generic-wrapper-factory rect/rect-shape show-interactions?))
|
(generic-wrapper-factory rect/rect-shape show-interactions?))
|
||||||
|
|
||||||
(defn icon-wrapper
|
|
||||||
[show-interactions?]
|
|
||||||
(generic-wrapper-factory icon/icon-shape show-interactions?))
|
|
||||||
|
|
||||||
(defn image-wrapper
|
(defn image-wrapper
|
||||||
[show-interactions?]
|
[show-interactions?]
|
||||||
(generic-wrapper-factory image/image-shape show-interactions?))
|
(generic-wrapper-factory image/image-shape show-interactions?))
|
||||||
|
@ -142,7 +137,6 @@
|
||||||
[objects show-interactions?]
|
[objects show-interactions?]
|
||||||
(let [path-wrapper (path-wrapper show-interactions?)
|
(let [path-wrapper (path-wrapper show-interactions?)
|
||||||
text-wrapper (text-wrapper show-interactions?)
|
text-wrapper (text-wrapper show-interactions?)
|
||||||
icon-wrapper (icon-wrapper show-interactions?)
|
|
||||||
rect-wrapper (rect-wrapper show-interactions?)
|
rect-wrapper (rect-wrapper show-interactions?)
|
||||||
image-wrapper (image-wrapper show-interactions?)
|
image-wrapper (image-wrapper show-interactions?)
|
||||||
circle-wrapper (circle-wrapper show-interactions?)]
|
circle-wrapper (circle-wrapper show-interactions?)]
|
||||||
|
@ -160,7 +154,6 @@
|
||||||
(case (:type shape)
|
(case (:type shape)
|
||||||
:curve [:> path-wrapper opts]
|
:curve [:> path-wrapper opts]
|
||||||
:text [:> text-wrapper opts]
|
:text [:> text-wrapper opts]
|
||||||
:icon [:> icon-wrapper opts]
|
|
||||||
:rect [:> rect-wrapper opts]
|
:rect [:> rect-wrapper opts]
|
||||||
:path [:> path-wrapper opts]
|
:path [:> path-wrapper opts]
|
||||||
:image [:> image-wrapper opts]
|
:image [:> image-wrapper opts]
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
[app.main.ui.cursors :as cur]
|
[app.main.ui.cursors :as cur]
|
||||||
[app.main.ui.shapes.rect :as rect]
|
[app.main.ui.shapes.rect :as rect]
|
||||||
[app.main.ui.shapes.circle :as circle]
|
[app.main.ui.shapes.circle :as circle]
|
||||||
[app.main.ui.shapes.icon :as icon]
|
|
||||||
[app.main.ui.shapes.image :as image]
|
[app.main.ui.shapes.image :as image]
|
||||||
[app.main.data.workspace.selection :as dws]
|
[app.main.data.workspace.selection :as dws]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
|
@ -40,7 +39,6 @@
|
||||||
(declare frame-wrapper)
|
(declare frame-wrapper)
|
||||||
|
|
||||||
(def circle-wrapper (common/generic-wrapper-factory circle/circle-shape))
|
(def circle-wrapper (common/generic-wrapper-factory circle/circle-shape))
|
||||||
(def icon-wrapper (common/generic-wrapper-factory icon/icon-shape))
|
|
||||||
(def image-wrapper (common/generic-wrapper-factory image/image-shape))
|
(def image-wrapper (common/generic-wrapper-factory image/image-shape))
|
||||||
(def rect-wrapper (common/generic-wrapper-factory rect/rect-shape))
|
(def rect-wrapper (common/generic-wrapper-factory rect/rect-shape))
|
||||||
|
|
||||||
|
@ -113,7 +111,6 @@
|
||||||
:path [:> path/path-wrapper opts]
|
:path [:> path/path-wrapper opts]
|
||||||
:text [:> text/text-wrapper opts]
|
:text [:> text/text-wrapper opts]
|
||||||
:group [:> group-wrapper opts]
|
:group [:> group-wrapper opts]
|
||||||
:icon [:> icon-wrapper opts]
|
|
||||||
:rect [:> rect-wrapper opts]
|
:rect [:> rect-wrapper opts]
|
||||||
:image [:> image-wrapper opts]
|
:image [:> image-wrapper opts]
|
||||||
:circle [:> circle-wrapper opts]
|
:circle [:> circle-wrapper opts]
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
[app.main.ui.context :as ctx]
|
[app.main.ui.context :as ctx]
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
[app.main.ui.keyboard :as kbd]
|
[app.main.ui.keyboard :as kbd]
|
||||||
[app.main.ui.shapes.icon :as icon]
|
|
||||||
[app.main.ui.workspace.sidebar.options.typography :refer [typography-entry]]
|
[app.main.ui.workspace.sidebar.options.typography :refer [typography-entry]]
|
||||||
[app.util.data :refer [matches-search]]
|
[app.util.data :refer [matches-search]]
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
[app.main.ui.hooks :as hooks]
|
[app.main.ui.hooks :as hooks]
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
[app.main.ui.keyboard :as kbd]
|
[app.main.ui.keyboard :as kbd]
|
||||||
[app.main.ui.shapes.icon :as icon]
|
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [t]]
|
[app.util.i18n :as i18n :refer [t]]
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
|
@ -35,7 +34,6 @@
|
||||||
[{:keys [shape] :as props}]
|
[{:keys [shape] :as props}]
|
||||||
(case (:type shape)
|
(case (:type shape)
|
||||||
:frame i/artboard
|
:frame i/artboard
|
||||||
:icon [:& icon/icon-svg {:shape shape}]
|
|
||||||
:image i/image
|
:image i/image
|
||||||
:line i/line
|
:line i/line
|
||||||
:circle i/circle
|
:circle i/circle
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
:letter-spacing
|
:letter-spacing
|
||||||
:text-decoration
|
:text-decoration
|
||||||
:text-transform]
|
:text-transform]
|
||||||
:to-prop {:fill-color "color" }
|
:to-prop {:fill-color "color"}
|
||||||
:format {:font-family #(str "'" % "'")
|
:format {:font-family #(str "'" % "'")
|
||||||
:font-style #(str "'" % "'")
|
:font-style #(str "'" % "'")
|
||||||
:font-size #(str % "px")
|
:font-size #(str % "px")
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
shape-format (->> text-shape-style vals (map :format) (reduce merge))
|
shape-format (->> text-shape-style vals (map :format) (reduce merge))
|
||||||
|
|
||||||
|
|
||||||
text-values (->> (ut/search-text-attrs (:content shape) (:props style-text))
|
text-values (->> (ut/search-text-attrs (:content shape) (conj (:props style-text) :fill-color-gradient))
|
||||||
(merge ut/default-text-attrs))]
|
(merge ut/default-text-attrs))]
|
||||||
|
|
||||||
(str/join
|
(str/join
|
||||||
|
|
|
@ -39,6 +39,11 @@
|
||||||
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24"
|
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24"
|
||||||
integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==
|
integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==
|
||||||
|
|
||||||
|
abbrev@1:
|
||||||
|
version "1.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
|
||||||
|
integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
|
||||||
|
|
||||||
ajv@^6.12.3:
|
ajv@^6.12.3:
|
||||||
version "6.12.6"
|
version "6.12.6"
|
||||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
|
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
|
||||||
|
@ -776,6 +781,11 @@ commander@2.15.1:
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f"
|
resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f"
|
||||||
integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==
|
integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==
|
||||||
|
|
||||||
|
commander@^2.19.0:
|
||||||
|
version "2.20.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
|
||||||
|
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
|
||||||
|
|
||||||
component-emitter@^1.2.1:
|
component-emitter@^1.2.1:
|
||||||
version "1.3.0"
|
version "1.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
|
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
|
||||||
|
@ -801,6 +811,14 @@ concat-stream@^1.6.0, concat-stream@^1.6.2:
|
||||||
readable-stream "^2.2.2"
|
readable-stream "^2.2.2"
|
||||||
typedarray "^0.0.6"
|
typedarray "^0.0.6"
|
||||||
|
|
||||||
|
config-chain@^1.1.12:
|
||||||
|
version "1.1.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.12.tgz#0fde8d091200eb5e808caf25fe618c02f48e4efa"
|
||||||
|
integrity sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==
|
||||||
|
dependencies:
|
||||||
|
ini "^1.3.4"
|
||||||
|
proto-list "~1.2.1"
|
||||||
|
|
||||||
console-browserify@^1.1.0:
|
console-browserify@^1.1.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336"
|
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336"
|
||||||
|
@ -1152,6 +1170,16 @@ ecc-jsbn@~0.1.1:
|
||||||
jsbn "~0.1.0"
|
jsbn "~0.1.0"
|
||||||
safer-buffer "^2.1.0"
|
safer-buffer "^2.1.0"
|
||||||
|
|
||||||
|
editorconfig@^0.15.3:
|
||||||
|
version "0.15.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.15.3.tgz#bef84c4e75fb8dcb0ce5cee8efd51c15999befc5"
|
||||||
|
integrity sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==
|
||||||
|
dependencies:
|
||||||
|
commander "^2.19.0"
|
||||||
|
lru-cache "^4.1.5"
|
||||||
|
semver "^5.6.0"
|
||||||
|
sigmund "^1.0.1"
|
||||||
|
|
||||||
electron-to-chromium@^1.3.571:
|
electron-to-chromium@^1.3.571:
|
||||||
version "1.3.583"
|
version "1.3.583"
|
||||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.583.tgz#47a9fde74740b1205dba96db2e433132964ba3ee"
|
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.583.tgz#47a9fde74740b1205dba96db2e433132964ba3ee"
|
||||||
|
@ -2296,6 +2324,17 @@ isstream@~0.1.2:
|
||||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||||
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
|
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
|
||||||
|
|
||||||
|
js-beautify@^1.13.0:
|
||||||
|
version "1.13.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.13.0.tgz#a056d5d3acfd4918549aae3ab039f9f3c51eebb2"
|
||||||
|
integrity sha512-/Tbp1OVzZjbwzwJQFIlYLm9eWQ+3aYbBXLSaqb1mEJzhcQAfrqMMQYtjb6io+U6KpD0ID4F+Id3/xcjH3l/sqA==
|
||||||
|
dependencies:
|
||||||
|
config-chain "^1.1.12"
|
||||||
|
editorconfig "^0.15.3"
|
||||||
|
glob "^7.1.3"
|
||||||
|
mkdirp "^1.0.4"
|
||||||
|
nopt "^5.0.0"
|
||||||
|
|
||||||
"js-tokens@^3.0.0 || ^4.0.0":
|
"js-tokens@^3.0.0 || ^4.0.0":
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
||||||
|
@ -2602,6 +2641,14 @@ loose-envify@^1.1.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
js-tokens "^3.0.0 || ^4.0.0"
|
js-tokens "^3.0.0 || ^4.0.0"
|
||||||
|
|
||||||
|
lru-cache@^4.1.5:
|
||||||
|
version "4.1.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd"
|
||||||
|
integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==
|
||||||
|
dependencies:
|
||||||
|
pseudomap "^1.0.2"
|
||||||
|
yallist "^2.1.2"
|
||||||
|
|
||||||
make-iterator@^1.0.0:
|
make-iterator@^1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6"
|
resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6"
|
||||||
|
@ -2892,6 +2939,13 @@ node-releases@^1.1.61:
|
||||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.64.tgz#71b4ae988e9b1dd7c1ffce58dd9e561752dfebc5"
|
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.64.tgz#71b4ae988e9b1dd7c1ffce58dd9e561752dfebc5"
|
||||||
integrity sha512-Iec8O9166/x2HRMJyLLLWkd0sFFLrFNy+Xf+JQfSQsdBJzPcHpNl3JQ9gD4j+aJxmCa25jNsIbM4bmACtSbkSg==
|
integrity sha512-Iec8O9166/x2HRMJyLLLWkd0sFFLrFNy+Xf+JQfSQsdBJzPcHpNl3JQ9gD4j+aJxmCa25jNsIbM4bmACtSbkSg==
|
||||||
|
|
||||||
|
nopt@^5.0.0:
|
||||||
|
version "5.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88"
|
||||||
|
integrity sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==
|
||||||
|
dependencies:
|
||||||
|
abbrev "1"
|
||||||
|
|
||||||
normalize-package-data@^2.3.2:
|
normalize-package-data@^2.3.2:
|
||||||
version "2.5.0"
|
version "2.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"
|
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"
|
||||||
|
@ -3341,6 +3395,16 @@ progress@^1.1.8:
|
||||||
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
|
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
|
||||||
integrity sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=
|
integrity sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=
|
||||||
|
|
||||||
|
proto-list@~1.2.1:
|
||||||
|
version "1.2.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849"
|
||||||
|
integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=
|
||||||
|
|
||||||
|
pseudomap@^1.0.2:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
|
||||||
|
integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM=
|
||||||
|
|
||||||
psl@^1.1.28:
|
psl@^1.1.28:
|
||||||
version "1.8.0"
|
version "1.8.0"
|
||||||
resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24"
|
resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24"
|
||||||
|
@ -3735,7 +3799,7 @@ semver-greatest-satisfied-range@^1.1.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
sver-compat "^1.5.0"
|
sver-compat "^1.5.0"
|
||||||
|
|
||||||
"semver@2 || 3 || 4 || 5", semver@^5.5.0:
|
"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0:
|
||||||
version "5.7.1"
|
version "5.7.1"
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
|
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
|
||||||
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
|
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
|
||||||
|
@ -3841,6 +3905,11 @@ should@^13.2.3:
|
||||||
should-type-adaptors "^1.0.1"
|
should-type-adaptors "^1.0.1"
|
||||||
should-util "^1.0.0"
|
should-util "^1.0.0"
|
||||||
|
|
||||||
|
sigmund@^1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590"
|
||||||
|
integrity sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=
|
||||||
|
|
||||||
signal-exit@^3.0.0:
|
signal-exit@^3.0.0:
|
||||||
version "3.0.3"
|
version "3.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
|
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
|
||||||
|
@ -4673,6 +4742,11 @@ y18n@^3.2.1:
|
||||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
|
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
|
||||||
integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
|
integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
|
||||||
|
|
||||||
|
yallist@^2.1.2:
|
||||||
|
version "2.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
|
||||||
|
integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=
|
||||||
|
|
||||||
yargs-parser@5.0.0-security.0:
|
yargs-parser@5.0.0-security.0:
|
||||||
version "5.0.0-security.0"
|
version "5.0.0-security.0"
|
||||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0-security.0.tgz#4ff7271d25f90ac15643b86076a2ab499ec9ee24"
|
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0-security.0.tgz#4ff7271d25f90ac15643b86076a2ab499ec9ee24"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue