mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
chore: merge blocksuite source code (#9213)
This commit is contained in:
23
blocksuite/playground/examples/basic/edgeless/index.html
Normal file
23
blocksuite/playground/examples/basic/edgeless/index.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Basic EdgelessEditor Example</title>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: var(--affine-white-90);
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script type="module" src="./main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
8
blocksuite/playground/examples/basic/edgeless/main.ts
Normal file
8
blocksuite/playground/examples/basic/edgeless/main.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import '../../../style.css';
|
||||
|
||||
import { createEmptyDoc, EdgelessEditor } from '@blocksuite/presets';
|
||||
|
||||
const doc = createEmptyDoc().init();
|
||||
const editor = new EdgelessEditor();
|
||||
editor.doc = doc;
|
||||
document.body.append(editor);
|
||||
23
blocksuite/playground/examples/basic/page/index.html
Normal file
23
blocksuite/playground/examples/basic/page/index.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Basic PageEditor Example</title>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: var(--affine-white-90);
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script type="module" src="./main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
13
blocksuite/playground/examples/basic/page/main.ts
Normal file
13
blocksuite/playground/examples/basic/page/main.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import '../../../style.css';
|
||||
|
||||
import { createEmptyDoc, PageEditor } from '@blocksuite/presets';
|
||||
import { Text } from '@blocksuite/store';
|
||||
|
||||
const doc = createEmptyDoc().init();
|
||||
const editor = new PageEditor();
|
||||
editor.doc = doc;
|
||||
document.body.append(editor);
|
||||
|
||||
const paragraphs = doc.getBlockByFlavour('affine:paragraph');
|
||||
const paragraph = paragraphs[0];
|
||||
doc.updateBlock(paragraph, { text: new Text('Hello World!') });
|
||||
Reference in New Issue
Block a user