The editor gains the blocks and formatting it lacked next to AFFiNE: - Tables with a header row, resizable columns, a toolbar to add, delete, merge and split, and rows that move by a drag grip, toolbar buttons or Ctrl+Alt+Up/Down. - To-do lists (also from "[] "), callouts with an emoji and colour, and headings down to level 6 (Ctrl+Shift+0-6 for text and headings). - Text colour and highlights from a fixed palette that follows the theme, and left, centre and right alignment. - Optional line numbers on code blocks, with a default hosts can set. - PDF attachments show their pages inline; pdf.js loads only then, and the mobile bundle leaves it out. - The selection toolbar adds underline, colour, align, inline math, make a linked page and copy block link. A grip beside each block drags it and opens a menu: turn into, move, duplicate, copy, copy link, delete. - The slash menu adds Today, Tomorrow, Yesterday, Now and New page. The web app translates the new words and makes linked pages as children of the open page. The mobile bridge gets underline, to-do, callout and table commands, so its protocol moves to version 2 and the bundle is rebuilt. docwell-server's converters learn the new nodes: Markdown writes task lists, GitHub alerts and tables and reads them back; HTML keeps colours and alignment and reads its own output back; PDF draws tables, to-dos, callouts and coloured text; Word import keeps tables, alignment, H4-H6 and colours; Notion import turns databases into tables and keeps callouts and to-dos. Imported tables and H4-H6 headings no longer collapse into paragraphs and H3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
438 B
TypeScript
13 lines
438 B
TypeScript
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
// pdf.js and its worker load only when a page shows a PDF inline.
|
|
|
|
import { getDocument, GlobalWorkerOptions } from "pdfjs-dist";
|
|
import workerUrl from "pdfjs-dist/build/pdf.worker.min.mjs?url";
|
|
import type { PdfJs } from "./pdf";
|
|
|
|
GlobalWorkerOptions.workerSrc = workerUrl;
|
|
|
|
/** pdf.js narrowed to what the viewer in pdf.ts uses. */
|
|
export const pdf = { getDocument } as unknown as PdfJs;
|