mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-13 04:13:19 +08:00
refactor(editor): move all options into trilium repo
This commit is contained in:
parent
a209d6872a
commit
8c393e4c47
@ -15,8 +15,4 @@ export default class BalloonEditor extends BalloonEditorBase {
|
|||||||
...COMMON_PLUGINS,
|
...COMMON_PLUGINS,
|
||||||
BlockToolbar
|
BlockToolbar
|
||||||
];
|
];
|
||||||
|
|
||||||
public static override defaultConfig = {
|
|
||||||
...COMMON_SETTINGS
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,4 @@ export default class DecoupledEditor extends DecoupledEditorBase {
|
|||||||
public static override builtinPlugins = [
|
public static override builtinPlugins = [
|
||||||
...COMMON_PLUGINS,
|
...COMMON_PLUGINS,
|
||||||
];
|
];
|
||||||
|
|
||||||
public static override defaultConfig = {
|
|
||||||
...COMMON_SETTINGS
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -149,112 +149,4 @@ export const COMMON_PLUGINS = [
|
|||||||
Mermaid
|
Mermaid
|
||||||
];
|
];
|
||||||
|
|
||||||
export const COMMON_SETTINGS = {
|
export const COMMON_SETTINGS = { };
|
||||||
image: {
|
|
||||||
styles: {
|
|
||||||
options: [
|
|
||||||
'inline',
|
|
||||||
'alignBlockLeft',
|
|
||||||
'alignCenter',
|
|
||||||
'alignBlockRight',
|
|
||||||
'alignLeft',
|
|
||||||
'alignRight',
|
|
||||||
'full', // full and side are for BC since the old images have been created with these styles
|
|
||||||
'side'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
resizeOptions: [
|
|
||||||
{
|
|
||||||
name: 'imageResize:original',
|
|
||||||
value: null,
|
|
||||||
icon: 'original'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'imageResize:25',
|
|
||||||
value: '25',
|
|
||||||
icon: 'small'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'imageResize:50',
|
|
||||||
value: '50',
|
|
||||||
icon: 'medium'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'imageResize:75',
|
|
||||||
value: '75',
|
|
||||||
icon: 'medium'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
toolbar: [
|
|
||||||
// Image styles, see https://ckeditor.com/docs/ckeditor5/latest/features/images/images-styles.html#demo.
|
|
||||||
'imageStyle:inline',
|
|
||||||
'imageStyle:alignCenter',
|
|
||||||
{
|
|
||||||
name: "imageStyle:wrapText",
|
|
||||||
title: "Wrap text",
|
|
||||||
items: [
|
|
||||||
'imageStyle:alignLeft',
|
|
||||||
'imageStyle:alignRight',
|
|
||||||
],
|
|
||||||
defaultItem: 'imageStyle:alignRight'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "imageStyle:block",
|
|
||||||
title: "Block align",
|
|
||||||
items: [
|
|
||||||
'imageStyle:alignBlockLeft',
|
|
||||||
'imageStyle:alignBlockRight'
|
|
||||||
],
|
|
||||||
defaultItem: "imageStyle:alignBlockLeft",
|
|
||||||
},
|
|
||||||
'|',
|
|
||||||
'imageResize:25',
|
|
||||||
'imageResize:50',
|
|
||||||
'imageResize:original',
|
|
||||||
'|',
|
|
||||||
'toggleImageCaption'
|
|
||||||
],
|
|
||||||
upload: {
|
|
||||||
types: [ 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff', 'svg', 'svg+xml', 'avif' ]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
heading: {
|
|
||||||
options: [
|
|
||||||
{ model: 'paragraph' as const, title: 'Paragraph', class: 'ck-heading_paragraph' },
|
|
||||||
// // heading1 is not used since that should be a note's title
|
|
||||||
{ model: 'heading2' as const, view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
|
|
||||||
{ model: 'heading3' as const, view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' },
|
|
||||||
{ model: 'heading4' as const, view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' },
|
|
||||||
{ model: 'heading5' as const, view: 'h5', title: 'Heading 5', class: 'ck-heading_heading5' },
|
|
||||||
{ model: 'heading6' as const, view: 'h6', title: 'Heading 6', class: 'ck-heading_heading6' }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
table: {
|
|
||||||
contentToolbar: [
|
|
||||||
'tableColumn',
|
|
||||||
'tableRow',
|
|
||||||
'mergeTableCells',
|
|
||||||
'tableProperties',
|
|
||||||
'tableCellProperties',
|
|
||||||
'toggleTableCaption'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
list: {
|
|
||||||
properties: {
|
|
||||||
styles: true,
|
|
||||||
startIndex: true,
|
|
||||||
reversed: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
link: {
|
|
||||||
defaultProtocol: 'https://',
|
|
||||||
allowedProtocols: [
|
|
||||||
'http', 'https', 'ftp', 'ftps', 'mailto', 'data', 'evernote', 'file', 'facetime', 'gemini', 'git',
|
|
||||||
'gopher', 'imap', 'irc', 'irc6', 'jabber', 'jar', 'lastfm', 'ldap', 'ldaps', 'magnet', 'message',
|
|
||||||
'mumble', 'nfs', 'onenote', 'pop', 'rmi', 's3', 'sftp', 'skype', 'sms', 'spotify', 'steam', 'svn', 'udp',
|
|
||||||
'view-source', 'vlc', 'vnc', 'ws', 'wss', 'xmpp', 'jdbc', 'slack', 'tel', 'smb', 'zotero', 'geo'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
// This value must be kept in sync with the language defined in webpack.config.js.
|
|
||||||
language: 'en'
|
|
||||||
};
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user