@wangeditor-next/plugin-formula 2.0.8 → 3.0.0

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.
@@ -16,6 +16,9 @@ declare const _default: {
16
16
  edit: string;
17
17
  width: string;
18
18
  height: string;
19
+ alignLeft: string;
20
+ alignCenter: string;
21
+ alignRight: string;
19
22
  };
20
23
  };
21
24
  export default _default;
@@ -16,6 +16,9 @@ declare const _default: {
16
16
  edit: string;
17
17
  width: string;
18
18
  height: string;
19
+ alignLeft: string;
20
+ alignCenter: string;
21
+ alignRight: string;
19
22
  };
20
23
  };
21
24
  export default _default;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @description video alignment helpers
3
+ */
4
+ import { Element } from 'slate';
5
+ import { VideoAlign } from './custom-types';
6
+ export declare const DEFAULT_VIDEO_ALIGN: VideoAlign;
7
+ export declare function normalizeVideoAlign(value: unknown): VideoAlign;
8
+ export declare function getVideoAlign(elemNode: Element): VideoAlign;
9
+ export declare function getVideoAlignClass(align: VideoAlign): string;
10
+ export declare function getVideoJustifyContent(align: VideoAlign): string;
@@ -9,12 +9,13 @@ export type videoStyle = {
9
9
  width?: string;
10
10
  height?: string;
11
11
  };
12
+ export type VideoAlign = 'left' | 'center' | 'right';
12
13
  export type VideoElement = {
13
14
  type: 'video';
14
15
  key?: string;
15
16
  src: string;
16
17
  poster?: string;
17
- textAlign?: string;
18
+ align?: VideoAlign;
18
19
  width?: string;
19
20
  height?: string;
20
21
  style?: videoStyle;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @description align video menu
3
+ */
4
+ import { IButtonMenu, IDomEditor } from '@wangeditor-next/core';
5
+ import { VideoAlign } from '../custom-types';
6
+ declare class VideoAlignMenu implements IButtonMenu {
7
+ readonly align: VideoAlign;
8
+ readonly iconSvg: string;
9
+ readonly tag = "button";
10
+ readonly title: string;
11
+ constructor(align: VideoAlign, titleKey: string, iconSvg: string);
12
+ private getSelectedVideo;
13
+ getValue(editor: IDomEditor): string | boolean;
14
+ isActive(editor: IDomEditor): boolean;
15
+ isDisabled(editor: IDomEditor): boolean;
16
+ exec(editor: IDomEditor, _value: string | boolean): void;
17
+ }
18
+ export default VideoAlignMenu;
@@ -6,6 +6,7 @@ import EditorVideoSizeMenu from './EditVideoSizeMenu';
6
6
  import EditorVideoSrcMenu from './EditVideoSrcMenu';
7
7
  import InsertVideoMenu from './InsertVideoMenu';
8
8
  import UploadVideoMenu from './UploadVideoMenu';
9
+ import VideoAlignMenu from './VideoAlignMenu';
9
10
  export declare const insertVideoMenuConf: {
10
11
  key: string;
11
12
  factory(): InsertVideoMenu;
@@ -28,3 +29,15 @@ export declare const editorVideoSrcMenuConf: {
28
29
  key: string;
29
30
  factory(): EditorVideoSrcMenu;
30
31
  };
32
+ export declare const videoAlignLeftMenuConf: {
33
+ key: string;
34
+ factory(): VideoAlignMenu;
35
+ };
36
+ export declare const videoAlignCenterMenuConf: {
37
+ key: string;
38
+ factory(): VideoAlignMenu;
39
+ };
40
+ export declare const videoAlignRightMenuConf: {
41
+ key: string;
42
+ factory(): VideoAlignMenu;
43
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wangeditor-next/plugin-formula",
3
- "version": "2.0.8",
3
+ "version": "3.0.0",
4
4
  "description": "wangEditor next formula 公式",
5
5
  "author": "cycleccc <2991205548@qq.com>",
6
6
  "type": "module",
@@ -31,14 +31,14 @@
31
31
  "url": "git+https://github.com/wangeditor-next/wangEditor-next.git"
32
32
  },
33
33
  "bugs": {
34
- "url": "https://github.com/wangeditor-next/wangeditor-next/issues"
34
+ "url": "https://github.com/wangeditor-next/wangEditor-next/issues"
35
35
  },
36
36
  "devDependencies": {
37
37
  "katex": "^0.16.0",
38
38
  "@wangeditor-next-shared/rollup-config": "^0.0.2"
39
39
  },
40
40
  "peerDependencies": {
41
- "@wangeditor-next/editor": ">=5.7.8",
41
+ "@wangeditor-next/editor": ">=6.0.0",
42
42
  "katex": "^0.16.0",
43
43
  "snabbdom": "^3.6.0"
44
44
  },