Skip to content

Commit

Permalink
resolve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Moon-DaeSeung committed Sep 23, 2024
1 parent a66fda4 commit c309d61
Show file tree
Hide file tree
Showing 7 changed files with 381 additions and 4 deletions.
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/react-notion-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@matejmazur/react-katex": "^3.1.3",
"@types/he": "^1.2.3",
"@types/katex": "^0.16.7",
"he": "^1.2.0",
Expand Down
17 changes: 17 additions & 0 deletions packages/react-notion-custom/src/lib/components/equation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @link react-katex https://github.com/MatejBransky/react-katex?tab=readme-ov-file
*/
import "katex/dist/katex.min.css";
import TeX from "@matejmazur/react-katex";

import { EquationArgs } from "../types";

const Equation = ({ equation: { expression } }: EquationArgs) => {
return (
<TeX className="notion-block notion-equation notion-equation-block">
{expression}
</TeX>
);
};

export default Equation;
4 changes: 3 additions & 1 deletion packages/react-notion-custom/src/lib/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import Headings from "./headings";
import Paragraph from "./paragraph";
import Toggle from "./toggle";
import Equation from "./equation";

export { Headings, Paragraph, Toggle };
export { Headings, Paragraph, Toggle, Equation };

export default {
heading_1: Headings,
heading_2: Headings,
heading_3: Headings,
paragraph: Paragraph,
toggle: Toggle,
equation: Equation,
};
34 changes: 31 additions & 3 deletions packages/react-notion-custom/src/lib/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@
border-top-width: 8px;
}

.notion-toggle-title {
display: block;
width: 100%;
}

.notion-h-content {
position: relative;

Expand Down Expand Up @@ -558,7 +563,30 @@
.notion-paragraph-content {
padding: 3px 2px;
}
.notion-toggle-title {
display: block;
width: 100%;

.notion-equation {
position: relative;
display: inline-flex;
color: inherit;
fill: inherit;
user-select: none;
border-radius: 3px;
transition: background 20ms ease-in 0s;
}
.notion-equation-block {
display: flex;
flex-direction: column;
justify-items: center;
align-items: center;
overflow: auto;
padding: 16px 8px;
margin: 2px 0;
cursor: pointer;
}
.notion-equation:hover {
background: var(--bg-color-0);
}
.notion-equation:active,
.notion-equation:focus {
background: var(--select-color-2);
}
Loading

0 comments on commit c309d61

Please sign in to comment.