@uxf/wysiwyg 11.74.0 → 11.74.2

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.
Files changed (245) hide show
  1. package/components.d.ts +7 -0
  2. package/components.js +34 -0
  3. package/config/icons-config.d.ts +2 -0
  4. package/config/icons-config.js +5 -0
  5. package/config/icons.d.ts +183 -0
  6. package/config/icons.js +51 -0
  7. package/create-all-plugins-with-ui.d.ts +64 -0
  8. package/create-all-plugins-with-ui.js +127 -0
  9. package/create-plugins-with-ui.d.ts +4 -0
  10. package/create-plugins-with-ui.js +47 -0
  11. package/hooks.d.ts +9 -0
  12. package/hooks.js +20 -0
  13. package/index.d.ts +6 -0
  14. package/index.js +38 -0
  15. package/package.json +3 -3
  16. package/plugins/blockquote/create-blockquote-plugin.d.ts +3 -0
  17. package/plugins/blockquote/create-blockquote-plugin.js +9 -0
  18. package/plugins/blockquote/types.d.ts +2 -0
  19. package/plugins/blockquote/types.js +6 -0
  20. package/plugins/button/constants.d.ts +2 -0
  21. package/plugins/button/constants.js +5 -0
  22. package/plugins/button/create-button-plugin.d.ts +2 -0
  23. package/plugins/button/create-button-plugin.js +11 -0
  24. package/plugins/button/index.d.ts +3 -0
  25. package/plugins/button/index.js +23 -0
  26. package/plugins/button/transforms/get-active-button.d.ts +2 -0
  27. package/plugins/button/transforms/get-active-button.js +9 -0
  28. package/plugins/button/transforms/index.d.ts +4 -0
  29. package/plugins/button/transforms/index.js +11 -0
  30. package/plugins/button/transforms/insert-button.d.ts +2 -0
  31. package/plugins/button/transforms/insert-button.js +16 -0
  32. package/plugins/button/transforms/is-button-active.d.ts +2 -0
  33. package/plugins/button/transforms/is-button-active.js +7 -0
  34. package/plugins/button/transforms/remove-selected-button.d.ts +2 -0
  35. package/plugins/button/transforms/remove-selected-button.js +13 -0
  36. package/plugins/button/transforms/update-button.d.ts +2 -0
  37. package/plugins/button/transforms/update-button.js +9 -0
  38. package/plugins/embedded/utils.d.ts +1 -0
  39. package/plugins/embedded/utils.js +7 -0
  40. package/plugins/embedded/video/create-video-plugin.d.ts +4 -0
  41. package/plugins/embedded/video/create-video-plugin.js +19 -0
  42. package/plugins/embedded/video/get-active-video.d.ts +2 -0
  43. package/plugins/embedded/video/get-active-video.js +9 -0
  44. package/plugins/embedded/video/insert-video.d.ts +2 -0
  45. package/plugins/embedded/video/insert-video.js +19 -0
  46. package/plugins/embedded/video/update-video.d.ts +2 -0
  47. package/plugins/embedded/video/update-video.js +12 -0
  48. package/plugins/exit-break/create-exit-break-plugin.d.ts +3 -0
  49. package/plugins/exit-break/create-exit-break-plugin.js +30 -0
  50. package/plugins/heading/constants.d.ts +8 -0
  51. package/plugins/heading/constants.js +11 -0
  52. package/plugins/heading/create-headings-plugin.d.ts +8 -0
  53. package/plugins/heading/create-headings-plugin.js +40 -0
  54. package/plugins/highlight/createHighlightPlugin.d.ts +3 -0
  55. package/plugins/highlight/createHighlightPlugin.js +27 -0
  56. package/plugins/highlight/types.d.ts +10 -0
  57. package/plugins/highlight/types.js +4 -0
  58. package/plugins/image/create-image-plugin.d.ts +6 -0
  59. package/plugins/image/create-image-plugin.js +105 -0
  60. package/plugins/image/hooks/use-image-handlers.d.ts +5 -0
  61. package/plugins/image/hooks/use-image-handlers.js +19 -0
  62. package/plugins/image/transforms/get-active-image.d.ts +2 -0
  63. package/plugins/image/transforms/get-active-image.js +9 -0
  64. package/plugins/image/transforms/insert-image.d.ts +3 -0
  65. package/plugins/image/transforms/insert-image.js +19 -0
  66. package/plugins/image/transforms/is-image-active.d.ts +2 -0
  67. package/plugins/image/transforms/is-image-active.js +7 -0
  68. package/plugins/image/transforms/remove-selected-image.d.ts +2 -0
  69. package/plugins/image/transforms/remove-selected-image.js +13 -0
  70. package/plugins/image/transforms/update-image.d.ts +3 -0
  71. package/plugins/image/transforms/update-image.js +12 -0
  72. package/plugins/image/types.d.ts +12 -0
  73. package/plugins/image/types.js +6 -0
  74. package/plugins/image/utils/is-image-url.d.ts +2 -0
  75. package/plugins/image/utils/is-image-url.js +135 -0
  76. package/plugins/image/with-image.d.ts +7 -0
  77. package/plugins/image/with-image.js +19 -0
  78. package/plugins/image/with-paste-image-url.d.ts +7 -0
  79. package/plugins/image/with-paste-image-url.js +36 -0
  80. package/plugins/image/with-paste-image.d.ts +7 -0
  81. package/plugins/image/with-paste-image.js +49 -0
  82. package/plugins/link/constants.d.ts +2 -0
  83. package/plugins/link/constants.js +6 -0
  84. package/plugins/link/create-link-plugin.d.ts +3 -0
  85. package/plugins/link/create-link-plugin.js +15 -0
  86. package/plugins/link/floating-link-wrapper.d.ts +11 -0
  87. package/plugins/link/floating-link-wrapper.js +26 -0
  88. package/plugins/link/hooks/index.d.ts +4 -0
  89. package/plugins/link/hooks/index.js +11 -0
  90. package/plugins/link/hooks/use-link-actions.d.ts +12 -0
  91. package/plugins/link/hooks/use-link-actions.js +48 -0
  92. package/plugins/link/hooks/use-link-cancel-on-escape.d.ts +1 -0
  93. package/plugins/link/hooks/use-link-cancel-on-escape.js +5 -0
  94. package/plugins/link/hooks/use-link-submit-on-enter.d.ts +1 -0
  95. package/plugins/link/hooks/use-link-submit-on-enter.js +23 -0
  96. package/plugins/link/transforms/get-active-link.d.ts +3 -0
  97. package/plugins/link/transforms/get-active-link.js +17 -0
  98. package/plugins/link/transforms/insert-link.d.ts +2 -0
  99. package/plugins/link/transforms/insert-link.js +27 -0
  100. package/plugins/link/transforms/is-link-selected.d.ts +2 -0
  101. package/plugins/link/transforms/is-link-selected.js +15 -0
  102. package/plugins/link/transforms/submit-link.d.ts +8 -0
  103. package/plugins/link/transforms/submit-link.js +36 -0
  104. package/plugins/link/transforms/trigger-link-insert-or-edit.d.ts +2 -0
  105. package/plugins/link/transforms/trigger-link-insert-or-edit.js +6 -0
  106. package/plugins/link/transforms/unwrap-link.d.ts +2 -0
  107. package/plugins/link/transforms/unwrap-link.js +10 -0
  108. package/plugins/link/types.d.ts +5 -0
  109. package/plugins/link/types.js +2 -0
  110. package/plugins/list/constants.d.ts +4 -0
  111. package/plugins/list/constants.js +14 -0
  112. package/plugins/list/create-list-plugin.d.ts +4 -0
  113. package/plugins/list/create-list-plugin.js +16 -0
  114. package/plugins/mark-bold/create-bold-plugin.d.ts +3 -0
  115. package/plugins/mark-bold/create-bold-plugin.js +6 -0
  116. package/plugins/mark-bold/types.d.ts +2 -0
  117. package/plugins/mark-bold/types.js +6 -0
  118. package/plugins/mark-code/create-code-plugin.d.ts +3 -0
  119. package/plugins/mark-code/create-code-plugin.js +6 -0
  120. package/plugins/mark-code/types.d.ts +2 -0
  121. package/plugins/mark-code/types.js +6 -0
  122. package/plugins/mark-italic/create-italic-plugin.d.ts +3 -0
  123. package/plugins/mark-italic/create-italic-plugin.js +6 -0
  124. package/plugins/mark-italic/types.d.ts +2 -0
  125. package/plugins/mark-italic/types.js +6 -0
  126. package/plugins/mark-underline/create-underline-plugin.d.ts +3 -0
  127. package/plugins/mark-underline/create-underline-plugin.js +6 -0
  128. package/plugins/mark-underline/types.d.ts +2 -0
  129. package/plugins/mark-underline/types.js +6 -0
  130. package/plugins/node-id/add-ids-to-nodes.d.ts +2 -0
  131. package/plugins/node-id/add-ids-to-nodes.js +22 -0
  132. package/plugins/node-id/create-node-id-plugin.d.ts +3 -0
  133. package/plugins/node-id/create-node-id-plugin.js +6 -0
  134. package/plugins/paragraph/create-paragraph-plugin.d.ts +3 -0
  135. package/plugins/paragraph/create-paragraph-plugin.js +9 -0
  136. package/plugins/paragraph/types.d.ts +2 -0
  137. package/plugins/paragraph/types.js +6 -0
  138. package/plugins/reset-node/create-reset-node.d.ts +3 -0
  139. package/plugins/reset-node/create-reset-node.js +28 -0
  140. package/plugins/select-on-backspace/create-select-on-backspace-plugin.d.ts +3 -0
  141. package/plugins/select-on-backspace/create-select-on-backspace-plugin.js +14 -0
  142. package/plugins/soft-break/create-soft-break-plugin.d.ts +3 -0
  143. package/plugins/soft-break/create-soft-break-plugin.js +22 -0
  144. package/plugins/trailing-block/create-trailing-block-plugin.d.ts +3 -0
  145. package/plugins/trailing-block/create-trailing-block-plugin.js +6 -0
  146. package/serializers/serialize-to-plaintext.d.ts +2 -0
  147. package/serializers/serialize-to-plaintext.js +8 -0
  148. package/translations/cs.json +134 -0
  149. package/translations/de.json +134 -0
  150. package/translations/en.json +134 -0
  151. package/translations/sk.json +134 -0
  152. package/types.d.ts +118 -0
  153. package/types.js +2 -0
  154. package/ui/blockquote-element.d.ts +2 -0
  155. package/ui/blockquote-element.js +13 -0
  156. package/ui/bold-mark.d.ts +2 -0
  157. package/ui/bold-mark.js +13 -0
  158. package/ui/button/button-element.d.ts +2 -0
  159. package/ui/button/button-element.js +54 -0
  160. package/ui/button/index.d.ts +1 -0
  161. package/ui/button/index.js +5 -0
  162. package/ui/button/insert-button-modal-content.d.ts +8 -0
  163. package/ui/button/insert-button-modal-content.js +81 -0
  164. package/ui/code-mark.d.ts +2 -0
  165. package/ui/code-mark.js +13 -0
  166. package/ui/components/element/element-action-buttons.d.ts +9 -0
  167. package/ui/components/element/element-action-buttons.js +22 -0
  168. package/ui/components/element/element-with-action-buttons.d.ts +10 -0
  169. package/ui/components/element/element-with-action-buttons.js +17 -0
  170. package/ui/components/modal/modal-button-cancel.d.ts +9 -0
  171. package/ui/components/modal/modal-button-cancel.js +45 -0
  172. package/ui/components/modal/modal-button-submit.d.ts +6 -0
  173. package/ui/components/modal/modal-button-submit.js +12 -0
  174. package/ui/components/modal/modal-buttons.d.ts +11 -0
  175. package/ui/components/modal/modal-buttons.js +16 -0
  176. package/ui/components/modal/modal-content.d.ts +6 -0
  177. package/ui/components/modal/modal-content.js +14 -0
  178. package/ui/create-uxf-ui.d.ts +21 -0
  179. package/ui/create-uxf-ui.js +51 -0
  180. package/ui/floating-link.d.ts +2 -0
  181. package/ui/floating-link.js +110 -0
  182. package/ui/heading-elements.d.ts +7 -0
  183. package/ui/heading-elements.js +38 -0
  184. package/ui/highlight-mark.d.ts +3 -0
  185. package/ui/highlight-mark.js +13 -0
  186. package/ui/image/image-element.d.ts +2 -0
  187. package/ui/image/image-element.js +53 -0
  188. package/ui/image/insert-image-modal-content.d.ts +8 -0
  189. package/ui/image/insert-image-modal-content.js +89 -0
  190. package/ui/italic-mark.d.ts +2 -0
  191. package/ui/italic-mark.js +13 -0
  192. package/ui/link-element.d.ts +3 -0
  193. package/ui/link-element.js +14 -0
  194. package/ui/list-item-element.d.ts +2 -0
  195. package/ui/list-item-element.js +13 -0
  196. package/ui/list-ordered-element.d.ts +2 -0
  197. package/ui/list-ordered-element.js +13 -0
  198. package/ui/list-unordered-element.d.ts +2 -0
  199. package/ui/list-unordered-element.js +13 -0
  200. package/ui/paragraph-element.d.ts +2 -0
  201. package/ui/paragraph-element.js +13 -0
  202. package/ui/toolbar/buttons/button-toolbar-button.d.ts +10 -0
  203. package/ui/toolbar/buttons/button-toolbar-button.js +20 -0
  204. package/ui/toolbar/buttons/element-toolbar-button.d.ts +12 -0
  205. package/ui/toolbar/buttons/element-toolbar-button.js +25 -0
  206. package/ui/toolbar/buttons/image-toolbar-button.d.ts +10 -0
  207. package/ui/toolbar/buttons/image-toolbar-button.js +20 -0
  208. package/ui/toolbar/buttons/link-toolbar-button.d.ts +10 -0
  209. package/ui/toolbar/buttons/link-toolbar-button.js +29 -0
  210. package/ui/toolbar/buttons/list-toolbar-button.d.ts +13 -0
  211. package/ui/toolbar/buttons/list-toolbar-button.js +27 -0
  212. package/ui/toolbar/buttons/mark-toolbar-button.d.ts +13 -0
  213. package/ui/toolbar/buttons/mark-toolbar-button.js +25 -0
  214. package/ui/toolbar/buttons/modal-toolbar-button.d.ts +15 -0
  215. package/ui/toolbar/buttons/modal-toolbar-button.js +22 -0
  216. package/ui/toolbar/buttons/toolbar-button.d.ts +15 -0
  217. package/ui/toolbar/buttons/toolbar-button.js +35 -0
  218. package/ui/toolbar/buttons/undo-redo-button-group.d.ts +8 -0
  219. package/ui/toolbar/buttons/undo-redo-button-group.js +64 -0
  220. package/ui/toolbar/buttons/video-toolbar-button.d.ts +10 -0
  221. package/ui/toolbar/buttons/video-toolbar-button.js +20 -0
  222. package/ui/toolbar/toolbar.d.ts +3 -0
  223. package/ui/toolbar/toolbar.js +77 -0
  224. package/ui/toolbar/types.d.ts +8 -0
  225. package/ui/toolbar/types.js +2 -0
  226. package/ui/underline-mark.d.ts +2 -0
  227. package/ui/underline-mark.js +13 -0
  228. package/ui/utils.d.ts +2 -0
  229. package/ui/utils.js +13 -0
  230. package/ui/video/insert-video-modal-content.d.ts +8 -0
  231. package/ui/video/insert-video-modal-content.js +80 -0
  232. package/ui/video/video-element.d.ts +2 -0
  233. package/ui/video/video-element.js +55 -0
  234. package/utils/get-video-meta-data.d.ts +2 -0
  235. package/utils/get-video-meta-data.js +41 -0
  236. package/utils/url-helper.d.ts +7 -0
  237. package/utils/url-helper.js +15 -0
  238. package/utils/url-helper.test.d.ts +1 -0
  239. package/utils/url-helper.test.js +37 -0
  240. package/utils.d.ts +30 -0
  241. package/utils.js +88 -0
  242. package/wysiwyg-editor.d.ts +15 -0
  243. package/wysiwyg-editor.js +42 -0
  244. package/wysiwyg-editor.stories.d.ts +5 -0
  245. package/wysiwyg-editor.stories.js +193 -0
@@ -0,0 +1,9 @@
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 {};
@@ -0,0 +1,45 @@
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 translations_1 = require("@uxf/core-react/translations");
28
+ const button_1 = require("@uxf/ui/button");
29
+ const react_1 = __importStar(require("react"));
30
+ const utils_1 = require("../../utils");
31
+ const ModalButtonCancel = (props) => {
32
+ var _a;
33
+ const t = (0, translations_1.useUxfTranslation)();
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("uxf-wysiwyg:components.modal.button-cancel")));
44
+ };
45
+ exports.ModalButtonCancel = ModalButtonCancel;
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ interface ModalButtonSubmitProps {
3
+ submitText: string;
4
+ }
5
+ export declare const ModalButtonSubmit: FC<ModalButtonSubmitProps>;
6
+ export {};
@@ -0,0 +1,12 @@
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;
@@ -0,0 +1,11 @@
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 {};
@@ -0,0 +1,16 @@
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;
@@ -0,0 +1,6 @@
1
+ import { FC, PropsWithChildren } from "react";
2
+ interface Props extends PropsWithChildren {
3
+ title: string;
4
+ }
5
+ export declare const ModalContent: FC<Props>;
6
+ export {};
@@ -0,0 +1,14 @@
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;
@@ -0,0 +1,21 @@
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
+ };
@@ -0,0 +1,51 @@
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;
@@ -0,0 +1,2 @@
1
+ import { RenderAfterEditable } from "../types";
2
+ export declare const FloatingLink: RenderAfterEditable;
@@ -0,0 +1,110 @@
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 translations_1 = require("@uxf/core-react/translations");
30
+ const button_1 = require("@uxf/ui/button");
31
+ const button_group_1 = require("@uxf/ui/button-group");
32
+ const checkbox_input_1 = require("@uxf/ui/checkbox-input");
33
+ const icon_1 = require("@uxf/ui/icon");
34
+ const text_input_1 = require("@uxf/ui/text-input");
35
+ const react_1 = __importStar(require("react"));
36
+ const hooks_1 = require("../hooks");
37
+ const floating_link_wrapper_1 = require("../plugins/link/floating-link-wrapper");
38
+ const hooks_2 = require("../plugins/link/hooks");
39
+ const get_active_link_1 = require("../plugins/link/transforms/get-active-link");
40
+ const unwrap_link_1 = require("../plugins/link/transforms/unwrap-link");
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, translations_1.useUxfTranslation)();
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("uxf-wysiwyg:plugins.link.url-address.required")
94
+ : invalidUrl
95
+ ? t("uxf-wysiwyg:plugins.link.url-address.invalid")
96
+ : undefined, hiddenLabel: true, id: firstInputId, isInvalid: emptyUrl || invalidUrl, isRequired: true, label: t("uxf-wysiwyg:plugins.link.url-address.label"), leftAddon: t("uxf-wysiwyg:plugins.link.url-address.label"), name: "url-address", onChange: linkActions.setUrl, placeholder: t("uxf-wysiwyg:plugins.link.url-address.placeholder"), value: linkActions.getUrl }),
97
+ react_1.default.createElement(text_input_1.TextInput, { hiddenLabel: true, label: t("uxf-wysiwyg:plugins.link.link-text.label"), leftAddon: t("uxf-wysiwyg:plugins.link.link-text.label"), name: "link-text", onChange: linkActions.setText, placeholder: t("uxf-wysiwyg:plugins.link.link-text.placeholder"), value: linkActions.getText }),
98
+ react_1.default.createElement(checkbox_input_1.CheckboxInput, { label: t("uxf-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("uxf-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;
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,38 @@
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;
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ import { HighlightLeafElementProps } from "../plugins/highlight/types";
3
+ export declare const HighlightMark: FC<HighlightLeafElementProps>;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,2 @@
1
+ import { ElementUiComponent, UxfImageElement } from "../../types";
2
+ export declare const ImageElement: ElementUiComponent<UxfImageElement>;
@@ -0,0 +1,53 @@
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;
@@ -0,0 +1,8 @@
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 {};
@@ -0,0 +1,89 @@
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.InsertImageModalContent = void 0;
27
+ const translations_1 = require("@uxf/core-react/translations");
28
+ const file_input_1 = require("@uxf/ui/file-input");
29
+ const modal_service_1 = require("@uxf/ui/modal/modal-service");
30
+ const text_input_1 = require("@uxf/ui/text-input");
31
+ const react_1 = __importStar(require("react"));
32
+ const use_image_handlers_1 = require("../../plugins/image/hooks/use-image-handlers");
33
+ const insert_image_1 = require("../../plugins/image/transforms/insert-image");
34
+ const update_image_1 = require("../../plugins/image/transforms/update-image");
35
+ const modal_buttons_1 = require("../components/modal/modal-buttons");
36
+ const modal_content_1 = require("../components/modal/modal-content");
37
+ const utils_1 = require("../utils");
38
+ const CLASS_NAME = "uxf-wysiwyg__insert-modal";
39
+ const InsertImageModalContent = (props) => {
40
+ var _a, _b, _c, _d, _e, _f, _g, _h;
41
+ const t = (0, translations_1.useUxfTranslation)();
42
+ const imageHandlers = (0, use_image_handlers_1.useImageHandlers)(props.editor);
43
+ const [selectedFile, setSelectedFile] = (0, react_1.useState)((_b = (_a = props.imageToEdit) === null || _a === void 0 ? void 0 : _a.file) !== null && _b !== void 0 ? _b : null);
44
+ const [alt, setAlt] = (0, react_1.useState)((_d = (_c = props.imageToEdit) === null || _c === void 0 ? void 0 : _c.alt) !== null && _d !== void 0 ? _d : "");
45
+ const [caption, setCaption] = (0, react_1.useState)((_f = (_e = props.imageToEdit) === null || _e === void 0 ? void 0 : _e.caption) !== null && _f !== void 0 ? _f : "");
46
+ const [source, setSource] = (0, react_1.useState)((_h = (_g = props.imageToEdit) === null || _g === void 0 ? void 0 : _g.source) !== null && _h !== void 0 ? _h : "");
47
+ const title = props.imageToEdit
48
+ ? t("uxf-wysiwyg:plugins.image.button-edit")
49
+ : t("uxf-wysiwyg:plugins.image.button-insert");
50
+ const fileUploadHandler = (0, react_1.useCallback)(async (file) => {
51
+ const fileResponse = await imageHandlers.uploadImage(file);
52
+ setSelectedFile(fileResponse);
53
+ return fileResponse;
54
+ }, [imageHandlers]);
55
+ const reset = (0, react_1.useCallback)(() => {
56
+ setSelectedFile(null);
57
+ setAlt("");
58
+ setCaption("");
59
+ setSource("");
60
+ }, []);
61
+ const onCloseHandler = (0, react_1.useCallback)(() => {
62
+ reset();
63
+ (0, utils_1.closeModalWithFocus)(props.editor);
64
+ }, [props.editor, reset]);
65
+ const onAddHandler = (0, react_1.useCallback)((event) => {
66
+ event.preventDefault();
67
+ if (selectedFile && !props.imageToEdit) {
68
+ (0, insert_image_1.insertImage)(props.editor, selectedFile, alt !== "" ? alt : undefined, caption !== "" ? caption : undefined, source !== "" ? source : undefined, imageHandlers.getImageUrl(selectedFile));
69
+ reset();
70
+ (0, modal_service_1.closeModal)();
71
+ }
72
+ else if (selectedFile && props.imageToEdit) {
73
+ (0, update_image_1.updateImage)(props.editor, selectedFile, alt !== "" ? alt : undefined, caption !== "" ? caption : undefined, source !== "" ? source : undefined, imageHandlers.getImageUrl(selectedFile));
74
+ reset();
75
+ (0, modal_service_1.closeModal)();
76
+ }
77
+ }, [alt, caption, imageHandlers, props.editor, props.imageToEdit, reset, selectedFile, source]);
78
+ return (react_1.default.createElement(modal_content_1.ModalContent, { title: title },
79
+ react_1.default.createElement("form", { className: `${CLASS_NAME}-image__form`, id: "insert-image-form", onSubmit: onAddHandler },
80
+ react_1.default.createElement("div", { className: `${CLASS_NAME}-image__form-inputs` },
81
+ react_1.default.createElement(file_input_1.FileInput, { label: t("uxf-wysiwyg:plugins.image.file-upload.label"), name: "image", onChange: setSelectedFile, onUploadFile: fileUploadHandler, value: selectedFile }),
82
+ react_1.default.createElement(text_input_1.TextInput, { className: `${CLASS_NAME}-image__optional-input`, label: t("uxf-wysiwyg:plugins.image.alt.label"), name: "alt", onChange: setAlt, placeholder: t("uxf-wysiwyg:plugins.image.alt.placeholder"), type: "text", value: alt }),
83
+ react_1.default.createElement(text_input_1.TextInput, { className: `${CLASS_NAME}-image__optional-input`, label: t("uxf-wysiwyg:plugins.image.caption.label"), name: "caption", onChange: setCaption, placeholder: t("uxf-wysiwyg:plugins.image.caption.placeholder"), type: "text", value: caption }),
84
+ react_1.default.createElement(text_input_1.TextInput, { className: `${CLASS_NAME}-image__optional-input`, label: t("uxf-wysiwyg:plugins.image.source.label"), name: "source", onChange: setSource, placeholder: t("uxf-wysiwyg:plugins.image.source.placeholder"), type: "text", value: source })),
85
+ selectedFile && (react_1.default.createElement("img", { alt: alt, className: `${CLASS_NAME}-image__selected-img`, src: imageHandlers.getImageUrl(selectedFile) })),
86
+ react_1.default.createElement(modal_buttons_1.ModalButtons, { className: `${CLASS_NAME}__form-buttons`, editor: props.editor, onCancel: onCloseHandler, submitText: title }),
87
+ react_1.default.createElement("button", { hidden: true, type: "submit" }))));
88
+ };
89
+ exports.InsertImageModalContent = InsertImageModalContent;
@@ -0,0 +1,2 @@
1
+ import { ElementUiComponent } from "../types";
2
+ export declare const ItalicMark: ElementUiComponent;
@@ -0,0 +1,13 @@
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.ItalicMark = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const CLASS_NAME = "uxf-wysiwyg__element";
9
+ const ItalicMark = (props) => {
10
+ var _a;
11
+ return (react_1.default.createElement("i", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-italic ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
12
+ };
13
+ exports.ItalicMark = ItalicMark;
@@ -0,0 +1,3 @@
1
+ import { TLinkElement } from "../plugins/link/types";
2
+ import { ElementUiComponent } from "../types";
3
+ export declare const LinkElement: ElementUiComponent<TLinkElement>;
@@ -0,0 +1,14 @@
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.LinkElement = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const CLASS_NAME = "uxf-wysiwyg__element";
9
+ const LinkElement = (props) => {
10
+ var _a;
11
+ return (react_1.default.createElement("span", null,
12
+ react_1.default.createElement("a", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-link ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, ...props.nodeProps }, props.children)));
13
+ };
14
+ exports.LinkElement = LinkElement;
@@ -0,0 +1,2 @@
1
+ import { ElementUiComponent } from "../types";
2
+ export declare const ListItemElement: ElementUiComponent;
@@ -0,0 +1,13 @@
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.ListItemElement = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const CLASS_NAME = "uxf-wysiwyg__element";
9
+ const ListItemElement = (props) => {
10
+ var _a;
11
+ return (react_1.default.createElement("li", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-list-item ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
12
+ };
13
+ exports.ListItemElement = ListItemElement;
@@ -0,0 +1,2 @@
1
+ import { ElementUiComponent } from "../types";
2
+ export declare const ListOrderedElement: ElementUiComponent;
@@ -0,0 +1,13 @@
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.ListOrderedElement = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const CLASS_NAME = "uxf-wysiwyg__element";
9
+ const ListOrderedElement = (props) => {
10
+ var _a;
11
+ return (react_1.default.createElement("ol", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-list-ordered ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
12
+ };
13
+ exports.ListOrderedElement = ListOrderedElement;
@@ -0,0 +1,2 @@
1
+ import { ElementUiComponent } from "../types";
2
+ export declare const ListUnorderedElement: ElementUiComponent;