mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
Merge branch 'beta'
# Conflicts: # package-lock.json
This commit is contained in:
commit
c881b39860
@ -5,8 +5,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CKEditor 5 (v39.0.1) content styles.
|
* CKEditor 5 (v39.0.2) content styles.
|
||||||
* Generated on Thu, 10 Aug 2023 09:21:07 GMT.
|
* Generated on Wed, 06 Sep 2023 07:32:15 GMT.
|
||||||
* For more information, check out https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html
|
* For more information, check out https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -197,6 +197,20 @@
|
|||||||
.ck-content .todo-list .todo-list__label .todo-list__label__description {
|
.ck-content .todo-list .todo-list__label .todo-list__label__description {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
|
||||||
|
.ck-content .image.image_resized {
|
||||||
|
max-width: 100%;
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
|
||||||
|
.ck-content .image.image_resized img {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
|
||||||
|
.ck-content .image.image_resized > figcaption {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
/* @ckeditor/ckeditor5-image/theme/image.css */
|
/* @ckeditor/ckeditor5-image/theme/image.css */
|
||||||
.ck-content .image {
|
.ck-content .image {
|
||||||
display: table;
|
display: table;
|
||||||
@ -234,20 +248,6 @@
|
|||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
|
|
||||||
.ck-content .image.image_resized {
|
|
||||||
max-width: 100%;
|
|
||||||
display: block;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
|
|
||||||
.ck-content .image.image_resized img {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
|
|
||||||
.ck-content .image.image_resized > figcaption {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
/* @ckeditor/ckeditor5-image/theme/imagecaption.css */
|
/* @ckeditor/ckeditor5-image/theme/imagecaption.css */
|
||||||
.ck-content .image > figcaption {
|
.ck-content .image > figcaption {
|
||||||
display: table-caption;
|
display: table-caption;
|
||||||
@ -259,32 +259,6 @@
|
|||||||
font-size: .75em;
|
font-size: .75em;
|
||||||
outline-offset: -1px;
|
outline-offset: -1px;
|
||||||
}
|
}
|
||||||
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
|
||||||
.ck-content .marker-yellow {
|
|
||||||
background-color: var(--ck-highlight-marker-yellow);
|
|
||||||
}
|
|
||||||
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
|
||||||
.ck-content .marker-green {
|
|
||||||
background-color: var(--ck-highlight-marker-green);
|
|
||||||
}
|
|
||||||
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
|
||||||
.ck-content .marker-pink {
|
|
||||||
background-color: var(--ck-highlight-marker-pink);
|
|
||||||
}
|
|
||||||
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
|
||||||
.ck-content .marker-blue {
|
|
||||||
background-color: var(--ck-highlight-marker-blue);
|
|
||||||
}
|
|
||||||
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
|
||||||
.ck-content .pen-red {
|
|
||||||
color: var(--ck-highlight-pen-red);
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
|
||||||
.ck-content .pen-green {
|
|
||||||
color: var(--ck-highlight-pen-green);
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
/* @ckeditor/ckeditor5-list/theme/list.css */
|
/* @ckeditor/ckeditor5-list/theme/list.css */
|
||||||
.ck-content ol {
|
.ck-content ol {
|
||||||
list-style-type: decimal;
|
list-style-type: decimal;
|
||||||
@ -321,6 +295,32 @@
|
|||||||
.ck-content ul ul ul ul {
|
.ck-content ul ul ul ul {
|
||||||
list-style-type: square;
|
list-style-type: square;
|
||||||
}
|
}
|
||||||
|
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
||||||
|
.ck-content .marker-yellow {
|
||||||
|
background-color: var(--ck-highlight-marker-yellow);
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
||||||
|
.ck-content .marker-green {
|
||||||
|
background-color: var(--ck-highlight-marker-green);
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
||||||
|
.ck-content .marker-pink {
|
||||||
|
background-color: var(--ck-highlight-marker-pink);
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
||||||
|
.ck-content .marker-blue {
|
||||||
|
background-color: var(--ck-highlight-marker-blue);
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
||||||
|
.ck-content .pen-red {
|
||||||
|
color: var(--ck-highlight-pen-red);
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
|
||||||
|
.ck-content .pen-green {
|
||||||
|
color: var(--ck-highlight-pen-green);
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
|
||||||
.ck-content .image-style-block-align-left,
|
.ck-content .image-style-block-align-left,
|
||||||
.ck-content .image-style-block-align-right {
|
.ck-content .image-style-block-align-right {
|
||||||
|
2
libraries/ckeditor/ckeditor.js
vendored
2
libraries/ckeditor/ckeditor.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2,7 +2,7 @@
|
|||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"productName": "Trilium Notes",
|
"productName": "Trilium Notes",
|
||||||
"description": "Trilium Notes",
|
"description": "Trilium Notes",
|
||||||
"version": "0.61.5-beta",
|
"version": "0.61.6-beta",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"main": "electron.js",
|
"main": "electron.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -53,7 +53,7 @@
|
|||||||
"escape-html": "1.0.3",
|
"escape-html": "1.0.3",
|
||||||
"express": "4.18.2",
|
"express": "4.18.2",
|
||||||
"express-partial-content": "1.0.2",
|
"express-partial-content": "1.0.2",
|
||||||
"express-rate-limit": "6.10.0",
|
"express-rate-limit": "6.11.0",
|
||||||
"express-session": "1.17.3",
|
"express-session": "1.17.3",
|
||||||
"fs-extra": "11.1.1",
|
"fs-extra": "11.1.1",
|
||||||
"helmet": "7.0.0",
|
"helmet": "7.0.0",
|
||||||
@ -68,7 +68,7 @@
|
|||||||
"jimp": "0.22.10",
|
"jimp": "0.22.10",
|
||||||
"joplin-turndown-plugin-gfm": "1.0.12",
|
"joplin-turndown-plugin-gfm": "1.0.12",
|
||||||
"jsdom": "22.1.0",
|
"jsdom": "22.1.0",
|
||||||
"marked": "7.0.5",
|
"marked": "8.0.1",
|
||||||
"mime-types": "2.1.35",
|
"mime-types": "2.1.35",
|
||||||
"multer": "1.4.5-lts.1",
|
"multer": "1.4.5-lts.1",
|
||||||
"node-abi": "3.47.0",
|
"node-abi": "3.47.0",
|
||||||
@ -91,7 +91,7 @@
|
|||||||
"tmp": "0.2.1",
|
"tmp": "0.2.1",
|
||||||
"turndown": "7.1.2",
|
"turndown": "7.1.2",
|
||||||
"unescape": "1.0.1",
|
"unescape": "1.0.1",
|
||||||
"ws": "8.13.0",
|
"ws": "8.14.0",
|
||||||
"xml2js": "0.6.2",
|
"xml2js": "0.6.2",
|
||||||
"yauzl": "2.10.0"
|
"yauzl": "2.10.0"
|
||||||
},
|
},
|
||||||
|
@ -104,7 +104,12 @@ class BAttachment extends AbstractBeccaEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
decrypt() {
|
decrypt() {
|
||||||
if (this.isProtected && !this.isDecrypted && protectedSessionService.isProtectedSessionAvailable()) {
|
if (!this.isProtected || !this.attachmentId) {
|
||||||
|
this.isDecrypted = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.isDecrypted && protectedSessionService.isProtectedSessionAvailable()) {
|
||||||
try {
|
try {
|
||||||
this.title = protectedSessionService.decryptString(this.title);
|
this.title = protectedSessionService.decryptString(this.title);
|
||||||
this.isDecrypted = true;
|
this.isDecrypted = true;
|
||||||
|
@ -647,4 +647,12 @@ export default class TabManager extends Component {
|
|||||||
await this.updateDocumentTitle(activeContext);
|
await this.updateDocumentTitle(activeContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async frocaReloadedEvent() {
|
||||||
|
const activeContext = this.getActiveContext();
|
||||||
|
|
||||||
|
if (activeContext) {
|
||||||
|
await this.updateDocumentTitle(activeContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
|
this.$widget.on('show.bs.dropdown', () => this.refreshVisibility(this.note));
|
||||||
|
|
||||||
this.$convertNoteIntoAttachmentButton = this.$widget.find("[data-trigger-command='convertNoteIntoAttachment']");
|
this.$convertNoteIntoAttachmentButton = this.$widget.find("[data-trigger-command='convertNoteIntoAttachment']");
|
||||||
this.$findInTextButton = this.$widget.find('.find-in-text-button');
|
this.$findInTextButton = this.$widget.find('.find-in-text-button');
|
||||||
@ -92,7 +93,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async refreshWithNote(note) {
|
async refreshVisibility(note) {
|
||||||
this.$convertNoteIntoAttachmentButton.toggle(note.isEligibleForConversionToAttachment());
|
this.$convertNoteIntoAttachmentButton.toggle(note.isEligibleForConversionToAttachment());
|
||||||
|
|
||||||
this.toggleDisabled(this.$findInTextButton, ['text', 'code', 'book'].includes(note.type));
|
this.toggleDisabled(this.$findInTextButton, ['text', 'code', 'book'].includes(note.type));
|
||||||
@ -103,11 +104,11 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
this.$renderNoteButton.toggle(note.type === 'render');
|
this.$renderNoteButton.toggle(note.type === 'render');
|
||||||
|
|
||||||
this.toggleDisabled(this.$openNoteExternallyButton, utils.isElectron() && !['search'].includes(note.type));
|
this.toggleDisabled(this.$openNoteExternallyButton, utils.isElectron() && !['search', 'book'].includes(note.type));
|
||||||
this.toggleDisabled(this.$openNoteCustomButton,
|
this.toggleDisabled(this.$openNoteCustomButton,
|
||||||
utils.isElectron()
|
utils.isElectron()
|
||||||
&& !utils.isMac() // no implementation for Mac yet
|
&& !utils.isMac() // no implementation for Mac yet
|
||||||
&& !['search'].includes(note.type)
|
&& !['search', 'book'].includes(note.type)
|
||||||
);
|
);
|
||||||
|
|
||||||
// I don't want to handle all special notes like this, but intuitively user might want to export content of backend log
|
// I don't want to handle all special notes like this, but intuitively user might want to export content of backend log
|
||||||
|
@ -1 +1 @@
|
|||||||
module.exports = { buildDate:"2023-08-16T23:02:15+02:00", buildRevision: "3f7a5504c77263a7118cede5c0d9b450ba37f424" };
|
module.exports = { buildDate:"2023-09-06T23:57:29+02:00", buildRevision: "6fa9d996e84f87fcb73c3388a5170affd2c2f7cc" };
|
||||||
|
@ -15,6 +15,7 @@ const becca = require('../becca/becca');
|
|||||||
const BBranch = require('../becca/entities/bbranch');
|
const BBranch = require('../becca/entities/bbranch');
|
||||||
const BNote = require('../becca/entities/bnote');
|
const BNote = require('../becca/entities/bnote');
|
||||||
const BAttribute = require('../becca/entities/battribute');
|
const BAttribute = require('../becca/entities/battribute');
|
||||||
|
const BAttachment = require("../becca/entities/battachment");
|
||||||
const dayjs = require("dayjs");
|
const dayjs = require("dayjs");
|
||||||
const htmlSanitizer = require("./html_sanitizer");
|
const htmlSanitizer = require("./html_sanitizer");
|
||||||
const ValidationError = require("../errors/validation_error");
|
const ValidationError = require("../errors/validation_error");
|
||||||
@ -810,6 +811,16 @@ function undeleteBranch(branchId, deleteId, taskContext) {
|
|||||||
new BAttribute(attributeRow).save({skipValidation: true});
|
new BAttribute(attributeRow).save({skipValidation: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const attachmentRows = sql.getRows(`
|
||||||
|
SELECT * FROM attachments
|
||||||
|
WHERE isDeleted = 1
|
||||||
|
AND deleteId = ?
|
||||||
|
AND ownerId = ?`, [deleteId, noteRow.noteId]);
|
||||||
|
|
||||||
|
for (const attachmentRow of attachmentRows) {
|
||||||
|
new BAttachment(attachmentRow).save();
|
||||||
|
}
|
||||||
|
|
||||||
const childBranchIds = sql.getColumn(`
|
const childBranchIds = sql.getColumn(`
|
||||||
SELECT branches.branchId
|
SELECT branches.branchId
|
||||||
FROM branches
|
FROM branches
|
||||||
|
@ -14,10 +14,7 @@ function protectRevisions(note) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const revision of note.getRevisions()) {
|
for (const revision of note.getRevisions()) {
|
||||||
if (note.isProtected === revision.isProtected) {
|
if (note.isProtected !== revision.isProtected) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const content = revision.getContent();
|
const content = revision.getContent();
|
||||||
|
|
||||||
@ -31,6 +28,22 @@ function protectRevisions(note) {
|
|||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const attachment of revision.getAttachments()) {
|
||||||
|
if (note.isProtected !== attachment.isProtected) {
|
||||||
|
try {
|
||||||
|
const content = attachment.getContent();
|
||||||
|
|
||||||
|
attachment.isProtected = note.isProtected;
|
||||||
|
attachment.setContent(content, {forceSave: true});
|
||||||
|
} catch (e) {
|
||||||
|
log.error(`Could not un/protect attachment '${attachment.attachmentId}'`);
|
||||||
|
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function eraseRevisions(revisionIdsToErase) {
|
function eraseRevisions(revisionIdsToErase) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user