Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 56cf993

Browse files
committed
Merge remote-tracking branch 'origin/develop' into patch-2
2 parents 1db36c5 + adc9172 commit 56cf993

33 files changed

+385
-277
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Download the repository, install dependencies using `pnpm` and then run the envi
128128
git clone https://github.com/TriliumNext/Notes.git
129129
cd Notes
130130
pnpm install
131-
pnpm nx run edit-docs:serve
131+
pnpm nx run edit-docs:edit-docs
132132
```
133133

134134
### Building the Executable

apps/client/src/stylesheets/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ button kbd {
328328
--bs-dropdown-zindex: 999;
329329
}
330330

331-
body.desktop .dropdown-menu {
331+
body.desktop .dropdown-menu.show {
332332
border: 1px solid var(--dropdown-border-color);
333333
box-shadow: 0px 10px 20px rgba(0, 0, 0, var(--dropdown-shadow-opacity));
334334
animation: dropdown-menu-opening 100ms ease-in;

apps/client/src/stylesheets/theme-next/base.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
* supported when this class is used.
9090
*/
9191

92-
.dropdown-menu:not(.static) {
92+
.dropdown-menu.show:not(.static) {
9393
border-radius: var(--dropdown-border-radius);
9494
padding: var(--menu-padding-size) !important;
9595
font-size: 0.9rem !important;

apps/client/src/widgets/buttons/create_ai_chat_button.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

apps/client/src/widgets/buttons/create_pane_button.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ export default class CreatePaneButton extends OnClickButtonWidget {
88
this.icon("bx-dock-right")
99
.title(t("create_pane_button.create_new_split"))
1010
.titlePlacement("bottom")
11-
.onClick((widget) => widget.triggerCommand("openNewNoteSplit", { ntxId: widget.getClosestNtxId() }))
11+
.onClick((widget, e) => {
12+
widget.triggerCommand("openNewNoteSplit", { ntxId: widget.getClosestNtxId() });
13+
e.stopPropagation();
14+
})
1215
.class("icon-action");
1316
}
1417
}

apps/client/src/widgets/buttons/note_actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {
186186

187187
this.$convertNoteIntoAttachmentButton.toggle(note.isEligibleForConversionToAttachment());
188188

189-
this.toggleDisabled(this.$findInTextButton, ["text", "code", "book"].includes(note.type));
189+
this.toggleDisabled(this.$findInTextButton, ["text", "code", "book", "mindMap"].includes(note.type));
190190

191191
this.toggleDisabled(this.$showAttachmentsButton, !isInOptions);
192192
this.toggleDisabled(this.$showSourceButton, ["text", "code", "relationMap", "mermaid", "canvas", "mindMap", "geoMap"].includes(note.type));

apps/client/src/widgets/find.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export default class FindWidget extends NoteContextAwareWidget {
188188
return;
189189
}
190190

191-
if (!["text", "code", "render"].includes(this.note?.type ?? "")) {
191+
if (!["text", "code", "render", "mindMap"].includes(this.note?.type ?? "")) {
192192
return;
193193
}
194194

@@ -250,6 +250,8 @@ export default class FindWidget extends NoteContextAwareWidget {
250250
case "text":
251251
const readOnly = await this.noteContext?.isReadOnly();
252252
return readOnly ? this.htmlHandler : this.textHandler;
253+
case "mindMap":
254+
return this.htmlHandler;
253255
default:
254256
console.warn("FindWidget: Unsupported note type for find widget", this.note?.type);
255257
}
@@ -352,7 +354,7 @@ export default class FindWidget extends NoteContextAwareWidget {
352354
}
353355

354356
isEnabled() {
355-
return super.isEnabled() && ["text", "code", "render"].includes(this.note?.type ?? "");
357+
return super.isEnabled() && ["text", "code", "render", "mindMap"].includes(this.note?.type ?? "");
356358
}
357359

358360
async entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {

apps/client/src/widgets/find_in_html.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default class FindInHtml {
8585
if (this.$results?.length) {
8686
const $current = this.$results.eq(this.currentIndex);
8787
this.$results.removeClass(FIND_RESULT_SELECTED_CSS_CLASSNAME);
88-
$current[0].scrollIntoView();
88+
$current[0].scrollIntoView({ block: 'center', inline: 'center'});
8989
$current.addClass(FIND_RESULT_SELECTED_CSS_CLASSNAME);
9090
}
9191
}

apps/client/src/widgets/tab_row.ts

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,16 +378,45 @@ export default class TabRowWidget extends BasicWidget {
378378
}
379379

380380
scrollTabContainer(direction: number, behavior: ScrollBehavior = "smooth") {
381-
const currentScrollLeft = this.$tabScrollingContainer[0]?.scrollLeft;
382-
this.$tabScrollingContainer[0].scrollTo({
383-
left: currentScrollLeft + direction,
381+
this.$tabScrollingContainer[0].scrollBy({
382+
left: direction,
384383
behavior
385384
});
386385
};
387386

388387
setupScrollEvents() {
389-
this.$tabScrollingContainer[0].addEventListener('wheel', (event) => {
390-
this.scrollTabContainer(event.deltaY * 1.5);
388+
let deltaX = 0;
389+
let isScrolling = false;
390+
const stepScroll = () => {
391+
if (Math.abs(deltaX) > 5) {
392+
const step = Math.round(deltaX * 0.2);
393+
deltaX -= step;
394+
this.scrollTabContainer(step, "instant");
395+
requestAnimationFrame(stepScroll);
396+
} else {
397+
this.scrollTabContainer(deltaX, "instant");
398+
deltaX = 0;
399+
isScrolling = false;
400+
}
401+
};
402+
this.$tabScrollingContainer[0].addEventListener('wheel', async (event) => {
403+
if (!event.shiftKey && event.deltaX === 0) {
404+
event.preventDefault();
405+
// Clamp deltaX between TAB_CONTAINER_MIN_WIDTH and TAB_CONTAINER_MIN_WIDTH * 3
406+
deltaX += Math.sign(event.deltaY) * Math.max(Math.min(Math.abs(event.deltaY), TAB_CONTAINER_MIN_WIDTH * 3), TAB_CONTAINER_MIN_WIDTH);
407+
if (!isScrolling) {
408+
isScrolling = true;
409+
stepScroll();
410+
}
411+
} else if (event.shiftKey) {
412+
event.preventDefault();
413+
if (event.deltaY > 0) {
414+
await appContext.tabManager.activateNextTabCommand();
415+
} else {
416+
await appContext.tabManager.activatePreviousTabCommand();
417+
}
418+
this.activeTabEl.scrollIntoView();
419+
}
391420
});
392421

393422
this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-200));

apps/client/src/widgets/type_widgets/mind_map.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,13 @@ export default class MindMapWidget extends TypeWidget {
286286
utils.downloadSvgAsPng(this.note.title, svg);
287287
}
288288

289+
async executeWithContentElementEvent({ resolve, ntxId }: EventData<"executeWithContentElement">) {
290+
if (!this.isNoteContext(ntxId)) {
291+
return;
292+
}
293+
294+
await this.initialized;
295+
296+
resolve(this.$content.find('.main-node-container'));
297+
}
289298
}

0 commit comments

Comments
 (0)