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 type { EditorView } from "@codemirror/view";
|
||||
import { actionIcon } from "../ui/actionIcons";
|
||||
import { moveTableAxis, type TableAxis } from "./tableStructure";
|
||||
@@ -102,7 +103,7 @@ export function tableDragControls(root: HTMLElement, wrapper: HTMLElement, table
|
||||
if (!preview || !previewLabel || !drag) return;
|
||||
const valid = drag.to !== undefined;
|
||||
preview.classList.toggle("is-invalid-drop", !valid);
|
||||
previewLabel.textContent = `${drag.axis === "row" ? "Row" : "Column"} ${drag.index + 1}${valid ? ` → ${drag.to! + 1}` : " · Release to cancel"}`;
|
||||
previewLabel.textContent = `${drag.axis === "row" ? tr("Row") : tr("Column")} ${drag.index + 1}${valid ? ` → ${drag.to! + 1}` : tr(" · Release to cancel")}`;
|
||||
const rect = preview.getBoundingClientRect();
|
||||
const x = Math.max(8, Math.min(drag.x + 16, window.innerWidth - rect.width - 8));
|
||||
const y = Math.max(8, Math.min(drag.y + 16, window.innerHeight - rect.height - 8));
|
||||
@@ -171,8 +172,8 @@ export function tableDragControls(root: HTMLElement, wrapper: HTMLElement, table
|
||||
button.type = "button";
|
||||
button.className = `table-drag-handle table-drag-${axis}`;
|
||||
button.dataset.index = String(index);
|
||||
const label = `Move ${axis} ${index + 1}`;
|
||||
const tooltip = `${label} · Drag to reorder · ${axis === "row" ? "↑/↓" : "←/→"} to move`;
|
||||
const label = tr(axis === "row" ? "Move row {number}" : "Move column {number}", { number: index + 1 });
|
||||
const tooltip = tr("{label} · Drag to reorder · {keys} to move", { label, keys: axis === "row" ? "↑/↓" : "←/→" });
|
||||
button.setAttribute("aria-label", label);
|
||||
tooltipCleanup.push(attachTooltip(button, () => drag ? "" : tooltip));
|
||||
button.append(actionIcon("grip"));
|
||||
|
||||
Reference in New Issue
Block a user