Compare commits

..

1 Commits

Author SHA1 Message Date
renovate[bot]
793dcee562 chore(deps): update dependency copy-webpack-plugin to v14 2026-03-03 02:02:49 +00:00
13 changed files with 38 additions and 69 deletions

View File

@@ -79,7 +79,7 @@
"@types/mark.js": "8.11.12",
"@types/reveal.js": "5.2.2",
"@types/tabulator-tables": "6.3.1",
"copy-webpack-plugin": "13.0.1",
"copy-webpack-plugin": "14.0.0",
"happy-dom": "20.7.0",
"lightningcss": "1.31.1",
"script-loader": "0.7.2",

View File

@@ -12,7 +12,6 @@ export default class SpacedUpdate {
private updateInterval: number;
private changeForbidden?: boolean;
private stateCallback?: StateCallback;
private lastState: SaveState = "saved";
constructor(updater: Callback, updateInterval = 1000, stateCallback?: StateCallback) {
this.updater = updater;
@@ -25,7 +24,7 @@ export default class SpacedUpdate {
scheduleUpdate() {
if (!this.changeForbidden) {
this.changed = true;
this.onStateChanged("unsaved");
this.stateCallback?.("unsaved");
setTimeout(() => this.triggerUpdate());
}
}
@@ -35,12 +34,12 @@ export default class SpacedUpdate {
this.changed = false; // optimistic...
try {
this.onStateChanged("saving");
this.stateCallback?.("saving");
await this.updater();
this.onStateChanged("saved");
this.stateCallback?.("saved");
} catch (e) {
this.changed = true;
this.onStateChanged("error");
this.stateCallback?.("error");
logError(getErrorMessage(e));
throw e;
}
@@ -77,13 +76,13 @@ export default class SpacedUpdate {
}
if (Date.now() - this.lastUpdated > this.updateInterval) {
this.onStateChanged("saving");
this.stateCallback?.("saving");
try {
await this.updater();
this.onStateChanged("saved");
this.stateCallback?.("saved");
this.changed = false;
} catch (e) {
this.onStateChanged("error");
this.stateCallback?.("error");
logError(getErrorMessage(e));
}
this.lastUpdated = Date.now();
@@ -93,13 +92,6 @@ export default class SpacedUpdate {
}
}
onStateChanged(state: SaveState) {
if (state === this.lastState) return;
this.stateCallback?.(state);
this.lastState = state;
}
async allowUpdateWithoutChange(callback: Callback) {
this.changeForbidden = true;

View File

@@ -4,7 +4,6 @@
overflow: visible;
contain: none !important;
clear: both;
&.full-height {
overflow: auto;

View File

@@ -54,8 +54,6 @@ export default function PopupEditor() {
}
});
// Events triggered at note context level (e.g. the save indicator) would not work since the note context has no parent component. Propagate events to parent component so that they can be handled properly.
noteContext.triggerEvent = (name, data) => parentComponent?.handleEventInChildren(name, data);
setNoteContext(noteContext);
setShown(true);
});

View File

@@ -7,7 +7,7 @@ import { t } from "../../services/i18n";
import { goToLinkExt } from "../../services/link";
import { Badge, BadgeWithDropdown } from "../react/Badge";
import { FormDropdownDivider, FormListItem } from "../react/FormList";
import { useGetContextDataFrom, useIsNoteReadOnly, useNoteContext, useNoteLabel, useNoteLabelBoolean } from "../react/hooks";
import { useGetContextData, useIsNoteReadOnly, useNoteContext, useNoteLabel, useNoteLabelBoolean } from "../react/hooks";
import { useShareState } from "../ribbon/BasicPropertiesTab";
import { useShareInfo } from "../shared_info";
import { ActiveContentBadges } from "./ActiveContentBadges";
@@ -112,8 +112,7 @@ function ExecuteBadge() {
}
export function SaveStatusBadge() {
const { noteContext} = useNoteContext();
const saveState = useGetContextDataFrom(noteContext, "saveState");
const saveState = useGetContextData("saveState");
if (!saveState) return;
const stateConfig = {

View File

@@ -34,7 +34,7 @@
"@types/electron-squirrel-startup": "1.0.2",
"@triliumnext/commons": "workspace:*",
"@triliumnext/server": "workspace:*",
"copy-webpack-plugin": "13.0.1",
"copy-webpack-plugin": "14.0.0",
"electron": "40.6.1",
"@electron-forge/cli": "7.11.1",
"@electron-forge/maker-deb": "7.11.1",

View File

@@ -11,7 +11,7 @@
"@triliumnext/client": "workspace:*",
"@triliumnext/desktop": "workspace:*",
"@types/fs-extra": "11.0.4",
"copy-webpack-plugin": "13.0.1",
"copy-webpack-plugin": "14.0.0",
"electron": "40.6.1",
"fs-extra": "11.3.3"
},

View File

@@ -57,7 +57,7 @@ function importFile(taskContext: TaskContext<"importNotes">, file: File, parentN
const mime = mimeService.getMime(originalName) || file.mimetype;
const { note } = noteService.createNewNote({
parentNoteId: parentNote.noteId,
title: getNoteTitle(originalName, mime === "application/pdf", { mime }),
title: getNoteTitle(originalName, mime === "application/pdf"),
content: file.buffer,
isProtected: parentNote.isProtected && protectedSessionService.isProtectedSessionAvailable(),
type: "file",

View File

@@ -204,13 +204,9 @@ export function formatDownloadTitle(fileName: string, type: string | null, mime:
return `${fileNameBase}${getExtension()}`;
}
export function removeFileExtension(filePath: string, mime?: string) {
export function removeFileExtension(filePath: string) {
const extension = path.extname(filePath).toLowerCase();
if (mime?.startsWith("video/") || mime?.startsWith("audio/")) {
return filePath.substring(0, filePath.length - extension.length);
}
switch (extension) {
case ".md":
case ".mdx":
@@ -231,7 +227,7 @@ export function getNoteTitle(filePath: string, replaceUnderscoresWithSpaces: boo
const trimmedNoteMeta = noteMeta?.title?.trim();
if (trimmedNoteMeta) return trimmedNoteMeta;
const basename = path.basename(removeFileExtension(filePath, noteMeta?.mime));
const basename = path.basename(removeFileExtension(filePath));
return replaceUnderscoresWithSpaces ? basename.replace(/_/g, " ").trim() : basename;
}

View File

@@ -59,8 +59,6 @@ export function getNoteIcon({ noteId, type, mime, iconClass, workspaceIconClass,
const correspondingMimeType = MIME_TYPES_DICT.find(m => m.mime === mime);
return correspondingMimeType?.icon ?? NOTE_TYPE_ICONS.code;
} else if (type === "file") {
if (mime.startsWith("video/")) return "bx bx-video";
if (mime.startsWith("audio/")) return "bx bx-music";
return FILE_MIME_MAPPINGS[mime] ?? NOTE_TYPE_ICONS.file;
} else if (type === "image") {
return IMAGE_MIME_MAPPINGS[mime] ?? NOTE_TYPE_ICONS.image;

View File

@@ -1,6 +1,6 @@
{
"name": "@triliumnext/pdfjs-viewer",
"version": "0.102.0",
"version": "1.0.0",
"private": true,
"scripts": {
"build": "tsx scripts/build.ts",
@@ -12,4 +12,4 @@
"devDependencies": {
"pdfjs-dist": "5.4.624"
}
}
}

53
pnpm-lock.yaml generated
View File

@@ -367,8 +367,8 @@ importers:
specifier: 6.3.1
version: 6.3.1
copy-webpack-plugin:
specifier: 13.0.1
version: 13.0.1(webpack@5.101.3(esbuild@0.27.3))
specifier: 14.0.0
version: 14.0.0(webpack@5.101.3(esbuild@0.27.3))
happy-dom:
specifier: 20.7.0
version: 20.7.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
@@ -455,8 +455,8 @@ importers:
specifier: 1.0.2
version: 1.0.2
copy-webpack-plugin:
specifier: 13.0.1
version: 13.0.1(webpack@5.101.3(esbuild@0.27.3))
specifier: 14.0.0
version: 14.0.0(webpack@5.101.3(esbuild@0.27.3))
electron:
specifier: 40.6.1
version: 40.6.1
@@ -511,8 +511,8 @@ importers:
specifier: 11.0.4
version: 11.0.4
copy-webpack-plugin:
specifier: 13.0.1
version: 13.0.1(webpack@5.101.3(esbuild@0.27.3))
specifier: 14.0.0
version: 14.0.0(webpack@5.101.3(esbuild@0.27.3))
electron:
specifier: 40.6.1
version: 40.6.1
@@ -7602,9 +7602,9 @@ packages:
copy-anything@2.0.6:
resolution: {integrity: sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==}
copy-webpack-plugin@13.0.1:
resolution: {integrity: sha512-J+YV3WfhY6W/Xf9h+J1znYuqTye2xkBUIGyTPWuBAT27qajBa5mR4f8WBmfDY3YjRftT2kqZZiLi1qf0H+UOFw==}
engines: {node: '>= 18.12.0'}
copy-webpack-plugin@14.0.0:
resolution: {integrity: sha512-3JLW90aBGeaTLpM7mYQKpnVdgsUZRExY55giiZgLuX/xTQRUs1dOCwbBnWnvY6Q6rfZoXMNwzOQJCSZPppfqXA==}
engines: {node: '>= 20.9.0'}
peerDependencies:
webpack: ^5.1.0
@@ -13410,6 +13410,10 @@ packages:
serialize-javascript@6.0.2:
resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==}
serialize-javascript@7.0.4:
resolution: {integrity: sha512-DuGdB+Po43Q5Jxwpzt1lhyFSYKryqoNjQSA9M92tyw0lyHIOur+XCalOUe0KTJpyqzT8+fQ5A0Jf7vCx/NKmIg==}
engines: {node: '>=20.0.0'}
serve-favicon@2.5.1:
resolution: {integrity: sha512-JndLBslCLA/ebr7rS3d+/EKkzTsTi1jI2T9l+vHfAaGJ7A7NhtDpSZ0lx81HCNWnnE0yHncG+SSnVf9IMxOwXQ==}
engines: {node: '>= 0.8.0'}
@@ -14213,10 +14217,6 @@ packages:
resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==}
engines: {node: '>=18'}
tinyglobby@0.2.14:
resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==}
engines: {node: '>=12.0.0'}
tinyglobby@0.2.15:
resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==}
engines: {node: '>=12.0.0'}
@@ -16204,8 +16204,6 @@ snapshots:
'@ckeditor/ckeditor5-core': 47.4.0
'@ckeditor/ckeditor5-utils': 47.4.0
ckeditor5: 47.4.0
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-code-block@47.4.0(patch_hash=2361d8caad7d6b5bddacc3a3b4aa37dbfba260b1c1b22a450413a79c1bb1ce95)':
dependencies:
@@ -16398,8 +16396,6 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.4.0
ckeditor5: 47.4.0
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-editor-classic@47.4.0':
dependencies:
@@ -16409,8 +16405,6 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.4.0
ckeditor5: 47.4.0
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-editor-decoupled@47.4.0':
dependencies:
@@ -16453,6 +16447,8 @@ snapshots:
'@ckeditor/ckeditor5-table': 47.4.0
'@ckeditor/ckeditor5-utils': 47.4.0
ckeditor5: 47.4.0
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-emoji@47.4.0':
dependencies:
@@ -16609,8 +16605,6 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.4.0
'@ckeditor/ckeditor5-widget': 47.4.0
ckeditor5: 47.4.0
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-html-embed@47.4.0':
dependencies:
@@ -16940,8 +16934,6 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.4.0
'@ckeditor/ckeditor5-utils': 47.4.0
ckeditor5: 47.4.0
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-restricted-editing@47.4.0':
dependencies:
@@ -17028,8 +17020,6 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.4.0
'@ckeditor/ckeditor5-utils': 47.4.0
ckeditor5: 47.4.0
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-special-characters@47.4.0':
dependencies:
@@ -23551,13 +23541,13 @@ snapshots:
is-what: 3.14.1
optional: true
copy-webpack-plugin@13.0.1(webpack@5.101.3(esbuild@0.27.3)):
copy-webpack-plugin@14.0.0(webpack@5.101.3(esbuild@0.27.3)):
dependencies:
glob-parent: 6.0.2
normalize-path: 3.0.0
schema-utils: 4.3.2
serialize-javascript: 6.0.2
tinyglobby: 0.2.14
serialize-javascript: 7.0.4
tinyglobby: 0.2.15
webpack: 5.101.3(esbuild@0.27.3)
core-js@3.46.0: {}
@@ -30599,6 +30589,8 @@ snapshots:
dependencies:
randombytes: 2.1.0
serialize-javascript@7.0.4: {}
serve-favicon@2.5.1:
dependencies:
etag: 1.8.1
@@ -31703,11 +31695,6 @@ snapshots:
tinyexec@1.0.2: {}
tinyglobby@0.2.14:
dependencies:
fdir: 6.5.0(picomatch@4.0.3)
picomatch: 4.0.3
tinyglobby@0.2.15:
dependencies:
fdir: 6.5.0(picomatch@4.0.3)

View File

@@ -30,7 +30,7 @@ function main() {
patchPackageJson(join(__dirname, "..", "apps", appName, "package.json"), version);
}
for (const packageName of ["commons", "pdfjs-viewer"]) {
for (const packageName of ["commons"]) {
patchPackageJson(join(__dirname, "..", "packages", packageName, "package.json"), version);
}
}