Skip to content

feat(summernote): Summernote 어댑터 추가 (1.1.0) - #37

Merged
jlc488 merged 1 commit into
mainfrom
feat/summernote-adapter
Aug 9, 2026
Merged

feat(summernote): Summernote 어댑터 추가 (1.1.0)#37
jlc488 merged 1 commit into
mainfrom
feat/summernote-adapter

Conversation

@jlc488

@jlc488 jlc488 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summernote는 주간 npm 다운로드 약 118,000인데 줄자가 없습니다. 그리고 jQuery 기반 직접-DOM 에디터라 Froala 구현이 거의 그대로 옮겨가서, 남은 후보 중 가장 저렴합니다.

호스트 API는 소스에서 확인했습니다

undo 보장이 여기 달려 있어서 추측하지 않았습니다. editor.afterCommand()history.recordUndo()를 호출하는 메서드라, 커밋을 이 경로로 보내면 드래그 제스처당 undo 1스텝이라는 다른 어댑터와 동일한 계약이 성립합니다. 블록은 editor.getLastRange().nodes(dom.isPara)로 얻고, Summernote에 아직 range가 없을 때를 위해 네이티브 선택 폴백을 둡니다.

테이블 지원이 따라옵니다

직접-DOM이라 테이블 통째 밀기와 컬럼 폭 마커가 그대로 동작합니다. Froala 외에 이 기능을 가진 첫 어댑터라, "테이블은 Froala 전용"이 더 이상 아닙니다.

옵션은 ruler 키 아래에 둡니다(enabled/visible/unit/vertical/verticalGutter/guides/guideSnap/language) — Froala의 평면 접두사가 아니라 Tiptap·CKEditor 5의 네임스페이스 방식을 따랐습니다.

문서 — 어댑터 집합을 언급하는 모든 곳

루트 README 양어(패키지 표·빠른 시작·StackBlitz 목록), 패키지 README en/ko, ARCHITECTURE(파일 맵 + §6 "새 어댑터 추가" 설명이 이제 이 어댑터를 실제 예시로 지목), 랜딩(데모 탭·연동 섹션·FAQ), CHANGELOG, examples/summernote.

어댑터 개수를 세던 문장들("all three", "네 패키지")도 개수 없는 표현으로 바꾸거나 바로잡았습니다.

검증 — jsdom이 아니라 실제 Summernote로

  • Summernote 툴바에 줄자 드롭다운 마운트 확인
  • 드래그로 문단 여백 60px → 70px, 출력이 순수 인라인 CSS (<p style="margin-left: 70px;">)
  • undo가 정확히 1스텝으로 복원 (80px → 70px)
  • 테이블 셀에 커서 → 컬럼 마커 노출 (2열 = 경계 1개)
  • 세로 줄자 거터로 토글 시 본문 이동 0px
  • 유닛 110개 그린

신규 테스트가 실제 버그를 잡았습니다 — 거터만 켠 경로에서 refresh()를 빠뜨려 가로 줄자가 낡은 오프셋을 유지하고 있었습니다.

Summernote pulls ~118k npm downloads a week and has no ruler; it is also
jQuery-based direct-DOM, which makes it the cheapest remaining adapter
because the Froala implementation transfers almost whole.

Researched the host APIs from Summernote's source rather than guessing,
because the undo guarantee depended on it: editor.afterCommand() is the
method that calls history.recordUndo(), so routing commits through it
gives us one undo step per drag gesture, the same contract every other
adapter honors. Blocks come from editor.getLastRange().nodes(dom.isPara)
with a native-selection fallback for before Summernote has a range.

Because it is direct-DOM, whole-table indent and column-width markers
come along — Summernote is the first adapter besides Froala to have
them, so that capability is no longer Froala-only.

Options sit under the "ruler" key (enabled/visible/unit/vertical/
verticalGutter/guides/guideSnap/language), matching the namespaced style
of the Tiptap and CKEditor 5 adapters rather than Froala's flat prefixes.

Docs updated everywhere the adapter set is stated: both root READMEs
(packages table, quick start, StackBlitz list), package READMEs en/ko,
ARCHITECTURE (file map, plus §6 now points at this adapter as the worked
example of the 'adding an editor' walkthrough), the landing page (demo
tab with lazy CDN loading, integration section, FAQ), and CHANGELOG.
Sentences that counted adapters ('all three', 'the four packages') were
either de-counted or corrected.

Verified in a real browser against real Summernote, not just jsdom:
ruler mounts into its toolbar, dragging moves a paragraph 60px -> 70px
and exports plain inline CSS, undo restores in exactly one step, column
markers appear with the caret in a table cell, and the vertical-ruler
gutter holds the content still (0px shift) across a toggle. 110 unit
tests green; one of the new tests caught a real bug — the gutter-only
path skipped refresh(), so the horizontal ruler kept a stale offset.
@jlc488
jlc488 merged commit 8e9287c into main Aug 9, 2026
1 check passed
@jlc488
jlc488 deleted the feat/summernote-adapter branch August 9, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant