@duskmoon-dev/el-markdown 0.2.0 → 0.3.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/cjs/index.js +20 -193
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/register.js +20 -193
- package/dist/cjs/register.js.map +3 -3
- package/dist/esm/index.js +20 -193
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/register.js +20 -193
- package/dist/esm/register.js.map +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/el-dm-markdown.d.ts.map +1 -1
- package/package.json +4 -3
package/dist/esm/register.js
CHANGED
|
@@ -1987,6 +1987,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`);
|
|
|
1987
1987
|
|
|
1988
1988
|
// src/el-dm-markdown.ts
|
|
1989
1989
|
import { BaseElement, css as css2 } from "@duskmoon-dev/el-core";
|
|
1990
|
+
import { css as markdownBodyCSS } from "@duskmoon-dev/core/components/markdown-body";
|
|
1990
1991
|
|
|
1991
1992
|
// ../../node_modules/.bun/bail@2.0.2/node_modules/bail/index.js
|
|
1992
1993
|
function bail(error) {
|
|
@@ -27111,217 +27112,43 @@ var atomOneLight = `
|
|
|
27111
27112
|
`;
|
|
27112
27113
|
|
|
27113
27114
|
// src/el-dm-markdown.ts
|
|
27115
|
+
var coreStyles = markdownBodyCSS.replace(/@layer\s+components\s*\{/, "").replace(/\}\s*$/, "");
|
|
27114
27116
|
var baseStyles = css2`
|
|
27115
27117
|
:host {
|
|
27116
27118
|
display: block;
|
|
27117
27119
|
font-family: var(
|
|
27118
27120
|
--dm-markdown-font-family,
|
|
27119
|
-
var(--
|
|
27121
|
+
var(--font-family, system-ui, -apple-system, sans-serif)
|
|
27120
27122
|
);
|
|
27121
27123
|
line-height: var(--dm-markdown-line-height, 1.6);
|
|
27122
|
-
color: var(--
|
|
27124
|
+
color: var(--color-on-surface);
|
|
27123
27125
|
}
|
|
27124
27126
|
|
|
27125
27127
|
:host([hidden]) {
|
|
27126
27128
|
display: none !important;
|
|
27127
27129
|
}
|
|
27128
27130
|
|
|
27131
|
+
/* Import core markdown-body styles */
|
|
27132
|
+
${coreStyles}
|
|
27133
|
+
|
|
27129
27134
|
.container {
|
|
27130
27135
|
width: 100%;
|
|
27131
27136
|
}
|
|
27132
27137
|
|
|
27133
|
-
.
|
|
27138
|
+
.markdown-body {
|
|
27134
27139
|
overflow-wrap: break-word;
|
|
27135
27140
|
word-wrap: break-word;
|
|
27136
27141
|
}
|
|
27137
27142
|
|
|
27138
|
-
/* Typography */
|
|
27139
|
-
.content h1,
|
|
27140
|
-
.content h2,
|
|
27141
|
-
.content h3,
|
|
27142
|
-
.content h4,
|
|
27143
|
-
.content h5,
|
|
27144
|
-
.content h6 {
|
|
27145
|
-
margin-top: 1.5em;
|
|
27146
|
-
margin-bottom: 0.5em;
|
|
27147
|
-
font-weight: var(--dm-font-weight-semibold, 600);
|
|
27148
|
-
line-height: 1.25;
|
|
27149
|
-
}
|
|
27150
|
-
|
|
27151
|
-
.content h1 {
|
|
27152
|
-
font-size: 2em;
|
|
27153
|
-
}
|
|
27154
|
-
.content h2 {
|
|
27155
|
-
font-size: 1.5em;
|
|
27156
|
-
border-bottom: 1px solid var(--dm-gray-200, #e5e7eb);
|
|
27157
|
-
padding-bottom: 0.3em;
|
|
27158
|
-
}
|
|
27159
|
-
.content h3 {
|
|
27160
|
-
font-size: 1.25em;
|
|
27161
|
-
}
|
|
27162
|
-
.content h4 {
|
|
27163
|
-
font-size: 1em;
|
|
27164
|
-
}
|
|
27165
|
-
.content h5 {
|
|
27166
|
-
font-size: 0.875em;
|
|
27167
|
-
}
|
|
27168
|
-
.content h6 {
|
|
27169
|
-
font-size: 0.85em;
|
|
27170
|
-
color: var(--dm-gray-500, #6b7280);
|
|
27171
|
-
}
|
|
27172
|
-
|
|
27173
|
-
.content p {
|
|
27174
|
-
margin-top: 0;
|
|
27175
|
-
margin-bottom: 1em;
|
|
27176
|
-
}
|
|
27177
|
-
|
|
27178
|
-
.content a {
|
|
27179
|
-
color: var(--dm-primary, #3b82f6);
|
|
27180
|
-
text-decoration: none;
|
|
27181
|
-
}
|
|
27182
|
-
|
|
27183
|
-
.content a:hover {
|
|
27184
|
-
text-decoration: underline;
|
|
27185
|
-
}
|
|
27186
|
-
|
|
27187
|
-
/* Lists */
|
|
27188
|
-
.content ul,
|
|
27189
|
-
.content ol {
|
|
27190
|
-
margin-top: 0;
|
|
27191
|
-
margin-bottom: 1em;
|
|
27192
|
-
padding-left: 2em;
|
|
27193
|
-
}
|
|
27194
|
-
|
|
27195
|
-
.content li {
|
|
27196
|
-
margin-bottom: 0.25em;
|
|
27197
|
-
}
|
|
27198
|
-
|
|
27199
|
-
.content li > * {
|
|
27200
|
-
display: inline;
|
|
27201
|
-
}
|
|
27202
|
-
|
|
27203
|
-
.content li > ul,
|
|
27204
|
-
.content li > ol {
|
|
27205
|
-
display: block;
|
|
27206
|
-
margin-top: 0.25em;
|
|
27207
|
-
margin-bottom: 0;
|
|
27208
|
-
}
|
|
27209
|
-
|
|
27210
|
-
/* Task lists (GFM) */
|
|
27211
|
-
.content ul.contains-task-list {
|
|
27212
|
-
list-style: none;
|
|
27213
|
-
padding-left: 1em;
|
|
27214
|
-
}
|
|
27215
|
-
|
|
27216
|
-
.content .task-list-item {
|
|
27217
|
-
display: flex;
|
|
27218
|
-
align-items: baseline;
|
|
27219
|
-
gap: 0.5em;
|
|
27220
|
-
}
|
|
27221
|
-
|
|
27222
|
-
.content .task-list-item input[type='checkbox'] {
|
|
27223
|
-
margin: 0;
|
|
27224
|
-
}
|
|
27225
|
-
|
|
27226
|
-
/* Code */
|
|
27227
|
-
.content code {
|
|
27228
|
-
font-family: var(
|
|
27229
|
-
--dm-markdown-code-font-family,
|
|
27230
|
-
ui-monospace,
|
|
27231
|
-
SFMono-Regular,
|
|
27232
|
-
Menlo,
|
|
27233
|
-
Monaco,
|
|
27234
|
-
Consolas,
|
|
27235
|
-
monospace
|
|
27236
|
-
);
|
|
27237
|
-
font-size: 0.875em;
|
|
27238
|
-
padding: 0.2em 0.4em;
|
|
27239
|
-
background-color: var(--dm-gray-100, #f3f4f6);
|
|
27240
|
-
border-radius: var(--dm-radius-sm, 0.25rem);
|
|
27241
|
-
}
|
|
27242
|
-
|
|
27243
|
-
.content pre {
|
|
27244
|
-
margin-top: 0;
|
|
27245
|
-
margin-bottom: 1em;
|
|
27246
|
-
padding: 1em;
|
|
27247
|
-
overflow-x: auto;
|
|
27248
|
-
border-radius: var(--dm-radius-md, 0.5rem);
|
|
27249
|
-
background-color: var(--dm-gray-100, #f3f4f6);
|
|
27250
|
-
}
|
|
27251
|
-
|
|
27252
|
-
.content pre code {
|
|
27253
|
-
padding: 0;
|
|
27254
|
-
background-color: transparent;
|
|
27255
|
-
font-size: 0.875em;
|
|
27256
|
-
line-height: 1.5;
|
|
27257
|
-
}
|
|
27258
|
-
|
|
27259
|
-
/* Blockquote */
|
|
27260
|
-
.content blockquote {
|
|
27261
|
-
margin: 0 0 1em;
|
|
27262
|
-
padding: 0.5em 1em;
|
|
27263
|
-
border-left: 4px solid var(--dm-gray-300, #d1d5db);
|
|
27264
|
-
color: var(--dm-gray-600, #4b5563);
|
|
27265
|
-
background-color: var(--dm-gray-50, #f9fafb);
|
|
27266
|
-
}
|
|
27267
|
-
|
|
27268
|
-
.content blockquote > :first-child {
|
|
27269
|
-
margin-top: 0;
|
|
27270
|
-
}
|
|
27271
|
-
|
|
27272
|
-
.content blockquote > :last-child {
|
|
27273
|
-
margin-bottom: 0;
|
|
27274
|
-
}
|
|
27275
|
-
|
|
27276
|
-
/* Tables */
|
|
27277
|
-
.content table {
|
|
27278
|
-
width: 100%;
|
|
27279
|
-
margin-bottom: 1em;
|
|
27280
|
-
border-collapse: collapse;
|
|
27281
|
-
border-spacing: 0;
|
|
27282
|
-
}
|
|
27283
|
-
|
|
27284
|
-
.content th,
|
|
27285
|
-
.content td {
|
|
27286
|
-
padding: 0.5em 1em;
|
|
27287
|
-
border: 1px solid var(--dm-gray-300, #d1d5db);
|
|
27288
|
-
text-align: left;
|
|
27289
|
-
}
|
|
27290
|
-
|
|
27291
|
-
.content th {
|
|
27292
|
-
font-weight: var(--dm-font-weight-semibold, 600);
|
|
27293
|
-
background-color: var(--dm-gray-50, #f9fafb);
|
|
27294
|
-
}
|
|
27295
|
-
|
|
27296
|
-
.content tr:nth-child(even) {
|
|
27297
|
-
background-color: var(--dm-gray-50, #f9fafb);
|
|
27298
|
-
}
|
|
27299
|
-
|
|
27300
|
-
/* Horizontal rule */
|
|
27301
|
-
.content hr {
|
|
27302
|
-
height: 0.25em;
|
|
27303
|
-
margin: 1.5em 0;
|
|
27304
|
-
padding: 0;
|
|
27305
|
-
background-color: var(--dm-gray-200, #e5e7eb);
|
|
27306
|
-
border: 0;
|
|
27307
|
-
}
|
|
27308
|
-
|
|
27309
|
-
/* Images */
|
|
27310
|
-
.content img {
|
|
27311
|
-
max-width: 100%;
|
|
27312
|
-
height: auto;
|
|
27313
|
-
border-radius: var(--dm-radius-md, 0.5rem);
|
|
27314
|
-
}
|
|
27315
|
-
|
|
27316
27143
|
/* Mermaid diagrams */
|
|
27317
|
-
.
|
|
27144
|
+
.markdown-body .language-mermaid {
|
|
27318
27145
|
display: flex;
|
|
27319
27146
|
justify-content: center;
|
|
27320
27147
|
background: transparent !important;
|
|
27321
27148
|
padding: 1em 0;
|
|
27322
27149
|
}
|
|
27323
27150
|
|
|
27324
|
-
.
|
|
27151
|
+
.markdown-body .language-mermaid svg {
|
|
27325
27152
|
max-width: 100%;
|
|
27326
27153
|
height: auto;
|
|
27327
27154
|
}
|
|
@@ -27332,7 +27159,7 @@ var baseStyles = css2`
|
|
|
27332
27159
|
align-items: center;
|
|
27333
27160
|
justify-content: center;
|
|
27334
27161
|
padding: 2em;
|
|
27335
|
-
color: var(--
|
|
27162
|
+
color: var(--color-on-surface-variant);
|
|
27336
27163
|
}
|
|
27337
27164
|
|
|
27338
27165
|
.loading::after {
|
|
@@ -27340,8 +27167,8 @@ var baseStyles = css2`
|
|
|
27340
27167
|
width: 1.5em;
|
|
27341
27168
|
height: 1.5em;
|
|
27342
27169
|
margin-left: 0.5em;
|
|
27343
|
-
border: 2px solid var(--
|
|
27344
|
-
border-top-color: var(--
|
|
27170
|
+
border: 2px solid var(--color-outline);
|
|
27171
|
+
border-top-color: var(--color-primary);
|
|
27345
27172
|
border-radius: 50%;
|
|
27346
27173
|
animation: spin 0.6s linear infinite;
|
|
27347
27174
|
}
|
|
@@ -27355,10 +27182,10 @@ var baseStyles = css2`
|
|
|
27355
27182
|
/* Error state */
|
|
27356
27183
|
.error {
|
|
27357
27184
|
padding: 1em;
|
|
27358
|
-
color: var(--
|
|
27359
|
-
background-color:
|
|
27360
|
-
border: 1px solid
|
|
27361
|
-
border-radius:
|
|
27185
|
+
color: var(--color-error);
|
|
27186
|
+
background-color: oklch(95% 0.05 25);
|
|
27187
|
+
border: 1px solid oklch(85% 0.1 25);
|
|
27188
|
+
border-radius: 0.5rem;
|
|
27362
27189
|
}
|
|
27363
27190
|
|
|
27364
27191
|
/* Streaming cursor */
|
|
@@ -27366,7 +27193,7 @@ var baseStyles = css2`
|
|
|
27366
27193
|
display: inline-block;
|
|
27367
27194
|
width: 2px;
|
|
27368
27195
|
height: 1.2em;
|
|
27369
|
-
background-color: var(--
|
|
27196
|
+
background-color: var(--color-primary);
|
|
27370
27197
|
margin-left: 2px;
|
|
27371
27198
|
vertical-align: text-bottom;
|
|
27372
27199
|
animation: cursor-blink 1s step-end infinite;
|
|
@@ -27760,7 +27587,7 @@ class ElDmMarkdown extends BaseElement {
|
|
|
27760
27587
|
const cursorHtml = this._isStreaming ? '<span class="streaming-cursor" aria-hidden="true"></span>' : "";
|
|
27761
27588
|
return `
|
|
27762
27589
|
<div class="container" part="container">
|
|
27763
|
-
<div class="content" part="content">${this._fragment}${cursorHtml}</div>
|
|
27590
|
+
<div class="content markdown-body" part="content">${this._fragment}${cursorHtml}</div>
|
|
27764
27591
|
</div>
|
|
27765
27592
|
`;
|
|
27766
27593
|
}
|
|
@@ -27775,5 +27602,5 @@ function register() {
|
|
|
27775
27602
|
// src/register.ts
|
|
27776
27603
|
register();
|
|
27777
27604
|
|
|
27778
|
-
//# debugId=
|
|
27605
|
+
//# debugId=8826492BE0B3A78664756E2164756E21
|
|
27779
27606
|
//# sourceMappingURL=register.js.map
|