@uxf/wysiwyg 1.2.8 → 1.2.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/Editor/Slate/Element.js +3 -3
- package/package.json +1 -1
- package/types.d.ts +12 -13
package/Editor/Slate/Element.js
CHANGED
|
@@ -27,8 +27,8 @@ var Element = function (props) {
|
|
|
27
27
|
if ("imageUrlClient" in plugin && "imageNamespace" in plugin) {
|
|
28
28
|
return (react_1.default.createElement(plugin.editorElementRenderer, { attributes: attributes, element: element, key: "element-plugin-".concat(index), imageNamespace: plugin.imageNamespace, imageUrlClient: plugin.imageUrlClient }, children));
|
|
29
29
|
}
|
|
30
|
-
if ("
|
|
31
|
-
return (react_1.default.createElement(plugin.editorElementRenderer, { attributes: attributes, element: element, key: "element-plugin-".concat(index),
|
|
30
|
+
if ("videoThumbnailImageUrlClient" in plugin && "videoThumbnailImageNamespace" in plugin) {
|
|
31
|
+
return (react_1.default.createElement(plugin.editorElementRenderer, { attributes: attributes, element: element, key: "element-plugin-".concat(index), videoThumbnailImageNamespace: plugin.videoThumbnailImageNamespace, videoThumbnailImageUrlClient: plugin.videoThumbnailImageUrlClient }, children));
|
|
32
32
|
}
|
|
33
33
|
return (react_1.default.createElement(plugin.editorElementRenderer, { key: "element-plugin-".concat(index), attributes: attributes, element: element }, children));
|
|
34
34
|
}
|
|
@@ -36,4 +36,4 @@ var Element = function (props) {
|
|
|
36
36
|
})));
|
|
37
37
|
};
|
|
38
38
|
exports.Element = Element;
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRWxlbWVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9FZGl0b3IvU2xhdGUvRWxlbWVudC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs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xDQUFDO2FBQ0w7WUFFRCxJQUFJLDhCQUE4QixJQUFJLE1BQU0sSUFBSSw4QkFBOEIsSUFBSSxNQUFNLEVBQUU7Z0JBQ3RGLE9BQU8sQ0FDSCw4QkFBQyxNQUFNLENBQUMscUJBQXFCLElBQ3pCLFVBQVUsRUFBRSxVQUFVLEVBQ3RCLE9BQU8sRUFBRSxPQUFPLEVBQ2hCLEdBQUcsRUFBRSx5QkFBa0IsS0FBSyxDQUFFLEVBQzlCLDRCQUE0QixFQUFFLE1BQU0sQ0FBQyw0QkFBNEIsRUFDakUsNEJBQTRCLEVBQUUsTUFBTSxDQUFDLDRCQUE0QixJQUVoRSxRQUFRLENBQ2tCLENBQ2xDLENBQUM7YUFDTDtZQUVELE9BQU8sQ0FDSCw4QkFBQyxNQUFNLENBQUMscUJBQXFCLElBQ3pCLEdBQUcsRUFBRSx5QkFBa0IsS0FBSyxDQUFFLEVBQzlCLFVBQVUsRUFBRSxVQUFVLEVBQ3RCLE9BQU8sRUFBRSxPQUFPLElBRWYsUUFBUSxDQUNrQixDQUNsQyxDQUFDO1NBQ0w7UUFFRCxPQUFPLElBQUksQ0FBQztJQUNoQixDQUFDLENBQUMsQ0FDSCxDQUNOLENBQUM7QUFDTixDQUFDLENBQUM7QUEzRFcsUUFBQSxPQUFPLFdBMkRsQiJ9
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { CSSProperties, FC } from "react";
|
|
|
2
2
|
import { BaseEditor, Editor, Range } from "slate";
|
|
3
3
|
import { HistoryEditor } from "slate-history";
|
|
4
4
|
import { ReactEditor, RenderElementProps as SlateRenderElementProps, RenderLeafProps as SlateRenderLeafProps } from "slate-react";
|
|
5
|
+
declare type DateString = `${number}-${number}-${number}`;
|
|
5
6
|
export interface WysiwygEditorProps {
|
|
6
7
|
value?: EditorBlockElement[];
|
|
7
8
|
onChange: (event: any) => void;
|
|
@@ -12,7 +13,7 @@ export interface WysiwygEditorProps {
|
|
|
12
13
|
stylesForEditable?: CSSProperties;
|
|
13
14
|
}
|
|
14
15
|
export declare type ImageUrlClient = (uuid: string, extension: string, namespace?: string) => string;
|
|
15
|
-
export declare type
|
|
16
|
+
export declare type VideoThumbnailImageUrlClient = ImageUrlClient;
|
|
16
17
|
export declare type ImageUploadHandler = (file: File, namespace: string) => Promise<{
|
|
17
18
|
id: number;
|
|
18
19
|
uuid: string;
|
|
@@ -22,7 +23,7 @@ export declare type ImageUploadHandler = (file: File, namespace: string) => Prom
|
|
|
22
23
|
namespace?: string | null;
|
|
23
24
|
url?: string;
|
|
24
25
|
}>;
|
|
25
|
-
export declare type
|
|
26
|
+
export declare type VideoThumbnailImageUploadHandler = ImageUploadHandler;
|
|
26
27
|
export declare type FontStyle = "italic" | "bold" | "underline" | "code";
|
|
27
28
|
export declare type LeafMarks = FontStyle;
|
|
28
29
|
export declare type Headings = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "paragraph";
|
|
@@ -52,12 +53,10 @@ export interface EditorImageElement extends EditorBlockElement {
|
|
|
52
53
|
url?: string;
|
|
53
54
|
}
|
|
54
55
|
export interface EditorVideoElement extends EditorBlockElement {
|
|
55
|
-
uuid?: string;
|
|
56
|
-
extension?: string;
|
|
57
56
|
name: string;
|
|
58
|
-
|
|
57
|
+
thumbnailUrl: string;
|
|
59
58
|
type: "video";
|
|
60
|
-
uploadedAt:
|
|
59
|
+
uploadedAt: DateString;
|
|
61
60
|
url: string;
|
|
62
61
|
}
|
|
63
62
|
export interface EditorButtonElement extends EditorBlockElement {
|
|
@@ -143,25 +142,25 @@ export interface EditorVideoElementPlugin {
|
|
|
143
142
|
toolbarButton: FC<ToolbarVideoButtonProps>;
|
|
144
143
|
editorElementRenderer: FC<EditorVideoElementRendererProps>;
|
|
145
144
|
type: string;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
videoThumbnailImageUploadHandler: VideoThumbnailImageUploadHandler;
|
|
146
|
+
videoThumbnailImageUrlClient: VideoThumbnailImageUrlClient;
|
|
147
|
+
videoThumbnailImageNamespace: string;
|
|
149
148
|
}
|
|
150
149
|
export interface ToolbarImageButtonProps extends ToolbarButtonProps {
|
|
151
150
|
imageUploadHandler: ImageUploadHandler;
|
|
152
151
|
imageNamespace: string;
|
|
153
152
|
}
|
|
154
153
|
export interface ToolbarVideoButtonProps extends ToolbarButtonProps {
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
videoThumbnailImageUploadHandler: VideoThumbnailImageUploadHandler;
|
|
155
|
+
videoThumbnailImageNamespace: string;
|
|
157
156
|
}
|
|
158
157
|
export interface EditorImageElementRendererProps extends EditorElementRendererProps {
|
|
159
158
|
imageUrlClient: ImageUrlClient;
|
|
160
159
|
imageNamespace: string;
|
|
161
160
|
}
|
|
162
161
|
export interface EditorVideoElementRendererProps extends EditorElementRendererProps {
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
videoThumbnailImageUrlClient: VideoThumbnailImageUrlClient;
|
|
163
|
+
videoThumbnailImageNamespace: string;
|
|
165
164
|
}
|
|
166
165
|
export interface ToolbarProps {
|
|
167
166
|
plugins: EditorPlugin[];
|