提交 49ff97c9 authored 作者: 钟是志's avatar 钟是志

26806 【北电科-通用功能】编辑器功能优化--增加本地视频上传功能,,,线下文档复制保留格式

上级 acf4fcfd
/**
* WangEditor5的使用
* 2022年6月21日
* 官方文档 https://www.wangeditor.com/v5/getting-started.html
* 将github 的源代码 下载下来 并执行
* npm install
* 再在 git bash 中执行 npm run build 获取编译后的文件/packages/editor/dist 复制出来放在项目代码中并引用
* */
import WangEditor5 from './index.esm';
import './css/style.css';
import React, { useEffect, useState } from 'react';
export default function WangEditorReactComponent(props) {
useEffect(() => {
console.log(WangEditor5);
}, []);
return <div>
</div>;
}
/**
* @description Editor View class
* @author wangfupeng
*/
import { IDomEditor, IEditorConfig, IToolbarConfig, IModuleConf, IRegisterMenuConf, IRenderElemConf, RenderStyleFnType, IElemToHtmlConf, styleToHtmlFnType, IPreParseHtmlConf, ParseStyleHtmlFnType, IParseElemHtmlConf } from '@wangeditor/core';
declare type PluginType = <T extends IDomEditor>(editor: T) => T;
declare class Boot {
constructor();
static editorConfig: Partial<IEditorConfig>;
static setEditorConfig(newConfig?: Partial<IEditorConfig>): void;
static simpleEditorConfig: Partial<IEditorConfig>;
static setSimpleEditorConfig(newConfig?: Partial<IEditorConfig>): void;
static toolbarConfig: Partial<IToolbarConfig>;
static setToolbarConfig(newConfig?: Partial<IToolbarConfig>): void;
static simpleToolbarConfig: Partial<IToolbarConfig>;
static setSimpleToolbarConfig(newConfig?: Partial<IToolbarConfig>): void;
static plugins: PluginType[];
static registerPlugin(plugin: PluginType): void;
static registerMenu(menuConf: IRegisterMenuConf, customConfig?: {
[key: string]: any;
}): void;
static registerRenderElem(renderElemConf: IRenderElemConf): void;
static registerRenderStyle(fn: RenderStyleFnType): void;
static registerElemToHtml(elemToHtmlConf: IElemToHtmlConf): void;
static registerStyleToHtml(fn: styleToHtmlFnType): void;
static registerPreParseHtml(preParseHtmlConf: IPreParseHtmlConf): void;
static registerParseElemHtml(parseElemHtmlConf: IParseElemHtmlConf): void;
static registerParseStyleHtml(fn: ParseStyleHtmlFnType): void;
static registerModule(module: Partial<IModuleConf>): void;
}
export default Boot;
/**
* @description svg tag
* @author wangfupeng
*/
/**
* 【注意】svg 字符串的长度 ,否则会导致代码体积过大
* 尽量选择 https://www.iconfont.cn/collections/detail?spm=a313x.7781069.0.da5a778a4&cid=20293
* 找不到再从 iconfont.com 搜索
*/
export declare const INDENT_RIGHT_SVG = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z\"></path></svg>";
export declare const JUSTIFY_LEFT_SVG = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z\"></path></svg>";
export declare const IMAGE_SVG = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z\"></path></svg>";
export declare const MORE_SVG = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M204.8 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z\"></path><path d=\"M505.6 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z\"></path><path d=\"M806.4 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z\"></path></svg>";
export declare const VIDEO_SVG = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z\"></path></svg>";
/**
* @description create
* @author wangfupeng
*/
import { Descendant } from 'slate';
import { DOMElement } from './utils/dom';
import { IEditorConfig, IDomEditor, IToolbarConfig, Toolbar } from '@wangeditor/core';
export interface ICreateEditorOption {
selector: string | DOMElement;
config: Partial<IEditorConfig>;
content?: Descendant[];
html?: string;
mode: string;
}
export interface ICreateToolbarOption {
editor: IDomEditor | null;
selector: string | DOMElement;
config?: Partial<IToolbarConfig>;
mode?: string;
}
/**
* 创建 editor 实例
*/
export declare function createEditor(option?: Partial<ICreateEditorOption>): IDomEditor;
/**
* 创建 toolbar 实例
*/
export declare function createToolbar(option: ICreateToolbarOption): Toolbar;
/**
* @description editor entry
* @author wangfupeng
*/
import './assets/index.less';
import '@wangeditor/core/dist/css/style.css';
import './utils/browser-polyfill';
import './utils/node-polyfill';
import './locale/index';
import './register-builtin-modules/index';
import './init-default-config';
import Boot from './Boot';
export { Boot };
export { DomEditor, IDomEditor, IEditorConfig, IToolbarConfig, Toolbar, IModuleConf, IButtonMenu, ISelectMenu, IDropPanelMenu, IModalMenu, i18nChangeLanguage, i18nAddResources, i18nGetResources, t, genModalTextareaElems, genModalInputElems, genModalButtonElems, createUploader, IUploadConfig, } from '@wangeditor/core';
export { Transforms as SlateTransforms, Descendant as SlateDescendant, Editor as SlateEditor, Node as SlateNode, Element as SlateElement, Text as SlateText, Path as SlatePath, Range as SlateRange, Location as SlateLocation, Point as SlatePoint, } from 'slate';
export { createEditor, createToolbar } from './create';
declare const _default: {};
export default _default;
/**
* @description hoverbar 配置
* @author wangfupeng
*/
export declare function genDefaultHoverbarKeys(): {
text: {
menuKeys: string[];
};
link: {
menuKeys: string[];
};
image: {
menuKeys: string[];
};
pre: {
menuKeys: string[];
};
table: {
menuKeys: string[];
};
divider: {
menuKeys: string[];
};
video: {
menuKeys: string[];
};
};
export declare function genSimpleHoverbarKeys(): {
link: {
menuKeys: string[];
};
image: {
menuKeys: string[];
};
pre: {
menuKeys: string[];
};
table: {
menuKeys: string[];
};
divider: {
menuKeys: string[];
};
video: {
menuKeys: string[];
};
};
/**
* @description 获取编辑器默认配置
* @author wangfupeng
*/
export declare function getDefaultEditorConfig(): {
hoverbarKeys: {
text: {
menuKeys: string[];
};
link: {
menuKeys: string[];
};
image: {
menuKeys: string[];
};
pre: {
menuKeys: string[];
};
table: {
menuKeys: string[];
};
divider: {
menuKeys: string[];
};
video: {
menuKeys: string[];
};
};
};
export declare function getSimpleEditorConfig(): {
hoverbarKeys: {
link: {
menuKeys: string[];
};
image: {
menuKeys: string[];
};
pre: {
menuKeys: string[];
};
table: {
menuKeys: string[];
};
divider: {
menuKeys: string[];
};
video: {
menuKeys: string[];
};
};
};
export declare function getDefaultToolbarConfig(): {
toolbarKeys: (string | {
key: string;
title: string;
iconSvg: string;
menuKeys: string[];
})[];
};
export declare function getSimpleToolbarConfig(): {
toolbarKeys: (string | {
key: string;
title: string;
iconSvg: string;
menuKeys: string[];
})[];
};
/**
* @description toolbar 配置
* @author wangfupeng
*/
export declare function genDefaultToolbarKeys(): (string | {
key: string;
title: string;
iconSvg: string;
menuKeys: string[];
})[];
export declare function genSimpleToolbarKeys(): (string | {
key: string;
title: string;
iconSvg: string;
menuKeys: string[];
})[];
/**
* @description set default config
* @author wangfupeng
*/
export {};
/**
* @description i18n en
* @author wangfupeng
*/
declare const _default: {
editor: {
more: string;
justify: string;
indent: string;
image: string;
video: string;
};
};
export default _default;
/**
* @description i18n entry
* @author wangfupeng
*/
export {};
/**
* @description i18n zh-CN
* @author wangfupeng
*/
declare const _default: {
editor: {
more: string;
justify: string;
indent: string;
image: string;
video: string;
};
};
export default _default;
/**
* @description register builtin modules
* @author wangfupeng
*/
import '@wangeditor/basic-modules/dist/css/style.css';
import '@wangeditor/list-module/dist/css/style.css';
import '@wangeditor/table-module/dist/css/style.css';
import '@wangeditor/video-module/dist/css/style.css';
import '@wangeditor/upload-image-module/dist/css/style.css';
import '@wangeditor/code-highlight/dist/css/style.css';
/**
* @description 注册 module
* @author wangfupeng
*/
import { IModuleConf } from '@wangeditor/core';
declare function registerModule(module: Partial<IModuleConf>): void;
export default registerModule;
/**
* @description browser polyfill
* @author wangfupeng
*/
declare function globalThisPolyfill(): void;
declare function AggregateErrorPolyfill(): void;
/**
* @description dom utils
* @author wangfupeng
*/
import DOMElement = globalThis.Element;
export { DOMElement };
/**
* @description node polyfill
* @author wangfupeng
*/
This source diff could not be displayed because it is too large. You can view the blob instead.
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论