mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	Merge branch 'develop' of https://github.com/TriliumNext/Notes into develop
This commit is contained in:
		
						commit
						25a787f9dc
					
				
							
								
								
									
										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
											
										
									
								
							@ -15,7 +15,7 @@ import type { CommandData, EventData, EventListener, FilteredCommandNames } from
 | 
				
			|||||||
import type { default as FAttribute, AttributeType } from "../../entities/fattribute.js";
 | 
					import type { default as FAttribute, AttributeType } from "../../entities/fattribute.js";
 | 
				
			||||||
import type FNote from "../../entities/fnote.js";
 | 
					import type FNote from "../../entities/fnote.js";
 | 
				
			||||||
import { escapeQuotes } from "../../services/utils.js";
 | 
					import { escapeQuotes } from "../../services/utils.js";
 | 
				
			||||||
import { buildConfig } from "../type_widgets/ckeditor/toolbars.js";
 | 
					import { buildConfig } from "../type_widgets/ckeditor/config.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const HELP_TEXT = `
 | 
					const HELP_TEXT = `
 | 
				
			||||||
<p>${t("attribute_editor.help_text_body1")}</p>
 | 
					<p>${t("attribute_editor.help_text_body1")}</p>
 | 
				
			||||||
 | 
				
			|||||||
@ -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",
 | 
				
			||||||
@ -15,7 +15,7 @@ import options from "../../services/options.js";
 | 
				
			|||||||
import toast from "../../services/toast.js";
 | 
					import toast from "../../services/toast.js";
 | 
				
			||||||
import { getMermaidConfig } from "../mermaid.js";
 | 
					import { getMermaidConfig } from "../mermaid.js";
 | 
				
			||||||
import { normalizeMimeTypeForCKEditor } from "../../services/mime_type_definitions.js";
 | 
					import { normalizeMimeTypeForCKEditor } from "../../services/mime_type_definitions.js";
 | 
				
			||||||
import { buildConfig, buildToolbarConfig } from "./ckeditor/toolbars.js";
 | 
					import { buildConfig, buildToolbarConfig } from "./ckeditor/config.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const ENABLE_INSPECTOR = false;
 | 
					const ENABLE_INSPECTOR = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -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