Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

feat(files): add copy, paste, and delete shortcuts in the file tree (#2419)

Dimitri POSTOLOV555bd350d3af
diff --git a/.changeset/files-sidebar-shortcuts.md b/.changeset/files-sidebar-shortcuts.md
new file mode 100644
index 000000000..7b868d956
--- /dev/null
+++ b/.changeset/files-sidebar-shortcuts.md
@@ -0,0 +1,5 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+Add Files sidebar keyboard shortcuts for duplicating and deleting files and folders, including copy/paste duplication.
diff --git a/packages/app/src/components/FileTree.duplicate.dom.test.tsx b/packages/app/src/components/FileTree.duplicate.dom.test.tsx
index 533c814b5..b9a8296ed 100644
--- a/packages/app/src/components/FileTree.duplicate.dom.test.tsx
+++ b/packages/app/src/components/FileTree.duplicate.dom.test.tsx
@@ -194,6 +194,7 @@ class StubModel {
this.items.set(path, new StubItem(path, path.endsWith('/')));
}
+ scrollToPath() {}
move() {}
remove() {}
}
@@ -220,6 +221,12 @@ let projectLocalBindingMock: { patch: ReturnType<typeof mock> } | null = null;
let mergedConfigMock: {
appearance?: { sidebar?: { showHiddenFiles?: boolean } };
} | null = null;
+let deleteConfirmationProps: {
+ itemName?: string;
+ customTitle?: string;
+ customDescription?: string;
+ onDelete?: () => void | Promise<void>;
+} | null = null;
function jsonResponse(body: unknown, status = 200): Response {
return new Response(JSON.stringify(body), {
@@ -373,7 +380,15 @@ mock.module('@/components/ui/skeleton', () => ({
}));
mock.module('@/components/DeleteConfirmationDialog', () => ({
- DeleteConfirmationDialog: () => null,
+ DeleteConfirmationDialog: (props: {
+ itemName?: string;
+ customTitle?: string;
+ customDescription?: string;
+ onDelete?: () => void | Promise<void>;
+ }) => {
+ deleteConfirmationProps = props;
+ return <div data-testid="delete-confirmation-dialog" />;
+ },
}));
mock.module('@/components/NewItemDialog', () => ({
@@ -455,6 +470,7 @@ describe('FileTree duplicate action runtime behavior', () => {
// These duplicate/rename tests don't depend on visibility config; the
// tree loads through the default disk-walk listing.
mergedConfigMock = null;
+ deleteConfirmationProps = null;
globalThis.fetch = makeFetchMock() as unknown as typeof fetch;
toastSuccessMock.mockClear();
toastErrorMock.mockClear();
@@ -775,6 +791,97 @@ describe('FileTree duplicate action runtime behavior', () => {
});
});
+ test('Cmd/Ctrl+C then Cmd/Ctrl+V duplicates the copied tree item', async () => {
+ renderFileTree();
+ await screen.findByRole('menuitem', { name: /duplicate/i });
+ fetchCalls = [];
+
+ model.focusedPath = null;
+ model.selectedPaths = ['notes/source.mdx'];
+ screen.getByTestId('tree-focus-target').focus();
+ fireEvent.keyDown(document, { key: 'c', ctrlKey: true });
+
+ model.focusedPath = 'images/logo.png';
+ model.selectedPaths = ['images/logo.png'];
+ fireEvent.keyDown(document, { key: 'v', ctrlKey: true });
+
+ await waitFor(() => expect(duplicateCalls()).toHaveLength(1));
+ expect(JSON.parse(String(duplicateCalls()[0]?.init?.body))).toEqual({
+ kind: 'file',
+ path: 'notes/source',
+ });
+ });
+
+ test('Cmd/Ctrl+V without a copied tree item preserves native paste', async () => {
+ renderFileTree();
+ await screen.findByRole('menuitem', { name: /duplicate/i });
+ fetchCalls = [];
+
+ screen.getByTestId('tree-focus-target').focus();
+ const pasteEvent = new KeyboardEvent('keydown', {
+ key: 'v',
+ ctrlKey: true,
+ bubbles: true,
+ cancelable: true,
+ });
+ document.dispatchEvent(pasteEvent);
+
+ await new Promise((resolve) => setTimeout(resolve, 0));
+ expect(pasteEvent.defaultPrevented).toBe(false);
+ expect(duplicateCalls()).toHaveLength(0);
+ });
+
+ test('Cmd/Ctrl+C on an asset row does not enqueue a paste target', async () => {
+ renderFileTree();
+ await screen.findByRole('menuitem', { name: /duplicate/i });
+ fetchCalls = [];
+
+ model.focusedPath = 'images/logo.png';
+ model.selectedPaths = ['images/logo.png'];
+ screen.getByTestId('tree-focus-target').focus();
+ const copyEvent = new KeyboardEvent('keydown', {
+ key: 'c',
+ ctrlKey: true,
+ bubbles: true,
+ cancelable: true,
+ });
+ document.dispatchEvent(copyEvent);
+ fireEvent.keyDown(document, { key: 'v', ctrlKey: true });
+
+ await new Promise((resolve) => setTimeout(resolve, 0));
+ expect(copyEvent.defaultPrevented).toBe(false);
+ expect(duplicateCalls()).toHaveLength(0);
+ });
+
+ test('Cmd/Ctrl+C on an asset row does not clear the previous copied tree item', async () => {
+ renderFileTree();
+ await screen.findByRole('menuitem', { name: /duplicate/i });
+ fetchCalls = [];
+
+ model.focusedPath = null;
+ model.selectedPaths = ['notes/source.mdx'];
+ screen.getByTestId('tree-focus-target').focus();
+ fireEvent.keyDown(document, { key: 'c', ctrlKey: true });
+
+ model.focusedPath = 'images/logo.png';
+ model.selectedPaths = ['images/logo.png'];
+ const assetCopyEvent = new KeyboardEvent('keydown', {
+ key: 'c',
+ ctrlKey: true,
+ bubbles: true,
+ cancelable: true,
+ });
+ document.dispatchEvent(assetCopyEvent);
+ fireEvent.keyDown(document, { key: 'v', ctrlKey: true });
+
+ await waitFor(() => expect(duplicateCalls()).toHaveLength(1));
+ expect(assetCopyEvent.defaultPrevented).toBe(false);
+ expect(JSON.parse(String(duplicateCalls()[0]?.init?.body))).toEqual({
+ kind: 'file',
+ path: 'notes/source',
+ });
+ });
+
test('Cmd/Ctrl+D ignores asset rows', async () => {
renderFileTree();
await screen.findByRole('menuitem', { name: /duplicate/i });
@@ -789,6 +896,78 @@ describe('FileTree duplicate action runtime behavior', () => {
expect(duplicateCalls()).toHaveLength(0);
});
+ test('Cmd+Backspace opens delete confirmation for the selected tree item', async () => {
+ renderFileTree();
+ await screen.findByRole('menuitem', { name: /duplicate/i });
+
+ model.focusedPath = null;
+ model.selectedPaths = ['notes/source.mdx'];
+ screen.getByTestId('tree-focus-target').focus();
+ fireEvent.keyDown(document, { key: 'Backspace', metaKey: true });
+
+ await screen.findByTestId('delete-confirmation-dialog');
+ expect(deleteConfirmationProps?.itemName).toBe('source.mdx');
+ expect(deleteConfirmationProps?.customTitle).toBeUndefined();
+ });
+
+ test('Delete opens delete confirmation for the focused tree item', async () => {
+ renderFileTree();
+ await screen.findByRole('menuitem', { name: /duplicate/i });
+
+ model.focusedPath = 'notes/source.mdx';
+ model.selectedPaths = [];
+ screen.getByTestId('tree-focus-target').focus();
+ fireEvent.keyDown(document, { key: 'Delete' });
+
+ await screen.findByTestId('delete-confirmation-dialog');
+ expect(deleteConfirmationProps?.itemName).toBe('source.mdx');
+ expect(deleteConfirmationProps?.customTitle).toBeUndefined();
+ });
+
+ test('Delete does not open confirmation while another file-tree action is busy', async () => {
+ let releaseDuplicate: () => void = () => {};
+ duplicateGate = new Promise<void>((resolve) => {
+ releaseDuplicate = resolve;
+ });
+ const user = userEvent.setup();
+ renderFileTree();
+
+ const duplicate = await screen.findByRole('menuitem', { name: /duplicate/i });
+ fetchCalls = [];
+ await user.click(duplicate);
+ await waitFor(() => expect(duplicateCalls()).toHaveLength(1));
+
+ model.focusedPath = 'notes/source.mdx';
+ model.selectedPaths = [];
+ screen.getByTestId('tree-focus-target').focus();
+ fireEvent.keyDown(document, { key: 'Delete' });
+
+ await new Promise((resolve) => setTimeout(resolve, 0));
+ expect(screen.queryByTestId('delete-confirmation-dialog')).toBeNull();
+ expect(deleteConfirmationProps).toBeNull();
+
+ releaseDuplicate();
+ await waitFor(() =>
+ expect(toastSuccessMock).toHaveBeenCalledWith('File duplicated', {
+ description: 'notes/source copy',
+ }),
+ );
+ });
+
+ test('Delete opens one confirmation for multi-selected targets with nested paths deduped', async () => {
+ renderFileTree();
+ await screen.findByRole('menuitem', { name: /duplicate/i });
+
+ model.focusedPath = null;
+ model.selectedPaths = ['notes/', 'notes/source.mdx', 'images/logo.png'];
+ screen.getByTestId('tree-focus-target').focus();
+ fireEvent.keyDown(document, { key: 'Delete' });
+
+ await screen.findByTestId('delete-confirmation-dialog');
+ expect(deleteConfirmationProps?.customTitle).toBe('Delete selected items');
+ expect(deleteConfirmationProps?.customDescription).toContain('2 selected items');
+ });
+
test('desktop duplicate event bus resolves doc and folder targets through the same duplicate path', async () => {
renderFileTree();
await screen.findByRole('menuitem', { name: /duplicate/i });
diff --git a/packages/app/src/components/FileTree.tsx b/packages/app/src/components/FileTree.tsx
index b14d4700c..0c0a03fbc 100644
--- a/packages/app/src/components/FileTree.tsx
+++ b/packages/app/src/components/FileTree.tsx
@@ -642,6 +642,44 @@ function selectedTreePathsToDeleteTargets(
.map((treePath) => treePathToTarget(treePath, documents));
}
+function normalizeTreePathFromModel(model: PierreFileTreeModel, treePath: string): string {
+ const selectedItem =
+ model.getItem(treePath) ?? model.getItem(folderPathToTreeDirectoryPath(treePath));
+ return selectedItem?.isDirectory()
+ ? folderPathToTreeDirectoryPath(treeDirectoryPathToFolderPath(selectedItem.getPath()))
+ : treePath;
+}
+
+function focusedOrFirstSelectedTreePath(model: PierreFileTreeModel): string | null {
+ const selectedPath = model.getFocusedPath() ?? model.getSelectedPaths()[0] ?? null;
+ return selectedPath ? normalizeTreePathFromModel(model, selectedPath) : null;
+}
+
+function resolveDuplicableKeyboardTarget(
+ model: PierreFileTreeModel,
+ documents: readonly FileEntry[],
+ assetTreePaths: ReadonlySet<string>,
+): FileTreeTarget | null {
+ const selectedPath = focusedOrFirstSelectedTreePath(model);
+ if (!selectedPath || assetTreePaths.has(selectedPath)) return null;
+ return treePathToTarget(selectedPath, documents);
+}
+
+function resolveKeyboardDeleteTargets(
+ model: PierreFileTreeModel,
+ documents: readonly FileEntry[],
+): FileTreeTarget[] {
+ const selectedPaths = model.getSelectedPaths();
+ const focusedPath = focusedOrFirstSelectedTreePath(model);
+ const paths =
+ selectedPaths.length > 0
+ ? selectedPaths.map((treePath) => normalizeTreePathFromModel(model, treePath))
+ : focusedPath
+ ? [focusedPath]
+ : [];
+ return selectedTreePathsToDeleteTargets(paths, documents);
+}
+
function isPathAtOrInsideFolder(path: string, folderPath: string): boolean {
return path === folderPath || path.startsWith(`${folderPath}/`);
}
@@ -1467,6 +1505,7 @@ export function FileTree({
(files: readonly File[], parentDir: string, busyPath: string) => void
>(() => {});
const busyPathRef = useRef<string | null>(null);
+ const copiedKeyboardTargetRef = useRef<FileTreeTarget | null>(null);
// Tracks locally-added tree paths (file/folder creates) with the timestamp
// when they were optimistically inserted into `documents` state. Used by
// `refreshDocs` to preserve entries the server's file-watcher index has not
@@ -3292,7 +3331,14 @@ export function FileTree({
const key = event.key.toLowerCase();
const isSelectAll = isPlatformShortcut && key === 'a';
const isDuplicate = isPlatformShortcut && !event.shiftKey && key === 'd';
- if (!isSelectAll && !isDuplicate) return;
+ const isCopy = isPlatformShortcut && !event.shiftKey && key === 'c';
+ const isPaste = isPlatformShortcut && !event.shiftKey && key === 'v';
+ const isDelete =
+ !event.altKey &&
+ !event.shiftKey &&
+ ((event.metaKey && !event.ctrlKey && key === 'backspace') ||
+ (!event.metaKey && !event.ctrlKey && key === 'delete'));
+ if (!isSelectAll && !isDuplicate && !isCopy && !isPaste && !isDelete) return;
if (isEditableKeyboardTarget(event.target)) return;
const host = fileTreeHostRef.current;
@@ -3302,18 +3348,46 @@ export function FileTree({
const focusIsInTree = activeElement instanceof Node && host?.contains(activeElement);
if (!eventStartedInTree && !focusIsInTree) return;
+ if (isCopy) {
+ const copiedTarget = resolveDuplicableKeyboardTarget(
+ model,
+ documentsRef.current,
+ assetTreePathsRef.current,
+ );
+ if (!copiedTarget) return;
+ copiedKeyboardTargetRef.current = copiedTarget;
+ event.preventDefault();
+ event.stopPropagation();
+ return;
+ }
+
+ if (isPaste) {
+ const copiedTarget = copiedKeyboardTargetRef.current;
+ if (!copiedTarget) return;
+ void handleDuplicateTargetRef.current(copiedTarget);
+ event.preventDefault();
+ event.stopPropagation();
+ return;
+ }
+
if (isDuplicate) {
- const selectedPath = model.getFocusedPath() ?? model.getSelectedPaths()[0] ?? null;
- if (!selectedPath) return;
- const selectedItem =
- model.getItem(selectedPath) ?? model.getItem(folderPathToTreeDirectoryPath(selectedPath));
- const normalizedPath = selectedItem?.isDirectory()
- ? folderPathToTreeDirectoryPath(treeDirectoryPathToFolderPath(selectedItem.getPath()))
- : selectedPath;
- if (assetTreePathsRef.current.has(normalizedPath)) return;
- void handleDuplicateTargetRef.current(
- treePathToTarget(normalizedPath, documentsRef.current),
+ const duplicateTarget = resolveDuplicableKeyboardTarget(
+ model,
+ documentsRef.current,
+ assetTreePathsRef.current,
);
+ if (!duplicateTarget) return;
+ void handleDuplicateTargetRef.current(duplicateTarget);
+ event.preventDefault();
+ event.stopPropagation();
+ return;
+ }
+
+ if (isDelete) {
+ if (busyPathRef.current !== null) return;
+ const targets = resolveKeyboardDeleteTargets(model, documentsRef.current);
+ if (targets.length === 0) return;
+ setDeleteRequest({ targets });
event.preventDefault();
event.stopPropagation();
return;
diff --git a/packages/app/src/lib/keyboard-shortcuts.test.ts b/packages/app/src/lib/keyboard-shortcuts.test.ts
index a20cd128f..75593fbdf 100644
--- a/packages/app/src/lib/keyboard-shortcuts.test.ts
+++ b/packages/app/src/lib/keyboard-shortcuts.test.ts
@@ -21,6 +21,10 @@ describe('keyboard shortcut registry', () => {
expect(formatShortcut('new-item', 'windowsLinux')).toBe('Ctrl N');
expect(formatShortcut('new-folder', 'mac')).toBe('⇧⌘ N');
expect(formatShortcut('new-folder', 'windowsLinux')).toBe('Ctrl Shift N');
+ expect(formatShortcut('file-tree-copy', 'mac')).toBe('⌘ C');
+ expect(formatShortcut('file-tree-paste', 'windowsLinux')).toBe('Ctrl V');
+ expect(formatShortcut('file-tree-delete', 'mac')).toBe('⌘ Backspace');
+ expect(formatShortcut('file-tree-delete', 'windowsLinux')).toBe('Delete');
expect(formatShortcut('edit-with-ai', 'mac')).toBe('⇧⌘ I');
expect(formatShortcut('tab-new', 'mac')).toBe('⌘ T');
expect(formatShortcut('tab-next', 'mac')).toBe('⌃ Tab');
diff --git a/packages/app/src/lib/keyboard-shortcuts.ts b/packages/app/src/lib/keyboard-shortcuts.ts
index b881d305d..6f5881a14 100644
--- a/packages/app/src/lib/keyboard-shortcuts.ts
+++ b/packages/app/src/lib/keyboard-shortcuts.ts
@@ -278,6 +278,22 @@ const KEYBOARD_SHORTCUT_DEFINITIONS = [
scope: msg`OK Desktop`,
bindings: [{ mac: '⇧⌘ P', windowsLinux: 'Ctrl Shift P' }],
},
+ {
+ id: 'file-tree-copy',
+ category: 'workspace',
+ title: msg`Copy selected file or folder`,
+ description: msg`Copy the focused file-tree item so Paste can duplicate it.`,
+ scope: msg`Files sidebar`,
+ bindings: [{ mac: '⌘ C', windowsLinux: 'Ctrl C' }],
+ },
+ {
+ id: 'file-tree-paste',
+ category: 'workspace',
+ title: msg`Paste duplicate`,
+ description: msg`Duplicate the file-tree item copied from the Files sidebar.`,
+ scope: msg`Files sidebar`,
+ bindings: [{ mac: '⌘ V', windowsLinux: 'Ctrl V' }],
+ },
{
id: 'file-tree-duplicate',
category: 'workspace',
@@ -286,6 +302,14 @@ const KEYBOARD_SHORTCUT_DEFINITIONS = [
scope: msg`Files sidebar`,
bindings: [{ mac: '⌘ D', windowsLinux: 'Ctrl D' }],
},
+ {
+ id: 'file-tree-delete',
+ category: 'workspace',
+ title: msg`Delete selected files or folders`,
+ description: msg`Open delete confirmation for the selected file-tree items.`,
+ scope: msg`Files sidebar`,
+ bindings: [{ mac: '⌘ Backspace', windowsLinux: 'Delete' }],
+ },
{
id: 'file-tree-select-all',
category: 'workspace',
diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.json
index b9dd79482..1788b67c8 100644
--- a/packages/app/src/locales/en/messages.json
+++ b/packages/app/src/locales/en/messages.json
@@ -352,6 +352,7 @@
"7hctf2": ["Describe the project you want to create"],
"7jIIFX": ["You're all set up!"],
"7qRHf0": ["Install for Claude Chat & Cowork"],
+ "7uBlRT": ["Copy the focused file-tree item so Paste can duplicate it."],
"80c4-P": ["Code copied to clipboard"],
"81H_23": ["Add properties"],
"881Uwh": ["Delete selected table"],
@@ -1261,6 +1262,7 @@
"VsaI0G": [["folderCount", "plural", { "one": ["folder"], "other": ["folders"] }]],
"VuxVSP": ["Start source completion"],
"VvS_k_": ["Config sharing is now local-only."],
+ "VxO6wR": ["Delete selected files or folders"],
"W-ntoW": ["heading-slug"],
"W0i24j": ["Object"],
"W1qRuM": ["This document is already active in the editor. Use Open to collapse the graph."],
@@ -1462,6 +1464,7 @@
"_qD6mn": ["Pick the folder where you've cloned it."],
"_rP3HI": [["minutes"], "m ago"],
"_tekeB": ["updated folder properties"],
+ "_tjopj": ["Paste duplicate"],
"a-cKXz": ["Select all source"],
"a3H_MR": ["Open and focus the Ask AI composer for the current editor selection."],
"a5Gha5": ["Local changes blocked the merge"],
@@ -1603,11 +1606,13 @@
"e1Rn_k": ["Open containing folder"],
"e1hptq": ["Embed a video with native player controls."],
"e4GHWP": ["Pull"],
+ "e4PbgC": ["Duplicate the file-tree item copied from the Files sidebar."],
"e8L17t": ["A non-empty folder already exists at this path. Pick a different folder."],
"e8zRrb": ["Show Files"],
"eBIT9h": ["Paste failed.", ["restoreSuffix"]],
"eFJkVt": ["Clone failed: ", ["cloneError"]],
"eG8Jsg": ["Toggle source tab focus mode"],
+ "eGUbmF": ["Copy selected file or folder"],
"eJitUk": ["Upload from computer"],
"eKThTQ": ["Failed to reorder"],
"eNQGRb": ["Inline LaTeX math rendered with KaTeX."],
@@ -2043,6 +2048,7 @@
"omXJcU": ["Close others"],
"optX0N": [["0"], "h ago"],
"oqB2ez": ["Previous match"],
+ "osRqlv": ["Open delete confirmation for the selected file-tree items."],
"ot5BRK": ["Duplicate selected file or folder"],
"otE4aj": ["Show external URL nodes"],
"ou1hFW": ["Toggle an ordered list."],
diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.po
index ee1b813a3..f08e74932 100644
--- a/packages/app/src/locales/en/messages.po
+++ b/packages/app/src/locales/en/messages.po
@@ -1710,6 +1710,10 @@ msgstr "Copy path"
msgid "Copy Path"
msgstr "Copy Path"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Copy selected file or folder"
+msgstr "Copy selected file or folder"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Copy share link"
msgstr "Copy share link"
@@ -1718,6 +1722,10 @@ msgstr "Copy share link"
msgid "Copy source"
msgstr "Copy source"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Copy the focused file-tree item so Paste can duplicate it."
+msgstr "Copy the focused file-tree item so Paste can duplicate it."
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Copying..."
msgstr "Copying..."
@@ -2273,6 +2281,10 @@ msgstr "Delete code block"
msgid "Delete Permanently"
msgstr "Delete Permanently"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Delete selected files or folders"
+msgstr "Delete selected files or folders"
+
#: src/components/FileTree.tsx
msgid "Delete selected items"
msgstr "Delete selected items"
@@ -2533,6 +2545,10 @@ msgstr "Duplicate selected file or folder"
msgid "Duplicate succeeded but the sidebar may be out of date — refresh to resync"
msgstr "Duplicate succeeded but the sidebar may be out of date — refresh to resync"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Duplicate the file-tree item copied from the Files sidebar."
+msgstr "Duplicate the file-tree item copied from the Files sidebar."
+
#: src/lib/keyboard-shortcuts.ts
msgid "Duplicate the focused file-tree item when focus is in the Files sidebar."
msgstr "Duplicate the focused file-tree item when focus is in the Files sidebar."
@@ -4800,6 +4816,10 @@ msgstr "Open containing folder, {hint}"
msgid "Open date picker for {keyName}"
msgstr "Open date picker for {keyName}"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Open delete confirmation for the selected file-tree items."
+msgstr "Open delete confirmation for the selected file-tree items."
+
#: src/components/PropertyWidgets.tsx
msgid "Open documents tagged #{chip}"
msgstr "Open documents tagged #{chip}"
@@ -5123,6 +5143,10 @@ msgstr "Paragraph"
msgid "Parse failed"
msgstr "Parse failed"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Paste duplicate"
+msgstr "Paste duplicate"
+
#: src/editor/clipboard/source-clipboard.ts
msgid "Paste failed.{restoreSuffix}"
msgstr "Paste failed.{restoreSuffix}"
diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.json
index c0afde109..53c8bb33e 100644
--- a/packages/app/src/locales/pseudo/messages.json
+++ b/packages/app/src/locales/pseudo/messages.json
@@ -352,6 +352,7 @@
"7hctf2": ["Ďēśćŕĩƀē ţĥē ƥŕōĴēćţ ŷōũ ŵàńţ ţō ćŕēàţē"],
"7jIIFX": ["Ŷōũ'ŕē àĺĺ śēţ ũƥ!"],
"7qRHf0": ["Ĩńśţàĺĺ ƒōŕ Ćĺàũďē Ćĥàţ & Ćōŵōŕķ"],
+ "7uBlRT": ["Ćōƥŷ ţĥē ƒōćũśēď ƒĩĺē-ţŕēē ĩţēḿ śō Ƥàśţē ćàń ďũƥĺĩćàţē ĩţ."],
"80c4-P": ["Ćōďē ćōƥĩēď ţō ćĺĩƥƀōàŕď"],
"81H_23": ["Àďď ƥŕōƥēŕţĩēś"],
"881Uwh": ["Ďēĺēţē śēĺēćţēď ţàƀĺē"],
@@ -1261,6 +1262,7 @@
"VsaI0G": [["folderCount", "plural", { "one": ["ƒōĺďēŕ"], "other": ["ƒōĺďēŕś"] }]],
"VuxVSP": ["Śţàŕţ śōũŕćē ćōḿƥĺēţĩōń"],
"VvS_k_": ["Ćōńƒĩĝ śĥàŕĩńĝ ĩś ńōŵ ĺōćàĺ-ōńĺŷ."],
+ "VxO6wR": ["Ďēĺēţē śēĺēćţēď ƒĩĺēś ōŕ ƒōĺďēŕś"],
"W-ntoW": ["ĥēàďĩńĝ-śĺũĝ"],
"W0i24j": ["ŌƀĴēćţ"],
"W1qRuM": ["Ţĥĩś ďōćũḿēńţ ĩś àĺŕēàďŷ àćţĩvē ĩń ţĥē ēďĩţōŕ. Ũśē Ōƥēń ţō ćōĺĺàƥśē ţĥē ĝŕàƥĥ."],
@@ -1462,6 +1464,7 @@
"_qD6mn": ["Ƥĩćķ ţĥē ƒōĺďēŕ ŵĥēŕē ŷōũ'vē ćĺōńēď ĩţ."],
"_rP3HI": [["minutes"], "ḿ àĝō"],
"_tekeB": ["ũƥďàţēď ƒōĺďēŕ ƥŕōƥēŕţĩēś"],
+ "_tjopj": ["Ƥàśţē ďũƥĺĩćàţē"],
"a-cKXz": ["Śēĺēćţ àĺĺ śōũŕćē"],
"a3H_MR": ["Ōƥēń àńď ƒōćũś ţĥē Àśķ ÀĨ ćōḿƥōśēŕ ƒōŕ ţĥē ćũŕŕēńţ ēďĩţōŕ śēĺēćţĩōń."],
"a5Gha5": ["Ĺōćàĺ ćĥàńĝēś ƀĺōćķēď ţĥē ḿēŕĝē"],
@@ -1603,11 +1606,13 @@
"e1Rn_k": ["Ōƥēń ćōńţàĩńĩńĝ ƒōĺďēŕ"],
"e1hptq": ["Ēḿƀēď à vĩďēō ŵĩţĥ ńàţĩvē ƥĺàŷēŕ ćōńţŕōĺś."],
"e4GHWP": ["Ƥũĺĺ"],
+ "e4PbgC": ["Ďũƥĺĩćàţē ţĥē ƒĩĺē-ţŕēē ĩţēḿ ćōƥĩēď ƒŕōḿ ţĥē Ƒĩĺēś śĩďēƀàŕ."],
"e8L17t": ["À ńōń-ēḿƥţŷ ƒōĺďēŕ àĺŕēàďŷ ēxĩśţś àţ ţĥĩś ƥàţĥ. Ƥĩćķ à ďĩƒƒēŕēńţ ƒōĺďēŕ."],
"e8zRrb": ["Śĥōŵ Ƒĩĺēś"],
"eBIT9h": ["Ƥàśţē ƒàĩĺēď.", ["restoreSuffix"]],
"eFJkVt": ["Ćĺōńē ƒàĩĺēď: ", ["cloneError"]],
"eG8Jsg": ["Ţōĝĝĺē śōũŕćē ţàƀ ƒōćũś ḿōďē"],
+ "eGUbmF": ["Ćōƥŷ śēĺēćţēď ƒĩĺē ōŕ ƒōĺďēŕ"],
"eJitUk": ["Ũƥĺōàď ƒŕōḿ ćōḿƥũţēŕ"],
"eKThTQ": ["Ƒàĩĺēď ţō ŕēōŕďēŕ"],
"eNQGRb": ["Ĩńĺĩńē ĹàŢēX ḿàţĥ ŕēńďēŕēď ŵĩţĥ ĶàŢēX."],
@@ -2043,6 +2048,7 @@
"omXJcU": ["Ćĺōśē ōţĥēŕś"],
"optX0N": [["0"], "ĥ àĝō"],
"oqB2ez": ["Ƥŕēvĩōũś ḿàţćĥ"],
+ "osRqlv": ["Ōƥēń ďēĺēţē ćōńƒĩŕḿàţĩōń ƒōŕ ţĥē śēĺēćţēď ƒĩĺē-ţŕēē ĩţēḿś."],
"ot5BRK": ["Ďũƥĺĩćàţē śēĺēćţēď ƒĩĺē ōŕ ƒōĺďēŕ"],
"otE4aj": ["Śĥōŵ ēxţēŕńàĺ ŨŔĹ ńōďēś"],
"ou1hFW": ["Ţōĝĝĺē àń ōŕďēŕēď ĺĩśţ."],
diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.po
index 963384dfe..dfacb6117 100644
--- a/packages/app/src/locales/pseudo/messages.po
+++ b/packages/app/src/locales/pseudo/messages.po
@@ -1705,6 +1705,10 @@ msgstr ""
msgid "Copy Path"
msgstr ""
+#: src/lib/keyboard-shortcuts.ts
+msgid "Copy selected file or folder"
+msgstr ""
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Copy share link"
msgstr ""
@@ -1713,6 +1717,10 @@ msgstr ""
msgid "Copy source"
msgstr ""
+#: src/lib/keyboard-shortcuts.ts
+msgid "Copy the focused file-tree item so Paste can duplicate it."
+msgstr ""
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Copying..."
msgstr ""
@@ -2268,6 +2276,10 @@ msgstr ""
msgid "Delete Permanently"
msgstr ""
+#: src/lib/keyboard-shortcuts.ts
+msgid "Delete selected files or folders"
+msgstr ""
+
#: src/components/FileTree.tsx
msgid "Delete selected items"
msgstr ""
@@ -2528,6 +2540,10 @@ msgstr ""
msgid "Duplicate succeeded but the sidebar may be out of date — refresh to resync"
msgstr ""
+#: src/lib/keyboard-shortcuts.ts
+msgid "Duplicate the file-tree item copied from the Files sidebar."
+msgstr ""
+
#: src/lib/keyboard-shortcuts.ts
msgid "Duplicate the focused file-tree item when focus is in the Files sidebar."
msgstr ""
@@ -4795,6 +4811,10 @@ msgstr ""
msgid "Open date picker for {keyName}"
msgstr ""
+#: src/lib/keyboard-shortcuts.ts
+msgid "Open delete confirmation for the selected file-tree items."
+msgstr ""
+
#: src/components/PropertyWidgets.tsx
msgid "Open documents tagged #{chip}"
msgstr ""
@@ -5118,6 +5138,10 @@ msgstr ""
msgid "Parse failed"
msgstr ""
+#: src/lib/keyboard-shortcuts.ts
+msgid "Paste duplicate"
+msgstr ""
+
#: src/editor/clipboard/source-clipboard.ts
msgid "Paste failed.{restoreSuffix}"
msgstr ""
diff --git a/packages/core/src/bridge/bind-frontmatter-doc.ts b/packages/core/src/bridge/bind-frontmatter-doc.ts
index 8f9d95287..c014b1413 100644
--- a/packages/core/src/bridge/bind-frontmatter-doc.ts
+++ b/packages/core/src/bridge/bind-frontmatter-doc.ts
@@ -1,4 +1,3 @@
-
import type * as Y from 'yjs';
import type { Err, Ok, Result } from '../config/result.ts';
import { type FrontmatterValidationError, toFrontmatterIssue } from '../frontmatter/errors.ts';
diff --git a/packages/core/src/bridge/bridge-invariant.ts b/packages/core/src/bridge/bridge-invariant.ts
index 8bfdb40cd..005627195 100644
--- a/packages/core/src/bridge/bridge-invariant.ts
+++ b/packages/core/src/bridge/bridge-invariant.ts
@@ -1,4 +1,3 @@
-
import { fnv1aDigest } from './hash-util.ts';
export type BridgeInvariantSite = 'observer-b' | 'persistence' | 'test-harness';
diff --git a/packages/core/src/bridge/doc-boundary-space.ts b/packages/core/src/bridge/doc-boundary-space.ts
index c18c086d5..8890f6739 100644
--- a/packages/core/src/bridge/doc-boundary-space.ts
+++ b/packages/core/src/bridge/doc-boundary-space.ts
@@ -1,4 +1,3 @@
-
import { FRONTMATTER_RE, stripFrontmatter } from '../extensions/frontmatter.ts';
const LEADING_BOUNDARY_RE = /^(?:\r?\n)+/;
diff --git a/packages/core/src/bridge/merge-three-way.ts b/packages/core/src/bridge/merge-three-way.ts
index 864bc7245..b0a80fbd9 100644
--- a/packages/core/src/bridge/merge-three-way.ts
+++ b/packages/core/src/bridge/merge-three-way.ts
@@ -37,7 +37,6 @@ function mergeThreeWayImpl(baseline: string, userText: string, agentText: string
return parts.join('\n');
}
-
export type BridgeMergeContentLossSide = 'user' | 'agent';
export type BridgeMergeContentLossWhich = 'substring' | 'order';
diff --git a/packages/core/src/bridge/normalize.ts b/packages/core/src/bridge/normalize.ts
index 592f0b956..e67f33b40 100644
--- a/packages/core/src/bridge/normalize.ts
+++ b/packages/core/src/bridge/normalize.ts
@@ -1,4 +1,3 @@
-
const COMMONMARK_ESCAPE_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g;
const TABLE_ALIGN_ROW_RE = /^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/;
diff --git a/packages/core/src/markdown/callout-transformer.ts b/packages/core/src/markdown/callout-transformer.ts
index a363dfd54..83d47404a 100644
--- a/packages/core/src/markdown/callout-transformer.ts
+++ b/packages/core/src/markdown/callout-transformer.ts
@@ -1,4 +1,3 @@
-
import type { Blockquote, Paragraph, Root } from 'mdast';
import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
import { visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/comment-promoter.ts b/packages/core/src/markdown/comment-promoter.ts
index 47f0d07e4..193e286b0 100644
--- a/packages/core/src/markdown/comment-promoter.ts
+++ b/packages/core/src/markdown/comment-promoter.ts
@@ -1,4 +1,3 @@
-
import type { Nodes, Paragraph, PhrasingContent, Root, RootContent, Text } from 'mdast';
import { SKIP, visit } from 'unist-util-visit';
import type { VFile } from 'vfile';
diff --git a/packages/core/src/markdown/dedent-block-jsx-close.ts b/packages/core/src/markdown/dedent-block-jsx-close.ts
index b6299a948..ece5c02a1 100644
--- a/packages/core/src/markdown/dedent-block-jsx-close.ts
+++ b/packages/core/src/markdown/dedent-block-jsx-close.ts
@@ -1,4 +1,3 @@
-
import { findFencedRegions, isInsideFence } from './fence-regions.ts';
const INDENTED_BLOCK_JSX_CLOSE_RE = /^([ ]{1,3})(<\/[A-Z][A-Za-z0-9_]*\s*>)([ \t]*)$/gm;
diff --git a/packages/core/src/markdown/details-accordion-promoter.ts b/packages/core/src/markdown/details-accordion-promoter.ts
index acd398aa6..54774764a 100644
--- a/packages/core/src/markdown/details-accordion-promoter.ts
+++ b/packages/core/src/markdown/details-accordion-promoter.ts
@@ -1,4 +1,3 @@
-
import type { Nodes, Paragraph, Parent, Root, Text } from 'mdast';
import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
import { visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/fence-regions.ts b/packages/core/src/markdown/fence-regions.ts
index fb5ac8e8a..c7518d614 100644
--- a/packages/core/src/markdown/fence-regions.ts
+++ b/packages/core/src/markdown/fence-regions.ts
@@ -1,4 +1,3 @@
-
const FENCE_RE = /^(`{3,}|~{3,})/gm;
export function findFencedRegions(src: string): Array<[number, number]> {
diff --git a/packages/core/src/markdown/fixtures/index.ts b/packages/core/src/markdown/fixtures/index.ts
index 6931623c7..00f5771ee 100644
--- a/packages/core/src/markdown/fixtures/index.ts
+++ b/packages/core/src/markdown/fixtures/index.ts
@@ -1,4 +1,3 @@
-
import { readFileSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
@@ -9,7 +8,6 @@ function fixturePath(...segments: string[]): string {
return resolve(FIXTURES_DIR, ...segments);
}
-
interface GfmExample {
section: string;
markdown: string;
@@ -19,7 +17,6 @@ export function loadGfmExamples(): GfmExample[] {
return JSON.parse(readFileSync(fixturePath('gfm', 'examples.json'), 'utf8')) as GfmExample[];
}
-
interface MdxCrashEntry {
id: string;
input: string;
@@ -71,7 +68,6 @@ export function loadLargeEmbedFixtures(): LargeEmbedFixture[] {
) as LargeEmbedFixture[];
}
-
export function loadPrd6955Before(): string {
return readFileSync(fixturePath('regression', 'prd-6955-before.md'), 'utf8');
}
@@ -80,7 +76,6 @@ export function loadPrd6955CorruptedTriplicated(): string {
return readFileSync(fixturePath('regression', 'prd-6955-corrupted-triplicated.md'), 'utf8');
}
-
export interface NgPinnedCase {
id: string;
name: string;
@@ -97,7 +92,6 @@ export function loadNgPinnedCases(): NgPinnedCase[] {
) as NgPinnedCase[];
}
-
export function loadLargeRealistic(): string {
return readFileSync(fixturePath('perf', 'large-realistic.md'), 'utf8');
}
diff --git a/packages/core/src/markdown/fixtures/perf/generate.ts b/packages/core/src/markdown/fixtures/perf/generate.ts
index daa3ef82b..8b1eb8519 100644
--- a/packages/core/src/markdown/fixtures/perf/generate.ts
+++ b/packages/core/src/markdown/fixtures/perf/generate.ts
@@ -1,4 +1,3 @@
-
import { writeFileSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
@@ -11,7 +10,6 @@ const BASELINE_ONLY_COUNTS = [500, 2500] as const;
const SEED = 0xf1de1117;
-
function mulberry32(seed: number): () => number {
let a = seed >>> 0;
return () => {
@@ -38,7 +36,6 @@ function pickWeighted<T>(rand: () => number, items: readonly [T, number][]): T {
return items[items.length - 1][0];
}
-
const WORDS = [
'lorem',
'ipsum',
@@ -156,7 +153,6 @@ function mdxBlock(rand: () => number): string {
return `<${name}>\n\n${sentence(rand)}\n\n</${name}>`;
}
-
type BlockKind = 'paragraph' | 'heading' | 'list' | 'code' | 'table' | 'mdx';
const MIX: readonly [BlockKind, number][] = [
@@ -195,7 +191,6 @@ function generateDocument(blockCount: number, seed: number): string {
return `${blocks.join('\n\n')}\n`;
}
-
function main(): void {
for (const count of [...BLOCK_COUNTS, ...BASELINE_ONLY_COUNTS]) {
const doc = generateDocument(count, SEED);
diff --git a/packages/core/src/markdown/guard-flanking-matrix.ts b/packages/core/src/markdown/guard-flanking-matrix.ts
index 32c055c5b..420dc0fe5 100644
--- a/packages/core/src/markdown/guard-flanking-matrix.ts
+++ b/packages/core/src/markdown/guard-flanking-matrix.ts
@@ -7,7 +7,6 @@ import {
import { BACKSLASH_GUARD_SUBSTITUTIONS, encodeBackslashEscapes } from './backslash-escape-guard.ts';
import { ENTITY_REF_GUARD_SUBSTITUTIONS, encodeEntityRefs } from './entity-ref-guard.ts';
-
export const ATTENTION_DELIMITERS = ['*', '_', '**', '~~', '=='] as const;
export type FlankClass = 'whitespace' | 'punctuation' | 'other';
diff --git a/packages/core/src/markdown/handler-shadow-audit.ts b/packages/core/src/markdown/handler-shadow-audit.ts
index 283913255..2653473da 100644
--- a/packages/core/src/markdown/handler-shadow-audit.ts
+++ b/packages/core/src/markdown/handler-shadow-audit.ts
@@ -1,4 +1,3 @@
-
export interface HandlerShadowWitness {
input: string;
expect: 'byte' | 'byte-and-reparse-type';
diff --git a/packages/core/src/markdown/highlight-promoter.ts b/packages/core/src/markdown/highlight-promoter.ts
index 7a22e8016..f758cf737 100644
--- a/packages/core/src/markdown/highlight-promoter.ts
+++ b/packages/core/src/markdown/highlight-promoter.ts
@@ -1,4 +1,3 @@
-
import type { Nodes, Parent, PhrasingContent, Root, Text } from 'mdast';
import type { MdxJsxTextElement } from 'mdast-util-mdx';
import { SKIP, visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/html-to-mdast.ts b/packages/core/src/markdown/html-to-mdast.ts
index 2f082e6d0..78fdfeb02 100644
--- a/packages/core/src/markdown/html-to-mdast.ts
+++ b/packages/core/src/markdown/html-to-mdast.ts
@@ -1,4 +1,3 @@
-
import type { Root as HastRoot } from 'hast';
import type { Root as MdastRoot } from 'mdast';
import rehypeParse from 'rehype-parse';
@@ -76,8 +75,7 @@ export function htmlToMdast(html: string, options?: HtmlToMdastOptions): MdastRo
throw new HtmlPayloadTooLargeError(html.length, maxBytes);
}
- const processor = unified()
- .use(rehypeParse, { fragment: true });
+ const processor = unified().use(rehypeParse, { fragment: true });
for (const plugin of cleanupPlugins) {
processor.use(plugin);
diff --git a/packages/core/src/markdown/image-promoter.ts b/packages/core/src/markdown/image-promoter.ts
index 994eb6917..706fa9afb 100644
--- a/packages/core/src/markdown/image-promoter.ts
+++ b/packages/core/src/markdown/image-promoter.ts
@@ -1,4 +1,3 @@
-
import type { Image, Paragraph, Root } from 'mdast';
import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
import { visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/index.ts b/packages/core/src/markdown/index.ts
index 064fa0773..58a810193 100644
--- a/packages/core/src/markdown/index.ts
+++ b/packages/core/src/markdown/index.ts
@@ -1,4 +1,3 @@
-
import {
type FromProseMirrorOptions,
fromPmMark,
@@ -165,7 +164,6 @@ export class MarkdownManager {
}
}
-
const registry = createRegistry();
function destructureAttrs(
@@ -214,7 +212,6 @@ function destructureAttrs(
return result;
}
-
function hasDirtyDescendant(node: PmNode): boolean {
let found = false;
node.descendants((child) => {
@@ -233,7 +230,6 @@ function effectiveDirty(node: PmNode): boolean {
return node.attrs.sourceDirty || hasDirtyDescendant(node);
}
-
function isEmptyMdastParagraph(node: MdastNodes): boolean {
if (node.type !== 'paragraph') return false;
const children = node.children ?? [];
@@ -302,7 +298,6 @@ function extractTextFromMdastNodes(nodes: MdastNodes[]): string {
return out;
}
-
import {
AUDIO_EXTENSIONS,
FILE_ATTACHMENT_EXTENSIONS,
@@ -552,7 +547,6 @@ function buildMdastToPmHandlers(
}));
}
-
if (m.emphasis) {
handlers.emphasis = toPmMark(m.emphasis, (node: Emphasis) => ({
sourceDelimiter: node.data?.sourceDelimiter ?? '*',
@@ -632,7 +626,6 @@ function buildMdastToPmHandlers(
}));
}
-
if (m.link) {
const sourceLiteralMark = m.sourceLiteral;
handlers.link = (node: Link, _parent: MdastParent, state: MdastToPmState) => {
@@ -911,7 +904,6 @@ function buildMdastToPmHandlers(
};
}
-
const blockUnknownHandler = (node: {
type: string;
position?: { start: { offset: number }; end: { offset: number } };
@@ -1037,7 +1029,6 @@ function buildMdastToPmHandlers(
return handlers as RemarkProseMirrorOptions['handlers'];
}
-
function buildPmToMdastHandlers(schema: Schema): {
nodeHandlers: FromProseMirrorOptions<string, string>['nodeHandlers'];
markHandlers: FromProseMirrorOptions<string, string>['markHandlers'];
diff --git a/packages/core/src/markdown/math-promoter.ts b/packages/core/src/markdown/math-promoter.ts
index bd79424c7..a5b511f25 100644
--- a/packages/core/src/markdown/math-promoter.ts
+++ b/packages/core/src/markdown/math-promoter.ts
@@ -1,4 +1,3 @@
-
import type { Code, Root } from 'mdast';
import type { Math as MdastMath } from 'mdast-util-math';
import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
diff --git a/packages/core/src/markdown/mdast-to-hast-handlers.ts b/packages/core/src/markdown/mdast-to-hast-handlers.ts
index f84967798..679c72ef7 100644
--- a/packages/core/src/markdown/mdast-to-hast-handlers.ts
+++ b/packages/core/src/markdown/mdast-to-hast-handlers.ts
@@ -1,4 +1,3 @@
-
import type { Comment, Element, ElementContent, Properties } from 'hast';
import type { FootnoteDefinition, FootnoteReference } from 'mdast';
import type { MdxJsxFlowElement, MdxJsxTextElement } from 'mdast-util-mdx';
diff --git a/packages/core/src/markdown/mdast-to-html.ts b/packages/core/src/markdown/mdast-to-html.ts
index df788a80d..8ce2b2492 100644
--- a/packages/core/src/markdown/mdast-to-html.ts
+++ b/packages/core/src/markdown/mdast-to-html.ts
@@ -1,4 +1,3 @@
-
import type { Element, Root as HastRoot, Text as HastText } from 'hast';
import type { Root as MdastRoot, Text as MdastText } from 'mdast';
import type { Handler } from 'mdast-util-to-hast';
diff --git a/packages/core/src/markdown/merged-walker.ts b/packages/core/src/markdown/merged-walker.ts
index a58f8c720..35d74b85e 100644
--- a/packages/core/src/markdown/merged-walker.ts
+++ b/packages/core/src/markdown/merged-walker.ts
@@ -1,4 +1,3 @@
-
import type { Nodes, Parent, Root } from 'mdast';
import { SKIP, visit } from 'unist-util-visit';
import type { VFile } from 'vfile';
diff --git a/packages/core/src/markdown/mermaid-promoter.ts b/packages/core/src/markdown/mermaid-promoter.ts
index 17ed2b829..1a897fca8 100644
--- a/packages/core/src/markdown/mermaid-promoter.ts
+++ b/packages/core/src/markdown/mermaid-promoter.ts
@@ -1,4 +1,3 @@
-
import type { Code, Root } from 'mdast';
import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
import { visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/parse-with-fallback.ts b/packages/core/src/markdown/parse-with-fallback.ts
index 7e4a9a48b..9864b3b60 100644
--- a/packages/core/src/markdown/parse-with-fallback.ts
+++ b/packages/core/src/markdown/parse-with-fallback.ts
@@ -168,7 +168,6 @@ export function parseRecursive(
}
}
-
interface VFilePlace {
offset?: number;
start?: { offset?: number };
@@ -187,7 +186,6 @@ function extractErrorOffset(err: unknown): number | undefined {
return undefined;
}
-
interface Region {
start: number;
end: number;
@@ -211,7 +209,6 @@ function nearestBlankLineAfter(src: string, offset: number): number | null {
return null;
}
-
export interface TagEvent {
kind: 'open' | 'close' | 'self-close';
name: string;
@@ -358,7 +355,6 @@ function findFallbackRegion(src: string, errorOffset: number): Region {
return { start: blockStart, end: blockEnd };
}
-
interface SourceBlock {
src: string;
start: number;
@@ -456,7 +452,6 @@ function tryPerBlockFallback(
};
}
-
function wholeDocRawText(source: string): JSONContent {
return {
type: 'doc',
diff --git a/packages/core/src/markdown/parser-drop-closure.ts b/packages/core/src/markdown/parser-drop-closure.ts
index 43d420187..e6ab4fd57 100644
--- a/packages/core/src/markdown/parser-drop-closure.ts
+++ b/packages/core/src/markdown/parser-drop-closure.ts
@@ -1,4 +1,3 @@
-
export type DroppedTokenAdjudication =
| {
kind: 'format-dof-axis';
diff --git a/packages/core/src/markdown/pipeline.ts b/packages/core/src/markdown/pipeline.ts
index 5b9550e90..5d6db7aa8 100644
--- a/packages/core/src/markdown/pipeline.ts
+++ b/packages/core/src/markdown/pipeline.ts
@@ -1,4 +1,3 @@
-
import {
type FromProseMirrorOptions,
fromProseMirror,
diff --git a/packages/core/src/markdown/position-aware-join.ts b/packages/core/src/markdown/position-aware-join.ts
index 4ac5731e7..248685cfe 100644
--- a/packages/core/src/markdown/position-aware-join.ts
+++ b/packages/core/src/markdown/position-aware-join.ts
@@ -1,4 +1,3 @@
-
import type { Join } from 'mdast-util-to-markdown';
import type { Position } from 'unist';
diff --git a/packages/core/src/markdown/position-slice.ts b/packages/core/src/markdown/position-slice.ts
index 240be90e6..50a193a16 100644
--- a/packages/core/src/markdown/position-slice.ts
+++ b/packages/core/src/markdown/position-slice.ts
@@ -1,4 +1,3 @@
-
import type { Nodes, Root } from 'mdast';
import { visit } from 'unist-util-visit';
import type { VFile } from 'vfile';
@@ -467,8 +466,7 @@ export function applyPositionSliceToNode(
const first = source[startOff];
if (first !== '[' && first !== '<' && !node.title) {
node.data.sourceStyle = 'gfm-autolink';
- }
- else if (first === '[') {
+ } else if (first === '[') {
const slice = source.slice(startOff, endOff);
const closeBracketIdx = slice.lastIndexOf('](');
if (closeBracketIdx !== -1) {
diff --git a/packages/core/src/markdown/rehype-plugins/skip-notion-whitespace.ts b/packages/core/src/markdown/rehype-plugins/skip-notion-whitespace.ts
index ca225ce9b..db10fa54b 100644
--- a/packages/core/src/markdown/rehype-plugins/skip-notion-whitespace.ts
+++ b/packages/core/src/markdown/rehype-plugins/skip-notion-whitespace.ts
@@ -1,4 +1,3 @@
-
import type { Comment, Element, Root, Text } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-cocoa-meta.ts b/packages/core/src/markdown/rehype-plugins/strip-cocoa-meta.ts
index 3a2524a9a..34068d103 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-cocoa-meta.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-cocoa-meta.ts
@@ -1,4 +1,3 @@
-
import type { Element, ElementContent, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-gdocs-wrapper.ts b/packages/core/src/markdown/rehype-plugins/strip-gdocs-wrapper.ts
index 2279a0189..93151d43b 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-gdocs-wrapper.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-gdocs-wrapper.ts
@@ -1,4 +1,3 @@
-
import type { Element, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-github-hovercard.ts b/packages/core/src/markdown/rehype-plugins/strip-github-hovercard.ts
index a0f467c42..188f02d83 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-github-hovercard.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-github-hovercard.ts
@@ -1,4 +1,3 @@
-
import type { Element, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-gmail-classes.ts b/packages/core/src/markdown/rehype-plugins/strip-gmail-classes.ts
index 4e8542a21..4ba2c3418 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-gmail-classes.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-gmail-classes.ts
@@ -1,4 +1,3 @@
-
import type { Element, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-gsheets-wrapper.ts b/packages/core/src/markdown/rehype-plugins/strip-gsheets-wrapper.ts
index a3c96b24a..1a74b1272 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-gsheets-wrapper.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-gsheets-wrapper.ts
@@ -1,4 +1,3 @@
-
import type { Element, ElementContent, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-mso-styles.ts b/packages/core/src/markdown/rehype-plugins/strip-mso-styles.ts
index e95cf43d6..de35e7b79 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-mso-styles.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-mso-styles.ts
@@ -1,4 +1,3 @@
-
import type { Comment, Element, ElementContent, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-slack-classes.ts b/packages/core/src/markdown/rehype-plugins/strip-slack-classes.ts
index ffdb4d5b5..b4be1b2ea 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-slack-classes.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-slack-classes.ts
@@ -1,4 +1,3 @@
-
import type { Element, ElementContent, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-vscode-spans.ts b/packages/core/src/markdown/rehype-plugins/strip-vscode-spans.ts
index e2a96d1a7..3c8d88b7c 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-vscode-spans.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-vscode-spans.ts
@@ -1,4 +1,3 @@
-
import type { Element, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/resolve-image-url.ts b/packages/core/src/markdown/resolve-image-url.ts
index 0389575ac..cf2c9da8e 100644
--- a/packages/core/src/markdown/resolve-image-url.ts
+++ b/packages/core/src/markdown/resolve-image-url.ts
@@ -1,4 +1,3 @@
-
import { isRelativeUrl } from './safe-url.ts';
function isDevDiagnosticContext(): boolean {
diff --git a/packages/core/src/markdown/safe-url.ts b/packages/core/src/markdown/safe-url.ts
index 8be632ba4..4d3250d3a 100644
--- a/packages/core/src/markdown/safe-url.ts
+++ b/packages/core/src/markdown/safe-url.ts
@@ -1,4 +1,3 @@
-
export const SAFE_URL_SCHEMES = ['https', 'http', 'mailto', 'tel', 'ftp', 'sms'] as const;
const SCHEME_ALT = SAFE_URL_SCHEMES.map((s) => `${s}:`).join('|');
diff --git a/packages/core/src/markdown/serialize-helpers.ts b/packages/core/src/markdown/serialize-helpers.ts
index 542204403..46cc6a074 100644
--- a/packages/core/src/markdown/serialize-helpers.ts
+++ b/packages/core/src/markdown/serialize-helpers.ts
@@ -1,4 +1,3 @@
-
import type { Node as PmNode } from '@tiptap/pm/model';
import type { MdxJsxAttribute, MdxJsxExpressionAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
import type { PropDef, SerializeContext } from '../registry/types.ts';
diff --git a/packages/core/src/markdown/single-dollar-math-promoter.ts b/packages/core/src/markdown/single-dollar-math-promoter.ts
index fe73659e6..be97d4d62 100644
--- a/packages/core/src/markdown/single-dollar-math-promoter.ts
+++ b/packages/core/src/markdown/single-dollar-math-promoter.ts
@@ -1,4 +1,3 @@
-
import type { PhrasingContent, Root, Text } from 'mdast';
import type { InlineMath } from 'mdast-util-math';
import { SKIP, visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/to-markdown-handlers.ts b/packages/core/src/markdown/to-markdown-handlers.ts
index e1161455b..1a2fb5d50 100644
--- a/packages/core/src/markdown/to-markdown-handlers.ts
+++ b/packages/core/src/markdown/to-markdown-handlers.ts
@@ -1,4 +1,3 @@
-
import type { Nodes, Parents } from 'mdast';
import type { MdxJsxAttribute, MdxJsxExpressionAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
import type { Handle, Info, State } from 'mdast-util-to-markdown';
diff --git a/packages/core/src/markdown/unknown-mdast-guard.ts b/packages/core/src/markdown/unknown-mdast-guard.ts
index c5bfd2386..cd245c38c 100644
--- a/packages/core/src/markdown/unknown-mdast-guard.ts
+++ b/packages/core/src/markdown/unknown-mdast-guard.ts
@@ -1,4 +1,3 @@
-
import type { Root as MdastRoot } from 'mdast';
import type { VFile } from 'vfile';
diff --git a/packages/core/src/markdown/whitespace-char-ref.ts b/packages/core/src/markdown/whitespace-char-ref.ts
index 1b75ba564..a100cad76 100644
--- a/packages/core/src/markdown/whitespace-char-ref.ts
+++ b/packages/core/src/markdown/whitespace-char-ref.ts
@@ -1,4 +1,3 @@
-
const INLINE_WHITESPACE_BY_CODE: ReadonlyMap<number, string> = new Map([
[0x20, ' '],
[0x09, '\t'],
diff --git a/packages/core/src/markdown/wiki-link-micromark.ts b/packages/core/src/markdown/wiki-link-micromark.ts
index afd9936fe..6dad26200 100644
--- a/packages/core/src/markdown/wiki-link-micromark.ts
+++ b/packages/core/src/markdown/wiki-link-micromark.ts
@@ -17,7 +17,6 @@ declare module 'micromark-util-types' {
}
}
-
const CODE_BANG = 33; // !
const CODE_LBRACKET = 91; // [
const CODE_RBRACKET = 93; // ]
@@ -261,7 +260,6 @@ export function wikiLinkSyntax(): Extension {
};
}
-
function enterWikiLink(this: CompileContext, token: Token) {
this.enter(
{
@@ -387,7 +385,6 @@ export const wikiLinkToMarkdown: {
unsafe: [{ character: '[', inConstruct: ['phrasing'] }],
};
-
const MICROMARK_EXT = wikiLinkSyntax();
export function remarkWikiLink(this: Processor) {