@wangeditor-next/code-highlight 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/code-highlight/src/custom-types.d.ts +3 -3
- package/dist/code-highlight/src/index.d.ts +2 -2
- package/dist/code-highlight/src/module/menu/SelectLangMenu.d.ts +2 -2
- package/dist/code-highlight/src/module/parse-style-html.d.ts +3 -3
- package/dist/code-highlight/src/utils/dom.d.ts +3 -3
- package/dist/css/style.css +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* @description 自定义 element
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
type PureText = {
|
|
6
6
|
text: string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type PreElement = {
|
|
9
9
|
type: 'pre';
|
|
10
10
|
children: CodeElement[];
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type CodeElement = {
|
|
13
13
|
type: 'code';
|
|
14
14
|
language: string;
|
|
15
15
|
children: PureText[];
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import './assets/index.less';
|
|
6
6
|
import './locale/index';
|
|
7
|
-
import wangEditorCodeHighlightModule from './module/index';
|
|
8
7
|
import wangEditorCodeHighLightDecorate from './decorate';
|
|
9
|
-
|
|
8
|
+
import wangEditorCodeHighlightModule from './module/index';
|
|
9
|
+
export { wangEditorCodeHighLightDecorate, wangEditorCodeHighlightModule };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description code-highlight select lang
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { IDomEditor, IOption, ISelectMenu } from '@wangeditor-next/core';
|
|
6
6
|
declare class SelectLangMenu implements ISelectMenu {
|
|
7
7
|
readonly title: string;
|
|
8
8
|
readonly iconSvg = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M64 64v896h896V64H64z m487.6 698.8c0 87.2-51.2 127-125.8 127-67.4 0-106.4-34.8-126.4-77l68.6-41.4c13.2 23.4 25.2 43.2 54.2 43.2 27.6 0 45.2-10.8 45.2-53V475.4h84.2v287.4z m199.2 127c-78.2 0-128.8-37.2-153.4-86l68.6-39.6c18 29.4 41.6 51.2 83 51.2 34.8 0 57.2-17.4 57.2-41.6 0-28.8-22.8-39-61.4-56l-21-9c-60.8-25.8-101-58.4-101-127 0-63.2 48.2-111.2 123.2-111.2 53.6 0 92 18.6 119.6 67.4L800 580c-14.4-25.8-30-36-54.2-36-24.6 0-40.2 15.6-40.2 36 0 25.2 15.6 35.4 51.8 51.2l21 9c71.6 30.6 111.8 62 111.8 132.4 0 75.6-59.6 117.2-139.4 117.2z\"></path></svg>";
|
|
@@ -11,7 +11,7 @@ declare class SelectLangMenu implements ISelectMenu {
|
|
|
11
11
|
readonly selectPanelWidth = 115;
|
|
12
12
|
private defaultCodeLang;
|
|
13
13
|
getOptions(editor: IDomEditor): IOption[];
|
|
14
|
-
isActive(
|
|
14
|
+
isActive(_editor: IDomEditor): boolean;
|
|
15
15
|
/**
|
|
16
16
|
* 获取语言类型
|
|
17
17
|
* @param editor editor
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description parse style html
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { DOMElement } from '../utils/dom';
|
|
6
|
-
import { Descendant } from 'slate';
|
|
7
5
|
import { IDomEditor } from '@wangeditor-next/core';
|
|
8
|
-
|
|
6
|
+
import { Descendant } from 'slate';
|
|
7
|
+
import { DOMElement } from '../utils/dom';
|
|
8
|
+
export declare function parseCodeStyleHtml(elem: DOMElement, node: Descendant, _editor: IDomEditor): Descendant;
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
5
|
import $ from 'dom7';
|
|
6
|
-
export { Dom7Array } from 'dom7';
|
|
7
|
-
export default $;
|
|
8
6
|
import DOMNode = globalThis.Node;
|
|
9
7
|
import DOMComment = globalThis.Comment;
|
|
10
8
|
import DOMElement = globalThis.Element;
|
|
@@ -12,4 +10,6 @@ import DOMText = globalThis.Text;
|
|
|
12
10
|
import DOMRange = globalThis.Range;
|
|
13
11
|
import DOMSelection = globalThis.Selection;
|
|
14
12
|
import DOMStaticRange = globalThis.StaticRange;
|
|
15
|
-
export {
|
|
13
|
+
export { Dom7Array } from 'dom7';
|
|
14
|
+
export default $;
|
|
15
|
+
export { DOMComment, DOMElement, DOMNode, DOMRange, DOMSelection, DOMStaticRange, DOMText, };
|
package/dist/css/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.w-e-text-container [data-slate-editor] pre>code{
|
|
1
|
+
.w-e-text-container [data-slate-editor] pre>code{font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;text-align:left;text-shadow:0 1px #fff;white-space:pre;word-break:normal;word-spacing:normal;word-wrap:normal;-webkit-hyphens:none;hyphens:none;line-height:1.5;margin:.5em 0;overflow:auto;padding:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4}.w-e-text-container [data-slate-editor] pre>code .token.cdata,.w-e-text-container [data-slate-editor] pre>code .token.comment,.w-e-text-container [data-slate-editor] pre>code .token.doctype,.w-e-text-container [data-slate-editor] pre>code .token.prolog{color:#708090}.w-e-text-container [data-slate-editor] pre>code .token.punctuation{color:#999}.w-e-text-container [data-slate-editor] pre>code .token.namespace{opacity:.7}.w-e-text-container [data-slate-editor] pre>code .token.boolean,.w-e-text-container [data-slate-editor] pre>code .token.constant,.w-e-text-container [data-slate-editor] pre>code .token.deleted,.w-e-text-container [data-slate-editor] pre>code .token.number,.w-e-text-container [data-slate-editor] pre>code .token.property,.w-e-text-container [data-slate-editor] pre>code .token.symbol,.w-e-text-container [data-slate-editor] pre>code .token.tag{color:#905}.w-e-text-container [data-slate-editor] pre>code .token.attr-name,.w-e-text-container [data-slate-editor] pre>code .token.builtin,.w-e-text-container [data-slate-editor] pre>code .token.char,.w-e-text-container [data-slate-editor] pre>code .token.inserted,.w-e-text-container [data-slate-editor] pre>code .token.selector,.w-e-text-container [data-slate-editor] pre>code .token.string{color:#690}.w-e-text-container [data-slate-editor] pre>code .language-css .token.string,.w-e-text-container [data-slate-editor] pre>code .style .token.string,.w-e-text-container [data-slate-editor] pre>code .token.entity,.w-e-text-container [data-slate-editor] pre>code .token.operator,.w-e-text-container [data-slate-editor] pre>code .token.url{color:#9a6e3a}.w-e-text-container [data-slate-editor] pre>code .token.atrule,.w-e-text-container [data-slate-editor] pre>code .token.attr-value,.w-e-text-container [data-slate-editor] pre>code .token.keyword{color:#07a}.w-e-text-container [data-slate-editor] pre>code .token.class-name,.w-e-text-container [data-slate-editor] pre>code .token.function{color:#dd4a68}.w-e-text-container [data-slate-editor] pre>code .token.important,.w-e-text-container [data-slate-editor] pre>code .token.regex,.w-e-text-container [data-slate-editor] pre>code .token.variable{color:#e90}.w-e-text-container [data-slate-editor] pre>code .token.bold,.w-e-text-container [data-slate-editor] pre>code .token.important{font-weight:700}.w-e-text-container [data-slate-editor] pre>code .token.italic{font-style:italic}.w-e-text-container [data-slate-editor] pre>code .token.entity{cursor:help}
|