@wangeditor-next/plugin-float-image 2.0.4 → 2.0.6

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.
@@ -13,6 +13,9 @@ declare const _default: {
13
13
  };
14
14
  codeBlock: {
15
15
  title: string;
16
+ copy: string;
17
+ copied: string;
18
+ copyFailed: string;
16
19
  };
17
20
  color: {
18
21
  color: string;
@@ -13,6 +13,9 @@ declare const _default: {
13
13
  };
14
14
  codeBlock: {
15
15
  title: string;
16
+ copy: string;
17
+ copied: string;
18
+ copyFailed: string;
16
19
  };
17
20
  color: {
18
21
  color: string;
@@ -5,5 +5,8 @@
5
5
  import CodeBlockMenu from './CodeBlockMenu';
6
6
  export declare const codeBlockMenuConf: {
7
7
  key: string;
8
+ config: {
9
+ showCopyButton: boolean;
10
+ };
8
11
  factory(): CodeBlockMenu;
9
12
  };
@@ -5,7 +5,7 @@
5
5
  import { IDomEditor } from '@wangeditor-next/core';
6
6
  import { Element as SlateElement } from 'slate';
7
7
  import { VNode } from 'snabbdom';
8
- declare function renderPre(_elemNode: SlateElement, children: VNode[] | null, _editor: IDomEditor): VNode;
8
+ declare function renderPre(elemNode: SlateElement, children: VNode[] | null, editor: IDomEditor): VNode;
9
9
  declare function renderCode(_elemNode: SlateElement, children: VNode[] | null, _editor: IDomEditor): VNode;
10
10
  export declare const renderPreConf: {
11
11
  type: string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @description indent target matcher
3
+ */
4
+ export declare function isIndentTargetElement(node: unknown): boolean;
@@ -95,6 +95,9 @@ interface IInsertTableConfig {
95
95
  selected: boolean;
96
96
  };
97
97
  }
98
+ interface IInsertTableColConfig {
99
+ insertPosition: 'before' | 'after';
100
+ }
98
101
  interface ILinkConfig {
99
102
  checkLink: (text: string, url: string) => string | boolean | undefined;
100
103
  parseLinkUrl: (url: string) => string;
@@ -115,6 +118,9 @@ interface ICodeLangConfig {
115
118
  selected?: boolean;
116
119
  }[];
117
120
  }
121
+ interface ICodeBlockConfig {
122
+ showCopyButton?: boolean;
123
+ }
118
124
  export interface IMenuConfig {
119
125
  bold: ISingleMenuConfig;
120
126
  underline: ISingleMenuConfig;
@@ -150,7 +156,7 @@ export interface IMenuConfig {
150
156
  editLink: ILinkConfig;
151
157
  unLink: ISingleMenuConfig;
152
158
  viewLink: ISingleMenuConfig;
153
- codeBlock: ISingleMenuConfig;
159
+ codeBlock: ICodeBlockConfig;
154
160
  blockquote: ISingleMenuConfig;
155
161
  headerSelect: ISingleMenuConfig;
156
162
  header1: ISingleMenuConfig;
@@ -172,7 +178,7 @@ export interface IMenuConfig {
172
178
  deleteTable: ISingleMenuConfig;
173
179
  insertTableRow: IInsertTableConfig;
174
180
  deleteTableRow: ISingleMenuConfig;
175
- insertTableCol: ISingleMenuConfig;
181
+ insertTableCol: IInsertTableColConfig;
176
182
  deleteTableCol: ISingleMenuConfig;
177
183
  tableHeader: ISingleMenuConfig;
178
184
  tableFullWidth: ISingleMenuConfig;
@@ -25,6 +25,7 @@ export interface IDomEditor extends Editor {
25
25
  alert: (info: string, type: AlertType) => void;
26
26
  handleTab: () => void;
27
27
  getHtml: () => string;
28
+ getHtmlWithId?: (idKey?: string) => string;
28
29
  getText: () => string;
29
30
  getSelectionText: () => string;
30
31
  getElemsByTypePrefix: (typePrefix: string) => ElementWithId[];
@@ -69,5 +70,6 @@ export interface IDomEditor extends Editor {
69
70
  emit: (type: string, ...args: any[]) => void;
70
71
  undo?: () => void;
71
72
  redo?: () => void;
73
+ clearHistory?: () => void;
72
74
  }
73
75
  export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @description slate 插件 - history
3
+ */
4
+ import { Editor } from 'slate';
5
+ import { HistoryEditor } from 'slate-history';
6
+ import { IDomEditor } from '../interface';
7
+ export declare const withHistory: <T extends Editor>(editor: T) => T & IDomEditor & HistoryEditor;
@@ -4,5 +4,6 @@
4
4
  */
5
5
  import { Element } from 'slate';
6
6
  import { IDomEditor } from '../editor/interface';
7
- declare function elemToHtml(elemNode: Element, editor: IDomEditor): string;
7
+ import type { INodeToHtmlOptions } from './node2html';
8
+ declare function elemToHtml(elemNode: Element, editor: IDomEditor, options?: INodeToHtmlOptions): string;
8
9
  export default elemToHtml;
@@ -3,6 +3,10 @@
3
3
  * @author wangfupeng
4
4
  */
5
5
  import { Descendant } from 'slate';
6
- import { IDomEditor } from '../editor/interface';
7
- declare function node2html(node: Descendant, editor: IDomEditor): string;
6
+ import type { IDomEditor } from '../editor/interface';
7
+ export interface INodeToHtmlOptions {
8
+ includeId?: boolean;
9
+ idKey?: string;
10
+ }
11
+ declare function node2html(node: Descendant, editor: IDomEditor, options?: INodeToHtmlOptions): string;
8
12
  export default node2html;
@@ -4,5 +4,6 @@
4
4
  */
5
5
  import { Text } from 'slate';
6
6
  import { IDomEditor } from '../editor/interface';
7
- declare function textToHtml(textNode: Text, editor: IDomEditor): string;
7
+ import type { INodeToHtmlOptions } from './node2html';
8
+ declare function textToHtml(textNode: Text, editor: IDomEditor, _options?: INodeToHtmlOptions): string;
8
9
  export default textToHtml;
@@ -2,11 +2,13 @@
2
2
  * @description gen uploader
3
3
  * @author wangfupeng
4
4
  */
5
- import type Uppy from '@uppy/core';
6
5
  import type { IDomEditor } from '../editor/interface';
7
6
  import type { IUploadAdapter, IUploadConfig, IUploader } from './interface';
8
7
  type IUploadConfigWithAdapter = IUploadConfig & {
9
8
  uploadAdapter: IUploadAdapter;
10
9
  };
11
- declare function createUploader<T extends IUploadConfig>(config: T, editor?: IDomEditor): T extends IUploadConfigWithAdapter ? IUploader : Uppy;
10
+ type IDefaultUploader = IUploader & {
11
+ [key: string]: any;
12
+ };
13
+ declare function createUploader<T extends IUploadConfig>(config: T, editor?: IDomEditor): T extends IUploadConfigWithAdapter ? IUploader : IDefaultUploader;
12
14
  export default createUploader;
@@ -29,6 +29,7 @@ export type TableRowElement = {
29
29
  export type TableElement = {
30
30
  type: 'table';
31
31
  width: string;
32
+ caption?: string;
32
33
  children: TableRowElement[];
33
34
  /** resize bar */
34
35
  scrollWidth?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wangeditor-next/plugin-float-image",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "wangEditor float image plugin",
5
5
  "author": "cycleccc <2991205548@qq.com>",
6
6
  "type": "module",
@@ -34,9 +34,9 @@
34
34
  "url": "https://github.com/wangeditor-next/wangeditor-next/issues"
35
35
  },
36
36
  "peerDependencies": {
37
- "@wangeditor-next/editor": "5.7.4",
37
+ "@wangeditor-next/editor": "5.7.6",
38
38
  "dom7": "^3.0.0 || ^4.0.0",
39
- "slate": "^0.123.0",
39
+ "slate": "^0.124.0",
40
40
  "snabbdom": "^3.6.0"
41
41
  },
42
42
  "devDependencies": {