์์ํ๊ธฐ
์ด๋ค ํจํค์ง๋ฅผ ์ค์นํ ์ง
- ๋๊ธยท๋ฉ์
ยท์ฌ๋์ ๋ฉ๋ด๊ฐ ํ์ํ๋ฉด โ
@inkio/editor - ํด๋ฐ ์์ฃผ classic ํธ์ง๊ธฐ๋ก ์ถฉ๋ถํ๋ฉด โ
@inkio/simple - ์ค์๊ฐ ํ์
์ด ํ์ํ๋ฉด โ ์ ์ ํ +
@inkio/collab - ์ด๋ฏธ์ง ์๋ฅด๊ธฐยท๋ชจ์์ดํฌ๊ฐ ํ์ํ๋ฉด โ ์ ์ ํ +
@inkio/image-editor - ์ง์ ์กฐํฉ(์คํค๋งยทํ์ฅ ๋จ์ ์ ์ด)์ด ํ์ํ๋ฉด โ
@inkio/core(+@inkio/advanced)
@inkio/advanced๋ ๋จ๋
์ค์นํ์ง ๋ง์ธ์. editor์ ํฌํจ๋์ด ์๊ณ ,
์ง์ importํ๋ export๋ฅผ ์ธ ๋๋ง ์ถ๊ฐํฉ๋๋ค.
์ค์น
npm install @inkio/simple react react-dom๋๋:
npm install @inkio/editor react react-dom์ต์ :
npm install @inkio/image-editorCommentPanel์ด๋ comment i18n์ฒ๋ผ advanced export๋ฅผ ์ง์ importํ ๋๋ง @inkio/advanced๋ฅผ ์ถ๊ฐ ์ค์นํฉ๋๋ค.
Inkio๋ ์์ ์ด ์ฌ์ฉํ๋ Tiptap runtime์ ์ง์ ์์ ํฉ๋๋ค. ์ผ๋ฐ ์ฌ์ฉ์๋ React peer๋ง ๋ง์ถ๋ฉด ๋ฉ๋๋ค.
์คํ์ผ
Simple:
import '@inkio/simple/minimal.css';Editor:
import '@inkio/editor/minimal.css';Image editor:
import '@inkio/image-editor/style.css';๊ธฐ๋ณธ ์ฌ์ฉ
Simple:
import { Editor } from '@inkio/simple';
export function Page() {
return <Editor content="<p>Hello Inkio</p>" />;
}Editor:
import { Editor } from '@inkio/editor';
export function Page() {
return (
<Editor
content="<p>Hello Inkio</p>"
hashtagItems={({ query }) => [
{ id: query || 'inkio', label: `#${query || 'inkio'}` },
]}
ui={{ showBubbleMenu: true, showFloatingMenu: true }}
/>
);
}๊ธฐ์ตํ ๊ท์น
content๋ ์ด๊ธฐ ๋ฌธ์์ ๋๋ค. ๋ง์ดํธ ํ ์ํ๋ ์๋ํฐ๊ฐ ์์ ํ๋ฉฐ, ์ธ๋ถ์์ ๊ฐ์ ๋ฐ๊พธ๋ ค๋ฉดonCreate์ธ์คํด์ค์editor.commands.setContent()๋ฅผ ์ฐ์ธ์.@inkio/editor๋ notion-like surface ๊ธฐ๋ณธ๊ฐ์ ๊ฐ์ง๋๋ค.@inkio/simple์ classic toolbar surface ๊ธฐ๋ณธ๊ฐ์ ๊ฐ์ง๋๋ค.- shell / panel / field ๊ฐ์ chrome surface๋ ํจํค์ง ๊ฐ์ ๊ณตํต Inkio token์ ๊ณต์ ํฉ๋๋ค.
@inkio/image-editor๋ fullscreen overlay ๊ตฌ์กฐ์ง๋ง ๊ฐ์ surface ๊ณ์ธต์ ์๋๋ค.@inkio/editorCSS๋ advanced preset ์คํ์ผ์ ์ด๋ฏธ ํฌํจํฉ๋๋ค.justifyalignment๋ ์ง์ํ์ง ์์ต๋๋ค.- math๋ ๋ด์ฅํ์ง ์์ต๋๋ค. ํ์ํ๋ฉด Tiptap Mathematicsย ๋ฅผ ์ง์ ์กฐํฉํ์ธ์.
Last updated on