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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
imaimai17468
August 07, 2024
88
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
75
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
Bash Introduction
62gerente
615
220k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
290
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
330
The Invisible Side of Design
smashingmag
301
52k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
530
My Coaching Mixtape
mlcsv
0
330
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
The Curse of the Amulet
leimatthew05
3
15k
Navigating Weather and Climate Data
rabernat
0
540
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
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