Skip to content

Commit 1770bb1

Browse files
fix: ShadCN example Tailwind setup (#2042)
* Added option to `.bnexample.json` to run example in Tailwind project * Added `type: "module"` to examples `package.json` * Added option to `.bnexample.json` to hide StackBlitz link
1 parent ac38a1b commit 1770bb1

File tree

92 files changed

+397
-26
lines changed

Some content is hidden

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

92 files changed

+397
-26
lines changed

docs/components/Example.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ function ExampleDemoBar(props: { exampleData: ExampleData }) {
4242
icon={<AiFillGithub size={16} />}
4343
url={`https://github.com/TypeCellOS/BlockNote/tree/main/${props.exampleData.pathFromRoot}`}
4444
/>
45-
<ExampleDemoBarSourceCodeLink
46-
name="StackBlitz"
47-
icon={<SiStackblitz size={16} />}
48-
url={`https://www.stackblitz.com/github/TypeCellOS/BlockNote/tree/main/${props.exampleData.pathFromRoot}`}
49-
/>
45+
{props.exampleData.showStackBlitzLink && (
46+
<ExampleDemoBarSourceCodeLink
47+
name="StackBlitz"
48+
icon={<SiStackblitz size={16} />}
49+
url={`https://www.stackblitz.com/github/TypeCellOS/BlockNote/tree/main/${props.exampleData.pathFromRoot}`}
50+
/>
51+
)}
5052
</div>
5153
);
5254
}

docs/content/docs/getting-started/shadcn.mdx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ To ensure Tailwind generates the necessary CSS for all utility classes used by B
3131
@source "../node_modules/@blocknote/shadcn";
3232
```
3333

34-
{/* TODO: Figure out why `@source` directive isn't working in StackBlitz sandbox. */}
35-
{/* https://stackblitz.com/edit/github-xdutga97?file=src%2FApp.tsx */}
36-
37-
<Callout type={"warning"}>
38-
Because the ShadCN version of BlockNote requires being in a Tailwind app,
39-
viewing the demo below on StackBlitz will have missing styles.
40-
</Callout>
41-
4234
<Example name="basic/shadcn" />
4335

4436
## Usage with Tailwind Only

examples/01-basic/01-minimal/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@blocknote/example-basic-minimal",
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
4+
"type": "module",
45
"private": true,
56
"version": "0.12.4",
67
"scripts": {

examples/01-basic/02-block-objects/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@blocknote/example-basic-block-objects",
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
4+
"type": "module",
45
"private": true,
56
"version": "0.12.4",
67
"scripts": {

examples/01-basic/03-multi-column/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@blocknote/example-basic-multi-column",
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
4+
"type": "module",
45
"private": true,
56
"version": "0.12.4",
67
"scripts": {

examples/01-basic/04-default-blocks/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@blocknote/example-basic-default-blocks",
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
4+
"type": "module",
45
"private": true,
56
"version": "0.12.4",
67
"scripts": {

examples/01-basic/05-removing-default-blocks/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@blocknote/example-basic-removing-default-blocks",
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
4+
"type": "module",
45
"private": true,
56
"version": "0.12.4",
67
"scripts": {

examples/01-basic/06-block-manipulation/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@blocknote/example-basic-block-manipulation",
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
4+
"type": "module",
45
"private": true,
56
"version": "0.12.4",
67
"scripts": {

examples/01-basic/07-selection-blocks/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@blocknote/example-basic-selection-blocks",
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
4+
"type": "module",
45
"private": true,
56
"version": "0.12.4",
67
"scripts": {

examples/01-basic/08-ariakit/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@blocknote/example-basic-ariakit",
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
4+
"type": "module",
45
"private": true,
56
"version": "0.12.4",
67
"scripts": {

0 commit comments

Comments
 (0)