@ctzhian/tiptap 1.12.12 → 1.12.13

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.
@@ -173,4 +173,17 @@
173
173
 
174
174
  .tiptap.ProseMirror .custom-horizontal-rule {
175
175
  margin: 20px 0;
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;
176
189
  }
@@ -1,10 +1,10 @@
1
1
  import { ChromeIcon } from "../../../component/Icons";
2
- import { Avatar, Box } from "@mui/material";
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, _mark$attrs6;
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,7 +39,6 @@ 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',
@@ -63,6 +62,6 @@ var LinkViewWrapper = function LinkViewWrapper(_ref) {
63
62
  cursor: 'grabbing'
64
63
  }
65
64
  }
66
- })), /*#__PURE__*/React.createElement(Box, null, mark === null || mark === void 0 || (_mark$attrs6 = mark.attrs) === null || _mark$attrs6 === void 0 ? void 0 : _mark$attrs6.title));
65
+ })));
67
66
  };
68
67
  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 (_ref2) {
145
- var commands = _ref2.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(_ref3) {
167
- var range = _ref3.range,
168
- match = _ref3.match,
169
- commands = _ref3.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 (_ref2) {
151
- var commands = _ref2.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(_ref3) {
173
- var range = _ref3.range,
174
- match = _ref3.match,
175
- commands = _ref3.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];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctzhian/tiptap",
3
- "version": "1.12.12",
3
+ "version": "1.12.13",
4
4
  "description": "基于 Tiptap 二次开发的编辑器组件",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",