Skip to content

Build your personal knowledge base with Trilium Notes

chore(ckeditor5): integrate ckeditor5-math

Elian Dorand6548f4cd6fe
diff --git a/packages/ckeditor5-math/src/index.ts b/packages/ckeditor5-math/src/index.ts
index 788de3f8ad..781f074327 100644
--- a/packages/ckeditor5-math/src/index.ts
+++ b/packages/ckeditor5-math/src/index.ts
@@ -1,4 +1,4 @@
-import ckeditor from './../theme/icons/ckeditor.svg';
+import ckeditor from './../theme/icons/math.svg';
import './augmentation.js';
import "../theme/mathform.css";
diff --git a/packages/ckeditor5-math/tsconfig.json b/packages/ckeditor5-math/tsconfig.json
index 069e3cb16b..f53643f74d 100644
--- a/packages/ckeditor5-math/tsconfig.json
+++ b/packages/ckeditor5-math/tsconfig.json
@@ -17,6 +17,7 @@
],
"noImplicitAny": true,
"noImplicitOverride": true,
+ "composite": true,
"strict": true,
"target": "es2019",
"sourceMap": true,
diff --git a/packages/ckeditor5/package.json b/packages/ckeditor5/package.json
index 80f3afa8c2..0aab266623 100644
--- a/packages/ckeditor5/package.json
+++ b/packages/ckeditor5/package.json
@@ -23,7 +23,8 @@
"@triliumnext/ckeditor5-keyboard-marker": "workspace:*",
"@triliumnext/ckeditor5-mermaid": "workspace:*",
"@triliumnext/ckeditor5-admonition": "workspace:*",
- "@triliumnext/ckeditor5-footnotes": "workspace:*"
+ "@triliumnext/ckeditor5-footnotes": "workspace:*",
+ "@triliumnext/ckeditor5-math": "workspace:*"
},
"devDependencies": {
"@types/jquery": "3.5.32"
diff --git a/packages/ckeditor5/src/plugins.ts b/packages/ckeditor5/src/plugins.ts
index 0c0f376d85..9b49c13ccb 100644
--- a/packages/ckeditor5/src/plugins.ts
+++ b/packages/ckeditor5/src/plugins.ts
@@ -17,10 +17,12 @@ import { Kbd } from "@triliumnext/ckeditor5-keyboard-marker";
import { Mermaid } from "@triliumnext/ckeditor5-mermaid";
import { Admonition } from "@triliumnext/ckeditor5-admonition";
import { Footnotes } from "@triliumnext/ckeditor5-footnotes";
+import { Math, AutoformatMath } from "@triliumnext/ckeditor5-math";
import "@triliumnext/ckeditor5-mermaid/index.css";
import "@triliumnext/ckeditor5-admonition/index.css";
import "@triliumnext/ckeditor5-footnotes/index.css";
+import "@triliumnext/ckeditor5-math/index.css";
const TRILIUM_PLUGINS: typeof Plugin[] = [
CutToNotePlugin,
@@ -42,7 +44,9 @@ const EXTERNAL_PLUGINS: typeof Plugin[] = [
Kbd,
Mermaid,
Admonition,
- Footnotes
+ Footnotes,
+ Math,
+ AutoformatMath
];
export const COMMON_PLUGINS: typeof Plugin[] = [
@@ -103,11 +107,7 @@ export const COMMON_PLUGINS: typeof Plugin[] = [
PageBreak,
GeneralHtmlSupport,
TextPartLanguage,
- Style,
-
- // External plugins
- // Math,
- // AutoformatMath,
+ Style
];
export const COMMON_SETTINGS = { };
diff --git a/packages/ckeditor5/tsconfig.json b/packages/ckeditor5/tsconfig.json
index f253709aaa..992ddddc0e 100644
--- a/packages/ckeditor5/tsconfig.json
+++ b/packages/ckeditor5/tsconfig.json
@@ -3,6 +3,9 @@
"files": [],
"include": [],
"references": [
+ {
+ "path": "../ckeditor5-math"
+ },
{
"path": "../ckeditor5-footnotes"
},
diff --git a/packages/ckeditor5/tsconfig.lib.json b/packages/ckeditor5/tsconfig.lib.json
index dc6f237b41..56b8c10dd6 100644
--- a/packages/ckeditor5/tsconfig.lib.json
+++ b/packages/ckeditor5/tsconfig.lib.json
@@ -19,6 +19,9 @@
"src/**/*.ts"
],
"references": [
+ {
+ "path": "../ckeditor5-math"
+ },
{
"path": "../ckeditor5-footnotes"
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 2645b2d858..a5c902c9a0 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -810,6 +810,9 @@ importers:
'@triliumnext/ckeditor5-keyboard-marker':
specifier: workspace:*
version: link:../ckeditor5-keyboard-marker
+ '@triliumnext/ckeditor5-math':
+ specifier: workspace:*
+ version: link:../ckeditor5-math
'@triliumnext/ckeditor5-mermaid':
specifier: workspace:*
version: link:../ckeditor5-mermaid
@@ -840,7 +843,7 @@ importers:
'@vitest/browser':
specifier: ^2.0.5
'@vitest/coverage-istanbul':
specifier: ^2.0.5
version: 2.1.9([email protected])
@@ -882,10 +885,10 @@ importers:
version: 2.0.1
vite-plugin-svgo:
specifier: ~1.4.0
vitest:
specifier: ^2.0.5
webdriverio:
specifier: ^9.0.7
@@ -954,7 +957,7 @@ importers:
vitest:
specifier: ^2.0.5
webdriverio:
specifier: ^9.0.7
@@ -1023,7 +1026,7 @@ importers:
vitest:
specifier: ^2.0.5
webdriverio:
specifier: ^9.0.7
@@ -1050,7 +1053,7 @@ importers:
'@vitest/browser':
specifier: ^2.0.5
'@vitest/coverage-istanbul':
specifier: ^2.0.5
version: 2.1.9([email protected])
@@ -1095,10 +1098,10 @@ importers:
version: 2.0.1
vite-plugin-svgo:
specifier: ~1.4.0
vitest:
specifier: ^2.0.5
webdriverio:
specifier: ^9.0.7
@@ -1174,7 +1177,7 @@ importers:
vitest:
specifier: ^2.0.5
webdriverio:
specifier: ^9.0.7
@@ -19467,7 +19470,7 @@ snapshots:
sirv: 3.0.1
tinyrainbow: 1.2.0
optionalDependencies:
playwright: 1.52.0
@@ -29749,10 +29752,10 @@ snapshots:
tsx: 4.19.4
yaml: 2.7.1
dependencies:
'@vitest/expect': 2.1.9
'@vitest/pretty-format': 2.1.9
'@vitest/runner': 2.1.9
'@vitest/snapshot': 2.1.9
@@ -29768,12 +29771,12 @@ snapshots:
tinyexec: 0.3.2
tinypool: 1.0.2
tinyrainbow: 1.2.0
why-is-node-running: 2.3.0
optionalDependencies:
'@types/node': 22.15.3
'@vitest/ui': 3.1.2([email protected])
happy-dom: 17.4.6
@@ -29788,10 +29791,10 @@ snapshots:
- supports-color
- terser
dependencies:
'@vitest/expect': 2.1.9
'@vitest/pretty-format': 2.1.9
'@vitest/runner': 2.1.9
'@vitest/snapshot': 2.1.9
@@ -29807,12 +29810,12 @@ snapshots:
tinyexec: 0.3.2
tinypool: 1.0.2
tinyrainbow: 1.2.0
why-is-node-running: 2.3.0
optionalDependencies:
'@types/node': 22.15.3
'@vitest/ui': 3.1.2([email protected])
happy-dom: 17.4.6
diff --git a/tsconfig.json b/tsconfig.json
index 7cd6f7e454..e2c6d2fc48 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -47,6 +47,9 @@
},
{
"path": "./packages/ckeditor5-footnotes"
+ },
+ {
+ "path": "./packages/ckeditor5-math"
}
]
}