x-star-editor 0.5.0 → 0.6.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.
- package/dist/components/Toolbar.js +16 -51
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/styles/cursor/editor-eraser.png +0 -0
- package/dist/styles/cursor/pencil.png +0 -0
- package/dist/styles/index.css +1455 -1261
- package/dist/themes/lark.css +160 -59
- package/dist/utils/markdown.d.ts +8 -1
- package/dist/utils/markdown.js +31 -4
- package/dist/utils/slide/index.d.ts +0 -0
- package/dist/utils/slide/index.js +32 -0
- package/dist/x-star-md-viewer/index.js +8 -5
- package/dist/x-star-slide-viewer/index.d.ts +42 -0
- package/dist/x-star-slide-viewer/index.js +367 -0
- package/package.json +4 -1
package/dist/themes/lark.css
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark
|
|
2
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark,
|
|
3
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark {
|
|
3
4
|
line-height: 1.68;
|
|
4
5
|
text-size-adjust: 100%;
|
|
5
6
|
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "Segoe UI", "PingFang SC", "Microsoft Yahei", "Hiragino Sans GB", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
6
7
|
font-size: 16px;
|
|
7
8
|
color: #1f2329;
|
|
8
9
|
}
|
|
9
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark
|
|
10
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark *,
|
|
11
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark * {
|
|
10
12
|
box-sizing: border-box;
|
|
11
13
|
-webkit-font-smoothing: antialiased;
|
|
12
14
|
text-rendering: optimizelegibility;
|
|
13
15
|
}
|
|
14
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark > *:first-child
|
|
16
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark > *:first-child,
|
|
17
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark > *:first-child {
|
|
15
18
|
margin-top: 0;
|
|
16
19
|
}
|
|
17
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark > *:last-child
|
|
20
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark > *:last-child,
|
|
21
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark > *:last-child {
|
|
18
22
|
margin-top: 0;
|
|
19
23
|
}
|
|
20
24
|
.x-star-editor-md-viewer.x-star-editor-theme-lark p,
|
|
@@ -28,57 +32,83 @@
|
|
|
28
32
|
.x-star-editor-md-viewer.x-star-editor-theme-lark blockquote,
|
|
29
33
|
.x-star-editor-md-viewer.x-star-editor-theme-lark table,
|
|
30
34
|
.x-star-editor-md-viewer.x-star-editor-theme-lark figure,
|
|
31
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark hr
|
|
35
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark hr,
|
|
36
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark p,
|
|
37
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark details,
|
|
38
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark dl,
|
|
39
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ol,
|
|
40
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ul,
|
|
41
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark xmp,
|
|
42
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark plaintext,
|
|
43
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark listing,
|
|
44
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark blockquote,
|
|
45
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark table,
|
|
46
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark figure,
|
|
47
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark hr {
|
|
32
48
|
margin-top: 8px;
|
|
33
49
|
margin-bottom: 8px;
|
|
34
50
|
}
|
|
35
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark h1
|
|
51
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark h1,
|
|
52
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark h1 {
|
|
36
53
|
font-size: 26px;
|
|
37
54
|
font-weight: bold;
|
|
38
55
|
margin: 26px 0 10px;
|
|
39
56
|
}
|
|
40
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark h2
|
|
57
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark h2,
|
|
58
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark h2 {
|
|
41
59
|
font-size: 22px;
|
|
42
60
|
font-weight: bold;
|
|
43
61
|
margin: 22px 0 8px;
|
|
44
62
|
}
|
|
45
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark h3
|
|
63
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark h3,
|
|
64
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark h3 {
|
|
46
65
|
font-size: 20px;
|
|
47
66
|
font-weight: bold;
|
|
48
67
|
margin: 20px 0 8px;
|
|
49
68
|
}
|
|
50
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark h4
|
|
69
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark h4,
|
|
70
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark h4 {
|
|
51
71
|
font-size: 18px;
|
|
52
72
|
font-weight: bold;
|
|
53
73
|
margin: 18px 0 8px;
|
|
54
74
|
}
|
|
55
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark h5
|
|
75
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark h5,
|
|
76
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark h5 {
|
|
56
77
|
font-size: 16px;
|
|
57
78
|
font-weight: bold;
|
|
58
79
|
margin: 16px 0 8px;
|
|
59
80
|
}
|
|
60
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark h6
|
|
81
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark h6,
|
|
82
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark h6 {
|
|
61
83
|
font-size: 16px;
|
|
62
84
|
font-weight: bold;
|
|
63
85
|
margin: 16px 0 8px;
|
|
64
86
|
}
|
|
65
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark p
|
|
87
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark p,
|
|
88
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark p {
|
|
66
89
|
margin-left: 0;
|
|
67
90
|
margin-right: 0;
|
|
68
91
|
}
|
|
69
92
|
.x-star-editor-md-viewer.x-star-editor-theme-lark pre,
|
|
70
93
|
.x-star-editor-md-viewer.x-star-editor-theme-lark xmp,
|
|
71
94
|
.x-star-editor-md-viewer.x-star-editor-theme-lark plaintext,
|
|
72
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark listing
|
|
95
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark listing,
|
|
96
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark pre,
|
|
97
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark xmp,
|
|
98
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark plaintext,
|
|
99
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark listing {
|
|
73
100
|
font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
|
|
74
101
|
}
|
|
75
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark blockquote > :first-child
|
|
102
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark blockquote > :first-child,
|
|
103
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark blockquote > :first-child {
|
|
76
104
|
margin-top: 0;
|
|
77
105
|
}
|
|
78
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark blockquote > :last-child
|
|
106
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark blockquote > :last-child,
|
|
107
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark blockquote > :last-child {
|
|
79
108
|
margin-bottom: 0;
|
|
80
109
|
}
|
|
81
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark hr
|
|
110
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark hr,
|
|
111
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark hr {
|
|
82
112
|
border-style: inset;
|
|
83
113
|
border-width: 1px;
|
|
84
114
|
margin: 13px 0 12px;
|
|
@@ -88,29 +118,38 @@
|
|
|
88
118
|
background-image: linear-gradient(90deg, #bbbfc4, #bbbfc4);
|
|
89
119
|
background-repeat: no-repeat;
|
|
90
120
|
}
|
|
91
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark img
|
|
121
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark img,
|
|
122
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark img {
|
|
92
123
|
max-width: 100%;
|
|
93
124
|
height: auto;
|
|
94
125
|
}
|
|
95
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark li
|
|
126
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark li,
|
|
127
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark li {
|
|
96
128
|
position: relative;
|
|
97
129
|
word-wrap: break-all;
|
|
98
130
|
}
|
|
99
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark li + li
|
|
131
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark li + li,
|
|
132
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark li + li {
|
|
100
133
|
margin-top: 4px;
|
|
101
134
|
}
|
|
102
135
|
.x-star-editor-md-viewer.x-star-editor-theme-lark ul ul,
|
|
103
136
|
.x-star-editor-md-viewer.x-star-editor-theme-lark ol ul,
|
|
104
137
|
.x-star-editor-md-viewer.x-star-editor-theme-lark ul ol,
|
|
105
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark ol ol
|
|
138
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark ol ol,
|
|
139
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ul ul,
|
|
140
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ol ul,
|
|
141
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ul ol,
|
|
142
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ol ol {
|
|
106
143
|
margin-top: 0;
|
|
107
144
|
margin-bottom: 0;
|
|
108
145
|
}
|
|
109
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item
|
|
146
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item,
|
|
147
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .task-list-item {
|
|
110
148
|
list-style-type: none;
|
|
111
149
|
padding-left: 0.3rem;
|
|
112
150
|
}
|
|
113
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark a
|
|
151
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark a,
|
|
152
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark a {
|
|
114
153
|
color: #3370ff;
|
|
115
154
|
overflow-wrap: break-word;
|
|
116
155
|
word-wrap: break-word;
|
|
@@ -119,11 +158,14 @@
|
|
|
119
158
|
word-break: break-word;
|
|
120
159
|
text-decoration: none;
|
|
121
160
|
}
|
|
122
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark a img
|
|
161
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark a img,
|
|
162
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark a img {
|
|
123
163
|
border: none;
|
|
124
164
|
}
|
|
125
165
|
.x-star-editor-md-viewer.x-star-editor-theme-lark b,
|
|
126
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark strong
|
|
166
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark strong,
|
|
167
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark b,
|
|
168
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark strong {
|
|
127
169
|
font-weight: bold;
|
|
128
170
|
}
|
|
129
171
|
.x-star-editor-md-viewer.x-star-editor-theme-lark i,
|
|
@@ -131,25 +173,39 @@
|
|
|
131
173
|
.x-star-editor-md-viewer.x-star-editor-theme-lark em,
|
|
132
174
|
.x-star-editor-md-viewer.x-star-editor-theme-lark var,
|
|
133
175
|
.x-star-editor-md-viewer.x-star-editor-theme-lark address,
|
|
134
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark dfn
|
|
176
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark dfn,
|
|
177
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark i,
|
|
178
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark cite,
|
|
179
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark em,
|
|
180
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark var,
|
|
181
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark address,
|
|
182
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark dfn {
|
|
135
183
|
font-style: italic;
|
|
136
184
|
}
|
|
137
185
|
.x-star-editor-md-viewer.x-star-editor-theme-lark code,
|
|
138
186
|
.x-star-editor-md-viewer.x-star-editor-theme-lark kbd,
|
|
139
187
|
.x-star-editor-md-viewer.x-star-editor-theme-lark tt,
|
|
140
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark samp
|
|
188
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark samp,
|
|
189
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark code,
|
|
190
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark kbd,
|
|
191
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark tt,
|
|
192
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark samp {
|
|
141
193
|
font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
|
|
142
194
|
}
|
|
143
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark mark
|
|
195
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark mark,
|
|
196
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark mark {
|
|
144
197
|
color: #1f2329;
|
|
145
198
|
padding: 0.2em 0;
|
|
146
199
|
background-color: rgba(255, 246, 122, 0.8);
|
|
147
200
|
}
|
|
148
201
|
.x-star-editor-md-viewer.x-star-editor-theme-lark del,
|
|
149
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark s
|
|
202
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark s,
|
|
203
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark del,
|
|
204
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark s {
|
|
150
205
|
color: inherit;
|
|
151
206
|
}
|
|
152
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark table
|
|
207
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark table,
|
|
208
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark table {
|
|
153
209
|
color: black;
|
|
154
210
|
border-collapse: collapse;
|
|
155
211
|
background-color: white;
|
|
@@ -157,47 +213,59 @@
|
|
|
157
213
|
font-size: 1em;
|
|
158
214
|
}
|
|
159
215
|
.x-star-editor-md-viewer.x-star-editor-theme-lark th,
|
|
160
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark td
|
|
216
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark td,
|
|
217
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark th,
|
|
218
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark td {
|
|
161
219
|
border-color: #dee0e3;
|
|
162
220
|
border-width: 1px;
|
|
163
221
|
border-style: solid;
|
|
164
222
|
}
|
|
165
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark th
|
|
223
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark th,
|
|
224
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark th {
|
|
166
225
|
padding: 8px;
|
|
167
226
|
font-size: 1em;
|
|
168
227
|
}
|
|
169
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark td
|
|
228
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark td,
|
|
229
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark td {
|
|
170
230
|
padding: 8px;
|
|
171
231
|
font-size: 1em;
|
|
172
232
|
font-weight: normal;
|
|
173
233
|
}
|
|
174
234
|
.x-star-editor-md-viewer.x-star-editor-theme-lark pre.md-fences,
|
|
175
235
|
.x-star-editor-md-viewer.x-star-editor-theme-lark pre.md-meta-block,
|
|
176
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .md-rawblock-control:not(.md-rawblock-tooltip) .md-rawblock-input
|
|
236
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .md-rawblock-control:not(.md-rawblock-tooltip) .md-rawblock-input,
|
|
237
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark pre.md-fences,
|
|
238
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark pre.md-meta-block,
|
|
239
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .md-rawblock-control:not(.md-rawblock-tooltip) .md-rawblock-input {
|
|
177
240
|
border-radius: 3px;
|
|
178
241
|
border: 1px solid #dee0e3;
|
|
179
242
|
padding: 10px;
|
|
180
243
|
background-color: #f5f6f7;
|
|
181
244
|
}
|
|
182
245
|
.x-star-editor-md-viewer.x-star-editor-theme-lark .md-math-block,
|
|
183
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .md-rawblock
|
|
246
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .md-rawblock,
|
|
247
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .md-math-block,
|
|
248
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .md-rawblock {
|
|
184
249
|
margin-top: 1em;
|
|
185
250
|
margin-bottom: 1em;
|
|
186
251
|
}
|
|
187
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .md-rawblock > .md-rawblock-tooltip
|
|
252
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .md-rawblock > .md-rawblock-tooltip,
|
|
253
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .md-rawblock > .md-rawblock-tooltip {
|
|
188
254
|
background-color: #f5f6f7;
|
|
189
255
|
transition: 0.5s;
|
|
190
256
|
display: block;
|
|
191
257
|
visibility: hidden;
|
|
192
258
|
opacity: 0;
|
|
193
259
|
}
|
|
194
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .md-rawblock:hover > .md-rawblock-tooltip
|
|
260
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .md-rawblock:hover > .md-rawblock-tooltip,
|
|
261
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .md-rawblock:hover > .md-rawblock-tooltip {
|
|
195
262
|
transition: 0.5s;
|
|
196
263
|
visibility: visible;
|
|
197
264
|
opacity: 1;
|
|
198
265
|
animation: none;
|
|
199
266
|
}
|
|
200
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .md-rawblock-control:not(.md-rawblock-tooltip)
|
|
267
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .md-rawblock-control:not(.md-rawblock-tooltip),
|
|
268
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .md-rawblock-control:not(.md-rawblock-tooltip) {
|
|
201
269
|
padding-left: 0;
|
|
202
270
|
padding-right: 0;
|
|
203
271
|
}
|
|
@@ -206,19 +274,27 @@
|
|
|
206
274
|
.x-star-editor-md-viewer.x-star-editor-theme-lark h3,
|
|
207
275
|
.x-star-editor-md-viewer.x-star-editor-theme-lark h4,
|
|
208
276
|
.x-star-editor-md-viewer.x-star-editor-theme-lark h5,
|
|
209
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark h6
|
|
277
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark h6,
|
|
278
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark h1,
|
|
279
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark h2,
|
|
280
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark h3,
|
|
281
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark h4,
|
|
282
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark h5,
|
|
283
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark h6 {
|
|
210
284
|
line-height: 1.4;
|
|
211
285
|
margin-top: 1em;
|
|
212
286
|
margin-bottom: 0.37em;
|
|
213
287
|
}
|
|
214
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark blockquote
|
|
288
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark blockquote,
|
|
289
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark blockquote {
|
|
215
290
|
display: block;
|
|
216
291
|
margin-left: 0;
|
|
217
292
|
padding-left: 14px;
|
|
218
293
|
border-left: 2px solid #3370ff;
|
|
219
294
|
color: rgba(31, 35, 41, 0.7);
|
|
220
295
|
}
|
|
221
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark :not(pre) > code
|
|
296
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark :not(pre) > code,
|
|
297
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark :not(pre) > code {
|
|
222
298
|
border-radius: 4px;
|
|
223
299
|
margin-left: 2px;
|
|
224
300
|
margin-right: 2px;
|
|
@@ -228,19 +304,23 @@
|
|
|
228
304
|
line-height: 1.6;
|
|
229
305
|
padding: 0 2px;
|
|
230
306
|
}
|
|
231
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark a:hover
|
|
307
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark a:hover,
|
|
308
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark a:hover {
|
|
232
309
|
text-decoration: underline;
|
|
233
310
|
}
|
|
234
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark ul
|
|
311
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark ul,
|
|
312
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ul {
|
|
235
313
|
margin-left: 0;
|
|
236
314
|
padding-left: 22px;
|
|
237
315
|
list-style: none;
|
|
238
316
|
}
|
|
239
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark ul > li:not([class*=task-list-item])
|
|
317
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark ul > li:not([class*=task-list-item]),
|
|
318
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ul > li:not([class*=task-list-item]) {
|
|
240
319
|
word-wrap: break-all;
|
|
241
320
|
padding-left: 0;
|
|
242
321
|
}
|
|
243
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark ul > li:not([class*=task-list-item])::before
|
|
322
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark ul > li:not([class*=task-list-item])::before,
|
|
323
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ul > li:not([class*=task-list-item])::before {
|
|
244
324
|
position: absolute;
|
|
245
325
|
top: 2px;
|
|
246
326
|
content: "•";
|
|
@@ -253,28 +333,33 @@
|
|
|
253
333
|
transform: scale(1.25);
|
|
254
334
|
font-family: PingFangSC-Regular, "PingFang SC", Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
|
|
255
335
|
}
|
|
256
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark ul > li:not([class*=task-list-item]) li:not([class*=task-list-item])::before
|
|
336
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark ul > li:not([class*=task-list-item]) li:not([class*=task-list-item])::before,
|
|
337
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ul > li:not([class*=task-list-item]) li:not([class*=task-list-item])::before {
|
|
257
338
|
content: "◦";
|
|
258
339
|
transform: scale(1);
|
|
259
340
|
font-weight: 700;
|
|
260
341
|
}
|
|
261
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark ul > li:not([class*=task-list-item]) li:not([class*=task-list-item]) li:not([class*=task-list-item])::before
|
|
342
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark ul > li:not([class*=task-list-item]) li:not([class*=task-list-item]) li:not([class*=task-list-item])::before,
|
|
343
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ul > li:not([class*=task-list-item]) li:not([class*=task-list-item]) li:not([class*=task-list-item])::before {
|
|
262
344
|
content: "▪";
|
|
263
345
|
transform: scale(1.25);
|
|
264
346
|
font-weight: normal;
|
|
265
347
|
}
|
|
266
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark ol
|
|
348
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark ol,
|
|
349
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ol {
|
|
267
350
|
counter-reset: ol_counter;
|
|
268
351
|
margin-left: 0;
|
|
269
352
|
padding-left: 22px;
|
|
270
353
|
list-style: none;
|
|
271
354
|
}
|
|
272
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark ol > li:not([class*=task-list-item])
|
|
355
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark ol > li:not([class*=task-list-item]),
|
|
356
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ol > li:not([class*=task-list-item]) {
|
|
273
357
|
word-wrap: break-all;
|
|
274
358
|
padding-left: 0;
|
|
275
359
|
position: relative;
|
|
276
360
|
}
|
|
277
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark ol > li:not([class*=task-list-item])::before
|
|
361
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark ol > li:not([class*=task-list-item])::before,
|
|
362
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ol > li:not([class*=task-list-item])::before {
|
|
278
363
|
content: counter(ol_counter) ".";
|
|
279
364
|
counter-increment: ol_counter;
|
|
280
365
|
color: #3370ff;
|
|
@@ -297,23 +382,35 @@
|
|
|
297
382
|
.x-star-editor-md-viewer.x-star-editor-theme-lark ul ol,
|
|
298
383
|
.x-star-editor-md-viewer.x-star-editor-theme-lark ol ol,
|
|
299
384
|
.x-star-editor-md-viewer.x-star-editor-theme-lark li ul,
|
|
300
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark li ol
|
|
385
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark li ol,
|
|
386
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark li + li,
|
|
387
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ul ul,
|
|
388
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ol ul,
|
|
389
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ul ol,
|
|
390
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark ol ol,
|
|
391
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark li ul,
|
|
392
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark li ol {
|
|
301
393
|
margin-top: 4px;
|
|
302
394
|
}
|
|
303
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item > p
|
|
395
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item > p,
|
|
396
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .task-list-item > p {
|
|
304
397
|
transition: color 0.3s, opacity 0.3s;
|
|
305
398
|
}
|
|
306
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item.task-list-done > p
|
|
399
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item.task-list-done > p,
|
|
400
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .task-list-item.task-list-done > p {
|
|
307
401
|
color: #646a73;
|
|
308
402
|
text-decoration: line-through;
|
|
309
403
|
}
|
|
310
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item.task-list-done > p > .md-emoji
|
|
404
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item.task-list-done > p > .md-emoji,
|
|
405
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .task-list-item.task-list-done > p > .md-emoji {
|
|
311
406
|
opacity: 0.5;
|
|
312
407
|
}
|
|
313
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item.task-list-done > p > .md-link > a
|
|
408
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item.task-list-done > p > .md-link > a,
|
|
409
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .task-list-item.task-list-done > p > .md-link > a {
|
|
314
410
|
opacity: 0.6;
|
|
315
411
|
}
|
|
316
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item > input
|
|
412
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item > input,
|
|
413
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .task-list-item > input {
|
|
317
414
|
appearance: initial;
|
|
318
415
|
display: block;
|
|
319
416
|
position: absolute;
|
|
@@ -324,14 +421,17 @@
|
|
|
324
421
|
width: 1.2rem;
|
|
325
422
|
transition: border-color 0.3s;
|
|
326
423
|
}
|
|
327
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item > input:focus
|
|
424
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item > input:focus,
|
|
425
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .task-list-item > input:focus {
|
|
328
426
|
outline: none;
|
|
329
427
|
box-shadow: none;
|
|
330
428
|
}
|
|
331
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item > input:hover
|
|
429
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item > input:hover,
|
|
430
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .task-list-item > input:hover {
|
|
332
431
|
border-color: #3370ff;
|
|
333
432
|
}
|
|
334
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item > input:checked::before
|
|
433
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item > input:checked::before,
|
|
434
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .task-list-item > input:checked::before {
|
|
335
435
|
content: "";
|
|
336
436
|
position: absolute;
|
|
337
437
|
top: 20%;
|
|
@@ -341,7 +441,8 @@
|
|
|
341
441
|
transform: rotate(40deg);
|
|
342
442
|
background: #3370ff;
|
|
343
443
|
}
|
|
344
|
-
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item > input:checked::after
|
|
444
|
+
.x-star-editor-md-viewer.x-star-editor-theme-lark .task-list-item > input:checked::after,
|
|
445
|
+
.x-star-editor-slide-viewer.x-star-editor-theme-lark .task-list-item > input:checked::after {
|
|
345
446
|
content: "";
|
|
346
447
|
position: absolute;
|
|
347
448
|
top: 46%;
|
package/dist/utils/markdown.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Root as HastRoot } from 'hast';
|
|
2
|
+
import type { Options as ToStringOptions } from 'mdast-util-to-string';
|
|
2
3
|
import { defaultSchema } from 'rehype-sanitize';
|
|
3
4
|
import type { ViewerOptions } from '../x-star-md-viewer';
|
|
4
5
|
/**
|
|
@@ -42,10 +43,16 @@ export declare const toHTML: (sourceCode: string) => string;
|
|
|
42
43
|
* @returns Markdown 文本
|
|
43
44
|
*/
|
|
44
45
|
export declare const toMarkdown: (sourceCode: string) => string;
|
|
46
|
+
export interface ToTextOptions extends ToStringOptions {
|
|
47
|
+
/**
|
|
48
|
+
* 替换图片的 alt 文本
|
|
49
|
+
*/
|
|
50
|
+
replaceImageAlt?: string;
|
|
51
|
+
}
|
|
45
52
|
/**
|
|
46
53
|
* 将 Markdown 文本转成纯文本
|
|
47
54
|
*
|
|
48
55
|
* @param sourceCode Markdown 文本
|
|
49
56
|
* @returns 纯文本
|
|
50
57
|
*/
|
|
51
|
-
export declare const toText: (sourceCode: string) => string;
|
|
58
|
+
export declare const toText: (sourceCode: string, options?: ToTextOptions) => string;
|
package/dist/utils/markdown.js
CHANGED
|
@@ -24,6 +24,7 @@ import remarkParse from 'remark-parse';
|
|
|
24
24
|
import remarkRehype from 'remark-rehype';
|
|
25
25
|
import remarkStringify from 'remark-stringify';
|
|
26
26
|
import { unified } from 'unified';
|
|
27
|
+
import { visit } from 'unist-util-visit';
|
|
27
28
|
import { prefix } from "./global";
|
|
28
29
|
import rehypeCustom from "./rehype/rehype-custom";
|
|
29
30
|
import rehypeMath, { isMathNode } from "./rehype/rehype-math";
|
|
@@ -268,6 +269,26 @@ var toHastProcessor = unified().use(remarkBreaks).use(remarkRehype, {
|
|
|
268
269
|
value: node.value
|
|
269
270
|
}) : h(node, 'div')
|
|
270
271
|
);
|
|
272
|
+
},
|
|
273
|
+
image: function image(h, node) {
|
|
274
|
+
try {
|
|
275
|
+
var _node$alt;
|
|
276
|
+
var styles = (_node$alt = node.alt) === null || _node$alt === void 0 ? void 0 : _node$alt.split(' ');
|
|
277
|
+
return h(node, 'img', {
|
|
278
|
+
src: node.url,
|
|
279
|
+
alt: styles === null || styles === void 0 ? void 0 : styles.filter(function (i) {
|
|
280
|
+
return !i.includes(':');
|
|
281
|
+
}).join(' '),
|
|
282
|
+
style: styles === null || styles === void 0 ? void 0 : styles.filter(function (i) {
|
|
283
|
+
return i.includes(':');
|
|
284
|
+
}).join(';')
|
|
285
|
+
});
|
|
286
|
+
} catch (_unused) {
|
|
287
|
+
return h(node, 'img', {
|
|
288
|
+
src: node.url,
|
|
289
|
+
alt: node.alt
|
|
290
|
+
});
|
|
291
|
+
}
|
|
271
292
|
}
|
|
272
293
|
}
|
|
273
294
|
}).use(rehypeMermaid, {
|
|
@@ -358,7 +379,7 @@ export var postViewerRender = function postViewerRender(root, options) {
|
|
|
358
379
|
jsxs: jsxs,
|
|
359
380
|
components: components
|
|
360
381
|
});
|
|
361
|
-
} catch (
|
|
382
|
+
} catch (_unused2) {
|
|
362
383
|
return jsx('div', {
|
|
363
384
|
style: {
|
|
364
385
|
fontStyle: 'italic',
|
|
@@ -418,13 +439,19 @@ var toMarkdownProcessor = unified().use(rehypeRemark, {
|
|
|
418
439
|
export var toMarkdown = function toMarkdown(sourceCode) {
|
|
419
440
|
return toMarkdownProcessor.stringify(toMarkdownProcessor.runSync(toHTMLProcessor.runSync(toHTMLProcessor.parse(sourceCode))));
|
|
420
441
|
};
|
|
421
|
-
|
|
422
442
|
/**
|
|
423
443
|
* 将 Markdown 文本转成纯文本
|
|
424
444
|
*
|
|
425
445
|
* @param sourceCode Markdown 文本
|
|
426
446
|
* @returns 纯文本
|
|
427
447
|
*/
|
|
428
|
-
export var toText = function toText(sourceCode) {
|
|
429
|
-
|
|
448
|
+
export var toText = function toText(sourceCode, options) {
|
|
449
|
+
var root = toMdastProcessor.parse(sourceCode);
|
|
450
|
+
if (options !== null && options !== void 0 && options.replaceImageAlt) {
|
|
451
|
+
// 遍历 Mdast 树的图片节点,替换 alt 文本
|
|
452
|
+
visit(root, 'image', function (node) {
|
|
453
|
+
node.alt = options.replaceImageAlt;
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
return toString(root, options);
|
|
430
457
|
};
|
|
File without changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// import _ from 'lodash';
|
|
2
|
+
// import { CanvasData } from 'x-star-editor/x-star-slide-viewer';
|
|
3
|
+
|
|
4
|
+
// /**
|
|
5
|
+
// *
|
|
6
|
+
// * @param scaleString
|
|
7
|
+
// * @returns 'scale(3)' -> 3
|
|
8
|
+
// */
|
|
9
|
+
// export const getScaleNumber = (scaleString: string) =>
|
|
10
|
+
// Number(scaleString.replace('scale(', '').replace(')', ''));
|
|
11
|
+
|
|
12
|
+
// /**
|
|
13
|
+
// *
|
|
14
|
+
// * @param pointData
|
|
15
|
+
// * @param beforeScale
|
|
16
|
+
// * @param parentWidth
|
|
17
|
+
// */
|
|
18
|
+
// export const computeScaledPoint = (
|
|
19
|
+
// // 计算点scale后的坐标值
|
|
20
|
+
// pointData: CanvasData,
|
|
21
|
+
// parentWidth: number,
|
|
22
|
+
// ) => {
|
|
23
|
+
// const beforeScale = pointData.scale;
|
|
24
|
+
// const newData = _.cloneDeep(pointData.points);
|
|
25
|
+
// newData.forEach(({ points }) =>
|
|
26
|
+
// points.forEach((point) => {
|
|
27
|
+
// point.x = (point.x / beforeScale) * (parentWidth / 960);
|
|
28
|
+
// point.y = (point.y / beforeScale) * (parentWidth / 960);
|
|
29
|
+
// }),
|
|
30
|
+
// );
|
|
31
|
+
// return newData;
|
|
32
|
+
// };
|
|
@@ -28,11 +28,14 @@ var XStarMdViewer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
28
28
|
};
|
|
29
29
|
}, []);
|
|
30
30
|
var options = useMemo(function () {
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
return (
|
|
32
|
+
// plugins 是一个数组,里面是一些函数
|
|
33
|
+
composeHandlers(plugins)({
|
|
34
|
+
customSchema: getDefaultSchema(),
|
|
35
|
+
customHTMLElements: {},
|
|
36
|
+
customBlocks: {}
|
|
37
|
+
})
|
|
38
|
+
);
|
|
36
39
|
}, [plugins]);
|
|
37
40
|
var optionsLatest = useRef(options);
|
|
38
41
|
optionsLatest.current = options;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewerOptions } from "../x-star-md-viewer/index.js";
|
|
3
|
+
export interface XStarSlideViewerPlugin {
|
|
4
|
+
(ctx: ViewerOptions): void;
|
|
5
|
+
}
|
|
6
|
+
export interface XStarSlideViewerHandle {
|
|
7
|
+
getViewerContainer: () => HTMLDivElement;
|
|
8
|
+
getSlideContainer: () => HTMLDivElement;
|
|
9
|
+
}
|
|
10
|
+
export interface XStarSlideViewerProps {
|
|
11
|
+
/**
|
|
12
|
+
* CSS 类名
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
/**
|
|
16
|
+
* CSS 样式
|
|
17
|
+
*/
|
|
18
|
+
style?: React.CSSProperties;
|
|
19
|
+
/**
|
|
20
|
+
* 查看器的高度
|
|
21
|
+
*/
|
|
22
|
+
height?: React.CSSProperties['height'];
|
|
23
|
+
/**
|
|
24
|
+
* 内置主题
|
|
25
|
+
*/
|
|
26
|
+
theme?: string;
|
|
27
|
+
/**
|
|
28
|
+
* 内部 Slide 容器 CSS 类名
|
|
29
|
+
*/
|
|
30
|
+
slideClassName?: string;
|
|
31
|
+
/**
|
|
32
|
+
* 文本
|
|
33
|
+
*/
|
|
34
|
+
value?: string;
|
|
35
|
+
/**
|
|
36
|
+
* 插件
|
|
37
|
+
*/
|
|
38
|
+
plugins?: XStarSlideViewerPlugin[];
|
|
39
|
+
}
|
|
40
|
+
declare const XStarSlideViewer: React.ForwardRefExoticComponent<XStarSlideViewerProps & React.RefAttributes<XStarSlideViewerHandle>>;
|
|
41
|
+
export default XStarSlideViewer;
|
|
42
|
+
export declare const useSlideViewerRef: () => React.RefObject<XStarSlideViewerHandle>;
|