@kestra-io/ui-libs 0.0.59 → 0.0.60
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/package.json +13 -7
- package/src/components/content/Alert.vue +34 -0
- package/src/components/content/Collapse.vue +66 -0
- package/src/components/content/ConfigPropertyCard.vue +78 -0
- package/src/components/content/MDCRenderer.vue +8 -0
- package/src/components/content/Mermaid.vue +19 -0
- package/src/components/content/NextLink.vue +39 -0
- package/src/components/content/ProseBlockquote.vue +8 -0
- package/src/components/content/ProseCode.vue +19 -0
- package/src/components/content/ProsePre.vue +164 -0
- package/src/components/content/ProseTable.vue +50 -0
- package/src/composables/useMarkdownParser.js +78 -0
- package/src/scss/_variables.scss +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kestra-io/ui-libs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.60",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -18,26 +18,32 @@
|
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@vue-flow/background": "^1.3.0",
|
|
20
20
|
"@vue-flow/controls": "^1.1.1",
|
|
21
|
-
"@vue-flow/core": "^1.
|
|
21
|
+
"@vue-flow/core": "^1.41.1",
|
|
22
22
|
"bootstrap": "^5.3.3",
|
|
23
23
|
"dagre": "^0.8.5",
|
|
24
24
|
"humanize-duration": "^3.31.0",
|
|
25
25
|
"js-yaml": "^4.1.0",
|
|
26
26
|
"lodash": "^4.17.21",
|
|
27
27
|
"moment": "^2.30.1",
|
|
28
|
-
"vue": "^3.5.
|
|
28
|
+
"vue": "^3.5.5",
|
|
29
29
|
"vue-material-design-icons": "^5.3.0",
|
|
30
30
|
"vuex": "^4.1.0",
|
|
31
31
|
"yaml": "^2.5.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@
|
|
34
|
+
"@esbuild/linux-x64": "^0.23.1",
|
|
35
|
+
"@nuxtjs/mdc": "^0.9.0",
|
|
36
|
+
"@typescript-eslint/parser": "^8.5.0",
|
|
35
37
|
"@vitejs/plugin-vue": "^5.1.3",
|
|
36
38
|
"eslint": "^8.57.0",
|
|
37
39
|
"eslint-plugin-vue": "^9.28.0",
|
|
38
|
-
"sass": "^1.
|
|
39
|
-
"shiki": "^1.
|
|
40
|
-
"vite": "^5.4.
|
|
40
|
+
"sass": "^1.78.0",
|
|
41
|
+
"shiki": "^1.17.6",
|
|
42
|
+
"vite": "^5.4.5",
|
|
41
43
|
"vite-plugin-static-copy": "^1.0.6"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@popperjs/core": "^2.11.8",
|
|
47
|
+
"mermaid": "^11.2.1"
|
|
42
48
|
}
|
|
43
49
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="'doc-alert alert alert-' + type" role="alert">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
components: {},
|
|
10
|
+
props: {
|
|
11
|
+
type: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<style lang="scss" scoped>
|
|
20
|
+
.doc-alert {
|
|
21
|
+
--bs-alert-padding-x: var(--spacer);
|
|
22
|
+
--bs-alert-padding-y: var(--spacer);
|
|
23
|
+
--bs-alert-margin-bottom: var(--spacer);
|
|
24
|
+
|
|
25
|
+
background-color: #18131f;
|
|
26
|
+
border: 1px solid #3a3c55;
|
|
27
|
+
padding: var(--bs-alert-padding-y) var(--bs-alert-padding-x);
|
|
28
|
+
margin-bottom: var(--bs-alert-margin-bottom);
|
|
29
|
+
|
|
30
|
+
> * {
|
|
31
|
+
margin: 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="mb-4">
|
|
3
|
+
<div class="show-button" @click="toggleShow">
|
|
4
|
+
<ChevronDown v-if="show" class="icon-2x" />
|
|
5
|
+
<ChevronRight v-else class="icon-2x" />
|
|
6
|
+
<span v-if="title" class="title">{{ title }}</span>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div v-if="show">
|
|
10
|
+
<slot />
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import ChevronDown from "vue-material-design-icons/ChevronDown.vue"
|
|
16
|
+
import ChevronRight from "vue-material-design-icons/ChevronRight.vue"
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
components: {
|
|
20
|
+
ChevronDown,
|
|
21
|
+
ChevronRight
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
title: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true,
|
|
27
|
+
default: "Details"
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
show: false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
toggleShow() {
|
|
37
|
+
this.show = !this.show
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style lang="scss" scoped>
|
|
45
|
+
@import "../../scss/variables";
|
|
46
|
+
|
|
47
|
+
.show-button {
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
font-size: 1.30em;
|
|
50
|
+
color: var(--bs-white);
|
|
51
|
+
display: inline-block;
|
|
52
|
+
padding-right: 0.1em;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.show-button:hover {
|
|
56
|
+
color: $purple-36;
|
|
57
|
+
background-color: #252526;
|
|
58
|
+
border-radius: 4px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.title {
|
|
62
|
+
margin-left: 0.25em;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
</style>
|
|
66
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="config-property-card">
|
|
3
|
+
<table class="table table-dark">
|
|
4
|
+
<tbody>
|
|
5
|
+
<tr>
|
|
6
|
+
<td class="label">
|
|
7
|
+
Type
|
|
8
|
+
</td>
|
|
9
|
+
<td>{{ type }}</td>
|
|
10
|
+
</tr>
|
|
11
|
+
<tr>
|
|
12
|
+
<td class="label">
|
|
13
|
+
Default
|
|
14
|
+
</td>
|
|
15
|
+
<td>
|
|
16
|
+
<prose-code>{{ defaultValue }}</prose-code>
|
|
17
|
+
</td>
|
|
18
|
+
</tr>
|
|
19
|
+
<tr v-if="validValues">
|
|
20
|
+
<td class="label">
|
|
21
|
+
Valid values:
|
|
22
|
+
</td>
|
|
23
|
+
<td>
|
|
24
|
+
<prose-code>[ {{ validValues }} ]</prose-code>
|
|
25
|
+
</td>
|
|
26
|
+
</tr>
|
|
27
|
+
</tbody>
|
|
28
|
+
</table>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
<script>
|
|
32
|
+
import {defineComponent} from "vue";
|
|
33
|
+
import ProseCode from "./ProseCode.vue";
|
|
34
|
+
|
|
35
|
+
export default defineComponent({
|
|
36
|
+
components: {ProseCode},
|
|
37
|
+
props: {
|
|
38
|
+
type: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: undefined,
|
|
41
|
+
required: true
|
|
42
|
+
},
|
|
43
|
+
defaultValue: {
|
|
44
|
+
type: [String, Boolean, Number, Array, Object],
|
|
45
|
+
default: ""
|
|
46
|
+
},
|
|
47
|
+
validValues: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: ""
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<style lang="scss" scoped>
|
|
56
|
+
.config-property-card {
|
|
57
|
+
table {
|
|
58
|
+
min-width: 50%;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
tr td:first-child {
|
|
62
|
+
width: 10em;
|
|
63
|
+
min-width: 10em;
|
|
64
|
+
max-width: 10em;
|
|
65
|
+
word-break: break-all;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
td {
|
|
69
|
+
font-size: 1rem;
|
|
70
|
+
padding: 0.6rem 1rem;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
td.label {
|
|
74
|
+
font-weight: bold;
|
|
75
|
+
padding-right: 1em;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="mermaid" v-if="show">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import mermaid from "mermaid/dist/mermaid.esm.mjs";
|
|
9
|
+
import {nextTick, onMounted, ref} from "vue";
|
|
10
|
+
|
|
11
|
+
let show = ref(false);
|
|
12
|
+
|
|
13
|
+
onMounted(async () => {
|
|
14
|
+
show.value = true
|
|
15
|
+
await mermaid.initialize({startOnLoad: true})
|
|
16
|
+
await nextTick()
|
|
17
|
+
await mermaid.init();
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="text-end mt-3 mb-3">
|
|
3
|
+
<div class="btn btn-outline-primary">
|
|
4
|
+
<ChevronRight />
|
|
5
|
+
<slot />
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import ChevronRight from "vue-material-design-icons/ChevronRight.vue"
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<style lang="scss" scoped>
|
|
21
|
+
div {
|
|
22
|
+
.material-design-icon {
|
|
23
|
+
color: var(--bs-purple);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:hover {
|
|
27
|
+
:deep(a), :deep(a:hover) {
|
|
28
|
+
color: var(--bs-white) !important;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:deep(p) {
|
|
33
|
+
display: inline;
|
|
34
|
+
margin-bottom: 0 !important;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<code>
|
|
3
|
+
<slot />
|
|
4
|
+
</code>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<style lang="scss" scoped>
|
|
9
|
+
@import "../../scss/variables";
|
|
10
|
+
|
|
11
|
+
code {
|
|
12
|
+
color: $white-3;
|
|
13
|
+
background: $black-2;
|
|
14
|
+
border: 1px solid $black-3;
|
|
15
|
+
border-radius: var(--bs-border-radius);
|
|
16
|
+
padding: 0 0.25rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
</style>
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import {createPopper} from "@popperjs/core";
|
|
3
|
+
|
|
4
|
+
import ContentCopy from "vue-material-design-icons/ContentCopy.vue";
|
|
5
|
+
import Check from "vue-material-design-icons/Check.vue";
|
|
6
|
+
import {defineComponent, nextTick, shallowRef} from "vue";
|
|
7
|
+
import Mermaid from "./Mermaid.vue";
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
components: {Mermaid},
|
|
11
|
+
props: {
|
|
12
|
+
code: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
language: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: null
|
|
19
|
+
},
|
|
20
|
+
filename: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: null
|
|
23
|
+
},
|
|
24
|
+
highlights: {
|
|
25
|
+
type: Array,
|
|
26
|
+
default: () => []
|
|
27
|
+
},
|
|
28
|
+
meta: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: null
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
icons: shallowRef({
|
|
36
|
+
ContentCopy: shallowRef(ContentCopy),
|
|
37
|
+
Check: shallowRef(Check)
|
|
38
|
+
}),
|
|
39
|
+
copyIcon: undefined,
|
|
40
|
+
copyIconResetTimer: undefined,
|
|
41
|
+
isHoveringCode: false
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
created() {
|
|
45
|
+
this.copyIcon = this.icons.ContentCopy;
|
|
46
|
+
},
|
|
47
|
+
methods: {
|
|
48
|
+
hoverCode(){
|
|
49
|
+
this.isHoveringCode = true;
|
|
50
|
+
if(this.copyIconResetTimer) {
|
|
51
|
+
nextTick(() => {
|
|
52
|
+
createPopper(this.$refs.copyButton, this.$refs.copyTooltip, {
|
|
53
|
+
placement: "left",
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
copyToClipboard() {
|
|
59
|
+
clearTimeout(this.copyIconResetTimer);
|
|
60
|
+
|
|
61
|
+
navigator.clipboard.writeText(this.code.trimEnd())
|
|
62
|
+
|
|
63
|
+
this.copyIcon = this.icons.Check;
|
|
64
|
+
|
|
65
|
+
this.copyIconResetTimer = setTimeout(() => {
|
|
66
|
+
this.copyIcon = this.icons.ContentCopy;
|
|
67
|
+
this.copyIconResetTimer = undefined;
|
|
68
|
+
}, 2000)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<template>
|
|
75
|
+
<template v-if="language === 'mermaid'">
|
|
76
|
+
<Mermaid>
|
|
77
|
+
{{ code }}
|
|
78
|
+
</Mermaid>
|
|
79
|
+
</template>
|
|
80
|
+
<div class="code-block mb-3" @mouseover="hoverCode" @mouseleave="isHoveringCode = false" v-else>
|
|
81
|
+
<div class="language" v-if="language">
|
|
82
|
+
{{ language }}
|
|
83
|
+
</div>
|
|
84
|
+
<template v-if="isHoveringCode">
|
|
85
|
+
<button ref="copyButton" class="copy">
|
|
86
|
+
<component
|
|
87
|
+
:is="copyIcon"
|
|
88
|
+
@click="copyToClipboard"
|
|
89
|
+
/>
|
|
90
|
+
</button>
|
|
91
|
+
<div ref="copyTooltip" v-if="!!copyIconResetTimer" id="copied-tooltip" role="tooltip">
|
|
92
|
+
Copied!
|
|
93
|
+
<div id="arrow" data-popper-arrow />
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
96
|
+
<slot />
|
|
97
|
+
</div>
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<style lang="scss" scoped>
|
|
101
|
+
@import "../../scss/variables";
|
|
102
|
+
|
|
103
|
+
.code-block {
|
|
104
|
+
background-color: $black-2;
|
|
105
|
+
border: $block-border;
|
|
106
|
+
padding: 1.25rem 1.5rem;
|
|
107
|
+
border-radius: var(--bs-border-radius-lg);
|
|
108
|
+
color: var(--bs-white);
|
|
109
|
+
position: relative;
|
|
110
|
+
|
|
111
|
+
.language {
|
|
112
|
+
position: absolute;
|
|
113
|
+
right: 0.35rem;
|
|
114
|
+
top: 0.25rem;
|
|
115
|
+
color: var(--bs-gray-600);
|
|
116
|
+
font-size: calc($font-size-base * .75);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:deep(pre) {
|
|
120
|
+
margin-bottom: 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.copy {
|
|
124
|
+
position: absolute;
|
|
125
|
+
right: 0;
|
|
126
|
+
bottom: 0.1rem;
|
|
127
|
+
color: $gray-600;
|
|
128
|
+
border: none;
|
|
129
|
+
background: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
#copied-tooltip {
|
|
133
|
+
border-radius: $border-radius;
|
|
134
|
+
background: $gray-500;
|
|
135
|
+
padding: 4px 8px;
|
|
136
|
+
font-size: $font-size-xs;
|
|
137
|
+
margin-right: $popper-margin !important;
|
|
138
|
+
|
|
139
|
+
#arrow,
|
|
140
|
+
#arrow::before {
|
|
141
|
+
position: absolute;
|
|
142
|
+
width: 8px;
|
|
143
|
+
height: 8px;
|
|
144
|
+
background: inherit;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
#arrow {
|
|
148
|
+
visibility: hidden;
|
|
149
|
+
right: -4px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
#arrow::before {
|
|
153
|
+
visibility: visible;
|
|
154
|
+
content: '';
|
|
155
|
+
transform: rotate(45deg);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
:deep(pre code .line) {
|
|
161
|
+
display: block;
|
|
162
|
+
min-height: 1rem;
|
|
163
|
+
}
|
|
164
|
+
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container table-responsive">
|
|
3
|
+
<table class="table table-dark">
|
|
4
|
+
<slot />
|
|
5
|
+
</table>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<style lang="scss" scoped>
|
|
13
|
+
@import "../../scss/variables";
|
|
14
|
+
|
|
15
|
+
.table-responsive {
|
|
16
|
+
padding: 0;
|
|
17
|
+
margin: calc($spacer * 2) 0 calc($spacer * 4);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:deep(thead) {
|
|
21
|
+
border-bottom: none !important;
|
|
22
|
+
th {
|
|
23
|
+
font-size: $font-size-md;
|
|
24
|
+
font-weight: 600;
|
|
25
|
+
line-height: 1.25rem;
|
|
26
|
+
padding: calc($spacer * 0.5) $spacer $spacer;
|
|
27
|
+
background-color: transparent;
|
|
28
|
+
border-bottom: 4px solid #8B8B8D !important;
|
|
29
|
+
border-top: none;
|
|
30
|
+
color: $white;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:deep(tbody) {
|
|
35
|
+
tr {
|
|
36
|
+
td {
|
|
37
|
+
font-size: $font-size-sm;
|
|
38
|
+
padding: calc($spacer * 1.5) $spacer $spacer !important;
|
|
39
|
+
font-weight: 400;
|
|
40
|
+
color: $white;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.table-dark {
|
|
46
|
+
--bs-table-bg: $black-2 !important;
|
|
47
|
+
color: transparent !important;
|
|
48
|
+
outline: none !important;
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {createMarkdownParser, createShikiHighlighter, rehypeHighlight,} from "@nuxtjs/mdc/runtime";
|
|
2
|
+
import GithubDark from "shiki/themes/github-dark.mjs";
|
|
3
|
+
|
|
4
|
+
export default function useMarkdownParser() {
|
|
5
|
+
let parser;
|
|
6
|
+
|
|
7
|
+
return async (markdown) => {
|
|
8
|
+
if (!parser) {
|
|
9
|
+
const {bundledLanguagesInfo} = await import("shiki/langs");
|
|
10
|
+
|
|
11
|
+
const langsMap = {};
|
|
12
|
+
const langs = [
|
|
13
|
+
"bash",
|
|
14
|
+
"c",
|
|
15
|
+
"cpp",
|
|
16
|
+
"csv",
|
|
17
|
+
"dockerfile",
|
|
18
|
+
"go",
|
|
19
|
+
"groovy",
|
|
20
|
+
"handlebars",
|
|
21
|
+
"hcl",
|
|
22
|
+
"ini",
|
|
23
|
+
"java",
|
|
24
|
+
"javascript",
|
|
25
|
+
"json",
|
|
26
|
+
"markdown",
|
|
27
|
+
"mermaid",
|
|
28
|
+
"perl",
|
|
29
|
+
"php",
|
|
30
|
+
"python",
|
|
31
|
+
"r",
|
|
32
|
+
"ruby",
|
|
33
|
+
"rust",
|
|
34
|
+
"scala",
|
|
35
|
+
"sql",
|
|
36
|
+
"systemd",
|
|
37
|
+
"twig",
|
|
38
|
+
"typescript",
|
|
39
|
+
"xml",
|
|
40
|
+
"yaml"
|
|
41
|
+
]
|
|
42
|
+
langs.forEach(lang => {
|
|
43
|
+
const info = bundledLanguagesInfo.find(i => i.aliases?.includes?.(lang) || i.id === lang);
|
|
44
|
+
if (!info) {
|
|
45
|
+
throw new Error(`[@nuxtjs/mdc] Could not find shiki language: ${lang}`);
|
|
46
|
+
}
|
|
47
|
+
const langImport = () => import(`../../node_modules/shiki/dist/langs/${info.id}.mjs`);
|
|
48
|
+
langsMap[info.id] = langImport;
|
|
49
|
+
for (const alias of info.aliases || []) {
|
|
50
|
+
langsMap[alias] = langImport;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
parser = await createMarkdownParser({
|
|
55
|
+
rehype: {
|
|
56
|
+
plugins: {
|
|
57
|
+
highlight: {
|
|
58
|
+
instance: rehypeHighlight,
|
|
59
|
+
options: {
|
|
60
|
+
// Pass in your desired theme(s)
|
|
61
|
+
theme: "github-dark",
|
|
62
|
+
// Create the Shiki highlighter
|
|
63
|
+
highlighter: createShikiHighlighter({
|
|
64
|
+
bundledThemes: {
|
|
65
|
+
"github-dark": GithubDark,
|
|
66
|
+
},
|
|
67
|
+
// Configure the bundled languages
|
|
68
|
+
bundledLangs: langsMap,
|
|
69
|
+
}),
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
return parser(markdown)
|
|
77
|
+
}
|
|
78
|
+
}
|
package/src/scss/_variables.scss
CHANGED
|
@@ -7,6 +7,7 @@ $tertiary: #2F3342 !default;
|
|
|
7
7
|
$blue: #1761FD !default;
|
|
8
8
|
$indigo: #8405FF !default;
|
|
9
9
|
$purple: #9F9DFF !default;
|
|
10
|
+
$purple-36: #9CA1DE;
|
|
10
11
|
$pink: #FD3C97 !default;
|
|
11
12
|
$red: #E36065 !default;
|
|
12
13
|
$red-light: #FF9D9D !default;
|
|
@@ -32,11 +33,21 @@ $black: #26282D !default;
|
|
|
32
33
|
$light: $gray-200 !default;
|
|
33
34
|
$dark: $gray-900 !default;
|
|
34
35
|
|
|
36
|
+
$white-3: #B9B9BA;
|
|
37
|
+
|
|
38
|
+
$black-2 : #161617;
|
|
39
|
+
$black-3 : #252526;
|
|
40
|
+
|
|
35
41
|
// fonts
|
|
36
42
|
$font-size-base: 1rem !default;
|
|
37
43
|
$font-family-sans-serif: "Public Sans", sans-serif;
|
|
38
44
|
$font-family-monospace: "Source Code Pro", monospace;
|
|
39
45
|
$font-size-xs: $font-size-base * 0.75 !default;
|
|
46
|
+
$font-size-md : $font-size-base * 1;
|
|
47
|
+
$font-size-xl: $font-size-base * 1.375;
|
|
48
|
+
|
|
49
|
+
// border
|
|
50
|
+
$block-border: 1px solid $black-3;
|
|
40
51
|
|
|
41
52
|
// border radius
|
|
42
53
|
$border-radius: 0.25rem !default;
|
|
@@ -97,6 +108,8 @@ $element-colors: (
|
|
|
97
108
|
),
|
|
98
109
|
);
|
|
99
110
|
|
|
111
|
+
$popper-margin: .2rem;
|
|
112
|
+
|
|
100
113
|
$baseline-max-width: 730px;
|
|
101
114
|
|
|
102
115
|
// bootstrap
|