Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade puck to v0.15.0 #160

Merged
merged 5 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions app/blog/[...puckPath]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ export async function generateMetadata({
const { path } = resolvePuckPath(params.puckPath);
const pageRes = await getPageRes(`${blogPath}${path}`);
const data = pageRes?.data?.data as Data;
const root = data?.root;
const pageDescription =
root?.description || root?.props?.description || blogPostDescription;
const pageImage = root?.ogImage || root?.props?.ogImage || {};
const pageTitle = root?.title || root?.props?.title || "Post";
const rootProps = data?.root?.props;
const pageDescription = rootProps?.description || blogPostDescription;
const pageImage = rootProps?.ogImage || {};
const pageTitle = rootProps?.title || "Post";
const pageUrl = `${siteUrl}${blogPath}${path}`;
const post = data?.content?.find(
(item: ComponentData) => item.type === "Post"
Expand Down
8 changes: 4 additions & 4 deletions app/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export async function generateMetadata(): Promise<Metadata> {
const path = "/blog";
const pageRes = await getPageRes(path);
const data = pageRes?.data?.data as Data;
const root = data?.root;
const pageDescription = root?.description || blogDescription;
const pageImage = root?.ogImage || {};
const pageTitle = root?.title || "Blog";
const rootProps = data?.root?.props;
const pageDescription = rootProps?.description || blogDescription;
const pageImage = rootProps?.ogImage || {};
const pageTitle = rootProps?.title || "Blog";
const pageUrl = `${siteUrl}${path}`;

return {
Expand Down
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
src="https://plausible.io/js/plausible.js"
></script>
</head>
<body style={{ margin: "0" }}>{children}</body>
<body>{children}</body>
</html>
);
}
8 changes: 4 additions & 4 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export const viewport: Viewport = {
export async function generateMetadata(): Promise<Metadata> {
const pageRes = await getPageRes("/");
const data = pageRes?.data?.data as Data;
const root = data.root;
const pageDescription = root?.description || description;
const pageImage = root?.ogImage || {};
const pageTitle = root?.title || title;
const rootProps = data?.root?.props;
const pageDescription = rootProps?.description || description;
const pageImage = rootProps?.ogImage || {};
const pageTitle = rootProps?.title || title;

return {
alternates: { canonical: siteUrl },
Expand Down
3 changes: 1 addition & 2 deletions components/Artifact/Artifact.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.msrd .msrd-Artifact {
color: currentColor;
display: block;
font: var(--font-08);
font-weight: 100;
font: 100 var(--font-08);
letter-spacing: var(--font-08-letter-spacing);
}
4 changes: 4 additions & 0 deletions components/Base/Base.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
min-height: 100vh;
}

body {
margin: 0;
}

/* prevent 100vh when rendered in Puck editor */
body > div .msrd {
min-height: 100%;
Expand Down
9 changes: 3 additions & 6 deletions components/Contact/Contact.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,22 @@

.msrd .msrd-Contact-heading {
color: var(--color-brand);
font: var(--font-08);
font-weight: 700;
font: 700 var(--font-08);
letter-spacing: var(--font-08-letter-spacing);
margin-bottom: 0;
margin-top: 0;
}

@media (min-width: 23em) {
.msrd .msrd-Contact-heading {
font: var(--font-09);
font-weight: 700;
font: 700 var(--font-09);
letter-spacing: var(--font-09-letter-spacing);
}
}

@media (min-width: 48em) {
.msrd .msrd-Contact-heading {
font: var(--font-10);
font-weight: 700;
font: 700 var(--font-10);
letter-spacing: var(--font-10-letter-spacing);
margin-bottom: var(--space-vertical-01);
}
Expand Down
43 changes: 15 additions & 28 deletions components/Heading/Heading.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,91 +5,78 @@
}
monospaced marked this conversation as resolved.
Show resolved Hide resolved

.msrd .msrd-Heading--6 {
font: var(--font-02);
font-weight: 700;
font: 700 var(--font-02);
letter-spacing: var(--font-02-letter-spacing);
}

.msrd .msrd-Heading--5 {
font: var(--font-03);
font-weight: 700;
font: 700 var(--font-03);
letter-spacing: var(--font-03-letter-spacing);
}

@media (min-width: 48em) {
.msrd .msrd-Heading--5 {
font: var(--font-04);
font-weight: 700;
font: 700 var(--font-04);
letter-spacing: var(--font-04-letter-spacing);
}
}

.msrd .msrd-Heading--4 {
font: var(--font-04);
font-weight: 700;
font: 700 var(--font-04);
letter-spacing: var(--font-04-letter-spacing);
}

@media (min-width: 48em) {
.msrd .msrd-Heading--4 {
font: var(--font-05);
font-weight: 700;
font: 700 var(--font-05);
letter-spacing: var(--font-05-letter-spacing);
}
}

.msrd .msrd-Heading--3 {
font: var(--font-05);
font-weight: 700;
font: 700 var(--font-05);
letter-spacing: var(--font-05-letter-spacing);
}

@media (min-width: 48em) {
.msrd .msrd-Heading--3 {
font: var(--font-06);
font-weight: 700;
font: 700 var(--font-06);
letter-spacing: var(--font-06-letter-spacing);
}
}

.msrd .msrd-Heading--2 {
font: var(--font-07);
font-weight: 700;
font: 700 var(--font-07);
letter-spacing: var(--font-07-letter-spacing);
}

@media (min-width: 48em) {
.msrd .msrd-Heading--2 {
font: var(--font-08);
font-weight: 700;
font: 700 var(--font-08);
letter-spacing: var(--font-08-letter-spacing);
}
}

.msrd .msrd-Heading--1 {
font: var(--font-09);
font-weight: 800;
font: 800 var(--font-09);
letter-spacing: var(--font-09-letter-spacing);
}

@media (min-width: 48em) {
.msrd .msrd-Heading--1 {
font: var(--font-10);
font-weight: 800;
.msrd .msrd-Heading--1 {
font: 800 var(--font-10);
letter-spacing: var(--font-10-letter-spacing);
}
}

.msrd .msrd-Heading--display {
font: var(--font-09);
font-weight: 800;
font: 800 var(--font-09);
letter-spacing: var(--font-09-letter-spacing);
}

@media (min-width: 48em) {
.msrd .msrd-Heading--display {
font: var(--font-11);
font-weight: 800;
.msrd .msrd-Heading--display {
font: 800 var(--font-11);
letter-spacing: var(--font-11-letter-spacing);
}
}
Expand Down
6 changes: 2 additions & 4 deletions components/Hero/Hero.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.msrd .msrd-Hero-strapline {
font: var(--font-09);
font-weight: 800;
font: 800 var(--font-09);
letter-spacing: var(--font-09-letter-spacing);
margin-bottom: var(--space-vertical-03);
margin-top: 0;
Expand All @@ -16,8 +15,7 @@

@media (min-width: 48em) {
.msrd .msrd-Hero-strapline {
font: var(--font-11);
font-weight: 800;
font: 800 var(--font-11);
letter-spacing: var(--font-11-letter-spacing);
margin-bottom: var(--space-vertical-05);
}
Expand Down
39 changes: 15 additions & 24 deletions components/Markdown/Markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@
}

.msrd .msrd-Markdown pre code {
font: var(--font-02);
font-size: var(--font-02-size);
font-family: var(--font-family-monospaced);
font-feature-settings: normal;
font-weight: inherit;
display: block;
line-height: var(--font-02-line-height);
margin-bottom: var(--space-vertical);
overflow-x: auto;
padding: var(--space-vertical);
width: 100%;
}

.msrd .msrd-Markdown h6 {
font: var(--font-02);
font-weight: 700;
font: 700 var(--font-02);
letter-spacing: var(--font-02-letter-spacing);
margin-bottom: var(--space-vertical-03);
margin-top: var(--space-vertical);
Expand All @@ -104,89 +104,79 @@
}

.msrd .msrd-Markdown h5 {
font: var(--font-03);
font-weight: 700;
font: 700 var(--font-03);
letter-spacing: var(--font-03-letter-spacing);
margin-bottom: var(--space-vertical-03);
margin-top: var(--space-vertical);
}

@media (min-width: 48em) {
.msrd .msrd-Markdown h5 {
font: var(--font-04);
font-weight: 700;
font: 700 var(--font-04);
letter-spacing: var(--font-04-letter-spacing);
margin-bottom: var(--space-vertical);
margin-top: var(--space-vertical-06);
}
}

.msrd .msrd-Markdown h4 {
font: var(--font-04);
font-weight: 700;
font: 700 var(--font-04);
letter-spacing: var(--font-04-letter-spacing);
margin-bottom: var(--space-vertical-03);
margin-top: var(--space-vertical);
}

@media (min-width: 48em) {
.msrd .msrd-Markdown h4 {
font: var(--font-05);
font-weight: 700;
font: 700 var(--font-05);
letter-spacing: var(--font-05-letter-spacing);
margin-bottom: var(--space-vertical);
margin-top: var(--space-vertical-06);
}
}

.msrd .msrd-Markdown h3 {
font: var(--font-05);
font-weight: 700;
font: 700 var(--font-05);
letter-spacing: var(--font-05-letter-spacing);
margin-bottom: var(--space-vertical-03);
margin-top: var(--space-vertical);
}

@media (min-width: 48em) {
.msrd .msrd-Markdown h3 {
font: var(--font-06);
font-weight: 700;
font: 700 var(--font-06);
letter-spacing: var(--font-06-letter-spacing);
margin-bottom: var(--space-vertical);
margin-top: var(--space-vertical-06);
}
}

.msrd .msrd-Markdown h2 {
font: var(--font-07);
font-weight: 700;
font: 700 var(--font-07);
letter-spacing: var(--font-07-letter-spacing);
margin-bottom: var(--space-vertical-03);
margin-top: var(--space-vertical);
}

@media (min-width: 48em) {
.msrd .msrd-Markdown h2 {
font: var(--font-08);
font-weight: 700;
font: 700 var(--font-08);
letter-spacing: var(--font-08-letter-spacing);
margin-bottom: var(--space-vertical);
margin-top: var(--space-vertical-06);
}
}

.msrd .msrd-Markdown h1 {
font: var(--font-09);
font-weight: 800;
font: 800 var(--font-09);
letter-spacing: var(--font-09-letter-spacing);
margin-bottom: var(--space-vertical-06);
margin-top: 0;
}

@media (min-width: 48em) {
.msrd .msrd-Markdown h1 {
font: var(--font-10);
font-weight: 800;
font: 800 var(--font-10);
letter-spacing: var(--font-10-letter-spacing);
}
}
Expand Down Expand Up @@ -256,11 +246,12 @@
.msrd .msrd-Markdown table {
border-collapse: collapse;
font: inherit;
font: var(--font-02);
font-size: var(--font-02-size);
font-family: var(--font-family-monospaced);
font-feature-settings: normal;
font-weight: inherit;
letter-spacing: 0;
line-height: var(--font-02-line-height);
margin-bottom: var(--space-vertical);
width: 100%;
}
Expand Down
3 changes: 1 addition & 2 deletions components/Paragraph/Paragraph.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.msrd .msrd-Paragraph {
font: var(--font-03);
font: 400 var(--font-03);
letter-spacing: var(--font-03-letter-spacing);
font-weight: normal;
margin: 0;
}

Expand Down
Loading