Skip to content

Commit 317f6ef

Browse files
committed
Merge remote-tracking branch 'origin/main' into autocomplete
; Conflicts: ; pnpm-lock.yaml
2 parents 39daca0 + ba87487 commit 317f6ef

File tree

130 files changed

+10855
-6063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+10855
-6063
lines changed

.github/actions/report-size/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ runs:
6969

7070
# Post github action comment
7171
- name: Post comment
72-
uses: marocchino/sticky-pull-request-comment@v2
72+
uses: marocchino/sticky-pull-request-comment@v3
7373
if: ${{ steps.bundleSize.outputs.hasDifferences == 'true' }} # post only in case of changes
7474
with:
7575
number: ${{ github.event.pull_request.number }}

.github/workflows/dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
key: ${{ secrets.RELATIVE_CI_CLIENT_KEY }}
9090
- name: Trigger server build
9191
run: pnpm run server:build
92-
- uses: docker/setup-buildx-action@v3
92+
- uses: docker/setup-buildx-action@v4
9393
- uses: docker/build-push-action@v7
9494
with:
9595
context: apps/server
@@ -124,7 +124,7 @@ jobs:
124124
run: echo "TEST_TAG=${TEST_TAG,,}" >> $GITHUB_ENV
125125

126126
- name: Set up Docker Buildx
127-
uses: docker/setup-buildx-action@v3
127+
uses: docker/setup-buildx-action@v4
128128

129129
- name: Build and export to Docker
130130
uses: docker/build-push-action@v7

.github/workflows/main-docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: echo "TEST_TAG=${TEST_TAG,,}" >> $GITHUB_ENV
4141

4242
- name: Set up Docker Buildx
43-
uses: docker/setup-buildx-action@v3
43+
uses: docker/setup-buildx-action@v4
4444

4545
- uses: pnpm/action-setup@v4
4646
- name: Set up node & dependencies
@@ -178,7 +178,7 @@ jobs:
178178
uses: docker/setup-qemu-action@v4
179179

180180
- name: Set up Docker Buildx
181-
uses: docker/setup-buildx-action@v3
181+
uses: docker/setup-buildx-action@v4
182182

183183
- name: Login to GHCR
184184
uses: docker/login-action@v4

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ upload
4646

4747
/.direnv
4848
/result
49-
.svelte-kit
5049

5150
# docs
5251
site/

apps/build-docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"keywords": [],
1515
"author": "Elian Doran <contact@eliandoran.me>",
1616
"license": "AGPL-3.0-only",
17-
"packageManager": "pnpm@10.32.0",
17+
"packageManager": "pnpm@10.32.1",
1818
"devDependencies": {
19-
"@redocly/cli": "2.20.2",
19+
"@redocly/cli": "2.21.1",
2020
"archiver": "7.0.1",
2121
"fs-extra": "11.3.4",
2222
"js-yaml": "4.1.1",

apps/client/package.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,42 @@
3636
"@triliumnext/highlightjs": "workspace:*",
3737
"@triliumnext/share-theme": "workspace:*",
3838
"@triliumnext/split.js": "workspace:*",
39-
"@univerjs/preset-sheets-conditional-formatting": "0.16.1",
40-
"@univerjs/preset-sheets-core": "0.16.1",
41-
"@univerjs/preset-sheets-data-validation": "0.16.1",
42-
"@univerjs/preset-sheets-filter": "0.16.1",
43-
"@univerjs/preset-sheets-find-replace": "0.16.1",
44-
"@univerjs/preset-sheets-note": "0.16.1",
45-
"@univerjs/preset-sheets-sort": "0.16.1",
46-
"@univerjs/presets": "0.16.1",
39+
"@univerjs/preset-sheets-conditional-formatting": "0.17.0",
40+
"@univerjs/preset-sheets-core": "0.17.0",
41+
"@univerjs/preset-sheets-data-validation": "0.17.0",
42+
"@univerjs/preset-sheets-filter": "0.17.0",
43+
"@univerjs/preset-sheets-find-replace": "0.17.0",
44+
"@univerjs/preset-sheets-note": "0.17.0",
45+
"@univerjs/preset-sheets-sort": "0.17.0",
46+
"@univerjs/presets": "0.17.0",
4747
"@zumer/snapdom": "2.1.0",
4848
"bootstrap": "5.3.8",
4949
"boxicons": "2.1.4",
5050
"clsx": "2.1.1",
5151
"color": "5.0.3",
5252
"debounce": "3.0.0",
5353
"draggabilly": "3.0.0",
54-
"force-graph": "1.51.1",
54+
"force-graph": "1.51.2",
5555
"globals": "17.4.0",
56-
"i18next": "25.8.17",
56+
"i18next": "25.8.18",
5757
"i18next-http-backend": "3.0.2",
5858
"jquery": "4.0.0",
5959
"jquery.fancytree": "2.38.5",
6060
"jsplumb": "2.15.6",
6161
"katex": "0.16.38",
62-
"knockout": "3.5.1",
62+
"knockout": "3.5.2",
6363
"leaflet": "1.9.4",
6464
"leaflet-gpx": "2.2.0",
6565
"mark.js": "8.11.1",
6666
"marked": "17.0.4",
67-
"mermaid": "11.12.3",
67+
"mermaid": "11.13.0",
6868
"mind-elixir": "5.9.3",
6969
"normalize.css": "8.0.1",
7070
"panzoom": "9.4.3",
7171
"preact": "10.29.0",
72-
"react-i18next": "16.5.6",
72+
"react-i18next": "16.5.8",
7373
"react-window": "2.2.7",
74-
"reveal.js": "5.2.1",
74+
"reveal.js": "6.0.0",
7575
"rrule": "2.8.1",
7676
"svg-pan-zoom": "3.6.2",
7777
"tabulator-tables": "6.4.0",
@@ -85,12 +85,11 @@
8585
"@types/leaflet": "1.9.21",
8686
"@types/leaflet-gpx": "1.3.8",
8787
"@types/mark.js": "8.11.12",
88-
"@types/reveal.js": "5.2.2",
8988
"@types/tabulator-tables": "6.3.1",
9089
"copy-webpack-plugin": "14.0.0",
91-
"happy-dom": "20.8.3",
90+
"happy-dom": "20.8.4",
9291
"lightningcss": "1.32.0",
9392
"script-loader": "0.7.2",
94-
"vite-plugin-static-copy": "3.2.0"
93+
"vite-plugin-static-copy": "3.3.0"
9594
}
9695
}

apps/client/src/components/note_context.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ class NoteContext extends Component implements EventListener<"entitiesReloaded">
381381

382382
// Collections must always display a note list, even if no children.
383383
if (note.type === "book") {
384+
if (note.isProtected && !protectedSessionHolder.isProtectedSessionAvailable()) {
385+
return false;
386+
}
387+
384388
const viewType = note.getLabelValue("viewType") ?? "grid";
385389
if (!["list", "grid"].includes(viewType)) {
386390
return true;

apps/client/src/services/froca_updater.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,12 @@ function processNoteChange(loadResults: LoadResults, ec: EntityChange) {
110110
}
111111
}
112112

113-
if (ec.componentId) {
113+
// Only register as a content change if the protection status didn't change.
114+
// When isProtected changes, the blobId change is a side effect of re-encryption,
115+
// not a content edit. Registering it as content would cause the tree's content-only
116+
// filter to incorrectly skip the note update (since both changes share the same
117+
// componentId).
118+
if (ec.componentId && note.isProtected === (ec.entity as FNoteRow).isProtected) {
114119
loadResults.addNoteContent(note.noteId, ec.componentId);
115120
}
116121
}

apps/client/src/services/note_create.ts

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1+
import type { CKTextEditor } from "@triliumnext/ckeditor5";
2+
import { AttributeRow } from "@triliumnext/commons";
3+
14
import appContext from "../components/app_context.js";
5+
import type FBranch from "../entities/fbranch.js";
6+
import type FNote from "../entities/fnote.js";
7+
import type { ChooseNoteTypeResponse } from "../widgets/dialogs/note_type_chooser.js";
8+
import froca from "./froca.js";
9+
import { t } from "./i18n.js";
210
import protectedSessionHolder from "./protected_session_holder.js";
311
import server from "./server.js";
4-
import ws from "./ws.js";
5-
import froca from "./froca.js";
6-
import treeService from "./tree.js";
712
import toastService from "./toast.js";
8-
import { t } from "./i18n.js";
9-
import type FNote from "../entities/fnote.js";
10-
import type FBranch from "../entities/fbranch.js";
11-
import type { ChooseNoteTypeResponse } from "../widgets/dialogs/note_type_chooser.js";
12-
import type { CKTextEditor } from "@triliumnext/ckeditor5";
13+
import treeService from "./tree.js";
14+
import ws from "./ws.js";
1315

1416
export interface CreateNoteOpts {
1517
isProtected?: boolean;
@@ -24,6 +26,8 @@ export interface CreateNoteOpts {
2426
target?: string;
2527
targetBranchId?: string;
2628
textEditor?: CKTextEditor;
29+
/** Attributes to be set on the note. These are set atomically on note creation, so entity changes are not sent for attributes defined here. */
30+
attributes?: Omit<AttributeRow, "noteId" | "attributeId">[];
2731
}
2832

2933
interface Response {
@@ -37,7 +41,7 @@ interface DuplicateResponse {
3741
note: FNote;
3842
}
3943

40-
async function createNote(parentNotePath: string | undefined, options: CreateNoteOpts = {}) {
44+
async function createNote(parentNotePath: string | undefined, options: CreateNoteOpts = {}, componentId?: string) {
4145
options = Object.assign(
4246
{
4347
activate: true,
@@ -63,22 +67,15 @@ async function createNote(parentNotePath: string | undefined, options: CreateNot
6367

6468
const parentNoteId = treeService.getNoteIdFromUrl(parentNotePath);
6569

66-
if (options.type === "mermaid" && !options.content && !options.templateNoteId) {
67-
options.content = `graph TD;
68-
A-->B;
69-
A-->C;
70-
B-->D;
71-
C-->D;`;
72-
}
73-
7470
const { note, branch } = await server.post<Response>(`notes/${parentNoteId}/children?target=${options.target}&targetBranchId=${options.targetBranchId || ""}`, {
7571
title: options.title,
7672
content: options.content || "",
7773
isProtected: options.isProtected,
7874
type: options.type,
7975
mime: options.mime,
80-
templateNoteId: options.templateNoteId
81-
});
76+
templateNoteId: options.templateNoteId,
77+
attributes: options.attributes
78+
}, componentId);
8279

8380
if (options.saveSelection) {
8481
// we remove the selection only after it was saved to server to make sure we don't lose anything
@@ -140,9 +137,8 @@ function parseSelectedHtml(selectedHtml: string) {
140137
const content = selectedHtml.replace(dom[0].outerHTML, "");
141138

142139
return [title, content];
143-
} else {
144-
return [null, selectedHtml];
145140
}
141+
return [null, selectedHtml];
146142
}
147143

148144
async function duplicateSubtree(noteId: string, parentNotePath: string) {

apps/client/src/setup.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import "jquery";
2-
import utils from "./services/utils.js";
2+
33
import ko from "knockout";
44

5+
import utils from "./services/utils.js";
6+
57
// TriliumNextTODO: properly make use of below types
68
// type SetupModelSetupType = "new-document" | "sync-from-desktop" | "sync-from-server" | "";
79
// type SetupModelStep = "sync-in-progress" | "setup-type" | "new-document-in-progress" | "sync-from-desktop";
@@ -74,9 +76,9 @@ class SetupModel {
7476

7577
// not using server.js because it loads too many dependencies
7678
const resp = await $.post("api/setup/sync-from-server", {
77-
syncServerHost: syncServerHost,
78-
syncProxy: syncProxy,
79-
password: password
79+
syncServerHost,
80+
syncProxy,
81+
password
8082
});
8183

8284
if (resp.result === "success") {
@@ -123,6 +125,8 @@ function getSyncInProgress() {
123125
}
124126

125127
addEventListener("DOMContentLoaded", (event) => {
126-
ko.applyBindings(new SetupModel(getSyncInProgress()), document.getElementById("setup-dialog"));
128+
const rootNode = document.getElementById("setup-dialog");
129+
if (!rootNode) return;
130+
ko.applyBindings(new SetupModel(getSyncInProgress()), rootNode);
127131
$("#setup-dialog").show();
128132
});

0 commit comments

Comments
 (0)