mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
chore(ckeditor): edit patches & add one for code blocks
This commit is contained in:
parent
73f69f91f2
commit
5db6043017
@ -24,8 +24,8 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.8.0",
|
|
||||||
"@electron/rebuild": "4.0.1",
|
"@electron/rebuild": "4.0.1",
|
||||||
|
"@eslint/js": "^9.8.0",
|
||||||
"@nx/devkit": "21.0.0",
|
"@nx/devkit": "21.0.0",
|
||||||
"@nx/esbuild": "21.0.0",
|
"@nx/esbuild": "21.0.0",
|
||||||
"@nx/eslint": "21.0.0",
|
"@nx/eslint": "21.0.0",
|
||||||
@ -91,7 +91,8 @@
|
|||||||
"packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39",
|
"packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39",
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"patchedDependencies": {
|
"patchedDependencies": {
|
||||||
"@ckeditor/ckeditor5-mention": "patches/@ckeditor__ckeditor5-mention.patch"
|
"@ckeditor/ckeditor5-mention": "patches/@ckeditor__ckeditor5-mention.patch",
|
||||||
|
"@ckeditor/ckeditor5-code-block": "patches/@ckeditor__ckeditor5-code-block.patch"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
37
patches/@ckeditor__ckeditor5-code-block.patch
Normal file
37
patches/@ckeditor__ckeditor5-code-block.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
diff --git a/dist/index.css b/dist/index.css
|
||||||
|
index 8276289d55abd0f70d399e33c5f6c2d006745000..c70f12f1644dcebea6730b9b201a6933fa28969b 100644
|
||||||
|
--- a/dist/index.css
|
||||||
|
+++ b/dist/index.css
|
||||||
|
@@ -9,8 +9,6 @@
|
||||||
|
|
||||||
|
.ck-content pre {
|
||||||
|
padding: 1em;
|
||||||
|
- color: hsl(0, 0%, 20.8%);
|
||||||
|
- background: hsla(0, 0%, 78%, 0.3);
|
||||||
|
border: 1px solid hsl(0, 0%, 77%);
|
||||||
|
border-radius: 2px;
|
||||||
|
|
||||||
|
@@ -28,6 +26,11 @@
|
||||||
|
min-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
+.ck-content pre:not(.hljs) {
|
||||||
|
+ color: hsl(0, 0%, 20.8%);
|
||||||
|
+ background: hsla(0, 0%, 78%, 0.3);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
.ck-content pre code {
|
||||||
|
background: unset;
|
||||||
|
padding: 0;
|
||||||
|
diff --git a/dist/index.js b/dist/index.js
|
||||||
|
index f0f8aec2323e8cdb34fa0bb4f48c2b433abcb804..b9600d356df2bf1922d51c6cebd1f74ee3ed9155 100644
|
||||||
|
--- a/dist/index.js
|
||||||
|
+++ b/dist/index.js
|
||||||
|
@@ -656,6 +656,7 @@ function getLastOutdentableSequenceRange(model, position, sequence) {
|
||||||
|
// Attributes added only in the editing view.
|
||||||
|
if (useLabels) {
|
||||||
|
preAttributes['data-language'] = languagesToLabels[codeBlockLanguage];
|
||||||
|
+ preAttributes.class = "hljs";
|
||||||
|
preAttributes.spellcheck = 'false';
|
||||||
|
}
|
||||||
|
const codeAttributes = languagesToClasses[codeBlockLanguage] ? {
|
@ -1,11 +1,11 @@
|
|||||||
diff --git a/build/mention.js b/build/mention.js
|
diff --git a/build/mention.js b/build/mention.js
|
||||||
deleted file mode 100644
|
deleted file mode 100644
|
||||||
index 6d433b2062ba52bcc6d70c911d38575e91b89d2c..0000000000000000000000000000000000000000
|
index 3ef262a2fb7cbb953b35cb7e07a999edce6dc72a..0000000000000000000000000000000000000000
|
||||||
diff --git a/dist/index.js b/dist/index.js
|
diff --git a/dist/index.js b/dist/index.js
|
||||||
index 9ba3f42b4093dce3174866f3321e03334d70e92e..62b0015a4bd255148496190c23ee48d6e9b1b5c2 100644
|
index bbe511c5550e1cac8612e998034382b4eea1f1b8..8394fd8bba89f8a7b82d62fe613be6f12703ff53 100644
|
||||||
--- a/dist/index.js
|
--- a/dist/index.js
|
||||||
+++ b/dist/index.js
|
+++ b/dist/index.js
|
||||||
@@ -606,6 +606,16 @@ const defaultCommitKeyCodes = [
|
@@ -603,6 +603,16 @@ const defaultCommitKeyCodes = [
|
||||||
}
|
}
|
||||||
if (data.keyCode == keyCodes.esc) {
|
if (data.keyCode == keyCodes.esc) {
|
||||||
this._hideUIAndRemoveMarker();
|
this._hideUIAndRemoveMarker();
|
||||||
@ -22,7 +22,7 @@ index 9ba3f42b4093dce3174866f3321e03334d70e92e..62b0015a4bd255148496190c23ee48d6
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@@ -1069,12 +1079,11 @@ const defaultCommitKeyCodes = [
|
@@ -1067,12 +1077,11 @@ const defaultCommitKeyCodes = [
|
||||||
*/ function createRegExp(marker, minimumCharacters) {
|
*/ function createRegExp(marker, minimumCharacters) {
|
||||||
const numberOfCharacters = minimumCharacters == 0 ? '*' : `{${minimumCharacters},}`;
|
const numberOfCharacters = minimumCharacters == 0 ? '*' : `{${minimumCharacters},}`;
|
||||||
const openAfterCharacters = env.features.isRegExpUnicodePropertySupported ? '\\p{Ps}\\p{Pi}"\'' : '\\(\\[{"\'';
|
const openAfterCharacters = env.features.isRegExpUnicodePropertySupported ? '\\p{Ps}\\p{Pi}"\'' : '\\(\\[{"\'';
|
||||||
@ -36,13 +36,11 @@ index 9ba3f42b4093dce3174866f3321e03334d70e92e..62b0015a4bd255148496190c23ee48d6
|
|||||||
// The pattern consists of 3 groups:
|
// The pattern consists of 3 groups:
|
||||||
//
|
//
|
||||||
// - 0 (non-capturing): Opening sequence - start of the line, space or an opening punctuation character like "(" or "\"",
|
// - 0 (non-capturing): Opening sequence - start of the line, space or an opening punctuation character like "(" or "\"",
|
||||||
@@ -1082,8 +1091,8 @@ const defaultCommitKeyCodes = [
|
@@ -1081,7 +1090,7 @@ const defaultCommitKeyCodes = [
|
||||||
// - 2: Mention input (taking the minimal length into consideration to trigger the UI),
|
|
||||||
//
|
//
|
||||||
// The pattern matches up to the caret (end of string switch - $).
|
// The pattern matches up to the caret (end of string switch - $).
|
||||||
- // (0: opening sequence )(1: marker )(2: typed mention )$
|
// (0: opening sequence )(1: marker )(2: typed mention )$
|
||||||
- const pattern = `(?:^|[ ${openAfterCharacters}])([${marker}])(${mentionCharacters}${numberOfCharacters})$`;
|
- const pattern = `(?:^|[ ${openAfterCharacters}])(${marker})(${mentionCharacters}${numberOfCharacters})$`;
|
||||||
+ // (0: opening sequence )(1: marker )(2: typed mention )$
|
|
||||||
+ const pattern = `(?:^|[= ${ openAfterCharacters }])([${ marker }])([${ mentionCharacters }]${ numberOfCharacters })$`;
|
+ const pattern = `(?:^|[= ${ openAfterCharacters }])([${ marker }])([${ mentionCharacters }]${ numberOfCharacters })$`;
|
||||||
return new RegExp(pattern, 'u');
|
return new RegExp(pattern, 'u');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user