@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.
Files changed (250) hide show
  1. package/README.md +3 -1
  2. package/package.json +3 -3
  3. package/translations/translations.d.ts +405 -5
  4. package/translations/translations.js +404 -4
  5. package/components.d.ts +0 -7
  6. package/components.js +0 -34
  7. package/config/icons-config.d.ts +0 -2
  8. package/config/icons-config.js +0 -5
  9. package/config/icons.d.ts +0 -183
  10. package/config/icons.js +0 -51
  11. package/create-all-plugins-with-ui.d.ts +0 -64
  12. package/create-all-plugins-with-ui.js +0 -127
  13. package/create-plugins-with-ui.d.ts +0 -4
  14. package/create-plugins-with-ui.js +0 -47
  15. package/hooks.d.ts +0 -9
  16. package/hooks.js +0 -20
  17. package/index.d.ts +0 -6
  18. package/index.js +0 -38
  19. package/plugins/blockquote/create-blockquote-plugin.d.ts +0 -3
  20. package/plugins/blockquote/create-blockquote-plugin.js +0 -9
  21. package/plugins/blockquote/types.d.ts +0 -2
  22. package/plugins/blockquote/types.js +0 -6
  23. package/plugins/button/constants.d.ts +0 -2
  24. package/plugins/button/constants.js +0 -5
  25. package/plugins/button/create-button-plugin.d.ts +0 -2
  26. package/plugins/button/create-button-plugin.js +0 -11
  27. package/plugins/button/index.d.ts +0 -3
  28. package/plugins/button/index.js +0 -23
  29. package/plugins/button/transforms/get-active-button.d.ts +0 -2
  30. package/plugins/button/transforms/get-active-button.js +0 -9
  31. package/plugins/button/transforms/index.d.ts +0 -4
  32. package/plugins/button/transforms/index.js +0 -11
  33. package/plugins/button/transforms/insert-button.d.ts +0 -2
  34. package/plugins/button/transforms/insert-button.js +0 -16
  35. package/plugins/button/transforms/is-button-active.d.ts +0 -2
  36. package/plugins/button/transforms/is-button-active.js +0 -7
  37. package/plugins/button/transforms/remove-selected-button.d.ts +0 -2
  38. package/plugins/button/transforms/remove-selected-button.js +0 -13
  39. package/plugins/button/transforms/update-button.d.ts +0 -2
  40. package/plugins/button/transforms/update-button.js +0 -9
  41. package/plugins/embedded/utils.d.ts +0 -1
  42. package/plugins/embedded/utils.js +0 -7
  43. package/plugins/embedded/video/create-video-plugin.d.ts +0 -4
  44. package/plugins/embedded/video/create-video-plugin.js +0 -19
  45. package/plugins/embedded/video/get-active-video.d.ts +0 -2
  46. package/plugins/embedded/video/get-active-video.js +0 -9
  47. package/plugins/embedded/video/insert-video.d.ts +0 -2
  48. package/plugins/embedded/video/insert-video.js +0 -18
  49. package/plugins/embedded/video/update-video.d.ts +0 -2
  50. package/plugins/embedded/video/update-video.js +0 -11
  51. package/plugins/exit-break/create-exit-break-plugin.d.ts +0 -3
  52. package/plugins/exit-break/create-exit-break-plugin.js +0 -30
  53. package/plugins/heading/constants.d.ts +0 -8
  54. package/plugins/heading/constants.js +0 -11
  55. package/plugins/heading/create-headings-plugin.d.ts +0 -8
  56. package/plugins/heading/create-headings-plugin.js +0 -40
  57. package/plugins/highlight/createHighlightPlugin.d.ts +0 -3
  58. package/plugins/highlight/createHighlightPlugin.js +0 -27
  59. package/plugins/highlight/types.d.ts +0 -10
  60. package/plugins/highlight/types.js +0 -4
  61. package/plugins/image/create-image-plugin.d.ts +0 -6
  62. package/plugins/image/create-image-plugin.js +0 -105
  63. package/plugins/image/hooks/use-image-handlers.d.ts +0 -5
  64. package/plugins/image/hooks/use-image-handlers.js +0 -19
  65. package/plugins/image/transforms/get-active-image.d.ts +0 -2
  66. package/plugins/image/transforms/get-active-image.js +0 -9
  67. package/plugins/image/transforms/insert-image.d.ts +0 -3
  68. package/plugins/image/transforms/insert-image.js +0 -19
  69. package/plugins/image/transforms/is-image-active.d.ts +0 -2
  70. package/plugins/image/transforms/is-image-active.js +0 -7
  71. package/plugins/image/transforms/remove-selected-image.d.ts +0 -2
  72. package/plugins/image/transforms/remove-selected-image.js +0 -13
  73. package/plugins/image/transforms/update-image.d.ts +0 -3
  74. package/plugins/image/transforms/update-image.js +0 -12
  75. package/plugins/image/types.d.ts +0 -12
  76. package/plugins/image/types.js +0 -6
  77. package/plugins/image/utils/is-image-url.d.ts +0 -2
  78. package/plugins/image/utils/is-image-url.js +0 -135
  79. package/plugins/image/with-image.d.ts +0 -7
  80. package/plugins/image/with-image.js +0 -19
  81. package/plugins/image/with-paste-image-url.d.ts +0 -7
  82. package/plugins/image/with-paste-image-url.js +0 -36
  83. package/plugins/image/with-paste-image.d.ts +0 -7
  84. package/plugins/image/with-paste-image.js +0 -49
  85. package/plugins/link/constants.d.ts +0 -2
  86. package/plugins/link/constants.js +0 -6
  87. package/plugins/link/create-link-plugin.d.ts +0 -3
  88. package/plugins/link/create-link-plugin.js +0 -15
  89. package/plugins/link/floating-link-wrapper.d.ts +0 -11
  90. package/plugins/link/floating-link-wrapper.js +0 -26
  91. package/plugins/link/hooks/index.d.ts +0 -4
  92. package/plugins/link/hooks/index.js +0 -11
  93. package/plugins/link/hooks/use-link-actions.d.ts +0 -12
  94. package/plugins/link/hooks/use-link-actions.js +0 -48
  95. package/plugins/link/hooks/use-link-cancel-on-escape.d.ts +0 -1
  96. package/plugins/link/hooks/use-link-cancel-on-escape.js +0 -5
  97. package/plugins/link/hooks/use-link-submit-on-enter.d.ts +0 -1
  98. package/plugins/link/hooks/use-link-submit-on-enter.js +0 -23
  99. package/plugins/link/transforms/get-active-link.d.ts +0 -3
  100. package/plugins/link/transforms/get-active-link.js +0 -17
  101. package/plugins/link/transforms/insert-link.d.ts +0 -2
  102. package/plugins/link/transforms/insert-link.js +0 -27
  103. package/plugins/link/transforms/is-link-selected.d.ts +0 -2
  104. package/plugins/link/transforms/is-link-selected.js +0 -15
  105. package/plugins/link/transforms/submit-link.d.ts +0 -8
  106. package/plugins/link/transforms/submit-link.js +0 -36
  107. package/plugins/link/transforms/trigger-link-insert-or-edit.d.ts +0 -2
  108. package/plugins/link/transforms/trigger-link-insert-or-edit.js +0 -6
  109. package/plugins/link/transforms/unwrap-link.d.ts +0 -2
  110. package/plugins/link/transforms/unwrap-link.js +0 -10
  111. package/plugins/link/types.d.ts +0 -5
  112. package/plugins/link/types.js +0 -2
  113. package/plugins/list/constants.d.ts +0 -4
  114. package/plugins/list/constants.js +0 -14
  115. package/plugins/list/create-list-plugin.d.ts +0 -4
  116. package/plugins/list/create-list-plugin.js +0 -16
  117. package/plugins/mark-bold/create-bold-plugin.d.ts +0 -3
  118. package/plugins/mark-bold/create-bold-plugin.js +0 -6
  119. package/plugins/mark-bold/types.d.ts +0 -2
  120. package/plugins/mark-bold/types.js +0 -6
  121. package/plugins/mark-code/create-code-plugin.d.ts +0 -3
  122. package/plugins/mark-code/create-code-plugin.js +0 -6
  123. package/plugins/mark-code/types.d.ts +0 -2
  124. package/plugins/mark-code/types.js +0 -6
  125. package/plugins/mark-italic/create-italic-plugin.d.ts +0 -3
  126. package/plugins/mark-italic/create-italic-plugin.js +0 -6
  127. package/plugins/mark-italic/types.d.ts +0 -2
  128. package/plugins/mark-italic/types.js +0 -6
  129. package/plugins/mark-underline/create-underline-plugin.d.ts +0 -3
  130. package/plugins/mark-underline/create-underline-plugin.js +0 -6
  131. package/plugins/mark-underline/types.d.ts +0 -2
  132. package/plugins/mark-underline/types.js +0 -6
  133. package/plugins/node-id/add-ids-to-nodes.d.ts +0 -2
  134. package/plugins/node-id/add-ids-to-nodes.js +0 -22
  135. package/plugins/node-id/create-node-id-plugin.d.ts +0 -3
  136. package/plugins/node-id/create-node-id-plugin.js +0 -6
  137. package/plugins/paragraph/create-paragraph-plugin.d.ts +0 -3
  138. package/plugins/paragraph/create-paragraph-plugin.js +0 -9
  139. package/plugins/paragraph/types.d.ts +0 -2
  140. package/plugins/paragraph/types.js +0 -6
  141. package/plugins/reset-node/create-reset-node.d.ts +0 -3
  142. package/plugins/reset-node/create-reset-node.js +0 -28
  143. package/plugins/select-on-backspace/create-select-on-backspace-plugin.d.ts +0 -3
  144. package/plugins/select-on-backspace/create-select-on-backspace-plugin.js +0 -14
  145. package/plugins/soft-break/create-soft-break-plugin.d.ts +0 -3
  146. package/plugins/soft-break/create-soft-break-plugin.js +0 -22
  147. package/plugins/trailing-block/create-trailing-block-plugin.d.ts +0 -3
  148. package/plugins/trailing-block/create-trailing-block-plugin.js +0 -6
  149. package/serializers/serialize-to-plaintext.d.ts +0 -2
  150. package/serializers/serialize-to-plaintext.js +0 -8
  151. package/translations/context.d.ts +0 -2
  152. package/translations/context.js +0 -9
  153. package/translations/cs.d.ts +0 -52
  154. package/translations/cs.js +0 -55
  155. package/translations/en.d.ts +0 -2
  156. package/translations/en.js +0 -55
  157. package/translations/sk.d.ts +0 -2
  158. package/translations/sk.js +0 -55
  159. package/types.d.ts +0 -102
  160. package/types.js +0 -2
  161. package/ui/blockquote-element.d.ts +0 -2
  162. package/ui/blockquote-element.js +0 -13
  163. package/ui/bold-mark.d.ts +0 -2
  164. package/ui/bold-mark.js +0 -13
  165. package/ui/button/button-element.d.ts +0 -2
  166. package/ui/button/button-element.js +0 -54
  167. package/ui/button/index.d.ts +0 -1
  168. package/ui/button/index.js +0 -5
  169. package/ui/button/insert-button-modal-content.d.ts +0 -8
  170. package/ui/button/insert-button-modal-content.js +0 -81
  171. package/ui/code-mark.d.ts +0 -2
  172. package/ui/code-mark.js +0 -13
  173. package/ui/components/element/element-action-buttons.d.ts +0 -9
  174. package/ui/components/element/element-action-buttons.js +0 -22
  175. package/ui/components/element/element-with-action-buttons.d.ts +0 -10
  176. package/ui/components/element/element-with-action-buttons.js +0 -17
  177. package/ui/components/modal/modal-button-cancel.d.ts +0 -9
  178. package/ui/components/modal/modal-button-cancel.js +0 -45
  179. package/ui/components/modal/modal-button-submit.d.ts +0 -6
  180. package/ui/components/modal/modal-button-submit.js +0 -12
  181. package/ui/components/modal/modal-buttons.d.ts +0 -11
  182. package/ui/components/modal/modal-buttons.js +0 -16
  183. package/ui/components/modal/modal-content.d.ts +0 -6
  184. package/ui/components/modal/modal-content.js +0 -14
  185. package/ui/create-uxf-ui.d.ts +0 -21
  186. package/ui/create-uxf-ui.js +0 -51
  187. package/ui/floating-link.d.ts +0 -2
  188. package/ui/floating-link.js +0 -110
  189. package/ui/heading-elements.d.ts +0 -7
  190. package/ui/heading-elements.js +0 -38
  191. package/ui/highlight-mark.d.ts +0 -3
  192. package/ui/highlight-mark.js +0 -13
  193. package/ui/image/image-element.d.ts +0 -2
  194. package/ui/image/image-element.js +0 -53
  195. package/ui/image/insert-image-modal-content.d.ts +0 -8
  196. package/ui/image/insert-image-modal-content.js +0 -87
  197. package/ui/italic-mark.d.ts +0 -2
  198. package/ui/italic-mark.js +0 -13
  199. package/ui/link-element.d.ts +0 -3
  200. package/ui/link-element.js +0 -14
  201. package/ui/list-item-element.d.ts +0 -2
  202. package/ui/list-item-element.js +0 -13
  203. package/ui/list-ordered-element.d.ts +0 -2
  204. package/ui/list-ordered-element.js +0 -13
  205. package/ui/list-unordered-element.d.ts +0 -2
  206. package/ui/list-unordered-element.js +0 -13
  207. package/ui/paragraph-element.d.ts +0 -2
  208. package/ui/paragraph-element.js +0 -13
  209. package/ui/toolbar/buttons/button-toolbar-button.d.ts +0 -10
  210. package/ui/toolbar/buttons/button-toolbar-button.js +0 -20
  211. package/ui/toolbar/buttons/element-toolbar-button.d.ts +0 -12
  212. package/ui/toolbar/buttons/element-toolbar-button.js +0 -25
  213. package/ui/toolbar/buttons/image-toolbar-button.d.ts +0 -10
  214. package/ui/toolbar/buttons/image-toolbar-button.js +0 -20
  215. package/ui/toolbar/buttons/link-toolbar-button.d.ts +0 -10
  216. package/ui/toolbar/buttons/link-toolbar-button.js +0 -29
  217. package/ui/toolbar/buttons/list-toolbar-button.d.ts +0 -13
  218. package/ui/toolbar/buttons/list-toolbar-button.js +0 -27
  219. package/ui/toolbar/buttons/mark-toolbar-button.d.ts +0 -13
  220. package/ui/toolbar/buttons/mark-toolbar-button.js +0 -25
  221. package/ui/toolbar/buttons/modal-toolbar-button.d.ts +0 -15
  222. package/ui/toolbar/buttons/modal-toolbar-button.js +0 -22
  223. package/ui/toolbar/buttons/toolbar-button.d.ts +0 -15
  224. package/ui/toolbar/buttons/toolbar-button.js +0 -35
  225. package/ui/toolbar/buttons/undo-redo-button-group.d.ts +0 -8
  226. package/ui/toolbar/buttons/undo-redo-button-group.js +0 -64
  227. package/ui/toolbar/buttons/video-toolbar-button.d.ts +0 -10
  228. package/ui/toolbar/buttons/video-toolbar-button.js +0 -20
  229. package/ui/toolbar/toolbar.d.ts +0 -3
  230. package/ui/toolbar/toolbar.js +0 -77
  231. package/ui/toolbar/types.d.ts +0 -8
  232. package/ui/toolbar/types.js +0 -2
  233. package/ui/underline-mark.d.ts +0 -2
  234. package/ui/underline-mark.js +0 -13
  235. package/ui/utils.d.ts +0 -2
  236. package/ui/utils.js +0 -13
  237. package/ui/video/insert-video-modal-content.d.ts +0 -8
  238. package/ui/video/insert-video-modal-content.js +0 -76
  239. package/ui/video/video-element.d.ts +0 -2
  240. package/ui/video/video-element.js +0 -55
  241. package/utils/url-helper.d.ts +0 -7
  242. package/utils/url-helper.js +0 -15
  243. package/utils/url-helper.test.d.ts +0 -1
  244. package/utils/url-helper.test.js +0 -37
  245. package/utils.d.ts +0 -30
  246. package/utils.js +0 -88
  247. package/wysiwyg-editor.d.ts +0 -17
  248. package/wysiwyg-editor.js +0 -44
  249. package/wysiwyg-editor.stories.d.ts +0 -5
  250. package/wysiwyg-editor.stories.js +0 -193
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withPasteImage = void 0;
4
- const plate_core_1 = require("@udecode/plate-core");
5
- const insert_image_1 = require("./transforms/insert-image");
6
- /**
7
- * If image is pasted from clipboard, upload image and insert it.
8
- */
9
- const withPasteImage = (editor, plugin) => {
10
- const { options: { uploadImage, getImageUrl }, } = plugin;
11
- const { insertData } = editor;
12
- editor.insertData = async (dataTransfer) => {
13
- const text = dataTransfer.getData("text/plain");
14
- const { files, effectAllowed } = dataTransfer;
15
- if (files.length > 0 && effectAllowed === "uninitialized") {
16
- // effectAllowed prevents re-upload image on drag and drop
17
- const injectedPlugins = (0, plate_core_1.getInjectedPlugins)(editor, plugin);
18
- if (!(0, plate_core_1.pipeInsertDataQuery)(injectedPlugins, {
19
- data: text,
20
- dataTransfer,
21
- })) {
22
- return insertData(dataTransfer);
23
- }
24
- for (const file of Array.from(files)) {
25
- const [mime] = file.type.split("/");
26
- if (mime === "image") {
27
- if (!uploadImage) {
28
- // eslint-disable-next-line no-console
29
- console.log("Missing uploadImage function in image plugin options!");
30
- return;
31
- }
32
- // eslint-disable-next-line no-await-in-loop
33
- const uploadedFile = await uploadImage(file);
34
- if (!getImageUrl) {
35
- // eslint-disable-next-line no-console
36
- console.log("Missing getImageUrl function in image plugin options!");
37
- return;
38
- }
39
- (0, insert_image_1.insertImage)(editor, uploadedFile, undefined, undefined, undefined, getImageUrl(uploadedFile));
40
- }
41
- }
42
- }
43
- else {
44
- insertData(dataTransfer);
45
- }
46
- };
47
- return editor;
48
- };
49
- exports.withPasteImage = withPasteImage;
@@ -1,2 +0,0 @@
1
- export { ELEMENT_LINK } from "@udecode/plate-link";
2
- export declare const LINK_PLUGIN_TYPE = "link";
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LINK_PLUGIN_TYPE = exports.ELEMENT_LINK = void 0;
4
- var plate_link_1 = require("@udecode/plate-link");
5
- Object.defineProperty(exports, "ELEMENT_LINK", { enumerable: true, get: function () { return plate_link_1.ELEMENT_LINK; } });
6
- exports.LINK_PLUGIN_TYPE = "link";
@@ -1,3 +0,0 @@
1
- import { LinkPlugin } from "@udecode/plate-link";
2
- import { UxfEditor, WysiwygContent } from "../../types";
3
- export declare const createLinkPlugin: () => import("@udecode/plate-core").PlatePlugin<LinkPlugin, WysiwygContent, UxfEditor>;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createLinkPlugin = void 0;
4
- const plate_link_1 = require("@udecode/plate-link");
5
- const floating_link_1 = require("../../ui/floating-link");
6
- const url_helper_1 = require("../../utils/url-helper");
7
- const constants_1 = require("./constants");
8
- const createLinkPlugin = () => (0, plate_link_1.createLinkPlugin)({
9
- type: constants_1.LINK_PLUGIN_TYPE,
10
- renderAfterEditable: floating_link_1.FloatingLink,
11
- options: {
12
- isUrl: url_helper_1.UrlHelper.isValid,
13
- },
14
- });
15
- exports.createLinkPlugin = createLinkPlugin;
@@ -1,11 +0,0 @@
1
- import { HTMLPropsAs } from "@udecode/plate-common";
2
- import { UseVirtualFloatingOptions } from "@udecode/plate-floating";
3
- export type FloatingLinkProps = HTMLPropsAs<"div"> & {
4
- floatingOptions?: UseVirtualFloatingOptions;
5
- };
6
- export declare const FloatingLinkEditRoot: import("@udecode/plate-common").Component<FloatingLinkProps>;
7
- export declare const FloatingLinkInsertRoot: import("@udecode/plate-common").Component<FloatingLinkProps>;
8
- export declare const FloatingLinkWrapper: {
9
- EditRoot: import("@udecode/plate-common").Component<FloatingLinkProps>;
10
- InsertRoot: import("@udecode/plate-common").Component<FloatingLinkProps>;
11
- };
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FloatingLinkWrapper = exports.FloatingLinkInsertRoot = exports.FloatingLinkEditRoot = void 0;
4
- const plate_common_1 = require("@udecode/plate-common");
5
- const plate_link_1 = require("@udecode/plate-link");
6
- const tw_z_index_1 = require("@uxf/ui/tw-tokens/tw-z-index");
7
- exports.FloatingLinkEditRoot = (0, plate_common_1.createComponentAs)((props) => {
8
- var _a;
9
- const htmlProps = (0, plate_link_1.useFloatingLinkEdit)(props);
10
- if (((_a = htmlProps.style) === null || _a === void 0 ? void 0 : _a.display) === "none") {
11
- return null;
12
- }
13
- return (0, plate_common_1.createElementAs)("div", { ...htmlProps, style: { ...htmlProps.style, zIndex: tw_z_index_1.twZIndex.modal } });
14
- });
15
- exports.FloatingLinkInsertRoot = (0, plate_common_1.createComponentAs)((props) => {
16
- var _a;
17
- const htmlProps = (0, plate_link_1.useFloatingLinkInsert)(props);
18
- if (((_a = htmlProps.style) === null || _a === void 0 ? void 0 : _a.display) === "none") {
19
- return null;
20
- }
21
- return (0, plate_common_1.createElementAs)("div", { ...htmlProps, style: { ...htmlProps.style, zIndex: tw_z_index_1.twZIndex.modal } });
22
- });
23
- exports.FloatingLinkWrapper = {
24
- EditRoot: exports.FloatingLinkEditRoot,
25
- InsertRoot: exports.FloatingLinkInsertRoot,
26
- };
@@ -1,4 +0,0 @@
1
- export { useFloatingLinkSelectors } from "@udecode/plate-link";
2
- export { useLinkActions } from "./use-link-actions";
3
- export { useLinkCancelOnEscape } from "./use-link-cancel-on-escape";
4
- export { useLinkSubmitOnEnter } from "./use-link-submit-on-enter";
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useLinkSubmitOnEnter = exports.useLinkCancelOnEscape = exports.useLinkActions = exports.useFloatingLinkSelectors = void 0;
4
- var plate_link_1 = require("@udecode/plate-link");
5
- Object.defineProperty(exports, "useFloatingLinkSelectors", { enumerable: true, get: function () { return plate_link_1.useFloatingLinkSelectors; } });
6
- var use_link_actions_1 = require("./use-link-actions");
7
- Object.defineProperty(exports, "useLinkActions", { enumerable: true, get: function () { return use_link_actions_1.useLinkActions; } });
8
- var use_link_cancel_on_escape_1 = require("./use-link-cancel-on-escape");
9
- Object.defineProperty(exports, "useLinkCancelOnEscape", { enumerable: true, get: function () { return use_link_cancel_on_escape_1.useLinkCancelOnEscape; } });
10
- var use_link_submit_on_enter_1 = require("./use-link-submit-on-enter");
11
- Object.defineProperty(exports, "useLinkSubmitOnEnter", { enumerable: true, get: function () { return use_link_submit_on_enter_1.useLinkSubmitOnEnter; } });
@@ -1,12 +0,0 @@
1
- export declare const useLinkActions: () => {
2
- editor: unknown;
3
- setUrl: (url: string) => void;
4
- getUrl: string;
5
- setText: (text: string) => void;
6
- getText: string;
7
- setTarget: (target: string | undefined) => void;
8
- getTarget: string;
9
- setAllValues: (url: string, text: string, target: string | undefined) => void;
10
- getActiveLinkValue: () => import("@udecode/plate-link").TLinkElement | undefined;
11
- isEditing: boolean;
12
- };
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useLinkActions = void 0;
4
- const plate_link_1 = require("@udecode/plate-link");
5
- const hooks_1 = require("../../../hooks");
6
- const get_active_link_1 = require("../transforms/get-active-link");
7
- const use_link_cancel_on_escape_1 = require("./use-link-cancel-on-escape");
8
- const use_link_submit_on_enter_1 = require("./use-link-submit-on-enter");
9
- const useLinkActions = () => {
10
- const editor = (0, hooks_1.useUxfEditorRef)();
11
- (0, use_link_submit_on_enter_1.useLinkSubmitOnEnter)();
12
- (0, use_link_cancel_on_escape_1.useLinkCancelOnEscape)();
13
- const floatingLinkSelectors = (0, plate_link_1.useFloatingLinkSelectors)();
14
- const setUrl = (url) => {
15
- plate_link_1.floatingLinkActions.url(url);
16
- plate_link_1.floatingLinkActions.isEditing(true);
17
- };
18
- const setText = (text) => {
19
- plate_link_1.floatingLinkActions.text(text);
20
- plate_link_1.floatingLinkActions.isEditing(true);
21
- };
22
- const setTarget = (target) => {
23
- plate_link_1.floatingLinkActions.newTab(target === "_blank");
24
- plate_link_1.floatingLinkActions.isEditing(true);
25
- };
26
- const setAllValues = (url, text, target) => {
27
- setUrl(url);
28
- setText(text);
29
- setTarget(target);
30
- plate_link_1.floatingLinkActions.isEditing(true);
31
- // floatingLinkActions.show("edit", editor.id);
32
- };
33
- const getActiveLinkValue = () => (0, get_active_link_1.getActiveLink)(editor);
34
- return {
35
- editor: editor.current,
36
- setUrl,
37
- getUrl: floatingLinkSelectors.url(),
38
- setText,
39
- getText: floatingLinkSelectors.text(),
40
- setTarget,
41
- getTarget: floatingLinkSelectors.newTab() ? "_blank" : "_self",
42
- setAllValues,
43
- getActiveLinkValue,
44
- // isLinkActive: linkActive,
45
- isEditing: floatingLinkSelectors.isEditing(),
46
- };
47
- };
48
- exports.useLinkActions = useLinkActions;
@@ -1 +0,0 @@
1
- export { useFloatingLinkEscape as useLinkCancelOnEscape } from "@udecode/plate-link";
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useLinkCancelOnEscape = void 0;
4
- var plate_link_1 = require("@udecode/plate-link");
5
- Object.defineProperty(exports, "useLinkCancelOnEscape", { enumerable: true, get: function () { return plate_link_1.useFloatingLinkEscape; } });
@@ -1 +0,0 @@
1
- export declare const useLinkSubmitOnEnter: () => void;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useLinkSubmitOnEnter = void 0;
4
- const plate_core_1 = require("@udecode/plate-core");
5
- const plate_link_1 = require("@udecode/plate-link");
6
- const hooks_1 = require("../../../hooks");
7
- const submit_link_1 = require("../transforms/submit-link");
8
- const useLinkSubmitOnEnter = () => {
9
- const editor = (0, hooks_1.useUxfEditorRef)();
10
- const open = (0, plate_link_1.useFloatingLinkSelectors)().isEditing();
11
- (0, plate_core_1.useHotkeys)("*", (e) => {
12
- if (e.key !== "Enter") {
13
- return;
14
- }
15
- if ((0, submit_link_1.submitLink)(editor)) {
16
- e.preventDefault();
17
- }
18
- }, {
19
- enabled: open,
20
- enableOnFormTags: ["INPUT"],
21
- }, []);
22
- };
23
- exports.useLinkSubmitOnEnter = useLinkSubmitOnEnter;
@@ -1,3 +0,0 @@
1
- import { TLinkElement } from "@udecode/plate-link";
2
- import { UxfEditor } from "../../../types";
3
- export declare const getActiveLink: (editor: UxfEditor) => TLinkElement | undefined;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getActiveLink = void 0;
4
- const plate_core_1 = require("@udecode/plate-core");
5
- const plate_link_1 = require("@udecode/plate-link");
6
- const slate_1 = require("@udecode/slate");
7
- const getActiveLink = (editor) => {
8
- const entry = (0, slate_1.findNode)(editor, {
9
- match: { type: (0, plate_core_1.getPluginType)(editor, plate_link_1.ELEMENT_LINK) },
10
- });
11
- if (!entry) {
12
- return;
13
- }
14
- const [link] = entry;
15
- return link;
16
- };
17
- exports.getActiveLink = getActiveLink;
@@ -1,2 +0,0 @@
1
- import { UxfEditor } from "../../../types";
2
- export declare const insertLink: (editor: UxfEditor, url: string, text: string, target: "_blank" | "_self") => boolean;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.insertLink = void 0;
4
- const plate_common_1 = require("@udecode/plate-common");
5
- const plate_core_1 = require("@udecode/plate-core");
6
- const plate_link_1 = require("@udecode/plate-link");
7
- const insertLink = (editor, url, text, target) => {
8
- if (!editor.selection) {
9
- return false;
10
- }
11
- const { isUrl, forceSubmit } = (0, plate_core_1.getPluginOptions)(editor, plate_link_1.ELEMENT_LINK);
12
- const isValid = (isUrl === null || isUrl === void 0 ? void 0 : isUrl(url)) || forceSubmit;
13
- if (!isValid) {
14
- return false;
15
- }
16
- (0, plate_link_1.upsertLink)(editor, {
17
- url,
18
- text,
19
- target,
20
- skipValidation: true,
21
- });
22
- setTimeout(() => {
23
- (0, plate_common_1.focusEditor)(editor, editor.selection || undefined);
24
- }, 0);
25
- return true;
26
- };
27
- exports.insertLink = insertLink;
@@ -1,2 +0,0 @@
1
- import { UxfEditor } from "../../../types";
2
- export declare const isLinkSelected: (editor: UxfEditor) => boolean;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isLinkSelected = void 0;
4
- const utils_1 = require("../../../utils");
5
- const constants_1 = require("../constants");
6
- const isLinkSelected = (editor) => {
7
- if (!editor.selection) {
8
- return false;
9
- }
10
- return ((0, utils_1.isRangeInSingleText)(editor) &&
11
- (0, utils_1.someNode)(editor, {
12
- match: { type: (0, utils_1.getPluginType)(editor, constants_1.LINK_PLUGIN_TYPE) },
13
- }));
14
- };
15
- exports.isLinkSelected = isLinkSelected;
@@ -1,8 +0,0 @@
1
- import { PlateEditor } from "@udecode/plate-core";
2
- import { Value } from "@udecode/slate";
3
- /**
4
- * Insert transforms if url is valid from store
5
- * Text is url if empty.
6
- * Focus editor.
7
- */
8
- export declare const submitLink: <V extends Value>(editor: PlateEditor<V>) => true | undefined;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.submitLink = void 0;
4
- const plate_common_1 = require("@udecode/plate-common");
5
- const plate_core_1 = require("@udecode/plate-core");
6
- const plate_link_1 = require("@udecode/plate-link");
7
- /**
8
- * Insert transforms if url is valid from store
9
- * Text is url if empty.
10
- * Focus editor.
11
- */
12
- const submitLink = (editor) => {
13
- if (!editor.selection) {
14
- return;
15
- }
16
- const { isUrl, forceSubmit } = (0, plate_core_1.getPluginOptions)(editor, plate_link_1.ELEMENT_LINK);
17
- const url = plate_link_1.floatingLinkSelectors.url();
18
- const isValid = (isUrl === null || isUrl === void 0 ? void 0 : isUrl(url)) || forceSubmit;
19
- if (!isValid) {
20
- return;
21
- }
22
- const text = plate_link_1.floatingLinkSelectors.text();
23
- const target = plate_link_1.floatingLinkSelectors.newTab() ? "_blank" : "_self";
24
- (0, plate_link_1.upsertLink)(editor, {
25
- url,
26
- text,
27
- target,
28
- skipValidation: true,
29
- });
30
- plate_link_1.floatingLinkActions.reset();
31
- setTimeout(() => {
32
- (0, plate_common_1.focusEditor)(editor, editor.selection || undefined);
33
- }, 0);
34
- return true;
35
- };
36
- exports.submitLink = submitLink;
@@ -1,2 +0,0 @@
1
- import { UxfEditor } from "../../../types";
2
- export declare const triggerLinkInsertOrEdit: (editor: UxfEditor, focused?: boolean) => void;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.triggerLinkInsertOrEdit = void 0;
4
- const plate_link_1 = require("@udecode/plate-link");
5
- const triggerLinkInsertOrEdit = (editor, focused = false) => (0, plate_link_1.triggerFloatingLink)(editor, { focused });
6
- exports.triggerLinkInsertOrEdit = triggerLinkInsertOrEdit;
@@ -1,2 +0,0 @@
1
- import { UxfEditor } from "../../../types";
2
- export declare const removeLink: (editor: UxfEditor) => void;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeLink = void 0;
4
- const plate_link_1 = require("@udecode/plate-link");
5
- const utils_1 = require("../../../utils");
6
- const removeLink = (editor) => {
7
- (0, plate_link_1.unwrapLink)(editor);
8
- (0, utils_1.focusEditor)(editor);
9
- };
10
- exports.removeLink = removeLink;
@@ -1,5 +0,0 @@
1
- import { UxfBlockElement } from "../../types";
2
- export interface TLinkElement extends UxfBlockElement {
3
- url: string;
4
- target: "_blank" | "_self";
5
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
1
- export declare const LIST_PLUGIN_KEY = "list";
2
- export declare const LIST_ORDERED_TYPE = "ol";
3
- export declare const LIST_UNORDERED_TYPE = "ul";
4
- export { ELEMENT_LI, ELEMENT_LIC, ELEMENT_OL, ELEMENT_UL, getListItemEntry, toggleList } from "@udecode/plate-list";
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toggleList = exports.getListItemEntry = exports.ELEMENT_UL = exports.ELEMENT_OL = exports.ELEMENT_LIC = exports.ELEMENT_LI = exports.LIST_UNORDERED_TYPE = exports.LIST_ORDERED_TYPE = exports.LIST_PLUGIN_KEY = void 0;
4
- const plate_list_1 = require("@udecode/plate-list");
5
- exports.LIST_PLUGIN_KEY = "list";
6
- exports.LIST_ORDERED_TYPE = plate_list_1.ELEMENT_OL;
7
- exports.LIST_UNORDERED_TYPE = plate_list_1.ELEMENT_UL;
8
- var plate_list_2 = require("@udecode/plate-list");
9
- Object.defineProperty(exports, "ELEMENT_LI", { enumerable: true, get: function () { return plate_list_2.ELEMENT_LI; } });
10
- Object.defineProperty(exports, "ELEMENT_LIC", { enumerable: true, get: function () { return plate_list_2.ELEMENT_LIC; } });
11
- Object.defineProperty(exports, "ELEMENT_OL", { enumerable: true, get: function () { return plate_list_2.ELEMENT_OL; } });
12
- Object.defineProperty(exports, "ELEMENT_UL", { enumerable: true, get: function () { return plate_list_2.ELEMENT_UL; } });
13
- Object.defineProperty(exports, "getListItemEntry", { enumerable: true, get: function () { return plate_list_2.getListItemEntry; } });
14
- Object.defineProperty(exports, "toggleList", { enumerable: true, get: function () { return plate_list_2.toggleList; } });
@@ -1,4 +0,0 @@
1
- import { ListPlugin } from "@udecode/plate-list";
2
- import { UxfPlatePlugin } from "../../types";
3
- export { getListItemEntry, toggleList } from "@udecode/plate-list";
4
- export declare const createListPlugin: () => UxfPlatePlugin<ListPlugin>;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createListPlugin = exports.toggleList = exports.getListItemEntry = void 0;
4
- const plate_list_1 = require("@udecode/plate-list");
5
- const types_1 = require("../paragraph/types");
6
- var plate_list_2 = require("@udecode/plate-list");
7
- Object.defineProperty(exports, "getListItemEntry", { enumerable: true, get: function () { return plate_list_2.getListItemEntry; } });
8
- Object.defineProperty(exports, "toggleList", { enumerable: true, get: function () { return plate_list_2.toggleList; } });
9
- const createListPlugin = () => (0, plate_list_1.createListPlugin)({
10
- inject: {
11
- props: {
12
- validTypes: [types_1.PARAGRAPH_PLUGIN_KEY],
13
- },
14
- },
15
- });
16
- exports.createListPlugin = createListPlugin;
@@ -1,3 +0,0 @@
1
- import { ToggleMarkPlugin } from "@udecode/plate-core";
2
- import { UxfEditor, WysiwygContent } from "../../types";
3
- export declare const createBoldPlugin: () => import("@udecode/plate-core").PlatePlugin<ToggleMarkPlugin, WysiwygContent, UxfEditor>;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createBoldPlugin = void 0;
4
- const plate_basic_marks_1 = require("@udecode/plate-basic-marks");
5
- const createBoldPlugin = () => (0, plate_basic_marks_1.createBoldPlugin)();
6
- exports.createBoldPlugin = createBoldPlugin;
@@ -1,2 +0,0 @@
1
- export declare const BOLD_PLUGIN_KEY = "bold";
2
- export declare const BOLD_PLUGIN_TYPE = "bold";
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BOLD_PLUGIN_TYPE = exports.BOLD_PLUGIN_KEY = void 0;
4
- const plate_basic_marks_1 = require("@udecode/plate-basic-marks");
5
- exports.BOLD_PLUGIN_KEY = plate_basic_marks_1.MARK_BOLD;
6
- exports.BOLD_PLUGIN_TYPE = plate_basic_marks_1.MARK_BOLD;
@@ -1,3 +0,0 @@
1
- import { ToggleMarkPlugin } from "@udecode/plate-core";
2
- import { UxfEditor, WysiwygContent } from "../../types";
3
- export declare const createCodePlugin: () => import("@udecode/plate-core").PlatePlugin<ToggleMarkPlugin, WysiwygContent, UxfEditor>;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createCodePlugin = void 0;
4
- const plate_basic_marks_1 = require("@udecode/plate-basic-marks");
5
- const createCodePlugin = () => (0, plate_basic_marks_1.createCodePlugin)();
6
- exports.createCodePlugin = createCodePlugin;
@@ -1,2 +0,0 @@
1
- export declare const CODE_PLUGIN_KEY = "code";
2
- export declare const CODE_PLUGIN_TYPE = "code";
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CODE_PLUGIN_TYPE = exports.CODE_PLUGIN_KEY = void 0;
4
- const plate_basic_marks_1 = require("@udecode/plate-basic-marks");
5
- exports.CODE_PLUGIN_KEY = plate_basic_marks_1.MARK_CODE;
6
- exports.CODE_PLUGIN_TYPE = plate_basic_marks_1.MARK_CODE;
@@ -1,3 +0,0 @@
1
- import { ToggleMarkPlugin } from "@udecode/plate-core";
2
- import { UxfEditor, WysiwygContent } from "../../types";
3
- export declare const createItalicPlugin: () => import("@udecode/plate-core").PlatePlugin<ToggleMarkPlugin, WysiwygContent, UxfEditor>;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createItalicPlugin = void 0;
4
- const plate_basic_marks_1 = require("@udecode/plate-basic-marks");
5
- const createItalicPlugin = () => (0, plate_basic_marks_1.createItalicPlugin)();
6
- exports.createItalicPlugin = createItalicPlugin;
@@ -1,2 +0,0 @@
1
- export declare const ITALIC_PLUGIN_KEY = "italic";
2
- export declare const ITALIC_PLUGIN_TYPE = "italic";
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ITALIC_PLUGIN_TYPE = exports.ITALIC_PLUGIN_KEY = void 0;
4
- const plate_basic_marks_1 = require("@udecode/plate-basic-marks");
5
- exports.ITALIC_PLUGIN_KEY = plate_basic_marks_1.MARK_ITALIC;
6
- exports.ITALIC_PLUGIN_TYPE = plate_basic_marks_1.MARK_ITALIC;
@@ -1,3 +0,0 @@
1
- import { ToggleMarkPlugin } from "@udecode/plate-core";
2
- import { UxfEditor, WysiwygContent } from "../../types";
3
- export declare const createUnderlinePlugin: () => import("@udecode/plate-core").PlatePlugin<ToggleMarkPlugin, WysiwygContent, UxfEditor>;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createUnderlinePlugin = void 0;
4
- const plate_basic_marks_1 = require("@udecode/plate-basic-marks");
5
- const createUnderlinePlugin = () => (0, plate_basic_marks_1.createUnderlinePlugin)();
6
- exports.createUnderlinePlugin = createUnderlinePlugin;
@@ -1,2 +0,0 @@
1
- export declare const UNDER_LINE_PLUGIN_KEY = "underline";
2
- export declare const UNDER_LINE_PLUGIN_TYPE = "underline";
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UNDER_LINE_PLUGIN_TYPE = exports.UNDER_LINE_PLUGIN_KEY = void 0;
4
- const plate_basic_marks_1 = require("@udecode/plate-basic-marks");
5
- exports.UNDER_LINE_PLUGIN_KEY = plate_basic_marks_1.MARK_UNDERLINE;
6
- exports.UNDER_LINE_PLUGIN_TYPE = plate_basic_marks_1.MARK_UNDERLINE;
@@ -1,2 +0,0 @@
1
- import { WysiwygContent } from "../../types";
2
- export declare const addIdsToNodes: (nodes: any[]) => WysiwygContent;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addIdsToNodes = void 0;
4
- const addIdsToNodes = (nodes) => {
5
- return nodes.map((node) => {
6
- let id = node.id;
7
- let children = node.children;
8
- if (!id && !node.text) {
9
- id = Math.random().toString(36).substring(2, 7);
10
- }
11
- if (node.children) {
12
- children = (0, exports.addIdsToNodes)(node.children);
13
- }
14
- return {
15
- type: node.type,
16
- id: id,
17
- ...node,
18
- children,
19
- };
20
- });
21
- };
22
- exports.addIdsToNodes = addIdsToNodes;
@@ -1,3 +0,0 @@
1
- import { NodeIdPlugin } from "@udecode/plate-node-id";
2
- import { UxfEditor, WysiwygContent } from "../../types";
3
- export declare const createNodeIdPlugin: () => import("@udecode/plate-core").PlatePlugin<NodeIdPlugin, WysiwygContent, UxfEditor>;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createNodeIdPlugin = void 0;
4
- const plate_node_id_1 = require("@udecode/plate-node-id");
5
- const createNodeIdPlugin = () => (0, plate_node_id_1.createNodeIdPlugin)();
6
- exports.createNodeIdPlugin = createNodeIdPlugin;
@@ -1,3 +0,0 @@
1
- import { HotkeyPlugin } from "@udecode/plate-core";
2
- import { UxfPlatePlugin } from "../../types";
3
- export declare const createParagraphPlugin: () => UxfPlatePlugin<HotkeyPlugin>;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createParagraphPlugin = void 0;
4
- const plate_paragraph_1 = require("@udecode/plate-paragraph");
5
- const types_1 = require("./types");
6
- const createParagraphPlugin = () => (0, plate_paragraph_1.createParagraphPlugin)({
7
- type: types_1.PARAGRAPH_PLUGIN_TYPE,
8
- });
9
- exports.createParagraphPlugin = createParagraphPlugin;
@@ -1,2 +0,0 @@
1
- export declare const PARAGRAPH_PLUGIN_KEY = "p";
2
- export declare const PARAGRAPH_PLUGIN_TYPE = "paragraph";
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PARAGRAPH_PLUGIN_TYPE = exports.PARAGRAPH_PLUGIN_KEY = void 0;
4
- const plate_paragraph_1 = require("@udecode/plate-paragraph");
5
- exports.PARAGRAPH_PLUGIN_KEY = plate_paragraph_1.ELEMENT_PARAGRAPH;
6
- exports.PARAGRAPH_PLUGIN_TYPE = "paragraph";