Files
multica/packages/views/locales/ko/editor.json
Naiyuan Qing 17ee59ccc5 feat(editor): standard Mermaid viewer with pan/zoom, exports and a real dialog (MUL-4908) (#5564)
* feat(editor): standard Mermaid viewer with pan/zoom, exports and a real dialog (MUL-4908)

Mermaid's fullscreen view was a bespoke lightbox: no visible close button, no
canvas interaction, and a toolbar that scrolled away with wide diagrams. Escape
also stopped working once the iframe took focus, which is why it read as
"impossible to close".

Replace it with a viewer built on the shared Dialog, so it inherits the
backdrop, focus trap, scroll lock, focus restore and Escape handling that HTML
preview already had.

The diagram stays in an `sandbox=""` iframe — isolation is not relaxed to buy
interactivity. Instead the iframe is `pointer-events: none` and pan/zoom is
applied from the host document as a transform on its wrapper. That inversion is
also what keeps Escape working: the iframe can never take focus.

- Viewer: fit-on-open, drag pan, wheel/pinch/keyboard zoom (25%-400%) anchored
  at the pointer, Fit / 100% / Reset, and a header toolbar that cannot scroll
  away. Panning is clamped so the canvas can never be lost.
- Export: `.mmd`, `.svg` and `.png`. Requires `htmlLabels: false` — browsers do
  not rasterize Mermaid's default HTML-in-foreignObject labels through an
  `<img>`; verified in Chromium that they paint zero pixels AND taint the
  canvas, so PNG export silently produced nothing.
- Inline: toolbar lifted out of the scroll container, natural-size rendering
  (small diagrams centered, wide ones scroll at a readable size with edge
  fades), copy source, and a parser message on the error fallback.
- Theme switches no longer close the viewer or discard zoom/position; the
  previous diagram stays on screen until its replacement is ready.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(editor): stop Mermaid drags selecting text and misfiring the viewer (MUL-4908)

Two gesture defects on the inline diagram, reported by Naiyuan.

1. Dragging a diagram started a native text selection. The iframe is a replaced
   element, so the whole diagram box got painted with the selection highlight
   and the drag ran on into the surrounding comment text. Fixed with
   `user-select: none` on the inline scroller and the viewer canvas.

   Deliberately NOT by preventDefault-ing pointerdown: verified in Chromium that
   it also drops the default focus, which silently kills the viewer's keyboard
   controls (+/-, 0, arrows).

2. Any drag ended in a `click`, so trying to look along a wide diagram opened
   the viewer on top of the user. The inline diagram had no drag handling at
   all — only `onClick`. Suppressing the selection alone would have made this
   fire more reliably, not less, so both had to land together.

   Past a 5px threshold the gesture is a drag for good: releasing no longer
   taps, and a horizontal drag pans the scroller instead. This holds even when
   the diagram has no room to scroll, so an unscrollable diagram cannot open on
   release either. A still click, a sub-threshold jitter, and the expand button
   all still open the viewer.

Touch is left alone — it already pans natively and its vertical drags belong to
the page; the browser announces its takeover with pointercancel. Mouse and pen
have no native drag-to-scroll and are panned here.

Verified in Chromium: still click opens; a 150px drag pans and does not open; a
drag on an unscrollable diagram does not open; 3px jitter still opens; and no
gesture selects text.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Walt <walt@multica.ai>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-07-17 16:07:37 +08:00

110 lines
3.6 KiB
JSON

{
"bubble_menu": {
"bold": "굵게",
"italic": "기울임",
"strikethrough": "취소선",
"code": "코드",
"highlight": "강조",
"link": "링크",
"list": "목록",
"task_list": "체크리스트",
"quote": "인용",
"url_aria_label": "URL",
"heading_dropdown": {
"text": "텍스트",
"normal_text": "일반 텍스트",
"heading_1": "제목 1",
"heading_2": "제목 2",
"heading_3": "제목 3"
},
"list_dropdown": {
"bullet_list": "글머리 기호 목록",
"ordered_list": "번호 목록",
"task_list": "체크리스트"
},
"sub_issue": {
"tooltip": "선택 영역으로 하위 이슈 만들기",
"created": "{{identifier}} 생성됨",
"create_failed": "하위 이슈를 만들지 못했습니다"
}
},
"image": {
"view": "이미지 보기",
"download": "다운로드",
"copy_link": "링크 복사",
"delete": "삭제",
"link_copied": "링크를 복사했습니다",
"copy_link_failed": "링크를 복사하지 못했습니다"
},
"attachment": {
"download_failed": "다운로드 링크를 가져오지 못했습니다. 잠시 후 다시 시도하세요.",
"preview": "미리보기",
"preview_loading": "미리보기 불러오는 중...",
"preview_failed": "미리보기를 불러오지 못했습니다",
"preview_too_large": "파일이 너무 커서 미리볼 수 없습니다. 다운로드하세요.",
"preview_unsupported": "이 파일 형식은 미리보기를 지원하지 않습니다.",
"close": "닫기",
"open_in_new_tab": "새 탭에서 열기",
"remove": "첨부 파일 제거"
},
"link_hover": {
"copy_link": "링크 복사",
"open_link": "링크 열기",
"link_copied": "링크를 복사했습니다",
"copy_failed": "복사하지 못했습니다"
},
"mention": {
"group_users": "사용자",
"group_issues": "이슈",
"all_members": "모든 멤버",
"searching": "검색 중...",
"no_results": "결과 없음",
"group_current": "현재 페이지",
"group_recent": "최근 본 항목",
"group_search": "검색 결과"
},
"code_block": {
"copy_code": "코드 복사",
"show_preview": "미리보기 표시",
"show_source": "소스 표시",
"fullscreen": "전체 화면"
},
"file_card": {
"uploading": "{{filename}} 업로드 중"
},
"upload": {
"failed": "{{filename}}을(를) 업로드하지 못했어요: {{reason}}",
"in_progress": "업로드 중…"
},
"title_editor": {
"title_aria_label": "제목"
},
"mermaid": {
"render_error": "Mermaid 다이어그램을 렌더링할 수 없습니다.",
"rendering": "다이어그램 렌더링 중...",
"viewer_title": "다이어그램",
"canvas_label": "다이어그램 캔버스. 드래그하여 이동, 스크롤하여 확대/축소할 수 있습니다.",
"open_viewer": "다이어그램 뷰어 열기",
"close_viewer": "닫기",
"copy_source": "다이어그램 소스 복사",
"show_source": "소스 표시",
"show_diagram": "다이어그램 표시",
"zoom_in": "확대",
"zoom_out": "축소",
"zoom_fit": "화면에 맞추기",
"zoom_actual": "실제 크기",
"reset_view": "보기 초기화",
"export": "내보내기",
"export_png": "PNG 다운로드",
"export_svg": "SVG 다운로드",
"export_source": ".mmd 다운로드"
},
"slash_command": {
"no_skills_configured": "구성된 스킬 없음",
"no_results": "일치하는 스킬 없음",
"commands": {
"note": "메모 추가 — 에이전트를 트리거하지 않음"
}
}
}