mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-20 02:37:21 +08:00
feat(editor): integrate styles support
This commit is contained in:
parent
b8cbd79ae1
commit
062955aa81
4
libraries/ckeditor/ckeditor.js
vendored
4
libraries/ckeditor/ckeditor.js
vendored
File diff suppressed because one or more lines are too long
2
libraries/ckeditor/ckeditor.js.map
vendored
2
libraries/ckeditor/ckeditor.js.map
vendored
File diff suppressed because one or more lines are too long
@ -96,11 +96,45 @@ export function buildConfig() {
|
|||||||
defaultProtocol: "https://",
|
defaultProtocol: "https://",
|
||||||
allowedProtocols: ALLOWED_PROTOCOLS
|
allowedProtocols: ALLOWED_PROTOCOLS
|
||||||
},
|
},
|
||||||
|
style: {
|
||||||
|
definitions: buildStyleDefinitions()
|
||||||
|
},
|
||||||
// This value must be kept in sync with the language defined in webpack.config.js.
|
// This value must be kept in sync with the language defined in webpack.config.js.
|
||||||
language: "en"
|
language: "en"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buildStyleDefinitions() {
|
||||||
|
const element = "blockquote";
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
name: "Note",
|
||||||
|
element,
|
||||||
|
classes: [ "admonition", "note" ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Tip",
|
||||||
|
element,
|
||||||
|
classes: [ "admonition", "tip" ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Important",
|
||||||
|
element,
|
||||||
|
classes: [ "admonition", "important" ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Caution",
|
||||||
|
element,
|
||||||
|
classes: [ "admonition", "caution" ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Warning",
|
||||||
|
element,
|
||||||
|
classes: [ "admonition", "warning" ]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
export function buildToolbarConfig(isClassicToolbar: boolean) {
|
export function buildToolbarConfig(isClassicToolbar: boolean) {
|
||||||
if (isClassicToolbar) {
|
if (isClassicToolbar) {
|
||||||
const multilineToolbar = utils.isDesktop() && options.get("textNoteEditorMultilineToolbar") === "true";
|
const multilineToolbar = utils.isDesktop() && options.get("textNoteEditorMultilineToolbar") === "true";
|
||||||
@ -115,6 +149,7 @@ function buildClassicToolbar(multilineToolbar: boolean) {
|
|||||||
return {
|
return {
|
||||||
toolbar: {
|
toolbar: {
|
||||||
items: [
|
items: [
|
||||||
|
"style",
|
||||||
"heading",
|
"heading",
|
||||||
"fontSize",
|
"fontSize",
|
||||||
"|",
|
"|",
|
||||||
@ -180,6 +215,7 @@ function buildFloatingToolbar() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
blockToolbar: [
|
blockToolbar: [
|
||||||
|
"style",
|
||||||
"heading",
|
"heading",
|
||||||
"|",
|
"|",
|
||||||
"bulletedList",
|
"bulletedList",
|
||||||
|
@ -1706,3 +1706,8 @@ footer.file-footer {
|
|||||||
footer.file-footer button {
|
footer.file-footer button {
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ck-content .admonition {
|
||||||
|
box-shadow: var(--card-box-shadow);
|
||||||
|
padding: 1em;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user