+
{children}
@@ -542,7 +534,7 @@ const SectionItem = ({ itemId, children, style }: SectionItemProps) => {
{children}
@@ -1597,9 +1589,7 @@ export const Section = ({ section, placement, showHeading = true }: SectionProps
return (
-
- {render ? render() : }
-
+ {render ? render() : }
);
};
diff --git a/packages/pdf/src/templates/shared/skill-keyword-presentation.test.tsx b/packages/pdf/src/templates/shared/skill-keyword-presentation.test.tsx
index a69bd73ac..261813327 100644
--- a/packages/pdf/src/templates/shared/skill-keyword-presentation.test.tsx
+++ b/packages/pdf/src/templates/shared/skill-keyword-presentation.test.tsx
@@ -110,7 +110,7 @@ describe("skill keyword presentation", () => {
text: '@version 1; section[type="skills"] field[name="keywords"] { font-size: 18pt; } section[type="skills"] item[id="css-hidden"] { display: none; }',
},
};
- const runtime = resolveResumeRuntime({ data, template: "leafish", mode: "semantic" });
+ const runtime = resolveResumeRuntime({ data, template: "leafish" });
expect(runtime.diagnostics).toEqual([]);
const { text, pages } = await renderKeywords(data);
expect(text).toContain("Engineering");
diff --git a/packages/pdf/src/templates/shared/skill-level-alignment.test.tsx b/packages/pdf/src/templates/shared/skill-level-alignment.test.tsx
index 317513baf..aece43f17 100644
--- a/packages/pdf/src/templates/shared/skill-level-alignment.test.tsx
+++ b/packages/pdf/src/templates/shared/skill-level-alignment.test.tsx
@@ -11,7 +11,6 @@ import { rasterizePdf } from "../../semantic/test/rasterize-pdf";
type FixtureOptions = {
columns: number;
count: number;
- mode?: "semantic" | "legacy";
configure?: (data: ResumeData) => void;
};
@@ -19,14 +18,14 @@ function setCss(data: ResumeData, css: string) {
data.metadata.stylesheet = { mode: "semantic", source: { languageVersion: 1, text: `@version 1; ${css}` } };
}
-async function renderRatings({ columns, count, mode = "semantic", configure }: FixtureOptions) {
+async function renderRatings({ columns, count, configure }: FixtureOptions) {
const data = structuredClone(defaultResumeData);
data.metadata.typography.body.fontFamily = "Helvetica";
data.metadata.typography.heading.fontFamily = "Helvetica";
data.metadata.page.hideIcons = true;
data.metadata.design.colors.primary = "rgba(255, 0, 0, 1)";
data.metadata.layout.pages = [{ fullWidth: true, main: ["skills"], sidebar: [] }];
- data.metadata.stylesheet = { mode, source: { languageVersion: 1, text: "@version 1;" } };
+ data.metadata.stylesheet = { mode: "semantic", source: { languageVersion: 1, text: "@version 1;" } };
data.sections.skills.columns = columns;
data.sections.skills.items = Array.from({ length: count }, (_, index) => ({
id: `skill-${index}`,
@@ -39,7 +38,7 @@ async function renderRatings({ columns, count, mode = "semantic", configure }: F
keywords: index === 1 ? Array.from({ length: 12 }, (_, word) => `Keyword${word}`) : ["Short"],
}));
configure?.(data);
- expect(resolveResumeRuntime({ data, template: "onyx", mode }).diagnostics).toEqual([]);
+ expect(resolveResumeRuntime({ data, template: "onyx" }).diagnostics).toEqual([]);
const bytes = await act(() => renderToBuffer(
));
const pages = await rasterizePdf(new Uint8Array(bytes));
const loading = getDocument({ data: new Uint8Array(bytes) });
@@ -82,21 +81,18 @@ async function renderRatings({ columns, count, mode = "semantic", configure }: F
}
describe("skill rating alignment (#3343)", () => {
- it.each(["semantic", "legacy"] as const)(
- "aligns mixed-height skills and preserves an incomplete row in %s mode",
- async (mode) => {
- const {
- rows: [rows],
- text,
- } = await renderRatings({ columns: 2, count: 3, mode });
- expect(rows).toHaveLength(2);
- if (!rows?.[0] || !rows[1]) throw new Error("Missing rating rows");
- // Ten circles share the first row; the remaining skill has five.
- expect(rows.map((row) => row.circles)).toEqual([10, 5]);
- expect(text).toContain("Keyword11");
- expect(text).toContain("Skill 2");
- },
- );
+ it("aligns mixed-height skills and preserves an incomplete row", async () => {
+ const {
+ rows: [rows],
+ text,
+ } = await renderRatings({ columns: 2, count: 3 });
+ expect(rows).toHaveLength(2);
+ if (!rows?.[0] || !rows[1]) throw new Error("Missing rating rows");
+ // Ten circles share the first row; the remaining skill has five.
+ expect(rows.map((row) => row.circles)).toEqual([10, 5]);
+ expect(text).toContain("Keyword11");
+ expect(text).toContain("Skill 2");
+ });
it("aligns three columns and preserves an incomplete row", async () => {
const {
rows: [rows],
diff --git a/packages/pdf/src/templates/shared/style-rules.test.ts b/packages/pdf/src/templates/shared/style-rules.test.ts
index 386aef12b..237332add 100644
--- a/packages/pdf/src/templates/shared/style-rules.test.ts
+++ b/packages/pdf/src/templates/shared/style-rules.test.ts
@@ -1,7 +1,8 @@
import type { ResumeData } from "@reactive-resume/schema/resume/data";
import { describe, expect, it } from "vitest";
import { defaultResumeData } from "@reactive-resume/schema/resume/default";
-import { getSectionStyleRuleContext, resolveStyleRuleSlot } from "./style-rules";
+import { getSectionStyleRuleContext } from "@reactive-resume/schema/resume/style-rules";
+import { resolveStyleRuleSlot } from "./style-rules";
const createResumeData = (styleRules: ResumeData["metadata"]["styleRules"]): ResumeData => ({
...defaultResumeData,
diff --git a/packages/pdf/src/templates/shared/style-rules.ts b/packages/pdf/src/templates/shared/style-rules.ts
index 6d7759171..028d3fa96 100644
--- a/packages/pdf/src/templates/shared/style-rules.ts
+++ b/packages/pdf/src/templates/shared/style-rules.ts
@@ -1,17 +1,13 @@
import type { ResumeData, StyleIntent, StyleSlot } from "@reactive-resume/schema/resume/data";
import type { SectionStyleRuleContext } from "@reactive-resume/schema/resume/style-rules";
import type { Style } from "../../forme/style-types";
-import { getSectionStyleRuleContext, resolveStyleIntentForSlot } from "@reactive-resume/schema/resume/style-rules";
+import { resolveStyleIntentForSlot } from "@reactive-resume/schema/resume/style-rules";
import { rgbaStringToHex } from "@reactive-resume/utils/color";
-export type { SectionStyleRuleContext };
-
export type ResolveStyleRuleSlotOptions = SectionStyleRuleContext & {
slot: StyleSlot;
};
-export { getSectionStyleRuleContext };
-
const spacingProperties = [
"padding",
"paddingTop",
diff --git a/packages/schema/src/resume/style-rules.test.ts b/packages/schema/src/resume/style-rules.test.ts
deleted file mode 100644
index 65df3e083..000000000
--- a/packages/schema/src/resume/style-rules.test.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { describe, expect, it } from "vitest";
-import { defaultResumeData } from "./default";
-import { resolveStyleRuleFontSize } from "./style-rules";
-
-describe("resolveStyleRuleFontSize", () => {
- it("returns global icon font sizes without section context", () => {
- const data = {
- ...defaultResumeData,
- metadata: {
- ...defaultResumeData.metadata,
- styleRules: [
- {
- id: "icon-global",
- label: "",
- enabled: true,
- target: { scope: "global" as const },
- slots: { icon: { fontSize: 22 } },
- },
- ],
- },
- };
-
- expect(resolveStyleRuleFontSize(data, { slot: "icon" })).toBe(22);
- });
-
- it("does not apply level font sizes to the icon slot", () => {
- const data = {
- ...defaultResumeData,
- metadata: {
- ...defaultResumeData.metadata,
- styleRules: [
- {
- id: "level-global",
- label: "",
- enabled: true,
- target: { scope: "global" as const },
- slots: { level: { fontSize: 18 } },
- },
- ],
- },
- };
-
- expect(resolveStyleRuleFontSize(data, { slot: "icon" })).toBeUndefined();
- });
-});
diff --git a/packages/schema/src/resume/style-rules.ts b/packages/schema/src/resume/style-rules.ts
index 0cdb5c84e..206ff8011 100644
--- a/packages/schema/src/resume/style-rules.ts
+++ b/packages/schema/src/resume/style-rules.ts
@@ -26,8 +26,6 @@ const builtInSectionTypes = new Set
([
"references",
]);
-const clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));
-
export const getSectionStyleRuleContext = (data: ResumeData, sectionId: string): SectionStyleRuleContext => {
if (sectionId === "summary") return { sectionId, sectionType: "summary" };
if (builtInSectionTypes.has(sectionId as SectionType)) {
@@ -62,13 +60,3 @@ export const resolveStyleIntentForSlot = (data: ResumeData, options: ResolveStyl
return Object.assign({}, ...bySpecificity.map((rule) => rule.slots[options.slot]));
};
-
-export const resolveStyleRuleFontSize = (
- data: ResumeData,
- options: ResolveStyleRuleSlotOptions,
-): number | undefined => {
- const fontSize = resolveStyleIntentForSlot(data, options).fontSize;
- if (fontSize === undefined) return undefined;
-
- return clamp(fontSize, 6, 48);
-};
diff --git a/tests/e2e/fixtures/db.ts b/tests/e2e/fixtures/db.ts
index e0b71ebd6..e04a1d0f9 100644
--- a/tests/e2e/fixtures/db.ts
+++ b/tests/e2e/fixtures/db.ts
@@ -1,15 +1,6 @@
import type { E2EAccount } from "./data";
-import { readFileSync } from "node:fs";
-import { resolve } from "node:path";
import { Pool } from "pg";
-const legacyParityRules = JSON.parse(
- readFileSync(
- resolve(process.cwd(), "packages/pdf/src/semantic/__fixtures__/legacy/custom-section-type.json"),
- "utf8",
- ),
-) as unknown[];
-
function getDatabaseUrl() {
const databaseUrl = process.env.DATABASE_URL;
if (!databaseUrl) throw new Error("DATABASE_URL is required for E2E cleanup.");
@@ -28,7 +19,7 @@ export async function deleteE2EUser(account: E2EAccount) {
}
type SemanticStylesheetSeed = {
- mode: "legacy" | "semantic";
+ mode: "semantic";
source: { languageVersion: number; text: string };
};
@@ -38,7 +29,6 @@ async function _updateSemanticCssFixture(
stylesheet?: SemanticStylesheetSeed;
portableLayout?: "balanced" | "pagination-stress";
experienceItemId?: string;
- legacyStyleRule?: boolean;
hidePicture?: boolean;
basicsName?: string;
},
@@ -116,11 +106,6 @@ async function _updateSemanticCssFixture(
},
];
}
- if (update.legacyStyleRule) {
- const metadata = data.metadata as Record;
- delete metadata.stylesheet;
- metadata.styleRules = structuredClone(legacyParityRules);
- }
if (update.hidePicture) {
const picture = data.picture as Record;
picture.hidden = true;