@antdv-next/x-markdown 0.1.0 → 0.1.2
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/XMarkdown/components/DebugPanel.css +44 -0
- package/dist/XMarkdown/components/DebugPanel.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/XMarkdown/components/index.js +1 -1
- package/dist/XMarkdown/index.js +1 -1
- package/dist/XMarkdown/index.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/themes/dark.css +8 -16
- package/themes/index.css +68 -32
- package/themes/light.css +8 -13
- /package/dist/XMarkdown/components/{DebugPanel.js → DebugPanel2.js} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* XMarkdown Debug Panel */
|
|
2
|
+
.xmd-debug-panel {
|
|
3
|
+
position: fixed;
|
|
4
|
+
background: rgba(0, 0, 0, 0.85);
|
|
5
|
+
border-radius: 8px;
|
|
6
|
+
padding: 12px;
|
|
7
|
+
min-width: 220px;
|
|
8
|
+
color: #fff;
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
z-index: 9999;
|
|
11
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
12
|
+
user-select: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.xmd-debug-header {
|
|
16
|
+
cursor: move;
|
|
17
|
+
padding-bottom: 8px;
|
|
18
|
+
margin-bottom: 8px;
|
|
19
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.xmd-debug-content {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: 8px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.xmd-debug-stat {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.xmd-debug-label {
|
|
35
|
+
color: rgba(255, 255, 255, 0.7);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.xmd-debug-chart {
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 60px;
|
|
41
|
+
margin-top: 8px;
|
|
42
|
+
background: rgba(255, 255, 255, 0.1);
|
|
43
|
+
border-radius: 4px;
|
|
44
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* empty css */
|
|
1
2
|
import { createElementBlock, createElementVNode, defineComponent, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, ref, toDisplayString } from "vue";
|
|
2
3
|
//#region src/XMarkdown/components/DebugPanel.vue?vue&type=script&setup=true&lang.ts
|
|
3
4
|
var _hoisted_1 = { class: "xmd-debug-content" };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import AnimationText_default from "./AnimationText.js";
|
|
2
|
-
import DebugPanel_default from "./
|
|
2
|
+
import DebugPanel_default from "./DebugPanel2.js";
|
|
3
3
|
import TailIndicator_default from "./TailIndicator.js";
|
|
4
4
|
export { AnimationText_default as AnimationText, DebugPanel_default as DebugPanel, TailIndicator_default as TailIndicator };
|
package/dist/XMarkdown/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AnimationText_default from "./components/AnimationText.js";
|
|
2
|
-
import DebugPanel_default from "./components/
|
|
2
|
+
import DebugPanel_default from "./components/DebugPanel2.js";
|
|
3
3
|
import TailIndicator_default from "./components/TailIndicator.js";
|
|
4
4
|
import { useStreaming } from "./composables/useStreaming.js";
|
|
5
5
|
import { Parser } from "./core/Parser.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import DebugPanel_default from "./components/
|
|
1
|
+
import DebugPanel_default from "./components/DebugPanel2.js";
|
|
2
2
|
import TailIndicator_default from "./components/TailIndicator.js";
|
|
3
3
|
import { useStreaming } from "./composables/useStreaming.js";
|
|
4
4
|
import { Parser } from "./core/Parser.js";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AnimationText_default from "./XMarkdown/components/AnimationText.js";
|
|
2
|
-
import DebugPanel_default from "./XMarkdown/components/
|
|
2
|
+
import DebugPanel_default from "./XMarkdown/components/DebugPanel2.js";
|
|
3
3
|
import TailIndicator_default from "./XMarkdown/components/TailIndicator.js";
|
|
4
4
|
import { useStreaming } from "./XMarkdown/composables/useStreaming.js";
|
|
5
5
|
import { Parser } from "./XMarkdown/core/Parser.js";
|
package/package.json
CHANGED
package/themes/dark.css
CHANGED
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
--margin-li: 0 0 14px 0;
|
|
22
22
|
--hr-margin: 24px 0;
|
|
23
23
|
--table-margin: 0 0 24px 0;
|
|
24
|
-
--margin-pre: 0 0 16px 0;
|
|
25
24
|
--padding-code: 16px;
|
|
26
25
|
--xmd-tail-color: var(--text-color);
|
|
27
26
|
}
|
|
@@ -47,6 +46,7 @@
|
|
|
47
46
|
|
|
48
47
|
.x-markdown-dark h3 {
|
|
49
48
|
font-size: 18px;
|
|
49
|
+
/* 18px */
|
|
50
50
|
line-height: 30px;
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
margin: var(--margin-block);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/* 列表项通用样式 */
|
|
63
64
|
.x-markdown-dark li {
|
|
64
65
|
position: relative;
|
|
65
66
|
}
|
|
@@ -98,14 +99,12 @@
|
|
|
98
99
|
.x-markdown-dark hr {
|
|
99
100
|
border: 0;
|
|
100
101
|
border-top: 1px solid var(--line-color);
|
|
101
|
-
margin: var(--hr-margin);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
.x-markdown-dark table {
|
|
105
105
|
border-collapse: collapse;
|
|
106
106
|
overflow: hidden;
|
|
107
107
|
box-shadow: 0 1px 3px rgba(255, 255, 255, 0.05);
|
|
108
|
-
margin: var(--table-margin);
|
|
109
108
|
}
|
|
110
109
|
|
|
111
110
|
.x-markdown-dark thead {
|
|
@@ -119,10 +118,10 @@
|
|
|
119
118
|
.x-markdown-dark tbody tr {
|
|
120
119
|
background-color: var(--table-body-bg);
|
|
121
120
|
transition: background-color 200ms linear;
|
|
122
|
-
}
|
|
123
121
|
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
&:hover {
|
|
123
|
+
background-color: var(--table-head-bg);
|
|
124
|
+
}
|
|
126
125
|
}
|
|
127
126
|
|
|
128
127
|
.x-markdown-dark th,
|
|
@@ -152,11 +151,7 @@
|
|
|
152
151
|
background-color: var(--cite-hover-bg);
|
|
153
152
|
}
|
|
154
153
|
|
|
155
|
-
.x-markdown-dark
|
|
156
|
-
pre
|
|
157
|
-
> code:not([class$="-highlightCode-code"]):not(
|
|
158
|
-
[class$="-codeHighlighter-code"]
|
|
159
|
-
) {
|
|
154
|
+
.x-markdown-dark pre code:not([class$="-highlighter-code"] pre code) {
|
|
160
155
|
display: block;
|
|
161
156
|
background: var(--dark-bg) !important;
|
|
162
157
|
padding: var(--padding-code);
|
|
@@ -167,10 +162,7 @@
|
|
|
167
162
|
margin: var(--margin-pre);
|
|
168
163
|
}
|
|
169
164
|
|
|
170
|
-
.x-markdown-dark
|
|
171
|
-
code:not(pre code):not([class$="-highlightCode-code"]):not(
|
|
172
|
-
[class$="-codeHighlighter-code"]
|
|
173
|
-
) {
|
|
165
|
+
.x-markdown-dark code:not([class$="-highlighter-code"] code):not(pre code) {
|
|
174
166
|
background-color: var(--dark-bg) !important;
|
|
175
167
|
color: var(--text-color) !important;
|
|
176
168
|
border-radius: var(--border-radius-small);
|
|
@@ -197,7 +189,7 @@
|
|
|
197
189
|
}
|
|
198
190
|
|
|
199
191
|
.x-markdown-dark a::after {
|
|
200
|
-
content: "
|
|
192
|
+
content: "↗";
|
|
201
193
|
margin-left: 4px;
|
|
202
194
|
vertical-align: super;
|
|
203
195
|
opacity: 0.7;
|
package/themes/index.css
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* ==========================================
|
|
2
|
+
XMarkdown – default css
|
|
3
|
+
========================================== */
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Default tag styles are gated behind `:not(.x-md-disable-all):not(.x-md-disable-<tag>)`
|
|
7
|
+
* so consumers can opt out via the `disableDefaultStyles` prop. This prevents the
|
|
8
|
+
* descendant-selector defaults (e.g. `ul`/`li`/`code`) from polluting elements
|
|
9
|
+
* rendered by custom components (such as antd `Collapse`) inside the container.
|
|
10
|
+
*/
|
|
2
11
|
|
|
3
12
|
@keyframes x-markdown-fade-in {
|
|
4
13
|
from {
|
|
@@ -35,12 +44,13 @@
|
|
|
35
44
|
color: var(--text-color);
|
|
36
45
|
}
|
|
37
46
|
|
|
47
|
+
/* xmd-tail: default styling for streaming tail indicator */
|
|
38
48
|
xmd-tail {
|
|
39
49
|
display: inline;
|
|
40
50
|
}
|
|
41
51
|
|
|
42
52
|
.xmd-tail {
|
|
43
|
-
color:
|
|
53
|
+
color: inherit;
|
|
44
54
|
font-size: inherit;
|
|
45
55
|
line-height: inherit;
|
|
46
56
|
}
|
|
@@ -60,95 +70,99 @@ xmd-tail {
|
|
|
60
70
|
white-space: pre-wrap;
|
|
61
71
|
}
|
|
62
72
|
|
|
63
|
-
.x-markdown th,
|
|
64
|
-
.x-markdown td {
|
|
73
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-th) th,
|
|
74
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-td) td {
|
|
65
75
|
padding: var(--td-th-padding);
|
|
66
76
|
}
|
|
67
77
|
|
|
68
|
-
.x-markdown th {
|
|
78
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-th) th {
|
|
69
79
|
font-weight: var(--border-font-weight);
|
|
70
80
|
}
|
|
71
81
|
|
|
72
|
-
.x-markdown pre table {
|
|
82
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-table) pre table {
|
|
73
83
|
box-shadow: none;
|
|
74
84
|
}
|
|
75
85
|
|
|
76
|
-
.x-markdown pre td,
|
|
77
|
-
.x-markdown pre th {
|
|
86
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-td) pre td,
|
|
87
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-th) pre th {
|
|
78
88
|
padding: var(--pre-th-td-padding);
|
|
79
89
|
border: none;
|
|
80
90
|
text-align: left;
|
|
81
91
|
}
|
|
82
92
|
|
|
83
|
-
.x-markdown p {
|
|
93
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-p) p {
|
|
84
94
|
margin: var(--margin-block);
|
|
85
95
|
}
|
|
86
96
|
|
|
87
|
-
.x-markdown p:first-child {
|
|
97
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-p) p:first-child {
|
|
88
98
|
margin-top: 0;
|
|
89
99
|
}
|
|
90
100
|
|
|
91
|
-
.x-markdown p:last-child {
|
|
101
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-p) p:last-child {
|
|
92
102
|
margin-bottom: 0;
|
|
93
103
|
}
|
|
94
104
|
|
|
95
|
-
.x-markdown ul,
|
|
96
|
-
.x-markdown ol {
|
|
105
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-ul) ul,
|
|
106
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-ol) ol {
|
|
97
107
|
margin: var(--margin-ul-ol);
|
|
98
108
|
padding: var(--padding-ul-ol);
|
|
99
109
|
}
|
|
100
110
|
|
|
101
|
-
.x-markdown ul:first-child,
|
|
102
|
-
.x-markdown ol:first-child {
|
|
111
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-ul) ul:first-child,
|
|
112
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-ol) ol:first-child {
|
|
103
113
|
margin-top: 0;
|
|
104
114
|
}
|
|
105
115
|
|
|
106
|
-
.x-markdown ul:last-child,
|
|
107
|
-
.x-markdown ol:last-child {
|
|
116
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-ul) ul:last-child,
|
|
117
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-ol) ol:last-child {
|
|
108
118
|
margin-bottom: 0;
|
|
109
119
|
}
|
|
110
120
|
|
|
111
|
-
.x-markdown
|
|
121
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-ol):not(.x-md-disable-li)
|
|
122
|
+
ol
|
|
123
|
+
> li {
|
|
112
124
|
list-style: decimal;
|
|
113
125
|
}
|
|
114
126
|
|
|
115
|
-
.x-markdown
|
|
127
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-ul):not(.x-md-disable-li)
|
|
128
|
+
ul
|
|
129
|
+
> li {
|
|
116
130
|
list-style: disc;
|
|
117
131
|
}
|
|
118
132
|
|
|
119
|
-
.x-markdown li {
|
|
133
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-li) li {
|
|
120
134
|
margin: var(--margin-li);
|
|
121
135
|
}
|
|
122
136
|
|
|
123
|
-
.x-markdown li:first-child {
|
|
137
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-li) li:first-child {
|
|
124
138
|
margin-top: 0;
|
|
125
139
|
}
|
|
126
140
|
|
|
127
|
-
.x-markdown li:last-child {
|
|
141
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-li) li:last-child {
|
|
128
142
|
margin-bottom: 0;
|
|
129
143
|
}
|
|
130
144
|
|
|
131
|
-
.x-markdown pre {
|
|
145
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-pre) pre {
|
|
132
146
|
margin: var(--margin-pre);
|
|
133
147
|
overflow-x: auto;
|
|
134
148
|
}
|
|
135
149
|
|
|
136
|
-
.x-markdown pre:first-child {
|
|
150
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-pre) pre:first-child {
|
|
137
151
|
margin-top: 0;
|
|
138
152
|
}
|
|
139
153
|
|
|
140
|
-
.x-markdown pre:last-child {
|
|
154
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-pre) pre:last-child {
|
|
141
155
|
margin-bottom: 0;
|
|
142
156
|
}
|
|
143
157
|
|
|
144
|
-
.x-markdown code {
|
|
158
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-code) code {
|
|
145
159
|
padding: var(--padding-code-inline);
|
|
146
160
|
margin: var(--margin-code-inline);
|
|
147
161
|
font-size: var(--code-inline-text);
|
|
148
162
|
border-radius: var(--small-border-radius);
|
|
149
163
|
}
|
|
150
164
|
|
|
151
|
-
.x-markdown pre code {
|
|
165
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-code) pre code {
|
|
152
166
|
padding: 0;
|
|
153
167
|
margin: 0;
|
|
154
168
|
font-size: inherit;
|
|
@@ -156,17 +170,17 @@ xmd-tail {
|
|
|
156
170
|
line-height: 2;
|
|
157
171
|
}
|
|
158
172
|
|
|
159
|
-
.x-markdown img {
|
|
173
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-img) img {
|
|
160
174
|
max-width: 100%;
|
|
161
175
|
height: auto;
|
|
162
176
|
margin: var(--image-margin);
|
|
163
177
|
}
|
|
164
178
|
|
|
165
|
-
.x-markdown hr {
|
|
179
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-hr) hr {
|
|
166
180
|
margin: var(--hr-margin);
|
|
167
181
|
}
|
|
168
182
|
|
|
169
|
-
.x-markdown table:not(pre) {
|
|
183
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-table) table:not(pre) {
|
|
170
184
|
margin: var(--table-margin);
|
|
171
185
|
border-collapse: collapse;
|
|
172
186
|
display: block;
|
|
@@ -175,11 +189,13 @@ xmd-tail {
|
|
|
175
189
|
overflow: auto;
|
|
176
190
|
}
|
|
177
191
|
|
|
178
|
-
.x-markdown
|
|
192
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-table)
|
|
193
|
+
table:not(pre):first-child {
|
|
179
194
|
margin-top: 0;
|
|
180
195
|
}
|
|
181
196
|
|
|
182
|
-
.x-markdown
|
|
197
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-table)
|
|
198
|
+
table:not(pre):last-child {
|
|
183
199
|
margin-bottom: 0;
|
|
184
200
|
}
|
|
185
201
|
|
|
@@ -204,3 +220,23 @@ xmd-tail {
|
|
|
204
220
|
.x-markdown .inline-katex .katex-display > .katex > .katex-html > .tag {
|
|
205
221
|
position: static;
|
|
206
222
|
}
|
|
223
|
+
|
|
224
|
+
.x-markdown .block-katex {
|
|
225
|
+
display: block;
|
|
226
|
+
margin: 1em 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/*
|
|
230
|
+
* Local overrides (NOT part of upstream @ant-design/x-markdown).
|
|
231
|
+
*
|
|
232
|
+
* The rules above are kept verbatim in sync with upstream so that future
|
|
233
|
+
* syncs remain a clean diff with minimal cognitive overhead. Do not edit
|
|
234
|
+
* the upstream rules in place — add local overrides in this section below
|
|
235
|
+
* so they are clearly separated and easy to drop on the next sync.
|
|
236
|
+
*
|
|
237
|
+
* Override the upstream `line-height: 2` on `pre code` so code blocks
|
|
238
|
+
* inherit the container line-height instead.
|
|
239
|
+
*/
|
|
240
|
+
.x-markdown:not(.x-md-disable-all):not(.x-md-disable-code) pre code {
|
|
241
|
+
line-height: inherit;
|
|
242
|
+
}
|
package/themes/light.css
CHANGED
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
|
|
48
48
|
.x-markdown-light h3 {
|
|
49
49
|
font-size: 18px;
|
|
50
|
+
/* 18px */
|
|
50
51
|
line-height: 30px;
|
|
51
52
|
}
|
|
52
53
|
|
|
@@ -60,6 +61,7 @@
|
|
|
60
61
|
margin: var(--margin-block);
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
/* 列表项通用样式 */
|
|
63
65
|
.x-markdown-light li {
|
|
64
66
|
position: relative;
|
|
65
67
|
}
|
|
@@ -119,10 +121,10 @@
|
|
|
119
121
|
.x-markdown-light tbody tr {
|
|
120
122
|
background-color: var(--table-body-bg);
|
|
121
123
|
transition: background-color 200ms linear;
|
|
122
|
-
}
|
|
123
124
|
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
&:hover {
|
|
126
|
+
background-color: var(--table-head-bg);
|
|
127
|
+
}
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
.x-markdown-light th,
|
|
@@ -152,11 +154,7 @@
|
|
|
152
154
|
background-color: var(--cite-hover-bg);
|
|
153
155
|
}
|
|
154
156
|
|
|
155
|
-
.x-markdown-light
|
|
156
|
-
pre
|
|
157
|
-
> code:not([class$="-highlightCode-code"]):not(
|
|
158
|
-
[class$="-codeHighlighter-code"]
|
|
159
|
-
) {
|
|
157
|
+
.x-markdown-light pre code:not([class$="-highlighter-code"] pre code) {
|
|
160
158
|
display: block;
|
|
161
159
|
background: var(--light-bg) !important;
|
|
162
160
|
padding: var(--padding-code);
|
|
@@ -167,10 +165,7 @@
|
|
|
167
165
|
margin: var(--margin-pre);
|
|
168
166
|
}
|
|
169
167
|
|
|
170
|
-
.x-markdown-light
|
|
171
|
-
code:not(pre code):not([class$="-highlightCode-code"]):not(
|
|
172
|
-
[class$="-codeHighlighter-code"]
|
|
173
|
-
) {
|
|
168
|
+
.x-markdown-light code:not([class$="-highlighter-code"] code):not(pre code) {
|
|
174
169
|
background-color: var(--light-bg) !important;
|
|
175
170
|
color: var(--text-color) !important;
|
|
176
171
|
border-radius: var(--border-radius-small);
|
|
@@ -197,7 +192,7 @@
|
|
|
197
192
|
}
|
|
198
193
|
|
|
199
194
|
.x-markdown-light a::after {
|
|
200
|
-
content: "
|
|
195
|
+
content: "↗";
|
|
201
196
|
margin-left: 4px;
|
|
202
197
|
vertical-align: super;
|
|
203
198
|
opacity: 0.7;
|
|
File without changes
|