Skip to content

Commit 6e1eba2

Browse files
committed
initial setup
0 parents  commit 6e1eba2

31 files changed

+22173
-0
lines changed

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: build
2+
on: ["push", "pull_request"]
3+
jobs:
4+
build:
5+
name: Build
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: actions/setup-node@v2
10+
with:
11+
node-version: '16.x'
12+
- name: Cache node modules
13+
uses: actions/cache@v2
14+
env:
15+
cache-name: cache-node-modules
16+
with:
17+
# npm cache files are stored in `~/.npm` on Linux/macOS
18+
path: ~/.npm
19+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
20+
restore-keys: |
21+
${{ runner.os }}-build-${{ env.cache-name }}-
22+
${{ runner.os }}-build-
23+
${{ runner.os }}-
24+
25+
- name: Install Dependencies
26+
run: npm run install-lerna
27+
28+
- name: Bootstrap packages
29+
run: npm run bootstrap
30+
31+
- name: Build packages
32+
run: npm run build
33+
env:
34+
CI: true
35+
36+
- name: Install Playwright
37+
run: npx playwright install --with-deps
38+
39+
- name: Run Playwright tests
40+
run: npx playwright test
41+
42+
- uses: actions/upload-artifact@v2
43+
if: always()
44+
with:
45+
name: playwright-report
46+
path: playwright-report/
47+
retention-days: 30

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
dist
6+
types
7+
/.pnp
8+
.pnp.js
9+
10+
# testing
11+
coverage
12+
13+
# production
14+
/build
15+
16+
# misc
17+
.DS_Store
18+
.env.local
19+
.env.development.local
20+
.env.test.local
21+
.env.production.local
22+
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
.idea/
28+
.vercel
29+
test-results/
30+
playwright-report/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16

examples/editor/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

examples/editor/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<!-- <link rel="icon" type="image/svg+xml" href="/src/favicon.svg" /> -->
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

examples/editor/package-lock.json

Lines changed: 154 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/editor/package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "@blocknote/example-editor",
3+
"private": true,
4+
"version": "0.0.0",
5+
"scripts": {
6+
"dev": "vite",
7+
"build": "tsc && vite build",
8+
"preview": "vite preview"
9+
},
10+
"dependencies": {
11+
"@blocknote/core": "*",
12+
"react": "^17.0.2",
13+
"react-dom": "^17.0.2"
14+
},
15+
"devDependencies": {
16+
"@types/react": "^17.0.33",
17+
"@types/react-dom": "^17.0.10",
18+
"@vitejs/plugin-react": "^1.0.7",
19+
"typescript": "^4.5.4",
20+
"vite": "^2.8.0"
21+
},
22+
"workspaces": {
23+
"nohoist": [
24+
"**"
25+
],
26+
"packages": [
27+
"."
28+
]
29+
}
30+
}

examples/editor/src/App.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { useState } from 'react'
2+
3+
// import logo from './logo.svg'
4+
// import './App.css'
5+
import { useEditor, EditorContent } from "@blocknote/core";
6+
7+
// import "@blocknote/core/style.css";
8+
9+
function App() {
10+
11+
12+
const editor = useEditor({
13+
onUpdate: ({ editor }) => {
14+
console.log(editor.getJSON());
15+
},
16+
// editorProps: {
17+
// attributes: {
18+
// class: "editor",
19+
// },
20+
// },
21+
});
22+
23+
return (
24+
<div>
25+
{/* {editor != null ? (
26+
<InlineMenu editor={editor} commentStore={commentStore} />
27+
) : null}
28+
{editor != null ? <TableMenu editor={editor} /> : null}
29+
{editor != null ? (
30+
<CommentWrapper editor={editor} commentStore={commentStore} />
31+
) : null} */}
32+
{/* <EngineContext.Provider */}
33+
{/* value={{ compiler, executionHost, document: props.document }}> */}
34+
<EditorContent editor={editor} />
35+
{/* </EngineContext.Provider> */}
36+
</div>
37+
);
38+
}
39+
40+
export default App

examples/editor/src/index.css

Whitespace-only changes.

examples/editor/src/main.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
// import './index.css'
4+
import App from './App'
5+
6+
ReactDOM.render(
7+
<React.StrictMode>
8+
<App />
9+
</React.StrictMode>,
10+
document.getElementById('root')
11+
)

0 commit comments

Comments
 (0)