Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
BlockNoteを布教するぜ
Search
imaimai17468
August 07, 2024
89
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
BlockNoteを布教するぜ
BlockNoteを紹介するためのスライドです
imaimai17468
August 07, 2024
More Decks by imaimai17468
See All by imaimai17468
オートメーション・バカにならないために
imaimai17468
1
340
MVP先行の探索型DocDD
imaimai17468
1
210
コーディングチェックの自動化がしたい!
imaimai17468
4
1.2k
型パズルを好きになるために、競プロを型システムだけで解いてみることにした
imaimai17468
6
820
フロントエンド設計の所感 1年目
imaimai17468
0
110
Silk Weave -未来研究大会発表資料-
imaimai17468
1
76
Next.jsでクエリパラメータを楽に扱おう nuqsを紹介!
imaimai17468
3
2.2k
TailwindCSSで学ぶ技術批判の気をつけ方
imaimai17468
8
7.2k
Next.js+yjs+BlockNoteでNotionライクな最高の共同編集エディタを作ろう
imaimai17468
0
3.4k
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
570
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Designing Powerful Visuals for Engaging Learning
tmiket
1
590
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Ruling the World: When Life Gets Gamed
codingconduct
0
380
BBQ
matthewcrist
89
10k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
320
Making the Leap to Tech Lead
cromwellryan
135
10k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Color Theory Basics | Prateek | Gurzu
gurzu
1
480
Transcript
BlockNoteを布教するぜ いまいまい 1
自己紹介 いまいまい (今井俊希) 株式会社ゆめみ 新卒 フロントエンドエンジニア 勉強中です | お手柔らかに 2
リッチエディタの実装、枯れてない? 技術的知見、 zennでもみない Qiitaでもみない TLでもみない 開発止まってるのもチラホラ TS対応してないのもチラホラ 3
現状 Mantine Editor.js Draft.js 大体見た目同じ ちょっと古臭くない? 4
現時点でのベストプラクティス? Zennやしずかなインターネット メニューバーは非表示 markdown入力でスタイル反映 5
なんかええのないの? 最近使った中で良いテキストエディタ... 6
あ!! 7
そんなあなたに BlockNote 8
BlockNoteって? 美しいテキストエディタ。 ユーザーが気に入るエディタをアプリに簡単に追加できます。 カスタムブロックやAIツールのような独自の機能でカスタマイズできます。 (公式訳) ほぼNotionです 9
百聞は一見に如かず 10
使い勝手良さそう! 11
必要なのはこれだけ! import "@blocknote/core/fonts/inter.css"; import { useCreateBlockNote } from "@blocknote/react"; import
{ BlockNoteView } from "@blocknote/mantine"; import "@blocknote/mantine/style.css"; export default function App() { const editor = useCreateBlockNote(); return <BlockNoteView editor={editor} />; } 12
カスタマイズも豊富! ツールバーやカーソルなどの形や色の変更 カスタムブロックも定義可能! 独自のコードブロックやアラートなど 13
でも、controlどうするの? どうせ面倒でしょ? 14
(前置き) 型構造は複雑 type Block = { id: string; type: string;
props: Record<string, boolean | number | string>; content: InlineContent[] | TableContent | undefined; children: Block[]; }; children: Block[] : 無限入れ子 15
ちゃんと詰まらないように変換できます 16
入出力が簡単! Markdown / HTMLで入力・出力できます! const editor = useCreateBlockNote(); // INPUT:
in first rendering (ex. useEffect) const blocks = await editor.tryParseMarkdownToBlocks(e.target.value); editor.replaceBlocks(editor.document, blocks); // OUTPUT: Markdown export handler const [markdown, setMarkdown] = useState<string>(); const onChange = async () => { const markdown = await editor.blocksToMarkdownLossy(editor.document); setMarkdown(markdown); }; return <BlockNoteView editor={editor} onChange={onChange} /> 17
BlockNote、魅力的じゃない? 18
蛇足 1. フロントエンドカンファレンス北海道に登壇します 今回の内容+yjs BlockNoteをオンラインエディタに改造しようというお話 2. このエディタを使ったサイトを作ってます BlockNoteを使って技術のTipsを投稿できるやつ いつ完成するんだろうね 19