Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
refactor(ckeditor5): fold mermaid into the aggregate package
Elian Doranbcc7f744aa0a
diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.ymlindex b5d9285d83..25c35733fb 100644--- a/.github/workflows/dev.yml+++ b/.github/workflows/dev.yml@@ -136,7 +136,6 @@ jobs:run: |export CHROMEDRIVER_PATH=$(which chromedriver || find /usr/local/share -name chromedriver -type f 2>/dev/null | head -1)echo "Using chromedriver at: $CHROMEDRIVER_PATH"- pnpm run --filter=ckeditor5-mermaid testpnpm run --filter=ckeditor5-math test- name: Run the CKEditor 5 aggregate tests@@ -304,7 +303,7 @@ jobs:fail_ci_if_error: false- name: Run the rest of the tests- run: pnpm run --filter=\!client --filter=\!standalone --filter=\!server --filter=\!desktop --filter=\!commons --filter=\!ckeditor5-mermaid --filter=\!ckeditor5-math --filter=\!ckeditor5 --filter=\!codemirror --filter=\!express-partial-content --filter=\!highlightjs --filter=\!pdfjs-viewer test+ run: pnpm run --filter=\!client --filter=\!standalone --filter=\!server --filter=\!desktop --filter=\!commons --filter=\!ckeditor5-math --filter=\!ckeditor5 --filter=\!codemirror --filter=\!express-partial-content --filter=\!highlightjs --filter=\!pdfjs-viewer testbuild_docker:name: Build Docker imagediff --git a/CLAUDE.md b/CLAUDE.mdindex ef1eafcf94..18f023e881 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -25,7 +25,7 @@ pnpm desktop:build # Electron# Testpnpm test:all # All tests (parallel + sequential)pnpm test:parallel # Client + most package tests-pnpm test:sequential # Server (shared DB) + browser-mode tests (ckeditor5, ckeditor5-mermaid, ckeditor5-math)+pnpm test:sequential # Server (shared DB) + browser-mode tests (ckeditor5, ckeditor5-math)pnpm --filter server test # Single package testspnpm coverage # Coverage reports@@ -75,7 +75,7 @@ packages/codemirror/ # Code editor integrationhighlightjs/ # Syntax highlightingshare-theme/ # Theme for shared/published notes- ckeditor5-math/, ckeditor5-mermaid/+ ckeditor5-math/express-partial-content/, pdfjs-viewer/, splitjs/turndown-plugin-gfm/```diff --git a/docs/Developer Guide/Developer Guide/Architecture.md b/docs/Developer Guide/Developer Guide/Architecture.mdindex 85ac9f79e9..4c0c48059f 100644--- a/docs/Developer Guide/Developer Guide/Architecture.md+++ b/docs/Developer Guide/Developer Guide/Architecture.md@@ -95,7 +95,6 @@ trilium/│ ├── codemirror/ # Code editor customizations│ ├── highlightjs/ # Syntax highlighting│ ├── ckeditor5-math/ # CKEditor plugin: math equations-│ ├── ckeditor5-mermaid/ # CKEditor plugin: diagrams│ ├── express-partial-content/ # HTTP partial content middleware│ ├── share-theme/ # Shared note theme│ ├── splitjs/ # Split pane librarydiff --git a/flake.nix b/flake.nixindex ce685db4da..bfe75eb9d6 100644--- a/flake.nix+++ b/flake.nix@@ -239,7 +239,6 @@ nodejs.pythoncomponents = ["packages/ckeditor5""packages/ckeditor5-math"- "packages/ckeditor5-mermaid""packages/codemirror""packages/commons""packages/express-partial-content"diff --git a/package.json b/package.jsonindex f92ab75141..83c75f46d1 100644--- a/package.json+++ b/package.json@@ -40,8 +40,8 @@"docs:preview": "pnpm http-server site -p 9000","edit-docs:edit-demo": "pnpm run --filter edit-docs edit-demo","test:all": "pnpm test:parallel && pnpm test:sequential",- "test:parallel": "pnpm --filter=!server --filter=!ckeditor5-mermaid --filter=!ckeditor5-math --filter=!ckeditor5 --parallel test",- "test:sequential": "pnpm --filter=server --filter=ckeditor5-mermaid --filter=ckeditor5-math --filter=ckeditor5 --sequential test",+ "test:parallel": "pnpm --filter=!server --filter=!ckeditor5-math --filter=!ckeditor5 --parallel test",+ "test:sequential": "pnpm --filter=server --filter=ckeditor5-math --filter=ckeditor5 --sequential test","typecheck": "tsx scripts/filter-tsc-output.mts","dev:format-check": "eslint -c eslint.format.config.mjs .","dev:format-fix": "eslint -c eslint.format.config.mjs . --fix",diff --git a/packages/ckeditor5-mermaid/.editorconfig b/packages/ckeditor5-mermaid/.editorconfigdeleted file mode 100644index 37ea8ff914..0000000000--- a/packages/ckeditor5-mermaid/.editorconfig+++ /dev/null@@ -1,19 +0,0 @@-# Configurations to normalize the IDE behavior.-# http://editorconfig.org/--root = true--[*]-indent_style = tab-tab_width = 4-charset = utf-8-end_of_line = lf-trim_trailing_whitespace = true-insert_final_newline = true--[*.{js,jsx,ts}]-quote_type = single--[package.json]-indent_style = space-tab_width = 2diff --git a/packages/ckeditor5-mermaid/.gitattributes b/packages/ckeditor5-mermaid/.gitattributesdeleted file mode 100644index 41be6fafe7..0000000000--- a/packages/ckeditor5-mermaid/.gitattributes+++ /dev/null@@ -1,19 +0,0 @@-* text=auto--*.htaccess eol=lf-*.cgi eol=lf-*.sh eol=lf--*.css text-*.htm text-*.html text-*.js text-*.ts text-*.json text-*.php text-*.txt text-*.md text--*.png -text-*.gif -text-*.jpg -textdiff --git a/packages/ckeditor5-mermaid/.gitignore b/packages/ckeditor5-mermaid/.gitignoredeleted file mode 100644index e7b2bce4e5..0000000000--- a/packages/ckeditor5-mermaid/.gitignore+++ /dev/null@@ -1,14 +0,0 @@-build/-coverage/-dist/-node_modules/-tmp/-sample/ckeditor.dist.js--# Ignore compiled TypeScript files.-src/**/*.js-src/**/*.d.ts--.vitest-attachments-# Vitest browser-mode writes screenshots under each test dir (e.g. tests/commands/__screenshots__).-**/__screenshots__/diff --git a/packages/ckeditor5-mermaid/.stylelintrc b/packages/ckeditor5-mermaid/.stylelintrcdeleted file mode 100644index 1d86a41f98..0000000000--- a/packages/ckeditor5-mermaid/.stylelintrc+++ /dev/null@@ -1,3 +0,0 @@-{- "extends": "stylelint-config-ckeditor5"-}diff --git a/packages/ckeditor5-mermaid/README.md b/packages/ckeditor5-mermaid/README.mddeleted file mode 100644index 8ed87bb784..0000000000--- a/packages/ckeditor5-mermaid/README.md+++ /dev/null@@ -1,148 +0,0 @@-@triliumnext/ckeditor5-mermaid-==============================--Warning: This is an experimental plugin that comes with no support, use it at your own risk.--This package contains a Mermaid feature for CKEditor 5.--## Table of contents--- [@triliumnext/ckeditor5-mermaid](#triliumnextckeditor5-mermaid)- - [Table of contents](#table-of-contents)- - [Developing the package](#developing-the-package)- - [Available scripts](#available-scripts)- - [`start`](#start)- - [`test`](#test)- - [`lint`](#lint)- - [`stylelint`](#stylelint)- - [`build:dist`](#builddist)- - [`translations:synchronize`](#translationssynchronize)- - [`translations:validate`](#translationsvalidate)- - [`ts:build` and `ts:clear`](#tsbuild-and-tsclear)- - [License](#license)- - [Trademarks](#trademarks)--## Developing the package--To read about the CKEditor 5 Framework, visit the [CKEditor 5 Framework documentation](https://ckeditor.com/docs/ckeditor5/latest/framework/index.html).--## Available scripts--NPM scripts are a convenient way to provide commands in a project. They are defined in the `package.json` file and shared with people contributing to the project. It ensures developers use the same command with the same options (flags).--All the scripts can be executed by running `npm run <script>`. Pre and post commands with matching names will be run for those as well.--The following scripts are available in the package.--### `start`--Starts an HTTP server with the live-reload mechanism that allows previewing and testing of plugins available in the package.--When the server starts, the default browser will open the developer sample. This can be disabled by passing the `--no-open` option to that command.--You can also define the language that will translate the created editor by specifying the `--language [LANG]` option. It defaults to `'en'`.--Examples:--```bash-# Starts the server and open the browser.-npm run start--# Disable auto-opening the browser.-npm run start -- --no-open--# Create the editor with the interface in German.-npm run start -- --language=de-```--### `test`--Allows executing unit tests for the package specified in the `tests/` directory. To check the code coverage, add the `--coverage` modifier. See other [CLI flags](https://vitest.dev/guide/cli.html) in Vitest.--Examples:--```bash-# Execute tests.-npm run test--# Generate code coverage report after each change in the sources.-npm run test -- --coverage-```--### `lint`--Runs ESLint, which analyzes the code (all `*.ts` files) to quickly find problems.--Examples:--```bash-# Execute eslint.-npm run lint-```--### `stylelint`--Similar to the `lint` task, stylelint analyzes the CSS code (`*.css` files in the `theme/` directory) in the package.--Examples:--```bash-# Execute stylelint.-npm run stylelint-```--### `build:dist`--Creates npm and browser builds of your plugin. These builds can be added to the editor by following the [Configuring CKEditor 5 features](https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/configuration.html) guide.--Examples:--```bash-# Builds the `npm` and browser files thats are ready to publish.-npm run build:dist-```--### `translations:synchronize`--Synchronizes translation messages (arguments of the `t()` function) by performing the following steps:-- * Collect all translation messages from the package by finding `t()` calls in source files.- * Detect if translation context is valid, i.e. whether the provided values do not interfere with the values specified in the `@ckeditor/ckeditor5-core` package.- * If there are no validation errors, update all translation files (`*.po` files) to be in sync with the context file:- * unused translation entries are removed,- * missing translation entries are added with empty string as the message translation,- * missing translation files are created for languages that do not have own `*.po` file yet.--The task may end with an error if one of the following conditions is met:--* Found the `Unused context` error – entries specified in the `lang/contexts.json` file are not used in source files. They should be removed.-* Found the `Duplicated contex` error – some of the entries are duplicated. Consider removing them from the `lang/contexts.json` file, or rewriting them.-* Found the `Missing context` error – entries specified in source files are not described in the `lang/contexts.json` file. They should be added.--Examples:--```bash-npm run translations:synchronize-```--### `translations:validate`--Peforms only validation steps as described in [`translations:synchronize`](#translationssynchronize) script, but without modifying any files. It only checks the correctness of the context file against the `t()` function calls.--Examples:--```bash-npm run translations:validate-```--### `ts:build` and `ts:clear`--These scripts compile TypeScript and remove the compiled files. They are used in the aforementioned life cycle scripts, and there is no need to call them manually.--## License--See [LICENSE.md](LICENSE.md) file.--### Trademarks--**CKEditor** is a trademark of [CKSource](https://cksource.com) Holding sp. z o.o. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.diff --git a/packages/ckeditor5-mermaid/ckeditor5-metadata.json b/packages/ckeditor5-mermaid/ckeditor5-metadata.jsondeleted file mode 100644index a43a183a96..0000000000--- a/packages/ckeditor5-mermaid/ckeditor5-metadata.json+++ /dev/null@@ -1,17 +0,0 @@-{- "plugins": [- {- "name": "Mermaid",- "className": "Mermaid",- "description": "Mermaid widget for CKEditor 5.",- "path": "src/mermaid.ts",- "uiComponents": [- {- "name": "mermaid",- "type": "Button",- "iconPath": "theme/icons/insert.svg"- }- ]- }- ]-}diff --git a/packages/ckeditor5-mermaid/eslint.config.js b/packages/ckeditor5-mermaid/eslint.config.jsdeleted file mode 100644index 8e49f74ea6..0000000000--- a/packages/ckeditor5-mermaid/eslint.config.js+++ /dev/null@@ -1,83 +0,0 @@-import globals from 'globals';-import { defineConfig } from 'eslint/config';-import eslintConfigCKEditor5 from 'eslint-config-ckeditor5';-import eslintPluginCKEditor5Rules from 'eslint-plugin-ckeditor5-rules';--export default defineConfig( [- eslintConfigCKEditor5,- {- name: 'Ignored files config',- ignores: [- // Ignore compiled JavaScript files, as they are generated automatically.- 'src/**/*.js',- // Also, do not check typing declarations, too.- 'src/**/*.d.ts',- // Ignore the entire `dist/` (the NIM build).- 'dist/**'- ]- },- {- name: 'Base config',- languageOptions: {- ecmaVersion: 'latest',- sourceType: 'module'- },- linterOptions: {- reportUnusedInlineConfigs: 'error',- reportUnusedDisableDirectives: 'error'- },- plugins: {- 'ckeditor5-rules': eslintPluginCKEditor5Rules- },- rules: {- // This rule disallows importing from any path other than the package main entrypoint.- 'ckeditor5-rules/allow-imports-only-from-main-package-entry-point': 'error',- // As required by the ECMAScript (ESM) standard, all imports must include a file extension.- // If the import does not include it, this rule will try to automatically detect the correct file extension.- 'ckeditor5-rules/require-file-extensions-in-imports': [ 'error', {- extensions: [ '.ts', '.js', '.json' ]- } ],- // This rule ensures that all imports from `@ckeditor/*` packages are done through the main package entry points.- // This is required for the editor types to work properly and to ease migration to the installation methods- // introduced in CKEditor 5 version 42.0.0.- 'ckeditor5-rules/no-legacy-imports': 'error'- }- },- {- name: 'NodeJS environment config',- files: [- './scripts/**/*.{js,mjs,cjs}'- ],- languageOptions: {- globals: {- ...globals.node- }- }- },- {- name: 'Browser environment config',- files: [- './sample/**/*.{ts,mts,cts}',- './src/**/*.{ts,mts,cts}',- './tests/**/*.{ts,mts,cts}',- './typings/**/*.d.ts'- ],- languageOptions: {- globals: {- ...globals.browser- }- }- },- {- name: 'Sample and tests config',- files: [- 'sample/**/*.{ts,mts,cts}',- 'tests/**/*.{ts,mts,cts}'- ],- rules: {- // To write complex tests, you may need to import files that are not exported in DLL files by default.- // Hence, imports CKEditor 5 packages in test files are not checked.- 'ckeditor5-rules/ckeditor-imports': 'off'- }- }-] );diff --git a/packages/ckeditor5-mermaid/lang/contexts.json b/packages/ckeditor5-mermaid/lang/contexts.jsondeleted file mode 100644index fbfface895..0000000000--- a/packages/ckeditor5-mermaid/lang/contexts.json+++ /dev/null@@ -1,3 +0,0 @@-{- "Mermaid": "Content for a tooltip is displayed when a user hovers the CKEditor 5 icon."-}diff --git a/packages/ckeditor5-mermaid/package.json b/packages/ckeditor5-mermaid/package.jsondeleted file mode 100644index f6ea3cafa2..0000000000--- a/packages/ckeditor5-mermaid/package.json+++ /dev/null@@ -1,44 +0,0 @@-{- "name": "@triliumnext/ckeditor5-mermaid",- "version": "0.0.4",- "description": "Mermaid widget for CKEditor 5.",- "keywords": [- "ckeditor",- "ckeditor5",- "ckeditor 5",- "ckeditor5-feature",- "ckeditor5-plugin",- "ckeditor5-package-generator"- ],- "type": "module",- "main": "src/index.ts",- "license": "SEE LICENSE IN LICENSE.md",- "author": "CKSource (https://cksource.com/)",- "homepage": "https://github.com/ckeditor/ckeditor5-mermaid",- "engines": {- "node": ">=18.0.0",- "npm": ">=5.7.1"- },- "devDependencies": {- "@ckeditor/ckeditor5-inspector": ">=4.1.0",- "@vitest/browser": "4.1.10",- "ckeditor5": "48.3.1",- "eslint": "10.8.0",- "eslint-config-ckeditor5": ">=9.1.0",- "stylelint": "17.14.1",- "stylelint-config-ckeditor5": ">=9.1.0",- "typescript": "6.0.3",- "vite-plugin-svgo": "2.0.0",- "vitest": "4.1.10",- "webdriverio": "9.30.0"- },- "peerDependencies": {- "ckeditor5": "48.3.1"- },- "scripts": {- "lint": "eslint \"**/*.{js,ts}\" --quiet",- "stylelint": "stylelint --quiet --allow-empty-input 'theme/**/*.css'",- "test": "vitest",- "test:debug": "vitest --inspect-brk --no-file-parallelism --browser.headless=false"- }-}diff --git a/packages/ckeditor5-mermaid/sample/ckeditor.ts b/packages/ckeditor5-mermaid/sample/ckeditor.tsdeleted file mode 100644index f5a95e5016..0000000000--- a/packages/ckeditor5-mermaid/sample/ckeditor.ts+++ /dev/null@@ -1,113 +0,0 @@-declare global {- interface Window {- editor: ClassicEditor;- }-}--import {- ClassicEditor,- Autoformat,- Base64UploadAdapter,- BlockQuote,- Bold,- Code,- CodeBlock,- Essentials,- Heading,- Image,- ImageCaption,- ImageStyle,- ImageToolbar,- ImageUpload,- Indent,- Italic,- Link,- List,- MediaEmbed,- Paragraph,- Table,- TableToolbar-} from 'ckeditor5';--import CKEditorInspector from '@ckeditor/ckeditor5-inspector';--import Mermaid from '../src/mermaid.js';--import 'ckeditor5/ckeditor5.css';--ClassicEditor- .create( document.getElementById( 'editor' )!, {- licenseKey: 'GPL',- plugins: [- Mermaid,- Essentials,- Autoformat,- BlockQuote,- Bold,- Heading,- Image,- ImageCaption,- ImageStyle,- ImageToolbar,- ImageUpload,- Indent,- Italic,- Link,- List,- MediaEmbed,- Paragraph,- Table,- TableToolbar,- CodeBlock,- Code,- Base64UploadAdapter- ],- toolbar: [- 'undo',- 'redo',- '|',- 'mermaid',- '|',- 'heading',- '|',- 'bold',- 'italic',- 'link',- 'code',- 'bulletedList',- 'numberedList',- '|',- 'outdent',- 'indent',- '|',- 'uploadImage',- 'blockQuote',- 'insertTable',- 'mediaEmbed',- 'codeBlock'- ],- image: {- toolbar: [- 'imageStyle:inline',- 'imageStyle:block',- 'imageStyle:side',- '|',- 'imageTextAlternative'- ]- },- table: {- contentToolbar: [- 'tableColumn',- 'tableRow',- 'mergeTableCells'- ]- }- } )- .then( editor => {- window.editor = editor;- CKEditorInspector.attach( editor );- window.console.log( 'CKEditor 5 is ready.', editor );- } )- .catch( err => {- window.console.error( err.stack );- } );diff --git a/packages/ckeditor5-mermaid/sample/dll.html b/packages/ckeditor5-mermaid/sample/dll.htmldeleted file mode 100644index bf07ac949b..0000000000--- a/packages/ckeditor5-mermaid/sample/dll.html+++ /dev/null@@ -1,172 +0,0 @@-<!DOCTYPE html>-<html lang="en">-<head>- <link rel="icon" type="image/png" href="https://ckeditor.com/docs/ckeditor5/latest/assets/img/favicons/32x32.png" sizes="32x32">- <meta charset="utf-8">- <title>CKEditor 5 – DLL Sample</title>- <style>- body {- max-width: 800px;- margin: 20px auto;- }- </style>-</head>-<body>--<h1>CKEditor 5 – DLL Sample</h1>--<div id="editor">- <h2>Production sample</h2>- <p>- This is a demo of the <a href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/overview.html#classic-editor">classic editor- build</a>, initialized using the <a href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/development/dll-builds.html">DLL builds</a>.- </p>- <p>- Your plugin (Mermaid) generated by the tool is already loaded into the editor. By default, it has an example button that adds some text to the editor. Whenever you change the plugin's name or toolbar items, make sure to update the editor configuration in the <code>sample/dll.html</code> file.- </p>-- <h3>Uncaught TypeError</h3>- <p>If the editor is not initialized correctly and the browser console displays an error such as the following:</p>- <pre><code>Uncaught TypeError: Cannot read properties of undefined (reading 'Mermaid') at dll.html:85</code></pre>- <p>it means that the DLL build of the <code>@triliumnext/ckeditor5-mermaid</code> package has not been created.</p>- <p>Please call the <code>npm run dll:build</code> command in the CLI, and after it finishes, refresh the page.</p>-- <h3>Anatomy of the DLL build</h3>- <p>The source of the DLL build is located in the <code>src/index.ts</code> file. It may export as many things as the package offers.</p>-- <h4>Maintaining the sample</h4>- <p>Whenever you change objects exported by the DLL build, please review the content of the sample. Things to keep in mind:</p>- <ul>- <li>Review the list of loaded plugins in the configuration.</li>- <li>Review names of items registered in toolbars.</li>- </ul>-- <h3>The goal</h3>- <p>The primary purpose of the sample is to verify whether the plugins in the package will work together with CKEditor 5 created with the DLL approach.</p>-- <h3>Publishing the package</h3>- <p>- While releasing TypeScript package on npm, few things have to be taken care of:- </p>- <ul>- <li>Building DLL</li>- <li>Building TypeScript</li>- <li>Changing the <code>main</code> filed in <code>package.json</code> to <code>.js</code> extension</li>- </ul>- <p>- Likewise, after the release, there are few steps:- </p>- <ul>- <li>Deleting compiled TypeScript files (they are generated in the <code>src</code> directory, and create needless clutter)</li>- <li>Changing the <code>main</code> filed in <code>package.json</code> back to <code>.ts</code> extension</li>- </ul>- <p>- When calling <code>npm publish</code>, those steps are handled automatically by predefined <code>prepublishOnly</code> and <code>postpublish</code> scripts. To learn more, see <a href="https://docs.npmjs.com/cli/v7/using-npm/scripts#pre--post-scripts">NPM docs</a>.- </p>-- <h3>Reporting issues</h3>- <p>If you found a problem with CKEditor 5 or the package generator, please, report an issue:</p>- <ul>- <li><a href="https://github.com/ckeditor/ckeditor5/issues/new/choose">CKEditor 5</a></li>- <li><a href="https://github.com/ckeditor/create-ckeditor5-plugin/issues/new">The package generator</a></li>- </ul>-</div>--<!-- DLL builds are served from the `node_modules/` directory -->-<script src="../node_modules/ckeditor5/build/ckeditor5-dll.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-editor-classic/build/editor-classic.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-code-block/build/code-block.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-essentials/build/essentials.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-basic-styles/build/basic-styles.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-heading/build/heading.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-autoformat/build/autoformat.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-block-quote/build/block-quote.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-image/build/image.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-link/build/link.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-indent/build/indent.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-media-embed/build/media-embed.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-list/build/list.js"></script>-<script src="../node_modules/@ckeditor/ckeditor5-table/build/table.js"></script>--<!-- The "@triliumnext/ckeditor5-mermaid" package DLL build is served from the `build/` directory -->-<script src="../build/mermaid.js"></script>--<script>- console.log( 'Objects exported by the DLL build:', CKEditor5[ 'mermaid' ] );-- CKEditor5.editorClassic.ClassicEditor- .create( document.querySelector( '#editor' ), {- plugins: [- CKEditor5[ 'mermaid' ].Mermaid,- CKEditor5.essentials.Essentials,- CKEditor5.autoformat.Autoformat,- CKEditor5.blockQuote.BlockQuote,- CKEditor5.basicStyles.Bold,- CKEditor5.heading.Heading,- CKEditor5.image.Image,- CKEditor5.image.ImageCaption,- CKEditor5.image.ImageStyle,- CKEditor5.image.ImageToolbar,- CKEditor5.image.ImageUpload,- CKEditor5.indent.Indent,- CKEditor5.basicStyles.Italic,- CKEditor5.link.Link,- CKEditor5.list.List,- CKEditor5.mediaEmbed.MediaEmbed,- CKEditor5.paragraph.Paragraph,- CKEditor5.table.Table,- CKEditor5.table.TableToolbar,- CKEditor5.codeBlock.CodeBlock,- CKEditor5.basicStyles.Code,- CKEditor5.upload.Base64UploadAdapter- ],- toolbar: [- 'mermaid',- '|',- 'heading',- '|',- 'bold',- 'italic',- 'link',- 'code',- 'bulletedList',- 'numberedList',- '|',- 'outdent',- 'indent',- '|',- 'uploadImage',- 'blockQuote',- 'insertTable',- 'mediaEmbed',- 'codeBlock',- '|',- 'undo',- 'redo'- ],- image: {- toolbar: [- 'imageStyle:inline',- 'imageStyle:block',- 'imageStyle:side',- '|',- 'imageTextAlternative'- ]- },- table: {- contentToolbar: [- 'tableColumn',- 'tableRow',- 'mergeTableCells'- ]- }- } )- .then( editor => {- window.editor = editor;- } )- .catch( error => {- console.error( 'There was a problem initializing the editor.', error );- } );-</script>-</body>-</html>diff --git a/packages/ckeditor5-mermaid/sample/index.html b/packages/ckeditor5-mermaid/sample/index.htmldeleted file mode 100644index cdf5db652f..0000000000--- a/packages/ckeditor5-mermaid/sample/index.html+++ /dev/null@@ -1,123 +0,0 @@-<!DOCTYPE html>-<html lang="en">--<head>- <link rel="icon" type="image/png" href="https://ckeditor.com/docs/ckeditor5/latest/assets/img/favicons/32x32.png"- sizes="32x32">- <meta charset="utf-8">- <title>CKEditor 5 – Development Sample</title>- <style>- body {- max-width: 800px;- margin: 20px auto;- }- </style>-</head>--<body>-- <h1>CKEditor 5 – Development Sample</h1>-- <div id="editor">- <h2>Development environment</h2>- <p>- This is a demo of the <a- href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/overview.html#classic-editor">classic- editor- build</a> that loads your plugin (<code>Mermaid</code>) generated by the- tool. You can modify this- sample and use it to validate whether a plugin or a set of plugins work fine.- </p>- <p>- <code>Mermaid</code> inserts text into the editor. You can click the- CKEditor 5 icon in the toolbar and see the results.- </p>-- <h3>Helpful resources</h3>- <ul>- <li>Architecture- <ul>- <li>- <a- href="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/architecture/core-editor-architecture.html">Core- editor architecture</a>- </li>- </ul>- <ul>- <li>- <a- href="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/architecture/editing-engine.html">The- editing engine</a>- </li>- </ul>- <ul>- <li>- <a- href="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/architecture/ui-library.html">The- UI library</a>- </li>- </ul>- </li>-- <li>- <a- href="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/browser-compatibility.html">Browser- compatibility</a>- </li>-- <li>- <a href="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html">The error- codes</a>- </li>-- <li><a href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/development/dll-builds.html">The DLL- builds</a></li>- </ul>-- <h3>The directory structure</h3>-- <p>- The code snippet below presents the directory structure.- </p>-- <pre><code class="language-plaintext">.-├─ lang-│ └─ contexts.json # Entries used for creating translations.-├─ sample-│ ├─ dll.html # The editor initialized using the DLL builds. Check README for details.-│ ├─ index.html # The currently displayed file.-│ └─ ckeditor.ts # The editor initialization script.-├─ src-│ ├─ mermaid.ts-│ ├─ augmentation.ts # Type augmentations for the `@ckeditor/ckeditor5-core` module. Read more in <a href="https://ckeditor.com/docs/ckeditor5/latest/api/module_core_plugincollection-PluginsMap.html">PluginsMap</a> and <a href="https://ckeditor.com/docs/ckeditor5/latest/api/module_core_commandcollection-CommandsMap.html">CommandsMap</a>.-│ ├─ index.ts # The modules exported by the package when using the DLL builds.-│ └─ **/*.ts # All TypeScript source files should be saved here.-├─ tests-│ ├─ mermaid.ts-│ ├─ index.ts # Tests for the plugin.-│ └─ **/*.ts # All tests should be saved here.-├─ theme-│ ├─ icons-│ │ ├─ ckeditor.svg # The CKEditor 5 icon displayed in the toolbar.-│ │ └─ **/*.svg # All icon files should be saved here.-│ └─ **/*.css # All CSS files should be saved here.-├─ typings-│ └─ **/*.d.ts # Files containing type definitions.-├─ .editorconfig-├─ ...-├─ README.md-└─ tsconfig.json # TypeScript configuration file.</code></pre>-- <h3>Reporting issues</h3>- <p>If you found a problem with CKEditor 5 or the package generator, please, report an issue:</p>- <ul>- <li><a href="https://github.com/ckeditor/ckeditor5/issues/new/choose">CKEditor 5</a></li>- <li><a href="https://github.com/ckeditor/ckeditor5-package-generator/issues/new">The package generator</a>- </li>- </ul>- </div>-- <script src="./ckeditor.dist.js"></script>-</body>--</html>diff --git a/packages/ckeditor5-mermaid/src/augmentation.ts b/packages/ckeditor5-mermaid/src/augmentation.tsdeleted file mode 100644index 60b27e96b4..0000000000--- a/packages/ckeditor5-mermaid/src/augmentation.ts+++ /dev/null@@ -1,37 +0,0 @@-import type { Mermaid } from './index.js';-import MermaidEditing from './mermaidediting.js';-import MermaidToolbar from './mermaidtoolbar.js';-import MermaidUI, { type MermaidSample } from './mermaidui.js';--declare global {- interface MermaidInstance {- initialize(config: MermaidConfig): void;- render(id: string, source: string): Promise<{ svg: string }>;- }-- interface MermaidConfig {-- }-- var mermaid: Mermaid | null | undefined;-}--declare module 'ckeditor5' {- interface PluginsMap {- [ Mermaid.pluginName ]: Mermaid;- [ MermaidEditing.pluginName ]: MermaidEditing;- [ MermaidToolbar.pluginName ]: MermaidToolbar;- [ MermaidUI.pluginName]: MermaidUI;- }-- interface EditorConfig {- "mermaid"?: {- lazyLoad?: () => Promise<MermaidInstance> | MermaidInstance;- config: MermaidConfig;- /** Diagram templates listed in the insert-diagram split button's dropdown. */- samples?: MermaidSample[];- }- }--}-diff --git a/packages/ckeditor5-mermaid/src/index.ts b/packages/ckeditor5-mermaid/src/index.tsdeleted file mode 100644index 604bcc5376..0000000000--- a/packages/ckeditor5-mermaid/src/index.ts+++ /dev/null@@ -1,19 +0,0 @@-import './augmentation.js';--export { default as Mermaid } from './mermaid.js';-export { INSERT_MERMAID_COMMAND } from './commands/insertMermaidCommand.js';-export type { MermaidSample } from './mermaidui.js';-import infoIcon from './../theme/icons/info.svg?raw';-import insertMermaidIcon from './../theme/icons/insert.svg?raw';-import previewModeIcon from './../theme/icons/preview-mode.svg?raw';-import splitModeIcon from './../theme/icons/split-mode.svg?raw';-import sourceModeIcon from './../theme/icons/source-mode.svg?raw';-import "../theme/mermaid.css";--export const icons = {- infoIcon,- insertMermaidIcon,- previewModeIcon,- splitModeIcon,- sourceModeIcon-};diff --git a/packages/ckeditor5-mermaid/src/mermaid.ts b/packages/ckeditor5-mermaid/src/mermaid.tsdeleted file mode 100644index e839c825be..0000000000--- a/packages/ckeditor5-mermaid/src/mermaid.ts+++ /dev/null@@ -1,17 +0,0 @@-import { Plugin } from 'ckeditor5';--import MermaidEditing from './mermaidediting.js';-import MermaidToolbar from './mermaidtoolbar.js';-import MermaidUI from './mermaidui.js';--export default class Mermaid extends Plugin {-- static get requires() {- return [ MermaidEditing, MermaidToolbar, MermaidUI ];- }-- public static get pluginName() {- return 'Mermaid' as const;- }--}diff --git a/packages/ckeditor5-mermaid/tests/index.ts b/packages/ckeditor5-mermaid/tests/index.tsdeleted file mode 100644index a2ec5fd563..0000000000--- a/packages/ckeditor5-mermaid/tests/index.ts+++ /dev/null@@ -1,34 +0,0 @@-import { Mermaid as MermaidDll, icons } from '../src/index.js';-import Mermaid from '../src/mermaid.js';--import infoIcon from './../theme/icons/info.svg?raw';-import insertMermaidIcon from './../theme/icons/insert.svg?raw';-import previewModeIcon from './../theme/icons/preview-mode.svg?raw';-import splitModeIcon from './../theme/icons/split-mode.svg?raw';-import sourceModeIcon from './../theme/icons/source-mode.svg?raw';-import { describe, it } from 'vitest';-import { expect } from 'vitest';--describe( 'CKEditor5 Mermaid DLL', () => {- it( 'exports MermaidWidget', () => {- expect( MermaidDll ).to.equal( Mermaid );- } );-- describe( 'icons', () => {- it( 'exports the "insertMermaidIcon" icon', () => {- expect( icons.insertMermaidIcon ).to.equal( insertMermaidIcon );- } );- it( 'exports the "infoIcon" icon', () => {- expect( icons.infoIcon ).to.equal( infoIcon );- } );- it( 'exports the "previewModeIcon" icon', () => {- expect( icons.previewModeIcon ).to.equal( previewModeIcon );- } );- it( 'exports the "splitModeIcon" icon', () => {- expect( icons.splitModeIcon ).to.equal( splitModeIcon );- } );- it( 'exports the "sourceModeIcon" icon', () => {- expect( icons.sourceModeIcon ).to.equal( sourceModeIcon );- } );- } );-} );diff --git a/packages/ckeditor5-mermaid/tests/manual/markdown.html b/packages/ckeditor5-mermaid/tests/manual/markdown.htmldeleted file mode 100644index 2285c9adf0..0000000000--- a/packages/ckeditor5-mermaid/tests/manual/markdown.html+++ /dev/null@@ -1,67 +0,0 @@-<style type="text/css">- #editor, .ck-editor {- /* Adjust width to the typical width in GH. */- width: 820px !important;- }-- pre.markdown-output {- background: hsl(70, 7%, 16%);- color: hsl(0, 0%, 100%);- display: block;- font-size: 1em;- font-family: Monaco, Menlo, Consolas, "Roboto Mono", "Courier New", "Ubuntu Mono", monospace;- padding: 1.333em;- }-- .editor-container {- display:flex;- }-- .output-container {- padding-left: 20px;- }-</style>--<div class="editor-container">- <textarea id="editor">-Mermaid snippet:--```mermaid-flowchart TB-A --> C-A --> D-B --> C-B --> D-```--More complex case:--```mermaid-sequenceDiagram-participant Alice-participant Bob-Alice->>John: Hello John, how are you?-loop Healthcheck- John->>John: Fight against hypochondria-end-Note right of John: Rational thoughts <br/>prevail!-John-->>Alice: Great!-John->>Bob: How about you?-Bob-->>John: Jolly good!-```--Javascript snippet:--```Javascript-var foo = 'bar';--alert( foo );-```- </textarea>-- <div class="output-container">- <p>Output:</p>-- <pre class="markdown-output"><code id="markdown-output"></code></pre>- </div>-</div>diff --git a/packages/ckeditor5-mermaid/tests/manual/markdown.md b/packages/ckeditor5-mermaid/tests/manual/markdown.mddeleted file mode 100644index abd7e5eec4..0000000000--- a/packages/ckeditor5-mermaid/tests/manual/markdown.md+++ /dev/null@@ -1 +0,0 @@-## Mermaid widget\ No newline at end of filediff --git a/packages/ckeditor5-mermaid/tests/manual/markdown.ts b/packages/ckeditor5-mermaid/tests/manual/markdown.tsdeleted file mode 100644index 3d55d418d9..0000000000--- a/packages/ckeditor5-mermaid/tests/manual/markdown.ts+++ /dev/null@@ -1,59 +0,0 @@-/**- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license- */--/* globals console, window, document */--import { ClassicEditor, Typing, Paragraph, Undo, Enter, Clipboard, Link, Bold, Italic, Markdown, CodeBlock } from 'ckeditor5';--import Mermaid from '../../src/mermaid.js';--ClassicEditor- .create( document.querySelector( '#editor' ), {- licenseKey: "GPL",- plugins: [- Markdown,- Typing,- Paragraph,- Undo,- Enter,- Clipboard,- Link,- Bold,- Italic,- CodeBlock,- Mermaid- ],- toolbar: [ 'bold', 'italic', 'link', 'undo', 'redo', 'codeBlock', 'mermaid' ],- codeBlock: {- languages: [- { language: 'plaintext', label: 'Plain text', class: '' },- { language: 'javascript', label: 'JavaScript' },- { language: 'python', label: 'Python' },- { language: 'mermaid', label: 'Mermaid' }- ]- }-- } )- .then( editor => {- window.editor = editor;-- setupMarkdownOutputPreview( editor );- } )- .catch( err => {- console.error( err.stack );- } );--function setupMarkdownOutputPreview( editor ) {- const outputElement = document.querySelector( '#markdown-output' );-- editor.model.document.on( 'change', () => {- outputElement.innerText = editor.getData();- } );-- // Set the initial data with delay so hightlight.js doesn't catch them.- window.setTimeout( () => {- outputElement.innerText = editor.getData();- }, 500 );-}diff --git a/packages/ckeditor5-mermaid/tests/manual/mermaid.html b/packages/ckeditor5-mermaid/tests/manual/mermaid.htmldeleted file mode 100644index 03fcf802d0..0000000000--- a/packages/ckeditor5-mermaid/tests/manual/mermaid.html+++ /dev/null@@ -1,38 +0,0 @@-<style type="text/css">- #editor, .ck-editor {- /* Adjust width to the typical width in GH. */- width: 820px !important;- }-</style>--<div id="editor">- <p>Mermaid snippet:</p>-- <pre>- <code class="mermaid language-mermaid">-flowchart TB-A --> C-A --> D-B --> C-B --> D- </code>- </pre>-- <p>More complex case:</p>-- <pre>- <code class="mermaid language-mermaid">-sequenceDiagram-participant Alice-participant Bob-Alice->>John: Hello John, how are you?-loop Healthcheck- John->>John: Fight against hypochondria-end-Note right of John: Rational thoughts <br/>prevail!-John-->>Alice: Great!-John->>Bob: How about you?-Bob-->>John: Jolly good!- </code>- </pre>-</div>diff --git a/packages/ckeditor5-mermaid/tests/manual/mermaid.md b/packages/ckeditor5-mermaid/tests/manual/mermaid.mddeleted file mode 100644index abd7e5eec4..0000000000--- a/packages/ckeditor5-mermaid/tests/manual/mermaid.md+++ /dev/null@@ -1 +0,0 @@-## Mermaid widget\ No newline at end of filediff --git a/packages/ckeditor5-mermaid/tests/manual/mermaid.ts b/packages/ckeditor5-mermaid/tests/manual/mermaid.tsdeleted file mode 100644index 389572bf7d..0000000000--- a/packages/ckeditor5-mermaid/tests/manual/mermaid.ts+++ /dev/null@@ -1,43 +0,0 @@-/**- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license- */--/* globals console, window, document */--import { ClassicEditor, Typing, Paragraph, Undo, Enter, Clipboard, Link, Bold, Italic, CodeBlock } from 'ckeditor5';--import Mermaid from '../../src/mermaid.js';--ClassicEditor- .create( document.querySelector( '#editor' ), {- licenseKey: "GPL",- plugins: [- Typing,- Paragraph,- Undo,- Enter,- Clipboard,- Link,- Bold,- Italic,- CodeBlock,- Mermaid- ],- toolbar: [ 'bold', 'italic', 'link', 'undo', 'redo', 'codeBlock', 'mermaid' ],- codeBlock: {- languages: [- { language: 'plaintext', label: 'Plain text', class: '' },- { language: 'javascript', label: 'JavaScript' },- { language: 'python', label: 'Python' },- { language: 'mermaid', label: 'Mermaid' }- ]- }-- } )- .then( editor => {- window.editor = editor;- } )- .catch( err => {- console.error( err.stack );- } );diff --git a/packages/ckeditor5-mermaid/tsconfig.json b/packages/ckeditor5-mermaid/tsconfig.jsondeleted file mode 100644index 303791fc66..0000000000--- a/packages/ckeditor5-mermaid/tsconfig.json+++ /dev/null@@ -1,41 +0,0 @@-{- "compilerOptions": {- /**- * TypeScript automagically loads typings from all "@types/*" packages if the "compilerOptions.types" array is not defined in- * this file. However, if some dependencies have "@types/*" packages as their dependencies, they'll also be loaded as well.- * As a result, TypeScript loaded "@types/node" which we don't want to use, because it allows using Node.js specific APIs that- * are not available in the browsers.- *- * To avoid such issues, we defined this empty "types" to disable automatic inclusion of the "@types/*" packages.- */- "types": [],- "lib": [- "ES2019", // Must match the "target".- "ES2020.String",- "DOM",- "DOM.Iterable"- ],- "noImplicitAny": true,- "noImplicitOverride": true,- "composite": true,- "strict": true,- "target": "es2019",- "sourceMap": true,- "allowJs": true,- "moduleDetection": "force",- "moduleResolution": "NodeNext",- "module": "NodeNext",- "skipLibCheck": true,- "noUncheckedSideEffectImports": false,- "outDir": "out-tsc",- "typeRoots": [- "typings",- "node_modules/@types"- ]- },- "include": [- "./sample",- "./src",- "./typings"- ]-}diff --git a/packages/ckeditor5-mermaid/tsconfig.test.json b/packages/ckeditor5-mermaid/tsconfig.test.jsondeleted file mode 100644index 065d98e49b..0000000000--- a/packages/ckeditor5-mermaid/tsconfig.test.json+++ /dev/null@@ -1,15 +0,0 @@-{- "extends": "./tsconfig.json",- "compilerOptions": {- "types": [- "@types/mocha"- ],- "sourceMap": true- },- "include": [- "./sample",- "./src",- "./tests",- "./typings"- ]-}diff --git a/packages/ckeditor5-mermaid/typings/ckeditor5-inspector.d.ts b/packages/ckeditor5-mermaid/typings/ckeditor5-inspector.d.tsdeleted file mode 100644index d50ee49c45..0000000000--- a/packages/ckeditor5-mermaid/typings/ckeditor5-inspector.d.ts+++ /dev/null@@ -1,7 +0,0 @@-declare module '@ckeditor/ckeditor5-inspector' {- const inspector: {- attach( editor: any ): void;- };-- export default inspector;-}diff --git a/packages/ckeditor5-mermaid/typings/types.d.ts b/packages/ckeditor5-mermaid/typings/types.d.tsdeleted file mode 100644index 09be57e1c9..0000000000--- a/packages/ckeditor5-mermaid/typings/types.d.ts+++ /dev/null@@ -1,4 +0,0 @@-declare module '*.svg?raw' {- const content: string;- export default content;-}diff --git a/packages/ckeditor5-mermaid/vitest.config.ts b/packages/ckeditor5-mermaid/vitest.config.tsdeleted file mode 100644index c35627c623..0000000000--- a/packages/ckeditor5-mermaid/vitest.config.ts+++ /dev/null@@ -1,41 +0,0 @@-/**- * @license Copyright (c) 2023-2024, CKSource Holding sp. z o.o. All rights reserved.- * For licensing, see LICENSE.md.- */--import { defineConfig } from 'vitest/config';-import svg from 'vite-plugin-svgo';-import { webdriverio } from "@vitest/browser-webdriverio";--export default defineConfig( {- plugins: [- svg()- ],- test: {- browser: {- enabled: true,- provider: webdriverio(),- headless: true,- ui: false,- instances: [ { browser: 'chrome' } ]- },- include: [- 'tests/**/*.[jt]s'- ],- globals: true,- watch: false,- passWithNoTests: true,- coverage: {- thresholds: {- lines: 100,- functions: 100,- branches: 100,- statements: 100- },- provider: 'v8',- include: [ 'src/**/*.{ts,tsx}' ],- exclude: [ '**/*.{test,spec}.{ts,mts,cts,tsx,js,jsx}', '**/*.d.ts' ],- reporter: [ 'text' ]- }- }-} );diff --git a/packages/ckeditor5/package.json b/packages/ckeditor5/package.jsonindex f4cfbc4b95..152dd80416 100644--- a/packages/ckeditor5/package.json+++ b/packages/ckeditor5/package.json@@ -16,7 +16,6 @@"dependencies": {"@triliumnext/commons": "workspace:*","@triliumnext/ckeditor5-math": "workspace:*",- "@triliumnext/ckeditor5-mermaid": "workspace:*","ckeditor5": "48.3.1"},"peerDependencies": {diff --git a/packages/ckeditor5/src/extra_slash_commands.spec.ts b/packages/ckeditor5/src/extra_slash_commands.spec.tsindex 21b4bf7a91..f93e70c899 100644--- a/packages/ckeditor5/src/extra_slash_commands.spec.ts+++ b/packages/ckeditor5/src/extra_slash_commands.spec.ts@@ -312,7 +312,7 @@ describe("buildExtraCommands", () => {});it("sample command execute calls editor.execute with INSERT_MERMAID_COMMAND and source", async () => {- const { INSERT_MERMAID_COMMAND } = await import("@triliumnext/ckeditor5-mermaid");+ const { INSERT_MERMAID_COMMAND } = await import("./plugins/mermaid/insert_mermaid_command.js");const samples = [{ name: "Flowchart", content: "flowchart LR\n A --> B" }];diff --git a/packages/ckeditor5/src/extra_slash_commands.ts b/packages/ckeditor5/src/extra_slash_commands.tsindex 70d30ea968..97c1e886da 100644--- a/packages/ckeditor5/src/extra_slash_commands.ts+++ b/packages/ckeditor5/src/extra_slash_commands.ts@@ -18,7 +18,8 @@ import internalLinkIcon from './icons/trilium.svg?raw';import noteIcon from './icons/note.svg?raw';import importMarkdownIcon from './icons/markdown-mark.svg?raw';import { icons as mathIcons, MathUI } from '@triliumnext/ckeditor5-math';-import { INSERT_MERMAID_COMMAND, type MermaidSample } from '@triliumnext/ckeditor5-mermaid';+import { INSERT_MERMAID_COMMAND } from './plugins/mermaid/insert_mermaid_command.js';+import type { MermaidSample } from './plugins/mermaid/mermaid_ui.js';import { BookmarkUI } from "ckeditor5";import bxBookmark from "boxicons/svg/regular/bx-bookmark.svg?raw";import bxNetworkChart from "boxicons/svg/regular/bx-network-chart.svg?raw";diff --git a/packages/ckeditor5-mermaid/theme/icons/info.svg b/packages/ckeditor5/src/icons/mermaid-info.svgsimilarity index 100%rename from packages/ckeditor5-mermaid/theme/icons/info.svgrename to packages/ckeditor5/src/icons/mermaid-info.svgdiff --git a/packages/ckeditor5-mermaid/theme/icons/insert.svg b/packages/ckeditor5/src/icons/mermaid-insert.svgsimilarity index 100%rename from packages/ckeditor5-mermaid/theme/icons/insert.svgrename to packages/ckeditor5/src/icons/mermaid-insert.svgdiff --git a/packages/ckeditor5-mermaid/theme/icons/preview-mode.svg b/packages/ckeditor5/src/icons/mermaid-preview-mode.svgsimilarity index 100%rename from packages/ckeditor5-mermaid/theme/icons/preview-mode.svgrename to packages/ckeditor5/src/icons/mermaid-preview-mode.svgdiff --git a/packages/ckeditor5-mermaid/theme/icons/source-mode.svg b/packages/ckeditor5/src/icons/mermaid-source-mode.svgsimilarity index 100%rename from packages/ckeditor5-mermaid/theme/icons/source-mode.svgrename to packages/ckeditor5/src/icons/mermaid-source-mode.svgdiff --git a/packages/ckeditor5-mermaid/theme/icons/split-mode.svg b/packages/ckeditor5/src/icons/mermaid-split-mode.svgsimilarity index 100%rename from packages/ckeditor5-mermaid/theme/icons/split-mode.svgrename to packages/ckeditor5/src/icons/mermaid-split-mode.svgdiff --git a/packages/ckeditor5/src/index.ts b/packages/ckeditor5/src/index.tsindex d9663dff89..2ae1459fe4 100644--- a/packages/ckeditor5/src/index.ts+++ b/packages/ckeditor5/src/index.ts@@ -21,7 +21,7 @@ export * from "./utils.js";// Import with sideffects to ensure that type augmentations are present.import "@triliumnext/ckeditor5-math";-import "@triliumnext/ckeditor5-mermaid";+import "./plugins/mermaid/mermaid.js";window[Symbol.for("cke distribution")] = "trilium";diff --git a/packages/ckeditor5/src/plugins.ts b/packages/ckeditor5/src/plugins.tsindex 0300d1c6e2..298b833157 100644--- a/packages/ckeditor5/src/plugins.ts+++ b/packages/ckeditor5/src/plugins.ts@@ -24,7 +24,7 @@ import LinkEmbed from "./plugins/link_embed/link_embed.js";import Uploadfileplugin from "./plugins/file_upload/uploadfileplugin.js";import SyntaxHighlighting from "./plugins/syntax_highlighting/index.js";import Kbd from "./plugins/keyboard_marker/keyboard_marker.js";-import { Mermaid } from "@triliumnext/ckeditor5-mermaid";+import Mermaid from "./plugins/mermaid/mermaid.js";import Admonition from "./plugins/admonition/admonition.js";import Collapsible from "./plugins/collapsible/collapsible.js";import Footnotes from "./plugins/footnotes/footnotes.js";@@ -34,7 +34,6 @@ import CopyLinkUrlButton from "./plugins/copy_link_url.js";import ImageActions from "./plugins/image_actions.js";import TriliumSnippets from "./plugins/snippets/snippets.js";-// import "@triliumnext/ckeditor5-mermaid/index.css";// import "@triliumnext/ckeditor5-math/index.css";import CodeBlockToolbar from "./plugins/code_block_toolbar.js";import CodeBlockLanguageDropdown from "./plugins/code_block_language_dropdown.js";diff --git a/packages/ckeditor5-mermaid/LICENSE.md b/packages/ckeditor5/src/plugins/mermaid/LICENSE.mdsimilarity index 100%rename from packages/ckeditor5-mermaid/LICENSE.mdrename to packages/ckeditor5/src/plugins/mermaid/LICENSE.mddiff --git a/packages/ckeditor5/src/plugins/mermaid/README.md b/packages/ckeditor5/src/plugins/mermaid/README.mdnew file mode 100644index 0000000000..3a9c2354a2--- /dev/null+++ b/packages/ckeditor5/src/plugins/mermaid/README.md@@ -0,0 +1,47 @@+# Mermaid diagrams++A `<mermaid>` block widget holding diagram source, shown as a source textarea, a rendered preview,+or both side by side. Load the `Mermaid` glue plugin; it pulls in `MermaidEditing`,+`MermaidToolbar` and `MermaidUI`.++| File | Role |+|---|---|+| `mermaid.ts` | Glue plugin; also declares the `ckeditor5` module augmentation and the global mermaid types |+| `mermaid_editing.ts` | Schema, conversion, and the renderer (`_renderMermaid`) |+| `mermaid_ui.ts` | The insert split button with its template dropdown, the mode buttons, the info button |+| `mermaid_toolbar.ts` | Registers the balloon toolbar shown when a diagram is selected |+| `insert_mermaid_command.ts` | `insertMermaid` — inserts a blank or pre-filled diagram |+| `mermaid_{preview,source_view,split_view}_command.ts` | Switch the widget's `displayMode` |+| `utils.ts` | `debounce` for the source textarea, `checkIsOn` for button state |++## The mermaid library is not a dependency++The plugin never imports mermaid. The host passes it in through editor config:++```js+mermaid: {+ lazyLoad: () => import( 'mermaid' ).then( m => m.default ),+ config: { /* mermaid initialize() config */ },+ samples: [ /* diagram templates for the insert dropdown */ ]+}+```++`_renderMermaid` calls `lazyLoad` once, memoises the promise, and calls `initialize()` on the+resolved instance. Renders are generation-stamped so a slow render that has been superseded cannot+overwrite a newer one, and a failed render shows the error message in place.++## Provenance++Derived from CKSource's `@ckeditor/ckeditor5-mermaid`, copyright CKSource Holding sp. z o.o., used+under the GPL-2.0-or-later arm of its license — see `LICENSE.md` next to this file, which combines+with this repository's AGPL-3.0-only.++Upstream describes itself as experimental and unsupported, and Trilium's copy has diverged+substantially: the split-button insert with diagram templates, the render generation guard, the+protection against double initialisation and stale renders, the lazy-load hook, and the flicker-free+re-render mechanism are all Trilium's.++It lived at `packages/ckeditor5-mermaid` until it was folded into this package — it had no consumers+outside `@triliumnext/ckeditor5`, declared no dependencies of its own, was never published, and+carried a `ckeditor5-package-generator` scaffold (sample pages, its own ESLint/Stylelint/vitest+configs) that nothing invoked.diff --git a/packages/ckeditor5-mermaid/tests/commands/insertMermaidCommand.ts b/packages/ckeditor5/src/plugins/mermaid/insert_mermaid_command.spec.tssimilarity index 95%rename from packages/ckeditor5-mermaid/tests/commands/insertMermaidCommand.tsrename to packages/ckeditor5/src/plugins/mermaid/insert_mermaid_command.spec.tsindex f6fc1bd24d..b98712da3b 100644--- a/packages/ckeditor5-mermaid/tests/commands/insertMermaidCommand.ts+++ b/packages/ckeditor5/src/plugins/mermaid/insert_mermaid_command.spec.ts@@ -1,8 +1,8 @@import { ClassicEditor, Paragraph, _setModelData as setModelData, _getModelData as getModelData } from 'ckeditor5';import { afterEach, beforeEach, describe, it } from 'vitest';import { expect } from 'vitest';-import MermaidEditing from '../../src/mermaidediting';-import InsertMermaidCommand from '../../src/commands/insertMermaidCommand';+import MermaidEditing from './mermaid_editing.js';+import InsertMermaidCommand from './insert_mermaid_command.js';/* global document */diff --git a/packages/ckeditor5-mermaid/src/commands/insertMermaidCommand.ts b/packages/ckeditor5/src/plugins/mermaid/insert_mermaid_command.tssimilarity index 100%rename from packages/ckeditor5-mermaid/src/commands/insertMermaidCommand.tsrename to packages/ckeditor5/src/plugins/mermaid/insert_mermaid_command.tsdiff --git a/packages/ckeditor5-mermaid/tests/mermaid.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid.spec.tssimilarity index 96%rename from packages/ckeditor5-mermaid/tests/mermaid.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid.spec.tsindex 5f53e4d388..45d0ebac4a 100644--- a/packages/ckeditor5-mermaid/tests/mermaid.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid.spec.ts@@ -1,6 +1,6 @@import { ClassicEditor, Essentials, Paragraph, Heading, _setModelData as setModelData } from 'ckeditor5';-import Mermaid from '../src/mermaid.js';+import Mermaid from './mermaid.js';import { afterEach, beforeEach, describe, it } from 'vitest';import { expect } from 'vitest';diff --git a/packages/ckeditor5/src/plugins/mermaid/mermaid.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid.tsnew file mode 100644index 0000000000..bb4d3759b9--- /dev/null+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid.ts@@ -0,0 +1,63 @@+import { Plugin } from 'ckeditor5';++import "../../theme/mermaid.css";+import MermaidEditing from './mermaid_editing.js';+import MermaidToolbar from './mermaid_toolbar.js';+import MermaidUI, { type MermaidSample } from './mermaid_ui.js';++/**+ * The Mermaid diagram feature: a `<mermaid>` block widget with a source textarea and a rendered+ * preview, switchable between source / split / preview modes.+ *+ * This is a "glue" plugin which loads {@link MermaidEditing}, {@link MermaidToolbar} and+ * {@link MermaidUI}.+ *+ * The mermaid library itself is not a dependency — the host supplies it through+ * `config.mermaid.lazyLoad`, so the diagram renderer is only fetched when a diagram is shown.+ *+ * Derived from CKSource's `@ckeditor/ckeditor5-mermaid`; see `LICENSE.md` and `README.md` next to+ * this file.+ */+export default class Mermaid extends Plugin {++ static get requires() {+ return [ MermaidEditing, MermaidToolbar, MermaidUI ];+ }++ public static get pluginName() {+ return 'Mermaid' as const;+ }++}++declare global {+ interface MermaidInstance {+ initialize( config: MermaidConfig ): void;+ render( id: string, source: string ): Promise<{ svg: string }>;+ }++ interface MermaidConfig {++ }++ var mermaid: Mermaid | null | undefined;+}++declare module 'ckeditor5' {+ interface PluginsMap {+ [ Mermaid.pluginName ]: Mermaid;+ [ MermaidEditing.pluginName ]: MermaidEditing;+ [ MermaidToolbar.pluginName ]: MermaidToolbar;+ [ MermaidUI.pluginName ]: MermaidUI;+ }++ interface EditorConfig {+ "mermaid"?: {+ lazyLoad?: () => Promise<MermaidInstance> | MermaidInstance;+ config: MermaidConfig;+ /** Diagram templates listed in the insert-diagram split button's dropdown. */+ samples?: MermaidSample[];+ }+ }++}diff --git a/packages/ckeditor5-mermaid/tests/mermaidconverterguards.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_converter_guards.spec.tssimilarity index 98%rename from packages/ckeditor5-mermaid/tests/mermaidconverterguards.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_converter_guards.spec.tsindex fe66c37f9a..9225d99c26 100644--- a/packages/ckeditor5-mermaid/tests/mermaidconverterguards.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_converter_guards.spec.ts@@ -1,7 +1,7 @@import { ClassicEditor, CodeBlockEditing, Essentials, Paragraph, _getModelData as getModelData, _setModelData as setModelData } from 'ckeditor5';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';-import MermaidEditing from '../src/mermaidediting.js';+import MermaidEditing from './mermaid_editing.js';/* global document */diff --git a/packages/ckeditor5-mermaid/tests/mermaidediting.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_editing.spec.tssimilarity index 99%rename from packages/ckeditor5-mermaid/tests/mermaidediting.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_editing.spec.tsindex 232701585e..3a0b8eae2c 100644--- a/packages/ckeditor5-mermaid/tests/mermaidediting.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_editing.spec.ts@@ -1,5 +1,5 @@import { ClassicEditor, Essentials, Paragraph, Heading, CodeBlockEditing, ViewElement, _setModelData as setModelData, _getModelData as getModelData, _getViewData as getViewData } from 'ckeditor5';-import MermaidEditing from '../src/mermaidediting.js';+import MermaidEditing from './mermaid_editing.js';import { afterEach, beforeEach, describe, it, expect, vi, type MockInstance } from 'vitest';/* global document */diff --git a/packages/ckeditor5-mermaid/src/mermaidediting.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_editing.tssimilarity index 97%rename from packages/ckeditor5-mermaid/src/mermaidediting.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_editing.tsindex 31a97a2a4e..02189a51a6 100644--- a/packages/ckeditor5-mermaid/src/mermaidediting.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_editing.ts@@ -1,11 +1,11 @@/**- * @module mermaid/mermaidediting+ * @module mermaid/mermaid_editing*/-import MermaidPreviewCommand from './commands/mermaidPreviewCommand.js';-import MermaidSourceViewCommand from './commands/mermaidSourceViewCommand.js';-import MermaidSplitViewCommand from './commands/mermaidSplitViewCommand.js';-import InsertMermaidCommand, { INSERT_MERMAID_COMMAND } from './commands/insertMermaidCommand.js';+import MermaidPreviewCommand from './mermaid_preview_command.js';+import MermaidSourceViewCommand from './mermaid_source_view_command.js';+import MermaidSplitViewCommand from './mermaid_split_view_command.js';+import InsertMermaidCommand, { INSERT_MERMAID_COMMAND } from './insert_mermaid_command.js';import { DowncastAttributeEvent, DowncastConversionApi, EditorConfig, ModelElement, EventInfo, ModelItem, ModelNode, Plugin, toWidget, uid, UpcastConversionApi, UpcastConversionData, ViewElement, ViewText, ViewUIElement } from 'ckeditor5';import { debounce } from './utils.js';diff --git a/packages/ckeditor5-mermaid/tests/commands/mermaidPreviewCommand.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_preview_command.spec.tssimilarity index 96%rename from packages/ckeditor5-mermaid/tests/commands/mermaidPreviewCommand.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_preview_command.spec.tsindex 0779b3b422..9ce7b053fb 100644--- a/packages/ckeditor5-mermaid/tests/commands/mermaidPreviewCommand.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_preview_command.spec.ts@@ -1,7 +1,7 @@import { ClassicEditor, Paragraph, _setModelData as setModelData, _getModelData as getModelData } from 'ckeditor5';-import MermaidPreviewCommand from '../../src/commands/mermaidPreviewCommand.js';-import MermaidEditing from '../../src/mermaidediting.js';+import MermaidPreviewCommand from './mermaid_preview_command.js';+import MermaidEditing from './mermaid_editing.js';import { afterEach, beforeEach, describe, it } from 'vitest';import { expect } from 'vitest';diff --git a/packages/ckeditor5-mermaid/src/commands/mermaidPreviewCommand.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_preview_command.tssimilarity index 96%rename from packages/ckeditor5-mermaid/src/commands/mermaidPreviewCommand.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_preview_command.tsindex a895ff7996..04c49cc9b1 100644--- a/packages/ckeditor5-mermaid/src/commands/mermaidPreviewCommand.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_preview_command.ts@@ -1,4 +1,4 @@-import { checkIsOn } from '../utils.js';+import { checkIsOn } from './utils.js';import { Command, ModelElement } from 'ckeditor5';/**diff --git a/packages/ckeditor5-mermaid/tests/mermaidrendering.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_rendering.spec.tssimilarity index 99%rename from packages/ckeditor5-mermaid/tests/mermaidrendering.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_rendering.spec.tsindex 84694195a7..8f01aa36b7 100644--- a/packages/ckeditor5-mermaid/tests/mermaidrendering.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_rendering.spec.ts@@ -1,7 +1,7 @@import { ClassicEditor, CodeBlockEditing, Essentials, Paragraph, _getModelData as getModelData, _setModelData as setModelData } from 'ckeditor5';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';-import MermaidEditing from '../src/mermaidediting.js';+import MermaidEditing from './mermaid_editing.js';/* global document */diff --git a/packages/ckeditor5-mermaid/tests/commands/mermaidSourceViewCommand.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_source_view_command.spec.tssimilarity index 96%rename from packages/ckeditor5-mermaid/tests/commands/mermaidSourceViewCommand.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_source_view_command.spec.tsindex bb1daf00d2..649b151b87 100644--- a/packages/ckeditor5-mermaid/tests/commands/mermaidSourceViewCommand.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_source_view_command.spec.ts@@ -1,7 +1,7 @@import { ClassicEditor, Paragraph, _setModelData as setModelData, _getModelData as getModelData } from 'ckeditor5';-import MermaidSourceViewCommand from '../../src/commands/mermaidSourceViewCommand.js';-import MermaidEditing from '../../src/mermaidediting.js';+import MermaidSourceViewCommand from './mermaid_source_view_command.js';+import MermaidEditing from './mermaid_editing.js';import { afterEach, beforeEach, describe, it } from 'vitest';import { expect } from 'vitest';diff --git a/packages/ckeditor5-mermaid/src/commands/mermaidSourceViewCommand.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_source_view_command.tssimilarity index 96%rename from packages/ckeditor5-mermaid/src/commands/mermaidSourceViewCommand.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_source_view_command.tsindex 0d9a55cf7b..296b11d148 100644--- a/packages/ckeditor5-mermaid/src/commands/mermaidSourceViewCommand.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_source_view_command.ts@@ -1,4 +1,4 @@-import { checkIsOn } from '../utils.js';+import { checkIsOn } from './utils.js';import { Command, ModelElement } from 'ckeditor5';/**diff --git a/packages/ckeditor5-mermaid/tests/commands/mermaidSplitViewCommand.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_split_view_command.spec.tssimilarity index 96%rename from packages/ckeditor5-mermaid/tests/commands/mermaidSplitViewCommand.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_split_view_command.spec.tsindex 782ee46504..822c23e92d 100644--- a/packages/ckeditor5-mermaid/tests/commands/mermaidSplitViewCommand.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_split_view_command.spec.ts@@ -1,7 +1,7 @@import { ClassicEditor, Paragraph, _setModelData as setModelData, _getModelData as getModelData } from 'ckeditor5';-import MermaidSplitViewCommand from '../../src/commands/mermaidSplitViewCommand.js';-import MermaidEditing from '../../src/mermaidediting.js';+import MermaidSplitViewCommand from './mermaid_split_view_command.js';+import MermaidEditing from './mermaid_editing.js';import { afterEach, beforeEach, describe, it } from 'vitest';import { expect } from 'vitest';diff --git a/packages/ckeditor5-mermaid/src/commands/mermaidSplitViewCommand.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_split_view_command.tssimilarity index 96%rename from packages/ckeditor5-mermaid/src/commands/mermaidSplitViewCommand.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_split_view_command.tsindex d604e9aa8b..adeb6c722c 100644--- a/packages/ckeditor5-mermaid/src/commands/mermaidSplitViewCommand.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_split_view_command.ts@@ -2,7 +2,7 @@* @module mermaid/mermaidsplitviewcommand*/-import { checkIsOn } from '../utils.js';+import { checkIsOn } from './utils.js';import { Command, ModelElement } from 'ckeditor5';/**diff --git a/packages/ckeditor5-mermaid/tests/mermaidtoolbar.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_toolbar.spec.tssimilarity index 99%rename from packages/ckeditor5-mermaid/tests/mermaidtoolbar.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_toolbar.spec.tsindex ba19f06851..4a7360a838 100644--- a/packages/ckeditor5-mermaid/tests/mermaidtoolbar.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_toolbar.spec.ts@@ -1,6 +1,6 @@import { ClassicEditor as ClassicTestEditor, Essentials, Paragraph, WidgetToolbarRepository, _setModelData as setData } from 'ckeditor5';-import Mermaid from '../src/mermaid.js';+import Mermaid from './mermaid.js';import { afterEach, beforeEach, describe, it } from 'vitest';import { expect } from 'vitest';diff --git a/packages/ckeditor5-mermaid/src/mermaidtoolbar.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_toolbar.tssimilarity index 96%rename from packages/ckeditor5-mermaid/src/mermaidtoolbar.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_toolbar.tsindex cf14d46ea4..70017f492a 100644--- a/packages/ckeditor5-mermaid/src/mermaidtoolbar.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_toolbar.ts@@ -1,5 +1,5 @@/**- * @module mermaid/mermaidtoolbar+ * @module mermaid/mermaid_toolbar*/import { Plugin, ViewDocumentSelection, ViewElement, WidgetToolbarRepository } from "ckeditor5";diff --git a/packages/ckeditor5-mermaid/tests/mermaidui.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_ui.spec.tssimilarity index 98%rename from packages/ckeditor5-mermaid/tests/mermaidui.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_ui.spec.tsindex 8851b79d4f..4910ac8d9d 100644--- a/packages/ckeditor5-mermaid/tests/mermaidui.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_ui.spec.ts@@ -1,8 +1,8 @@import { ClassicEditor, Paragraph, _getModelData as getModelData, _setModelData as setModelData } from 'ckeditor5';-import '../src/augmentation.js';-import Mermaid from '../src/mermaid.js';-import MermaidUI from '../src/mermaidui.js';+import './mermaid.js';+import Mermaid from './mermaid.js';+import MermaidUI from './mermaid_ui.js';import { afterEach, beforeEach, describe, it, vi } from 'vitest';import { expect } from 'vitest';diff --git a/packages/ckeditor5-mermaid/src/mermaidui.ts b/packages/ckeditor5/src/plugins/mermaid/mermaid_ui.tssimilarity index 93%rename from packages/ckeditor5-mermaid/src/mermaidui.tsrename to packages/ckeditor5/src/plugins/mermaid/mermaid_ui.tsindex 2de631fd6f..ddeb6ad64d 100644--- a/packages/ckeditor5-mermaid/src/mermaidui.ts+++ b/packages/ckeditor5/src/plugins/mermaid/mermaid_ui.ts@@ -1,14 +1,14 @@/**- * @module mermaid/mermaidui+ * @module mermaid/mermaid_ui*/-import insertMermaidIcon from '../theme/icons/insert.svg?raw';-import previewModeIcon from '../theme/icons/preview-mode.svg?raw';-import splitModeIcon from '../theme/icons/split-mode.svg?raw';-import sourceModeIcon from '../theme/icons/source-mode.svg?raw';-import infoIcon from '../theme/icons/info.svg?raw';+import insertMermaidIcon from '../../icons/mermaid-insert.svg?raw';+import previewModeIcon from '../../icons/mermaid-preview-mode.svg?raw';+import splitModeIcon from '../../icons/mermaid-split-mode.svg?raw';+import sourceModeIcon from '../../icons/mermaid-source-mode.svg?raw';+import infoIcon from '../../icons/mermaid-info.svg?raw';import { addListToDropdown, ButtonView, Collection, createDropdown, Editor, ListDropdownItemDefinition, Locale, ModelElement, Observable, Plugin, SplitButtonView, ViewModel } from 'ckeditor5';-import InsertMermaidCommand, { INSERT_MERMAID_COMMAND } from './commands/insertMermaidCommand.js';+import InsertMermaidCommand, { INSERT_MERMAID_COMMAND } from './insert_mermaid_command.js';/* global window, document */diff --git a/packages/ckeditor5-mermaid/tests/utils.ts b/packages/ckeditor5/src/plugins/mermaid/utils.spec.tssimilarity index 95%rename from packages/ckeditor5-mermaid/tests/utils.tsrename to packages/ckeditor5/src/plugins/mermaid/utils.spec.tsindex b4c406b388..527e8837ea 100644--- a/packages/ckeditor5-mermaid/tests/utils.ts+++ b/packages/ckeditor5/src/plugins/mermaid/utils.spec.ts@@ -1,8 +1,8 @@import { ClassicEditor, Paragraph, _setModelData as setModelData } from 'ckeditor5';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';-import MermaidEditing from '../src/mermaidediting.js';-import { checkIsOn, debounce } from '../src/utils.js';+import MermaidEditing from './mermaid_editing.js';+import { checkIsOn, debounce } from './utils.js';/* global document */diff --git a/packages/ckeditor5-mermaid/src/utils.ts b/packages/ckeditor5/src/plugins/mermaid/utils.tssimilarity index 100%rename from packages/ckeditor5-mermaid/src/utils.tsrename to packages/ckeditor5/src/plugins/mermaid/utils.tsdiff --git a/packages/ckeditor5-mermaid/theme/mermaid.css b/packages/ckeditor5/src/theme/mermaid.csssimilarity index 100%rename from packages/ckeditor5-mermaid/theme/mermaid.cssrename to packages/ckeditor5/src/theme/mermaid.cssdiff --git a/packages/ckeditor5/tsconfig.json b/packages/ckeditor5/tsconfig.jsonindex 60721af2a6..33f044cd30 100644--- a/packages/ckeditor5/tsconfig.json+++ b/packages/ckeditor5/tsconfig.json@@ -6,9 +6,6 @@{"path": "../ckeditor5-math"},- {- "path": "../ckeditor5-mermaid"- },{"path": "./tsconfig.lib.json"}diff --git a/packages/ckeditor5/tsconfig.lib.json b/packages/ckeditor5/tsconfig.lib.jsonindex 4c1a9662b0..601b539277 100644--- a/packages/ckeditor5/tsconfig.lib.json+++ b/packages/ckeditor5/tsconfig.lib.json@@ -23,9 +23,6 @@"references": [{"path": "../ckeditor5-math"- },- {- "path": "../ckeditor5-mermaid"}]}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex a1e834800a..be51f136dd 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1097,9 +1097,6 @@ importers:'@triliumnext/ckeditor5-math':specifier: workspace:*version: link:../ckeditor5-math- '@triliumnext/ckeditor5-mermaid':- specifier: workspace:*- version: link:../ckeditor5-mermaid'@triliumnext/commons':specifier: workspace:*version: link:../commons@@ -1163,42 +1160,6 @@ importers:specifier: 9.30.0version: 9.30.0([email protected])- packages/ckeditor5-mermaid:- devDependencies:- '@ckeditor/ckeditor5-inspector':- specifier: '>=4.1.0'- version: 5.0.3- '@vitest/browser':- specifier: 4.1.10- version: 4.1.10([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])- ckeditor5:- specifier: 48.3.1- version: 48.3.1([email protected])- eslint:- specifier: 10.8.0- version: 10.8.0([email protected])([email protected])- eslint-config-ckeditor5:- specifier: '>=9.1.0'- version: 19.0.0([email protected]([email protected])([email protected]))([email protected])([email protected])- stylelint:- specifier: 17.14.1- version: 17.14.1([email protected])([email protected])- stylelint-config-ckeditor5:- specifier: '>=9.1.0'- typescript:- specifier: 6.0.3- version: 6.0.3- vite-plugin-svgo:- specifier: 2.0.0- version: 2.0.0([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))- vitest:- specifier: 4.1.10- version: 4.1.10(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))- webdriverio:- specifier: 9.30.0- version: 9.30.0([email protected])-packages/codemirror:dependencies:'@catppuccin/codemirror':diff --git a/tsconfig.json b/tsconfig.jsonindex d395efe060..100e17b2b8 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -45,9 +45,6 @@{"path": "./packages/ckeditor5"},- {- "path": "./packages/ckeditor5-mermaid"- },{"path": "./packages/ckeditor5-math"},