Skip to content

Commit 3038faa

Browse files
refactor: drop unused deck helpers, approval package wording and styles (#179)
* refactor(slidedeck): drop unused paint resolver and radius wrapper * refactor(web): drop unused approval package wording and styles
1 parent 947975e commit 3038faa

4 files changed

Lines changed: 1 addition & 32 deletions

File tree

‎apps/web/src/config.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,8 @@ export const wording = {
638638
loadingSlides: "Loading slides…",
639639
slidesUnavailable:
640640
"The slides could not load. Reload the page to try again.",
641-
speakerNotes: "Speaker notes",
642641
downloadPdf: "Download PDF",
643642
openPdf: "Open PDF",
644-
downloadPptx: "Download PPTX",
645643
pdfTitle: "Approval package PDF preview",
646644
pdfUnreadable: "The PDF in this package could not be read.",
647645
manifest: {

‎apps/web/src/styles.css‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,21 +2232,6 @@ button[aria-disabled="true"] {
22322232
opacity: 0.8;
22332233
}
22342234

2235-
.approval-package-slide-notes {
2236-
padding: var(--space-3) var(--space-4);
2237-
border-radius: var(--radius-md);
2238-
border: 1px solid var(--wb-border);
2239-
background: color-mix(in srgb, var(--wb-muted) 50%, var(--wb-card));
2240-
font-size: 0.84375rem;
2241-
line-height: 1.55;
2242-
color: var(--wb-foreground);
2243-
}
2244-
2245-
.approval-package-slide-notes-label {
2246-
color: var(--wb-muted-foreground);
2247-
font-weight: 600;
2248-
}
2249-
22502235
.approval-package-pdf {
22512236
display: flex;
22522237
flex-direction: column;

‎packages/slidedeck/src/check.ts‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,6 @@ export function resolveThemeHex(theme: Theme, color: string): string {
5757
return raw.startsWith("#") ? raw.toUpperCase() : `#${raw.toUpperCase()}`;
5858
}
5959

60-
export function resolvePaintHex(theme: Theme, paint: Paint): string {
61-
if (typeof paint === "string") return resolveThemeHex(theme, paint);
62-
const first = paint.stops[0];
63-
if (!first) return resolveThemeHex(theme, "background");
64-
return resolveThemeHex(theme, first.color);
65-
}
66-
6760
function srgbChannelLuminance(byte: number): number {
6861
const s = byte / 255;
6962
if (s <= 0.04045) return s / 12.92;

‎packages/slidedeck/src/pdf.ts‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,6 @@ function scaleRadius(radius: PdfRadius): PdfRadius {
104104
];
105105
}
106106

107-
function scaleRadiusToPt(
108-
radius: PictureElement["radius"],
109-
): PdfRadius | undefined {
110-
if (radius === undefined) return undefined;
111-
return scaleRadius(radius);
112-
}
113-
114107
function richRunsToPdf(
115108
theme: Theme,
116109
text: RichText,
@@ -406,7 +399,7 @@ function renderPictureElement(
406399
): PdfElement {
407400
const box = pxBoxToPt(el);
408401
const data = media.get(el.image).data;
409-
const radius = scaleRadiusToPt(el.radius);
402+
const radius = el.radius === undefined ? undefined : scaleRadius(el.radius);
410403
const border = resolvePdfBorder(theme, el.border);
411404
return {
412405
type: "image",

0 commit comments

Comments
 (0)