@ctzhian/tiptap 1.12.9 → 1.12.10

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,83 @@
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;
121
+ }
122
+
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;
109
129
  }
110
130
 
111
- .tiptap.ProseMirror ol {
112
- list-style: decimal;
131
+ .tiptap.ProseMirror ol ol ol li::before {
132
+ content: counter(list-counter, lower-roman) '.' !important;
113
133
  }
114
134
 
115
- .tiptap.ProseMirror ul:not([data-type='taskList']) {
116
- list-style: disc;
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
+ color: var(--mui-palette-primary-main);
117
151
  }
118
152
 
119
153
  .tiptap.ProseMirror ul:not([data-type='taskList']) ul {
120
- list-style: circle;
154
+ margin: 0;
121
155
  }
122
156
 
123
- .tiptap.ProseMirror ul:not([data-type='taskList']) ul ul {
124
- list-style: square;
157
+ .tiptap.ProseMirror ul:not([data-type='taskList']) ul li::before {
158
+ content: '◦' !important;
125
159
  }
126
160
 
127
- .tiptap.ProseMirror ul:not([data-type='taskList']) ul ul ul {
128
- list-style: disc;
161
+ .tiptap.ProseMirror ul:not([data-type='taskList']) ul ul li::before {
162
+ content: '▪' !important;
129
163
  }
130
164
 
131
- .tiptap.ProseMirror ul:not([data-type='taskList']) li {
132
- position: relative;
133
- padding-left: 0;
165
+ .tiptap.ProseMirror ul:not([data-type='taskList']) ul ul ul li::before {
166
+ content: '•' !important;
134
167
  }
135
168
 
136
169
  .tiptap.ProseMirror ul[data-type='taskList'] {
@@ -176,12 +209,6 @@
176
209
  margin: 0;
177
210
  }
178
211
 
179
- .tiptap.ProseMirror li::marker {
180
- font-size: 16px;
181
- line-height: 26px;
182
- color: var(--mui-palette-primary-main);
183
- }
184
-
185
212
  /* code */
186
213
  .tiptap.ProseMirror .codeblock-wrapper {
187
214
  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.10",
4
4
  "description": "基于 Tiptap 二次开发的编辑器组件",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",