Merge branch 'main' into feat/llm-tool-improvement

This commit is contained in:
Jon Fuller 2025-06-30 11:32:26 -07:00 committed by GitHub
commit c119ffe478
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
34 changed files with 1046 additions and 1025 deletions

View File

@ -91,5 +91,5 @@ async function start() {
} }
// @TriliumNextTODO sqlInit.dbReady never seems to resolve so program hangs // @TriliumNextTODO sqlInit.dbReady never seems to resolve so program hangs
// see https://github.com/TriliumNext/Notes/issues/1020 // see https://github.com/TriliumNext/Trilium/issues/1020
sqlInit.dbReady.then(cls.wrap(start)).catch((err) => console.error(err)); sqlInit.dbReady.then(cls.wrap(start)).catch((err) => console.error(err));

View File

@ -8,5 +8,5 @@ test("Displays update badge when there is a version available", async ({ page })
await page.getByText(`Version ${expectedVersion} is available,`).click(); await page.getByText(`Version ${expectedVersion} is available,`).click();
const page1 = await page.waitForEvent("popup"); const page1 = await page.waitForEvent("popup");
expect(page1.url()).toBe(`https://github.com/TriliumNext/Notes/releases/tag/v${expectedVersion}`); expect(page1.url()).toBe(`https://github.com/TriliumNext/Trilium/releases/tag/v${expectedVersion}`);
}); });

View File

@ -424,7 +424,7 @@ export default class GlobalMenuWidget extends BasicWidget {
} }
downloadLatestVersionCommand() { downloadLatestVersionCommand() {
window.open("https://github.com/TriliumNext/Notes/releases/latest"); window.open("https://github.com/TriliumNext/Trilium/releases/latest");
} }
activeContextChangedEvent() { activeContextChangedEvent() {

View File

@ -27,7 +27,7 @@ const TPL = /*html*/`
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<th>${t("about.homepage")}</th> <th>${t("about.homepage")}</th>
<td><a class="tn-link" href="https://github.com/TriliumNext/Notes" class="external">https://github.com/TriliumNext/Notes</a></td> <td><a class="tn-link" href="https://github.com/TriliumNext/Trilium" class="external">https://github.com/TriliumNext/Trilium</a></td>
</tr> </tr>
<tr> <tr>
<th>${t("about.app_version")}</th> <th>${t("about.app_version")}</th>
@ -92,7 +92,7 @@ export default class AboutDialog extends BasicWidget {
this.$syncVersion.text(appInfo.syncVersion.toString()); this.$syncVersion.text(appInfo.syncVersion.toString());
this.$buildDate.text(formatDateTime(appInfo.buildDate)); this.$buildDate.text(formatDateTime(appInfo.buildDate));
this.$buildRevision.text(appInfo.buildRevision); this.$buildRevision.text(appInfo.buildRevision);
this.$buildRevision.attr("href", `https://github.com/TriliumNext/Notes/commit/${appInfo.buildRevision}`); this.$buildRevision.attr("href", `https://github.com/TriliumNext/Trilium/commit/${appInfo.buildRevision}`);
if (utils.isElectron()) { if (utils.isElectron()) {
this.$dataDirectory.html( this.$dataDirectory.html(
$("<a></a>", { $("<a></a>", {

View File

@ -41,9 +41,9 @@ export default class IncorrectCpuArchDialog extends BasicWidget {
// Open the releases page where users can download the correct version // Open the releases page where users can download the correct version
if (utils.isElectron()) { if (utils.isElectron()) {
const { shell } = utils.dynamicRequire("electron"); const { shell } = utils.dynamicRequire("electron");
shell.openExternal("https://github.com/TriliumNext/Notes/releases/latest"); shell.openExternal("https://github.com/TriliumNext/Trilium/releases/latest");
} else { } else {
window.open("https://github.com/TriliumNext/Notes/releases/latest", "_blank"); window.open("https://github.com/TriliumNext/Trilium/releases/latest", "_blank");
} }
}); });

View File

@ -74,7 +74,7 @@ export const DEFAULT_ALLOWED_TAGS = [
"del", "del",
"ins", "ins",
"en-media", // for ENEX import "en-media", // for ENEX import
// Additional tags (https://github.com/TriliumNext/Notes/issues/567) // Additional tags (https://github.com/TriliumNext/Trilium/issues/567)
"acronym", "acronym",
"article", "article",
"big", "big",

View File

@ -18,7 +18,7 @@
} }
}, },
"devDependencies": { "devDependencies": {
"dotenv": "16.5.0", "dotenv": "16.6.0",
"electron": "36.5.0" "electron": "36.6.0"
} }
} }

View File

@ -17,7 +17,7 @@
"@types/electron-squirrel-startup": "1.0.2", "@types/electron-squirrel-startup": "1.0.2",
"@triliumnext/server": "workspace:*", "@triliumnext/server": "workspace:*",
"copy-webpack-plugin": "13.0.0", "copy-webpack-plugin": "13.0.0",
"electron": "36.5.0", "electron": "36.6.0",
"@electron-forge/cli": "7.8.1", "@electron-forge/cli": "7.8.1",
"@electron-forge/maker-deb": "7.8.1", "@electron-forge/maker-deb": "7.8.1",
"@electron-forge/maker-dmg": "7.8.1", "@electron-forge/maker-dmg": "7.8.1",

View File

@ -12,7 +12,7 @@
"@triliumnext/desktop": "workspace:*", "@triliumnext/desktop": "workspace:*",
"@types/fs-extra": "11.0.4", "@types/fs-extra": "11.0.4",
"copy-webpack-plugin": "13.0.0", "copy-webpack-plugin": "13.0.0",
"electron": "36.5.0", "electron": "36.6.0",
"fs-extra": "11.3.0" "fs-extra": "11.3.0"
}, },
"nx": { "nx": {

View File

@ -17,6 +17,6 @@
} }
}, },
"devDependencies": { "devDependencies": {
"dotenv": "16.5.0" "dotenv": "16.6.0"
} }
} }

View File

@ -59,7 +59,7 @@
"debounce": "2.2.0", "debounce": "2.2.0",
"debug": "4.4.1", "debug": "4.4.1",
"ejs": "3.1.10", "ejs": "3.1.10",
"electron": "36.5.0", "electron": "36.6.0",
"electron-debug": "4.1.0", "electron-debug": "4.1.0",
"electron-window-state": "5.0.3", "electron-window-state": "5.0.3",
"escape-html": "1.0.3", "escape-html": "1.0.3",
@ -88,7 +88,7 @@
"multer": "2.0.1", "multer": "2.0.1",
"normalize-strings": "1.1.1", "normalize-strings": "1.1.1",
"ollama": "0.5.16", "ollama": "0.5.16",
"openai": "5.7.0", "openai": "5.8.1",
"rand-token": "1.0.1", "rand-token": "1.0.1",
"safe-compare": "1.1.4", "safe-compare": "1.1.4",
"sanitize-filename": "1.6.3", "sanitize-filename": "1.6.3",

View File

@ -0,0 +1,22 @@
import BRevision from "./brevision.js";
describe("Revision", () => {
it("handles note with empty title properly", () => {
const revision = new BRevision({
revisionId: "4omM5OvlLhOw",
noteId: "WHMg7iFCRG3Z",
type: "text",
mime: "text/html",
isProtected: false,
title: "",
blobId: "",
dateLastEdited: "2025-06-27 14:10:39.688+0300",
dateCreated: "2025-06-27 14:10:39.688+0300",
utcDateLastEdited: "2025-06-27 14:10:39.688+0300",
utcDateCreated: "2025-06-27 14:10:39.688+0300",
utcDateModified: "2025-06-27 14:10:39.688+0300"
});
const pojo = revision.getPojo();
expect(pojo.title).toBeDefined();
});
});

View File

@ -192,7 +192,7 @@ class BRevision extends AbstractBeccaEntity<BRevision> {
type: this.type, type: this.type,
mime: this.mime, mime: this.mime,
isProtected: this.isProtected, isProtected: this.isProtected,
title: this.title || undefined, title: this.title,
blobId: this.blobId, blobId: this.blobId,
dateLastEdited: this.dateLastEdited, dateLastEdited: this.dateLastEdited,
dateCreated: this.dateCreated, dateCreated: this.dateCreated,
@ -211,10 +211,10 @@ class BRevision extends AbstractBeccaEntity<BRevision> {
if (pojo.isProtected) { if (pojo.isProtected) {
if (protectedSessionService.isProtectedSessionAvailable()) { if (protectedSessionService.isProtectedSessionAvailable()) {
pojo.title = protectedSessionService.encrypt(this.title) || undefined; pojo.title = protectedSessionService.encrypt(this.title) ?? "";
} else { } else {
// updating protected note outside of protected session means we will keep original ciphertexts // updating protected note outside of protected session means we will keep original ciphertexts
delete pojo.title; pojo.title = "";
} }
} }

View File

@ -8,7 +8,7 @@ import appInfo from "../../services/app_info.js";
* operationId: app-info * operationId: app-info
* externalDocs: * externalDocs:
* description: Server implementation * description: Server implementation
* url: https://github.com/TriliumNext/Notes/blob/v0.91.6/src/services/app_info.ts * url: https://github.com/TriliumNext/Trilium/blob/v0.91.6/src/services/app_info.ts
* responses: * responses:
* '200': * '200':
* description: Installation info * description: Installation info

View File

@ -25,7 +25,7 @@ import type { Request } from "express";
* operationId: login-sync * operationId: login-sync
* externalDocs: * externalDocs:
* description: HMAC calculation * description: HMAC calculation
* url: https://github.com/TriliumNext/Notes/blob/v0.91.6/src/services/utils.ts#L62-L66 * url: https://github.com/TriliumNext/Trilium/blob/v0.91.6/src/services/utils.ts#L62-L66
* requestBody: * requestBody:
* content: * content:
* application/json: * application/json:

View File

@ -95,7 +95,7 @@ function forceFullSync() {
* operationId: sync-changed * operationId: sync-changed
* externalDocs: * externalDocs:
* description: Server implementation * description: Server implementation
* url: https://github.com/TriliumNext/Notes/blob/v0.91.6/src/routes/api/sync.ts * url: https://github.com/TriliumNext/Trilium/blob/v0.91.6/src/routes/api/sync.ts
* parameters: * parameters:
* - in: query * - in: query
* name: instanceId * name: instanceId
@ -214,7 +214,7 @@ const partialRequests: Record<
* operationId: sync-update * operationId: sync-update
* externalDocs: * externalDocs:
* description: Server implementation * description: Server implementation
* url: https://github.com/TriliumNext/Notes/blob/v0.91.6/src/routes/api/sync.ts * url: https://github.com/TriliumNext/Trilium/blob/v0.91.6/src/routes/api/sync.ts
* parameters: * parameters:
* - in: header * - in: header
* name: pageCount * name: pageCount

View File

@ -136,7 +136,7 @@ function getNotesAndBranchesAndAttributes(_noteIds: string[] | Set<string>) {
* operationId: tree * operationId: tree
* externalDocs: * externalDocs:
* description: Server implementation * description: Server implementation
* url: https://github.com/TriliumNext/Notes/blob/v0.91.6/src/routes/api/tree.ts * url: https://github.com/TriliumNext/Trilium/blob/v0.91.6/src/routes/api/tree.ts
* parameters: * parameters:
* - in: query * - in: query
* name: subTreeNoteId * name: subTreeNoteId

View File

@ -8,7 +8,7 @@ const doubleCsrfUtilities = doubleCsrf({
path: "/", path: "/",
secure: false, secure: false,
sameSite: "strict", sameSite: "strict",
httpOnly: !isElectron // set to false for Electron, see https://github.com/TriliumNext/Notes/pull/966 httpOnly: !isElectron // set to false for Electron, see https://github.com/TriliumNext/Trilium/pull/966
}, },
cookieName: "_csrf" cookieName: "_csrf"
}); });

View File

@ -77,7 +77,7 @@ function setPassword(req: Request, res: Response) {
* operationId: login-normal * operationId: login-normal
* externalDocs: * externalDocs:
* description: HMAC calculation * description: HMAC calculation
* url: https://github.com/TriliumNext/Notes/blob/v0.91.6/src/services/utils.ts#L62-L66 * url: https://github.com/TriliumNext/Trilium/blob/v0.91.6/src/services/utils.ts#L62-L66
* requestBody: * requestBody:
* content: * content:
* application/x-www-form-urlencoded: * application/x-www-form-urlencoded:

View File

@ -293,25 +293,25 @@ describe("Markdown export", () => {
const html = trimIndentation`\ const html = trimIndentation`\
<ul> <ul>
<li><a href="https://github.com/JYC333">@JYC333</a> made their first contribution <li><a href="https://github.com/JYC333">@JYC333</a> made their first contribution
in <a href="https://github.com/TriliumNext/Notes/pull/294">#294</a> in <a href="https://github.com/TriliumNext/Trilium/pull/294">#294</a>
</li> </li>
<li> <li>
<p><a href="https://github.com/TriliumNext/Notes/issues/375">Note Tooltip isn't removed when clicking on internal trilium link in read-only mode</a> <p><a href="https://github.com/TriliumNext/Trilium/issues/375">Note Tooltip isn't removed when clicking on internal trilium link in read-only mode</a>
</p> </p>
</li> </li>
<li> <li>
<p><a href="https://github.com/TriliumNext/Notes/issues/384">Calendar dropdown won't close if click/right-click other button that open notes from launcher bar</a> <p><a href="https://github.com/TriliumNext/Trilium/issues/384">Calendar dropdown won't close if click/right-click other button that open notes from launcher bar</a>
</p> </p>
</li> </li>
</ul> </ul>
`; `;
const expected = trimIndentation`\ const expected = trimIndentation`\
* [@JYC333](https://github.com/JYC333) made their first contribution in [#294](https://github.com/TriliumNext/Notes/pull/294) * [@JYC333](https://github.com/JYC333) made their first contribution in [#294](https://github.com/TriliumNext/Trilium/pull/294)
* [Note Tooltip isn't removed when clicking on internal trilium link in read-only mode](https://github.com/TriliumNext/Notes/issues/375) * [Note Tooltip isn't removed when clicking on internal trilium link in read-only mode](https://github.com/TriliumNext/Trilium/issues/375)
* [Calendar dropdown won't close if click/right-click other button that open notes from launcher bar](https://github.com/TriliumNext/Notes/issues/384)`; * [Calendar dropdown won't close if click/right-click other button that open notes from launcher bar](https://github.com/TriliumNext/Trilium/issues/384)`;
expect(markdownExportService.toMarkdown(html)).toBe(expected); expect(markdownExportService.toMarkdown(html)).toBe(expected);
}); });

View File

@ -84,7 +84,7 @@ export const DEFAULT_ALLOWED_TAGS = [
"del", "del",
"ins", "ins",
"en-media", // for ENEX import "en-media", // for ENEX import
// Additional tags (https://github.com/TriliumNext/Notes/issues/567) // Additional tags (https://github.com/TriliumNext/Trilium/issues/567)
"acronym", "acronym",
"article", "article",
"big", "big",

View File

@ -259,15 +259,15 @@ $$`;
const input = trimIndentation`\ const input = trimIndentation`\
### 🐞 Bugfixes ### 🐞 Bugfixes
* [v0.90.4 docker does not read USER\_UID and USER\_GID from environment](https://github.com/TriliumNext/Notes/issues/331) * [v0.90.4 docker does not read USER\_UID and USER\_GID from environment](https://github.com/TriliumNext/Trilium/issues/331)
* [Invalid CSRF token on Android phone](https://github.com/TriliumNext/Notes/issues/318) * [Invalid CSRF token on Android phone](https://github.com/TriliumNext/Trilium/issues/318)
* [Excess spacing in lists](https://github.com/TriliumNext/Notes/issues/341)`; * [Excess spacing in lists](https://github.com/TriliumNext/Trilium/issues/341)`;
const expected = [ const expected = [
/*html*/`<h3>🐞 Bugfixes</h3>`, /*html*/`<h3>🐞 Bugfixes</h3>`,
/*html*/`<ul>`, /*html*/`<ul>`,
/*html*/`<li><a href="https://github.com/TriliumNext/Notes/issues/331">v0.90.4 docker does not read USER_UID and USER_GID from environment</a></li>`, /*html*/`<li><a href="https://github.com/TriliumNext/Trilium/issues/331">v0.90.4 docker does not read USER_UID and USER_GID from environment</a></li>`,
/*html*/`<li><a href="https://github.com/TriliumNext/Notes/issues/318">Invalid CSRF token on Android phone</a></li>`, /*html*/`<li><a href="https://github.com/TriliumNext/Trilium/issues/318">Invalid CSRF token on Android phone</a></li>`,
/*html*/`<li><a href="https://github.com/TriliumNext/Notes/issues/341">Excess spacing in lists</a></li>`, /*html*/`<li><a href="https://github.com/TriliumNext/Trilium/issues/341">Excess spacing in lists</a></li>`,
/*html*/`</ul>` /*html*/`</ul>`
].join(""); ].join("");
expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected); expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected);

View File

@ -117,11 +117,11 @@ export const downloadMatrix: DownloadMatrix = {
}, },
tarX64: { tarX64: {
name: "x86 (.tar.xz)", name: "x86 (.tar.xz)",
url: `https://github.com/TriliumNext/Notes/releases/download/v${version}/TriliumNotes-Server-v${version}-linux-x64.tar.xz` url: `https://github.com/TriliumNext/Trilium/releases/download/v${version}/TriliumNotes-Server-v${version}-linux-x64.tar.xz`
}, },
tarArm64: { tarArm64: {
name: "ARM (.tar.xz)", name: "ARM (.tar.xz)",
url: `https://github.com/TriliumNext/Notes/releases/download/v${version}/TriliumNotes-Server-v${version}-linux-arm64.tar.xz` url: `https://github.com/TriliumNext/Trilium/releases/download/v${version}/TriliumNotes-Server-v${version}-linux-arm64.tar.xz`
}, },
nixos: { nixos: {
name: "NixOS module", name: "NixOS module",
@ -150,7 +150,7 @@ export const downloadMatrix: DownloadMatrix = {
export function buildDownloadUrl(app: App, platform: Platform, format: string, architecture: Architecture): string { export function buildDownloadUrl(app: App, platform: Platform, format: string, architecture: Architecture): string {
if (app === "desktop") { if (app === "desktop") {
return downloadMatrix.desktop[platform]?.downloads[format].url ?? return downloadMatrix.desktop[platform]?.downloads[format].url ??
`https://github.com/TriliumNext/Notes/releases/download/v${version}/TriliumNotes-v${version}-${platform}-${architecture}.${format}`; `https://github.com/TriliumNext/Trilium/releases/download/v${version}/TriliumNotes-v${version}-${platform}-${architecture}.${format}`;
} else if (app === "server") { } else if (app === "server") {
return downloadMatrix.server[platform]?.downloads[format].url ?? "#"; return downloadMatrix.server[platform]?.downloads[format].url ?? "#";
} else { } else {

View File

@ -80,7 +80,7 @@
"url": "https://github.com/TriliumNext/Notes/issues" "url": "https://github.com/TriliumNext/Notes/issues"
}, },
"homepage": "https://github.com/TriliumNext/Notes#readme", "homepage": "https://github.com/TriliumNext/Notes#readme",
"packageManager": "pnpm@10.12.3", "packageManager": "pnpm@10.12.4",
"pnpm": { "pnpm": {
"patchedDependencies": { "patchedDependencies": {
"@ckeditor/ckeditor5-mention": "patches/@ckeditor__ckeditor5-mention.patch", "@ckeditor/ckeditor5-mention": "patches/@ckeditor__ckeditor5-mention.patch",

View File

@ -32,14 +32,14 @@
"ckeditor5-metadata.json" "ckeditor5-metadata.json"
], ],
"devDependencies": { "devDependencies": {
"@ckeditor/ckeditor5-dev-build-tools": "43.0.1", "@ckeditor/ckeditor5-dev-build-tools": "43.1.0",
"@ckeditor/ckeditor5-inspector": ">=4.1.0", "@ckeditor/ckeditor5-inspector": ">=4.1.0",
"@ckeditor/ckeditor5-package-tools": "^4.0.0", "@ckeditor/ckeditor5-package-tools": "^4.0.0",
"@typescript-eslint/eslint-plugin": "~8.35.0", "@typescript-eslint/eslint-plugin": "~8.35.0",
"@typescript-eslint/parser": "^8.0.0", "@typescript-eslint/parser": "^8.0.0",
"@vitest/browser": "^3.0.5", "@vitest/browser": "^3.0.5",
"@vitest/coverage-istanbul": "^3.0.5", "@vitest/coverage-istanbul": "^3.0.5",
"ckeditor5": "45.2.0", "ckeditor5": "45.2.1",
"eslint": "^9.0.0", "eslint": "^9.0.0",
"eslint-config-ckeditor5": ">=9.1.0", "eslint-config-ckeditor5": ">=9.1.0",
"http-server": "^14.1.0", "http-server": "^14.1.0",
@ -53,7 +53,7 @@
"webdriverio": "^9.0.7" "webdriverio": "^9.0.7"
}, },
"peerDependencies": { "peerDependencies": {
"ckeditor5": "45.2.0" "ckeditor5": "45.2.1"
}, },
"author": "Elian Doran <contact@eliandoran.me>", "author": "Elian Doran <contact@eliandoran.me>",
"license": "GPL-2.0-or-later", "license": "GPL-2.0-or-later",

View File

@ -33,14 +33,14 @@
"ckeditor5-metadata.json" "ckeditor5-metadata.json"
], ],
"devDependencies": { "devDependencies": {
"@ckeditor/ckeditor5-dev-build-tools": "43.0.1", "@ckeditor/ckeditor5-dev-build-tools": "43.1.0",
"@ckeditor/ckeditor5-inspector": ">=4.1.0", "@ckeditor/ckeditor5-inspector": ">=4.1.0",
"@ckeditor/ckeditor5-package-tools": "^4.0.0", "@ckeditor/ckeditor5-package-tools": "^4.0.0",
"@typescript-eslint/eslint-plugin": "~8.35.0", "@typescript-eslint/eslint-plugin": "~8.35.0",
"@typescript-eslint/parser": "^8.0.0", "@typescript-eslint/parser": "^8.0.0",
"@vitest/browser": "^3.0.5", "@vitest/browser": "^3.0.5",
"@vitest/coverage-istanbul": "^3.0.5", "@vitest/coverage-istanbul": "^3.0.5",
"ckeditor5": "45.2.0", "ckeditor5": "45.2.1",
"eslint": "^9.0.0", "eslint": "^9.0.0",
"eslint-config-ckeditor5": ">=9.1.0", "eslint-config-ckeditor5": ">=9.1.0",
"http-server": "^14.1.0", "http-server": "^14.1.0",
@ -54,7 +54,7 @@
"webdriverio": "^9.0.7" "webdriverio": "^9.0.7"
}, },
"peerDependencies": { "peerDependencies": {
"ckeditor5": "45.2.0" "ckeditor5": "45.2.1"
}, },
"scripts": { "scripts": {
"build": "node ./scripts/build-dist.mjs", "build": "node ./scripts/build-dist.mjs",

View File

@ -35,14 +35,14 @@
"ckeditor5-metadata.json" "ckeditor5-metadata.json"
], ],
"devDependencies": { "devDependencies": {
"@ckeditor/ckeditor5-dev-build-tools": "43.0.1", "@ckeditor/ckeditor5-dev-build-tools": "43.1.0",
"@ckeditor/ckeditor5-inspector": ">=4.1.0", "@ckeditor/ckeditor5-inspector": ">=4.1.0",
"@ckeditor/ckeditor5-package-tools": "^4.0.0", "@ckeditor/ckeditor5-package-tools": "^4.0.0",
"@typescript-eslint/eslint-plugin": "~8.35.0", "@typescript-eslint/eslint-plugin": "~8.35.0",
"@typescript-eslint/parser": "^8.0.0", "@typescript-eslint/parser": "^8.0.0",
"@vitest/browser": "^3.0.5", "@vitest/browser": "^3.0.5",
"@vitest/coverage-istanbul": "^3.0.5", "@vitest/coverage-istanbul": "^3.0.5",
"ckeditor5": "45.2.0", "ckeditor5": "45.2.1",
"eslint": "^9.0.0", "eslint": "^9.0.0",
"eslint-config-ckeditor5": ">=9.1.0", "eslint-config-ckeditor5": ">=9.1.0",
"http-server": "^14.1.0", "http-server": "^14.1.0",
@ -56,7 +56,7 @@
"webdriverio": "^9.0.7" "webdriverio": "^9.0.7"
}, },
"peerDependencies": { "peerDependencies": {
"ckeditor5": "45.2.0" "ckeditor5": "45.2.1"
}, },
"scripts": { "scripts": {
"build": "node ./scripts/build-dist.mjs", "build": "node ./scripts/build-dist.mjs",

View File

@ -35,15 +35,15 @@
"ckeditor5-metadata.json" "ckeditor5-metadata.json"
], ],
"devDependencies": { "devDependencies": {
"@ckeditor/ckeditor5-dev-build-tools": "43.0.1", "@ckeditor/ckeditor5-dev-build-tools": "43.1.0",
"@ckeditor/ckeditor5-dev-utils": "43.0.1", "@ckeditor/ckeditor5-dev-utils": "43.1.0",
"@ckeditor/ckeditor5-inspector": ">=4.1.0", "@ckeditor/ckeditor5-inspector": ">=4.1.0",
"@ckeditor/ckeditor5-package-tools": "^4.0.0", "@ckeditor/ckeditor5-package-tools": "^4.0.0",
"@typescript-eslint/eslint-plugin": "~8.35.0", "@typescript-eslint/eslint-plugin": "~8.35.0",
"@typescript-eslint/parser": "^8.0.0", "@typescript-eslint/parser": "^8.0.0",
"@vitest/browser": "^3.0.5", "@vitest/browser": "^3.0.5",
"@vitest/coverage-istanbul": "^3.0.5", "@vitest/coverage-istanbul": "^3.0.5",
"ckeditor5": "45.2.0", "ckeditor5": "45.2.1",
"eslint": "^9.0.0", "eslint": "^9.0.0",
"eslint-config-ckeditor5": ">=9.1.0", "eslint-config-ckeditor5": ">=9.1.0",
"http-server": "^14.1.0", "http-server": "^14.1.0",
@ -57,7 +57,7 @@
"webdriverio": "^9.0.7" "webdriverio": "^9.0.7"
}, },
"peerDependencies": { "peerDependencies": {
"ckeditor5": "45.2.0" "ckeditor5": "45.2.1"
}, },
"scripts": { "scripts": {
"build": "node ./scripts/build-dist.mjs", "build": "node ./scripts/build-dist.mjs",
@ -90,6 +90,6 @@
} }
}, },
"dependencies": { "dependencies": {
"@ckeditor/ckeditor5-icons": "45.2.0" "@ckeditor/ckeditor5-icons": "45.2.1"
} }
} }

View File

@ -35,14 +35,14 @@
"ckeditor5-metadata.json" "ckeditor5-metadata.json"
], ],
"devDependencies": { "devDependencies": {
"@ckeditor/ckeditor5-dev-build-tools": "43.0.1", "@ckeditor/ckeditor5-dev-build-tools": "43.1.0",
"@ckeditor/ckeditor5-inspector": ">=4.1.0", "@ckeditor/ckeditor5-inspector": ">=4.1.0",
"@ckeditor/ckeditor5-package-tools": "^4.0.0", "@ckeditor/ckeditor5-package-tools": "^4.0.0",
"@typescript-eslint/eslint-plugin": "~8.35.0", "@typescript-eslint/eslint-plugin": "~8.35.0",
"@typescript-eslint/parser": "^8.0.0", "@typescript-eslint/parser": "^8.0.0",
"@vitest/browser": "^3.0.5", "@vitest/browser": "^3.0.5",
"@vitest/coverage-istanbul": "^3.0.5", "@vitest/coverage-istanbul": "^3.0.5",
"ckeditor5": "45.2.0", "ckeditor5": "45.2.1",
"eslint": "^9.0.0", "eslint": "^9.0.0",
"eslint-config-ckeditor5": ">=9.1.0", "eslint-config-ckeditor5": ">=9.1.0",
"http-server": "^14.1.0", "http-server": "^14.1.0",
@ -56,7 +56,7 @@
"webdriverio": "^9.0.7" "webdriverio": "^9.0.7"
}, },
"peerDependencies": { "peerDependencies": {
"ckeditor5": "45.2.0" "ckeditor5": "45.2.1"
}, },
"scripts": { "scripts": {
"build": "node ./scripts/build-dist.mjs", "build": "node ./scripts/build-dist.mjs",

View File

@ -35,8 +35,8 @@
"@triliumnext/ckeditor5-keyboard-marker": "workspace:*", "@triliumnext/ckeditor5-keyboard-marker": "workspace:*",
"@triliumnext/ckeditor5-math": "workspace:*", "@triliumnext/ckeditor5-math": "workspace:*",
"@triliumnext/ckeditor5-mermaid": "workspace:*", "@triliumnext/ckeditor5-mermaid": "workspace:*",
"ckeditor5": "45.2.0", "ckeditor5": "45.2.1",
"ckeditor5-premium-features": "45.2.0" "ckeditor5-premium-features": "45.2.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jquery": "3.5.32" "@types/jquery": "3.5.32"

View File

@ -1,5 +1,5 @@
/** /**
* https://github.com/TriliumNext/Notes/issues/1002 * https://github.com/TriliumNext/Trilium/issues/1002
*/ */
import { Command, DocumentSelection, Element, Node, Plugin, Range } from 'ckeditor5'; import { Command, DocumentSelection, Element, Node, Plugin, Range } from 'ckeditor5';
@ -11,11 +11,11 @@ export default class MoveBlockUpDownPlugin extends Plugin {
editor.commands.add('moveBlockUp', new MoveBlockUpCommand(editor)); editor.commands.add('moveBlockUp', new MoveBlockUpCommand(editor));
editor.commands.add('moveBlockDown', new MoveBlockDownCommand(editor)); editor.commands.add('moveBlockDown', new MoveBlockDownCommand(editor));
// Use native DOM capturing to intercept Ctrl/Alt + ↑/↓, // Use native DOM capturing to intercept Ctrl/Alt + ↑/↓,
// as plugin-level keystroke handling may fail when the selection is near an object. // as plugin-level keystroke handling may fail when the selection is near an object.
this.bindMoveBlockShortcuts(editor); this.bindMoveBlockShortcuts(editor);
} }
bindMoveBlockShortcuts(editor: any) { bindMoveBlockShortcuts(editor: any) {
editor.editing.view.once('render', () => { editor.editing.view.once('render', () => {
const domRoot = editor.editing.view.getDomRoot(); const domRoot = editor.editing.view.getDomRoot();
@ -59,7 +59,7 @@ abstract class MoveBlockUpDownCommand extends Command {
if (!isEnabled) { if (!isEnabled) {
return; return;
} }
const movingBlocks = this.offset === 'before' const movingBlocks = this.offset === 'before'
? selectedBlocks ? selectedBlocks
: [...selectedBlocks].reverse(); : [...selectedBlocks].reverse();
@ -104,7 +104,7 @@ abstract class MoveBlockUpDownCommand extends Command {
this.scrollToSelection(); this.scrollToSelection();
}); });
} }
getSelectedBlocks(selection: DocumentSelection) { getSelectedBlocks(selection: DocumentSelection) {
const blocks = [...selection.getSelectedBlocks()]; const blocks = [...selection.getSelectedBlocks()];
const resolved: Element[] = []; const resolved: Element[] = [];
@ -129,7 +129,7 @@ abstract class MoveBlockUpDownCommand extends Command {
// Deduplicate adjacent duplicates (e.g., nested selections resolving to same block) // Deduplicate adjacent duplicates (e.g., nested selections resolving to same block)
return resolved.filter((blk, idx) => idx === 0 || blk !== resolved[idx - 1]); return resolved.filter((blk, idx) => idx === 0 || blk !== resolved[idx - 1]);
} }
scrollToSelection() { scrollToSelection() {
// Ensure scroll happens in sync with DOM updates // Ensure scroll happens in sync with DOM updates
requestAnimationFrame(() => { requestAnimationFrame(() => {

1907
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -23,10 +23,10 @@ const options = {
title: "Trilium Notes - Sync server API", title: "Trilium Notes - Sync server API",
version: packageJson["version"], version: packageJson["version"],
description: description:
"This is the internal sync server API used by Trilium Notes.\n\n_If you're looking for the officially supported External Trilium API, see [here](https://triliumnext.github.io/Docs/Wiki/etapi.html)._\n\nThis page does not yet list all routes. For a full list, see the [route controller](https://github.com/TriliumNext/Notes/blob/v0.91.6/src/routes/routes.ts).", "This is the internal sync server API used by Trilium Notes.\n\n_If you're looking for the officially supported External Trilium API, see [here](https://triliumnext.github.io/Docs/Wiki/etapi.html)._\n\nThis page does not yet list all routes. For a full list, see the [route controller](https://github.com/TriliumNext/Trilium/blob/v0.91.6/src/routes/routes.ts).",
contact: { contact: {
name: "TriliumNext issue tracker", name: "TriliumNext issue tracker",
url: "https://github.com/TriliumNext/Notes/issues" url: "https://github.com/TriliumNext/Trilium/issues"
}, },
license: { license: {
name: "GNU Free Documentation License 1.3 (or later)", name: "GNU Free Documentation License 1.3 (or later)",
@ -159,7 +159,7 @@ console.log("Saved to", outputPath);
* type: string * type: string
* example: "text" * example: "text"
* enum: ["text", "code", "render", "file", "image", "search", "relationMap", "book", "noteMap", "mermaid", "canvas", "webView", "launcher", "doc", "contentWidget", "mindMap", "geoMap"] * enum: ["text", "code", "render", "file", "image", "search", "relationMap", "book", "noteMap", "mermaid", "canvas", "webView", "launcher", "doc", "contentWidget", "mindMap", "geoMap"]
* description: "[Reference list](https://github.com/TriliumNext/Notes/blob/v0.91.6/src/services/note_types.ts)" * description: "[Reference list](https://github.com/TriliumNext/Trilium/blob/v0.91.6/src/services/note_types.ts)"
* mime: * mime:
* type: string * type: string
* example: "text/html" * example: "text/html"

View File

@ -10,7 +10,7 @@
import { type BrowserContext, chromium } from 'playwright'; import { type BrowserContext, chromium } from 'playwright';
import { createWriteStream, existsSync, readFileSync, writeFileSync } from 'fs'; import { createWriteStream, existsSync, readFileSync, writeFileSync } from 'fs';
const SOURCE_URL = "https://github.com/TriliumNext/Notes"; const SOURCE_URL = "https://github.com/TriliumNext/Trilium";
const TARGET_REPOSITORY_ID = 92111509; const TARGET_REPOSITORY_ID = 92111509;
const fsLog = createWriteStream('port-discussions.log', { flags: 'a' }); const fsLog = createWriteStream('port-discussions.log', { flags: 'a' });