@elmethis/core 0.4.7 → 0.5.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/containments/ElmConfirmModal.vue2.mjs +2 -4
- package/dist/components/form/ElmCheckbox.vue2.mjs +4 -4
- package/dist/components/icon/ElmToggleTheme.vue2.mjs +4 -4
- package/dist/components/icon/languages/C.vue2.mjs +2 -2
- package/dist/components/icon/languages/Cplusplus.vue2.mjs +2 -2
- package/dist/components/icon/languages/Csharp.vue2.mjs +2 -2
- package/dist/components/icon/languages/Css.vue2.mjs +2 -2
- package/dist/components/icon/languages/Go.vue2.mjs +2 -2
- package/dist/components/icon/languages/Html.vue2.mjs +2 -2
- package/dist/components/icon/languages/Java.vue2.mjs +2 -2
- package/dist/components/icon/languages/Javascript.vue2.mjs +2 -2
- package/dist/components/icon/languages/Json.vue2.mjs +2 -2
- package/dist/components/icon/languages/Kotlin.vue2.mjs +2 -2
- package/dist/components/icon/languages/Lua.vue2.mjs +2 -2
- package/dist/components/icon/languages/Npm.vue2.mjs +2 -2
- package/dist/components/icon/languages/Python.vue2.mjs +2 -2
- package/dist/components/icon/languages/Rust.vue2.mjs +2 -2
- package/dist/components/icon/languages/Sql.vue2.mjs +2 -2
- package/dist/components/icon/languages/Terraform.vue2.mjs +2 -2
- package/dist/components/icon/languages/Typescript copy.vue2.mjs +2 -2
- package/dist/components/icon/languages/Typescript.vue2.mjs +2 -2
- package/dist/components/others/ElmJsonComponentRenderer.vue2.mjs +1 -0
- package/dist/components/others/ElmMarkdown.stories.d.ts +6 -0
- package/dist/components/others/ElmMarkdown.vue.d.ts +5 -0
- package/dist/components/others/ElmMarkdown.vue.mjs +270 -0
- package/dist/components/others/ElmMarkdown.vue2.mjs +4 -0
- package/dist/components/typography/ElmInlineText.vue.d.ts +20 -2
- package/dist/components/typography/ElmInlineText.vue2.mjs +19 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +28 -26
- package/dist/node_modules/.pnpm/marked@16.2.0/node_modules/marked/lib/marked.esm.mjs +1084 -0
- package/package.json +7 -6
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
"use strict";
|
|
3
|
+
try {
|
|
4
|
+
if (typeof document != "undefined") {
|
|
5
|
+
var elementStyle = document.createElement("style");
|
|
6
|
+
elementStyle.appendChild(document.createTextNode(".v-enter-to[data-v-fd68c0a3],.v-leave-from[data-v-fd68c0a3]{opacity:1}.v-enter-active[data-v-fd68c0a3],.v-leave-active[data-v-fd68c0a3]{transition:opacity .15s}.v-enter-from[data-v-fd68c0a3],.v-leave-to[data-v-fd68c0a3]{opacity:0}\n.v-enter-to[data-v-d15a5efe],.v-leave-from[data-v-d15a5efe]{opacity:1}.v-enter-active[data-v-d15a5efe],.v-leave-active[data-v-d15a5efe]{transition:opacity .1s}.v-enter-from[data-v-d15a5efe],.v-leave-to[data-v-d15a5efe]{opacity:0}\n.fade-enter-active[data-v-12f55baa],.fade-leave-active[data-v-12f55baa]{transition:all .3s ease}.fade-enter-from[data-v-12f55baa],.fade-leave-to[data-v-12f55baa]{opacity:0;transform:translate(30px)}\n.v-enter-to[data-v-84bc9c5d],.v-leave-from[data-v-84bc9c5d]{opacity:1}.v-enter-active[data-v-84bc9c5d],.v-leave-active[data-v-84bc9c5d]{transition:opacity .15s}.v-enter-from[data-v-84bc9c5d],.v-leave-to[data-v-84bc9c5d]{opacity:0}\n.v-enter-to[data-v-4e995755],.v-leave-from[data-v-4e995755]{opacity:1}.v-enter-active[data-v-4e995755],.v-leave-active[data-v-4e995755]{transition:opacity .3s}.v-enter-from[data-v-4e995755],.v-leave-to[data-v-4e995755]{opacity:0}\n.elmethis-list-common{margin-block:1rem;opacity:var(--opacity);transition:opacity .8s;box-sizing:border-box;padding-left:1.25rem}.elmethis-bulleted-list li{box-sizing:border-box;padding-left:.5rem;margin-block:.75rem}.elmethis-bulleted-list li::marker{content:url(data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMTYgMTYnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICA+CiAgICA8cGF0aAogICAgICBmaWxsPScjNDQ5NzYzJwogICAgICBvcGFjaXR5PScwLjgnCiAgICAgIGQ9J00zIDMuNzMyYTEuNSAxLjUgMCAwIDEgMi4zMDUtMS4yNjVsNi43MDYgNC4yNjdhMS41IDEuNSAwIDAgMSAwIDIuNTMxbC02LjcwNiA0LjI2OEExLjUgMS41IDAgMCAxIDMgMTIuMjY3VjMuNzMyWicKICAgIC8+CiAgPC9zdmc+)}.elmethis-bulleted-list li ul li::marker{content:url(data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMjQgMjQnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICAgIHN0cm9rZT0nIzQ0OTc2MycKICAgIGZpbGw9J3RyYW5zcGFyZW50JwogID4KICAgIDxwYXRoCiAgICAgIHN0cm9rZUxpbmVjYXA9J3JvdW5kJwogICAgICBzdHJva2VMaW5lam9pbj0ncm91bmQnCiAgICAgIGQ9J001LjI1IDUuNjUzYzAtLjg1Ni45MTctMS4zOTggMS42NjctLjk4NmwxMS41NCA2LjM0N2ExLjEyNSAxLjEyNSAwIDAgMSAwIDEuOTcybC0xMS41NCA2LjM0N2ExLjEyNSAxLjEyNSAwIDAgMS0xLjY2Ny0uOTg2VjUuNjUzWicKICAgIC8+CiAgPC9zdmc+)}.elmethis-bulleted-list li ul li ul li::marker{content:url(data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMjAgMjAnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICAgIHN0cm9rZT0nIzQ0OTc2MycKICAgIGZpbGw9JyM0NDk3NjMnCiAgPgogICAgPHBhdGgKICAgICAgZmlsbFJ1bGU9J2V2ZW5vZGQnCiAgICAgIGQ9J004LjIyIDUuMjJhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0LjI1IDQuMjVhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNC4yNSA0LjI1YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTEuOTQgMTAgOC4yMiA2LjI4YS43NS43NSAwIDAgMSAwLTEuMDZaJwogICAgICBjbGlwUnVsZT0nZXZlbm9kZCcKICAgIC8+CiAgPC9zdmc+)}.elmethis-numbered-list li{box-sizing:border-box;padding-left:.25rem;margin-block:.75rem;margin-left:.25rem;list-style-type:decimal}.elmethis-numbered-list li::marker{font-weight:700;color:#9771bd}.elmethis-numbered-list li ol li{list-style-type:lower-alpha}.elmethis-numbered-list li ol li ol li{list-style-type:lower-roman}.elmethis-numbered-list li ol li ol li ol li{list-style-type:lower-greek}"));
|
|
7
|
+
document.head.appendChild(elementStyle);
|
|
8
|
+
}
|
|
9
|
+
} catch (e) {
|
|
10
|
+
console.error("vite-plugin-css-injected-by-js", e);
|
|
11
|
+
}
|
|
12
|
+
})();
|
|
13
|
+
import { defineComponent, defineAsyncComponent, createElementBlock, openBlock, createBlock, resolveDynamicComponent, h } from "vue";
|
|
14
|
+
import { marked as d } from "../../node_modules/.pnpm/marked@16.2.0/node_modules/marked/lib/marked.esm.mjs";
|
|
15
|
+
import "@mdi/js";
|
|
16
|
+
import "polished";
|
|
17
|
+
import "@vueuse/core";
|
|
18
|
+
import ElmBlockFallback from "../fallback/ElmBlockFallback.vue.mjs";
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
import "lodash-es";
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
import "nanoid";
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
28
|
+
__name: "ElmMarkdown",
|
|
29
|
+
props: {
|
|
30
|
+
markdown: {}
|
|
31
|
+
},
|
|
32
|
+
setup(__props) {
|
|
33
|
+
const AsyncElmInlineText = defineAsyncComponent({
|
|
34
|
+
loader: () => import("../typography/ElmInlineText.vue.mjs")
|
|
35
|
+
});
|
|
36
|
+
const AsyncElmHeading = defineAsyncComponent({
|
|
37
|
+
loader: () => import("../typography/ElmHeading.vue.mjs"),
|
|
38
|
+
loadingComponent: ElmBlockFallback
|
|
39
|
+
});
|
|
40
|
+
const AsyncElmParagraph = defineAsyncComponent({
|
|
41
|
+
loader: () => import("../typography/ElmParagraph.vue.mjs"),
|
|
42
|
+
loadingComponent: ElmBlockFallback
|
|
43
|
+
});
|
|
44
|
+
const AsyncElmList = defineAsyncComponent({
|
|
45
|
+
loader: () => import("../typography/ElmList.vue3.mjs"),
|
|
46
|
+
loadingComponent: ElmBlockFallback
|
|
47
|
+
});
|
|
48
|
+
const AsyncElmBlockQuote = defineAsyncComponent({
|
|
49
|
+
loader: () => import("../typography/ElmBlockQuote.vue.mjs"),
|
|
50
|
+
loadingComponent: ElmBlockFallback
|
|
51
|
+
});
|
|
52
|
+
const AsyncElmDivider = defineAsyncComponent({
|
|
53
|
+
loader: () => import("../typography/ElmDivider.vue.mjs"),
|
|
54
|
+
loadingComponent: ElmBlockFallback
|
|
55
|
+
});
|
|
56
|
+
const AsyncElmImage = defineAsyncComponent({
|
|
57
|
+
loader: () => import("../media/ElmImage.vue.mjs"),
|
|
58
|
+
loadingComponent: ElmBlockFallback
|
|
59
|
+
});
|
|
60
|
+
const AsyncElmCodeBlock = defineAsyncComponent({
|
|
61
|
+
loader: () => import("../code/ElmCodeBlock.vue.mjs"),
|
|
62
|
+
loadingComponent: ElmBlockFallback
|
|
63
|
+
});
|
|
64
|
+
const AsyncElmTable = defineAsyncComponent({
|
|
65
|
+
loader: () => import("../table/ElmTable.vue.mjs"),
|
|
66
|
+
loadingComponent: ElmBlockFallback
|
|
67
|
+
});
|
|
68
|
+
const AsyncElmTableHeader = defineAsyncComponent({
|
|
69
|
+
loader: () => import("../table/ElmTableHeader.vue.mjs"),
|
|
70
|
+
loadingComponent: ElmBlockFallback
|
|
71
|
+
});
|
|
72
|
+
const AsyncElmTableBody = defineAsyncComponent({
|
|
73
|
+
loader: () => import("../table/ElmTableBody.vue2.mjs"),
|
|
74
|
+
loadingComponent: ElmBlockFallback
|
|
75
|
+
});
|
|
76
|
+
const AsyncElmTableRow = defineAsyncComponent({
|
|
77
|
+
loader: () => import("../table/ElmTableRow.vue.mjs"),
|
|
78
|
+
loadingComponent: ElmBlockFallback
|
|
79
|
+
});
|
|
80
|
+
const AsyncElmTableCell = defineAsyncComponent({
|
|
81
|
+
loader: () => import("../table/ElmTableCell.vue.mjs"),
|
|
82
|
+
loadingComponent: ElmBlockFallback
|
|
83
|
+
});
|
|
84
|
+
const renderByToken = ({ tokens }) => {
|
|
85
|
+
const results = [];
|
|
86
|
+
for (const token of tokens) {
|
|
87
|
+
switch (token.type) {
|
|
88
|
+
case "blockquote":
|
|
89
|
+
if (token.tokens != null && token.tokens.length !== 0) {
|
|
90
|
+
results.push(
|
|
91
|
+
h(
|
|
92
|
+
AsyncElmBlockQuote,
|
|
93
|
+
{},
|
|
94
|
+
{ default: renderByToken({ tokens: token.tokens }) }
|
|
95
|
+
)
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
break;
|
|
99
|
+
case "br":
|
|
100
|
+
results.push(h("br"));
|
|
101
|
+
break;
|
|
102
|
+
case "code":
|
|
103
|
+
results.push(
|
|
104
|
+
h(AsyncElmCodeBlock, {
|
|
105
|
+
code: token.text.trim(),
|
|
106
|
+
language: token.lang
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
break;
|
|
110
|
+
case "codespan":
|
|
111
|
+
results.push(h(AsyncElmInlineText, { text: token.text, code: true }));
|
|
112
|
+
break;
|
|
113
|
+
case "def":
|
|
114
|
+
h("span", "aaa");
|
|
115
|
+
break;
|
|
116
|
+
case "del":
|
|
117
|
+
results.push(
|
|
118
|
+
token.tokens != null && token.tokens.length !== 0 ? h(
|
|
119
|
+
AsyncElmInlineText,
|
|
120
|
+
{ strikethrough: true },
|
|
121
|
+
{ default: renderByToken({ tokens: token.tokens }) }
|
|
122
|
+
) : h(AsyncElmInlineText, { text: token.text, strikethrough: true })
|
|
123
|
+
);
|
|
124
|
+
break;
|
|
125
|
+
case "em":
|
|
126
|
+
results.push(
|
|
127
|
+
token.tokens != null && token.tokens.length !== 0 ? h(
|
|
128
|
+
AsyncElmInlineText,
|
|
129
|
+
{ italic: true },
|
|
130
|
+
{ default: renderByToken({ tokens: token.tokens }) }
|
|
131
|
+
) : h(AsyncElmInlineText, { text: token.text, italic: true })
|
|
132
|
+
);
|
|
133
|
+
break;
|
|
134
|
+
case "escape":
|
|
135
|
+
break;
|
|
136
|
+
case "heading":
|
|
137
|
+
if (token.tokens && token.tokens.length !== 0) {
|
|
138
|
+
results.push(
|
|
139
|
+
h(
|
|
140
|
+
AsyncElmHeading,
|
|
141
|
+
{ level: token.depth },
|
|
142
|
+
{ default: renderByToken({ tokens: token.tokens }) }
|
|
143
|
+
)
|
|
144
|
+
);
|
|
145
|
+
} else {
|
|
146
|
+
results.push(
|
|
147
|
+
h(AsyncElmHeading, { level: token.depth, text: token.text })
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
case "hr":
|
|
152
|
+
results.push(h(AsyncElmDivider));
|
|
153
|
+
break;
|
|
154
|
+
case "html":
|
|
155
|
+
break;
|
|
156
|
+
case "image":
|
|
157
|
+
results.push(
|
|
158
|
+
h(AsyncElmImage, {
|
|
159
|
+
block: true,
|
|
160
|
+
enableModal: true,
|
|
161
|
+
src: token.href,
|
|
162
|
+
alt: token.text
|
|
163
|
+
})
|
|
164
|
+
);
|
|
165
|
+
break;
|
|
166
|
+
case "link":
|
|
167
|
+
results.push(
|
|
168
|
+
token.tokens != null && token.tokens.length !== 0 ? h(
|
|
169
|
+
AsyncElmInlineText,
|
|
170
|
+
{ href: token.href },
|
|
171
|
+
{ default: renderByToken({ tokens: token.tokens }) }
|
|
172
|
+
) : h(AsyncElmInlineText, { text: token.text, href: token.href })
|
|
173
|
+
);
|
|
174
|
+
break;
|
|
175
|
+
case "list":
|
|
176
|
+
const listItems = token.items.map(
|
|
177
|
+
(item) => h("li", {}, renderByToken({ tokens: item.tokens }))
|
|
178
|
+
);
|
|
179
|
+
results.push(
|
|
180
|
+
h(
|
|
181
|
+
AsyncElmList,
|
|
182
|
+
{
|
|
183
|
+
listStyle: token.ordered ? "ordered" : "unordered"
|
|
184
|
+
},
|
|
185
|
+
{ default: listItems }
|
|
186
|
+
)
|
|
187
|
+
);
|
|
188
|
+
break;
|
|
189
|
+
case "list_item":
|
|
190
|
+
results.push(
|
|
191
|
+
token.tokens != null && token.tokens.length !== 0 ? h("li", {}, { default: renderByToken({ tokens: token.tokens }) }) : h("li", { text: token.text })
|
|
192
|
+
);
|
|
193
|
+
break;
|
|
194
|
+
case "paragraph":
|
|
195
|
+
if (token.tokens && token.tokens.length !== 0) {
|
|
196
|
+
results.push(
|
|
197
|
+
h(
|
|
198
|
+
AsyncElmParagraph,
|
|
199
|
+
{},
|
|
200
|
+
{ default: renderByToken({ tokens: token.tokens }) }
|
|
201
|
+
)
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
break;
|
|
205
|
+
case "space":
|
|
206
|
+
break;
|
|
207
|
+
case "strong":
|
|
208
|
+
results.push(
|
|
209
|
+
token.tokens != null && token.tokens.length !== 0 ? h(
|
|
210
|
+
AsyncElmInlineText,
|
|
211
|
+
{ bold: true },
|
|
212
|
+
{ default: renderByToken({ tokens: token.tokens }) }
|
|
213
|
+
) : h(AsyncElmInlineText, { text: token.text, bold: true })
|
|
214
|
+
);
|
|
215
|
+
break;
|
|
216
|
+
case "table":
|
|
217
|
+
const renderTableCells = ({
|
|
218
|
+
cells
|
|
219
|
+
}) => cells.map(
|
|
220
|
+
(cell) => h(
|
|
221
|
+
AsyncElmTableCell,
|
|
222
|
+
{},
|
|
223
|
+
{ default: renderByToken({ tokens: cell.tokens }) }
|
|
224
|
+
)
|
|
225
|
+
);
|
|
226
|
+
const headerRow = h(
|
|
227
|
+
AsyncElmTableRow,
|
|
228
|
+
{},
|
|
229
|
+
{ default: renderTableCells({ cells: token.header }) }
|
|
230
|
+
);
|
|
231
|
+
const bodyRows = token.rows.map(
|
|
232
|
+
(row) => h(AsyncElmTableRow, {}, { default: renderTableCells({ cells: row }) })
|
|
233
|
+
);
|
|
234
|
+
const table = h(
|
|
235
|
+
AsyncElmTable,
|
|
236
|
+
{},
|
|
237
|
+
{
|
|
238
|
+
header: h(AsyncElmTableHeader, {}, { default: headerRow }),
|
|
239
|
+
body: h(AsyncElmTableBody, {}, { default: bodyRows })
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
results.push(table);
|
|
243
|
+
break;
|
|
244
|
+
case "text":
|
|
245
|
+
results.push(
|
|
246
|
+
token.tokens != null && token.tokens.length !== 0 ? h(
|
|
247
|
+
AsyncElmInlineText,
|
|
248
|
+
{},
|
|
249
|
+
{ default: renderByToken({ tokens: token.tokens }) }
|
|
250
|
+
) : h(AsyncElmInlineText, { text: token.text })
|
|
251
|
+
);
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return results;
|
|
256
|
+
};
|
|
257
|
+
const render = ({ markdown }) => {
|
|
258
|
+
const tokens = d.setOptions({ gfm: true }).lexer(markdown);
|
|
259
|
+
return renderByToken({ tokens });
|
|
260
|
+
};
|
|
261
|
+
return (_ctx, _cache) => {
|
|
262
|
+
return openBlock(), createElementBlock("div", null, [
|
|
263
|
+
(openBlock(), createBlock(resolveDynamicComponent(() => render({ markdown: _ctx.markdown }))))
|
|
264
|
+
]);
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
export {
|
|
269
|
+
_sfc_main as default
|
|
270
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Property } from 'csstype';
|
|
2
|
+
import { VNodeChild } from 'vue';
|
|
2
3
|
export interface ElmInlineTextProps {
|
|
3
4
|
/**
|
|
4
5
|
* The text to display.
|
|
5
6
|
*/
|
|
6
|
-
text
|
|
7
|
+
text?: string;
|
|
7
8
|
/**
|
|
8
9
|
* Specifies the color of the text.
|
|
9
10
|
*
|
|
@@ -56,7 +57,18 @@ export interface ElmInlineTextProps {
|
|
|
56
57
|
image?: string;
|
|
57
58
|
};
|
|
58
59
|
}
|
|
59
|
-
declare
|
|
60
|
+
declare function __VLS_template(): {
|
|
61
|
+
attrs: Partial<{}>;
|
|
62
|
+
slots: Readonly<{
|
|
63
|
+
default?: () => VNodeChild;
|
|
64
|
+
}> & {
|
|
65
|
+
default?: () => VNodeChild;
|
|
66
|
+
};
|
|
67
|
+
refs: {};
|
|
68
|
+
rootEl: any;
|
|
69
|
+
};
|
|
70
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
71
|
+
declare const __VLS_component: import('vue').DefineComponent<ElmInlineTextProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ElmInlineTextProps> & Readonly<{}>, {
|
|
60
72
|
size: Property.FontSize;
|
|
61
73
|
code: boolean;
|
|
62
74
|
bold: boolean;
|
|
@@ -64,4 +76,10 @@ declare const _default: import('vue').DefineComponent<ElmInlineTextProps, {}, {}
|
|
|
64
76
|
underline: boolean;
|
|
65
77
|
strikethrough: boolean;
|
|
66
78
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
79
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
67
80
|
export default _default;
|
|
81
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
82
|
+
new (): {
|
|
83
|
+
$slots: S;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useCssModule, resolveComponent, createBlock, openBlock, withCtx, createElementBlock, normalizeClass, createElementVNode, createCommentVNode, unref, toDisplayString, resolveDynamicComponent, h } from "vue";
|
|
1
|
+
import { defineComponent, useCssModule, useSlots, resolveComponent, createBlock, openBlock, withCtx, createElementBlock, normalizeClass, createElementVNode, createCommentVNode, unref, toDisplayString, resolveDynamicComponent, h } from "vue";
|
|
2
2
|
import { getLuminance } from "polished";
|
|
3
3
|
import ElmInlineIcon from "../icon/ElmInlineIcon.vue.mjs";
|
|
4
4
|
import ElmMdiIcon from "../icon/ElmMdiIcon.vue.mjs";
|
|
@@ -27,12 +27,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
27
|
setup(__props) {
|
|
28
28
|
const props = __props;
|
|
29
29
|
const style = useCssModule();
|
|
30
|
+
const slots = useSlots();
|
|
30
31
|
const renderLink = () => {
|
|
31
32
|
const children = [];
|
|
32
33
|
if (props.favicon) {
|
|
33
34
|
children.push(h(ElmInlineIcon, { src: props.favicon, alt: "favicon" }));
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
if (slots.default) {
|
|
37
|
+
children.push(h(slots.default));
|
|
38
|
+
} else {
|
|
39
|
+
children.push(h("span", {}, props.text ?? props.href));
|
|
40
|
+
}
|
|
36
41
|
children.push(
|
|
37
42
|
h(ElmMdiIcon, {
|
|
38
43
|
d: mdiOpenInNew,
|
|
@@ -55,7 +60,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
55
60
|
};
|
|
56
61
|
const render = () => {
|
|
57
62
|
const backgroundColor = props.backgroundColor != null ? getLuminance(props.backgroundColor) < 0.5 ? "rgba(255, 255, 255, 0.7)" : "rgba(0, 0, 0, 0.7)" : void 0;
|
|
58
|
-
let vnode = h(
|
|
63
|
+
let vnode = slots.default ? h(
|
|
64
|
+
"span",
|
|
65
|
+
{
|
|
66
|
+
class: [style.text, textStyle.text],
|
|
67
|
+
style: {
|
|
68
|
+
"--color": props.color ?? backgroundColor,
|
|
69
|
+
"--font-size": props.size,
|
|
70
|
+
"--background-color": props.backgroundColor
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{ default: slots.default }
|
|
74
|
+
) : h(
|
|
59
75
|
"span",
|
|
60
76
|
{
|
|
61
77
|
class: [style.text, textStyle.text],
|
package/dist/index.d.ts
CHANGED
|
@@ -80,6 +80,8 @@ export type { ElmColorTableProps } from './components/others/ElmColorTable.vue';
|
|
|
80
80
|
export { default as ElmColorTable } from './components/others/ElmColorTable.vue';
|
|
81
81
|
export type { ElmJsonComponentRendererProps } from './components/others/ElmJsonComponentRenderer.vue';
|
|
82
82
|
export { default as ElmJsonComponentRenderer } from './components/others/ElmJsonComponentRenderer.vue';
|
|
83
|
+
export type { ElmMarkdownProps } from './components/others/ElmMarkdown.vue';
|
|
84
|
+
export { default as ElmMarkdown } from './components/others/ElmMarkdown.vue';
|
|
83
85
|
export type { ElmTableProps } from './components/table/ElmTable.vue';
|
|
84
86
|
export { default as ElmTable } from './components/table/ElmTable.vue';
|
|
85
87
|
export type { ElmTableHeaderProps } from './components/table/ElmTableHeader.vue';
|
package/dist/index.mjs
CHANGED
|
@@ -51,31 +51,32 @@ import { default as default39 } from "./components/navigation/ElmTableOfContents
|
|
|
51
51
|
import { default as default40 } from "./components/others/ElmColorSample.vue.mjs";
|
|
52
52
|
import { default as default41 } from "./components/others/ElmColorTable.vue.mjs";
|
|
53
53
|
import { default as default42 } from "./components/others/ElmJsonComponentRenderer.vue.mjs";
|
|
54
|
-
import { default as default43 } from "./components/
|
|
55
|
-
import { default as default44 } from "./components/table/
|
|
56
|
-
import { default as default45 } from "./components/table/
|
|
57
|
-
import { default as default46 } from "./components/table/
|
|
58
|
-
import { default as default47 } from "./components/table/
|
|
59
|
-
import { default as default48 } from "./components/
|
|
60
|
-
import { default as default49 } from "./components/typography/
|
|
61
|
-
import { default as default50 } from "./components/typography/
|
|
62
|
-
import { default as default51 } from "./components/typography/
|
|
63
|
-
import { default as default52 } from "./components/typography/
|
|
64
|
-
import { default as default53 } from "./components/typography/
|
|
65
|
-
import { default as default54 } from "./components/typography/
|
|
66
|
-
import { default as default55 } from "./components/typography/
|
|
54
|
+
import { default as default43 } from "./components/others/ElmMarkdown.vue.mjs";
|
|
55
|
+
import { default as default44 } from "./components/table/ElmTable.vue.mjs";
|
|
56
|
+
import { default as default45 } from "./components/table/ElmTableHeader.vue.mjs";
|
|
57
|
+
import { default as default46 } from "./components/table/ElmTableBody.vue.mjs";
|
|
58
|
+
import { default as default47 } from "./components/table/ElmTableRow.vue.mjs";
|
|
59
|
+
import { default as default48 } from "./components/table/ElmTableCell.vue.mjs";
|
|
60
|
+
import { default as default49 } from "./components/typography/ElmBlockQuote.vue.mjs";
|
|
61
|
+
import { default as default50 } from "./components/typography/ElmCallout.vue.mjs";
|
|
62
|
+
import { default as default51 } from "./components/typography/ElmDivider.vue.mjs";
|
|
63
|
+
import { default as default52 } from "./components/typography/ElmFragmentIdentifier.vue.mjs";
|
|
64
|
+
import { default as default53 } from "./components/typography/ElmHeading.vue.mjs";
|
|
65
|
+
import { default as default54 } from "./components/typography/ElmInlineText.vue.mjs";
|
|
66
|
+
import { default as default55 } from "./components/typography/ElmParagraph.vue.mjs";
|
|
67
|
+
import { default as default56 } from "./components/typography/ElmList.vue.mjs";
|
|
67
68
|
|
|
68
69
|
import { useElmethisTheme } from "./hooks/useElmethisTheme.mjs";
|
|
69
70
|
import { useTyping } from "./hooks/useTyping.mjs";
|
|
70
71
|
export {
|
|
71
72
|
default26 as ElmArrowIcon,
|
|
72
73
|
default17 as ElmBlockFallback,
|
|
73
|
-
|
|
74
|
+
default49 as ElmBlockQuote,
|
|
74
75
|
default36 as ElmBookmark,
|
|
75
76
|
default27 as ElmBookmarkIcon,
|
|
76
77
|
default37 as ElmBreadcrumb,
|
|
77
78
|
default20 as ElmButton,
|
|
78
|
-
|
|
79
|
+
default50 as ElmCallout,
|
|
79
80
|
default21 as ElmCheckbox,
|
|
80
81
|
default2 as ElmCodeBlock,
|
|
81
82
|
default40 as ElmColorSample,
|
|
@@ -83,23 +84,24 @@ export {
|
|
|
83
84
|
default5 as ElmConfirmModal,
|
|
84
85
|
default28 as ElmCubeIcon,
|
|
85
86
|
default4 as ElmDesktopWindow,
|
|
86
|
-
|
|
87
|
+
default51 as ElmDivider,
|
|
87
88
|
default29 as ElmDotLoadingIcon,
|
|
88
89
|
default34 as ElmFile,
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
default52 as ElmFragmentIdentifier,
|
|
91
|
+
default53 as ElmHeading,
|
|
91
92
|
default35 as ElmImage,
|
|
92
|
-
|
|
93
|
+
default54 as ElmInlineText,
|
|
93
94
|
default42 as ElmJsonComponentRenderer,
|
|
94
95
|
default3 as ElmKatex,
|
|
95
96
|
default30 as ElmLanguageIcon,
|
|
96
|
-
|
|
97
|
+
default56 as ElmList,
|
|
97
98
|
default31 as ElmLoginIcon,
|
|
99
|
+
default43 as ElmMarkdown,
|
|
98
100
|
default32 as ElmMdiIcon,
|
|
99
101
|
default6 as ElmModal,
|
|
100
102
|
default14 as ElmMultiProgress,
|
|
101
103
|
default38 as ElmPagetop,
|
|
102
|
-
|
|
104
|
+
default55 as ElmParagraph,
|
|
103
105
|
default7 as ElmParallax,
|
|
104
106
|
default13 as ElmProgress,
|
|
105
107
|
default16 as ElmRectangleWave,
|
|
@@ -110,12 +112,12 @@ export {
|
|
|
110
112
|
default18 as ElmSpinner,
|
|
111
113
|
default15 as ElmStatusMessage,
|
|
112
114
|
default23 as ElmSwitch,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
default44 as ElmTable,
|
|
116
|
+
default46 as ElmTableBody,
|
|
117
|
+
default48 as ElmTableCell,
|
|
118
|
+
default45 as ElmTableHeader,
|
|
117
119
|
default39 as ElmTableOfContents,
|
|
118
|
-
|
|
120
|
+
default47 as ElmTableRow,
|
|
119
121
|
default24 as ElmTextField,
|
|
120
122
|
default11 as ElmToggle,
|
|
121
123
|
default33 as ElmToggleTheme,
|