@ctzhian/tiptap 1.12.12 → 1.12.14
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.
package/dist/asset/css/index.css
CHANGED
|
@@ -173,4 +173,17 @@
|
|
|
173
173
|
|
|
174
174
|
.tiptap.ProseMirror .custom-horizontal-rule {
|
|
175
175
|
margin: 20px 0;
|
|
176
|
-
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* .tiptap.ProseMirror .mark-link {
|
|
179
|
+
line-height: 22px;
|
|
180
|
+
vertical-align: middle;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.tiptap.ProseMirror .mark-link a {
|
|
184
|
+
line-height: 1;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.tiptap.ProseMirror .mark-link a:hover {
|
|
188
|
+
text-decoration: underline;
|
|
189
|
+
} */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ChromeIcon } from "../../../component/Icons";
|
|
2
|
-
import { Avatar
|
|
2
|
+
import { Avatar } from "@mui/material";
|
|
3
3
|
import { useTheme } from "@mui/material/styles";
|
|
4
4
|
import { MarkViewContent } from "@tiptap/react";
|
|
5
5
|
import React, { useCallback } from "react";
|
|
6
6
|
var LinkViewWrapper = function LinkViewWrapper(_ref) {
|
|
7
|
-
var _mark$attrs2, _mark$attrs3, _mark$attrs4
|
|
7
|
+
var _mark$attrs2, _mark$attrs3, _mark$attrs4;
|
|
8
8
|
var editor = _ref.editor,
|
|
9
9
|
mark = _ref.mark;
|
|
10
10
|
var theme = useTheme();
|
|
@@ -39,11 +39,12 @@ var LinkViewWrapper = function LinkViewWrapper(_ref) {
|
|
|
39
39
|
onClick: handleClick,
|
|
40
40
|
style: {
|
|
41
41
|
color: theme.palette.primary.main,
|
|
42
|
-
textDecoration: 'underline',
|
|
43
42
|
cursor: 'pointer',
|
|
44
43
|
display: 'inline-flex',
|
|
45
44
|
alignItems: 'center',
|
|
46
|
-
gap: '2px'
|
|
45
|
+
gap: '2px',
|
|
46
|
+
verticalAlign: '-0.125em',
|
|
47
|
+
lineHeight: 1
|
|
47
48
|
}
|
|
48
49
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
49
50
|
sx: {
|
|
@@ -63,6 +64,6 @@ var LinkViewWrapper = function LinkViewWrapper(_ref) {
|
|
|
63
64
|
cursor: 'grabbing'
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
}))
|
|
67
|
+
})));
|
|
67
68
|
};
|
|
68
69
|
export default LinkViewWrapper;
|
|
@@ -137,12 +137,16 @@ export var AudioExtension = function AudioExtension(props) {
|
|
|
137
137
|
var HTMLAttributes = _ref.HTMLAttributes;
|
|
138
138
|
return ['audio', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
|
|
139
139
|
},
|
|
140
|
+
renderMarkdown: function renderMarkdown(_ref2) {
|
|
141
|
+
var HTMLAttributes = _ref2.HTMLAttributes;
|
|
142
|
+
return "<audio ".concat(HTMLAttributes.src ? "src=\"".concat(HTMLAttributes.src, "\"") : '', " ").concat(HTMLAttributes.title ? "title=\"".concat(HTMLAttributes.title, "\"") : '', " ").concat(HTMLAttributes.poster ? "poster=\"".concat(HTMLAttributes.poster, "\"") : '', " ").concat(HTMLAttributes.controls ? 'controls' : '', " ").concat(HTMLAttributes.autoplay ? 'autoplay' : '', " ").concat(HTMLAttributes.loop ? 'loop' : '', " ").concat(HTMLAttributes.muted ? 'muted' : '', "></audio>");
|
|
143
|
+
},
|
|
140
144
|
addCommands: function addCommands() {
|
|
141
145
|
var _this2 = this;
|
|
142
146
|
return {
|
|
143
147
|
setAudio: function setAudio(options) {
|
|
144
|
-
return function (
|
|
145
|
-
var commands =
|
|
148
|
+
return function (_ref3) {
|
|
149
|
+
var commands = _ref3.commands;
|
|
146
150
|
return commands.insertContent({
|
|
147
151
|
type: _this2.name,
|
|
148
152
|
attrs: {
|
|
@@ -163,10 +167,10 @@ export var AudioExtension = function AudioExtension(props) {
|
|
|
163
167
|
var _this3 = this;
|
|
164
168
|
return [new InputRule({
|
|
165
169
|
find: /^https?:\/\/.*\.(mp3|wav|ogg|m4a|flac|aac|wma|webm)$/,
|
|
166
|
-
handler: function handler(
|
|
167
|
-
var range =
|
|
168
|
-
match =
|
|
169
|
-
commands =
|
|
170
|
+
handler: function handler(_ref4) {
|
|
171
|
+
var range = _ref4.range,
|
|
172
|
+
match = _ref4.match,
|
|
173
|
+
commands = _ref4.commands;
|
|
170
174
|
var from = range.from,
|
|
171
175
|
to = range.to;
|
|
172
176
|
var audioUrl = match[0];
|
|
@@ -143,12 +143,16 @@ export var VideoExtension = function VideoExtension(props) {
|
|
|
143
143
|
var HTMLAttributes = _ref.HTMLAttributes;
|
|
144
144
|
return ['video', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
|
|
145
145
|
},
|
|
146
|
+
renderMarkdown: function renderMarkdown(_ref2) {
|
|
147
|
+
var HTMLAttributes = _ref2.HTMLAttributes;
|
|
148
|
+
return "<video ".concat(HTMLAttributes.src ? "src=\"".concat(HTMLAttributes.src, "\"") : '', " ").concat(HTMLAttributes.width ? "width=\"".concat(HTMLAttributes.width, "\"") : '', " ").concat(HTMLAttributes.controls ? 'controls' : '', " ").concat(HTMLAttributes.autoplay ? 'autoplay' : '', " ").concat(HTMLAttributes.loop ? 'loop' : '', " ").concat(HTMLAttributes.muted ? 'muted' : '', " ").concat(HTMLAttributes.poster ? "poster=\"".concat(HTMLAttributes.poster, "\"") : '', "></video>");
|
|
149
|
+
},
|
|
146
150
|
addCommands: function addCommands() {
|
|
147
151
|
var _this2 = this;
|
|
148
152
|
return {
|
|
149
153
|
setVideo: function setVideo(options) {
|
|
150
|
-
return function (
|
|
151
|
-
var commands =
|
|
154
|
+
return function (_ref3) {
|
|
155
|
+
var commands = _ref3.commands;
|
|
152
156
|
return commands.insertContent({
|
|
153
157
|
type: _this2.name,
|
|
154
158
|
attrs: {
|
|
@@ -169,10 +173,10 @@ export var VideoExtension = function VideoExtension(props) {
|
|
|
169
173
|
var _this3 = this;
|
|
170
174
|
return [new InputRule({
|
|
171
175
|
find: /^https?:\/\/.*\.(mp4|webm|ogg|mov|m4v|avi|wmv|flv|mkv|mpg|mpeg|m4p|m4v|m4b|m4r|m4a)$/,
|
|
172
|
-
handler: function handler(
|
|
173
|
-
var range =
|
|
174
|
-
match =
|
|
175
|
-
commands =
|
|
176
|
+
handler: function handler(_ref4) {
|
|
177
|
+
var range = _ref4.range,
|
|
178
|
+
match = _ref4.match,
|
|
179
|
+
commands = _ref4.commands;
|
|
176
180
|
var from = range.from,
|
|
177
181
|
to = range.to;
|
|
178
182
|
var videoUrl = match[0];
|