Skip to content

Commit 5ad8d6a

Browse files
committed
Merge branch 'main' into releases
# Conflicts: # package-lock.json # tests/package.json
2 parents cbc659c + 5f88e05 commit 5ad8d6a

File tree

226 files changed

+3680
-2174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+3680
-2174
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
CI: true
6565

6666
- name: Install Playwright
67-
run: npx playwright install --with-deps
67+
run: npm run install-playwright
6868

6969
- name: Run Playwright tests
7070
working-directory: ./tests

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ blocknote
1111
└── tests - Playwright end to end tests
1212
```
1313

14-
An introduction into the BlockNote Prosemirror schema can be found in [packages/core/ARCHITECTURE.md](https://github.com/TypeCellOS/BlockNote/blob/main/packages/core/ARCHITECTURE.md).
14+
An introduction into the BlockNote Prosemirror schema can be found in [packages/core/src/pm-nodes/README.md](https://github.com/TypeCellOS/BlockNote/blob/main/packages/core/src/pm-nodes/README.md).
1515

1616
## Running
1717

docs/components/example/ExampleBlock.tsx

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import dynamic from "next/dynamic";
2-
import { AiFillCodeSandboxCircle, AiFillGithub } from "react-icons/ai";
2+
import { AiFillGithub } from "react-icons/ai";
3+
import { SiStackblitz } from "react-icons/si";
34

45
import { examples } from "./generated/exampleComponents.gen";
56
import "./styles.css";
67

7-
const baseGitHubURL =
8-
"https://github.com/TypeCellOS/BlockNote/tree/main/examples/";
9-
const baseCodeSandboxURL =
10-
"https://githubbox.com/TypeCellOS/BlockNote/tree/main/examples/";
8+
const baseGitHubURL = "https://github.com/TypeCellOS/BlockNote/tree/main/";
9+
// const baseCodeSandboxURL =
10+
// "https://githubbox.com/TypeCellOS/BlockNote/tree/main/";
11+
12+
const baseStackBlitzURL =
13+
"https://www.stackblitz.com/github/TypeCellOS/BlockNote/tree/main/";
1114

1215
const ThemedExample = dynamic(() => import("./ThemedExample"), {
1316
ssr: false,
1417
});
1518

1619
export function ExampleBlock(props: {
1720
name: keyof typeof examples;
21+
path: string;
1822
children: any;
1923
}) {
2024
// const example = examplesFlattened.find((e) => e.slug === props.name);
@@ -25,24 +29,26 @@ export function ExampleBlock(props: {
2529
return (
2630
<div className="demo nx-bg-primary-700/5 dark:nx-bg-primary-300/10 mt-6 rounded-lg p-4">
2731
<div className={"flex flex-row gap-6 pb-4"}>
28-
<button
32+
<a
2933
className={
3034
"nx-select-none nx-text-gray-600 hover:nx-text-black dark:nx-text-gray-200 dark:hover:nx-text-white flex flex-row items-center gap-1"
3135
}
32-
onClick={() => window.open(`${baseGitHubURL}${props.name}/`)}>
36+
href={`${baseGitHubURL}${props.path}/`}
37+
target="_blank">
3338
<AiFillGithub />
3439
<div className={"text-sm"}>GitHub</div>
35-
</button>
36-
<button
40+
</a>
41+
<a
3742
className={
3843
"nx-select-none nx-text-gray-600 hover:nx-text-black dark:nx-text-gray-200 dark:hover:nx-text-white flex flex-row items-center gap-1"
3944
}
40-
onClick={() => window.open(`${baseCodeSandboxURL}${props.name}/`)}>
41-
<AiFillCodeSandboxCircle />
42-
<div className={"text-sm"}>CodeSandbox</div>
43-
</button>
45+
href={`${baseStackBlitzURL}${props.path}/`}
46+
target="_blank">
47+
<SiStackblitz />
48+
<div className={"text-sm"}>StackBlitz</div>
49+
</a>
4450
</div>
45-
<div className={"h-96 overflow-auto rounded-lg"}>
51+
<div className={"demo-contents h-96 overflow-auto rounded-lg"}>
4652
<ThemedExample name={props.name} />
4753
</div>
4854
{props.children}

docs/components/example/styles.css

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
:focus-visible {
2-
box-shadow: unset !important;
2+
box-shadow: unset !important;
33
}
44

55
.demo .nextra-code-block pre {
6-
background-color: transparent !important;
7-
margin: 0 !important;
8-
padding: 0 !important;
6+
background-color: transparent !important;
7+
margin: 0 !important;
8+
padding: 0 !important;
99
}
1010

1111
.demo .nextra-code-block code > span {
12-
padding: 0 !important;
12+
padding: 0 !important;
1313
}
1414

15-
.demo .bn-container, .demo .bn-editor {
16-
height: 100%;
15+
.demo .bn-container,
16+
.demo .bn-editor {
17+
height: 100%;
1718
}
1819

1920
.demo .bn-editor {
20-
overflow: auto;
21-
padding-block: 1rem;
21+
overflow: auto;
22+
padding-block: 1rem;
2223
}
2324

24-
.demo a {
25-
color: revert;
26-
text-decoration: revert;
27-
}
25+
.demo-contents a {
26+
color: revert;
27+
text-decoration: revert;
28+
}

docs/components/pages/landing/gradients.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,20 @@ section {
1111
--bg-color: #000000;
1212
}
1313

14-
.editor-glow {
14+
.demo-glow {
1515
--glow-opacity: 0.4;
16+
display: block;
17+
}
18+
19+
.text-glow {
20+
--glow-opacity: 0.2;
21+
display: none;
22+
@media only screen and (hover: none) and (pointer: coarse) {
23+
display: block; /* disable on mobile */
24+
}
25+
}
26+
27+
.hero-glow {
1628
background: conic-gradient(
1729
from 33deg at 50% 50%,
1830
hsla(var(--glow-blue), var(--glow-opacity)),

docs/components/pages/landing/hero/Demo.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ const DemoEditor = dynamic(
2929
},
3030
);
3131

32-
export function Demo(props: { theme: "light" | "dark" }) {
32+
export function Demo(props: { theme?: "light" | "dark" }) {
3333
return (
34-
<div className="hero relative h-[36rem] w-full shrink-0 grow-0 rounded-lg xl:w-[584px]">
35-
<div className="editor-glow absolute z-10 h-full w-full" />
34+
<div className="hero-demo relative h-[36rem] w-full shrink-0 grow-0 rounded-lg sm:block xl:w-[584px]">
35+
<div className="hero-glow demo-glow absolute z-10 h-full w-full" />
3636
<div className="relative z-20 h-full w-full rounded-lg bg-white dark:bg-[#202020]">
37-
<DemoEditor theme={props.theme === "dark" ? "dark" : "light"} />
37+
<DemoEditor theme={props.theme} />
3838
</div>
3939
<TryHereImage />
4040
</div>

docs/components/pages/landing/hero/DemoEditor.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import { useCallback, useMemo, useState } from "react";
66
import YPartyKitProvider from "y-partykit/provider";
77
import * as Y from "yjs";
88

9-
import "./styles.css";
10-
119
const colors = [
1210
"#958DF1",
1311
"#F98181",
@@ -54,9 +52,8 @@ function getUTCDateYYYYMMDD() {
5452
return `${year}${formattedMonth}${formattedDay}`;
5553
}
5654

57-
export default function DemoEditor(props: { theme: "light" | "dark" }) {
55+
export default function DemoEditor(props: { theme?: "light" | "dark" }) {
5856
const [doc, provider] = useMemo(() => {
59-
console.log("create");
6057
const doc = new Y.Doc();
6158
const provider = new YPartyKitProvider(
6259
"blocknote.yousefed.partykit.dev",

docs/components/pages/landing/hero/Hero.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { Text } from "@/components/pages/landing/hero/Text";
44
import { Demo } from "@/components/pages/landing/hero/Demo";
55
import { FadeIn } from "@/components/pages/landing/shared/FadeIn";
66

7+
import "./styles.css";
8+
79
export function Hero() {
810
const { theme } = useTheme();
911

@@ -15,7 +17,13 @@ export function Hero() {
1517
"z-20 flex w-full flex-col items-center justify-between gap-6 px-6 md:max-w-screen-md xl:max-w-[1440px] xl:flex-row"
1618
}>
1719
<Text />
18-
<Demo theme={theme === "dark" ? "dark" : "light"} />
20+
<Demo
21+
theme={
22+
theme === undefined || theme === "system"
23+
? undefined
24+
: (theme as "light" | "dark" | undefined)
25+
}
26+
/>
1927
</FadeIn>
2028
</Section>
2129
);

docs/components/pages/landing/hero/Text.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ import { CTAButton } from "@/components/pages/landing/shared/CTAButton";
66

77
export function Text() {
88
return (
9-
<div className="flex h-fit flex-col items-center justify-center gap-6 text-center xl:w-[584px] xl:items-start xl:text-left">
10-
<HeroText h1>
9+
<div className="relative flex h-fit flex-col items-center justify-center gap-6 text-center xl:w-[584px] xl:items-start xl:text-left">
10+
<div className="hero-glow text-glow absolute block h-full w-full sm:hidden" />
11+
<HeroText h1 className={"z-10"}>
1112
The open source
1213
<br />
1314
<strong>Block-Based</strong>
1415
<br />
1516
rich text editor
1617
</HeroText>
17-
<SectionSubtext>
18+
<SectionSubtext className={"z-10"}>
1819
A beautiful text editor that just works. Easily add an editor to your
1920
app that users will love. Customize it with your own functionality like
2021
custom blocks or AI tooling.
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
.hero .bn-container, .hero .bn-editor {
1+
.hero-demo {
2+
@media only screen and (hover: none) and (pointer: coarse) {
3+
display: none; /* disable on mobile */
4+
}
5+
}
6+
7+
.hero-demo .bn-container, .hero-demo .bn-editor {
28
height: 100%
39
}
410

5-
.hero .bn-editor {
11+
.hero-demo .bn-editor {
612
overflow: auto;
713
min-height: 100%;
814
/* Removes focus outline */
915
box-shadow: none !important;
1016
padding-block: 1rem
1117
}
1218

13-
.hero a {
19+
.hero-demo a {
1420
color: revert;
1521
text-decoration: revert;
1622
}

0 commit comments

Comments
 (0)