Add interface languages and improve themes and workspace controls for 0.1.36
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { tr } from '../i18n/index.ts';
|
||||
import { Editor, Extension, Mark, getMarkRange } from "@tiptap/core";
|
||||
import { Plugin } from "@tiptap/pm/state";
|
||||
import { Decoration, DecorationSet } from "@tiptap/pm/view";
|
||||
@@ -96,7 +97,7 @@ export function tableControls(root: HTMLElement, view: EditorView, initialSource
|
||||
cell.removeAttribute("title");
|
||||
if (result && cell !== active) cell.innerHTML = formulas.tableFormulaHtml(result);
|
||||
if (cell === active) {
|
||||
formulaStatus.textContent = `${address}${result ? ` = ${result.text}` : " · Type = to calculate"}`;
|
||||
formulaStatus.textContent = `${address}${result ? ` = ${result.text}` : tr(" · Type = to calculate")}`;
|
||||
formulaHint.textContent = result?.error ? formulas.formulaErrors[result.error] : "";
|
||||
formulaHint.hidden = !formulaHint.textContent;
|
||||
}
|
||||
@@ -136,7 +137,7 @@ export function tableControls(root: HTMLElement, view: EditorView, initialSource
|
||||
cell.innerHTML = html;
|
||||
cell.classList.remove("is-editing", "is-source-editing");
|
||||
refreshFormulas();
|
||||
formulaStatus.textContent = "Type = in a cell to calculate";
|
||||
formulaStatus.textContent = tr("Type = in a cell to calculate");
|
||||
formulaHint.hidden = true;
|
||||
view.requestMeasure();
|
||||
if (!firstEdit) view.dispatch({ annotations: isolateHistory.of("after") });
|
||||
@@ -390,7 +391,7 @@ export function tableControls(root: HTMLElement, view: EditorView, initialSource
|
||||
wrapper.after(footer);
|
||||
for (const kind of ["column", "row"] as const) {
|
||||
const button = document.createElement("button");
|
||||
const label = kind === "column" ? "Add column to the right" : "Add row below";
|
||||
const label = kind === "column" ? tr("Add column to the right") : tr("Add row below");
|
||||
button.type = "button";
|
||||
button.className = `table-add table-add-${kind}`;
|
||||
tooltipCleanup.push(attachTooltip(button, () => label));
|
||||
@@ -409,7 +410,7 @@ export function tableControls(root: HTMLElement, view: EditorView, initialSource
|
||||
}
|
||||
for (const row of table.rows) for (const cell of row.cells) {
|
||||
cell.tabIndex = 0;
|
||||
cell.setAttribute("aria-label", `${formulas ? formulas.cellAddress(row.rowIndex, cell.cellIndex) + " · " : ""}Row ${row.rowIndex + 1}, column ${cell.cellIndex + 1}`);
|
||||
cell.setAttribute("aria-label", (formulas ? formulas.cellAddress(row.rowIndex, cell.cellIndex) + " · " : "") + tr("Row {row}, column {column}", { row: row.rowIndex + 1, column: cell.cellIndex + 1 }));
|
||||
cell.addEventListener("focus", () => activate(cell));
|
||||
}
|
||||
selectionControls = tableSelectionControls(root, wrapper, table, view, () => controller.source, finish, change, { get: () => editor, activate, editSource }, actions);
|
||||
|
||||
Reference in New Issue
Block a user