Skip to content

Commit 890bd60

Browse files
authored
docs: switch to stackblitz (#614)
* switch to stackblitz * fix
1 parent c1747a2 commit 890bd60

File tree

42 files changed

+74
-67
lines changed

Some content is hidden

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

42 files changed

+74
-67
lines changed

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/pages/examples/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import { ExampleList } from "../../components/example/ExampleList";
44

55
Browse through the examples below to see how to use and customize BlockNote.
66

7-
Want to contribute? Copy the [basic example on CodeSandbox](https://codesandbox.io/s/github/TypeCellOS/BlockNote/tree/main/examples/basic/minimal) and submit a PR.
7+
Want to contribute? Copy the [basic example on StackBlitz](https://stackblitz.com/github/TypeCellOS/BlockNote/tree/main/examples/01-basic/01-minimal/) and submit a PR.
88

99
<ExampleList />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/01-basic/03-all-blocks/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/01-basic/04-selection-blocks/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/01-basic/05-block-manipulation/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/01-basic/06-file-uploading/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/01-basic/07-saving-loading/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/01-basic/testing/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/02-ui-components/01-ui-elements-remove/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/02-ui-components/02-formatting-toolbar-buttons/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/02-ui-components/03-formatting-toolbar-block-type-items/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/02-ui-components/04-side-menu-buttons/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/02-ui-components/05-side-menu-drag-handle-items/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/02-ui-components/06-suggestion-menus-slash-menu-items/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/02-ui-components/07-suggestion-menus-slash-menu-component/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/02-ui-components/08-custom-ui/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/02-ui-components/hyperlink-toolbar-buttons/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/03-theming/01-theming-dom-attributes/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/03-theming/02-changing-font/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/03-theming/03-theming-css/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/03-theming/04-theming-css-variables/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/03-theming/05-theming-css-variables-code/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/04-interoperability/01-converting-blocks-to-html/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/04-interoperability/02-converting-blocks-from-html/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/04-interoperability/03-converting-blocks-to-md/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/04-interoperability/04-converting-blocks-from-md/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/05-custom-schema/01-alert-block/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/05-custom-schema/02-suggestion-menus-mentions/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/05-custom-schema/03-font-style/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/05-custom-schema/react-custom-blocks/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

examples/05-custom-schema/react-custom-inline-content/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"include": [
2626
"."
2727
],
28-
"references": [
28+
"__ADD_FOR_LOCAL_DEV_references": [
2929
{
3030
"path": "../../../packages/core/"
3131
},

0 commit comments

Comments
 (0)