docs: remove word as placeholder for general text editor

This commit is contained in:
Steffen Becker committed 2026-08-07 18:08:20 +02:00
1 parent ad38994c65
commit 7c09727cda
18 files changed
+33 -33

No files matched your search

+6 -6
View File
@@ -61,8 +61,8 @@
});
// A header/footer that reaches past the body's margin (its distance from the edge plus
// its line count) pushes the body's content area in so text doesn't overlap it — Word
// grows the margin to fit the zone. ~18.4px = one 12pt line.
// its line count) pushes the body's content area in so text doesn't overlap it: the
// margin grows to fit the zone. ~18.4px = one 12pt line.
const HF_LINE_PX = 16 * 1.15;
function hfReachPx(doc: HfDoc, distPx: number): number {
if (!doc || hfIsEmpty(doc)) return 0;
@@ -193,7 +193,7 @@
return (Number.isFinite(ph) ? ph : 1123) + 20;
}
// --- Right-click context menu (Word's text menu, spelling suggestions merged in) ---
// --- Right-click context menu (text menu, spelling suggestions merged in) ---
let ctxMenu = $state<{ top: number; left: number; items: MenuEntry[] } | null>(null);
// The misspelled range the open menu's suggestions belong to.
let spellTarget: { from: number; to: number; word: string } | null = null;
@@ -212,7 +212,7 @@
const view = ed.view;
const coords = view.posAtCoords({ left: event.clientX, top: event.clientY });
const sel = view.state.selection;
// Word keeps a selection the click lands inside, otherwise it moves the caret.
// A selection the click lands inside is kept, otherwise the caret moves.
if (coords && (sel.empty || coords.pos < sel.from || coords.pos > sel.to)) {
view.dispatch(view.state.tr.setSelection(TextSelection.near(view.state.doc.resolve(coords.pos))));
}
@@ -294,7 +294,7 @@
// Shown when the selection is inside a table; positioned just above that table.
let tableUi = $state<{ visible: boolean; top: number; left: number }>({ visible: false, top: 0, left: 0 });
let tableUiRaf = 0;
// Word-style "Split Cells…" popover, opened from the table toolbar.
// "Split Cells…" popover, opened from the table toolbar.
let splitDialogOpen = $state(false);
// Drop the dialog if the selection leaves the table (toolbar hidden).
$effect(() => {
@@ -738,7 +738,7 @@
saveDocument(e.getJSON());
},
onFocus: () => {
// Clicking back into the body ends header/footer editing (Word behaviour).
// Clicking back into the body ends header/footer editing.
hfActive = null;
},
});
+1 -1
View File
@@ -307,7 +307,7 @@
flex-direction: column;
pointer-events: auto;
/* Content taller than the margin band spills into the margin (footer up, header
down), like Word's auto-growing zones; the anchored edge stays put. */
down) — the zone auto-grows; the anchored edge stays put. */
overflow: visible;
font-family: var(--font-serif);
font-size: 12pt;
@@ -6,7 +6,7 @@
let { editor, tick }: { editor: Editor | null; tick: number } = $props();
let open = $state(false);
// Pen settings (Word-style): presets apply with the currently chosen width/color.
// Pen settings: presets apply with the currently chosen width/color.
let widthPt = $state(0.5);
let color = $state('#000000');
+2 -2
View File
@@ -6,7 +6,7 @@
let { editor, tick }: { editor: Editor | null; tick: number } = $props();
let open = $state(false);
// Pen settings (Word-style): presets apply with the currently chosen width/color.
// Pen settings: presets apply with the currently chosen width/color.
let widthPt = $state(0.5);
let color = $state('#000000');
@@ -45,7 +45,7 @@
);
// Clicking an inactive preset applies the pen; clicking an active one toggles those
// borders off (Word behavior). The panel stays open so the states visibly update.
// borders off. The panel stays open so the states visibly update.
function apply(id: BorderPreset | 'none') {
if (!editor) return;
if (id === 'none') editor.chain().focus().setTableBorders('all', null).run();
+1 -1
View File
@@ -189,7 +189,7 @@
user-select: none;
}
/* Tiles and options side by side, as in Word's Table Design tab. */
/* Tiles and options side by side. */
.tsp-body {
display: flex;
align-items: flex-start;
+1 -1
View File
@@ -274,7 +274,7 @@
return mixed ? '' : (c ?? null);
});
// Sub/superscript are mutually exclusive (Word-style): toggling one clears the
// Sub/superscript are mutually exclusive: toggling one clears the
// other. odf-kit maps these marks to text:position (round-trips with LibreOffice
// and Word). See export/odt.ts applyRuns for the custom-attr-paragraph path.
let isSuperscript = $derived(tick >= 0 && !!editor?.isActive('superscript'));