mirror of
https://github.com/penpot/penpot.git
synced 2025-05-13 01:16:37 +02:00
Merge branch 'main' into develop
This commit is contained in:
commit
eff333cbaf
5 changed files with 51 additions and 30 deletions
12
CHANGES.md
12
CHANGES.md
|
@ -27,6 +27,18 @@
|
||||||
- zzkt [#814](https://github.com/penpot/penpot/pull/814)
|
- zzkt [#814](https://github.com/penpot/penpot/pull/814)
|
||||||
|
|
||||||
|
|
||||||
|
## 1.4.1-alpha
|
||||||
|
|
||||||
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
|
- Fix typography unlinking.
|
||||||
|
- Fix incorrect measures on shapes outside artboard.
|
||||||
|
- Fix issues on svg parsing related to numbers with exponents.
|
||||||
|
- Fix some race conditions on removing shape from workspace.
|
||||||
|
- Fix incorrect state management of user lang selection.
|
||||||
|
- Fix email validation usability issue on team invitation lightbox.
|
||||||
|
|
||||||
|
|
||||||
## 1.4.0-alpha
|
## 1.4.0-alpha
|
||||||
|
|
||||||
### :sparkles: New features
|
### :sparkles: New features
|
||||||
|
|
|
@ -173,7 +173,6 @@
|
||||||
|
|
||||||
(defn update-text-attrs
|
(defn update-text-attrs
|
||||||
[{:keys [id attrs]}]
|
[{:keys [id attrs]}]
|
||||||
(let [attrs (d/without-nils attrs)]
|
|
||||||
(ptk/reify ::update-text-attrs
|
(ptk/reify ::update-text-attrs
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
|
@ -188,7 +187,7 @@
|
||||||
update-fn #(update-shape % txt/is-text-node? attrs/merge attrs)
|
update-fn #(update-shape % txt/is-text-node? attrs/merge attrs)
|
||||||
shape-ids (cond (= (:type shape) :text) [id]
|
shape-ids (cond (= (:type shape) :text) [id]
|
||||||
(= (:type shape) :group) (cp/get-children id objects))]
|
(= (:type shape) :group) (cp/get-children id objects))]
|
||||||
(rx/of (dwc/update-shapes shape-ids update-fn))))))))
|
(rx/of (dwc/update-shapes shape-ids update-fn)))))))
|
||||||
|
|
||||||
;; --- RESIZE UTILS
|
;; --- RESIZE UTILS
|
||||||
|
|
||||||
|
|
|
@ -237,7 +237,8 @@
|
||||||
(when-not (empty? attrs)
|
(when-not (empty? attrs)
|
||||||
(st/emit! (dwt/update-text-attrs {:id id :attrs attrs})))))
|
(st/emit! (dwt/update-text-attrs {:id id :attrs attrs})))))
|
||||||
|
|
||||||
typography (cond
|
typography
|
||||||
|
(cond
|
||||||
(and (:typography-ref-id values)
|
(and (:typography-ref-id values)
|
||||||
(not= (:typography-ref-id values) :multiple)
|
(not= (:typography-ref-id values) :multiple)
|
||||||
(not= (:typography-ref-file values) file-id))
|
(not= (:typography-ref-file values) file-id))
|
||||||
|
|
|
@ -7,14 +7,15 @@
|
||||||
(ns app.util.text-editor
|
(ns app.util.text-editor
|
||||||
"Draft related abstraction functions."
|
"Draft related abstraction functions."
|
||||||
(:require
|
(:require
|
||||||
["draft-js" :as draft]
|
|
||||||
["./text_editor_impl.js" :as impl]
|
["./text_editor_impl.js" :as impl]
|
||||||
|
["draft-js" :as draft]
|
||||||
[app.common.attrs :as attrs]
|
[app.common.attrs :as attrs]
|
||||||
[app.common.text :as txt]
|
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.util.transit :as t]
|
[app.common.text :as txt]
|
||||||
|
[app.common.uuid :as uuid]
|
||||||
[app.util.array :as arr]
|
[app.util.array :as arr]
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
|
[app.util.transit :as t]
|
||||||
[clojure.walk :as walk]
|
[clojure.walk :as walk]
|
||||||
[cuerdas.core :as str]))
|
[cuerdas.core :as str]))
|
||||||
|
|
||||||
|
@ -23,6 +24,7 @@
|
||||||
(defn encode-style-value
|
(defn encode-style-value
|
||||||
[v]
|
[v]
|
||||||
(cond
|
(cond
|
||||||
|
(uuid? v) (str "u:" v)
|
||||||
(string? v) (str "s:" v)
|
(string? v) (str "s:" v)
|
||||||
(number? v) (str "n:" v)
|
(number? v) (str "n:" v)
|
||||||
(keyword? v) (str "k:" (name v))
|
(keyword? v) (str "k:" (name v))
|
||||||
|
@ -38,6 +40,7 @@
|
||||||
"n:" (js/Number (subs v 2))
|
"n:" (js/Number (subs v 2))
|
||||||
"k:" (keyword (subs v 2))
|
"k:" (keyword (subs v 2))
|
||||||
"m:" (t/decode (subs v 2))
|
"m:" (t/decode (subs v 2))
|
||||||
|
"u:" (uuid/uuid (subs v 2))
|
||||||
"z:" nil
|
"z:" nil
|
||||||
"o:" (subs v 2)
|
"o:" (subs v 2)
|
||||||
v)))
|
v)))
|
||||||
|
|
|
@ -106,12 +106,18 @@ export function applyInlineStyle(state, styles) {
|
||||||
let content = null;
|
let content = null;
|
||||||
|
|
||||||
for (let style of styles) {
|
for (let style of styles) {
|
||||||
const [p, k, _] = style.split("$$$");
|
console.log("applyInlineStyle", style);
|
||||||
|
|
||||||
|
const [p, k, v] = style.split("$$$");
|
||||||
const prefix = [p, k, ""].join("$$$");
|
const prefix = [p, k, ""].join("$$$");
|
||||||
|
|
||||||
content = state.getCurrentContent();
|
content = state.getCurrentContent();
|
||||||
content = removeInlineStylePrefix(content, selection, prefix);
|
content = removeInlineStylePrefix(content, selection, prefix);
|
||||||
|
|
||||||
|
if (v !== "z:null") {
|
||||||
content = Modifier.applyInlineStyle(content, selection, style);
|
content = Modifier.applyInlineStyle(content, selection, style);
|
||||||
|
}
|
||||||
|
|
||||||
state = EditorState.push(state, content, "change-inline-style");
|
state = EditorState.push(state, content, "change-inline-style");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue