@mdxeditor/editor 3.2.0 → 3.3.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 (60) hide show
  1. package/dist/MDXEditor.js +2 -5
  2. package/dist/defaultSvgIcons.js +330 -0
  3. package/dist/index.d.ts +7 -6
  4. package/dist/plugins/codeblock/CodeBlockNode.js +1 -0
  5. package/dist/plugins/codemirror/CodeMirrorEditor.js +45 -6
  6. package/dist/plugins/image/ImageEditor.js +17 -2
  7. package/dist/plugins/sandpack/SandpackEditor.js +24 -7
  8. package/dist/plugins/sandpack/useCodeMirrorRef.js +10 -1
  9. package/dist/plugins/table/TableEditor.js +16 -16
  10. package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +3 -4
  11. package/dist/style.css +317 -277
  12. package/dist/styles/ui.module.css.js +113 -104
  13. package/package.json +5 -3
  14. package/dist/icons/add_column.svg.js +0 -5
  15. package/dist/icons/add_photo.svg.js +0 -5
  16. package/dist/icons/add_row.svg.js +0 -5
  17. package/dist/icons/admonition.svg.js +0 -5
  18. package/dist/icons/arrow_drop_down.svg.js +0 -5
  19. package/dist/icons/check.svg.js +0 -5
  20. package/dist/icons/check_small.svg.js +0 -5
  21. package/dist/icons/close.svg.js +0 -5
  22. package/dist/icons/code.svg.js +0 -5
  23. package/dist/icons/content_copy.svg.js +0 -5
  24. package/dist/icons/delete_big.svg.js +0 -5
  25. package/dist/icons/delete_small.svg.js +0 -5
  26. package/dist/icons/difference.svg.js +0 -5
  27. package/dist/icons/edit.svg.js +0 -5
  28. package/dist/icons/extension.svg.js +0 -5
  29. package/dist/icons/format_align_center.svg.js +0 -5
  30. package/dist/icons/format_align_left.svg.js +0 -5
  31. package/dist/icons/format_align_right.svg.js +0 -5
  32. package/dist/icons/format_bold.svg.js +0 -5
  33. package/dist/icons/format_italic.svg.js +0 -5
  34. package/dist/icons/format_list_bulleted.svg.js +0 -5
  35. package/dist/icons/format_list_checked.svg.js +0 -5
  36. package/dist/icons/format_list_numbered.svg.js +0 -5
  37. package/dist/icons/format_underlined.svg.js +0 -5
  38. package/dist/icons/frame_source.svg.js +0 -5
  39. package/dist/icons/frontmatter.svg.js +0 -5
  40. package/dist/icons/horizontal_rule.svg.js +0 -5
  41. package/dist/icons/insert_col_left.svg.js +0 -5
  42. package/dist/icons/insert_col_right.svg.js +0 -5
  43. package/dist/icons/insert_row_above.svg.js +0 -5
  44. package/dist/icons/insert_row_below.svg.js +0 -5
  45. package/dist/icons/link.svg.js +0 -5
  46. package/dist/icons/link_off.svg.js +0 -5
  47. package/dist/icons/markdown.svg.js +0 -5
  48. package/dist/icons/more_horiz.svg.js +0 -5
  49. package/dist/icons/more_vert.svg.js +0 -5
  50. package/dist/icons/open_in_new.svg.js +0 -5
  51. package/dist/icons/redo.svg.js +0 -5
  52. package/dist/icons/rich_text.svg.js +0 -5
  53. package/dist/icons/sandpack.svg.js +0 -5
  54. package/dist/icons/settings.svg.js +0 -5
  55. package/dist/icons/strikethrough_s.svg.js +0 -5
  56. package/dist/icons/subscript.svg.js +0 -5
  57. package/dist/icons/superscript.svg.js +0 -5
  58. package/dist/icons/table.svg.js +0 -5
  59. package/dist/icons/undo.svg.js +0 -5
  60. package/dist/plugins/core/Icon.js +0 -102
@@ -1,5 +0,0 @@
1
- import * as React from "react";
2
- const SvgSettings = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("path", { d: "m9.25 22-.4-3.2a3.79 3.79 0 0 1-.613-.3 8.266 8.266 0 0 1-.562-.375L4.7 19.375l-2.75-4.75 2.575-1.95a2.387 2.387 0 0 1-.025-.338v-.675c0-.108.008-.22.025-.337L1.95 9.375l2.75-4.75 2.975 1.25c.183-.133.375-.258.575-.375.2-.117.4-.217.6-.3l.4-3.2h5.5l.4 3.2c.217.083.42.183.612.3.192.117.38.242.563.375l2.975-1.25 2.75 4.75-2.575 1.95c.017.117.025.23.025.338v.675c0 .108-.017.22-.05.337l2.575 1.95-2.75 4.75-2.95-1.25a6.842 6.842 0 0 1-.575.375c-.2.117-.4.217-.6.3l-.4 3.2h-5.5Zm2.8-6.5c.967 0 1.792-.342 2.475-1.025A3.372 3.372 0 0 0 15.55 12c0-.967-.342-1.792-1.025-2.475A3.373 3.373 0 0 0 12.05 8.5c-.983 0-1.813.342-2.488 1.025A3.393 3.393 0 0 0 8.55 12c0 .967.337 1.792 1.012 2.475.676.683 1.505 1.025 2.488 1.025Zm0-2c-.417 0-.77-.146-1.063-.438A1.446 1.446 0 0 1 10.55 12c0-.417.146-.77.438-1.063a1.446 1.446 0 0 1 1.062-.437c.417 0 .77.146 1.063.438.291.291.437.645.437 1.062 0 .417-.146.77-.438 1.063a1.447 1.447 0 0 1-1.062.437ZM11 20h1.975l.35-2.65a5.61 5.61 0 0 0 1.438-.588c.441-.258.845-.57 1.212-.937l2.475 1.025.975-1.7-2.15-1.625c.083-.233.142-.48.175-.738a6.153 6.153 0 0 0 0-1.575 3.535 3.535 0 0 0-.175-.737l2.15-1.625-.975-1.7-2.475 1.05a5.556 5.556 0 0 0-1.213-.962 5.607 5.607 0 0 0-1.437-.588L13 4h-1.975l-.35 2.65c-.517.133-.996.33-1.438.587a6.015 6.015 0 0 0-1.212.938L5.55 7.15l-.975 1.7 2.15 1.6c-.083.25-.142.5-.175.75a6.122 6.122 0 0 0 0 1.575c.033.25.092.5.175.75l-2.15 1.625.975 1.7 2.475-1.05c.367.383.77.704 1.212.962.442.259.921.455 1.438.588L11 20Z" }));
3
- export {
4
- SvgSettings as default
5
- };
@@ -1,5 +0,0 @@
1
- import * as React from "react";
2
- const SvgStrikethroughS = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M12.15 20C10.8833 20 9.75833 19.625 8.775 18.875C7.79167 18.125 7.08333 17.1 6.65 15.8L8.85 14.85C9.08333 15.65 9.4875 16.3083 10.0625 16.825C10.6375 17.3416 11.35 17.6 12.2 17.6C12.9 17.6 13.5333 17.4333 14.1 17.1C14.6667 16.7666 14.95 16.2333 14.95 15.5C14.95 15.2 14.8917 14.925 14.775 14.675C14.6583 14.425 14.5 14.2 14.3 14H17.1C17.1833 14.2333 17.2458 14.4708 17.2875 14.7125C17.3292 14.9541 17.35 15.2166 17.35 15.5C17.35 16.9333 16.8375 18.0416 15.8125 18.825C14.7875 19.6083 13.5667 20 12.15 20ZM2 12V9.99998H22V12H2ZM12.05 3.84998C13.15 3.84998 14.1125 4.12081 14.9375 4.66248C15.7625 5.20414 16.4 6.03331 16.85 7.14998L14.65 8.12498C14.5 7.64164 14.2208 7.20831 13.8125 6.82498C13.4042 6.44164 12.8333 6.24998 12.1 6.24998C11.4167 6.24998 10.85 6.40414 10.4 6.71248C9.95 7.02081 9.7 7.44998 9.65 7.99998H7.25C7.28333 6.84998 7.7375 5.87081 8.6125 5.06248C9.4875 4.25414 10.6333 3.84998 12.05 3.84998Z", fill: "currentColor" }));
3
- export {
4
- SvgStrikethroughS as default
5
- };
@@ -1,5 +0,0 @@
1
- import * as React from "react";
2
- const SvgSubscript = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M19 21V18H22V17H19V16H23V19H20V20H23V21H19ZM5.875 19L10.5 11.725L6.2 5H8.85L11.95 10H12.05L15.125 5H17.8L13.475 11.725L18.125 19H15.45L12.05 13.575H11.95L8.55 19H5.875Z", fill: "currentColor" }));
3
- export {
4
- SvgSubscript as default
5
- };
@@ -1,5 +0,0 @@
1
- import * as React from "react";
2
- const SvgSuperscript = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M19 8V5H22V4H19V3H23V6H20V7H23V8H19ZM5.875 19L10.5 11.725L6.2 5H8.85L11.95 10H12.05L15.125 5H17.8L13.475 11.725L18.125 19H15.45L12.05 13.575H11.95L8.55 19H5.875Z", fill: "currentColor" }));
3
- export {
4
- SvgSuperscript as default
5
- };
@@ -1,5 +0,0 @@
1
- import * as React from "react";
2
- const SvgTable = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M3 21V3h18v18H3ZM5 9h14V5H5v4Zm5.325 5h3.35v-3h-3.35v3Zm0 5h3.35v-3h-3.35v3ZM5 14h3.325v-3H5v3Zm10.675 0H19v-3h-3.325v3ZM5 19h3.325v-3H5v3Zm10.675 0H19v-3h-3.325v3Z" }), /* @__PURE__ */ React.createElement("path", { d: "M8.325 9h2V5h-2v4Zm5.35 0h2V5h-2v4Z" }));
3
- export {
4
- SvgTable as default
5
- };
@@ -1,5 +0,0 @@
1
- import * as React from "react";
2
- const SvgUndo = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M7 19V17H14.1C15.15 17 16.0625 16.6667 16.8375 16C17.6125 15.3333 18 14.5 18 13.5C18 12.5 17.6125 11.6667 16.8375 11C16.0625 10.3333 15.15 10 14.1 10H7.8L10.4 12.6L9 14L4 9L9 4L10.4 5.4L7.8 8H14.1C15.7167 8 17.1042 8.525 18.2625 9.575C19.4208 10.625 20 11.9333 20 13.5C20 15.0667 19.4208 16.375 18.2625 17.425C17.1042 18.475 15.7167 19 14.1 19H7Z", fill: "currentColor" }));
3
- export {
4
- SvgUndo as default
5
- };
@@ -1,102 +0,0 @@
1
- import React__default from "react";
2
- import SvgAddColumn from "../../icons/add_column.svg.js";
3
- import SvgAddPhoto from "../../icons/add_photo.svg.js";
4
- import SvgAddRow from "../../icons/add_row.svg.js";
5
- import SvgArrowDropDown from "../../icons/arrow_drop_down.svg.js";
6
- import SvgCheck from "../../icons/check.svg.js";
7
- import SvgCheckSmall from "../../icons/check_small.svg.js";
8
- import SvgClose from "../../icons/close.svg.js";
9
- import SvgCode from "../../icons/code.svg.js";
10
- import SvgContentCopy from "../../icons/content_copy.svg.js";
11
- import SvgDeleteBig from "../../icons/delete_big.svg.js";
12
- import SvgDeleteSmall from "../../icons/delete_small.svg.js";
13
- import SvgSandpack from "../../icons/sandpack.svg.js";
14
- import SvgDifference from "../../icons/difference.svg.js";
15
- import SvgEdit from "../../icons/edit.svg.js";
16
- import SvgAdmonition from "../../icons/admonition.svg.js";
17
- import SvgExtension from "../../icons/extension.svg.js";
18
- import SvgFormatAlignCenter from "../../icons/format_align_center.svg.js";
19
- import SvgFormatAlignLeft from "../../icons/format_align_left.svg.js";
20
- import SvgFormatAlignRight from "../../icons/format_align_right.svg.js";
21
- import SvgFormatBold from "../../icons/format_bold.svg.js";
22
- import SvgFormatItalic from "../../icons/format_italic.svg.js";
23
- import SvgFormatListBulleted from "../../icons/format_list_bulleted.svg.js";
24
- import SvgFormatListChecked from "../../icons/format_list_checked.svg.js";
25
- import SvgFormatListNumbered from "../../icons/format_list_numbered.svg.js";
26
- import SvgFormatUnderlined from "../../icons/format_underlined.svg.js";
27
- import SvgFrameSource from "../../icons/frame_source.svg.js";
28
- import SvgFrontmatter from "../../icons/frontmatter.svg.js";
29
- import SvgHorizontalRule from "../../icons/horizontal_rule.svg.js";
30
- import SvgInsertColLeft from "../../icons/insert_col_left.svg.js";
31
- import SvgInsertColRight from "../../icons/insert_col_right.svg.js";
32
- import SvgInsertRowAbove from "../../icons/insert_row_above.svg.js";
33
- import SvgInsertRowBelow from "../../icons/insert_row_below.svg.js";
34
- import SvgLink from "../../icons/link.svg.js";
35
- import SvgLinkOff from "../../icons/link_off.svg.js";
36
- import SvgMarkdown from "../../icons/markdown.svg.js";
37
- import SvgMoreHoriz from "../../icons/more_horiz.svg.js";
38
- import SvgMoreVert from "../../icons/more_vert.svg.js";
39
- import SvgOpenInNew from "../../icons/open_in_new.svg.js";
40
- import SvgRedo from "../../icons/redo.svg.js";
41
- import SvgRichText from "../../icons/rich_text.svg.js";
42
- import SvgSettings from "../../icons/settings.svg.js";
43
- import SvgTable from "../../icons/table.svg.js";
44
- import SvgUndo from "../../icons/undo.svg.js";
45
- import SvgStrikethroughS from "../../icons/strikethrough_s.svg.js";
46
- import SvgSuperscript from "../../icons/superscript.svg.js";
47
- import SvgSubscript from "../../icons/subscript.svg.js";
48
- const IconMap = {
49
- add_column: SvgAddColumn,
50
- add_photo: SvgAddPhoto,
51
- add_row: SvgAddRow,
52
- arrow_drop_down: SvgArrowDropDown,
53
- check: SvgCheck,
54
- check_small: SvgCheckSmall,
55
- close: SvgClose,
56
- code: SvgCode,
57
- content_copy: SvgContentCopy,
58
- delete_big: SvgDeleteBig,
59
- delete_small: SvgDeleteSmall,
60
- sandpack: SvgSandpack,
61
- difference: SvgDifference,
62
- edit: SvgEdit,
63
- admonition: SvgAdmonition,
64
- extension: SvgExtension,
65
- format_align_center: SvgFormatAlignCenter,
66
- format_align_left: SvgFormatAlignLeft,
67
- format_align_right: SvgFormatAlignRight,
68
- format_bold: SvgFormatBold,
69
- format_italic: SvgFormatItalic,
70
- format_list_bulleted: SvgFormatListBulleted,
71
- format_list_checked: SvgFormatListChecked,
72
- format_list_numbered: SvgFormatListNumbered,
73
- format_underlined: SvgFormatUnderlined,
74
- frame_source: SvgFrameSource,
75
- frontmatter: SvgFrontmatter,
76
- horizontal_rule: SvgHorizontalRule,
77
- insert_col_left: SvgInsertColLeft,
78
- insert_col_right: SvgInsertColRight,
79
- insert_row_above: SvgInsertRowAbove,
80
- insert_row_below: SvgInsertRowBelow,
81
- link: SvgLink,
82
- link_off: SvgLinkOff,
83
- markdown: SvgMarkdown,
84
- more_horiz: SvgMoreHoriz,
85
- more_vert: SvgMoreVert,
86
- open_in_new: SvgOpenInNew,
87
- redo: SvgRedo,
88
- rich_text: SvgRichText,
89
- settings: SvgSettings,
90
- strikeThrough: SvgStrikethroughS,
91
- subscript: SvgSubscript,
92
- superscript: SvgSuperscript,
93
- table: SvgTable,
94
- undo: SvgUndo
95
- };
96
- const Icon = ({ name }) => {
97
- const IconComponent = IconMap[name];
98
- return /* @__PURE__ */ React__default.createElement(IconComponent, null);
99
- };
100
- export {
101
- Icon as default
102
- };