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
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
BlockNoteを布教するぜ
BlockNoteを紹介するためのスライドです
imaimai17468
August 07, 2024
Transcript
19 slides
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
More Decks by imaimai17468
See All by imaimai17468
オートメーション・バカにならないために
imaimai17468
1
400
MVP先行の探索型DocDD
imaimai17468
1
230
コーディングチェックの自動化がしたい!
imaimai17468
4
1.2k
型パズルを好きになるために、競プロを型システムだけで解いてみることにした
imaimai17468
6
850
フロントエンド設計の所感 1年目
imaimai17468
0
130
Silk Weave -未来研究大会発表資料-
imaimai17468
1
91
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
How STYLIGHT went responsive
nonsquared
100
6.4k
Utilizing Notion as your number one productivity tool
mfonobong
4
650
Building an army of robots
kneath
307
47k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
410
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Faster Mobile Websites
deanohume
310
32k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
570
Why Our Code Smells
bkeepers
PRO
340
58k
Raft: Consensus for Rubyists
vanstee
143
7.9k
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
Google's AI Overviews - The New Search
badams
0
1.7k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
400