@wangeditor-next/plugin-float-image 2.0.5 → 2.0.7

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;
@@ -18,6 +18,7 @@ interface IHoverbarConf {
18
18
  export type AlertType = 'success' | 'info' | 'warning' | 'error';
19
19
  export type TextStyleMode = 'inline' | 'class';
20
20
  export type ClassStylePolicy = 'preserve-data' | 'fallback-inline' | 'strict';
21
+ export type TableWidthExportMode = 'adaptive' | 'explicit';
21
22
  export type StyleClassTokenType = 'color' | 'bgColor' | 'fontSize' | 'fontFamily' | 'textAlign' | 'lineHeight' | 'indent';
22
23
  export interface IClassStyleUnsupportedPayload {
23
24
  type: string;
@@ -88,12 +89,14 @@ interface IEmotionConfig {
88
89
  }
89
90
  interface IInsertTableConfig {
90
91
  minWidth: number;
92
+ minRowHeight: number;
91
93
  tableHeader: {
92
94
  selected: boolean;
93
95
  };
94
96
  tableFullWidth: {
95
97
  selected: boolean;
96
98
  };
99
+ widthExportMode: TableWidthExportMode;
97
100
  }
98
101
  interface IInsertTableColConfig {
99
102
  insertPosition: 'before' | 'after';
@@ -118,6 +121,9 @@ interface ICodeLangConfig {
118
121
  selected?: boolean;
119
122
  }[];
120
123
  }
124
+ interface ICodeBlockConfig {
125
+ showCopyButton?: boolean;
126
+ }
121
127
  export interface IMenuConfig {
122
128
  bold: ISingleMenuConfig;
123
129
  underline: ISingleMenuConfig;
@@ -153,7 +159,7 @@ export interface IMenuConfig {
153
159
  editLink: ILinkConfig;
154
160
  unLink: ISingleMenuConfig;
155
161
  viewLink: ISingleMenuConfig;
156
- codeBlock: ISingleMenuConfig;
162
+ codeBlock: ICodeBlockConfig;
157
163
  blockquote: ISingleMenuConfig;
158
164
  headerSelect: ISingleMenuConfig;
159
165
  header1: ISingleMenuConfig;
@@ -2,7 +2,7 @@
2
2
  * @description 绑定 node 的关系
3
3
  * @author wangfupeng
4
4
  */
5
- import { Node, Ancestor } from 'slate';
5
+ import { Ancestor, Node } from 'slate';
6
6
  import { IDomEditor } from '../editor/interface';
7
7
  /**
8
8
  * createEditor 未传递 selector 时,绑定 node 的关系( NODE_TO_PARENT, NODE_TO_INDEX 等 )
@@ -2,9 +2,9 @@
2
2
  * @description create toolbar
3
3
  * @author wangfupeng
4
4
  */
5
+ import { IToolbarConfig } from '../config/interface';
5
6
  import { IDomEditor } from '../editor/interface';
6
7
  import Toolbar from '../menus/bar/Toolbar';
7
- import { IToolbarConfig } from '../config/interface';
8
8
  import { DOMElement } from '../utils/dom';
9
9
  interface ICreateOption {
10
10
  selector: string | DOMElement;
@@ -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;
@@ -3,8 +3,8 @@
3
3
  * @author wangfupeng
4
4
  */
5
5
  import { Dom7Array } from '../../utils/dom';
6
- import { IBarItem } from './index';
7
6
  import { ISelectMenu } from '../interface';
7
+ import { IBarItem } from './index';
8
8
  declare class BarItemSelect implements IBarItem {
9
9
  readonly $elem: Dom7Array;
10
10
  private readonly $button;
@@ -2,9 +2,9 @@
2
2
  * @description bar item
3
3
  * @author wangfupeng
4
4
  */
5
- import { Dom7Array } from '../../utils/dom';
6
- import { IButtonMenu, ISelectMenu, IDropPanelMenu, IModalMenu, IMenuGroup } from '../interface';
7
5
  import { IDomEditor } from '../../editor/interface';
6
+ import { Dom7Array } from '../../utils/dom';
7
+ import { IButtonMenu, IDropPanelMenu, IMenuGroup, IModalMenu, ISelectMenu } from '../interface';
8
8
  import GroupButton from './GroupButton';
9
9
  type MenuType = IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
10
10
  export interface IBarItem {
@@ -2,13 +2,11 @@
2
2
  * @description dropPanel class
3
3
  * @author wangfupeng
4
4
  */
5
- import { IDomEditor } from '../../editor/interface';
6
5
  import { Dom7Array } from '../../utils/dom';
7
6
  import PanelAndModal from './BaseClass';
8
7
  declare class DropPanel extends PanelAndModal {
9
8
  type: string;
10
9
  readonly $elem: Dom7Array;
11
- constructor(editor: IDomEditor);
12
10
  genSelfElem(): Dom7Array | null;
13
11
  }
14
12
  export default DropPanel;
@@ -2,10 +2,10 @@
2
2
  * @description modal class
3
3
  * @author wangfupeng
4
4
  */
5
+ import { IDomEditor } from '../../editor/interface';
5
6
  import { Dom7Array, DOMElement } from '../../utils/dom';
6
7
  import { IPositionStyle } from '../interface';
7
8
  import PanelAndModal from './BaseClass';
8
- import { IDomEditor } from '../../editor/interface';
9
9
  declare class Modal extends PanelAndModal {
10
10
  type: string;
11
11
  readonly $elem: Dom7Array;
@@ -2,7 +2,7 @@
2
2
  * @description slate node to vnode
3
3
  * @author wangfupeng
4
4
  */
5
- import { Node, Ancestor } from 'slate';
5
+ import { Ancestor, Node } from 'slate';
6
6
  import { VNode } from 'snabbdom';
7
7
  import { IDomEditor } from '../editor/interface';
8
8
  /**
@@ -2,8 +2,8 @@
2
2
  * @description 生成 text vnode
3
3
  * @author wangfupeng
4
4
  */
5
- import { Text as SlateText, Ancestor } from 'slate';
5
+ import { Ancestor, Text as SlateText } from 'slate';
6
6
  import { VNode } from 'snabbdom';
7
7
  import { IDomEditor } from '../../editor/interface';
8
- declare function genTextVnode(leafNode: SlateText, isLast: boolean | undefined, textNode: SlateText, parent: Ancestor, editor: IDomEditor): VNode;
8
+ declare function genTextVnode(leafNode: SlateText, textNode: SlateText, parent: Ancestor, editor: IDomEditor, isLast?: boolean): VNode;
9
9
  export default genTextVnode;
@@ -4,16 +4,16 @@
4
4
  */
5
5
  import handleBeforeInput from './beforeInput';
6
6
  import handleOnBlur from './blur';
7
- import handleOnFocus from './focus';
8
7
  import handleOnClick from './click';
9
- import { handleCompositionStart, handleCompositionEnd, handleCompositionUpdate } from './composition';
10
- import handleOnKeydown from './keydown';
11
- import handleKeypress from './keypress';
8
+ import { handleCompositionEnd, handleCompositionStart, handleCompositionUpdate } from './composition';
12
9
  import handleOnCopy from './copy';
13
10
  import handleOnCut from './cut';
14
- import handleOnPaste from './paste';
15
- import { handleOnDragover, handleOnDragstart, handleOnDragend } from './drag';
11
+ import { handleOnDragend, handleOnDragover, handleOnDragstart } from './drag';
16
12
  import handleOnDrop from './drop';
13
+ import handleOnFocus from './focus';
14
+ import handleOnKeydown from './keydown';
15
+ import handleKeypress from './keypress';
16
+ import handleOnPaste from './paste';
17
17
  declare const eventConf: {
18
18
  beforeinput: typeof handleBeforeInput;
19
19
  blur: typeof handleOnBlur;
@@ -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;
@@ -16,6 +16,17 @@ import TableHander from './TableHeader';
16
16
  import TableProperty from './TableProperty';
17
17
  export declare const insertTableMenuConf: {
18
18
  key: string;
19
+ config: {
20
+ minWidth: number;
21
+ minRowHeight: number;
22
+ tableHeader: {
23
+ selected: boolean;
24
+ };
25
+ tableFullWidth: {
26
+ selected: boolean;
27
+ };
28
+ widthExportMode: string;
29
+ };
19
30
  factory(): InsertTable;
20
31
  };
21
32
  export declare const deleteTableMenuConf: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wangeditor-next/plugin-float-image",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
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.5",
37
+ "@wangeditor-next/editor": "5.7.7",
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": {