diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 28d45245d0..7d893979af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,14 @@ concurrency: cancel-in-progress: true jobs: + sanity-check: + name: Sanity Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Check version consistency + run: pnpm tsx ${{ github.workspace }}/scripts/check-version-consistency.ts ${{ github.ref_name }} make-electron: name: Make Electron strategy: diff --git a/.gitignore b/.gitignore index 4dd7bde624..44d9b523dc 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,4 @@ upload # docs site/ apps/*/coverage -scripts/translation/.language*.json \ No newline at end of file +scripts/translation/.language*.json diff --git a/apps/build-docs/package.json b/apps/build-docs/package.json index ef5a0053bc..e0e562ef85 100644 --- a/apps/build-docs/package.json +++ b/apps/build-docs/package.json @@ -9,9 +9,9 @@ "keywords": [], "author": "Elian Doran ", "license": "AGPL-3.0-only", - "packageManager": "pnpm@10.27.0", + "packageManager": "pnpm@10.28.0", "devDependencies": { - "@redocly/cli": "2.14.3", + "@redocly/cli": "2.14.4", "archiver": "7.0.1", "fs-extra": "11.3.3", "react": "19.2.3", diff --git a/apps/client/package.json b/apps/client/package.json index 57628fd371..1f08b90305 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -1,6 +1,6 @@ { "name": "@triliumnext/client", - "version": "0.101.1", + "version": "0.101.3", "description": "JQuery-based client for TriliumNext, used for both web and desktop (via Electron)", "private": true, "license": "AGPL-3.0-only", @@ -56,12 +56,12 @@ "mark.js": "8.11.1", "marked": "17.0.1", "mermaid": "11.12.2", - "mind-elixir": "5.4.0", + "mind-elixir": "5.5.0", "normalize.css": "8.0.1", "panzoom": "9.4.3", "preact": "10.28.1", "react-i18next": "16.5.1", - "react-window": "2.2.3", + "react-window": "2.2.4", "reveal.js": "5.2.1", "svg-pan-zoom": "3.6.2", "tabulator-tables": "6.3.1", @@ -69,7 +69,7 @@ }, "devDependencies": { "@ckeditor/ckeditor5-inspector": "5.0.0", - "@preact/preset-vite": "2.10.2", + "@prefresh/vite": "2.4.11", "@types/bootstrap": "5.2.10", "@types/jquery": "3.5.33", "@types/leaflet": "1.9.21", @@ -79,6 +79,7 @@ "@types/tabulator-tables": "6.3.1", "copy-webpack-plugin": "13.0.1", "happy-dom": "20.0.11", + "lightningcss": "1.30.2", "script-loader": "0.7.2", "vite-plugin-static-copy": "3.1.4" } diff --git a/apps/client/src/components/app_context.ts b/apps/client/src/components/app_context.ts index 560a004382..b5f203b245 100644 --- a/apps/client/src/components/app_context.ts +++ b/apps/client/src/components/app_context.ts @@ -154,6 +154,7 @@ export type CommandMappings = { }; openInTab: ContextMenuCommandData; openNoteInSplit: ContextMenuCommandData; + openNoteInWindow: ContextMenuCommandData; openNoteInPopup: ContextMenuCommandData; toggleNoteHoisting: ContextMenuCommandData; insertNoteAfter: ContextMenuCommandData; diff --git a/apps/client/src/desktop.html b/apps/client/src/desktop.html deleted file mode 100644 index d4b7b190ca..0000000000 --- a/apps/client/src/desktop.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - Trilium Notes - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/client/src/entities/fnote.ts b/apps/client/src/entities/fnote.ts index 048d175db8..83255e4889 100644 --- a/apps/client/src/entities/fnote.ts +++ b/apps/client/src/entities/fnote.ts @@ -616,7 +616,9 @@ export default class FNote { } isFolder() { - return this.type === "search" || this.getFilteredChildBranches().length > 0; + if (this.isLabelTruthy("subtreeHidden")) return false; + if (this.type === "search") return true; + return this.getFilteredChildBranches().length > 0; } getFilteredChildBranches() { diff --git a/apps/client/src/index.html b/apps/client/src/index.html new file mode 100644 index 0000000000..b1541e784b --- /dev/null +++ b/apps/client/src/index.html @@ -0,0 +1,29 @@ + + + + + + + + + + Trilium Notes + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/client/src/index.ts b/apps/client/src/index.ts index e69de29bb2..795adc8cfd 100644 --- a/apps/client/src/index.ts +++ b/apps/client/src/index.ts @@ -0,0 +1,110 @@ +async function bootstrap() { + showSplash(); + await setupGlob(); + await Promise.all([ + initJQuery(), + loadBootstrapCss() + ]); + loadStylesheets(); + loadIcons(); + setBodyAttributes(); + await loadScripts(); + hideSplash(); +} + +async function initJQuery() { + const $ = (await import("jquery")).default; + window.$ = $; + window.jQuery = $; +} + +async function setupGlob() { + const response = await fetch(`/bootstrap${window.location.search}`); + const json = await response.json(); + + window.global = globalThis; /* fixes https://github.com/webpack/webpack/issues/10035 */ + window.glob = { + ...json, + activeDialog: null + }; +} + +async function loadBootstrapCss() { + // We have to selectively import Bootstrap CSS based on text direction. + if (glob.isRtl) { + await import("bootstrap/dist/css/bootstrap.rtl.min.css"); + } else { + await import("bootstrap/dist/css/bootstrap.min.css"); + } +} + +function loadStylesheets() { + const { assetPath, themeCssUrl, themeUseNextAsBase } = window.glob; + const cssToLoad: string[] = []; + cssToLoad.push(`${assetPath}/stylesheets/ckeditor-theme.css`); + cssToLoad.push(`api/fonts`); + cssToLoad.push(`${assetPath}/stylesheets/theme-light.css`); + if (themeCssUrl) { + cssToLoad.push(themeCssUrl); + } + if (themeUseNextAsBase === "next") { + cssToLoad.push(`${assetPath}/stylesheets/theme-next.css`); + } else if (themeUseNextAsBase === "next-dark") { + cssToLoad.push(`${assetPath}/stylesheets/theme-next-dark.css`); + } else if (themeUseNextAsBase === "next-light") { + cssToLoad.push(`${assetPath}/stylesheets/theme-next-light.css`); + } + cssToLoad.push(`${assetPath}/stylesheets/style.css`); + + for (const href of cssToLoad) { + const linkEl = document.createElement("link"); + linkEl.href = href; + linkEl.rel = "stylesheet"; + document.head.appendChild(linkEl); + } +} + +function loadIcons() { + const styleEl = document.createElement("style"); + styleEl.innerText = window.glob.iconPackCss; + document.head.appendChild(styleEl); +} + +function setBodyAttributes() { + const { device, headingStyle, layoutOrientation, platform, isElectron, hasNativeTitleBar, hasBackgroundEffects, currentLocale } = window.glob; + const classesToSet = [ + device, + `heading-style-${headingStyle}`, + `layout-${layoutOrientation}`, + `platform-${platform}`, + isElectron && "electron", + hasNativeTitleBar && "native-titlebar", + hasBackgroundEffects && "background-effects" + ].filter(Boolean) as string[]; + + for (const classToSet of classesToSet) { + document.body.classList.add(classToSet); + } + + document.body.lang = currentLocale.id; + document.body.dir = currentLocale.rtl ? "rtl" : "ltr"; +} + +async function loadScripts() { + if (glob.device === "mobile") { + await import("./mobile.js"); + } else { + await import("./desktop.js"); + } +} + +function showSplash() { + // hide body to reduce flickering on the startup. This is done through JS and not CSS to not hide