@wangeditor-next/video-module 1.3.8 → 1.3.10
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/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/video-module/src/module/custom-types.d.ts +3 -3
- package/dist/video-module/src/module/elem-to-html.d.ts +1 -1
- package/dist/video-module/src/module/menu/EditVideoSizeMenu.d.ts +4 -4
- package/dist/video-module/src/module/menu/EditVideoSrcMenu.d.ts +4 -4
- package/dist/video-module/src/module/menu/InsertVideoMenu.d.ts +5 -5
- package/dist/video-module/src/module/menu/UploadVideoMenu.d.ts +3 -3
- package/dist/video-module/src/module/menu/config.d.ts +4 -4
- package/dist/video-module/src/module/menu/index.d.ts +4 -4
- package/dist/video-module/src/module/parse-elem-html.d.ts +3 -3
- package/dist/video-module/src/module/render-elem.d.ts +1 -1
- package/dist/video-module/src/utils/dom.d.ts +8 -8
- package/package.json +2 -2
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* @description video element
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
type EmptyText = {
|
|
6
6
|
text: '';
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type videoStyle = {
|
|
9
9
|
width?: string;
|
|
10
10
|
height?: string;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type VideoElement = {
|
|
13
13
|
type: 'video';
|
|
14
14
|
key?: string;
|
|
15
15
|
src: string;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
5
|
import { Element } from 'slate';
|
|
6
|
-
declare function videoToHtml(elemNode: Element,
|
|
6
|
+
declare function videoToHtml(elemNode: Element, _childrenHtml?: string): string;
|
|
7
7
|
export declare const videoToHtmlConf: {
|
|
8
8
|
type: string;
|
|
9
9
|
elemToHtml: typeof videoToHtml;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @description 修改视频尺寸
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
+
import { IDomEditor, IModalMenu } from '@wangeditor-next/core';
|
|
5
6
|
import { Node as SlateNode } from 'slate';
|
|
6
|
-
import { IModalMenu, IDomEditor } from '@wangeditor-next/core';
|
|
7
7
|
import { DOMElement } from '../../utils/dom';
|
|
8
8
|
declare class EditorVideoSizeMenu implements IModalMenu {
|
|
9
9
|
readonly title: string;
|
|
@@ -15,9 +15,9 @@ declare class EditorVideoSizeMenu implements IModalMenu {
|
|
|
15
15
|
private readonly heightInputId;
|
|
16
16
|
private readonly buttonId;
|
|
17
17
|
private getSelectedVideoNode;
|
|
18
|
-
getValue(
|
|
19
|
-
isActive(
|
|
20
|
-
exec(
|
|
18
|
+
getValue(_editor: IDomEditor): string | boolean;
|
|
19
|
+
isActive(_editor: IDomEditor): boolean;
|
|
20
|
+
exec(_editor: IDomEditor, _value: string | boolean): void;
|
|
21
21
|
isDisabled(editor: IDomEditor): boolean;
|
|
22
22
|
getModalPositionNode(editor: IDomEditor): SlateNode | null;
|
|
23
23
|
getModalContentElem(editor: IDomEditor): DOMElement;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @description editor video menu
|
|
3
3
|
* @author
|
|
4
4
|
*/
|
|
5
|
+
import { IDomEditor, IModalMenu } from '@wangeditor-next/core';
|
|
5
6
|
import { Node as SlateNode } from 'slate';
|
|
6
|
-
import { IModalMenu, IDomEditor } from '@wangeditor-next/core';
|
|
7
7
|
import { DOMElement } from '../../utils/dom';
|
|
8
8
|
declare class Editvideo implements IModalMenu {
|
|
9
9
|
readonly title: string;
|
|
@@ -16,9 +16,9 @@ declare class Editvideo implements IModalMenu {
|
|
|
16
16
|
private readonly posterInputId;
|
|
17
17
|
private readonly buttonId;
|
|
18
18
|
private getSelectedVideoNode;
|
|
19
|
-
getValue(
|
|
20
|
-
isActive(
|
|
21
|
-
exec(
|
|
19
|
+
getValue(_editor: IDomEditor): string | boolean;
|
|
20
|
+
isActive(_editor: IDomEditor): boolean;
|
|
21
|
+
exec(_editor: IDomEditor, _value: string | boolean): void;
|
|
22
22
|
isDisabled(editor: IDomEditor): boolean;
|
|
23
23
|
getModalPositionNode(editor: IDomEditor): SlateNode | null;
|
|
24
24
|
getModalContentElem(editor: IDomEditor): DOMElement;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @description insert video menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
+
import { IDomEditor, IModalMenu } from '@wangeditor-next/core';
|
|
5
6
|
import { Node } from 'slate';
|
|
6
|
-
import { IModalMenu, IDomEditor } from '@wangeditor-next/core';
|
|
7
7
|
import { DOMElement } from '../../utils/dom';
|
|
8
8
|
declare class InsertVideoMenu implements IModalMenu {
|
|
9
9
|
readonly title: string;
|
|
@@ -15,11 +15,11 @@ declare class InsertVideoMenu implements IModalMenu {
|
|
|
15
15
|
private readonly srcInputId;
|
|
16
16
|
private readonly posterInputId;
|
|
17
17
|
private readonly buttonId;
|
|
18
|
-
getValue(
|
|
19
|
-
isActive(
|
|
20
|
-
exec(
|
|
18
|
+
getValue(_editor: IDomEditor): string | boolean;
|
|
19
|
+
isActive(_editor: IDomEditor): boolean;
|
|
20
|
+
exec(_editor: IDomEditor, _value: string | boolean): void;
|
|
21
21
|
isDisabled(editor: IDomEditor): boolean;
|
|
22
|
-
getModalPositionNode(
|
|
22
|
+
getModalPositionNode(_editor: IDomEditor): Node | null;
|
|
23
23
|
getModalContentElem(editor: IDomEditor): DOMElement;
|
|
24
24
|
}
|
|
25
25
|
export default InsertVideoMenu;
|
|
@@ -7,9 +7,9 @@ declare class UploadVideoMenu implements IButtonMenu {
|
|
|
7
7
|
readonly title: string;
|
|
8
8
|
readonly iconSvg = "<svg viewBox=\"0 0 1056 1024\"><path d=\"M805.902261 521.819882a251.441452 251.441452 0 0 0-251.011972 246.600033 251.051015 251.051015 0 1 0 502.023944 8.823877 253.237463 253.237463 0 0 0-251.011972-255.42391z m59.463561 240.001647v129.898403h-116.701631v-129.898403h-44.041298l101.279368-103.504859 101.279368 103.504859z\" p-id=\"6802\"></path><path d=\"M788.254507 0.000781H99.094092A98.663439 98.663439 0 0 0 0.001171 99.093701v590.067495a98.663439 98.663439 0 0 0 99.092921 99.092921h411.7549a266.434235 266.434235 0 0 1-2.186448-41.815807 275.843767 275.843767 0 0 1 275.180024-270.729042 270.650955 270.650955 0 0 1 103.504859 19.834201V99.093701A101.51363 101.51363 0 0 0 788.254507 0.000781zM295.054441 640.747004V147.507894l394.146189 246.600033z\"></path></svg>";
|
|
9
9
|
readonly tag = "button";
|
|
10
|
-
getValue(
|
|
11
|
-
isActive(
|
|
12
|
-
exec(editor: IDomEditor,
|
|
10
|
+
getValue(_editor: IDomEditor): string | boolean;
|
|
11
|
+
isActive(_editor: IDomEditor): boolean;
|
|
12
|
+
exec(editor: IDomEditor, _value: string | boolean): void;
|
|
13
13
|
isDisabled(editor: IDomEditor): boolean;
|
|
14
14
|
private getMenuConfig;
|
|
15
15
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IUploadConfig } from '@wangeditor-next/core';
|
|
6
6
|
import { VideoElement } from '../custom-types';
|
|
7
|
-
|
|
8
|
-
export
|
|
7
|
+
type InsertFn = (src: string, poster: string) => void;
|
|
8
|
+
export type IUploadConfigForVideo = IUploadConfig & {
|
|
9
9
|
allowedFileTypes?: string[];
|
|
10
10
|
customInsert?: (res: any, insertFn: InsertFn) => void;
|
|
11
11
|
customUpload?: (files: File, insertFn: InsertFn) => void;
|
|
@@ -16,13 +16,13 @@ export declare function genUploadVideoMenuConfig(): IUploadConfigForVideo;
|
|
|
16
16
|
* 生成插入网络视频的配置
|
|
17
17
|
*/
|
|
18
18
|
export declare function genInsertVideoMenuConfig(): {
|
|
19
|
-
onInsertedVideo(
|
|
19
|
+
onInsertedVideo(_node: VideoElement): void;
|
|
20
20
|
/**
|
|
21
21
|
* 检查 video ,支持 async
|
|
22
22
|
* @param src src
|
|
23
23
|
* @param poster poster
|
|
24
24
|
*/
|
|
25
|
-
checkVideo(
|
|
25
|
+
checkVideo(_src: string, _poster: string): boolean | string | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* 转换 video src
|
|
28
28
|
* @param src src
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* @description video menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import InsertVideoMenu from './InsertVideoMenu';
|
|
6
|
-
import UploadVideoMenu from './UploadVideoMenu';
|
|
7
5
|
import EditorVideoSizeMenu from './EditVideoSizeMenu';
|
|
8
6
|
import EditorVideoSrcMenu from './EditVideoSrcMenu';
|
|
7
|
+
import InsertVideoMenu from './InsertVideoMenu';
|
|
8
|
+
import UploadVideoMenu from './UploadVideoMenu';
|
|
9
9
|
export declare const insertVideoMenuConf: {
|
|
10
10
|
key: string;
|
|
11
11
|
factory(): InsertVideoMenu;
|
|
12
12
|
config: {
|
|
13
|
-
onInsertedVideo(
|
|
14
|
-
checkVideo(
|
|
13
|
+
onInsertedVideo(_node: import("../custom-types").VideoElement): void;
|
|
14
|
+
checkVideo(_src: string, _poster: string): string | boolean | undefined;
|
|
15
15
|
parseVideoSrc(src: string): string;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* @description parse html
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { Descendant } from 'slate';
|
|
6
5
|
import { IDomEditor } from '@wangeditor-next/core';
|
|
7
|
-
import {
|
|
6
|
+
import { Descendant } from 'slate';
|
|
8
7
|
import { DOMElement } from '../utils/dom';
|
|
9
|
-
|
|
8
|
+
import { VideoElement } from './custom-types';
|
|
9
|
+
declare function parseHtml(elem: DOMElement, _children: Descendant[], _editor: IDomEditor): VideoElement;
|
|
10
10
|
export declare const parseHtmlConf: {
|
|
11
11
|
selector: string;
|
|
12
12
|
parseElemHtml: typeof parseHtml;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* @description video render elem
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
+
import { IDomEditor } from '@wangeditor-next/core';
|
|
5
6
|
import { Element } from 'slate';
|
|
6
7
|
import { VNode } from 'snabbdom';
|
|
7
|
-
import { IDomEditor } from '@wangeditor-next/core';
|
|
8
8
|
declare function renderVideo(elemNode: Element, children: VNode[] | null, editor: IDomEditor): VNode;
|
|
9
9
|
declare const renderVideoConf: {
|
|
10
10
|
type: string;
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import $, { Dom7Array } from 'dom7';
|
|
6
6
|
import { videoStyle } from '../module/custom-types';
|
|
7
|
+
import DOMNode = globalThis.Node;
|
|
8
|
+
import DOMComment = globalThis.Comment;
|
|
9
|
+
import DOMElement = globalThis.Element;
|
|
10
|
+
import DOMText = globalThis.Text;
|
|
11
|
+
import DOMRange = globalThis.Range;
|
|
12
|
+
import DOMSelection = globalThis.Selection;
|
|
13
|
+
import DOMStaticRange = globalThis.StaticRange;
|
|
7
14
|
export { Dom7Array } from 'dom7';
|
|
8
15
|
export default $;
|
|
9
16
|
/**
|
|
@@ -19,11 +26,4 @@ export declare function getTagName($elem: Dom7Array): string;
|
|
|
19
26
|
* @returns iframe html string with size style
|
|
20
27
|
*/
|
|
21
28
|
export declare function genSizeStyledIframeHtml(iframeHtml: string, width?: string, height?: string, style?: videoStyle): string;
|
|
22
|
-
|
|
23
|
-
import DOMComment = globalThis.Comment;
|
|
24
|
-
import DOMElement = globalThis.Element;
|
|
25
|
-
import DOMText = globalThis.Text;
|
|
26
|
-
import DOMRange = globalThis.Range;
|
|
27
|
-
import DOMSelection = globalThis.Selection;
|
|
28
|
-
import DOMStaticRange = globalThis.StaticRange;
|
|
29
|
-
export { DOMNode, DOMComment, DOMElement, DOMText, DOMRange, DOMSelection, DOMStaticRange };
|
|
29
|
+
export { DOMComment, DOMElement, DOMNode, DOMRange, DOMSelection, DOMStaticRange, DOMText, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wangeditor-next/video-module",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.10",
|
|
4
4
|
"description": "wangEditor video module",
|
|
5
5
|
"author": "cycleccc <2991205548@qq.com>",
|
|
6
6
|
"contributors": [],
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@uppy/core": "^2.1.4",
|
|
44
44
|
"@uppy/xhr-upload": "^2.0.7",
|
|
45
|
-
"@wangeditor-next/core": "1.7.
|
|
45
|
+
"@wangeditor-next/core": "1.7.6",
|
|
46
46
|
"dom7": "^3.0.0",
|
|
47
47
|
"nanoid": "^5.0.0",
|
|
48
48
|
"slate": "^0.72.0",
|