1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-27 06:01:54 +03:00

JS Build: Split markdown to own file, updated packages

Markdown-related code was growing, representing half of app.js main
bundle code while only being needed in one view/scenario.
This extracts markdown related code to its own built file.
Related to #4858
This commit is contained in:
Dan Brown
2024-04-08 14:41:51 +01:00
parent ee40adf11a
commit f5e6f9574d
5 changed files with 420 additions and 336 deletions

View File

@ -1,5 +1,4 @@
import {Component} from './component';
import {init as initEditor} from '../markdown/editor';
export class MarkdownEditor extends Component {
@ -20,17 +19,19 @@ export class MarkdownEditor extends Component {
const settingInputs = settingContainer.querySelectorAll('input[type="checkbox"]');
this.editor = null;
initEditor({
pageId: this.pageId,
container: this.elem,
displayEl: this.display,
inputEl: this.input,
drawioUrl: this.getDrawioUrl(),
settingInputs: Array.from(settingInputs),
text: {
serverUploadLimit: this.serverUploadLimitText,
imageUploadError: this.imageUploadErrorText,
},
window.importVersioned('markdown').then(markdown => {
return markdown.init({
pageId: this.pageId,
container: this.elem,
displayEl: this.display,
inputEl: this.input,
drawioUrl: this.getDrawioUrl(),
settingInputs: Array.from(settingInputs),
text: {
serverUploadLimit: this.serverUploadLimitText,
imageUploadError: this.imageUploadErrorText,
},
});
}).then(editor => {
this.editor = editor;
this.setupListeners();