feat(studio): non-destructive crop + cross-project asset view

This commit is contained in:
Miguel Angel Simon Sierra
2026-07-06 23:40:32 -04:00
parent 8c3590a90e
commit 676f461f6a
39 changed files with 1646 additions and 208 deletions
@@ -1,3 +1,4 @@
// fallow-ignore-file code-duplication
import { parseHTML } from "linkedom";
import { describe, expect, it } from "vitest";
import {
@@ -56,6 +57,16 @@ describe("patchElementInHtml", () => {
expect(result).toContain('id="hero"');
});
it("patches a 4-side clip-path inset inline style", () => {
const { html: result, matched } = patchElementInHtml(FIXTURE, { id: "hero" }, [
{ type: "inline-style", property: "clip-path", value: "inset(10px 20px 30px 40px)" },
]);
expect(matched).toBe(true);
expect(result).toMatch(/clip-path:\s*inset\(10px 20px 30px 40px\)/);
expect(result).toContain('id="hero"');
});
it("patches inline style by class selector", () => {
const { html: result } = patchElementInHtml(FIXTURE, { selector: ".hero-heading" }, [
{ type: "inline-style", property: "font-size", value: "72px" },