diff --git a/CHANGES.md b/CHANGES.md index fa618fa820..1cc035453c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -83,6 +83,7 @@ example. It's still usable as before, we just removed the example. - Ensure consistent snap behavior across all zoom levels [Github #7774](https://github.com/penpot/penpot/pull/7774) by [@Tokytome](https://github.com/Tokytome) - Fix crash in token grid view due to tooltip validation (by @dfelinto) [Github #7887](https://github.com/penpot/penpot/pull/7887) +- Enable Hindi translations on the application ### :sparkles: New features & Enhancements diff --git a/backend/src/app/binfile/v3.clj b/backend/src/app/binfile/v3.clj index e044ef2e8b..bd6c041b0a 100644 --- a/backend/src/app/binfile/v3.clj +++ b/backend/src/app/binfile/v3.clj @@ -821,9 +821,10 @@ entries (keep (match-storage-entry-fn) entries)] (doseq [{:keys [id entry]} entries] - (let [object (->> (read-entry input entry) - (decode-storage-object) - (validate-storage-object)) + (let [object (-> (read-entry input entry) + (decode-storage-object) + (update :bucket d/nilv sto/default-bucket) + (validate-storage-object)) ext (cmedia/mtype->extension (:content-type object)) path (str "objects/" id ext) diff --git a/backend/src/app/storage.clj b/backend/src/app/storage.clj index 0d7bac7eca..0fe48c2911 100644 --- a/backend/src/app/storage.clj +++ b/backend/src/app/storage.clj @@ -35,6 +35,9 @@ :assets-s3 :s3 nil))) +(def default-bucket + "file-media-object") + (def valid-buckets #{"file-media-object" "team-font-variant" diff --git a/backend/src/app/storage/gc_touched.clj b/backend/src/app/storage/gc_touched.clj index 964765589b..fa3e144ef9 100644 --- a/backend/src/app/storage/gc_touched.clj +++ b/backend/src/app/storage/gc_touched.clj @@ -25,7 +25,7 @@ [app.common.time :as ct] [app.config :as cf] [app.db :as db] - [app.storage :as-alias sto] + [app.storage :as sto] [app.storage.impl :as impl] [integrant.core :as ig])) @@ -130,7 +130,7 @@ [{:keys [metadata]}] (or (some-> metadata :bucket) (some-> metadata :reference d/name) - "file-media-object")) + sto/default-bucket)) (defn- process-objects! [conn has-refs? bucket objects] diff --git a/frontend/scripts/_helpers.js b/frontend/scripts/_helpers.js index 559cacf236..49603f0d12 100644 --- a/frontend/scripts/_helpers.js +++ b/frontend/scripts/_helpers.js @@ -276,6 +276,7 @@ export async function compileTranslations() { "id", "ru", "tr", + "hi", "zh_CN", "zh_Hant", "hr", diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 93db68bd85..a8077fe15d 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -270,8 +270,12 @@ (ptk/reify ::process-wasm-object ptk/EffectEvent (effect [_ state _] - (let [objects (dsh/lookup-page-objects state)] - (wasm.api/process-object (get objects id)))))) + (let [objects (dsh/lookup-page-objects state) + shape (get objects id)] + ;; Only process objects that exist in the current page + ;; This prevents errors when processing changes from other pages + (when shape + (wasm.api/process-object shape)))))) (defn initialize-workspace [team-id file-id] diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs index ce8f2ce7b5..b6f919c8c3 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs @@ -271,8 +271,10 @@ :font-variant-id new-variant-id :font-weight (:weight variant) :font-style (:style variant)})) - - (dom/blur! (dom/get-target new-variant-id))))) + ;; NOTE: the select component we are using does not fire on-blur event + ;; so we need to call on-blur manually + (when (some? on-blur) + (on-blur))))) on-font-select (mf/use-fn diff --git a/frontend/src/app/main/ui/workspace/viewport/comments.scss b/frontend/src/app/main/ui/workspace/viewport/comments.scss index 2e6b283f86..18c737cef0 100644 --- a/frontend/src/app/main/ui/workspace/viewport/comments.scss +++ b/frontend/src/app/main/ui/workspace/viewport/comments.scss @@ -19,5 +19,5 @@ } .threads { - position: fixed; + position: absolute; } diff --git a/frontend/src/app/plugins/shape.cljs b/frontend/src/app/plugins/shape.cljs index 8cf45c60c3..f4794ef6e8 100644 --- a/frontend/src/app/plugins/shape.cljs +++ b/frontend/src/app/plugins/shape.cljs @@ -54,6 +54,7 @@ [app.plugins.ruler-guides :as rg] [app.plugins.text :as text] [app.plugins.utils :as u] + [app.util.http :as http] [app.util.object :as obj] [beicon.v2.core :as rx] [cuerdas.core :as str])) @@ -1195,7 +1196,12 @@ (js/Promise. (fn [resolve reject] (->> (rp/cmd! :export payload) - (rx/mapcat #(rp/cmd! :export {:cmd :get-resource :wait true :id (:id %) :blob? true})) + (rx/mapcat (fn [{:keys [uri]}] + (->> (http/send! {:method :get + :uri uri + :response-type :blob + :omit-default-headers true}) + (rx/map :body)))) (rx/mapcat #(.arrayBuffer %)) (rx/map #(js/Uint8Array. %)) (rx/subs! resolve reject)))))))) diff --git a/frontend/src/app/render_wasm/api.cljs b/frontend/src/app/render_wasm/api.cljs index cc18034b57..f0c8a7a12b 100644 --- a/frontend/src/app/render_wasm/api.cljs +++ b/frontend/src/app/render_wasm/api.cljs @@ -18,6 +18,7 @@ [app.common.types.path :as path] [app.common.types.path.impl :as path.impl] [app.common.types.shape.layout :as ctl] + [app.common.types.text :as txt] [app.common.uuid :as uuid] [app.config :as cf] [app.main.refs :as refs] @@ -964,8 +965,8 @@ (set-shape-children children) (set-shape-corners corners) (set-shape-blur blur) - (when (and (= type :group) masked) - (set-masked masked)) + (when (= type :group) + (set-masked (boolean masked))) (when (= type :bool) (set-shape-bool-type bool-type)) (when (and (some? content) @@ -1411,20 +1412,23 @@ (get span)) text (subs (:text element) start-pos end-pos)] - {:x x - :y (+ y height) - :width width - :height height - :direction (dr/translate-direction direction) - :font-family (get element :font-family) - :font-size (get element :font-size) - :font-weight (get element :font-weight) - :text-transform (get element :text-transform) - :text-decoration (get element :text-decoration) - :letter-spacing (get element :letter-spacing) - :font-style (get element :font-style) - :fills (get element :fills) - :text text}))))] + (d/patch-object + txt/default-text-attrs + (d/without-nils + {:x x + :y (+ y height) + :width width + :height height + :direction (dr/translate-direction direction) + :font-family (get element :font-family) + :font-size (get element :font-size) + :font-weight (get element :font-weight) + :text-transform (get element :text-transform) + :text-decoration (get element :text-decoration) + :letter-spacing (get element :letter-spacing) + :font-style (get element :font-style) + :fills (get element :fills) + :text text}))))))] (mem/free) result))) diff --git a/frontend/src/app/render_wasm/shape.cljs b/frontend/src/app/render_wasm/shape.cljs index 335a1432d5..0ae88e07c1 100644 --- a/frontend/src/app/render_wasm/shape.cljs +++ b/frontend/src/app/render_wasm/shape.cljs @@ -233,8 +233,8 @@ (api/set-shape-shadows (:shadow shape))) :masked-group - (when (cfh/mask-shape? shape) - (api/set-masked (:masked-group shape))) + (when (cfh/group-shape? shape) + (api/set-masked (boolean (:masked-group shape)))) :content (cond diff --git a/frontend/src/app/util/i18n.cljs b/frontend/src/app/util/i18n.cljs index 3b43ca3b29..149c0c7ff5 100644 --- a/frontend/src/app/util/i18n.cljs +++ b/frontend/src/app/util/i18n.cljs @@ -50,6 +50,7 @@ {:label "Føroyskt mál (community)" :value "fo"} {:label "Korean (community)" :value "ko"} {:label "עִבְרִית (community)" :value "he"} + {:label "आधुनिक मानक हिन्दी (community)" :value "hi"} {:label "عربي/عربى (community)" :value "ar"} {:label "فارسی (community)" :value "fa"} {:label "日本語 (Community)" :value "ja_jp"}