@airalogy/aimd-renderer 2.5.0 → 2.7.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/README.md +44 -5
- package/README.zh-CN.md +44 -5
- package/dist/aimd-renderer.css +1 -1
- package/dist/common/criticMarkup.d.ts +10 -0
- package/dist/common/criticMarkup.d.ts.map +1 -0
- package/dist/common/processor.d.ts.map +1 -1
- package/dist/common/unified-token-renderer.d.ts.map +1 -1
- package/dist/html.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +263 -211
- package/dist/{processor-B2mByErv.js → processor-BOCQYqXE.js} +3065 -2146
- package/dist/readonly-record-renderer-CkzY7UvT.js +711 -0
- package/dist/vue/index.d.ts +2 -1
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/readonly-record-renderer.d.ts +42 -0
- package/dist/vue/readonly-record-renderer.d.ts.map +1 -0
- package/dist/vue/vue-renderer.d.ts +22 -1
- package/dist/vue/vue-renderer.d.ts.map +1 -1
- package/dist/vue.js +17 -9
- package/package.json +6 -6
- package/src/__tests__/renderer.test.ts +435 -2
- package/src/common/criticMarkup.ts +97 -0
- package/src/common/processor.ts +186 -43
- package/src/common/unified-token-renderer.ts +104 -24
- package/src/index.ts +21 -0
- package/src/styles/katex.css +174 -0
- package/src/vue/index.ts +21 -0
- package/src/vue/readonly-record-renderer.ts +747 -0
- package/src/vue/vue-renderer.ts +318 -48
package/src/styles/katex.css
CHANGED
|
@@ -1,2 +1,176 @@
|
|
|
1
1
|
/* Re-export KaTeX base styles for AIMD renderer consumers. */
|
|
2
2
|
@import "katex/dist/katex.min.css";
|
|
3
|
+
|
|
4
|
+
.aimd-field__metadata-host {
|
|
5
|
+
position: relative;
|
|
6
|
+
cursor: help;
|
|
7
|
+
outline: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.aimd-field__metadata-host:hover,
|
|
11
|
+
.aimd-field__metadata-host:focus,
|
|
12
|
+
.aimd-field__metadata-host:focus-within {
|
|
13
|
+
z-index: 90;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.aimd-field__metadata-host:focus-visible {
|
|
17
|
+
border-radius: 4px;
|
|
18
|
+
box-shadow: 0 0 0 2px rgba(65, 129, 253, 0.24);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.aimd-field__metadata-host .aimd-field__title {
|
|
22
|
+
text-decoration-line: underline;
|
|
23
|
+
text-decoration-style: dotted;
|
|
24
|
+
text-decoration-color: rgba(15, 23, 42, 0.36);
|
|
25
|
+
text-underline-offset: 3px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.aimd-field__metadata-popover {
|
|
29
|
+
position: absolute;
|
|
30
|
+
z-index: 80;
|
|
31
|
+
inset-inline-start: 0;
|
|
32
|
+
top: calc(100% + 7px);
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
gap: 4px;
|
|
36
|
+
width: max-content;
|
|
37
|
+
min-width: 220px;
|
|
38
|
+
max-width: min(360px, 82vw);
|
|
39
|
+
padding: 8px 10px;
|
|
40
|
+
border-radius: 8px;
|
|
41
|
+
background: rgba(15, 23, 42, 0.96);
|
|
42
|
+
color: #f8fafc;
|
|
43
|
+
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
|
|
44
|
+
font-size: 12px;
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
line-height: 1.45;
|
|
47
|
+
letter-spacing: 0;
|
|
48
|
+
text-align: left;
|
|
49
|
+
text-transform: none;
|
|
50
|
+
white-space: normal;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
opacity: 0;
|
|
53
|
+
visibility: hidden;
|
|
54
|
+
transform: translateY(-2px);
|
|
55
|
+
transition:
|
|
56
|
+
opacity 120ms ease,
|
|
57
|
+
transform 120ms ease,
|
|
58
|
+
visibility 120ms ease;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.aimd-field__metadata-popover::before {
|
|
62
|
+
content: "";
|
|
63
|
+
position: absolute;
|
|
64
|
+
inset-inline-start: 14px;
|
|
65
|
+
top: -5px;
|
|
66
|
+
width: 10px;
|
|
67
|
+
height: 10px;
|
|
68
|
+
background: rgba(15, 23, 42, 0.96);
|
|
69
|
+
transform: rotate(45deg);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.aimd-field__metadata-popover-line {
|
|
73
|
+
display: block;
|
|
74
|
+
color: inherit;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.aimd-field__metadata-examples {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-wrap: wrap;
|
|
80
|
+
align-items: center;
|
|
81
|
+
gap: 4px;
|
|
82
|
+
padding-top: 1px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.aimd-field__metadata-examples-label {
|
|
86
|
+
color: rgba(226, 232, 240, 0.78);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.aimd-field__metadata-example {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
max-width: 100%;
|
|
93
|
+
padding: 1px 6px;
|
|
94
|
+
border: 1px solid rgba(248, 250, 252, 0.18);
|
|
95
|
+
border-radius: 5px;
|
|
96
|
+
background: rgba(248, 250, 252, 0.1);
|
|
97
|
+
color: #f8fafc;
|
|
98
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
99
|
+
font-size: 11px;
|
|
100
|
+
font-weight: 600;
|
|
101
|
+
line-height: 1.45;
|
|
102
|
+
overflow-wrap: anywhere;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.aimd-field__metadata-host:hover > .aimd-field__metadata-popover,
|
|
106
|
+
.aimd-field__metadata-host:focus > .aimd-field__metadata-popover,
|
|
107
|
+
.aimd-field__metadata-host:focus-within > .aimd-field__metadata-popover {
|
|
108
|
+
opacity: 1;
|
|
109
|
+
visibility: visible;
|
|
110
|
+
transform: translateY(0);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.aimd-critic {
|
|
114
|
+
border-radius: 4px;
|
|
115
|
+
padding: 0 0.14em;
|
|
116
|
+
box-decoration-break: clone;
|
|
117
|
+
-webkit-box-decoration-break: clone;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.aimd-critic--addition {
|
|
121
|
+
background: rgba(22, 163, 74, 0.13);
|
|
122
|
+
color: #166534;
|
|
123
|
+
text-decoration: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.aimd-critic--deletion {
|
|
127
|
+
background: rgba(220, 38, 38, 0.1);
|
|
128
|
+
color: #991b1b;
|
|
129
|
+
text-decoration-line: line-through;
|
|
130
|
+
text-decoration-thickness: 0.08em;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.aimd-critic--highlight {
|
|
134
|
+
background: rgba(250, 204, 21, 0.36);
|
|
135
|
+
color: inherit;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.aimd-critic--substitution {
|
|
139
|
+
background: rgba(99, 102, 241, 0.08);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.aimd-critic--substitution .aimd-critic {
|
|
143
|
+
margin-inline: 0.04em;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.aimd-critic__replacement-arrow {
|
|
147
|
+
color: #64748b;
|
|
148
|
+
font-size: 0.86em;
|
|
149
|
+
font-weight: 600;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.aimd-critic--comment {
|
|
153
|
+
display: inline-flex;
|
|
154
|
+
align-items: baseline;
|
|
155
|
+
gap: 0.34em;
|
|
156
|
+
padding: 0.03em 0.44em;
|
|
157
|
+
border: 1px solid rgba(37, 99, 235, 0.22);
|
|
158
|
+
border-radius: 999px;
|
|
159
|
+
background: rgba(37, 99, 235, 0.09);
|
|
160
|
+
color: #1e3a8a;
|
|
161
|
+
font-size: 0.92em;
|
|
162
|
+
line-height: 1.5;
|
|
163
|
+
vertical-align: baseline;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.aimd-critic__comment-label {
|
|
167
|
+
color: #2563eb;
|
|
168
|
+
font-size: 0.78em;
|
|
169
|
+
font-weight: 700;
|
|
170
|
+
letter-spacing: 0.02em;
|
|
171
|
+
text-transform: uppercase;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.aimd-critic__comment-body {
|
|
175
|
+
color: inherit;
|
|
176
|
+
}
|
package/src/vue/index.ts
CHANGED
|
@@ -12,14 +12,35 @@ export {
|
|
|
12
12
|
createEmbeddedRenderer,
|
|
13
13
|
createMermaidRenderer,
|
|
14
14
|
createStepCardRenderer,
|
|
15
|
+
loadShikiHighlighter,
|
|
16
|
+
type CodeBlockRendererOptions,
|
|
15
17
|
type ElementRenderer,
|
|
16
18
|
hastToVue,
|
|
17
19
|
renderToVNodes,
|
|
20
|
+
type LoadShikiHighlighterOptions,
|
|
18
21
|
type AimdStepCardRendererOptions,
|
|
19
22
|
type ShikiHighlighter,
|
|
20
23
|
type VueRendererOptions,
|
|
21
24
|
} from './vue-renderer'
|
|
22
25
|
|
|
26
|
+
export {
|
|
27
|
+
AIMD_RECORD_RENDER_SCOPES,
|
|
28
|
+
createReadonlyRecordAimdRenderers,
|
|
29
|
+
createReadonlyRecordElementRenderers,
|
|
30
|
+
createReadonlyRecordRenderContext,
|
|
31
|
+
normalizeRecordRenderValue,
|
|
32
|
+
renderReadonlyRecordToVue,
|
|
33
|
+
type AimdRecordRenderScope,
|
|
34
|
+
type AimdRecordRenderValue,
|
|
35
|
+
type ReadonlyRecordAsset,
|
|
36
|
+
type ReadonlyRecordAssetKind,
|
|
37
|
+
type ReadonlyRecordAssetResolveContext,
|
|
38
|
+
type ReadonlyRecordAssetResolver,
|
|
39
|
+
type ReadonlyRecordMarkdownRenderOptions,
|
|
40
|
+
type ReadonlyRecordRenderContextInput,
|
|
41
|
+
type ReadonlyRecordVueRendererOptions,
|
|
42
|
+
} from './readonly-record-renderer'
|
|
43
|
+
|
|
23
44
|
export {
|
|
24
45
|
renderToVue,
|
|
25
46
|
createRenderer,
|