@ctzhian/tiptap 0.4.0 → 0.5.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 (88) hide show
  1. package/dist/Editor/demo.js +9 -6
  2. package/dist/asset/css/index.css +1 -2
  3. package/dist/component/CustomBubbleMenu/SelectionText.d.ts +1 -1
  4. package/dist/component/CustomBubbleMenu/SelectionText.js +11 -6
  5. package/dist/component/CustomDragHandle/index.d.ts +1 -1
  6. package/dist/component/CustomDragHandle/index.js +26 -2
  7. package/dist/component/Icons/checkbox-circle-fill-icon.d.ts +6 -0
  8. package/dist/component/Icons/checkbox-circle-fill-icon.js +13 -0
  9. package/dist/component/Icons/close-circle-fill-icon.d.ts +6 -0
  10. package/dist/component/Icons/close-circle-fill-icon.js +13 -0
  11. package/dist/component/Icons/error-warning-fill-icon.d.ts +6 -0
  12. package/dist/component/Icons/error-warning-fill-icon.js +13 -0
  13. package/dist/component/Icons/index.d.ts +5 -0
  14. package/dist/component/Icons/index.js +5 -0
  15. package/dist/component/Icons/information-2-fill-icon.d.ts +6 -0
  16. package/dist/component/Icons/information-2-fill-icon.js +13 -0
  17. package/dist/component/Icons/question-fill-icon.d.ts +6 -0
  18. package/dist/component/Icons/question-fill-icon.js +13 -0
  19. package/dist/component/ListHover/index.js +1 -1
  20. package/dist/component/Toolbar/EditorAlignSelect.js +1 -1
  21. package/dist/component/Toolbar/EditorCode.js +1 -1
  22. package/dist/component/Toolbar/EditorHeading.js +1 -1
  23. package/dist/component/Toolbar/EditorInsert/index.js +1 -1
  24. package/dist/component/Toolbar/EditorListSelect.js +1 -1
  25. package/dist/component/Toolbar/EditorMath.js +1 -1
  26. package/dist/component/Toolbar/EditorMore/NotificationDialog.js +1 -1
  27. package/dist/component/Toolbar/EditorMore/index.js +1 -1
  28. package/dist/component/Toolbar/EditorScript.js +1 -1
  29. package/dist/component/Toolbar/EditorVerticalAlignSelect.js +1 -1
  30. package/dist/component/Toolbar/Item.js +1 -1
  31. package/dist/extension/component/Alert/index.d.ts +11 -0
  32. package/dist/extension/component/Alert/index.js +125 -0
  33. package/dist/extension/component/Attachment/Insert.d.ts +1 -1
  34. package/dist/extension/component/Attachment/Insert.js +6 -6
  35. package/dist/extension/component/Attachment/Readonly.js +5 -5
  36. package/dist/extension/component/Attachment/index.d.ts +1 -1
  37. package/dist/extension/component/Attachment/index.js +5 -5
  38. package/dist/extension/component/Audio/Insert.js +2 -2
  39. package/dist/extension/component/Audio/Readonly.js +2 -2
  40. package/dist/extension/component/Audio/index.d.ts +1 -1
  41. package/dist/extension/component/Audio/index.js +2 -2
  42. package/dist/extension/component/CodeBlock/Readonly.js +8 -10
  43. package/dist/extension/component/CodeBlock/index.js +14 -19
  44. package/dist/extension/component/Image/Insert.js +2 -2
  45. package/dist/extension/component/Image/index.d.ts +1 -1
  46. package/dist/extension/component/Image/index.js +2 -2
  47. package/dist/extension/component/Link/Insert.js +2 -2
  48. package/dist/extension/component/Link/Readonly.js +20 -11
  49. package/dist/extension/component/Link/index.js +7 -5
  50. package/dist/extension/component/Mathematics/block/index.d.ts +1 -1
  51. package/dist/extension/component/Mathematics/block/index.js +2 -2
  52. package/dist/extension/component/Mathematics/inline/index.d.ts +1 -1
  53. package/dist/extension/component/Mathematics/inline/index.js +2 -2
  54. package/dist/extension/component/Table/ContextMenu.js +1 -1
  55. package/dist/extension/component/UploadProgress/index.js +1 -1
  56. package/dist/extension/component/Video/Insert.js +2 -2
  57. package/dist/extension/component/Video/index.d.ts +1 -1
  58. package/dist/extension/component/Video/index.js +1 -1
  59. package/dist/extension/index.js +2 -2
  60. package/dist/extension/node/Alert.d.ts +14 -0
  61. package/dist/extension/node/Alert.js +141 -0
  62. package/dist/extension/node/Attachment.d.ts +1 -1
  63. package/dist/extension/node/Audio.d.ts +1 -1
  64. package/dist/extension/node/CodeBlockLowlight.js +6 -4
  65. package/dist/extension/node/FileHandler.js +1 -1
  66. package/dist/extension/node/Link/index.js +1 -1
  67. package/dist/extension/node/Video.d.ts +1 -1
  68. package/dist/extension/node/index.d.ts +1 -0
  69. package/dist/extension/node/index.js +1 -0
  70. package/dist/extension/suggestion/emoji.js +1 -1
  71. package/dist/extension/suggestion/mention.d.ts +1 -1
  72. package/dist/extension/suggestion/mention.js +1 -1
  73. package/dist/extension/suggestion/slash.js +1 -1
  74. package/dist/hook/index.d.ts +1 -1
  75. package/dist/hook/index.js +2 -2
  76. package/dist/index.css +197 -69
  77. package/dist/themes/componentStyleOverrides.d.ts +0 -31
  78. package/dist/themes/componentStyleOverrides.js +0 -39
  79. package/dist/themes/dark.d.ts +2 -4
  80. package/dist/themes/dark.js +7 -9
  81. package/dist/themes/index.d.ts +1 -1
  82. package/dist/themes/light.d.ts +3 -5
  83. package/dist/themes/light.js +7 -9
  84. package/dist/themes/palette.d.ts +3 -5
  85. package/dist/util/resourceExtractor.d.ts +1 -1
  86. package/dist/util/resourceExtractor.js +0 -1
  87. package/package.json +30 -30
  88. package/dist/asset/images/down.svg +0 -3
@@ -0,0 +1,125 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { Box, Typography, useTheme } from '@mui/material';
8
+ import { NodeViewContent, NodeViewWrapper } from '@tiptap/react';
9
+ import React from 'react';
10
+ import { CheckboxCircleFillIcon, CloseCircleFillIcon, ErrorWarningFillIcon, Information2FillIcon } from "../../../component/Icons";
11
+ var AlertViewWrapper = function AlertViewWrapper(_ref) {
12
+ var node = _ref.node,
13
+ updateAttributes = _ref.updateAttributes,
14
+ selected = _ref.selected,
15
+ editor = _ref.editor,
16
+ onUpload = _ref.onUpload,
17
+ onError = _ref.onError;
18
+ var theme = useTheme();
19
+ var _ref2 = node.attrs,
20
+ _ref2$type = _ref2.type,
21
+ type = _ref2$type === void 0 ? 'info' : _ref2$type,
22
+ _ref2$title = _ref2.title,
23
+ title = _ref2$title === void 0 ? '' : _ref2$title;
24
+
25
+ // 根据类型获取颜色和图标
26
+ var getAlertConfig = function getAlertConfig(alertType) {
27
+ switch (alertType) {
28
+ case 'success':
29
+ return {
30
+ color: theme.palette.success.main,
31
+ backgroundColor: "".concat(theme.palette.success.main, "10"),
32
+ // 10% 透明度
33
+ icon: CheckboxCircleFillIcon
34
+ };
35
+ case 'warning':
36
+ return {
37
+ color: theme.palette.warning.main,
38
+ backgroundColor: "".concat(theme.palette.warning.main, "10"),
39
+ icon: ErrorWarningFillIcon
40
+ };
41
+ case 'error':
42
+ return {
43
+ color: theme.palette.error.main,
44
+ backgroundColor: "".concat(theme.palette.error.main, "10"),
45
+ icon: CloseCircleFillIcon
46
+ };
47
+ case 'info':
48
+ default:
49
+ return {
50
+ color: theme.palette.text.secondary,
51
+ backgroundColor: "".concat(theme.palette.text.secondary, "10"),
52
+ icon: Information2FillIcon
53
+ };
54
+ }
55
+ };
56
+ var config = getAlertConfig(type);
57
+ var IconComponent = config.icon;
58
+ return /*#__PURE__*/React.createElement(NodeViewWrapper, {
59
+ as: "div",
60
+ style: {
61
+ margin: '16px 0',
62
+ position: 'relative'
63
+ }
64
+ }, /*#__PURE__*/React.createElement(Box, {
65
+ sx: _objectSpread({
66
+ display: 'flex',
67
+ alignItems: 'flex-start',
68
+ padding: '12px 16px',
69
+ borderRadius: '8px',
70
+ border: "1px solid ".concat(config.color),
71
+ backgroundColor: config.backgroundColor,
72
+ position: 'relative'
73
+ }, selected && {
74
+ outline: "2px solid ".concat(theme.palette.primary.main),
75
+ outlineOffset: '2px'
76
+ })
77
+ }, /*#__PURE__*/React.createElement(Box, {
78
+ sx: {
79
+ display: 'flex',
80
+ alignItems: 'center',
81
+ marginRight: '12px',
82
+ marginTop: '2px',
83
+ flexShrink: 0
84
+ }
85
+ }, /*#__PURE__*/React.createElement(IconComponent, {
86
+ style: {
87
+ fontSize: '20px',
88
+ color: config.color
89
+ }
90
+ })), /*#__PURE__*/React.createElement(Box, {
91
+ sx: {
92
+ flex: 1,
93
+ minWidth: 0
94
+ }
95
+ }, title && /*#__PURE__*/React.createElement(Typography, {
96
+ variant: "subtitle2",
97
+ sx: {
98
+ color: config.color,
99
+ fontWeight: 600,
100
+ marginBottom: '4px',
101
+ fontSize: '14px',
102
+ lineHeight: '20px'
103
+ }
104
+ }, title), /*#__PURE__*/React.createElement(Box, {
105
+ sx: {
106
+ color: theme.palette.text.primary,
107
+ fontSize: '14px',
108
+ lineHeight: '20px',
109
+ '& p': {
110
+ margin: 0,
111
+ '&:not(:last-child)': {
112
+ marginBottom: '8px'
113
+ }
114
+ },
115
+ '& ul, & ol': {
116
+ margin: 0,
117
+ paddingLeft: '20px'
118
+ },
119
+ '& li': {
120
+ marginBottom: '4px'
121
+ }
122
+ }
123
+ }, /*#__PURE__*/React.createElement(NodeViewContent, null)))));
124
+ };
125
+ export default AlertViewWrapper;
@@ -1,5 +1,5 @@
1
- import { Editor } from "@tiptap/core";
2
1
  import { EditorFnProps } from "../../../type";
2
+ import { Editor } from "@tiptap/core";
3
3
  import React from "react";
4
4
  import { AttachmentAttributes } from ".";
5
5
  type InsertAttachmentProps = {
@@ -13,10 +13,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
13
13
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
14
  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; } }
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
- import { Box, CircularProgress } from "@mui/material";
17
- import { NodeViewWrapper } from "@tiptap/react";
18
16
  import { Attachment2Icon } from "../../../component/Icons";
19
17
  import { insertNodeAfterPosition } from "../../../util";
18
+ import { Box, CircularProgress } from "@mui/material";
19
+ import { NodeViewWrapper } from "@tiptap/react";
20
20
  import React, { useEffect, useRef, useState } from "react";
21
21
  var InsertAttachment = function InsertAttachment(_ref) {
22
22
  var editor = _ref.editor,
@@ -78,10 +78,10 @@ var InsertAttachment = function InsertAttachment(_ref) {
78
78
  case 10:
79
79
  result = _context.sent;
80
80
  insertNodeAfterPosition(editor, from, {
81
- type: 'inlineAttachment',
81
+ type: 'blockAttachment',
82
82
  attrs: {
83
83
  url: result || '',
84
- type: 'icon',
84
+ type: 'block',
85
85
  size: fileSize,
86
86
  title: file.name
87
87
  }
@@ -95,10 +95,10 @@ var InsertAttachment = function InsertAttachment(_ref) {
95
95
  _context.prev = 15;
96
96
  _context.t0 = _context["catch"](7);
97
97
  insertNodeAfterPosition(editor, from, {
98
- type: 'inlineAttachment',
98
+ type: 'blockAttachment',
99
99
  attrs: {
100
100
  url: 'error',
101
- type: 'icon',
101
+ type: 'block',
102
102
  size: fileSize,
103
103
  title: _context.t0 instanceof Error ? _context.t0.message : '上传失败'
104
104
  }
@@ -1,6 +1,6 @@
1
+ import { Attachment2Icon } from "../../../component/Icons";
1
2
  import { Box, Stack } from "@mui/material";
2
3
  import { NodeViewWrapper } from "@tiptap/react";
3
- import { Attachment2Icon } from "../../../component/Icons";
4
4
  import React from "react";
5
5
  var ReadonlyAttachment = function ReadonlyAttachment(_ref) {
6
6
  var attrs = _ref.attrs,
@@ -15,7 +15,7 @@ var ReadonlyAttachment = function ReadonlyAttachment(_ref) {
15
15
  target: "_blank",
16
16
  download: attrs.title,
17
17
  sx: {
18
- textDecoration: 'none',
18
+ textDecoration: 'none !important',
19
19
  color: 'inherit'
20
20
  }
21
21
  }, type === 'block' ? /*#__PURE__*/React.createElement(Stack, {
@@ -30,7 +30,8 @@ var ReadonlyAttachment = function ReadonlyAttachment(_ref) {
30
30
  bgcolor: 'background.paper',
31
31
  p: 2,
32
32
  ':hover': {
33
- borderColor: attrs.url === 'error' ? 'error.main' : 'primary.main'
33
+ borderColor: attrs.url === 'error' ? 'error.main' : 'primary.main',
34
+ color: attrs.url === 'error' ? 'error.main' : 'primary.main'
34
35
  }
35
36
  }
36
37
  }, /*#__PURE__*/React.createElement(Attachment2Icon, {
@@ -51,8 +52,7 @@ var ReadonlyAttachment = function ReadonlyAttachment(_ref) {
51
52
  }, /*#__PURE__*/React.createElement(Box, {
52
53
  sx: {
53
54
  fontSize: '0.875rem',
54
- fontWeight: 'bold',
55
- color: attrs.url === 'error' ? 'error.main' : 'inherit'
55
+ fontWeight: 'bold'
56
56
  }
57
57
  }, attrs.title), /*#__PURE__*/React.createElement(Box, {
58
58
  sx: {
@@ -1,5 +1,5 @@
1
- import { NodeViewProps } from "@tiptap/react";
2
1
  import { EditorFnProps } from "../../../type";
2
+ import { NodeViewProps } from "@tiptap/react";
3
3
  import React from "react";
4
4
  export interface AttachmentAttributes {
5
5
  url: string;
@@ -4,11 +4,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { Box, Button, Divider, Stack, TextField } from "@mui/material";
8
- import { NodeViewWrapper } from "@tiptap/react";
9
7
  import { FloatingPopover } from "../../../component";
10
8
  import { Attachment2Icon, CarouselViewIcon, DeleteLineIcon, DownloadLineIcon, EditBoxLineIcon, ScrollToBottomLineIcon } from "../../../component/Icons";
11
9
  import { ToolbarItem } from "../../../component/Toolbar";
10
+ import { Box, Button, Divider, Stack, TextField } from "@mui/material";
11
+ import { NodeViewWrapper } from "@tiptap/react";
12
12
  import React, { useEffect, useState } from "react";
13
13
  import InsertAttachment from "./Insert";
14
14
  import ReadonlyAttachment from "./Readonly";
@@ -116,7 +116,8 @@ var AttachmentViewWrapper = function AttachmentViewWrapper(_ref) {
116
116
  bgcolor: 'background.paper',
117
117
  p: 2,
118
118
  ':hover': {
119
- borderColor: attrs.url === 'error' ? 'error.main' : 'primary.main'
119
+ borderColor: attrs.url === 'error' ? 'error.main' : 'primary.main',
120
+ color: attrs.url === 'error' ? 'error.main' : 'primary.main'
120
121
  }
121
122
  }
122
123
  }, /*#__PURE__*/React.createElement(Attachment2Icon, {
@@ -137,8 +138,7 @@ var AttachmentViewWrapper = function AttachmentViewWrapper(_ref) {
137
138
  }, /*#__PURE__*/React.createElement(Box, {
138
139
  sx: {
139
140
  fontSize: '0.875rem',
140
- fontWeight: 'bold',
141
- color: attrs.url === 'error' ? 'error.main' : 'inherit'
141
+ fontWeight: 'bold'
142
142
  }
143
143
  }, attrs.title), /*#__PURE__*/React.createElement(Box, {
144
144
  sx: {
@@ -13,10 +13,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
13
13
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
14
  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; } }
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
- import { Box, Button, CircularProgress, IconButton, Stack, Tab, Tabs, TextField } from "@mui/material";
17
- import { NodeViewWrapper } from "@tiptap/react";
18
16
  import { FloatingPopover } from "../../../component/FloatingPopover";
19
17
  import { Attachment2Icon, UploadCloud2LineIcon } from "../../../component/Icons";
18
+ import { Box, Button, CircularProgress, IconButton, Stack, Tab, Tabs, TextField } from "@mui/material";
19
+ import { NodeViewWrapper } from "@tiptap/react";
20
20
  import React, { useState } from "react";
21
21
  var InsertAudio = function InsertAudio(_ref) {
22
22
  var selected = _ref.selected,
@@ -10,10 +10,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  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; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { Box, IconButton, MenuItem, MenuList, Paper, Slider, Stack, Typography } from "@mui/material";
14
- import { NodeViewWrapper } from "@tiptap/react";
15
13
  import { FloatingPopover } from "../../../component";
16
14
  import { DownloadLineIcon, PauseLineIcon, PlayLineIcon, SpeedLineIcon, VolumeMuteLineIcon, VolumeUpLineIcon } from "../../../component/Icons";
15
+ import { Box, IconButton, MenuItem, MenuList, Paper, Slider, Stack, Typography } from "@mui/material";
16
+ import { NodeViewWrapper } from "@tiptap/react";
17
17
  import React, { useEffect, useRef, useState } from "react";
18
18
  import Disk from "../../../asset/images/disk.png";
19
19
  var ReadonlyAudio = function ReadonlyAudio(_ref) {
@@ -1,5 +1,5 @@
1
- import { NodeViewProps } from '@tiptap/react';
2
1
  import { EditorFnProps } from "../../../type";
2
+ import { NodeViewProps } from '@tiptap/react';
3
3
  import React from "react";
4
4
  export interface AudioAttributes {
5
5
  src: string;
@@ -13,10 +13,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
13
13
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
14
  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; } }
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
- import { Box, Button, CircularProgress, IconButton, MenuItem, MenuList, Paper, Slider, Stack, TextField, Tooltip, Typography } from "@mui/material";
17
- import { NodeViewWrapper } from '@tiptap/react';
18
16
  import { FloatingPopover } from "../../../component";
19
17
  import { DeleteLineIcon, DownloadLineIcon, EditBoxLineIcon, PauseLineIcon, PlayLineIcon, SpeedLineIcon, UploadCloud2LineIcon, VolumeMuteLineIcon, VolumeUpLineIcon } from "../../../component/Icons";
18
+ import { Box, Button, CircularProgress, IconButton, MenuItem, MenuList, Paper, Slider, Stack, TextField, Tooltip, Typography } from "@mui/material";
19
+ import { NodeViewWrapper } from '@tiptap/react';
20
20
  import React, { useEffect, useRef, useState } from "react";
21
21
  import Disk from "../../../asset/images/disk.png";
22
22
  import InsertAudio from "./Insert";
@@ -8,9 +8,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
8
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
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
+ import { FileCopyLineIcon } from "../../../component/Icons";
11
12
  import { Box, Stack } from '@mui/material';
12
13
  import { NodeViewContent, NodeViewWrapper } from '@tiptap/react';
13
- import { CopyIcon } from "../../../component/Icons";
14
14
  import React, { useCallback, useState } from 'react';
15
15
  var ReadonlyCodeBlock = function ReadonlyCodeBlock(_ref) {
16
16
  var node = _ref.node,
@@ -57,7 +57,7 @@ var ReadonlyCodeBlock = function ReadonlyCodeBlock(_ref) {
57
57
  };
58
58
  }(), [node]);
59
59
  return /*#__PURE__*/React.createElement(NodeViewWrapper, {
60
- className: "codeblock-wrapper ".concat(selected ? 'ProseMirror-selectednode' : ''),
60
+ className: "codeblock-wrapper",
61
61
  "data-drag-handle": true,
62
62
  onMouseEnter: function onMouseEnter() {
63
63
  return setIsHovering(true);
@@ -70,8 +70,7 @@ var ReadonlyCodeBlock = function ReadonlyCodeBlock(_ref) {
70
70
  sx: {
71
71
  p: '0.75rem 1rem',
72
72
  m: 0,
73
- borderRadius: 1,
74
- bgcolor: 'background.paper',
73
+ borderRadius: '6px',
75
74
  overflow: 'hidden',
76
75
  position: 'relative'
77
76
  }
@@ -98,14 +97,13 @@ var ReadonlyCodeBlock = function ReadonlyCodeBlock(_ref) {
98
97
  borderRadius: 'var(--mui-shape-borderRadius)',
99
98
  cursor: 'pointer',
100
99
  userSelect: 'none',
101
- '&:hover': {
102
- bgcolor: 'action.hover'
103
- }
100
+ bgcolor: 'inherit',
101
+ color: 'inherit'
104
102
  }
105
- }, /*#__PURE__*/React.createElement(CopyIcon, {
103
+ }, /*#__PURE__*/React.createElement(FileCopyLineIcon, {
106
104
  sx: {
107
105
  fontSize: '0.875rem',
108
- color: 'text.secondary'
106
+ color: 'inherit'
109
107
  }
110
108
  }), /*#__PURE__*/React.createElement(Box, {
111
109
  sx: {
@@ -127,7 +125,7 @@ var ReadonlyCodeBlock = function ReadonlyCodeBlock(_ref) {
127
125
  height: '1rem',
128
126
  lineHeight: 1,
129
127
  fontSize: '0.875rem',
130
- color: 'text.secondary',
128
+ color: 'inherit',
131
129
  letterSpacing: '0.01rem'
132
130
  }
133
131
  }, attrs.title));
@@ -12,10 +12,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
12
12
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
13
  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; } }
14
14
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+ import { ArrowDownSLineIcon, FileCopyLineIcon, TitleIcon } from "../../../component/Icons";
16
+ import { languages } from "../../../contants/highlight";
15
17
  import { Box, MenuItem, Select, Stack, TextField } from '@mui/material';
16
18
  import { NodeViewContent, NodeViewWrapper } from '@tiptap/react';
17
- import { ArrowDownSLineIcon, CopyIcon, TitleIcon } from "../../../component/Icons";
18
- import { languages } from "../../../contants/highlight";
19
19
  import React, { useCallback, useState } from 'react';
20
20
  import ReadonlyCodeBlock from "./Readonly";
21
21
  var CodeBlockView = function CodeBlockView(props) {
@@ -107,8 +107,7 @@ var CodeBlockView = function CodeBlockView(props) {
107
107
  sx: {
108
108
  p: '1.75rem 1rem 0.75rem',
109
109
  m: 0,
110
- borderRadius: showTitleInput ? 'var(--mui-shape-borderRadius) var(--mui-shape-borderRadius) 0 0 !important' : 'var(--mui-shape-borderRadius)',
111
- bgcolor: 'background.paper3',
110
+ borderRadius: showTitleInput ? '6px 6px 0 0 !important' : '6px',
112
111
  overflow: 'hidden'
113
112
  }
114
113
  }, /*#__PURE__*/React.createElement(Stack, {
@@ -136,17 +135,16 @@ var CodeBlockView = function CodeBlockView(props) {
136
135
  px: 0,
137
136
  height: '1.25rem',
138
137
  fontSize: '0.75rem',
139
- '&:hover': {
140
- bgcolor: 'action.hover'
141
- },
142
- '&:focus': {
143
- bgcolor: 'action.selected'
144
- },
138
+ bgcolor: 'inherit',
139
+ color: 'inherit',
145
140
  '&.MuiOutlinedInput-root .MuiSelect-select': {
146
141
  p: 0,
147
142
  pl: 1,
148
143
  pr: 'calc(var(--mui-spacing-unit) * 3) !important'
149
144
  },
145
+ '& .MuiSelect-icon': {
146
+ color: 'inherit'
147
+ },
150
148
  '& .MuiOutlinedInput-notchedOutline': {
151
149
  border: 'none'
152
150
  }
@@ -158,8 +156,7 @@ var CodeBlockView = function CodeBlockView(props) {
158
156
  className: className
159
157
  }, rest, {
160
158
  sx: {
161
- fontSize: '1rem',
162
- color: 'text.secondary'
159
+ fontSize: '1rem'
163
160
  }
164
161
  }));
165
162
  },
@@ -204,10 +201,10 @@ var CodeBlockView = function CodeBlockView(props) {
204
201
  bgcolor: 'action.hover'
205
202
  }
206
203
  }
207
- }, /*#__PURE__*/React.createElement(CopyIcon, {
204
+ }, /*#__PURE__*/React.createElement(FileCopyLineIcon, {
208
205
  sx: {
209
206
  fontSize: '0.875rem',
210
- color: 'text.secondary'
207
+ color: 'inherit'
211
208
  }
212
209
  }), /*#__PURE__*/React.createElement(Box, {
213
210
  sx: {
@@ -222,16 +219,14 @@ var CodeBlockView = function CodeBlockView(props) {
222
219
  sx: {
223
220
  px: 1,
224
221
  py: 0.5,
225
- borderRadius: 'var(--mui-shape-borderRadius)',
226
222
  cursor: 'pointer',
227
- '&:hover': {
228
- bgcolor: 'action.hover'
229
- }
223
+ bgcolor: 'inherit',
224
+ color: 'inherit'
230
225
  }
231
226
  }, /*#__PURE__*/React.createElement(TitleIcon, {
232
227
  sx: {
233
228
  fontSize: '0.875rem',
234
- color: 'text.secondary'
229
+ color: 'inherit'
235
230
  }
236
231
  }), /*#__PURE__*/React.createElement(Box, {
237
232
  sx: {
@@ -13,10 +13,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
13
13
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
14
  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; } }
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
- import { Box, Button, CircularProgress, Stack, Tab, Tabs, TextField } from "@mui/material";
17
- import { NodeViewWrapper } from "@tiptap/react";
18
16
  import { FloatingPopover } from "../../../component/FloatingPopover";
19
17
  import { ImageLineIcon } from "../../../component/Icons";
18
+ import { Box, Button, CircularProgress, Stack, Tab, Tabs, TextField } from "@mui/material";
19
+ import { NodeViewWrapper } from "@tiptap/react";
20
20
  import React, { useState } from "react";
21
21
  import { getImageDimensions, getImageDimensionsFromFile } from ".";
22
22
  var InsertImage = function InsertImage(_ref) {
@@ -1,5 +1,5 @@
1
- import { NodeViewProps } from "@tiptap/react";
2
1
  import { EditorFnProps } from "../../../type";
2
+ import { NodeViewProps } from "@tiptap/react";
3
3
  import React from "react";
4
4
  export interface ImageAttributes {
5
5
  src: string;
@@ -4,10 +4,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { Box, Button, IconButton, Stack, TextField, Tooltip } from "@mui/material";
8
- import { NodeViewWrapper } from "@tiptap/react";
9
7
  import { FloatingPopover } from "../../../component";
10
8
  import { CustomSizeIcon, DeleteLineIcon, EditBoxLineIcon } from "../../../component/Icons";
9
+ import { Box, Button, IconButton, Stack, TextField, Tooltip } from "@mui/material";
10
+ import { NodeViewWrapper } from "@tiptap/react";
11
11
  import React, { useEffect, useRef, useState } from "react";
12
12
  import CropImage from "./Crop";
13
13
  import InsertImage from "./Insert";
@@ -4,10 +4,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { Box, Button, FormControl, FormControlLabel, FormLabel, Radio, RadioGroup, Stack, TextField } from "@mui/material";
8
- import { NodeViewWrapper } from "@tiptap/react";
9
7
  import { FloatingPopover } from "../../../component";
10
8
  import { LinkIcon } from "../../../component/Icons";
9
+ import { Box, Button, FormControl, FormControlLabel, FormLabel, Radio, RadioGroup, Stack, TextField } from "@mui/material";
10
+ import { NodeViewWrapper } from "@tiptap/react";
11
11
  import React, { useEffect, useState } from "react";
12
12
  var InsertLink = function InsertLink(_ref) {
13
13
  var updateAttributes = _ref.updateAttributes,
@@ -1,7 +1,7 @@
1
- import { Avatar, Box, Stack } from "@mui/material";
2
- import { NodeViewWrapper } from "@tiptap/react";
3
1
  import { LinkIcon } from "../../../component/Icons";
4
2
  import { getLinkTitle } from "../../../util";
3
+ import { Avatar, Box, Stack } from "@mui/material";
4
+ import { NodeViewWrapper } from "@tiptap/react";
5
5
  import React from "react";
6
6
  var ReadonlyLink = function ReadonlyLink(_ref) {
7
7
  var attrs = _ref.attrs,
@@ -13,7 +13,7 @@ var ReadonlyLink = function ReadonlyLink(_ref) {
13
13
  return /*#__PURE__*/React.createElement(NodeViewWrapper, {
14
14
  className: "link-wrapper",
15
15
  "data-drag-handle": true
16
- }, /*#__PURE__*/React.createElement(Box, {
16
+ }, attrs.type === 'block' ? /*#__PURE__*/React.createElement(Box, {
17
17
  component: 'a',
18
18
  href: attrs.href,
19
19
  target: attrs.target,
@@ -21,22 +21,24 @@ var ReadonlyLink = function ReadonlyLink(_ref) {
21
21
  "data-title": attrs.title,
22
22
  "data-type": attrs.type,
23
23
  sx: {
24
- color: 'primary.main',
25
- textDecoration: 'none'
24
+ display: 'block',
25
+ textDecoration: 'none !important'
26
26
  }
27
- }, attrs.type === 'block' ? /*#__PURE__*/React.createElement(Stack, {
27
+ }, /*#__PURE__*/React.createElement(Stack, {
28
28
  direction: 'row',
29
29
  alignItems: 'center',
30
30
  gap: 2,
31
31
  sx: {
32
32
  border: '1px solid',
33
33
  borderColor: 'divider',
34
+ color: 'text.primary',
34
35
  cursor: 'pointer',
35
36
  borderRadius: 'var(--mui-shape-borderRadius)',
36
37
  bgcolor: 'background.paper',
37
38
  p: 2,
38
39
  ':hover': {
39
- borderColor: 'primary.main'
40
+ borderColor: 'primary.main',
41
+ color: 'primary.main'
40
42
  }
41
43
  }
42
44
  }, /*#__PURE__*/React.createElement(Avatar, {
@@ -72,12 +74,19 @@ var ReadonlyLink = function ReadonlyLink(_ref) {
72
74
  fontSize: '0.75rem',
73
75
  color: 'text.secondary'
74
76
  }
75
- }, attrs.href))) : /*#__PURE__*/React.createElement(Box, {
76
- component: 'span',
77
+ }, attrs.href)))) : /*#__PURE__*/React.createElement(Box, {
78
+ component: 'a',
79
+ href: attrs.href,
80
+ target: attrs.target,
81
+ rel: attrs.rel,
82
+ "data-title": attrs.title,
83
+ "data-type": attrs.type,
77
84
  sx: {
78
85
  display: 'inline-flex',
79
86
  alignItems: 'baseline',
80
- gap: 0.5
87
+ gap: '2px',
88
+ color: 'primary.main',
89
+ fontWeight: 500
81
90
  }
82
91
  }, attrs.type === 'icon' && /*#__PURE__*/React.createElement(Avatar, {
83
92
  sx: {
@@ -97,6 +106,6 @@ var ReadonlyLink = function ReadonlyLink(_ref) {
97
106
  cursor: 'grabbing'
98
107
  }
99
108
  }
100
- })), attrs.title || getLinkTitle(attrs.href))));
109
+ })), attrs.title || getLinkTitle(attrs.href)));
101
110
  };
102
111
  export default ReadonlyLink;
@@ -8,12 +8,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
8
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
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
- import { Avatar, Box, Button, Divider, FormControl, FormControlLabel, FormLabel, Radio, RadioGroup, Stack, TextField } from "@mui/material";
12
- import { NodeViewWrapper } from "@tiptap/react";
13
11
  import { FloatingPopover } from "../../../component";
14
12
  import { CarouselViewIcon, CopyIcon, EditBoxLineIcon, LinkIcon, LinkUnlinkIcon, ScrollToBottomLineIcon, ShareBoxLineIcon, TextIcon } from "../../../component/Icons";
15
13
  import { ToolbarItem } from "../../../component/Toolbar";
16
14
  import { getLinkTitle } from "../../../util";
15
+ import { Avatar, Box, Button, Divider, FormControl, FormControlLabel, FormLabel, Radio, RadioGroup, Stack, TextField } from "@mui/material";
16
+ import { NodeViewWrapper } from "@tiptap/react";
17
17
  import React, { useCallback, useEffect, useState } from "react";
18
18
  import InsertLink from "./Insert";
19
19
  import ReadonlyLink from "./Readonly";
@@ -160,7 +160,8 @@ var LinkViewWrapper = function LinkViewWrapper(_ref) {
160
160
  borderRadius: 'var(--mui-shape-borderRadius)',
161
161
  p: 2,
162
162
  ':hover': {
163
- borderColor: 'primary.main'
163
+ borderColor: 'primary.main',
164
+ color: 'primary.main'
164
165
  }
165
166
  }
166
167
  }, /*#__PURE__*/React.createElement(Avatar, {
@@ -201,7 +202,6 @@ var LinkViewWrapper = function LinkViewWrapper(_ref) {
201
202
  onClick: handleShowOperationPopover,
202
203
  sx: {
203
204
  color: 'primary.main',
204
- textDecoration: 'none',
205
205
  cursor: 'pointer',
206
206
  borderRadius: 'var(--mui-shape-borderRadius)',
207
207
  transition: 'background-color 0.2s ease',
@@ -212,9 +212,11 @@ var LinkViewWrapper = function LinkViewWrapper(_ref) {
212
212
  }, /*#__PURE__*/React.createElement(Box, {
213
213
  component: 'span',
214
214
  sx: {
215
+ textDecoration: 'underline',
215
216
  display: 'inline-flex',
216
217
  alignItems: 'baseline',
217
- gap: 0.5
218
+ gap: 0.5,
219
+ fontWeight: 500
218
220
  }
219
221
  }, attrs.type === 'icon' && /*#__PURE__*/React.createElement(Avatar, {
220
222
  sx: {
@@ -1,5 +1,5 @@
1
- import { NodeViewProps } from "@tiptap/react";
2
1
  import { EditorFnProps } from "../../../../type";
2
+ import { NodeViewProps } from "@tiptap/react";
3
3
  import React from "react";
4
4
  export type BlockMathAttributes = {
5
5
  latex: string;