@ctzhian/tiptap 1.6.2 → 1.6.4

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 (33) hide show
  1. package/dist/Editor/demo.js +6 -47
  2. package/dist/EditorToolbar/index.js +74 -103
  3. package/dist/component/CustomDragHandle/index.js +57 -47
  4. package/dist/component/Icons/add-circle-fill-icon.d.ts +6 -0
  5. package/dist/component/Icons/add-circle-fill-icon.js +13 -0
  6. package/dist/component/Icons/command-line-icon.d.ts +6 -0
  7. package/dist/component/Icons/command-line-icon.js +13 -0
  8. package/dist/component/Icons/eraser-line-icon.d.ts +6 -0
  9. package/dist/component/Icons/eraser-line-icon.js +13 -0
  10. package/dist/component/Icons/folder-2-line-icon.d.ts +6 -0
  11. package/dist/component/Icons/folder-2-line-icon.js +13 -0
  12. package/dist/component/Icons/index.d.ts +5 -0
  13. package/dist/component/Icons/index.js +5 -0
  14. package/dist/component/Icons/keyboard-line-icon.d.ts +6 -0
  15. package/dist/component/Icons/keyboard-line-icon.js +13 -0
  16. package/dist/component/Menu/NestedList.d.ts +1 -0
  17. package/dist/component/Menu/NestedList.js +11 -5
  18. package/dist/component/Menu/index.js +4 -1
  19. package/dist/component/Toolbar/EditorHeading.js +67 -79
  20. package/dist/component/Toolbar/EditorInsert/index.d.ts +2 -2
  21. package/dist/component/Toolbar/EditorInsert/index.js +414 -178
  22. package/dist/component/Toolbar/EditorMore/index.js +2 -2
  23. package/dist/component/Toolbar/Item.d.ts +1 -1
  24. package/dist/contants/slash-commands.d.ts +15 -2
  25. package/dist/contants/slash-commands.js +21 -6
  26. package/dist/extension/component/SlashCommandsList/index.js +45 -1
  27. package/dist/extension/index.js +1 -1
  28. package/dist/extension/suggestion/slash.d.ts +15 -2
  29. package/dist/type/index.d.ts +3 -0
  30. package/dist/util/shortcutKey.d.ts +1 -1
  31. package/dist/util/shortcutKey.js +2 -1
  32. package/package.json +1 -1
  33. /package/dist/types/{images.d.ts → declare.d.ts} +0 -0
@@ -0,0 +1,13 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ import { SvgIcon } from "@mui/material";
3
+ import * as React from "react";
4
+ export var Folder2LineIcon = function Folder2LineIcon(props) {
5
+ return /*#__PURE__*/React.createElement(SvgIcon, _extends({
6
+ viewBox: "0 0 24 24",
7
+ version: "1.1",
8
+ xmlns: "http://www.w3.org/2000/svg"
9
+ }, props), /*#__PURE__*/React.createElement("path", {
10
+ d: "M12.4142 5H21C21.5523 5 22 5.44772 22 6V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H10.4142L12.4142 5ZM20 11H4V19H20V11ZM20 9V7H11.5858L9.58579 5H4V9H20Z"
11
+ }));
12
+ };
13
+ Folder2LineIcon.displayName = 'icon-folder-2-line';
@@ -1,3 +1,4 @@
1
+ export { AddCircleFillIcon } from './add-circle-fill-icon';
1
2
  export { AddLineIcon } from './add-line-icon';
2
3
  export { AiGenerate2Icon } from './ai-generate-2-icon';
3
4
  export { AiGenerateTextIcon } from './ai-generate-text-icon';
@@ -27,6 +28,7 @@ export { CloseCircleFillIcon } from './close-circle-fill-icon';
27
28
  export { CodeBoxLineIcon } from './code-box-line-icon';
28
29
  export { CodeLineIcon } from './code-line-icon';
29
30
  export { CodeSSlashLineIcon } from './code-s-slash-line-icon';
31
+ export { CommandLineIcon } from './command-line-icon';
30
32
  export { CopyIcon } from './copy-icon';
31
33
  export { CustomSizeIcon } from './custom-size-icon';
32
34
  export { DeleteColumnIcon } from './delete-column-icon';
@@ -36,11 +38,13 @@ export { DoubleQuotesLIcon } from './double-quotes-l-icon';
36
38
  export { DownloadLineIcon } from './download-line-icon';
37
39
  export { DraggableIcon } from './draggable-icon';
38
40
  export { EditBoxLineIcon } from './edit-box-line-icon';
41
+ export { EraserLineIcon } from './eraser-line-icon';
39
42
  export { ErrorWarningFillIcon } from './error-warning-fill-icon';
40
43
  export { ExportLineIcon } from './export-line-icon';
41
44
  export { FileCopyLineIcon } from './file-copy-line-icon';
42
45
  export { FileUploadLineIcon } from './file-upload-line-icon';
43
46
  export { FlowChartIcon } from './flow-chart-icon';
47
+ export { Folder2LineIcon } from './folder-2-line-icon';
44
48
  export { FontColorIcon } from './font-color-icon';
45
49
  export { FontFamilyIcon } from './font-family-icon';
46
50
  export { FontSizeIcon } from './font-size-icon';
@@ -69,6 +73,7 @@ export { InsertColumnRightIcon } from './insert-column-right-icon';
69
73
  export { InsertRowBottomIcon } from './insert-row-bottom-icon';
70
74
  export { InsertRowTopIcon } from './insert-row-top-icon';
71
75
  export { ItalicIcon } from './italic-icon';
76
+ export { KeyboardLineIcon } from './keyboard-line-icon';
72
77
  export { LayoutLeft2LineIcon } from './layout-left-2-line-icon';
73
78
  export { LayoutTop2LineIcon } from './layout-top-2-line-icon';
74
79
  export { LinkIcon } from './link-icon';
@@ -1,6 +1,7 @@
1
1
  // 此文件由脚本自动生成
2
2
  // 导出所有图标组件
3
3
 
4
+ export { AddCircleFillIcon } from "./add-circle-fill-icon";
4
5
  export { AddLineIcon } from "./add-line-icon";
5
6
  export { AiGenerate2Icon } from "./ai-generate-2-icon";
6
7
  export { AiGenerateTextIcon } from "./ai-generate-text-icon";
@@ -30,6 +31,7 @@ export { CloseCircleFillIcon } from "./close-circle-fill-icon";
30
31
  export { CodeBoxLineIcon } from "./code-box-line-icon";
31
32
  export { CodeLineIcon } from "./code-line-icon";
32
33
  export { CodeSSlashLineIcon } from "./code-s-slash-line-icon";
34
+ export { CommandLineIcon } from "./command-line-icon";
33
35
  export { CopyIcon } from "./copy-icon";
34
36
  export { CustomSizeIcon } from "./custom-size-icon";
35
37
  export { DeleteColumnIcon } from "./delete-column-icon";
@@ -39,11 +41,13 @@ export { DoubleQuotesLIcon } from "./double-quotes-l-icon";
39
41
  export { DownloadLineIcon } from "./download-line-icon";
40
42
  export { DraggableIcon } from "./draggable-icon";
41
43
  export { EditBoxLineIcon } from "./edit-box-line-icon";
44
+ export { EraserLineIcon } from "./eraser-line-icon";
42
45
  export { ErrorWarningFillIcon } from "./error-warning-fill-icon";
43
46
  export { ExportLineIcon } from "./export-line-icon";
44
47
  export { FileCopyLineIcon } from "./file-copy-line-icon";
45
48
  export { FileUploadLineIcon } from "./file-upload-line-icon";
46
49
  export { FlowChartIcon } from "./flow-chart-icon";
50
+ export { Folder2LineIcon } from "./folder-2-line-icon";
47
51
  export { FontColorIcon } from "./font-color-icon";
48
52
  export { FontFamilyIcon } from "./font-family-icon";
49
53
  export { FontSizeIcon } from "./font-size-icon";
@@ -72,6 +76,7 @@ export { InsertColumnRightIcon } from "./insert-column-right-icon";
72
76
  export { InsertRowBottomIcon } from "./insert-row-bottom-icon";
73
77
  export { InsertRowTopIcon } from "./insert-row-top-icon";
74
78
  export { ItalicIcon } from "./italic-icon";
79
+ export { KeyboardLineIcon } from "./keyboard-line-icon";
75
80
  export { LayoutLeft2LineIcon } from "./layout-left-2-line-icon";
76
81
  export { LayoutTop2LineIcon } from "./layout-top-2-line-icon";
77
82
  export { LinkIcon } from "./link-icon";
@@ -0,0 +1,6 @@
1
+ import { SvgIconProps } from "@mui/material";
2
+ import * as React from "react";
3
+ export declare const KeyboardLineIcon: {
4
+ (props: SvgIconProps): React.JSX.Element;
5
+ displayName: string;
6
+ };
@@ -0,0 +1,13 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ import { SvgIcon } from "@mui/material";
3
+ import * as React from "react";
4
+ export var KeyboardLineIcon = function KeyboardLineIcon(props) {
5
+ return /*#__PURE__*/React.createElement(SvgIcon, _extends({
6
+ viewBox: "0 0 24 24",
7
+ version: "1.1",
8
+ xmlns: "http://www.w3.org/2000/svg"
9
+ }, props), /*#__PURE__*/React.createElement("path", {
10
+ d: "M3 17H21V19H3V17ZM3 11H6V14H3V11ZM8 11H11V14H8V11ZM3 5H6V8H3V5ZM13 5H16V8H13V5ZM18 5H21V8H18V5ZM13 11H16V14H13V11ZM18 11H21V14H18V11ZM8 5H11V8H8V5Z"
11
+ }));
12
+ };
13
+ KeyboardLineIcon.displayName = 'icon-keyboard-line';
@@ -3,6 +3,7 @@ import { PopoverOrigin } from '@mui/material';
3
3
  import React from 'react';
4
4
  export interface NestedMenuListProps {
5
5
  list: MenuItem[];
6
+ width?: number;
6
7
  arrowIcon?: React.ReactNode;
7
8
  childrenProps?: {
8
9
  anchorOrigin?: PopoverOrigin;
@@ -15,6 +15,7 @@ import { Box, Popover, Stack } from '@mui/material';
15
15
  import React from 'react';
16
16
  var NestedList = function NestedList(_ref) {
17
17
  var list = _ref.list,
18
+ width = _ref.width,
18
19
  arrowIcon = _ref.arrowIcon,
19
20
  _ref$childrenProps = _ref.childrenProps,
20
21
  childrenProps = _ref$childrenProps === void 0 ? {
@@ -56,10 +57,12 @@ var NestedList = function NestedList(_ref) {
56
57
  };
57
58
  return /*#__PURE__*/React.createElement(Box, {
58
59
  className: "menu-select-list",
59
- sx: {
60
+ sx: _objectSpread({
60
61
  minWidth: 160,
61
62
  lineHeight: 1.625
62
- }
63
+ }, width ? {
64
+ width: width
65
+ } : {})
63
66
  }, list.map(function (item) {
64
67
  var _item$children2;
65
68
  return item.customLabel ? /*#__PURE__*/React.createElement(Box, {
@@ -101,16 +104,19 @@ var NestedList = function NestedList(_ref) {
101
104
  onClose: handleItemLeave,
102
105
  sx: {
103
106
  pointerEvents: 'none'
104
- }
107
+ },
108
+ disableScrollLock: true
105
109
  }, childrenProps), /*#__PURE__*/React.createElement(Box, {
106
110
  className: "menu-select-sub-list",
107
- sx: _objectSpread(_objectSpread({
111
+ sx: _objectSpread(_objectSpread(_objectSpread({
108
112
  pointerEvents: 'auto',
109
113
  p: 0.5,
110
114
  minWidth: 160,
111
115
  maxHeight: 360,
112
116
  overflow: 'auto'
113
- }, item.minWidth ? {
117
+ }, item.width ? {
118
+ width: item.width
119
+ } : {}), item.minWidth ? {
114
120
  minWidth: item.minWidth
115
121
  } : {}), item.maxHeight ? {
116
122
  maxHeight: item.maxHeight
@@ -10,6 +10,7 @@ import NestedList from "./NestedList";
10
10
  var Menu = function Menu(_ref) {
11
11
  var _ref$id = _ref.id,
12
12
  id = _ref$id === void 0 ? 'menu-select' : _ref$id,
13
+ width = _ref.width,
13
14
  arrowIcon = _ref.arrowIcon,
14
15
  list = _ref.list,
15
16
  _ref$header = _ref.header,
@@ -67,7 +68,8 @@ var Menu = function Menu(_ref) {
67
68
  anchorEl: anchorEl,
68
69
  onClose: handleClose,
69
70
  anchorOrigin: anchorOrigin,
70
- transformOrigin: transformOrigin
71
+ transformOrigin: transformOrigin,
72
+ disableScrollLock: true
71
73
  }, /*#__PURE__*/React.createElement(Box, {
72
74
  sx: {
73
75
  p: 0.5
@@ -75,6 +77,7 @@ var Menu = function Menu(_ref) {
75
77
  }, /*#__PURE__*/React.createElement(Box, {
76
78
  onClick: handleClose
77
79
  }, header), /*#__PURE__*/React.createElement(NestedList, {
80
+ width: width,
78
81
  list: list,
79
82
  arrowIcon: arrowIcon,
80
83
  childrenProps: childrenProps,
@@ -1,7 +1,7 @@
1
- var _excluded = ["className"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
6
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
7
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -9,10 +9,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
9
9
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import { getShortcutKeyText } from "../../util";
12
- import { Box, MenuItem, Select, Stack, Tooltip } from "@mui/material";
12
+ import { Box, Typography } from "@mui/material";
13
13
  import React, { useEffect, useState } from "react";
14
- import { ArrowDownSLineIcon, H1Icon, H2Icon, H3Icon, H4Icon, H5Icon, H6Icon, HeadingIcon } from "../Icons";
15
- import ToolItem from "./Item";
14
+ import { ArrowDownSLineIcon, H1Icon, H2Icon, H3Icon, H4Icon, H5Icon, H6Icon, TextIcon } from "../Icons";
15
+ import Menu from "../Menu";
16
+ import { default as ToolbarItem } from "./Item";
16
17
  var EditorHeading = function EditorHeading(_ref) {
17
18
  var editor = _ref.editor;
18
19
  var _useState = useState("paragraph"),
@@ -21,12 +22,12 @@ var EditorHeading = function EditorHeading(_ref) {
21
22
  setSelectedValue = _useState2[1];
22
23
  var HeadingOptions = [{
23
24
  id: 'paragraph',
24
- icon: /*#__PURE__*/React.createElement(HeadingIcon, {
25
+ icon: /*#__PURE__*/React.createElement(TextIcon, {
25
26
  sx: {
26
27
  fontSize: '1rem'
27
28
  }
28
29
  }),
29
- label: 'Paragraph',
30
+ label: '正文',
30
31
  shortcutKey: ['ctrl', 'alt', '0']
31
32
  }, {
32
33
  id: '1',
@@ -35,7 +36,7 @@ var EditorHeading = function EditorHeading(_ref) {
35
36
  fontSize: '1rem'
36
37
  }
37
38
  }),
38
- label: 'Heading 1',
39
+ label: '标题1',
39
40
  shortcutKey: ['ctrl', 'alt', '1']
40
41
  }, {
41
42
  id: '2',
@@ -44,7 +45,7 @@ var EditorHeading = function EditorHeading(_ref) {
44
45
  fontSize: '1rem'
45
46
  }
46
47
  }),
47
- label: 'Heading 2',
48
+ label: '标题2',
48
49
  shortcutKey: ['ctrl', 'alt', '2']
49
50
  }, {
50
51
  id: '3',
@@ -53,7 +54,7 @@ var EditorHeading = function EditorHeading(_ref) {
53
54
  fontSize: '1rem'
54
55
  }
55
56
  }),
56
- label: 'Heading 3',
57
+ label: '标题3',
57
58
  shortcutKey: ['ctrl', 'alt', '3']
58
59
  }, {
59
60
  id: '4',
@@ -62,7 +63,7 @@ var EditorHeading = function EditorHeading(_ref) {
62
63
  fontSize: '1rem'
63
64
  }
64
65
  }),
65
- label: 'Heading 4',
66
+ label: '标题4',
66
67
  shortcutKey: ['ctrl', 'alt', '4']
67
68
  }, {
68
69
  id: '5',
@@ -71,7 +72,7 @@ var EditorHeading = function EditorHeading(_ref) {
71
72
  fontSize: '1rem'
72
73
  }
73
74
  }),
74
- label: 'Heading 5',
75
+ label: '标题5',
75
76
  shortcutKey: ['ctrl', 'alt', '5']
76
77
  }, {
77
78
  id: '6',
@@ -80,15 +81,14 @@ var EditorHeading = function EditorHeading(_ref) {
80
81
  fontSize: '1rem'
81
82
  }
82
83
  }),
83
- label: 'Heading 6',
84
+ label: '标题6',
84
85
  shortcutKey: ['ctrl', 'alt', '6']
85
86
  }];
86
87
  var updateSelection = function updateSelection() {
87
88
  var level = editor.getAttributes("heading").level || "paragraph";
88
89
  setSelectedValue(level);
89
90
  };
90
- var handleChange = function handleChange(e) {
91
- var value = e.target.value;
91
+ var handleChange = function handleChange(value) {
92
92
  setSelectedValue(value);
93
93
  if (value !== 'paragraph') {
94
94
  var level = parseInt(value);
@@ -107,79 +107,67 @@ var EditorHeading = function EditorHeading(_ref) {
107
107
  editor.off('transaction', updateSelection);
108
108
  };
109
109
  }, [editor]);
110
- return /*#__PURE__*/React.createElement(Select, {
111
- value: selectedValue,
112
- className: ['1', '2', '3', '4', '5', '6'].includes(String(selectedValue)) ? "tool-active" : "",
113
- onChange: handleChange,
114
- sx: {
115
- bgcolor: 'transparent',
116
- '&:hover .MuiOutlinedInput-notchedOutline': {
117
- borderWidth: '0px !important',
118
- borderColor: 'transparent !important'
119
- },
120
- '&.Mui-focused .MuiOutlinedInput-notchedOutline': {
121
- borderWidth: '0px !important',
122
- borderColor: 'transparent !important'
123
- }
124
- },
125
- renderValue: function renderValue(value) {
126
- var _HeadingOptions$find;
127
- return /*#__PURE__*/React.createElement(ToolItem, {
128
- tip: '标题',
129
- icon: /*#__PURE__*/React.createElement(Stack, {
130
- direction: 'row',
131
- alignItems: 'center',
132
- sx: {
133
- mr: 0.5,
134
- width: '1.5rem'
135
- }
136
- }, ((_HeadingOptions$find = HeadingOptions.find(function (it) {
137
- return it.id === String(value);
138
- })) === null || _HeadingOptions$find === void 0 ? void 0 : _HeadingOptions$find.icon) || /*#__PURE__*/React.createElement(HeadingIcon, {
139
- sx: {
140
- fontSize: '1rem'
141
- }
142
- }))
143
- });
144
- },
145
- IconComponent: function IconComponent(_ref2) {
146
- var className = _ref2.className,
147
- rest = _objectWithoutProperties(_ref2, _excluded);
148
- return /*#__PURE__*/React.createElement(ArrowDownSLineIcon, _extends({
110
+ return /*#__PURE__*/React.createElement(Menu, {
111
+ context: /*#__PURE__*/React.createElement(ToolbarItem, {
112
+ tip: '标题',
113
+ text: /*#__PURE__*/React.createElement(Box, {
114
+ sx: {
115
+ position: 'relative',
116
+ pr: 1
117
+ }
118
+ }, /*#__PURE__*/React.createElement(Box, {
119
+ sx: {
120
+ width: '38px',
121
+ textAlign: 'left'
122
+ }
123
+ }, HeadingOptions.filter(function (it) {
124
+ return it.id === String(selectedValue);
125
+ })[0].label), /*#__PURE__*/React.createElement(ArrowDownSLineIcon, {
149
126
  sx: {
150
127
  position: 'absolute',
151
- right: 2,
128
+ right: -6,
129
+ top: '50%',
130
+ transform: 'translateY(-50%)',
152
131
  flexSelf: 'center',
153
132
  fontSize: '1rem',
154
133
  flexShrink: 0,
155
134
  mr: 0,
156
135
  color: 'text.disabled',
157
- transform: className !== null && className !== void 0 && className.includes('MuiSelect-iconOpen') ? 'rotate(-180deg)' : 'none',
158
- transition: 'transform 0.3s',
159
136
  cursor: 'pointer',
160
137
  pointerEvents: 'none'
161
138
  }
162
- }, rest));
163
- }
164
- }, HeadingOptions.map(function (it) {
165
- return /*#__PURE__*/React.createElement(MenuItem, {
166
- key: it.id,
167
- value: it.id
168
- }, /*#__PURE__*/React.createElement(Tooltip, {
169
- arrow: true,
170
- title: getShortcutKeyText(it.shortcutKey),
171
- placement: "right"
172
- }, /*#__PURE__*/React.createElement(Stack, {
173
- direction: 'row',
174
- alignItems: 'center',
175
- justifyContent: "center",
176
- gap: 1
177
- }, it.icon, /*#__PURE__*/React.createElement(Box, {
139
+ }))
140
+ }),
141
+ anchorOrigin: {
142
+ vertical: 'bottom',
143
+ horizontal: 'left'
144
+ },
145
+ transformOrigin: {
146
+ vertical: 'top',
147
+ horizontal: 'left'
148
+ },
149
+ arrowIcon: /*#__PURE__*/React.createElement(ArrowDownSLineIcon, {
178
150
  sx: {
179
- ml: 1,
180
- fontSize: '0.875rem'
151
+ fontSize: '1rem',
152
+ transform: 'rotate(-90deg)'
181
153
  }
182
- }, it.label))));
183
- }));
154
+ }),
155
+ list: _toConsumableArray(HeadingOptions.map(function (it) {
156
+ return {
157
+ label: it.label,
158
+ key: it.id,
159
+ icon: it.icon,
160
+ extra: /*#__PURE__*/React.createElement(Typography, {
161
+ sx: {
162
+ fontSize: '12px',
163
+ color: 'text.disabled'
164
+ }
165
+ }, getShortcutKeyText(it.shortcutKey, '+')),
166
+ onClick: function onClick() {
167
+ return handleChange(it.id);
168
+ }
169
+ };
170
+ }))
171
+ });
184
172
  };
185
173
  export default EditorHeading;
@@ -1,5 +1,5 @@
1
- import { Editor } from "@tiptap/react";
2
- import React from "react";
1
+ import { Editor } from '@tiptap/react';
2
+ import React from 'react';
3
3
  interface EditorInsertProps {
4
4
  editor: Editor;
5
5
  }