@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,81 +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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.InsertButtonModalContent = void 0;
|
|
27
|
-
const text_input_1 = require("@uxf/ui/text-input");
|
|
28
|
-
const react_1 = __importStar(require("react"));
|
|
29
|
-
const button_1 = require("../../plugins/button");
|
|
30
|
-
const context_1 = require("../../translations/context");
|
|
31
|
-
const modal_buttons_1 = require("../components/modal/modal-buttons");
|
|
32
|
-
const modal_content_1 = require("../components/modal/modal-content");
|
|
33
|
-
const utils_1 = require("../utils");
|
|
34
|
-
const CLASS_NAME = "uxf-wysiwyg__insert-modal-button";
|
|
35
|
-
const InsertButtonModalContent = (props) => {
|
|
36
|
-
var _a, _b, _c, _d;
|
|
37
|
-
const t = (0, context_1.useTranslation)();
|
|
38
|
-
const [buttonText, setButtonText] = (0, react_1.useState)((_b = (_a = props.buttonToEdit) === null || _a === void 0 ? void 0 : _a.buttonText) !== null && _b !== void 0 ? _b : "");
|
|
39
|
-
const [buttonUrl, setButtonUrl] = (0, react_1.useState)((_d = (_c = props.buttonToEdit) === null || _c === void 0 ? void 0 : _c.buttonUrl) !== null && _d !== void 0 ? _d : "");
|
|
40
|
-
const [error, setError] = (0, react_1.useState)({
|
|
41
|
-
text: undefined,
|
|
42
|
-
url: undefined,
|
|
43
|
-
});
|
|
44
|
-
const title = props.buttonToEdit
|
|
45
|
-
? t("wysiwyg:plugins.button.button-edit")
|
|
46
|
-
: t("wysiwyg:plugins.button.button-insert");
|
|
47
|
-
const onSubmit = (0, react_1.useCallback)(async (e) => {
|
|
48
|
-
e.preventDefault();
|
|
49
|
-
if (buttonText.length === 0) {
|
|
50
|
-
setError((prevError) => ({
|
|
51
|
-
...prevError,
|
|
52
|
-
text: "Toto pole je povinné",
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
if (buttonUrl.length === 0) {
|
|
56
|
-
setError((prevError) => {
|
|
57
|
-
return {
|
|
58
|
-
...prevError,
|
|
59
|
-
url: "Toto pole je povinné",
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
if (buttonText.length !== 0 && buttonUrl.length !== 0) {
|
|
64
|
-
if (props.buttonToEdit) {
|
|
65
|
-
(0, button_1.updateButton)(props.editor, buttonText, buttonUrl);
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
(0, button_1.insertButton)(props.editor, buttonText, buttonUrl);
|
|
69
|
-
}
|
|
70
|
-
(0, utils_1.closeModalWithFocus)(props.editor);
|
|
71
|
-
}
|
|
72
|
-
}, [buttonText, buttonUrl, props.buttonToEdit, props.editor]);
|
|
73
|
-
return (react_1.default.createElement(modal_content_1.ModalContent, { title: title },
|
|
74
|
-
react_1.default.createElement("form", { className: `${CLASS_NAME}__form`, id: "insert-button-form", onSubmit: onSubmit },
|
|
75
|
-
react_1.default.createElement("div", { className: `${CLASS_NAME}__form-inputs` },
|
|
76
|
-
react_1.default.createElement(text_input_1.TextInput, { helperText: error.text, isInvalid: Boolean(error.text), isRequired: true, label: t("wysiwyg:plugins.button.button-text.label"), name: "button-text", onChange: setButtonText, placeholder: t("wysiwyg:plugins.button.button-text.placeholder"), type: "text", value: buttonText }),
|
|
77
|
-
react_1.default.createElement(text_input_1.TextInput, { helperText: error.url, isInvalid: Boolean(error.url), isRequired: true, label: t("wysiwyg:plugins.button.url-address.label"), name: "url-address", onChange: setButtonUrl, placeholder: t("wysiwyg:plugins.button.url-address.placeholder"), type: "text", value: buttonUrl })),
|
|
78
|
-
react_1.default.createElement(modal_buttons_1.ModalButtons, { className: `${CLASS_NAME}__form-buttons`, editor: props.editor, submitText: title }),
|
|
79
|
-
react_1.default.createElement("button", { hidden: true, type: "submit" }))));
|
|
80
|
-
};
|
|
81
|
-
exports.InsertButtonModalContent = InsertButtonModalContent;
|
package/ui/code-mark.d.ts
DELETED
package/ui/code-mark.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CodeMark = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const CLASS_NAME = "uxf-wysiwyg__element";
|
|
9
|
-
const CodeMark = (props) => {
|
|
10
|
-
var _a;
|
|
11
|
-
return (react_1.default.createElement("code", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-code ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
|
|
12
|
-
};
|
|
13
|
-
exports.CodeMark = CodeMark;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ElementActionButtons = void 0;
|
|
7
|
-
const button_1 = require("@uxf/ui/button");
|
|
8
|
-
const icon_1 = require("@uxf/ui/icon");
|
|
9
|
-
const react_1 = __importDefault(require("react"));
|
|
10
|
-
const CLASS_NAME = "uxf-wysiwyg__element-action-buttons";
|
|
11
|
-
const ElementActionButtons = (props) => {
|
|
12
|
-
var _a;
|
|
13
|
-
if (!props.isSelected) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return (react_1.default.createElement("div", { className: `${CLASS_NAME} ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, contentEditable: false, tabIndex: -1 },
|
|
17
|
-
react_1.default.createElement(button_1.Button, { className: `${CLASS_NAME}__edit`, isIconButton: true, onClick: props.onEdit, variant: "secondary" },
|
|
18
|
-
react_1.default.createElement(icon_1.Icon, { name: "edit" })),
|
|
19
|
-
react_1.default.createElement(button_1.Button, { className: `${CLASS_NAME}__delete`, isIconButton: true, onClick: props.onDelete, variant: "secondary" },
|
|
20
|
-
react_1.default.createElement(icon_1.Icon, { name: "delete" }))));
|
|
21
|
-
};
|
|
22
|
-
exports.ElementActionButtons = ElementActionButtons;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from "react";
|
|
2
|
-
interface Props extends PropsWithChildren {
|
|
3
|
-
className?: string;
|
|
4
|
-
onEdit: () => void;
|
|
5
|
-
onDelete: () => void;
|
|
6
|
-
isSelected: boolean;
|
|
7
|
-
padding?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const ElementWithActionButtons: FC<Props>;
|
|
10
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ElementWithActionButtons = void 0;
|
|
7
|
-
const classes_1 = require("@uxf/core/constants/classes");
|
|
8
|
-
const cx_1 = require("@uxf/core/utils/cx");
|
|
9
|
-
const react_1 = __importDefault(require("react"));
|
|
10
|
-
const element_action_buttons_1 = require("./element-action-buttons");
|
|
11
|
-
const CLASS_NAME = "uxf-wysiwyg__element-with-action-buttons";
|
|
12
|
-
const ElementWithActionButtons = (props) => {
|
|
13
|
-
return (react_1.default.createElement("div", { className: (0, cx_1.cx)(CLASS_NAME, props.padding && `${CLASS_NAME}--has-padding`, props.isSelected && `${CLASS_NAME}--${classes_1.CLASSES.IS_SELECTED}`, props.className), contentEditable: false },
|
|
14
|
-
react_1.default.createElement(element_action_buttons_1.ElementActionButtons, { isSelected: props.isSelected, onDelete: props.onDelete, onEdit: props.onEdit }),
|
|
15
|
-
props.children));
|
|
16
|
-
};
|
|
17
|
-
exports.ElementWithActionButtons = ElementWithActionButtons;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { UxfEditor } from "../../../types";
|
|
3
|
-
interface ModalButtonCancelProps {
|
|
4
|
-
editor: UxfEditor;
|
|
5
|
-
onCancel?: () => void;
|
|
6
|
-
cancelText?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const ModalButtonCancel: FC<ModalButtonCancelProps>;
|
|
9
|
-
export {};
|
|
@@ -1,45 +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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ModalButtonCancel = void 0;
|
|
27
|
-
const button_1 = require("@uxf/ui/button");
|
|
28
|
-
const react_1 = __importStar(require("react"));
|
|
29
|
-
const context_1 = require("../../../translations/context");
|
|
30
|
-
const utils_1 = require("../../utils");
|
|
31
|
-
const ModalButtonCancel = (props) => {
|
|
32
|
-
var _a;
|
|
33
|
-
const t = (0, context_1.useTranslation)();
|
|
34
|
-
const onCancel = props.onCancel;
|
|
35
|
-
const cancelHandler = (0, react_1.useCallback)(() => {
|
|
36
|
-
if (onCancel) {
|
|
37
|
-
onCancel();
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
(0, utils_1.closeModalWithFocus)(props.editor);
|
|
41
|
-
}
|
|
42
|
-
}, [onCancel, props.editor]);
|
|
43
|
-
return (react_1.default.createElement(button_1.Button, { className: "uxf-wysiwyg__modal-button-cancel", color: "default", onClick: cancelHandler, variant: "secondary" }, (_a = props.cancelText) !== null && _a !== void 0 ? _a : t("wysiwyg:components.modal.button-cancel")));
|
|
44
|
-
};
|
|
45
|
-
exports.ModalButtonCancel = ModalButtonCancel;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ModalButtonSubmit = void 0;
|
|
7
|
-
const button_1 = require("@uxf/ui/button");
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const ModalButtonSubmit = (props) => {
|
|
10
|
-
return (react_1.default.createElement(button_1.Button, { className: "uxf-wysiwyg__modal-button-submit", color: "default", type: "submit" }, props.submitText));
|
|
11
|
-
};
|
|
12
|
-
exports.ModalButtonSubmit = ModalButtonSubmit;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { UxfEditor } from "../../../types";
|
|
3
|
-
interface ModalButtonsProps {
|
|
4
|
-
className?: string;
|
|
5
|
-
editor: UxfEditor;
|
|
6
|
-
submitText: string;
|
|
7
|
-
onCancel?: () => void;
|
|
8
|
-
cancelText?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const ModalButtons: FC<ModalButtonsProps>;
|
|
11
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ModalButtons = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const modal_button_cancel_1 = require("./modal-button-cancel");
|
|
9
|
-
const modal_button_submit_1 = require("./modal-button-submit");
|
|
10
|
-
const ModalButtons = (props) => {
|
|
11
|
-
var _a;
|
|
12
|
-
return (react_1.default.createElement("div", { className: `uxf-wysiwyg__modal-buttons ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` },
|
|
13
|
-
react_1.default.createElement(modal_button_cancel_1.ModalButtonCancel, { cancelText: props.cancelText, editor: props.editor, onCancel: props.onCancel }),
|
|
14
|
-
react_1.default.createElement(modal_button_submit_1.ModalButtonSubmit, { submitText: props.submitText })));
|
|
15
|
-
};
|
|
16
|
-
exports.ModalButtons = ModalButtons;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ModalContent = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const CLASS_NAME = "uxf-wysiwyg__modal";
|
|
9
|
-
const ModalContent = (props) => {
|
|
10
|
-
return (react_1.default.createElement("div", { className: CLASS_NAME },
|
|
11
|
-
react_1.default.createElement("p", { className: `${CLASS_NAME}-title` }, props.title),
|
|
12
|
-
props.children));
|
|
13
|
-
};
|
|
14
|
-
exports.ModalContent = ModalContent;
|
package/ui/create-uxf-ui.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare const createUxfUi: () => {
|
|
2
|
-
p: import("..").ElementUiComponent;
|
|
3
|
-
blockquote: import("..").ElementUiComponent;
|
|
4
|
-
h1: import("..").ElementUiComponent;
|
|
5
|
-
h2: import("..").ElementUiComponent;
|
|
6
|
-
h3: import("..").ElementUiComponent;
|
|
7
|
-
h4: import("..").ElementUiComponent;
|
|
8
|
-
h5: import("..").ElementUiComponent;
|
|
9
|
-
h6: import("..").ElementUiComponent;
|
|
10
|
-
bold: import("..").LeafUiComponent;
|
|
11
|
-
italic: import("..").ElementUiComponent;
|
|
12
|
-
underline: import("..").LeafUiComponent;
|
|
13
|
-
code: import("..").LeafUiComponent;
|
|
14
|
-
li: import("..").ElementUiComponent;
|
|
15
|
-
ul: import("..").ElementUiComponent;
|
|
16
|
-
ol: import("..").ElementUiComponent;
|
|
17
|
-
a: import("..").ElementUiComponent<import("../plugins/link/types").TLinkElement>;
|
|
18
|
-
img: import("..").ElementUiComponent<import("..").UxfImageElement>;
|
|
19
|
-
video: import("..").ElementUiComponent<import("..").UxfVideoElement>;
|
|
20
|
-
button: import("..").ElementUiComponent<import("..").UxfButtonElement>;
|
|
21
|
-
};
|
package/ui/create-uxf-ui.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createUxfUi = void 0;
|
|
4
|
-
const types_1 = require("../plugins/blockquote/types");
|
|
5
|
-
const button_1 = require("../plugins/button");
|
|
6
|
-
const create_video_plugin_1 = require("../plugins/embedded/video/create-video-plugin");
|
|
7
|
-
const constants_1 = require("../plugins/heading/constants");
|
|
8
|
-
const types_2 = require("../plugins/image/types");
|
|
9
|
-
const constants_2 = require("../plugins/link/constants");
|
|
10
|
-
const constants_3 = require("../plugins/list/constants");
|
|
11
|
-
const types_3 = require("../plugins/mark-bold/types");
|
|
12
|
-
const types_4 = require("../plugins/mark-code/types");
|
|
13
|
-
const types_5 = require("../plugins/mark-italic/types");
|
|
14
|
-
const types_6 = require("../plugins/mark-underline/types");
|
|
15
|
-
const types_7 = require("../plugins/paragraph/types");
|
|
16
|
-
const blockquote_element_1 = require("./blockquote-element");
|
|
17
|
-
const bold_mark_1 = require("./bold-mark");
|
|
18
|
-
const button_2 = require("./button");
|
|
19
|
-
const code_mark_1 = require("./code-mark");
|
|
20
|
-
const heading_elements_1 = require("./heading-elements");
|
|
21
|
-
const image_element_1 = require("./image/image-element");
|
|
22
|
-
const italic_mark_1 = require("./italic-mark");
|
|
23
|
-
const link_element_1 = require("./link-element");
|
|
24
|
-
const list_item_element_1 = require("./list-item-element");
|
|
25
|
-
const list_ordered_element_1 = require("./list-ordered-element");
|
|
26
|
-
const list_unordered_element_1 = require("./list-unordered-element");
|
|
27
|
-
const paragraph_element_1 = require("./paragraph-element");
|
|
28
|
-
const underline_mark_1 = require("./underline-mark");
|
|
29
|
-
const video_element_1 = require("./video/video-element");
|
|
30
|
-
const createUxfUi = () => ({
|
|
31
|
-
[types_7.PARAGRAPH_PLUGIN_KEY]: paragraph_element_1.ParagraphElement,
|
|
32
|
-
[types_1.BLOCKQUOTE_PLUGIN_KEY]: blockquote_element_1.BlockquoteElement,
|
|
33
|
-
[constants_1.ELEMENT_H1]: heading_elements_1.H1Element,
|
|
34
|
-
[constants_1.ELEMENT_H2]: heading_elements_1.H2Element,
|
|
35
|
-
[constants_1.ELEMENT_H3]: heading_elements_1.H3Element,
|
|
36
|
-
[constants_1.ELEMENT_H4]: heading_elements_1.H4Element,
|
|
37
|
-
[constants_1.ELEMENT_H5]: heading_elements_1.H5Element,
|
|
38
|
-
[constants_1.ELEMENT_H6]: heading_elements_1.H6Element,
|
|
39
|
-
[types_3.BOLD_PLUGIN_KEY]: bold_mark_1.BoldMark,
|
|
40
|
-
[types_5.ITALIC_PLUGIN_KEY]: italic_mark_1.ItalicMark,
|
|
41
|
-
[types_6.UNDER_LINE_PLUGIN_KEY]: underline_mark_1.UnderlineMark,
|
|
42
|
-
[types_4.CODE_PLUGIN_KEY]: code_mark_1.CodeMark,
|
|
43
|
-
[constants_3.ELEMENT_LI]: list_item_element_1.ListItemElement,
|
|
44
|
-
[constants_3.ELEMENT_UL]: list_unordered_element_1.ListUnorderedElement,
|
|
45
|
-
[constants_3.ELEMENT_OL]: list_ordered_element_1.ListOrderedElement,
|
|
46
|
-
[constants_2.ELEMENT_LINK]: link_element_1.LinkElement,
|
|
47
|
-
[types_2.IMAGE_PLUGIN_KEY]: image_element_1.ImageElement,
|
|
48
|
-
[create_video_plugin_1.ELEMENT_VIDEO_EMBED]: video_element_1.VideoElement,
|
|
49
|
-
[button_1.PLUGIN_BUTTON_KEY]: button_2.ButtonElement,
|
|
50
|
-
});
|
|
51
|
-
exports.createUxfUi = createUxfUi;
|
package/ui/floating-link.d.ts
DELETED
package/ui/floating-link.js
DELETED
|
@@ -1,110 +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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.FloatingLink = void 0;
|
|
27
|
-
const plate_floating_1 = require("@udecode/plate-floating");
|
|
28
|
-
const plate_link_1 = require("@udecode/plate-link");
|
|
29
|
-
const button_1 = require("@uxf/ui/button");
|
|
30
|
-
const button_group_1 = require("@uxf/ui/button-group");
|
|
31
|
-
const checkbox_input_1 = require("@uxf/ui/checkbox-input");
|
|
32
|
-
const icon_1 = require("@uxf/ui/icon");
|
|
33
|
-
const text_input_1 = require("@uxf/ui/text-input");
|
|
34
|
-
const react_1 = __importStar(require("react"));
|
|
35
|
-
const hooks_1 = require("../hooks");
|
|
36
|
-
const floating_link_wrapper_1 = require("../plugins/link/floating-link-wrapper");
|
|
37
|
-
const hooks_2 = require("../plugins/link/hooks");
|
|
38
|
-
const get_active_link_1 = require("../plugins/link/transforms/get-active-link");
|
|
39
|
-
const unwrap_link_1 = require("../plugins/link/transforms/unwrap-link");
|
|
40
|
-
const context_1 = require("../translations/context");
|
|
41
|
-
const url_helper_1 = require("../utils/url-helper");
|
|
42
|
-
const CLASS_NAME = "uxf-wysiwyg__floating-link";
|
|
43
|
-
const EDIT_CLASS_NAME = `${CLASS_NAME}-edit`;
|
|
44
|
-
const Edit = () => {
|
|
45
|
-
var _a, _b;
|
|
46
|
-
const editor = (0, hooks_1.useUxfEditorRef)();
|
|
47
|
-
const url = (_b = (_a = (0, get_active_link_1.getActiveLink)(editor)) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : "";
|
|
48
|
-
return (react_1.default.createElement(button_group_1.ButtonGroup, { className: EDIT_CLASS_NAME },
|
|
49
|
-
react_1.default.createElement(button_1.Button, { className: `${EDIT_CLASS_NAME}__button ${EDIT_CLASS_NAME}__button-edit`, isIconButton: true, onClick: () => (0, plate_link_1.triggerFloatingLinkEdit)(editor), variant: "secondary" },
|
|
50
|
-
react_1.default.createElement(icon_1.Icon, { name: "edit", size: 15 })),
|
|
51
|
-
react_1.default.createElement(button_1.Button, { className: `${EDIT_CLASS_NAME}__button ${EDIT_CLASS_NAME}__button-open`, href: !url_helper_1.UrlHelper.hasProtocol(url) ? `https://${url}` : url, isIconButton: true, target: "_blank", variant: "secondary" },
|
|
52
|
-
react_1.default.createElement(icon_1.Icon, { name: "open-link-in-new-tab", size: 15 })),
|
|
53
|
-
react_1.default.createElement(button_1.Button, { className: `${EDIT_CLASS_NAME}__button ${EDIT_CLASS_NAME}__button-delete`, isIconButton: true, onClick: () => (0, unwrap_link_1.removeLink)(editor), variant: "secondary" },
|
|
54
|
-
react_1.default.createElement(icon_1.Icon, { name: "delete", size: 15 }))));
|
|
55
|
-
};
|
|
56
|
-
function useInsertLinkFormAutoFocus() {
|
|
57
|
-
const id = (0, react_1.useId)();
|
|
58
|
-
// TODO FEB-139 - native html autoFocus breaks popover placement in insert mode
|
|
59
|
-
(0, react_1.useEffect)(() => {
|
|
60
|
-
let timer;
|
|
61
|
-
const firstInput = document.querySelector(`#${CSS.escape(id)}`);
|
|
62
|
-
if (firstInput instanceof HTMLElement) {
|
|
63
|
-
timer = window.setTimeout(() => firstInput.focus(), 0);
|
|
64
|
-
}
|
|
65
|
-
return () => {
|
|
66
|
-
clearTimeout(timer);
|
|
67
|
-
};
|
|
68
|
-
}, [id]);
|
|
69
|
-
return id;
|
|
70
|
-
}
|
|
71
|
-
const INSERT_CLASS_NAME = `${CLASS_NAME}-insert`;
|
|
72
|
-
const Insert = () => {
|
|
73
|
-
const t = (0, context_1.useTranslation)();
|
|
74
|
-
const linkActions = (0, hooks_2.useLinkActions)();
|
|
75
|
-
const editor = (0, hooks_1.useUxfEditorRef)();
|
|
76
|
-
const [isSubmitted, setIsSubmitted] = (0, react_1.useState)(false);
|
|
77
|
-
const firstInputId = useInsertLinkFormAutoFocus();
|
|
78
|
-
const onSubmit = (e) => {
|
|
79
|
-
e.preventDefault();
|
|
80
|
-
e.stopPropagation();
|
|
81
|
-
setIsSubmitted(true);
|
|
82
|
-
if (!linkActions.getUrl || !url_helper_1.UrlHelper.isValid(linkActions.getUrl)) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
(0, plate_link_1.submitFloatingLink)(editor);
|
|
86
|
-
};
|
|
87
|
-
const emptyUrl = isSubmitted && !linkActions.getUrl;
|
|
88
|
-
const invalidUrl = isSubmitted && !url_helper_1.UrlHelper.isValid(linkActions.getUrl);
|
|
89
|
-
return (react_1.default.createElement("div", { className: INSERT_CLASS_NAME },
|
|
90
|
-
react_1.default.createElement("form", { className: `${INSERT_CLASS_NAME}__form`, id: "insert-link-form", onSubmit: onSubmit },
|
|
91
|
-
react_1.default.createElement("div", { className: `${INSERT_CLASS_NAME}__form-inputs` },
|
|
92
|
-
react_1.default.createElement(text_input_1.TextInput, { helperText: emptyUrl
|
|
93
|
-
? t("wysiwyg:plugins.link.url-address.required")
|
|
94
|
-
: invalidUrl
|
|
95
|
-
? t("wysiwyg:plugins.link.url-address.invalid")
|
|
96
|
-
: undefined, hiddenLabel: true, id: firstInputId, isInvalid: emptyUrl || invalidUrl, isRequired: true, label: t("wysiwyg:plugins.link.url-address.label"), leftAddon: t("wysiwyg:plugins.link.url-address.label"), name: "url-address", onChange: linkActions.setUrl, placeholder: t("wysiwyg:plugins.link.url-address.placeholder"), value: linkActions.getUrl }),
|
|
97
|
-
react_1.default.createElement(text_input_1.TextInput, { hiddenLabel: true, label: t("wysiwyg:plugins.link.link-text.label"), leftAddon: t("wysiwyg:plugins.link.link-text.label"), name: "link-text", onChange: linkActions.setText, placeholder: t("wysiwyg:plugins.link.link-text.placeholder"), value: linkActions.getText }),
|
|
98
|
-
react_1.default.createElement(checkbox_input_1.CheckboxInput, { label: t("wysiwyg:plugins.link.open-in-new-tab"), name: "open-in-new-tab", onChange: (checked) => linkActions.setTarget(checked ? "_blank" : "_self"), value: linkActions.getTarget === "_blank" })),
|
|
99
|
-
react_1.default.createElement("div", { className: `${INSERT_CLASS_NAME}__form-buttons` },
|
|
100
|
-
react_1.default.createElement(button_1.Button, { className: `${INSERT_CLASS_NAME}__form-submit-button`, type: "submit" }, t("wysiwyg:plugins.link.button-save"))),
|
|
101
|
-
react_1.default.createElement("button", { hidden: true, type: "submit" }))));
|
|
102
|
-
};
|
|
103
|
-
const FloatingLink = () => {
|
|
104
|
-
const isEditing = (0, plate_link_1.useFloatingLinkSelectors)().isEditing();
|
|
105
|
-
return (react_1.default.createElement(plate_floating_1.FloatingPortal, null,
|
|
106
|
-
react_1.default.createElement(floating_link_wrapper_1.FloatingLinkWrapper.InsertRoot, null,
|
|
107
|
-
react_1.default.createElement(Insert, null)),
|
|
108
|
-
react_1.default.createElement(floating_link_wrapper_1.FloatingLinkWrapper.EditRoot, null, !isEditing ? react_1.default.createElement(Edit, null) : react_1.default.createElement(Insert, null))));
|
|
109
|
-
};
|
|
110
|
-
exports.FloatingLink = FloatingLink;
|
package/ui/heading-elements.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ElementUiComponent } from "../types";
|
|
2
|
-
export declare const H1Element: ElementUiComponent;
|
|
3
|
-
export declare const H2Element: ElementUiComponent;
|
|
4
|
-
export declare const H3Element: ElementUiComponent;
|
|
5
|
-
export declare const H4Element: ElementUiComponent;
|
|
6
|
-
export declare const H5Element: ElementUiComponent;
|
|
7
|
-
export declare const H6Element: ElementUiComponent;
|
package/ui/heading-elements.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.H6Element = exports.H5Element = exports.H4Element = exports.H3Element = exports.H2Element = exports.H1Element = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const CLASS_NAME = "uxf-wysiwyg__element";
|
|
9
|
-
const H1Element = (props) => {
|
|
10
|
-
var _a;
|
|
11
|
-
return (react_1.default.createElement("h1", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-heading-h1 ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
|
|
12
|
-
};
|
|
13
|
-
exports.H1Element = H1Element;
|
|
14
|
-
const H2Element = (props) => {
|
|
15
|
-
var _a;
|
|
16
|
-
return (react_1.default.createElement("h2", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-heading-h2 ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
|
|
17
|
-
};
|
|
18
|
-
exports.H2Element = H2Element;
|
|
19
|
-
const H3Element = (props) => {
|
|
20
|
-
var _a;
|
|
21
|
-
return (react_1.default.createElement("h3", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-heading-h3 ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
|
|
22
|
-
};
|
|
23
|
-
exports.H3Element = H3Element;
|
|
24
|
-
const H4Element = (props) => {
|
|
25
|
-
var _a;
|
|
26
|
-
return (react_1.default.createElement("h4", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-heading-h4 ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
|
|
27
|
-
};
|
|
28
|
-
exports.H4Element = H4Element;
|
|
29
|
-
const H5Element = (props) => {
|
|
30
|
-
var _a;
|
|
31
|
-
return (react_1.default.createElement("h5", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-heading-h5 ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
|
|
32
|
-
};
|
|
33
|
-
exports.H5Element = H5Element;
|
|
34
|
-
const H6Element = (props) => {
|
|
35
|
-
var _a;
|
|
36
|
-
return (react_1.default.createElement("h6", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-heading-h6 ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
|
|
37
|
-
};
|
|
38
|
-
exports.H6Element = H6Element;
|
package/ui/highlight-mark.d.ts
DELETED
package/ui/highlight-mark.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HighlightMark = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const CLASS_NAME = "uxf-wysiwyg__element";
|
|
9
|
-
const HighlightMark = (props) => {
|
|
10
|
-
var _a;
|
|
11
|
-
return (react_1.default.createElement("mark", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-highlight ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: { "--highlight-color": props.color } }, props.children));
|
|
12
|
-
};
|
|
13
|
-
exports.HighlightMark = HighlightMark;
|
|
@@ -1,53 +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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ImageElement = void 0;
|
|
27
|
-
const dialog_panel_1 = require("@uxf/ui/dialog/dialog-panel");
|
|
28
|
-
const modal_service_1 = require("@uxf/ui/modal/modal-service");
|
|
29
|
-
const react_1 = __importStar(require("react"));
|
|
30
|
-
const hooks_1 = require("../../hooks");
|
|
31
|
-
const get_active_image_1 = require("../../plugins/image/transforms/get-active-image");
|
|
32
|
-
const remove_selected_image_1 = require("../../plugins/image/transforms/remove-selected-image");
|
|
33
|
-
const element_with_action_buttons_1 = require("../components/element/element-with-action-buttons");
|
|
34
|
-
const insert_image_modal_content_1 = require("./insert-image-modal-content");
|
|
35
|
-
const CLASS_NAME = "uxf-wysiwyg__element";
|
|
36
|
-
const ImageElement = (props) => {
|
|
37
|
-
var _a;
|
|
38
|
-
const selected = (0, hooks_1.useSelected)();
|
|
39
|
-
const onEdit = (0, react_1.useCallback)(() => {
|
|
40
|
-
(0, modal_service_1.openModal)({
|
|
41
|
-
children: (react_1.default.createElement(dialog_panel_1.DialogPanel, { width: "lg" },
|
|
42
|
-
react_1.default.createElement(insert_image_modal_content_1.InsertImageModalContent, { editor: props.editor, imageToEdit: (0, get_active_image_1.getActiveImage)(props.editor) }))),
|
|
43
|
-
});
|
|
44
|
-
}, [props.editor]);
|
|
45
|
-
const onDelete = (0, react_1.useCallback)(() => {
|
|
46
|
-
(0, remove_selected_image_1.removeSelectedImage)(props.editor);
|
|
47
|
-
}, [props.editor]);
|
|
48
|
-
return (react_1.default.createElement("div", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-image ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` },
|
|
49
|
-
react_1.default.createElement(element_with_action_buttons_1.ElementWithActionButtons, { className: `${CLASS_NAME}-image__action-buttons`, isSelected: selected, onDelete: onDelete, onEdit: onEdit },
|
|
50
|
-
react_1.default.createElement("img", { alt: props.element.alt, className: `${CLASS_NAME}-image__img`, src: props.element.url })),
|
|
51
|
-
props.children));
|
|
52
|
-
};
|
|
53
|
-
exports.ImageElement = ImageElement;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { UxfEditor, UxfImageElement } from "../../types";
|
|
3
|
-
interface InsertImageModalContentProps {
|
|
4
|
-
editor: UxfEditor;
|
|
5
|
-
imageToEdit?: UxfImageElement;
|
|
6
|
-
}
|
|
7
|
-
export declare const InsertImageModalContent: FC<InsertImageModalContentProps>;
|
|
8
|
-
export {};
|