0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-14 19:19:09 -05:00

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

This commit is contained in:
Andrey Antukh 2025-02-06 12:57:33 +01:00
commit 8b466ef0a3
8 changed files with 45 additions and 9 deletions

View file

@ -68,10 +68,12 @@ is a number of cores)
- Fix error when reseting stroke cap
- Fix problem with strokes not refreshing in Safari [Taiga #9040](https://tree.taiga.io/project/penpot/issue/9040)
- Fix problem with multiple color changes [Taiga #9631](https://tree.taiga.io/project/penpot/issue/9631)
- Fix create new layers in a component copy [Taiga #10037](https://tree.taiga.io/project/penpot/issue/10037)
- Fix problem in plugins with zoomIntoView [Plugins #189](https://github.com/penpot/penpot-plugins/issues/189)
- Fix problem in plugins with renaming components [Taiga #10060](https://tree.taiga.io/project/penpot/issue/10060)
- Added upload svg with images method [#5489](https://github.com/penpot/penpot/issues/5489)
- Fix problem with root frame parent reference [Taiga #9437](https://tree.taiga.io/project/penpot/issue/9437)
- Fix change flex direction using plugins API [Taiga #9407](https://tree.taiga.io/project/penpot/issue/9407)
## 2.4.3

View file

@ -535,10 +535,11 @@
(letfn [(get-frame [parent-id]
(if (cfh/frame-shape? objects parent-id) parent-id (get-in objects [parent-id :frame-id])))]
(let [parent (get objects parent-id)
;; We can always move the children to the parent they already have
;; We can always move the children to the parent they already have.
no-changes?
(->> children (every? #(= parent-id (:parent-id %))))]
(if (or no-changes? (not (invalid-structure-for-component? objects parent children pasting? libraries)))
;; In case no-changes is true we must ensure we are copy pasting the children in the same position
(if (or (and no-changes? (not pasting?)) (not (invalid-structure-for-component? objects parent children pasting? libraries)))
[parent-id (get-frame parent-id)]
(recur (:parent-id parent) objects children pasting? libraries))))))

View file

@ -60,8 +60,8 @@ test("BUG 10090 - Local library should be expanded by default", async ({
await workspacePage.clickAssets();
expect(workspacePage.sidebar.getByText("Local library")).toBeVisible();
expect(workspacePage.sidebar.getByText("Components")).toBeVisible();
expect(workspacePage.sidebar.getByText("Colors")).toBeVisible();
expect(workspacePage.sidebar.getByText("Typographies")).toBeVisible();
await expect(workspacePage.sidebar.getByText("Local library")).toBeVisible();
await expect(workspacePage.sidebar.getByText("Components")).toBeVisible();
await expect(workspacePage.sidebar.getByText("Colors")).toBeVisible();
await expect(workspacePage.sidebar.getByText("Typographies")).toBeVisible();
});

View file

@ -181,3 +181,34 @@ test("Bug 9900 - Color picker has no inputs for HSV values", async ({
await workspacePage.page.getByLabel("S", { exact: true }).isVisible();
await workspacePage.page.getByLabel("V", { exact: true }).isVisible();
});
test("Bug 10089 - Cannot change alpha", async ({ page }) => {
const workspacePage = new WorkspacePage(page);
await workspacePage.setupEmptyFile();
await workspacePage.mockRPC(
/get\-file\?/,
"workspace/get-file-not-empty.json",
);
await workspacePage.mockRPC(
"update-file?id=*",
"workspace/update-file-create-rect.json",
);
await workspacePage.goToWorkspace({
fileId: "6191cd35-bb1f-81f7-8004-7cc63d087374",
pageId: "6191cd35-bb1f-81f7-8004-7cc63d087375",
});
await workspacePage.clickLeafLayer("Rectangle");
const swatch = workspacePage.page.getByRole("button", { name: "#B1B2B5" });
const swatchBox = await swatch.boundingBox();
await swatch.click();
const alpha = workspacePage.page.getByLabel("A", { exact: true });
await expect(alpha).toHaveValue("100");
const alphaSlider = workspacePage.page.getByTestId("slider-opacity");
await alphaSlider.click();
await expect(alpha).toHaveValue("50");
});

View file

@ -181,7 +181,7 @@ test.describe("Tokens: Tokens Tab", () => {
const colorTokenChanged = tokensSidebar.getByRole("button", {
name: "colors.blue.100.changed",
});
expect(colorTokenChanged).toBeVisible();
await expect(colorTokenChanged).toBeVisible();
});
test("User edits theme and activates it in the sidebar", async ({ page }) => {

View file

@ -181,7 +181,8 @@
(when (or (not= (str/lower (:hex color)) (str/lower (:hex current-color)))
(not= (:h color) (:h current-color))
(not= (:s color) (:s current-color))
(not= (:v color) (:v current-color)))
(not= (:v color) (:v current-color))
(not= (:alpha color) (:alpha current-color)))
(let [recent-color (merge current-color color)
recent-color (dc/materialize-color-components recent-color)]
(st/emit! (dc/update-colorpicker-color recent-color (not @drag?)))))))

View file

@ -57,6 +57,7 @@
:hue (= type :hue)
:opacity (= type :opacity)
:value (= type :value)))
:data-testid (when (= type :opacity) "slider-opacity")
:on-pointer-down handle-start-drag
:on-pointer-up handle-stop-drag
:on-lost-pointer-capture handle-stop-drag

View file

@ -954,7 +954,7 @@
:else
(do (st/emit! (dwsl/create-layout-from-id id :flex :from-frame? true :calculate-params? false))
(grid/grid-layout-proxy plugin-id file-id page-id id)))))
(flex/flex-layout-proxy plugin-id file-id page-id id)))))
:addGridLayout
(fn []