@uxf/wysiwyg 11.72.3 → 11.74.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.
- package/README.md +3 -1
- package/package.json +3 -3
- package/translations/translations.d.ts +405 -5
- package/translations/translations.js +404 -4
- package/components.d.ts +0 -7
- package/components.js +0 -34
- package/config/icons-config.d.ts +0 -2
- package/config/icons-config.js +0 -5
- package/config/icons.d.ts +0 -183
- package/config/icons.js +0 -51
- package/create-all-plugins-with-ui.d.ts +0 -64
- package/create-all-plugins-with-ui.js +0 -127
- package/create-plugins-with-ui.d.ts +0 -4
- package/create-plugins-with-ui.js +0 -47
- package/hooks.d.ts +0 -9
- package/hooks.js +0 -20
- package/index.d.ts +0 -6
- package/index.js +0 -38
- package/plugins/blockquote/create-blockquote-plugin.d.ts +0 -3
- package/plugins/blockquote/create-blockquote-plugin.js +0 -9
- package/plugins/blockquote/types.d.ts +0 -2
- package/plugins/blockquote/types.js +0 -6
- package/plugins/button/constants.d.ts +0 -2
- package/plugins/button/constants.js +0 -5
- package/plugins/button/create-button-plugin.d.ts +0 -2
- package/plugins/button/create-button-plugin.js +0 -11
- package/plugins/button/index.d.ts +0 -3
- package/plugins/button/index.js +0 -23
- package/plugins/button/transforms/get-active-button.d.ts +0 -2
- package/plugins/button/transforms/get-active-button.js +0 -9
- package/plugins/button/transforms/index.d.ts +0 -4
- package/plugins/button/transforms/index.js +0 -11
- package/plugins/button/transforms/insert-button.d.ts +0 -2
- package/plugins/button/transforms/insert-button.js +0 -16
- package/plugins/button/transforms/is-button-active.d.ts +0 -2
- package/plugins/button/transforms/is-button-active.js +0 -7
- package/plugins/button/transforms/remove-selected-button.d.ts +0 -2
- package/plugins/button/transforms/remove-selected-button.js +0 -13
- package/plugins/button/transforms/update-button.d.ts +0 -2
- package/plugins/button/transforms/update-button.js +0 -9
- package/plugins/embedded/utils.d.ts +0 -1
- package/plugins/embedded/utils.js +0 -7
- package/plugins/embedded/video/create-video-plugin.d.ts +0 -4
- package/plugins/embedded/video/create-video-plugin.js +0 -19
- package/plugins/embedded/video/get-active-video.d.ts +0 -2
- package/plugins/embedded/video/get-active-video.js +0 -9
- package/plugins/embedded/video/insert-video.d.ts +0 -2
- package/plugins/embedded/video/insert-video.js +0 -18
- package/plugins/embedded/video/update-video.d.ts +0 -2
- package/plugins/embedded/video/update-video.js +0 -11
- package/plugins/exit-break/create-exit-break-plugin.d.ts +0 -3
- package/plugins/exit-break/create-exit-break-plugin.js +0 -30
- package/plugins/heading/constants.d.ts +0 -8
- package/plugins/heading/constants.js +0 -11
- package/plugins/heading/create-headings-plugin.d.ts +0 -8
- package/plugins/heading/create-headings-plugin.js +0 -40
- package/plugins/highlight/createHighlightPlugin.d.ts +0 -3
- package/plugins/highlight/createHighlightPlugin.js +0 -27
- package/plugins/highlight/types.d.ts +0 -10
- package/plugins/highlight/types.js +0 -4
- package/plugins/image/create-image-plugin.d.ts +0 -6
- package/plugins/image/create-image-plugin.js +0 -105
- package/plugins/image/hooks/use-image-handlers.d.ts +0 -5
- package/plugins/image/hooks/use-image-handlers.js +0 -19
- package/plugins/image/transforms/get-active-image.d.ts +0 -2
- package/plugins/image/transforms/get-active-image.js +0 -9
- package/plugins/image/transforms/insert-image.d.ts +0 -3
- package/plugins/image/transforms/insert-image.js +0 -19
- package/plugins/image/transforms/is-image-active.d.ts +0 -2
- package/plugins/image/transforms/is-image-active.js +0 -7
- package/plugins/image/transforms/remove-selected-image.d.ts +0 -2
- package/plugins/image/transforms/remove-selected-image.js +0 -13
- package/plugins/image/transforms/update-image.d.ts +0 -3
- package/plugins/image/transforms/update-image.js +0 -12
- package/plugins/image/types.d.ts +0 -12
- package/plugins/image/types.js +0 -6
- package/plugins/image/utils/is-image-url.d.ts +0 -2
- package/plugins/image/utils/is-image-url.js +0 -135
- package/plugins/image/with-image.d.ts +0 -7
- package/plugins/image/with-image.js +0 -19
- package/plugins/image/with-paste-image-url.d.ts +0 -7
- package/plugins/image/with-paste-image-url.js +0 -36
- package/plugins/image/with-paste-image.d.ts +0 -7
- package/plugins/image/with-paste-image.js +0 -49
- package/plugins/link/constants.d.ts +0 -2
- package/plugins/link/constants.js +0 -6
- package/plugins/link/create-link-plugin.d.ts +0 -3
- package/plugins/link/create-link-plugin.js +0 -15
- package/plugins/link/floating-link-wrapper.d.ts +0 -11
- package/plugins/link/floating-link-wrapper.js +0 -26
- package/plugins/link/hooks/index.d.ts +0 -4
- package/plugins/link/hooks/index.js +0 -11
- package/plugins/link/hooks/use-link-actions.d.ts +0 -12
- package/plugins/link/hooks/use-link-actions.js +0 -48
- package/plugins/link/hooks/use-link-cancel-on-escape.d.ts +0 -1
- package/plugins/link/hooks/use-link-cancel-on-escape.js +0 -5
- package/plugins/link/hooks/use-link-submit-on-enter.d.ts +0 -1
- package/plugins/link/hooks/use-link-submit-on-enter.js +0 -23
- package/plugins/link/transforms/get-active-link.d.ts +0 -3
- package/plugins/link/transforms/get-active-link.js +0 -17
- package/plugins/link/transforms/insert-link.d.ts +0 -2
- package/plugins/link/transforms/insert-link.js +0 -27
- package/plugins/link/transforms/is-link-selected.d.ts +0 -2
- package/plugins/link/transforms/is-link-selected.js +0 -15
- package/plugins/link/transforms/submit-link.d.ts +0 -8
- package/plugins/link/transforms/submit-link.js +0 -36
- package/plugins/link/transforms/trigger-link-insert-or-edit.d.ts +0 -2
- package/plugins/link/transforms/trigger-link-insert-or-edit.js +0 -6
- package/plugins/link/transforms/unwrap-link.d.ts +0 -2
- package/plugins/link/transforms/unwrap-link.js +0 -10
- package/plugins/link/types.d.ts +0 -5
- package/plugins/link/types.js +0 -2
- package/plugins/list/constants.d.ts +0 -4
- package/plugins/list/constants.js +0 -14
- package/plugins/list/create-list-plugin.d.ts +0 -4
- package/plugins/list/create-list-plugin.js +0 -16
- package/plugins/mark-bold/create-bold-plugin.d.ts +0 -3
- package/plugins/mark-bold/create-bold-plugin.js +0 -6
- package/plugins/mark-bold/types.d.ts +0 -2
- package/plugins/mark-bold/types.js +0 -6
- package/plugins/mark-code/create-code-plugin.d.ts +0 -3
- package/plugins/mark-code/create-code-plugin.js +0 -6
- package/plugins/mark-code/types.d.ts +0 -2
- package/plugins/mark-code/types.js +0 -6
- package/plugins/mark-italic/create-italic-plugin.d.ts +0 -3
- package/plugins/mark-italic/create-italic-plugin.js +0 -6
- package/plugins/mark-italic/types.d.ts +0 -2
- package/plugins/mark-italic/types.js +0 -6
- package/plugins/mark-underline/create-underline-plugin.d.ts +0 -3
- package/plugins/mark-underline/create-underline-plugin.js +0 -6
- package/plugins/mark-underline/types.d.ts +0 -2
- package/plugins/mark-underline/types.js +0 -6
- package/plugins/node-id/add-ids-to-nodes.d.ts +0 -2
- package/plugins/node-id/add-ids-to-nodes.js +0 -22
- package/plugins/node-id/create-node-id-plugin.d.ts +0 -3
- package/plugins/node-id/create-node-id-plugin.js +0 -6
- package/plugins/paragraph/create-paragraph-plugin.d.ts +0 -3
- package/plugins/paragraph/create-paragraph-plugin.js +0 -9
- package/plugins/paragraph/types.d.ts +0 -2
- package/plugins/paragraph/types.js +0 -6
- package/plugins/reset-node/create-reset-node.d.ts +0 -3
- package/plugins/reset-node/create-reset-node.js +0 -28
- package/plugins/select-on-backspace/create-select-on-backspace-plugin.d.ts +0 -3
- package/plugins/select-on-backspace/create-select-on-backspace-plugin.js +0 -14
- package/plugins/soft-break/create-soft-break-plugin.d.ts +0 -3
- package/plugins/soft-break/create-soft-break-plugin.js +0 -22
- package/plugins/trailing-block/create-trailing-block-plugin.d.ts +0 -3
- package/plugins/trailing-block/create-trailing-block-plugin.js +0 -6
- package/serializers/serialize-to-plaintext.d.ts +0 -2
- package/serializers/serialize-to-plaintext.js +0 -8
- package/translations/context.d.ts +0 -2
- package/translations/context.js +0 -9
- package/translations/cs.d.ts +0 -52
- package/translations/cs.js +0 -55
- package/translations/en.d.ts +0 -2
- package/translations/en.js +0 -55
- package/translations/sk.d.ts +0 -2
- package/translations/sk.js +0 -55
- package/types.d.ts +0 -102
- package/types.js +0 -2
- package/ui/blockquote-element.d.ts +0 -2
- package/ui/blockquote-element.js +0 -13
- package/ui/bold-mark.d.ts +0 -2
- package/ui/bold-mark.js +0 -13
- package/ui/button/button-element.d.ts +0 -2
- package/ui/button/button-element.js +0 -54
- package/ui/button/index.d.ts +0 -1
- package/ui/button/index.js +0 -5
- package/ui/button/insert-button-modal-content.d.ts +0 -8
- package/ui/button/insert-button-modal-content.js +0 -81
- package/ui/code-mark.d.ts +0 -2
- package/ui/code-mark.js +0 -13
- package/ui/components/element/element-action-buttons.d.ts +0 -9
- package/ui/components/element/element-action-buttons.js +0 -22
- package/ui/components/element/element-with-action-buttons.d.ts +0 -10
- package/ui/components/element/element-with-action-buttons.js +0 -17
- package/ui/components/modal/modal-button-cancel.d.ts +0 -9
- package/ui/components/modal/modal-button-cancel.js +0 -45
- package/ui/components/modal/modal-button-submit.d.ts +0 -6
- package/ui/components/modal/modal-button-submit.js +0 -12
- package/ui/components/modal/modal-buttons.d.ts +0 -11
- package/ui/components/modal/modal-buttons.js +0 -16
- package/ui/components/modal/modal-content.d.ts +0 -6
- package/ui/components/modal/modal-content.js +0 -14
- package/ui/create-uxf-ui.d.ts +0 -21
- package/ui/create-uxf-ui.js +0 -51
- package/ui/floating-link.d.ts +0 -2
- package/ui/floating-link.js +0 -110
- package/ui/heading-elements.d.ts +0 -7
- package/ui/heading-elements.js +0 -38
- package/ui/highlight-mark.d.ts +0 -3
- package/ui/highlight-mark.js +0 -13
- package/ui/image/image-element.d.ts +0 -2
- package/ui/image/image-element.js +0 -53
- package/ui/image/insert-image-modal-content.d.ts +0 -8
- package/ui/image/insert-image-modal-content.js +0 -87
- package/ui/italic-mark.d.ts +0 -2
- package/ui/italic-mark.js +0 -13
- package/ui/link-element.d.ts +0 -3
- package/ui/link-element.js +0 -14
- package/ui/list-item-element.d.ts +0 -2
- package/ui/list-item-element.js +0 -13
- package/ui/list-ordered-element.d.ts +0 -2
- package/ui/list-ordered-element.js +0 -13
- package/ui/list-unordered-element.d.ts +0 -2
- package/ui/list-unordered-element.js +0 -13
- package/ui/paragraph-element.d.ts +0 -2
- package/ui/paragraph-element.js +0 -13
- package/ui/toolbar/buttons/button-toolbar-button.d.ts +0 -10
- package/ui/toolbar/buttons/button-toolbar-button.js +0 -20
- package/ui/toolbar/buttons/element-toolbar-button.d.ts +0 -12
- package/ui/toolbar/buttons/element-toolbar-button.js +0 -25
- package/ui/toolbar/buttons/image-toolbar-button.d.ts +0 -10
- package/ui/toolbar/buttons/image-toolbar-button.js +0 -20
- package/ui/toolbar/buttons/link-toolbar-button.d.ts +0 -10
- package/ui/toolbar/buttons/link-toolbar-button.js +0 -29
- package/ui/toolbar/buttons/list-toolbar-button.d.ts +0 -13
- package/ui/toolbar/buttons/list-toolbar-button.js +0 -27
- package/ui/toolbar/buttons/mark-toolbar-button.d.ts +0 -13
- package/ui/toolbar/buttons/mark-toolbar-button.js +0 -25
- package/ui/toolbar/buttons/modal-toolbar-button.d.ts +0 -15
- package/ui/toolbar/buttons/modal-toolbar-button.js +0 -22
- package/ui/toolbar/buttons/toolbar-button.d.ts +0 -15
- package/ui/toolbar/buttons/toolbar-button.js +0 -35
- package/ui/toolbar/buttons/undo-redo-button-group.d.ts +0 -8
- package/ui/toolbar/buttons/undo-redo-button-group.js +0 -64
- package/ui/toolbar/buttons/video-toolbar-button.d.ts +0 -10
- package/ui/toolbar/buttons/video-toolbar-button.js +0 -20
- package/ui/toolbar/toolbar.d.ts +0 -3
- package/ui/toolbar/toolbar.js +0 -77
- package/ui/toolbar/types.d.ts +0 -8
- package/ui/toolbar/types.js +0 -2
- package/ui/underline-mark.d.ts +0 -2
- package/ui/underline-mark.js +0 -13
- package/ui/utils.d.ts +0 -2
- package/ui/utils.js +0 -13
- package/ui/video/insert-video-modal-content.d.ts +0 -8
- package/ui/video/insert-video-modal-content.js +0 -76
- package/ui/video/video-element.d.ts +0 -2
- package/ui/video/video-element.js +0 -55
- package/utils/url-helper.d.ts +0 -7
- package/utils/url-helper.js +0 -15
- package/utils/url-helper.test.d.ts +0 -1
- package/utils/url-helper.test.js +0 -37
- package/utils.d.ts +0 -30
- package/utils.js +0 -88
- package/wysiwyg-editor.d.ts +0 -17
- package/wysiwyg-editor.js +0 -44
- package/wysiwyg-editor.stories.d.ts +0 -5
- package/wysiwyg-editor.stories.js +0 -193
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from "react";
|
|
2
|
-
import { HeadingsPluginOptions } from "./plugins/heading/create-headings-plugin";
|
|
3
|
-
import { UxfImagePluginOptions } from "./plugins/image/types";
|
|
4
|
-
import { ElementUiComponent } from "./types";
|
|
5
|
-
export declare const createHeadingsPluginWithUi: (options?: HeadingsPluginOptions) => {
|
|
6
|
-
plugin: import("@udecode/plate-core").PlatePlugin<HeadingsPluginOptions, import("./types").WysiwygContent, import("@udecode/plate-core").PlateEditor<import("./types").WysiwygContent>>;
|
|
7
|
-
components: {
|
|
8
|
-
[key: string]: ElementUiComponent;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export declare const createBlockquotePluginWithUi: () => {
|
|
12
|
-
plugin: import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").HotkeyPlugin, import("./types").WysiwygContent, import("./types").UxfEditor>;
|
|
13
|
-
component: ElementUiComponent;
|
|
14
|
-
};
|
|
15
|
-
export declare const createBoldPluginWithUi: () => {
|
|
16
|
-
plugin: import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").ToggleMarkPlugin, import("./types").WysiwygContent, import("./types").UxfEditor>;
|
|
17
|
-
component: import("./types").LeafUiComponent;
|
|
18
|
-
};
|
|
19
|
-
export declare const createHighlightPluginWithUi: (color?: CSSProperties["color"]) => {
|
|
20
|
-
plugin: import("@udecode/plate-core").PlatePlugin<import("./plugins/highlight/types").HighlightPluginOptions, import("./types").WysiwygContent, import("@udecode/plate-core").PlateEditor<import("./types").WysiwygContent>>;
|
|
21
|
-
component: import("react").FC<import("./plugins/highlight/types").HighlightLeafElementProps>;
|
|
22
|
-
};
|
|
23
|
-
export declare const createItalicPluginWithUi: () => {
|
|
24
|
-
plugin: import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").ToggleMarkPlugin, import("./types").WysiwygContent, import("./types").UxfEditor>;
|
|
25
|
-
component: ElementUiComponent;
|
|
26
|
-
};
|
|
27
|
-
export declare const createUnderlinePluginWithUi: () => {
|
|
28
|
-
plugin: import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").ToggleMarkPlugin, import("./types").WysiwygContent, import("./types").UxfEditor>;
|
|
29
|
-
component: import("./types").LeafUiComponent;
|
|
30
|
-
};
|
|
31
|
-
export declare const createCodePluginWithUi: () => {
|
|
32
|
-
plugin: import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").ToggleMarkPlugin, import("./types").WysiwygContent, import("./types").UxfEditor>;
|
|
33
|
-
component: import("./types").LeafUiComponent;
|
|
34
|
-
};
|
|
35
|
-
export declare const createListPluginWithUi: () => {
|
|
36
|
-
plugin: import("./types").UxfPlatePlugin<import("@udecode/plate-list").ListPlugin>;
|
|
37
|
-
components: {
|
|
38
|
-
ul: ElementUiComponent;
|
|
39
|
-
ol: ElementUiComponent;
|
|
40
|
-
li: ElementUiComponent;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
export declare const createLinkPluginWithUi: () => {
|
|
44
|
-
plugin: import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-link").LinkPlugin, import("./types").WysiwygContent, import("./types").UxfEditor>;
|
|
45
|
-
component: ElementUiComponent<import("./plugins/link/types").TLinkElement>;
|
|
46
|
-
};
|
|
47
|
-
export declare const createImagePluginWithUi: (options: UxfImagePluginOptions) => {
|
|
48
|
-
plugin: import("@udecode/plate-core").PlatePlugin<UxfImagePluginOptions, import("./types").WysiwygContent, import("@udecode/plate-core").PlateEditor<import("./types").WysiwygContent>>;
|
|
49
|
-
component: ElementUiComponent<import("./types").UxfImageElement>;
|
|
50
|
-
};
|
|
51
|
-
export declare const createVideoPluginWithUi: () => {
|
|
52
|
-
plugin: import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-media").MediaPlugin, import("./types").WysiwygContent, import("@udecode/plate-core").PlateEditor<import("./types").WysiwygContent>>;
|
|
53
|
-
component: ElementUiComponent<import("./types").UxfVideoElement>;
|
|
54
|
-
};
|
|
55
|
-
export declare const createButtonPluginWithUi: () => {
|
|
56
|
-
plugin: import("@udecode/plate-core").PlatePlugin<import("@udecode/utils").AnyObject, import("./types").WysiwygContent, import("@udecode/plate-core").PlateEditor<import("./types").WysiwygContent>>;
|
|
57
|
-
component: ElementUiComponent<import("./types").UxfButtonElement>;
|
|
58
|
-
};
|
|
59
|
-
export interface CreateAllPluginsOptions {
|
|
60
|
-
image: UxfImagePluginOptions;
|
|
61
|
-
headings?: HeadingsPluginOptions;
|
|
62
|
-
highlightColor?: CSSProperties["color"];
|
|
63
|
-
}
|
|
64
|
-
export declare const createAllPluginsWithUi: (options: CreateAllPluginsOptions) => import("./types").UxfPlatePlugin[];
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createAllPluginsWithUi = exports.createButtonPluginWithUi = exports.createVideoPluginWithUi = exports.createImagePluginWithUi = exports.createLinkPluginWithUi = exports.createListPluginWithUi = exports.createCodePluginWithUi = exports.createUnderlinePluginWithUi = exports.createItalicPluginWithUi = exports.createHighlightPluginWithUi = exports.createBoldPluginWithUi = exports.createBlockquotePluginWithUi = exports.createHeadingsPluginWithUi = void 0;
|
|
4
|
-
const empty_array_1 = require("@uxf/core/constants/empty-array");
|
|
5
|
-
const tw_colors_1 = require("@uxf/ui/tw-tokens/tw-colors");
|
|
6
|
-
const create_plugins_with_ui_1 = require("./create-plugins-with-ui");
|
|
7
|
-
const create_blockquote_plugin_1 = require("./plugins/blockquote/create-blockquote-plugin");
|
|
8
|
-
const button_1 = require("./plugins/button");
|
|
9
|
-
const create_video_plugin_1 = require("./plugins/embedded/video/create-video-plugin");
|
|
10
|
-
const constants_1 = require("./plugins/heading/constants");
|
|
11
|
-
const create_headings_plugin_1 = require("./plugins/heading/create-headings-plugin");
|
|
12
|
-
const createHighlightPlugin_1 = require("./plugins/highlight/createHighlightPlugin");
|
|
13
|
-
const create_image_plugin_1 = require("./plugins/image/create-image-plugin");
|
|
14
|
-
const create_link_plugin_1 = require("./plugins/link/create-link-plugin");
|
|
15
|
-
const create_list_plugin_1 = require("./plugins/list/create-list-plugin");
|
|
16
|
-
const create_bold_plugin_1 = require("./plugins/mark-bold/create-bold-plugin");
|
|
17
|
-
const create_code_plugin_1 = require("./plugins/mark-code/create-code-plugin");
|
|
18
|
-
const create_italic_plugin_1 = require("./plugins/mark-italic/create-italic-plugin");
|
|
19
|
-
const create_underline_plugin_1 = require("./plugins/mark-underline/create-underline-plugin");
|
|
20
|
-
const blockquote_element_1 = require("./ui/blockquote-element");
|
|
21
|
-
const bold_mark_1 = require("./ui/bold-mark");
|
|
22
|
-
const button_2 = require("./ui/button");
|
|
23
|
-
const code_mark_1 = require("./ui/code-mark");
|
|
24
|
-
const heading_elements_1 = require("./ui/heading-elements");
|
|
25
|
-
const highlight_mark_1 = require("./ui/highlight-mark");
|
|
26
|
-
const image_element_1 = require("./ui/image/image-element");
|
|
27
|
-
const italic_mark_1 = require("./ui/italic-mark");
|
|
28
|
-
const link_element_1 = require("./ui/link-element");
|
|
29
|
-
const list_item_element_1 = require("./ui/list-item-element");
|
|
30
|
-
const list_ordered_element_1 = require("./ui/list-ordered-element");
|
|
31
|
-
const list_unordered_element_1 = require("./ui/list-unordered-element");
|
|
32
|
-
const underline_mark_1 = require("./ui/underline-mark");
|
|
33
|
-
const video_element_1 = require("./ui/video/video-element");
|
|
34
|
-
const createHeadingsPluginWithUi = (options) => {
|
|
35
|
-
var _a;
|
|
36
|
-
const disabledLevels = (_a = options === null || options === void 0 ? void 0 : options.disabledLevels) !== null && _a !== void 0 ? _a : empty_array_1.EMPTY_ARRAY;
|
|
37
|
-
const isDisabled = (level) => disabledLevels.findIndex((e) => e === level) !== -1;
|
|
38
|
-
const components = {};
|
|
39
|
-
const elementsByKey = [heading_elements_1.H1Element, heading_elements_1.H2Element, heading_elements_1.H3Element, heading_elements_1.H4Element, heading_elements_1.H5Element, heading_elements_1.H6Element];
|
|
40
|
-
for (let level = 1; level <= 6; level++) {
|
|
41
|
-
if (isDisabled(level)) {
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
components[constants_1.KEYS_HEADING[level - 1]] = elementsByKey[level - 1];
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
plugin: (0, create_headings_plugin_1.createHeadingsPlugin)({ options }),
|
|
48
|
-
components,
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
exports.createHeadingsPluginWithUi = createHeadingsPluginWithUi;
|
|
52
|
-
const createBlockquotePluginWithUi = () => ({
|
|
53
|
-
plugin: (0, create_blockquote_plugin_1.createBlockquotePlugin)(),
|
|
54
|
-
component: blockquote_element_1.BlockquoteElement,
|
|
55
|
-
});
|
|
56
|
-
exports.createBlockquotePluginWithUi = createBlockquotePluginWithUi;
|
|
57
|
-
const createBoldPluginWithUi = () => ({
|
|
58
|
-
plugin: (0, create_bold_plugin_1.createBoldPlugin)(),
|
|
59
|
-
component: bold_mark_1.BoldMark,
|
|
60
|
-
});
|
|
61
|
-
exports.createBoldPluginWithUi = createBoldPluginWithUi;
|
|
62
|
-
const createHighlightPluginWithUi = (color = tw_colors_1.twColors.yellow["300"]) => ({
|
|
63
|
-
plugin: (0, createHighlightPlugin_1.createHighlightPlugin)(color),
|
|
64
|
-
component: highlight_mark_1.HighlightMark,
|
|
65
|
-
});
|
|
66
|
-
exports.createHighlightPluginWithUi = createHighlightPluginWithUi;
|
|
67
|
-
const createItalicPluginWithUi = () => ({
|
|
68
|
-
plugin: (0, create_italic_plugin_1.createItalicPlugin)(),
|
|
69
|
-
component: italic_mark_1.ItalicMark,
|
|
70
|
-
});
|
|
71
|
-
exports.createItalicPluginWithUi = createItalicPluginWithUi;
|
|
72
|
-
const createUnderlinePluginWithUi = () => ({
|
|
73
|
-
plugin: (0, create_underline_plugin_1.createUnderlinePlugin)(),
|
|
74
|
-
component: underline_mark_1.UnderlineMark,
|
|
75
|
-
});
|
|
76
|
-
exports.createUnderlinePluginWithUi = createUnderlinePluginWithUi;
|
|
77
|
-
const createCodePluginWithUi = () => ({
|
|
78
|
-
plugin: (0, create_code_plugin_1.createCodePlugin)(),
|
|
79
|
-
component: code_mark_1.CodeMark,
|
|
80
|
-
});
|
|
81
|
-
exports.createCodePluginWithUi = createCodePluginWithUi;
|
|
82
|
-
const createListPluginWithUi = () => ({
|
|
83
|
-
plugin: (0, create_list_plugin_1.createListPlugin)(),
|
|
84
|
-
components: {
|
|
85
|
-
ul: list_unordered_element_1.ListUnorderedElement,
|
|
86
|
-
ol: list_ordered_element_1.ListOrderedElement,
|
|
87
|
-
li: list_item_element_1.ListItemElement,
|
|
88
|
-
},
|
|
89
|
-
});
|
|
90
|
-
exports.createListPluginWithUi = createListPluginWithUi;
|
|
91
|
-
const createLinkPluginWithUi = () => ({
|
|
92
|
-
plugin: (0, create_link_plugin_1.createLinkPlugin)(),
|
|
93
|
-
component: link_element_1.LinkElement,
|
|
94
|
-
});
|
|
95
|
-
exports.createLinkPluginWithUi = createLinkPluginWithUi;
|
|
96
|
-
const createImagePluginWithUi = (options) => ({
|
|
97
|
-
plugin: (0, create_image_plugin_1.createImagePlugin)({
|
|
98
|
-
options,
|
|
99
|
-
}),
|
|
100
|
-
component: image_element_1.ImageElement,
|
|
101
|
-
});
|
|
102
|
-
exports.createImagePluginWithUi = createImagePluginWithUi;
|
|
103
|
-
const createVideoPluginWithUi = () => ({
|
|
104
|
-
plugin: (0, create_video_plugin_1.createVideoPlugin)(),
|
|
105
|
-
component: video_element_1.VideoElement,
|
|
106
|
-
});
|
|
107
|
-
exports.createVideoPluginWithUi = createVideoPluginWithUi;
|
|
108
|
-
const createButtonPluginWithUi = () => ({
|
|
109
|
-
plugin: (0, button_1.createButtonPlugin)(),
|
|
110
|
-
component: button_2.ButtonElement,
|
|
111
|
-
});
|
|
112
|
-
exports.createButtonPluginWithUi = createButtonPluginWithUi;
|
|
113
|
-
const createAllPluginsWithUi = (options) => (0, create_plugins_with_ui_1.createPluginsWithUi)([
|
|
114
|
-
(0, exports.createHeadingsPluginWithUi)(options.headings),
|
|
115
|
-
(0, exports.createBlockquotePluginWithUi)(),
|
|
116
|
-
(0, exports.createBoldPluginWithUi)(),
|
|
117
|
-
(0, exports.createItalicPluginWithUi)(),
|
|
118
|
-
(0, exports.createUnderlinePluginWithUi)(),
|
|
119
|
-
(0, exports.createCodePluginWithUi)(),
|
|
120
|
-
(0, exports.createListPluginWithUi)(),
|
|
121
|
-
(0, exports.createLinkPluginWithUi)(),
|
|
122
|
-
(0, exports.createImagePluginWithUi)(options.image),
|
|
123
|
-
(0, exports.createVideoPluginWithUi)(),
|
|
124
|
-
(0, exports.createButtonPluginWithUi)(),
|
|
125
|
-
(0, exports.createHighlightPluginWithUi)(options.highlightColor),
|
|
126
|
-
]);
|
|
127
|
-
exports.createAllPluginsWithUi = createAllPluginsWithUi;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { MyOverrideByKey, UxfPlatePlugin, WysiwygPlugin, WysiwygRecursivePlugin } from "./types";
|
|
2
|
-
export declare const createPluginsWithUi: (wysiwygPlugins: Array<WysiwygPlugin<any> | WysiwygRecursivePlugin<string>>, options?: {
|
|
3
|
-
overrideByKey?: MyOverrideByKey;
|
|
4
|
-
}) => UxfPlatePlugin[];
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPluginsWithUi = void 0;
|
|
4
|
-
const plate_core_1 = require("@udecode/plate-core");
|
|
5
|
-
const create_exit_break_plugin_1 = require("./plugins/exit-break/create-exit-break-plugin");
|
|
6
|
-
const create_node_id_plugin_1 = require("./plugins/node-id/create-node-id-plugin");
|
|
7
|
-
const create_paragraph_plugin_1 = require("./plugins/paragraph/create-paragraph-plugin");
|
|
8
|
-
const types_1 = require("./plugins/paragraph/types");
|
|
9
|
-
const create_reset_node_1 = require("./plugins/reset-node/create-reset-node");
|
|
10
|
-
const create_select_on_backspace_plugin_1 = require("./plugins/select-on-backspace/create-select-on-backspace-plugin");
|
|
11
|
-
const create_soft_break_plugin_1 = require("./plugins/soft-break/create-soft-break-plugin");
|
|
12
|
-
const create_trailing_block_plugin_1 = require("./plugins/trailing-block/create-trailing-block-plugin");
|
|
13
|
-
const paragraph_element_1 = require("./ui/paragraph-element");
|
|
14
|
-
function isRecursivePlugin(plugin) {
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
16
|
-
return plugin.components !== undefined;
|
|
17
|
-
}
|
|
18
|
-
const createPluginsWithUi = (wysiwygPlugins, options) => {
|
|
19
|
-
const plugins = wysiwygPlugins.map((p) => p.plugin);
|
|
20
|
-
const pluginComponents = {
|
|
21
|
-
[types_1.PARAGRAPH_PLUGIN_KEY]: paragraph_element_1.ParagraphElement,
|
|
22
|
-
};
|
|
23
|
-
wysiwygPlugins.forEach((p) => {
|
|
24
|
-
if (isRecursivePlugin(p)) {
|
|
25
|
-
Object.keys(p.components).forEach((componentKey) => {
|
|
26
|
-
pluginComponents[componentKey] = p.components[componentKey];
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
pluginComponents[p.plugin.key] = p.component;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
return (0, plate_core_1.createPlugins)([
|
|
34
|
-
(0, create_paragraph_plugin_1.createParagraphPlugin)(),
|
|
35
|
-
(0, create_exit_break_plugin_1.createExitBreakPlugin)(),
|
|
36
|
-
(0, create_reset_node_1.createResetNodePlugin)(),
|
|
37
|
-
(0, create_soft_break_plugin_1.createSoftBreakPlugin)(),
|
|
38
|
-
(0, create_node_id_plugin_1.createNodeIdPlugin)(),
|
|
39
|
-
(0, create_select_on_backspace_plugin_1.createSelectOnBackspacePlugin)(),
|
|
40
|
-
(0, create_trailing_block_plugin_1.createTrailingBlockPlugin)(),
|
|
41
|
-
...plugins,
|
|
42
|
-
], {
|
|
43
|
-
...options,
|
|
44
|
-
components: pluginComponents /* TODO: fix this type mismatch */,
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
exports.createPluginsWithUi = createPluginsWithUi;
|
package/hooks.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { UxfEditor, WysiwygContent } from "./types";
|
|
2
|
-
export declare const useUxfPlateEditorRef: (id?: any) => UxfEditor;
|
|
3
|
-
export declare const useUxfEditorRef: () => UxfEditor;
|
|
4
|
-
export declare const useUxfEditorState: () => UxfEditor;
|
|
5
|
-
export declare const useUxfPlateEditorState: (id?: any) => UxfEditor;
|
|
6
|
-
export declare const useUxfPlateSelectors: (id?: any) => import("@udecode/plate-core").GetRecord<import("@udecode/plate-core").PlateStoreState<WysiwygContent, UxfEditor>>;
|
|
7
|
-
export declare const useUxfPlateActions: (id?: any) => import("@udecode/plate-core").SetRecord<import("@udecode/plate-core").PlateStoreState<WysiwygContent, UxfEditor>>;
|
|
8
|
-
export declare const useUxfPlateStates: (id?: any) => import("@udecode/plate-core").UseRecord<import("@udecode/plate-core").PlateStoreState<WysiwygContent, UxfEditor>>;
|
|
9
|
-
export { useSelected } from "slate-react";
|
package/hooks.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useSelected = exports.useUxfPlateStates = exports.useUxfPlateActions = exports.useUxfPlateSelectors = exports.useUxfPlateEditorState = exports.useUxfEditorState = exports.useUxfEditorRef = exports.useUxfPlateEditorRef = void 0;
|
|
4
|
-
const plate_core_1 = require("@udecode/plate-core");
|
|
5
|
-
const useUxfPlateEditorRef = (id) => (0, plate_core_1.usePlateEditorRef)(id);
|
|
6
|
-
exports.useUxfPlateEditorRef = useUxfPlateEditorRef;
|
|
7
|
-
const useUxfEditorRef = () => (0, plate_core_1.useEditorRef)();
|
|
8
|
-
exports.useUxfEditorRef = useUxfEditorRef;
|
|
9
|
-
const useUxfEditorState = () => (0, plate_core_1.useEditorState)();
|
|
10
|
-
exports.useUxfEditorState = useUxfEditorState;
|
|
11
|
-
const useUxfPlateEditorState = (id) => (0, plate_core_1.usePlateEditorState)((0, plate_core_1.useEventPlateId)(id));
|
|
12
|
-
exports.useUxfPlateEditorState = useUxfPlateEditorState;
|
|
13
|
-
const useUxfPlateSelectors = (id) => (0, plate_core_1.usePlateSelectors)(id);
|
|
14
|
-
exports.useUxfPlateSelectors = useUxfPlateSelectors;
|
|
15
|
-
const useUxfPlateActions = (id) => (0, plate_core_1.usePlateActions)(id);
|
|
16
|
-
exports.useUxfPlateActions = useUxfPlateActions;
|
|
17
|
-
const useUxfPlateStates = (id) => (0, plate_core_1.usePlateStates)(id);
|
|
18
|
-
exports.useUxfPlateStates = useUxfPlateStates;
|
|
19
|
-
var slate_react_1 = require("slate-react");
|
|
20
|
-
Object.defineProperty(exports, "useSelected", { enumerable: true, get: function () { return slate_react_1.useSelected; } });
|
package/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { createAllPluginsWithUi, createBlockquotePluginWithUi, createBoldPluginWithUi, createButtonPluginWithUi, createCodePluginWithUi, createHeadingsPluginWithUi, createHighlightPluginWithUi, createImagePluginWithUi, createItalicPluginWithUi, createLinkPluginWithUi, createListPluginWithUi, createUnderlinePluginWithUi, createVideoPluginWithUi, type CreateAllPluginsOptions, } from "./create-all-plugins-with-ui";
|
|
2
|
-
export * from "./hooks";
|
|
3
|
-
export * from "./types";
|
|
4
|
-
export * from "./utils";
|
|
5
|
-
export { WysiwygEditor } from "./wysiwyg-editor";
|
|
6
|
-
export { createPluginsWithUi } from "./create-plugins-with-ui";
|
package/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.createPluginsWithUi = exports.WysiwygEditor = exports.createVideoPluginWithUi = exports.createUnderlinePluginWithUi = exports.createListPluginWithUi = exports.createLinkPluginWithUi = exports.createItalicPluginWithUi = exports.createImagePluginWithUi = exports.createHighlightPluginWithUi = exports.createHeadingsPluginWithUi = exports.createCodePluginWithUi = exports.createButtonPluginWithUi = exports.createBoldPluginWithUi = exports.createBlockquotePluginWithUi = exports.createAllPluginsWithUi = void 0;
|
|
18
|
-
var create_all_plugins_with_ui_1 = require("./create-all-plugins-with-ui");
|
|
19
|
-
Object.defineProperty(exports, "createAllPluginsWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createAllPluginsWithUi; } });
|
|
20
|
-
Object.defineProperty(exports, "createBlockquotePluginWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createBlockquotePluginWithUi; } });
|
|
21
|
-
Object.defineProperty(exports, "createBoldPluginWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createBoldPluginWithUi; } });
|
|
22
|
-
Object.defineProperty(exports, "createButtonPluginWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createButtonPluginWithUi; } });
|
|
23
|
-
Object.defineProperty(exports, "createCodePluginWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createCodePluginWithUi; } });
|
|
24
|
-
Object.defineProperty(exports, "createHeadingsPluginWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createHeadingsPluginWithUi; } });
|
|
25
|
-
Object.defineProperty(exports, "createHighlightPluginWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createHighlightPluginWithUi; } });
|
|
26
|
-
Object.defineProperty(exports, "createImagePluginWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createImagePluginWithUi; } });
|
|
27
|
-
Object.defineProperty(exports, "createItalicPluginWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createItalicPluginWithUi; } });
|
|
28
|
-
Object.defineProperty(exports, "createLinkPluginWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createLinkPluginWithUi; } });
|
|
29
|
-
Object.defineProperty(exports, "createListPluginWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createListPluginWithUi; } });
|
|
30
|
-
Object.defineProperty(exports, "createUnderlinePluginWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createUnderlinePluginWithUi; } });
|
|
31
|
-
Object.defineProperty(exports, "createVideoPluginWithUi", { enumerable: true, get: function () { return create_all_plugins_with_ui_1.createVideoPluginWithUi; } });
|
|
32
|
-
__exportStar(require("./hooks"), exports);
|
|
33
|
-
__exportStar(require("./types"), exports);
|
|
34
|
-
__exportStar(require("./utils"), exports);
|
|
35
|
-
var wysiwyg_editor_1 = require("./wysiwyg-editor");
|
|
36
|
-
Object.defineProperty(exports, "WysiwygEditor", { enumerable: true, get: function () { return wysiwyg_editor_1.WysiwygEditor; } });
|
|
37
|
-
var create_plugins_with_ui_1 = require("./create-plugins-with-ui");
|
|
38
|
-
Object.defineProperty(exports, "createPluginsWithUi", { enumerable: true, get: function () { return create_plugins_with_ui_1.createPluginsWithUi; } });
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createBlockquotePlugin = void 0;
|
|
4
|
-
const plate_block_quote_1 = require("@udecode/plate-block-quote");
|
|
5
|
-
const types_1 = require("./types");
|
|
6
|
-
const createBlockquotePlugin = () => (0, plate_block_quote_1.createBlockquotePlugin)({
|
|
7
|
-
type: types_1.BLOCKQUOTE_PLUGIN_TYPE,
|
|
8
|
-
});
|
|
9
|
-
exports.createBlockquotePlugin = createBlockquotePlugin;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BLOCKQUOTE_PLUGIN_TYPE = exports.BLOCKQUOTE_PLUGIN_KEY = void 0;
|
|
4
|
-
const plate_block_quote_1 = require("@udecode/plate-block-quote");
|
|
5
|
-
exports.BLOCKQUOTE_PLUGIN_KEY = plate_block_quote_1.ELEMENT_BLOCKQUOTE;
|
|
6
|
-
exports.BLOCKQUOTE_PLUGIN_TYPE = "blockquote";
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { WysiwygContent } from "../../types";
|
|
2
|
-
export declare const createButtonPlugin: <OP = import("@udecode/utils").AnyObject, OV extends import("@udecode/slate").Value = WysiwygContent, OE extends import("@udecode/plate-core").PlateEditor<OV> = import("@udecode/plate-core").PlateEditor<OV>>(override?: Partial<import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").NoInfer<OP>, OV, OE>> | undefined, overrideByKey?: import("@udecode/plate-core").OverrideByKey<OV, OE> | undefined) => import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").NoInfer<OP>, OV, OE>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createButtonPlugin = void 0;
|
|
4
|
-
const plate_core_1 = require("@udecode/plate-core");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
exports.createButtonPlugin = (0, plate_core_1.createPluginFactory)({
|
|
7
|
-
key: constants_1.PLUGIN_BUTTON_KEY,
|
|
8
|
-
type: constants_1.PLUGIN_BUTTON_TYPE,
|
|
9
|
-
isElement: true,
|
|
10
|
-
isVoid: true,
|
|
11
|
-
});
|
package/plugins/button/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.createButtonPlugin = exports.PLUGIN_BUTTON_TYPE = exports.PLUGIN_BUTTON_KEY = void 0;
|
|
18
|
-
var constants_1 = require("./constants");
|
|
19
|
-
Object.defineProperty(exports, "PLUGIN_BUTTON_KEY", { enumerable: true, get: function () { return constants_1.PLUGIN_BUTTON_KEY; } });
|
|
20
|
-
Object.defineProperty(exports, "PLUGIN_BUTTON_TYPE", { enumerable: true, get: function () { return constants_1.PLUGIN_BUTTON_TYPE; } });
|
|
21
|
-
var create_button_plugin_1 = require("./create-button-plugin");
|
|
22
|
-
Object.defineProperty(exports, "createButtonPlugin", { enumerable: true, get: function () { return create_button_plugin_1.createButtonPlugin; } });
|
|
23
|
-
__exportStar(require("./transforms"), exports);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getActiveButton = void 0;
|
|
4
|
-
const utils_1 = require("../../../utils");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
const getActiveButton = (editor) => {
|
|
7
|
-
return (0, utils_1.getActiveElement)(editor, constants_1.PLUGIN_BUTTON_TYPE);
|
|
8
|
-
};
|
|
9
|
-
exports.getActiveButton = getActiveButton;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateButton = exports.isButtonActive = exports.insertButton = exports.getActiveButton = void 0;
|
|
4
|
-
var get_active_button_1 = require("./get-active-button");
|
|
5
|
-
Object.defineProperty(exports, "getActiveButton", { enumerable: true, get: function () { return get_active_button_1.getActiveButton; } });
|
|
6
|
-
var insert_button_1 = require("./insert-button");
|
|
7
|
-
Object.defineProperty(exports, "insertButton", { enumerable: true, get: function () { return insert_button_1.insertButton; } });
|
|
8
|
-
var is_button_active_1 = require("./is-button-active");
|
|
9
|
-
Object.defineProperty(exports, "isButtonActive", { enumerable: true, get: function () { return is_button_active_1.isButtonActive; } });
|
|
10
|
-
var update_button_1 = require("./update-button");
|
|
11
|
-
Object.defineProperty(exports, "updateButton", { enumerable: true, get: function () { return update_button_1.updateButton; } });
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.insertButton = void 0;
|
|
4
|
-
const utils_1 = require("../../../utils");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
const insertButton = (editor, buttonText, buttonUrl) => {
|
|
7
|
-
const text = { text: "" };
|
|
8
|
-
const button = {
|
|
9
|
-
type: constants_1.PLUGIN_BUTTON_KEY,
|
|
10
|
-
buttonText,
|
|
11
|
-
buttonUrl,
|
|
12
|
-
children: [text],
|
|
13
|
-
};
|
|
14
|
-
(0, utils_1.insertVoid)(editor, button);
|
|
15
|
-
};
|
|
16
|
-
exports.insertButton = insertButton;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isButtonActive = void 0;
|
|
4
|
-
const plate_common_1 = require("@udecode/plate-common");
|
|
5
|
-
const get_active_button_1 = require("./get-active-button");
|
|
6
|
-
const isButtonActive = (editor) => Boolean((0, get_active_button_1.getActiveButton)(editor) && (0, plate_common_1.isRangeInSameBlock)(editor));
|
|
7
|
-
exports.isButtonActive = isButtonActive;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeSelectedButton = void 0;
|
|
4
|
-
const utils_1 = require("../../../utils");
|
|
5
|
-
const get_active_button_1 = require("./get-active-button");
|
|
6
|
-
const removeSelectedButton = (editor) => {
|
|
7
|
-
const activeButton = (0, get_active_button_1.getActiveButton)(editor);
|
|
8
|
-
if (!activeButton) {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
return (0, utils_1.removeElement)(editor, activeButton);
|
|
12
|
-
};
|
|
13
|
-
exports.removeSelectedButton = removeSelectedButton;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateButton = void 0;
|
|
4
|
-
const plate_common_1 = require("@udecode/plate-common");
|
|
5
|
-
const updateButton = (editor, buttonText, buttonUrl) => (0, plate_common_1.setNodes)(editor, {
|
|
6
|
-
buttonText,
|
|
7
|
-
buttonUrl,
|
|
8
|
-
});
|
|
9
|
-
exports.updateButton = updateButton;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { parseIframeUrl, parseTwitterUrl, parseVideoUrl } from "@udecode/plate-media";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseVideoUrl = exports.parseTwitterUrl = exports.parseIframeUrl = void 0;
|
|
4
|
-
var plate_media_1 = require("@udecode/plate-media");
|
|
5
|
-
Object.defineProperty(exports, "parseIframeUrl", { enumerable: true, get: function () { return plate_media_1.parseIframeUrl; } });
|
|
6
|
-
Object.defineProperty(exports, "parseTwitterUrl", { enumerable: true, get: function () { return plate_media_1.parseTwitterUrl; } });
|
|
7
|
-
Object.defineProperty(exports, "parseVideoUrl", { enumerable: true, get: function () { return plate_media_1.parseVideoUrl; } });
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { MediaPlugin } from "@udecode/plate-media";
|
|
2
|
-
import { WysiwygContent } from "../../../types";
|
|
3
|
-
export declare const ELEMENT_VIDEO_EMBED = "video";
|
|
4
|
-
export declare const createVideoPlugin: <OP = MediaPlugin, OV extends import("@udecode/slate").Value = WysiwygContent, OE extends import("@udecode/plate-core").PlateEditor<OV> = import("@udecode/plate-core").PlateEditor<OV>>(override?: Partial<import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").NoInfer<OP>, OV, OE>> | undefined, overrideByKey?: import("@udecode/plate-core").OverrideByKey<OV, OE> | undefined) => import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").NoInfer<OP>, OV, OE>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createVideoPlugin = exports.ELEMENT_VIDEO_EMBED = void 0;
|
|
4
|
-
const plate_core_1 = require("@udecode/plate-core");
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
|
-
exports.ELEMENT_VIDEO_EMBED = "video";
|
|
7
|
-
exports.createVideoPlugin = (0, plate_core_1.createPluginFactory)({
|
|
8
|
-
key: exports.ELEMENT_VIDEO_EMBED,
|
|
9
|
-
isElement: true,
|
|
10
|
-
isVoid: true,
|
|
11
|
-
options: {
|
|
12
|
-
transformUrl: utils_1.parseIframeUrl,
|
|
13
|
-
rules: [
|
|
14
|
-
{
|
|
15
|
-
parser: utils_1.parseVideoUrl,
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getActiveVideo = void 0;
|
|
4
|
-
const utils_1 = require("../../../utils");
|
|
5
|
-
const create_video_plugin_1 = require("./create-video-plugin");
|
|
6
|
-
const getActiveVideo = (editor) => {
|
|
7
|
-
return (0, utils_1.getActiveElement)(editor, create_video_plugin_1.ELEMENT_VIDEO_EMBED);
|
|
8
|
-
};
|
|
9
|
-
exports.getActiveVideo = getActiveVideo;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.insertVideo = void 0;
|
|
4
|
-
const utils_1 = require("../../../utils");
|
|
5
|
-
const create_video_plugin_1 = require("./create-video-plugin");
|
|
6
|
-
const insertVideo = (editor, url, embeddedUrl, provider, videoId) => {
|
|
7
|
-
const text = { text: "" };
|
|
8
|
-
const element = {
|
|
9
|
-
type: create_video_plugin_1.ELEMENT_VIDEO_EMBED,
|
|
10
|
-
url,
|
|
11
|
-
embeddedUrl,
|
|
12
|
-
provider,
|
|
13
|
-
videoId,
|
|
14
|
-
children: [text],
|
|
15
|
-
};
|
|
16
|
-
(0, utils_1.insertVoid)(editor, element);
|
|
17
|
-
};
|
|
18
|
-
exports.insertVideo = insertVideo;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateVideo = void 0;
|
|
4
|
-
const plate_common_1 = require("@udecode/plate-common");
|
|
5
|
-
const updateVideo = (editor, url, embeddedUrl, provider, videoId) => (0, plate_common_1.setNodes)(editor, {
|
|
6
|
-
url,
|
|
7
|
-
embeddedUrl,
|
|
8
|
-
provider,
|
|
9
|
-
videoId,
|
|
10
|
-
});
|
|
11
|
-
exports.updateVideo = updateVideo;
|