@ctzhian/tiptap 1.12.9 → 1.12.11

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.
@@ -152,7 +152,7 @@ var Reader = function Reader() {
152
152
  }
153
153
  return onUpload;
154
154
  }(),
155
- content: ''
155
+ content: "<ol class=\"ordered-list\" data-type=\"orderedList\"><li><p>jfdlsaf</p></li><li><p>sadfsa</p><ol class=\"ordered-list\" data-type=\"orderedList\"><li><p>fjasldkfj</p><ol class=\"ordered-list\" data-type=\"orderedList\"><li><p>fasd</p><ol class=\"ordered-list\" data-type=\"orderedList\"><li><p>fasdjklf</p></li></ol></li><li><p>fjdslkf</p></li><li><p>sjfsadlf</p></li></ol></li></ol></li></ol><ul class=\"bullet-list\" data-type=\"bulletList\"><li><p>fsldjakfjlksd</p></li><li><p>fsadfasd</p><ul class=\"bullet-list\" data-type=\"bulletList\"><li><p>fajsdlkfj</p></li><li><p>fasdjklf</p><ul class=\"bullet-list\" data-type=\"bulletList\"><li><p>fjasldfsa</p><ul class=\"bullet-list\" data-type=\"bulletList\"><li><p>fsadlkj</p></li></ul></li></ul></li></ul></li></ul><p></p>"
156
156
  }),
157
157
  editor = _useTiptap.editor;
158
158
  return /*#__PURE__*/React.createElement(EditorThemeProvider, {
@@ -8,9 +8,6 @@ export declare const PLACEHOLDER: {
8
8
  6: string;
9
9
  };
10
10
  detailsSummary: string;
11
- orderedList: string;
12
- bulletList: string;
13
- taskList: string;
14
11
  paragraph: string;
15
12
  default: string;
16
13
  };
@@ -8,9 +8,6 @@ export var PLACEHOLDER = {
8
8
  6: '六级标题'
9
9
  },
10
10
  detailsSummary: '输入面板标题',
11
- orderedList: '列表',
12
- bulletList: '列表',
13
- taskList: '列表',
14
11
  paragraph: '输入 "/" 插入内容',
15
12
  default: '写点什么吧,输入 "/" 插入内容'
16
13
  };
@@ -1,8 +1,10 @@
1
+ import { ChromeIcon } from "../../../component/Icons";
2
+ import { Avatar, Box } from "@mui/material";
1
3
  import { useTheme } from "@mui/material/styles";
2
4
  import { MarkViewContent } from "@tiptap/react";
3
5
  import React, { useCallback } from "react";
4
6
  var LinkViewWrapper = function LinkViewWrapper(_ref) {
5
- var _mark$attrs2, _mark$attrs3, _mark$attrs4;
7
+ var _mark$attrs2, _mark$attrs3, _mark$attrs4, _mark$attrs6;
6
8
  var editor = _ref.editor,
7
9
  mark = _ref.mark;
8
10
  var theme = useTheme();
@@ -24,6 +26,11 @@ var LinkViewWrapper = function LinkViewWrapper(_ref) {
24
26
  var href = (mark === null || mark === void 0 || (_mark$attrs2 = mark.attrs) === null || _mark$attrs2 === void 0 ? void 0 : _mark$attrs2.href) || '';
25
27
  var target = (mark === null || mark === void 0 || (_mark$attrs3 = mark.attrs) === null || _mark$attrs3 === void 0 ? void 0 : _mark$attrs3.target) || '_blank';
26
28
  var download = mark === null || mark === void 0 || (_mark$attrs4 = mark.attrs) === null || _mark$attrs4 === void 0 ? void 0 : _mark$attrs4.download;
29
+ var favicon = '';
30
+ try {
31
+ var _mark$attrs5;
32
+ favicon = mark !== null && mark !== void 0 && (_mark$attrs5 = mark.attrs) !== null && _mark$attrs5 !== void 0 && _mark$attrs5.href ? new URL(mark.attrs.href).origin + '/favicon.ico' : '';
33
+ } catch (err) {}
27
34
  return /*#__PURE__*/React.createElement(MarkViewContent, {
28
35
  as: "a",
29
36
  href: href,
@@ -33,8 +40,29 @@ var LinkViewWrapper = function LinkViewWrapper(_ref) {
33
40
  style: {
34
41
  color: theme.palette.primary.main,
35
42
  textDecoration: 'underline',
36
- cursor: 'pointer'
43
+ cursor: 'pointer',
44
+ display: 'inline-flex',
45
+ alignItems: 'center',
46
+ gap: '2px'
37
47
  }
38
- });
48
+ }, /*#__PURE__*/React.createElement(Avatar, {
49
+ sx: {
50
+ width: '1rem',
51
+ height: '1rem',
52
+ alignSelf: 'center',
53
+ bgcolor: '#FFFFFF'
54
+ },
55
+ src: favicon
56
+ }, /*#__PURE__*/React.createElement(ChromeIcon, {
57
+ sx: {
58
+ fontSize: '1rem',
59
+ cursor: 'grab',
60
+ color: 'primary.main',
61
+ alignSelf: 'center',
62
+ ':active': {
63
+ cursor: 'grabbing'
64
+ }
65
+ }
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));
39
67
  };
40
68
  export default LinkViewWrapper;
package/dist/index.css CHANGED
@@ -87,50 +87,87 @@
87
87
  /* list */
88
88
  .tiptap.ProseMirror ol,
89
89
  .tiptap.ProseMirror ul {
90
- padding: 0 32px;
90
+ padding: 0 32px 0 24px;
91
91
  margin: 8px 0;
92
92
  list-style: none;
93
+ position: relative;
94
+ counter-reset: list-counter;
93
95
  }
94
96
 
95
97
  .tiptap.ProseMirror li {
98
+ display: flex;
96
99
  margin: 8px 0;
100
+ flex-direction: column;
101
+ position: relative;
97
102
  }
98
103
 
99
- .tiptap.ProseMirror ol ol ol ol {
100
- list-style: decimal;
104
+ .tiptap.ProseMirror ol li {
105
+ counter-increment: list-counter;
101
106
  }
102
107
 
103
- .tiptap.ProseMirror ol ol ol {
104
- list-style: lower-roman;
108
+ .tiptap.ProseMirror ol li::before {
109
+ position: absolute;
110
+ top: 0;
111
+ left: -24px;
112
+ content: counter(list-counter) '.' !important;
113
+ font-size: 16px;
114
+ line-height: 26px;
115
+ color: var(--mui-palette-primary-main);
105
116
  }
106
117
 
107
118
  .tiptap.ProseMirror ol ol {
108
- list-style: lower-alpha;
119
+ counter-reset: list-counter;
120
+ margin: 0;
109
121
  }
110
122
 
111
- .tiptap.ProseMirror ol {
112
- list-style: decimal;
123
+ .tiptap.ProseMirror ol ol li::before {
124
+ content: counter(list-counter, lower-alpha) '.' !important;
125
+ }
126
+
127
+ .tiptap.ProseMirror ol ol ol {
128
+ counter-reset: list-counter;
113
129
  }
114
130
 
115
- .tiptap.ProseMirror ul:not([data-type='taskList']) {
116
- list-style: disc;
131
+ .tiptap.ProseMirror ol ol ol li::before {
132
+ content: counter(list-counter, lower-roman) '.' !important;
133
+ }
134
+
135
+ .tiptap.ProseMirror ol ol ol ol {
136
+ counter-reset: list-counter;
137
+ }
138
+
139
+ .tiptap.ProseMirror ol ol ol ol li::before {
140
+ content: counter(list-counter) '.' !important;
141
+ }
142
+
143
+ .tiptap.ProseMirror ul:not([data-type='taskList']) li::before {
144
+ content: '•' !important;
145
+ position: absolute;
146
+ top: 0;
147
+ left: -24px;
148
+ font-size: 16px;
149
+ line-height: 26px;
150
+ font-size: 20px;
151
+ color: var(--mui-palette-primary-main);
117
152
  }
118
153
 
119
154
  .tiptap.ProseMirror ul:not([data-type='taskList']) ul {
120
- list-style: circle;
155
+ margin: 0;
121
156
  }
122
157
 
123
- .tiptap.ProseMirror ul:not([data-type='taskList']) ul ul {
124
- list-style: square;
158
+ .tiptap.ProseMirror ul:not([data-type='taskList']) ul li::before {
159
+ content: '◦' !important;
160
+ font-size: 15px;
125
161
  }
126
162
 
127
- .tiptap.ProseMirror ul:not([data-type='taskList']) ul ul ul {
128
- list-style: disc;
163
+ .tiptap.ProseMirror ul:not([data-type='taskList']) ul ul li::before {
164
+ content: '▪' !important;
165
+ font-size: 20px;
129
166
  }
130
167
 
131
- .tiptap.ProseMirror ul:not([data-type='taskList']) li {
132
- position: relative;
133
- padding-left: 0;
168
+ .tiptap.ProseMirror ul:not([data-type='taskList']) ul ul ul li::before {
169
+ content: '•' !important;
170
+ font-size: 20px;
134
171
  }
135
172
 
136
173
  .tiptap.ProseMirror ul[data-type='taskList'] {
@@ -176,12 +213,6 @@
176
213
  margin: 0;
177
214
  }
178
215
 
179
- .tiptap.ProseMirror li::marker {
180
- font-size: 16px;
181
- line-height: 26px;
182
- color: var(--mui-palette-primary-main);
183
- }
184
-
185
216
  /* code */
186
217
  .tiptap.ProseMirror .codeblock-wrapper {
187
218
  margin: 20px 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctzhian/tiptap",
3
- "version": "1.12.9",
3
+ "version": "1.12.11",
4
4
  "description": "基于 Tiptap 二次开发的编辑器组件",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",