Add tables, to-dos, callouts and the rest of editor parity

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>
This commit is contained in:
tajniak81andClaude Opus 5.5 committed 2026-11-14 12:20:08 +01:00
1 parent 3c7403ddf9
commit d28f1e02db
44 files changed
+4318 -338

No files matched your search

@@ -1,122 +1,63 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import type { EditorLabels, MentionHost, PageHost } from "@docwell/editor";
import { englishLabels, type EditorLabels, type MentionHost, type PageHost } from "@docwell/editor";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { useApi } from "../api";
import { useAuthStore } from "../stores/auth";
import { useSpacesStore } from "../stores/spaces";
const blocks = [
"text",
"h1",
"h2",
"h3",
"bullet",
"ordered",
"quote",
"code",
"divider",
"image",
"file",
"toc",
"math",
"mathInline",
"mermaid",
"drawio",
"excalidraw",
"pageLink",
"toggle",
"embed",
"linkCard",
];
const blockWords = [
"edit",
"done",
"cancel",
"save",
"remove",
"saving",
"latex",
"mermaid",
"mermaidError",
"emptyDrawio",
"emptyExcalidraw",
"loadFailed",
"toc",
"tocEmpty",
"expand",
"collapse",
"embed",
"embedUrl",
"embedInvalid",
"linkUrl",
"copyBlockLink",
] as const;
const findWords = [
"find",
"replace",
"previous",
"next",
"replaceOne",
"replaceAll",
"matchCase",
"close",
"count",
"none",
] as const;
const dateWords = [
"today",
"tomorrow",
"yesterday",
"nextWeek",
"remindWord",
"remindMe",
"reminderAt",
"someoneElse",
"edit",
] as const;
/** Groups of editor words, each looked up as editor.<group>.<word>; the words are the English labels' keys. */
const words = <K extends keyof EditorLabels>(group: K) => Object.keys(englishLabels[group] as object);
/** The editor's menu and button words in the app's language. */
export function useEditorLabels() {
const { t, locale } = useI18n();
// Placeholders the editor fills in itself pass through as they are.
const keep = { current: "{current}", total: "{total}", n: "{n}" };
const group = <K extends keyof EditorLabels>(name: K, prefix: string) =>
Object.fromEntries(words(name).map((w) => [w, t(`editor.${prefix}.${w}`, keep)])) as EditorLabels[K];
return computed<EditorLabels>(() => ({
locale: locale.value,
slashMenu: t("editor.slashMenu"),
noMatches: t("editor.noMatches"),
slash: Object.fromEntries(
blocks.map((b) => [
words("slash").map((b) => [
b,
{ label: t(`editor.blocks.${b}.label`), description: t(`editor.blocks.${b}.description`) },
]),
),
format: {
bold: t("editor.format.bold"),
italic: t("editor.format.italic"),
strike: t("editor.format.strike"),
code: t("editor.format.code"),
link: t("editor.format.link"),
linkPrompt: t("editor.format.linkPrompt"),
comment: t("editor.format.comment"),
},
format: group("format", "format"),
colors: group("colors", "colors"),
table: group("table", "table"),
blockMenu: group("blockMenu", "blockMenu"),
mentions: t("editor.mentions"),
noPeople: t("editor.noPeople"),
pageLinks: t("editor.pageLinks"),
noPages: t("editor.noPages"),
blocks: Object.fromEntries(blockWords.map((w) => [w, t(`editor.block.${w}`)])) as EditorLabels["blocks"],
// The editor fills in {current} and {total} itself, so they pass through.
find: Object.fromEntries(
findWords.map((w) => [w, t(`editor.find.${w}`, { current: "{current}", total: "{total}" })]),
) as EditorLabels["find"],
dates: Object.fromEntries(dateWords.map((w) => [w, t(`editor.dates.${w}`)])) as EditorLabels["dates"],
blocks: group("blocks", "block"),
find: group("find", "find"),
dates: group("dates", "dates"),
}));
}
/** "[[" page links find pages in the page's workspace through search. */
export function usePageLinks(workspace: () => string | undefined): PageHost {
/**
* "[[" page links find pages in the page's workspace through search. With
* parent, the editor can also make new pages, as children of that page.
*/
export function usePageLinks(
workspace: () => string | undefined,
parent?: () => { space: string; id: string } | undefined,
): PageHost {
const api = useApi();
const spaces = useSpacesStore();
return {
async create(title) {
const at = parent?.();
if (!at) throw new Error("no page to add the new page to");
const page = await spaces.createPage(at.space, at.id, title || undefined);
return { id: page.id, title: page.title, icon: page.icon };
},
async search(query) {
const ws = workspace();
if (!ws || !query.trim()) return [];
+101 -2
View File
@@ -495,6 +495,50 @@
"linkCard": {
"label": "Linkkarte",
"description": "Ein Link mit Titel und Bild seiner Seite"
},
"h4": {
"label": "Überschrift 4",
"description": "Weitere Überschriften: Ebene 4"
},
"h5": {
"label": "Überschrift 5",
"description": "Weitere Überschriften: Ebene 5"
},
"h6": {
"label": "Überschrift 6",
"description": "Weitere Überschriften: Ebene 6"
},
"todo": {
"label": "Aufgabenliste",
"description": "Aufgaben zum Abhaken (oder [] tippen)"
},
"callout": {
"label": "Hinweisbox",
"description": "Eine Notiz mit Emoji und Farbe hervorheben"
},
"table": {
"label": "Tabelle",
"description": "Zeilen und Spalten"
},
"newPage": {
"label": "Neue Seite",
"description": "Eine Seite anlegen und hier verlinken"
},
"today": {
"label": "Heute",
"description": "Das heutige Datum einfügen"
},
"tomorrow": {
"label": "Morgen",
"description": "Das morgige Datum einfügen"
},
"yesterday": {
"label": "Gestern",
"description": "Das gestrige Datum einfügen"
},
"now": {
"label": "Jetzt",
"description": "Datum und Uhrzeit einfügen"
}
},
"format": {
@@ -504,7 +548,18 @@
"code": "Code im Text",
"link": "Link",
"linkPrompt": "Linkadresse (leer lassen, um den Link zu entfernen)",
"comment": "Kommentieren"
"comment": "Kommentieren",
"underline": "Unterstrichen",
"color": "Farbe",
"textColor": "Textfarbe",
"highlight": "Markierung",
"noColor": "Standard",
"align": "Ausrichtung",
"alignLeft": "Linksbündig",
"alignCenter": "Zentriert",
"alignRight": "Rechtsbündig",
"math": "Formel im Text",
"linkedPage": "Verknüpfte Seite anlegen"
},
"pageLinks": "Link zu einer Seite",
"noPages": "Keine Seiten gefunden – tippe einen Teil eines Titels",
@@ -529,7 +584,51 @@
"embedUrl": "Adresse des Videos, Designs oder Dokuments",
"embedInvalid": "Diese Adresse kann nicht eingebettet werden.",
"linkUrl": "Adresse der zu verlinkenden Seite",
"copyBlockLink": "Link zu diesem Block kopieren"
"copyBlockLink": "Link zu diesem Block kopieren",
"calloutEmoji": "Emoji ändern",
"calloutColor": "Farbe ändern",
"pdfLoading": "PDF wird geladen…",
"pdfPage": "Seite {n}"
},
"colors": {
"gray": "Grau",
"red": "Rot",
"orange": "Orange",
"yellow": "Gelb",
"green": "Grün",
"teal": "Petrol",
"blue": "Blau",
"purple": "Lila",
"pink": "Pink"
},
"table": {
"toolbar": "Tabelle",
"dragRow": "Ziehen, um die Zeile zu verschieben",
"moveRowUp": "Zeile nach oben",
"moveRowDown": "Zeile nach unten",
"addRowBefore": "Zeile darüber",
"addRowAfter": "Zeile darunter",
"addColumnBefore": "Spalte links",
"addColumnAfter": "Spalte rechts",
"deleteRow": "Zeile löschen",
"deleteColumn": "Spalte löschen",
"toggleHeaderRow": "Kopfzeile",
"mergeCells": "Zellen verbinden",
"splitCell": "Zelle teilen",
"deleteTable": "Tabelle löschen"
},
"blockMenu": {
"open": "Ziehen zum Verschieben, klicken für Aktionen",
"turnInto": "Umwandeln in",
"moveUp": "Nach oben",
"moveDown": "Nach unten",
"duplicate": "Duplizieren",
"copy": "Kopieren",
"delete": "Löschen",
"showLineNumbers": "Zeilennummern zeigen",
"hideLineNumbers": "Zeilennummern ausblenden",
"showPages": "Seiten zeigen",
"showAsFile": "Als Datei zeigen"
}
},
"comments": {
+101 -2
View File
@@ -495,6 +495,50 @@
"linkCard": {
"label": "Link card",
"description": "A link with its page's title and picture"
},
"h4": {
"label": "Heading 4",
"description": "Other headings: level 4"
},
"h5": {
"label": "Heading 5",
"description": "Other headings: level 5"
},
"h6": {
"label": "Heading 6",
"description": "Other headings: level 6"
},
"todo": {
"label": "To-do list",
"description": "Tasks to tick off (or type [])"
},
"callout": {
"label": "Callout",
"description": "Set a note apart with an emoji and colour"
},
"table": {
"label": "Table",
"description": "Rows and columns"
},
"newPage": {
"label": "New page",
"description": "Make a page and link it here"
},
"today": {
"label": "Today",
"description": "Insert today's date"
},
"tomorrow": {
"label": "Tomorrow",
"description": "Insert tomorrow's date"
},
"yesterday": {
"label": "Yesterday",
"description": "Insert yesterday's date"
},
"now": {
"label": "Now",
"description": "Insert the date and time"
}
},
"format": {
@@ -504,7 +548,18 @@
"code": "Inline code",
"link": "Link",
"linkPrompt": "Link address (leave empty to remove the link)",
"comment": "Comment"
"comment": "Comment",
"underline": "Underline",
"color": "Colour",
"textColor": "Text colour",
"highlight": "Highlight",
"noColor": "Default",
"align": "Align",
"alignLeft": "Align left",
"alignCenter": "Align centre",
"alignRight": "Align right",
"math": "Inline math",
"linkedPage": "Make a linked page"
},
"pageLinks": "Link to a page",
"noPages": "No pages found — type part of a title",
@@ -529,7 +584,51 @@
"embedUrl": "Address of the video, design or document",
"embedInvalid": "This address can't be embedded.",
"linkUrl": "Address of the page to link",
"copyBlockLink": "Copy link to this block"
"copyBlockLink": "Copy link to this block",
"calloutEmoji": "Change emoji",
"calloutColor": "Change colour",
"pdfLoading": "Loading PDF…",
"pdfPage": "Page {n}"
},
"colors": {
"gray": "Grey",
"red": "Red",
"orange": "Orange",
"yellow": "Yellow",
"green": "Green",
"teal": "Teal",
"blue": "Blue",
"purple": "Purple",
"pink": "Pink"
},
"table": {
"toolbar": "Table",
"dragRow": "Drag to move the row",
"moveRowUp": "Move row up",
"moveRowDown": "Move row down",
"addRowBefore": "Add row above",
"addRowAfter": "Add row below",
"addColumnBefore": "Add column left",
"addColumnAfter": "Add column right",
"deleteRow": "Delete row",
"deleteColumn": "Delete column",
"toggleHeaderRow": "Header row",
"mergeCells": "Merge cells",
"splitCell": "Split cell",
"deleteTable": "Delete table"
},
"blockMenu": {
"open": "Drag to move, click for actions",
"turnInto": "Turn into",
"moveUp": "Move up",
"moveDown": "Move down",
"duplicate": "Duplicate",
"copy": "Copy",
"delete": "Delete",
"showLineNumbers": "Show line numbers",
"hideLineNumbers": "Hide line numbers",
"showPages": "Show pages",
"showAsFile": "Show as file"
}
},
"comments": {
+101 -2
View File
@@ -495,6 +495,50 @@
"linkCard": {
"label": "Tarjeta de enlace",
"description": "Un enlace con el título y la imagen de su página"
},
"h4": {
"label": "Encabezado 4",
"description": "Otros encabezados: nivel 4"
},
"h5": {
"label": "Encabezado 5",
"description": "Otros encabezados: nivel 5"
},
"h6": {
"label": "Encabezado 6",
"description": "Otros encabezados: nivel 6"
},
"todo": {
"label": "Lista de tareas",
"description": "Tareas para marcar (o escribe [])"
},
"callout": {
"label": "Destacado",
"description": "Resaltar una nota con un emoji y un color"
},
"table": {
"label": "Tabla",
"description": "Filas y columnas"
},
"newPage": {
"label": "Página nueva",
"description": "Crear una página y enlazarla aquí"
},
"today": {
"label": "Hoy",
"description": "Insertar la fecha de hoy"
},
"tomorrow": {
"label": "Mañana",
"description": "Insertar la fecha de mañana"
},
"yesterday": {
"label": "Ayer",
"description": "Insertar la fecha de ayer"
},
"now": {
"label": "Ahora",
"description": "Insertar la fecha y la hora"
}
},
"format": {
@@ -504,7 +548,18 @@
"code": "Código en línea",
"link": "Enlace",
"linkPrompt": "Dirección del enlace (déjala vacía para quitar el enlace)",
"comment": "Comentar"
"comment": "Comentar",
"underline": "Subrayado",
"color": "Color",
"textColor": "Color del texto",
"highlight": "Resaltado",
"noColor": "Predeterminado",
"align": "Alineación",
"alignLeft": "Alinear a la izquierda",
"alignCenter": "Centrar",
"alignRight": "Alinear a la derecha",
"math": "Fórmula en el texto",
"linkedPage": "Crear una página enlazada"
},
"pageLinks": "Enlace a una página",
"noPages": "No se encontraron páginas: escribe parte de un título",
@@ -529,7 +584,51 @@
"embedUrl": "Dirección del vídeo, diseño o documento",
"embedInvalid": "Esta dirección no se puede insertar.",
"linkUrl": "Dirección de la página que enlazar",
"copyBlockLink": "Copiar enlace a este bloque"
"copyBlockLink": "Copiar enlace a este bloque",
"calloutEmoji": "Cambiar emoji",
"calloutColor": "Cambiar color",
"pdfLoading": "Cargando PDF…",
"pdfPage": "Página {n}"
},
"colors": {
"gray": "Gris",
"red": "Rojo",
"orange": "Naranja",
"yellow": "Amarillo",
"green": "Verde",
"teal": "Verde azulado",
"blue": "Azul",
"purple": "Morado",
"pink": "Rosa"
},
"table": {
"toolbar": "Tabla",
"dragRow": "Arrastra para mover la fila",
"moveRowUp": "Subir fila",
"moveRowDown": "Bajar fila",
"addRowBefore": "Fila encima",
"addRowAfter": "Fila debajo",
"addColumnBefore": "Columna a la izquierda",
"addColumnAfter": "Columna a la derecha",
"deleteRow": "Eliminar fila",
"deleteColumn": "Eliminar columna",
"toggleHeaderRow": "Fila de encabezado",
"mergeCells": "Combinar celdas",
"splitCell": "Dividir celda",
"deleteTable": "Eliminar tabla"
},
"blockMenu": {
"open": "Arrastra para mover, haz clic para ver acciones",
"turnInto": "Convertir en",
"moveUp": "Subir",
"moveDown": "Bajar",
"duplicate": "Duplicar",
"copy": "Copiar",
"delete": "Eliminar",
"showLineNumbers": "Mostrar números de línea",
"hideLineNumbers": "Ocultar números de línea",
"showPages": "Mostrar páginas",
"showAsFile": "Mostrar como archivo"
}
},
"comments": {
+101 -2
View File
@@ -495,6 +495,50 @@
"linkCard": {
"label": "Carte de lien",
"description": "Un lien avec le titre et l’image de sa page"
},
"h4": {
"label": "Titre 4",
"description": "Autres titres : niveau 4"
},
"h5": {
"label": "Titre 5",
"description": "Autres titres : niveau 5"
},
"h6": {
"label": "Titre 6",
"description": "Autres titres : niveau 6"
},
"todo": {
"label": "Liste de tâches",
"description": "Des tâches à cocher (ou tapez [])"
},
"callout": {
"label": "Encadré",
"description": "Mettre une note en valeur avec un emoji et une couleur"
},
"table": {
"label": "Tableau",
"description": "Lignes et colonnes"
},
"newPage": {
"label": "Nouvelle page",
"description": "Créer une page et la lier ici"
},
"today": {
"label": "Aujourd'hui",
"description": "Insérer la date du jour"
},
"tomorrow": {
"label": "Demain",
"description": "Insérer la date de demain"
},
"yesterday": {
"label": "Hier",
"description": "Insérer la date d'hier"
},
"now": {
"label": "Maintenant",
"description": "Insérer la date et l'heure"
}
},
"format": {
@@ -504,7 +548,18 @@
"code": "Code en ligne",
"link": "Lien",
"linkPrompt": "Adresse du lien (laissez vide pour supprimer le lien)",
"comment": "Commenter"
"comment": "Commenter",
"underline": "Souligné",
"color": "Couleur",
"textColor": "Couleur du texte",
"highlight": "Surlignage",
"noColor": "Par défaut",
"align": "Alignement",
"alignLeft": "Aligner à gauche",
"alignCenter": "Centrer",
"alignRight": "Aligner à droite",
"math": "Formule dans le texte",
"linkedPage": "Créer une page liée"
},
"pageLinks": "Lien vers une page",
"noPages": "Aucune page trouvée — tapez une partie d’un titre",
@@ -529,7 +584,51 @@
"embedUrl": "Adresse de la vidéo, du design ou du document",
"embedInvalid": "Cette adresse ne peut pas être intégrée.",
"linkUrl": "Adresse de la page à lier",
"copyBlockLink": "Copier le lien vers ce bloc"
"copyBlockLink": "Copier le lien vers ce bloc",
"calloutEmoji": "Changer l'emoji",
"calloutColor": "Changer la couleur",
"pdfLoading": "Chargement du PDF…",
"pdfPage": "Page {n}"
},
"colors": {
"gray": "Gris",
"red": "Rouge",
"orange": "Orange",
"yellow": "Jaune",
"green": "Vert",
"teal": "Bleu canard",
"blue": "Bleu",
"purple": "Violet",
"pink": "Rose"
},
"table": {
"toolbar": "Tableau",
"dragRow": "Glisser pour déplacer la ligne",
"moveRowUp": "Monter la ligne",
"moveRowDown": "Descendre la ligne",
"addRowBefore": "Ligne au-dessus",
"addRowAfter": "Ligne en dessous",
"addColumnBefore": "Colonne à gauche",
"addColumnAfter": "Colonne à droite",
"deleteRow": "Supprimer la ligne",
"deleteColumn": "Supprimer la colonne",
"toggleHeaderRow": "Ligne d'en-tête",
"mergeCells": "Fusionner les cellules",
"splitCell": "Scinder la cellule",
"deleteTable": "Supprimer le tableau"
},
"blockMenu": {
"open": "Glisser pour déplacer, cliquer pour les actions",
"turnInto": "Transformer en",
"moveUp": "Monter",
"moveDown": "Descendre",
"duplicate": "Dupliquer",
"copy": "Copier",
"delete": "Supprimer",
"showLineNumbers": "Afficher les numéros de ligne",
"hideLineNumbers": "Masquer les numéros de ligne",
"showPages": "Afficher les pages",
"showAsFile": "Afficher comme fichier"
}
},
"comments": {
+101 -2
View File
@@ -495,6 +495,50 @@
"linkCard": {
"label": "Karta linku",
"description": "Link z tytułem i obrazkiem strony"
},
"h4": {
"label": "Nagłówek 4",
"description": "Inne nagłówki: poziom 4"
},
"h5": {
"label": "Nagłówek 5",
"description": "Inne nagłówki: poziom 5"
},
"h6": {
"label": "Nagłówek 6",
"description": "Inne nagłówki: poziom 6"
},
"todo": {
"label": "Lista zadań",
"description": "Zadania do odhaczenia (lub wpisz [])"
},
"callout": {
"label": "Wyróżnienie",
"description": "Notatka z emoji i kolorem tła"
},
"table": {
"label": "Tabela",
"description": "Wiersze i kolumny"
},
"newPage": {
"label": "Nowa strona",
"description": "Utwórz stronę i wstaw do niej link"
},
"today": {
"label": "Dzisiaj",
"description": "Wstaw dzisiejszą datę"
},
"tomorrow": {
"label": "Jutro",
"description": "Wstaw jutrzejszą datę"
},
"yesterday": {
"label": "Wczoraj",
"description": "Wstaw wczorajszą datę"
},
"now": {
"label": "Teraz",
"description": "Wstaw datę i godzinę"
}
},
"format": {
@@ -504,7 +548,18 @@
"code": "Kod w tekście",
"link": "Link",
"linkPrompt": "Adres linku (zostaw puste, aby usunąć link)",
"comment": "Komentarz"
"comment": "Komentarz",
"underline": "Podkreślenie",
"color": "Kolor",
"textColor": "Kolor tekstu",
"highlight": "Wyróżnienie",
"noColor": "Domyślny",
"align": "Wyrównanie",
"alignLeft": "Do lewej",
"alignCenter": "Do środka",
"alignRight": "Do prawej",
"math": "Wzór w tekście",
"linkedPage": "Utwórz połączoną stronę"
},
"pageLinks": "Link do strony",
"noPages": "Nie znaleziono stron — wpisz fragment tytułu",
@@ -529,7 +584,51 @@
"embedUrl": "Adres filmu, projektu lub dokumentu",
"embedInvalid": "Tego adresu nie da się osadzić.",
"linkUrl": "Adres strony do podlinkowania",
"copyBlockLink": "Kopiuj link do tego bloku"
"copyBlockLink": "Kopiuj link do tego bloku",
"calloutEmoji": "Zmień emoji",
"calloutColor": "Zmień kolor",
"pdfLoading": "Wczytywanie PDF…",
"pdfPage": "Strona {n}"
},
"colors": {
"gray": "Szary",
"red": "Czerwony",
"orange": "Pomarańczowy",
"yellow": "Żółty",
"green": "Zielony",
"teal": "Morski",
"blue": "Niebieski",
"purple": "Fioletowy",
"pink": "Różowy"
},
"table": {
"toolbar": "Tabela",
"dragRow": "Przeciągnij, aby przenieść wiersz",
"moveRowUp": "Wiersz wyżej",
"moveRowDown": "Wiersz niżej",
"addRowBefore": "Wiersz powyżej",
"addRowAfter": "Wiersz poniżej",
"addColumnBefore": "Kolumna z lewej",
"addColumnAfter": "Kolumna z prawej",
"deleteRow": "Usuń wiersz",
"deleteColumn": "Usuń kolumnę",
"toggleHeaderRow": "Wiersz nagłówka",
"mergeCells": "Scal komórki",
"splitCell": "Podziel komórkę",
"deleteTable": "Usuń tabelę"
},
"blockMenu": {
"open": "Przeciągnij, aby przenieść, kliknij, aby zobaczyć akcje",
"turnInto": "Zmień na",
"moveUp": "Przenieś wyżej",
"moveDown": "Przenieś niżej",
"duplicate": "Duplikuj",
"copy": "Kopiuj",
"delete": "Usuń",
"showLineNumbers": "Pokaż numery wierszy",
"hideLineNumbers": "Ukryj numery wierszy",
"showPages": "Pokaż strony",
"showAsFile": "Pokaż jako plik"
}
},
"comments": {
+2 -2
View File
@@ -100,8 +100,8 @@ export const useSpacesStore = defineStore("spaces", () => {
for (let p = parentOf.get(pageId); p; p = parentOf.get(p)) setExpanded(p, true);
}
async function createPage(spaceId: string, parent = "") {
const page = await api.spaces.createPage(spaceId, { parent });
async function createPage(spaceId: string, parent = "", title?: string) {
const page = await api.spaces.createPage(spaceId, title ? { parent, title } : { parent });
if (parent) setExpanded(parent, true);
await loadTree(spaceId);
return page;
+4 -1
View File
@@ -53,7 +53,10 @@ const historyOpen = ref(false);
const shareOpen = ref(false);
const labels = useEditorLabels();
const mentions = useMentions(() => page.value?.workspace);
const pageLinks = usePageLinks(() => page.value?.workspace);
const pageLinks = usePageLinks(
() => page.value?.workspace,
() => (page.value && editable.value ? { space: page.value.space, id: page.value.id } : undefined),
);
// Link cards: docwell-server reads the linked page's title and picture.
const linkHost = { preview: (url: string) => api.pages.preview(url) };