Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Andrey Antukh 2025-05-08 12:22:50 +02:00
commit ab01f0b274
19 changed files with 121 additions and 21 deletions

View file

@ -32,9 +32,11 @@
- Add set selection in create Token themes flow [Taiga #10746](https://tree.taiga.io/project/penpot/issue/10746) - Add set selection in create Token themes flow [Taiga #10746](https://tree.taiga.io/project/penpot/issue/10746)
- Display indicator on not active sets [Taiga #10668](https://tree.taiga.io/project/penpot/issue/10668) - Display indicator on not active sets [Taiga #10668](https://tree.taiga.io/project/penpot/issue/10668)
- Create `input*` wrapper component, and `label*`, `input-field*` and `hint-message*` components [Taiga #10713](https://tree.taiga.io/project/penpot/us/10713) - Create `input*` wrapper component, and `label*`, `input-field*` and `hint-message*` components [Taiga #10713](https://tree.taiga.io/project/penpot/us/10713)
- Fix problem in viewer with the back button [Taiga #10907](https://tree.taiga.io/project/penpot/issue/10907)
### :bug: Bugs fixed ### :bug: Bugs fixed
- Fix shortcut for history version panel [Taiga #11006](https://tree.taiga.io/project/penpot/issue/11006)
- Fix positioning of comment drafts when near the right / bottom edges of viewport [Taiga #10534](https://tree.taiga.io/project/penpot/issue/10534) - Fix positioning of comment drafts when near the right / bottom edges of viewport [Taiga #10534](https://tree.taiga.io/project/penpot/issue/10534)
- Fix path having a wrong selrect [Taiga #10257](https://tree.taiga.io/project/penpot/issue/10257) - Fix path having a wrong selrect [Taiga #10257](https://tree.taiga.io/project/penpot/issue/10257)
- Fix SVG `stroke-linecap` property when importing SVGs [Taiga #9489](https://tree.taiga.io/project/penpot/issue/9489) - Fix SVG `stroke-linecap` property when importing SVGs [Taiga #9489](https://tree.taiga.io/project/penpot/issue/9489)

View file

@ -1,3 +1,9 @@
;; 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/.
;;
;; Copyright (c) KALEIDOS INC
(ns app.common.files.tokens (ns app.common.files.tokens
(:require (:require
[app.common.data :as d] [app.common.data :as d]

View file

@ -1,3 +1,9 @@
;; 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/.
;;
;; Copyright (c) KALEIDOS INC
(ns common-tests.logic.token-test (ns common-tests.logic.token-test
(:require (:require
[app.common.files.changes-builder :as pcb] [app.common.files.changes-builder :as pcb]

View file

@ -4,11 +4,13 @@ import { presenceFixture } from "../../data/workspace/ws-notifications";
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await WorkspacePage.init(page); await WorkspacePage.init(page);
const workspacePage = new WorkspacePage(page);
await workspacePage.setupEmptyFile(page);
}); });
test("Save and restore version", async ({ page }) => { test("Save and restore version", async ({ page }) => {
const workspacePage = new WorkspacePage(page); const workspacePage = new WorkspacePage(page);
await workspacePage.setupEmptyFile(page);
await workspacePage.mockRPC(/get\-file\?/, "workspace/versions-init.json"); await workspacePage.mockRPC(/get\-file\?/, "workspace/versions-init.json");
await workspacePage.mockRPC( await workspacePage.mockRPC(
"get-file-fragment?file-id=*&fragment-id=406b7b01-d3e2-80e4-8005-3138b7cc5f0b", "get-file-fragment?file-id=*&fragment-id=406b7b01-d3e2-80e4-8005-3138b7cc5f0b",
@ -87,3 +89,20 @@ test("Save and restore version", async ({ page }) => {
// check that the history panel is closed after restore // check that the history panel is closed after restore
await expect(page.getByRole("tab", { name: "design" })).toBeVisible(); await expect(page.getByRole("tab", { name: "design" })).toBeVisible();
}); });
test("BUG 11006 - Fix history panel shortcut", async ({ page }) => {
const workspacePage = new WorkspacePage(page);
await workspacePage.mockRPC(/get\-file\?/, "workspace/versions-init.json");
await workspacePage.mockRPC(
"get-file-snapshots?file-id=*",
"workspace/versions-snapshot-1.json",
);
await workspacePage.goToWorkspace();
await page.keyboard.press("Control+Alt+h");
await expect(
workspacePage.rightSidebar.getByText("There are no versions yet"),
).toBeVisible();
});

View file

@ -1,3 +1,9 @@
;; 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/.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.data.style-dictionary (ns app.main.data.style-dictionary
(:require (:require
["@tokens-studio/sd-transforms" :as sd-transforms] ["@tokens-studio/sd-transforms" :as sd-transforms]

View file

@ -1,3 +1,9 @@
;; 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/.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.data.tinycolor (ns app.main.data.tinycolor
"Bindings for tinycolor2 which supports a wide range of css compatible colors. "Bindings for tinycolor2 which supports a wide range of css compatible colors.

View file

@ -582,11 +582,14 @@
changes (-> (pcb/empty-changes it) changes (-> (pcb/empty-changes it)
(cll/generate-restore-component ldata component-id library-id page objects)) (cll/generate-restore-component ldata component-id library-id page objects))
page-id
(->> changes :redo-changes (keep :page-id) first)
frames frames
(->> changes :redo-changes (keep :frame-id))] (->> changes :redo-changes (keep :frame-id))]
(rx/of (dch/commit-changes changes) (rx/of (dch/commit-changes changes)
(ptk/data-event :layout/update {:ids frames})))))) (ptk/data-event :layout/update {:page-id page-id :ids frames}))))))
(defn restore-components (defn restore-components

View file

@ -98,18 +98,20 @@
;; Never call this directly but through the data-event `:layout/update` ;; Never call this directly but through the data-event `:layout/update`
;; Otherwise a lot of cycle dependencies could be generated ;; Otherwise a lot of cycle dependencies could be generated
(defn- update-layout-positions (defn- update-layout-positions
[{:keys [ids undo-group]}] [{:keys [page-id ids undo-group]}]
(ptk/reify ::update-layout-positions (ptk/reify ::update-layout-positions
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]
(let [objects (dsh/lookup-page-objects state) (let [page-id (or page-id (:current-page-id state))
objects (dsh/lookup-page-objects state page-id)
ids (->> ids (filter #(contains? objects %)))] ids (->> ids (filter #(contains? objects %)))]
(if (d/not-empty? ids) (if (d/not-empty? ids)
(let [modif-tree (dwm/create-modif-tree ids (ctm/reflow-modifiers))] (let [modif-tree (dwm/create-modif-tree ids (ctm/reflow-modifiers))]
(if (features/active-feature? state "render-wasm/v1") (if (features/active-feature? state "render-wasm/v1")
(rx/of (dwm/apply-wasm-modifiers modif-tree :stack-undo? true :undo-group undo-group)) (rx/of (dwm/apply-wasm-modifiers modif-tree :stack-undo? true :undo-group undo-group))
(rx/of (dwm/apply-modifiers {:modifiers modif-tree (rx/of (dwm/apply-modifiers {:page-id page-id
:modifiers modif-tree
:stack-undo? true :stack-undo? true
:undo-group undo-group})))) :undo-group undo-group}))))
(rx/empty)))))) (rx/empty))))))
@ -131,8 +133,9 @@
(rx/filter #(d/not-empty? %)) (rx/filter #(d/not-empty? %))
(rx/map (rx/map
(fn [data] (fn [data]
(let [ids (reduce #(into %1 (:ids %2)) #{} data)] (let [page-id (->> data (keep :page-id) first)
(update-layout-positions {:ids ids})))) ids (reduce #(into %1 (:ids %2)) #{} data)]
(update-layout-positions {:page-id page-id :ids ids}))))
(rx/take-until stopper)))))) (rx/take-until stopper))))))
(defn finalize-shape-layout (defn finalize-shape-layout

View file

@ -464,11 +464,11 @@
:subsections [:panels] :subsections [:panels]
:fn #(st/emit! (dcm/go-to-workspace :layout :assets))} :fn #(st/emit! (dcm/go-to-workspace :layout :assets))}
:toggle-history {:tooltip (ds/alt "H") :toggle-history {:tooltip (ds/meta-alt "H")
:command (ds/a-mod "h") :command (ds/ca-mod "h")
:subsections [:panels] :subsections [:panels]
:fn #(emit-when-no-readonly :fn #(emit-when-no-readonly
(dcm/go-to-workspace :layout :document-history))} (dw/toggle-layout-flag :document-history))}
:toggle-colorpalette {:tooltip (ds/alt "P") :toggle-colorpalette {:tooltip (ds/alt "P")
:command (ds/a-mod "p") :command (ds/a-mod "p")

View file

@ -1,3 +1,9 @@
;; 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/.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.data.workspace.tokens.errors (ns app.main.data.workspace.tokens.errors
(:require (:require
[app.util.i18n :refer [tr]] [app.util.i18n :refer [tr]]

View file

@ -1,3 +1,9 @@
;; 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/.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.data.workspace.tokens.warnings (ns app.main.data.workspace.tokens.warnings
(:require (:require
[app.util.i18n :refer [tr]] [app.util.i18n :refer [tr]]

View file

@ -198,7 +198,7 @@
} }
.import-error-disclaimer { .import-error-disclaimer {
color: var(--color-foreground-primary); color: var(--color-foreground-secondary);
} }
.import-error-list { .import-error-list {

View file

@ -127,6 +127,7 @@
width: $s-28; width: $s-28;
margin-left: $s-8; margin-left: $s-8;
background-color: var(--viewer-controls-background-color); background-color: var(--viewer-controls-background-color);
pointer-events: all;
svg { svg {
@extend .button-icon; @extend .button-icon;
stroke: var(--icon-foreground); stroke: var(--icon-foreground);

View file

@ -618,7 +618,7 @@
[:> dropdown-menu-item* {:class (stl/css :submenu-item) [:> dropdown-menu-item* {:class (stl/css :submenu-item)
:on-click on-pin-version :on-click on-pin-version
:on-key-down on-pin-version-key-down :on-key-down on-pin-version-key-down
:id "file-menu-show-version-history"} :id "file-menu-create-version"}
[:span {:class (stl/css :item-name)} [:span {:class (stl/css :item-name)}
(tr "dashboard.create-version-menu")]] (tr "dashboard.create-version-menu")]]
@ -627,7 +627,10 @@
:on-key-down on-show-version-history-key-down :on-key-down on-show-version-history-key-down
:id "file-menu-show-version-history"} :id "file-menu-show-version-history"}
[:span {:class (stl/css :item-name)} [:span {:class (stl/css :item-name)}
(tr "dashboard.show-version-history")]] (tr "dashboard.show-version-history")]
[:span {:class (stl/css :shortcut)}
(for [sc (scd/split-sc (sc/get-tooltip :toggle-history))]
[:span {:class (stl/css :shortcut-key) :key sc} sc])]]
[:div {:class (stl/css :separator)}]]) [:div {:class (stl/css :separator)}]])
@ -786,6 +789,7 @@
on-power-up-click on-power-up-click
(mf/use-fn (mf/use-fn
(fn [] (fn []
(st/emit! (ptk/event ::ev/event {::ev/name "explore-pricing-click" ::ev/origin "workspace-menu"}))
(dom/open-new-window "https://penpot.app/pricing"))) (dom/open-new-window "https://penpot.app/pricing")))
toggle-flag toggle-flag
@ -900,14 +904,16 @@
:id "file-menu-help-info"} :id "file-menu-help-info"}
[:span {:class (stl/css :item-name)} (tr "workspace.header.menu.option.help-info")] [:span {:class (stl/css :item-name)} (tr "workspace.header.menu.option.help-info")]
[:span {:class (stl/css :open-arrow)} i/arrow]] [:span {:class (stl/css :open-arrow)} i/arrow]]
[:> dropdown-menu-item* {:class (stl/css-case :menu-item true) ;; TODO remove this block when subscriptions is full implemented
:on-click on-power-up-click (when (contains? cf/flags :subscriptions-old)
:on-key-down (fn [event] [:> dropdown-menu-item* {:class (stl/css-case :menu-item true)
(when (kbd/enter? event) :on-click on-power-up-click
(on-power-up-click))) :on-key-down (fn [event]
:on-pointer-enter close-sub-menu (when (kbd/enter? event)
:id "file-menu-power-up"} (on-power-up-click)))
[:span {:class (stl/css :item-name)} (tr "workspace.header.menu.option.power-up")]]] :on-pointer-enter close-sub-menu
:id "file-menu-power-up"}
[:span {:class (stl/css :item-name)} (tr "workspace.header.menu.option.power-up")]])]
(case sub-menu (case sub-menu
:file :file

View file

@ -1,3 +1,9 @@
;; 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/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.tokens.helpers.state (ns frontend-tests.tokens.helpers.state
(:require (:require
[app.common.types.tokens-lib :as ctob] [app.common.types.tokens-lib :as ctob]

View file

@ -1,3 +1,9 @@
;; 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/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.tokens.helpers.tokens (ns frontend-tests.tokens.helpers.tokens
(:require (:require
[app.common.files.tokens :as cft] [app.common.files.tokens :as cft]

View file

@ -1,3 +1,9 @@
;; 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/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.tokens.logic.token-actions-test (ns frontend-tests.tokens.logic.token-actions-test
(:require (:require
[app.common.test-helpers.compositions :as ctho] [app.common.test-helpers.compositions :as ctho]

View file

@ -1,3 +1,9 @@
;; 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/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.tokens.logic.token-data-test (ns frontend-tests.tokens.logic.token-data-test
(:require (:require
[app.common.test-helpers.files :as cthf] [app.common.test-helpers.files :as cthf]

View file

@ -1,3 +1,9 @@
;; 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/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.tokens.style-dictionary-test (ns frontend-tests.tokens.style-dictionary-test
(:require (:require
[app.common.transit :as tr] [app.common.transit :as tr]