@md-plugins/quasar-app-extension-q-press 0.1.0-beta.2 → 0.1.0-beta.21
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 +20 -15
- package/dist/index.js +41 -7
- package/dist/install.js +7 -5
- package/dist/q-press-globals.d.ts +49 -0
- package/dist/templates/init/src/_q-press/api/components/MarkdownCode.json +2 -2
- package/dist/templates/init/src/_q-press/api/components/MarkdownCodepen.json +6 -9
- package/dist/templates/init/src/_q-press/api/components/MarkdownExample.json +27 -2
- package/dist/templates/init/src/_q-press/components/MarkdownApi.vue +129 -84
- package/dist/templates/init/src/_q-press/components/MarkdownCardLink.vue +1 -1
- package/dist/templates/init/src/_q-press/components/MarkdownCardTitle.vue +1 -1
- package/dist/templates/init/src/_q-press/components/MarkdownCode.vue +71 -3
- package/dist/templates/init/src/_q-press/components/MarkdownCodepen.vue +316 -59
- package/dist/templates/init/src/_q-press/components/MarkdownCopyButton.vue +1 -1
- package/dist/templates/init/src/_q-press/components/MarkdownExample.vue +54 -19
- package/dist/templates/init/src/_q-press/components/MarkdownLink.vue +5 -5
- package/dist/templates/init/src/_q-press/components/MarkdownMermaid.vue +123 -0
- package/dist/templates/init/src/_q-press/components/MarkdownTree.vue +2 -2
- package/dist/templates/init/src/_q-press/components/markdown-utils.ts +27 -3
- package/dist/templates/init/src/_q-press/css/app.scss +38 -26
- package/dist/templates/init/src/_q-press/css/code-theme.scss +634 -0
- package/dist/templates/init/src/_q-press/css/themes/default.scss +1 -1
- package/dist/templates/init/src/_q-press/css/themes/evergreen.scss +69 -0
- package/dist/templates/init/src/_q-press/css/themes/mystic.scss +1 -1
- package/dist/templates/init/src/_q-press/css/themes/newspaper.scss +1 -1
- package/dist/templates/init/src/_q-press/css/themes/sunrise.scss +1 -1
- package/dist/templates/init/src/_q-press/css/themes/tawny.scss +1 -1
- package/dist/templates/init/src/_q-press/layouts/MarkdownDrawerSidebar.vue +1 -1
- package/dist/templates/init/src/_q-press/layouts/MarkdownDrawerToc.vue +1 -1
- package/dist/templates/init/src/_q-press/layouts/MarkdownHeader.vue +1 -1
- package/dist/templates/init/src/_q-press/layouts/MarkdownLayout.vue +2 -2
- package/dist/templates/init/src/_q-press/layouts/MarkdownPage.vue +4 -3
- package/dist/templates/init/src/_q-press/layouts/MarkdownSearch.vue +1 -1
- package/dist/templates/init/src/_q-press/stores/markdown.ts +1 -2
- package/dist/templates/init/src/components/LandingPage/LandingPage.vue +15 -1
- package/dist/templates/init/src/components/QPressThemeGallery.vue +336 -0
- package/dist/templates/init/src/components/page-parts/releases/GitHubReleases.vue +121 -0
- package/dist/templates/init/src/components/page-parts/releases/PackageReleases.vue +191 -0
- package/dist/templates/init/src/components/page-parts/releases/md-table-parser.ts +52 -0
- package/dist/templates/init/src/components/page-parts/releases/sanitize.ts +132 -0
- package/dist/templates/init/src/markdown/__elements.md +8 -8
- package/dist/templates/init/src/markdown/__elements2.md +4 -4
- package/dist/templates/init/src/markdown/faq/best-practices.md +27 -0
- package/dist/templates/init/src/markdown/faq/general.md +27 -0
- package/dist/templates/init/src/markdown/faq/troubleshooting.md +27 -0
- package/dist/templates/init/src/markdown/getting-started/introduction.md +7 -5
- package/dist/templates/init/src/markdown/md-plugins/blockquote/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/codeblocks/advanced.md +19 -15
- package/dist/templates/init/src/markdown/md-plugins/codeblocks/overview.md +45 -8
- package/dist/templates/init/src/markdown/md-plugins/containers/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/frontmatter/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/headers/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/image/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/imports/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/inline-code/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/link/advanced.md +2 -2
- package/dist/templates/init/src/markdown/md-plugins/link/overview.md +6 -4
- package/dist/templates/init/src/markdown/md-plugins/mermaid/advanced.md +69 -0
- package/dist/templates/init/src/markdown/md-plugins/mermaid/overview.md +73 -0
- package/dist/templates/init/src/markdown/md-plugins/shared/overview.md +28 -13
- package/dist/templates/init/src/markdown/md-plugins/table/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/title/overview.md +3 -1
- package/dist/templates/init/src/markdown/other/contact.md +37 -0
- package/dist/templates/init/src/markdown/other/contributing/bugs-and-feature-requests.md +33 -0
- package/dist/templates/init/src/markdown/other/contributing/call-to-action.md +25 -0
- package/dist/templates/init/src/markdown/other/contributing/documentation.md +31 -0
- package/dist/templates/init/src/markdown/other/contributing/overview.md +41 -0
- package/dist/templates/init/src/markdown/other/contributing/packages.md +28 -0
- package/dist/templates/init/src/markdown/other/contributing/sponsor.md +23 -0
- package/dist/templates/init/src/markdown/other/faq.md +179 -0
- package/dist/templates/init/src/markdown/other/releases.md +11 -0
- package/dist/templates/init/src/markdown/other/upgrade-guide.md +165 -0
- package/dist/templates/init/src/markdown/quasar-app-extensions/qpress/advanced.md +11 -3
- package/dist/templates/init/src/markdown/quasar-app-extensions/qpress/components.md +25 -29
- package/dist/templates/init/src/markdown/quasar-app-extensions/qpress/overview.md +20 -20
- package/dist/templates/init/src/markdown/quasar-app-extensions/qpress/site-config.md +17 -3
- package/dist/templates/init/src/markdown/quasar-app-extensions/qpress/themes.md +101 -9
- package/dist/templates/init/src/markdown/quasar-app-extensions/vite-md-plugin-app-ext/advanced.md +158 -0
- package/dist/templates/init/src/markdown/quasar-app-extensions/vite-md-plugin-app-ext/overview.md +1 -1
- package/dist/templates/init/src/markdown/vite-plugins/vite-examples-plugin/advanced.md +8 -3
- package/dist/templates/init/src/markdown/vite-plugins/vite-examples-plugin/overview.md +19 -5
- package/dist/templates/init/src/markdown/vite-plugins/vite-md-plugin/advanced.md +84 -54
- package/dist/templates/init/src/markdown/vite-plugins/vite-md-plugin/overview.md +19 -3
- package/dist/templates/init/src/siteConfig/index.ts +52 -23
- package/dist/templates/update/src/_q-press/api/components/MarkdownCode.json +2 -2
- package/dist/templates/update/src/_q-press/api/components/MarkdownCodepen.json +6 -9
- package/dist/templates/update/src/_q-press/api/components/MarkdownExample.json +27 -2
- package/dist/templates/update/src/_q-press/components/MarkdownApi.vue +129 -84
- package/dist/templates/update/src/_q-press/components/MarkdownCardLink.vue +1 -1
- package/dist/templates/update/src/_q-press/components/MarkdownCardTitle.vue +1 -1
- package/dist/templates/update/src/_q-press/components/MarkdownCode.vue +71 -3
- package/dist/templates/update/src/_q-press/components/MarkdownCodepen.vue +316 -59
- package/dist/templates/update/src/_q-press/components/MarkdownCopyButton.vue +1 -1
- package/dist/templates/update/src/_q-press/components/MarkdownExample.vue +54 -19
- package/dist/templates/update/src/_q-press/components/MarkdownLink.vue +5 -5
- package/dist/templates/update/src/_q-press/components/MarkdownMermaid.vue +123 -0
- package/dist/templates/update/src/_q-press/components/MarkdownTree.vue +2 -2
- package/dist/templates/update/src/_q-press/components/markdown-utils.ts +27 -3
- package/dist/templates/update/src/_q-press/css/app.scss +38 -26
- package/dist/templates/update/src/_q-press/css/code-theme.scss +634 -0
- package/dist/templates/update/src/_q-press/css/themes/default.scss +1 -1
- package/dist/templates/update/src/_q-press/css/themes/evergreen.scss +69 -0
- package/dist/templates/update/src/_q-press/css/themes/mystic.scss +1 -1
- package/dist/templates/update/src/_q-press/css/themes/newspaper.scss +1 -1
- package/dist/templates/update/src/_q-press/css/themes/sunrise.scss +1 -1
- package/dist/templates/update/src/_q-press/css/themes/tawny.scss +1 -1
- package/dist/templates/update/src/_q-press/layouts/MarkdownDrawerSidebar.vue +1 -1
- package/dist/templates/update/src/_q-press/layouts/MarkdownDrawerToc.vue +1 -1
- package/dist/templates/update/src/_q-press/layouts/MarkdownHeader.vue +1 -1
- package/dist/templates/update/src/_q-press/layouts/MarkdownLayout.vue +2 -2
- package/dist/templates/update/src/_q-press/layouts/MarkdownPage.vue +4 -3
- package/dist/templates/update/src/_q-press/layouts/MarkdownSearch.vue +1 -1
- package/dist/templates/update/src/_q-press/stores/markdown.ts +1 -2
- package/package.json +22 -21
- package/src/index.ts +80 -11
- package/src/install.ts +10 -9
- package/src/q-press-globals.d.ts +49 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownCode.json +2 -2
- package/src/templates/init/src/_q-press/api/components/MarkdownCodepen.json +6 -9
- package/src/templates/init/src/_q-press/api/components/MarkdownExample.json +27 -2
- package/src/templates/init/src/_q-press/components/MarkdownApi.vue +129 -84
- package/src/templates/init/src/_q-press/components/MarkdownCardLink.vue +1 -1
- package/src/templates/init/src/_q-press/components/MarkdownCardTitle.vue +1 -1
- package/src/templates/init/src/_q-press/components/MarkdownCode.vue +71 -3
- package/src/templates/init/src/_q-press/components/MarkdownCodepen.vue +316 -59
- package/src/templates/init/src/_q-press/components/MarkdownCopyButton.vue +1 -1
- package/src/templates/init/src/_q-press/components/MarkdownExample.vue +54 -19
- package/src/templates/init/src/_q-press/components/MarkdownLink.vue +5 -5
- package/src/templates/init/src/_q-press/components/MarkdownMermaid.vue +123 -0
- package/src/templates/init/src/_q-press/components/MarkdownTree.vue +2 -2
- package/src/templates/init/src/_q-press/components/markdown-utils.ts +27 -3
- package/src/templates/init/src/_q-press/css/app.scss +38 -26
- package/src/templates/init/src/_q-press/css/code-theme.scss +634 -0
- package/src/templates/init/src/_q-press/css/themes/default.scss +1 -1
- package/src/templates/init/src/_q-press/css/themes/evergreen.scss +69 -0
- package/src/templates/init/src/_q-press/css/themes/mystic.scss +1 -1
- package/src/templates/init/src/_q-press/css/themes/newspaper.scss +1 -1
- package/src/templates/init/src/_q-press/css/themes/sunrise.scss +1 -1
- package/src/templates/init/src/_q-press/css/themes/tawny.scss +1 -1
- package/src/templates/init/src/_q-press/layouts/MarkdownDrawerSidebar.vue +1 -1
- package/src/templates/init/src/_q-press/layouts/MarkdownDrawerToc.vue +1 -1
- package/src/templates/init/src/_q-press/layouts/MarkdownHeader.vue +1 -1
- package/src/templates/init/src/_q-press/layouts/MarkdownLayout.vue +2 -2
- package/src/templates/init/src/_q-press/layouts/MarkdownPage.vue +4 -3
- package/src/templates/init/src/_q-press/layouts/MarkdownSearch.vue +1 -1
- package/src/templates/init/src/_q-press/stores/markdown.ts +1 -2
- package/src/templates/init/src/components/LandingPage/LandingPage.vue +15 -1
- package/src/templates/init/src/components/QPressThemeGallery.vue +336 -0
- package/src/templates/init/src/components/page-parts/releases/GitHubReleases.vue +121 -0
- package/src/templates/init/src/components/page-parts/releases/PackageReleases.vue +191 -0
- package/src/templates/init/src/components/page-parts/releases/md-table-parser.ts +52 -0
- package/src/templates/init/src/components/page-parts/releases/sanitize.ts +132 -0
- package/src/templates/init/src/markdown/__elements.md +8 -8
- package/src/templates/init/src/markdown/__elements2.md +4 -4
- package/src/templates/init/src/markdown/faq/best-practices.md +27 -0
- package/src/templates/init/src/markdown/faq/general.md +27 -0
- package/src/templates/init/src/markdown/faq/troubleshooting.md +27 -0
- package/src/templates/init/src/markdown/getting-started/introduction.md +7 -5
- package/src/templates/init/src/markdown/md-plugins/blockquote/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/codeblocks/advanced.md +19 -15
- package/src/templates/init/src/markdown/md-plugins/codeblocks/overview.md +45 -8
- package/src/templates/init/src/markdown/md-plugins/containers/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/frontmatter/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/headers/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/image/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/imports/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/inline-code/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/link/advanced.md +2 -2
- package/src/templates/init/src/markdown/md-plugins/link/overview.md +6 -4
- package/src/templates/init/src/markdown/md-plugins/mermaid/advanced.md +69 -0
- package/src/templates/init/src/markdown/md-plugins/mermaid/overview.md +73 -0
- package/src/templates/init/src/markdown/md-plugins/shared/overview.md +28 -13
- package/src/templates/init/src/markdown/md-plugins/table/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/title/overview.md +3 -1
- package/src/templates/init/src/markdown/other/contact.md +37 -0
- package/src/templates/init/src/markdown/other/contributing/bugs-and-feature-requests.md +33 -0
- package/src/templates/init/src/markdown/other/contributing/call-to-action.md +25 -0
- package/src/templates/init/src/markdown/other/contributing/documentation.md +31 -0
- package/src/templates/init/src/markdown/other/contributing/overview.md +41 -0
- package/src/templates/init/src/markdown/other/contributing/packages.md +28 -0
- package/src/templates/init/src/markdown/other/contributing/sponsor.md +23 -0
- package/src/templates/init/src/markdown/other/faq.md +179 -0
- package/src/templates/init/src/markdown/other/releases.md +11 -0
- package/src/templates/init/src/markdown/other/upgrade-guide.md +165 -0
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/advanced.md +11 -3
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/components.md +25 -29
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/overview.md +20 -20
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/site-config.md +17 -3
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/themes.md +101 -9
- package/src/templates/init/src/markdown/quasar-app-extensions/vite-md-plugin-app-ext/advanced.md +158 -0
- package/src/templates/init/src/markdown/quasar-app-extensions/vite-md-plugin-app-ext/overview.md +1 -1
- package/src/templates/init/src/markdown/vite-plugins/vite-examples-plugin/advanced.md +8 -3
- package/src/templates/init/src/markdown/vite-plugins/vite-examples-plugin/overview.md +19 -5
- package/src/templates/init/src/markdown/vite-plugins/vite-md-plugin/advanced.md +84 -54
- package/src/templates/init/src/markdown/vite-plugins/vite-md-plugin/overview.md +19 -3
- package/src/templates/init/src/siteConfig/index.ts +52 -23
- package/src/templates/update/src/_q-press/api/components/MarkdownCode.json +2 -2
- package/src/templates/update/src/_q-press/api/components/MarkdownCodepen.json +6 -9
- package/src/templates/update/src/_q-press/api/components/MarkdownExample.json +27 -2
- package/src/templates/update/src/_q-press/components/MarkdownApi.vue +129 -84
- package/src/templates/update/src/_q-press/components/MarkdownCardLink.vue +1 -1
- package/src/templates/update/src/_q-press/components/MarkdownCardTitle.vue +1 -1
- package/src/templates/update/src/_q-press/components/MarkdownCode.vue +71 -3
- package/src/templates/update/src/_q-press/components/MarkdownCodepen.vue +316 -59
- package/src/templates/update/src/_q-press/components/MarkdownCopyButton.vue +1 -1
- package/src/templates/update/src/_q-press/components/MarkdownExample.vue +54 -19
- package/src/templates/update/src/_q-press/components/MarkdownLink.vue +5 -5
- package/src/templates/update/src/_q-press/components/MarkdownMermaid.vue +123 -0
- package/src/templates/update/src/_q-press/components/MarkdownTree.vue +2 -2
- package/src/templates/update/src/_q-press/components/markdown-utils.ts +27 -3
- package/src/templates/update/src/_q-press/css/app.scss +38 -26
- package/src/templates/update/src/_q-press/css/code-theme.scss +634 -0
- package/src/templates/update/src/_q-press/css/themes/default.scss +1 -1
- package/src/templates/update/src/_q-press/css/themes/evergreen.scss +69 -0
- package/src/templates/update/src/_q-press/css/themes/mystic.scss +1 -1
- package/src/templates/update/src/_q-press/css/themes/newspaper.scss +1 -1
- package/src/templates/update/src/_q-press/css/themes/sunrise.scss +1 -1
- package/src/templates/update/src/_q-press/css/themes/tawny.scss +1 -1
- package/src/templates/update/src/_q-press/layouts/MarkdownDrawerSidebar.vue +1 -1
- package/src/templates/update/src/_q-press/layouts/MarkdownDrawerToc.vue +1 -1
- package/src/templates/update/src/_q-press/layouts/MarkdownHeader.vue +1 -1
- package/src/templates/update/src/_q-press/layouts/MarkdownLayout.vue +2 -2
- package/src/templates/update/src/_q-press/layouts/MarkdownPage.vue +4 -3
- package/src/templates/update/src/_q-press/layouts/MarkdownSearch.vue +1 -1
- package/src/templates/update/src/_q-press/stores/markdown.ts +1 -2
- package/tsconfig.json +1 -1
- package/dist/templates/init/src/_q-press/api/components/MarkdownCodePrism.json +0 -29
- package/dist/templates/init/src/_q-press/components/MarkdownCodePrism.ts +0 -36
- package/dist/templates/init/src/_q-press/css/prism-theme.scss +0 -298
- package/dist/templates/init/src/markdown/guides/contributing.md +0 -101
- package/dist/templates/init/src/markdown/guides/faq.md +0 -115
- package/dist/templates/init/src/markdown/guides/release-notes.md +0 -0
- package/dist/templates/init/src/markdown/guides/style-guide.md +0 -0
- package/dist/templates/init/src/markdown/guides/upgrade-guide.md +0 -92
- package/dist/templates/init/src/markdown/other/release-notes.md +0 -8
- package/dist/templates/init/src/q-press.globals.d.ts +0 -36
- package/dist/templates/update/src/_q-press/api/components/MarkdownCodePrism.json +0 -29
- package/dist/templates/update/src/_q-press/components/MarkdownCodePrism.ts +0 -36
- package/dist/templates/update/src/_q-press/css/prism-theme.scss +0 -298
- package/dist/templates/update/src/q-press.globals.d.ts +0 -36
- package/src/templates/init/src/_q-press/api/components/MarkdownCodePrism.json +0 -29
- package/src/templates/init/src/_q-press/components/MarkdownCodePrism.ts +0 -36
- package/src/templates/init/src/_q-press/css/prism-theme.scss +0 -298
- package/src/templates/init/src/markdown/guides/contributing.md +0 -101
- package/src/templates/init/src/markdown/guides/faq.md +0 -115
- package/src/templates/init/src/markdown/guides/release-notes.md +0 -0
- package/src/templates/init/src/markdown/guides/style-guide.md +0 -0
- package/src/templates/init/src/markdown/guides/upgrade-guide.md +0 -92
- package/src/templates/init/src/markdown/other/release-notes.md +0 -8
- package/src/templates/init/src/q-press.globals.d.ts +0 -36
- package/src/templates/update/src/_q-press/api/components/MarkdownCodePrism.json +0 -29
- package/src/templates/update/src/_q-press/components/MarkdownCodePrism.ts +0 -36
- package/src/templates/update/src/_q-press/css/prism-theme.scss +0 -298
- package/src/templates/update/src/q-press.globals.d.ts +0 -36
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="markdown-mermaid q-my-md">
|
|
3
|
+
<div
|
|
4
|
+
v-if="errorMessage"
|
|
5
|
+
class="markdown-mermaid__error"
|
|
6
|
+
role="alert"
|
|
7
|
+
>
|
|
8
|
+
{{ errorMessage }}
|
|
9
|
+
</div>
|
|
10
|
+
<div
|
|
11
|
+
v-else-if="isRendering"
|
|
12
|
+
class="markdown-mermaid__loading"
|
|
13
|
+
>
|
|
14
|
+
Rendering diagram...
|
|
15
|
+
</div>
|
|
16
|
+
<div
|
|
17
|
+
ref="containerRef"
|
|
18
|
+
class="markdown-mermaid__diagram"
|
|
19
|
+
></div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
import { uid, useQuasar } from 'quasar'
|
|
25
|
+
import { nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
26
|
+
|
|
27
|
+
const props = defineProps<{
|
|
28
|
+
code: string
|
|
29
|
+
}>()
|
|
30
|
+
|
|
31
|
+
const $q = useQuasar()
|
|
32
|
+
const containerRef = ref<HTMLElement | null>(null)
|
|
33
|
+
const errorMessage = ref('')
|
|
34
|
+
const isRendering = ref(false)
|
|
35
|
+
|
|
36
|
+
let disposed = false
|
|
37
|
+
let renderRequest = 0
|
|
38
|
+
|
|
39
|
+
async function renderDiagram(): Promise<void> {
|
|
40
|
+
if (import.meta.env.QUASAR_CLIENT !== true || containerRef.value === null) {
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const requestId = ++renderRequest
|
|
45
|
+
|
|
46
|
+
errorMessage.value = ''
|
|
47
|
+
isRendering.value = true
|
|
48
|
+
|
|
49
|
+
await nextTick()
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
const { default: mermaid } = await import('mermaid')
|
|
53
|
+
|
|
54
|
+
mermaid.initialize({
|
|
55
|
+
securityLevel: 'strict',
|
|
56
|
+
startOnLoad: false,
|
|
57
|
+
theme: $q.dark.isActive === true ? 'dark' : 'default',
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const { svg, bindFunctions } = await mermaid.render(`markdown-mermaid-${uid()}`, props.code)
|
|
61
|
+
|
|
62
|
+
if (disposed === true || requestId !== renderRequest || containerRef.value === null) {
|
|
63
|
+
return
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
containerRef.value.innerHTML = svg
|
|
67
|
+
bindFunctions?.(containerRef.value)
|
|
68
|
+
} catch (error) {
|
|
69
|
+
if (disposed === false && requestId === renderRequest) {
|
|
70
|
+
errorMessage.value = error instanceof Error ? error.message : 'Unable to render diagram.'
|
|
71
|
+
}
|
|
72
|
+
} finally {
|
|
73
|
+
if (disposed === false && requestId === renderRequest) {
|
|
74
|
+
isRendering.value = false
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
onMounted(() => {
|
|
80
|
+
void renderDiagram()
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
watch(
|
|
84
|
+
() => [props.code, $q.dark.isActive] as const,
|
|
85
|
+
() => {
|
|
86
|
+
void renderDiagram()
|
|
87
|
+
},
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
onBeforeUnmount(() => {
|
|
91
|
+
disposed = true
|
|
92
|
+
})
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<style lang="scss">
|
|
96
|
+
.markdown-mermaid {
|
|
97
|
+
border: 1px solid var(--q-separator-color);
|
|
98
|
+
border-radius: 8px;
|
|
99
|
+
overflow-x: auto;
|
|
100
|
+
padding: 1rem;
|
|
101
|
+
|
|
102
|
+
&__diagram {
|
|
103
|
+
min-width: 100%;
|
|
104
|
+
text-align: center;
|
|
105
|
+
|
|
106
|
+
svg {
|
|
107
|
+
max-width: 100%;
|
|
108
|
+
height: auto;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&__error {
|
|
113
|
+
color: var(--q-negative);
|
|
114
|
+
font-family: monospace;
|
|
115
|
+
white-space: pre-wrap;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&__loading {
|
|
119
|
+
color: var(--q-secondary);
|
|
120
|
+
font-style: italic;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
</q-tree>
|
|
35
35
|
</template>
|
|
36
36
|
|
|
37
|
-
<script setup>
|
|
38
|
-
import { mdiLaunch, mdiInformationOutline } from '@quasar/extras/mdi-
|
|
37
|
+
<script setup lang="ts">
|
|
38
|
+
import { mdiLaunch, mdiInformationOutline } from '@quasar/extras/mdi-v7'
|
|
39
39
|
|
|
40
40
|
const props = defineProps({
|
|
41
41
|
def: {
|
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
import { Notify } from 'quasar'
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const andRE = /&/g
|
|
4
|
+
const rCombining = /[\u0300-\u036F]/g
|
|
5
|
+
// oxlint-disable-next-line no-control-regex
|
|
6
|
+
const rControl = /[\u0000-\u001f]/g
|
|
7
|
+
const rSpecial = /[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'“”‘’<>,.?/]+/g
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Default slugification function used by qPress client helpers.
|
|
11
|
+
*/
|
|
12
|
+
export const slugify = (str: string): string =>
|
|
13
|
+
str
|
|
14
|
+
.trim()
|
|
15
|
+
.replace(/([a-z])([A-Z])/g, '$1-$2')
|
|
16
|
+
.replace(/[\s_]+/g, '-')
|
|
17
|
+
.toLowerCase()
|
|
18
|
+
.normalize('NFKD')
|
|
19
|
+
.replace(rCombining, '')
|
|
20
|
+
.replace(andRE, '-and-')
|
|
21
|
+
.replace(rControl, '-')
|
|
22
|
+
.replace(rSpecial, '-')
|
|
23
|
+
.replace(/[^a-z0-9-]+/g, '')
|
|
24
|
+
.replace(/([a-z])(\d)/g, '$1-$2')
|
|
25
|
+
.replace(/(\d)([a-z])/g, '$1-$2')
|
|
26
|
+
.replace(/-{2,}/g, '-')
|
|
27
|
+
.replace(/(^-|-$)/g, '')
|
|
28
|
+
.replace(/^(\d)/, '_$1')
|
|
3
29
|
|
|
4
30
|
/**
|
|
5
31
|
* Fallback function to copy text to clipboard when the Clipboard API is not available.
|
|
@@ -101,5 +127,3 @@ export function copyHeading(id: string): void {
|
|
|
101
127
|
timeout: 2000,
|
|
102
128
|
})
|
|
103
129
|
}
|
|
104
|
-
|
|
105
|
-
export { slugify }
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
@use 'sass:math';
|
|
2
|
+
@use 'sass:color';
|
|
3
|
+
@use './fonts.scss';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
@import './
|
|
5
|
+
// Keep this import so Shiki code blocks share the selected qPress theme variables.
|
|
6
|
+
@import './code-theme.scss';
|
|
5
7
|
|
|
6
8
|
.material-icons {
|
|
7
9
|
font-family: 'Material Icons';
|
|
@@ -82,9 +84,10 @@ ul {
|
|
|
82
84
|
line-height: $font-size;
|
|
83
85
|
border-radius: $generic-border-radius;
|
|
84
86
|
font-family: inherit;
|
|
85
|
-
color:
|
|
87
|
+
color: $brand-light-text;
|
|
88
|
+
background-color: rgba($brand-primary, 0.08);
|
|
86
89
|
vertical-align: baseline;
|
|
87
|
-
border: 1px solid
|
|
90
|
+
border: 1px solid rgba($brand-primary, 0.5);
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
.markdown-note {
|
|
@@ -107,10 +110,13 @@ ul {
|
|
|
107
110
|
// .markdown-note__title,
|
|
108
111
|
.markdown-link,
|
|
109
112
|
.markdown-token {
|
|
110
|
-
color:
|
|
113
|
+
color: $brand-light-text;
|
|
114
|
+
}
|
|
115
|
+
.markdown-link {
|
|
116
|
+
border-bottom-color: rgba($brand-primary, 0.78);
|
|
111
117
|
}
|
|
112
118
|
.markdown-token {
|
|
113
|
-
border-color:
|
|
119
|
+
border-color: rgba($brand-primary, 0.5);
|
|
114
120
|
}
|
|
115
121
|
& strong {
|
|
116
122
|
font-weight: 700;
|
|
@@ -119,16 +125,16 @@ ul {
|
|
|
119
125
|
}
|
|
120
126
|
|
|
121
127
|
&--tip {
|
|
122
|
-
color: scale
|
|
123
|
-
background-color: scale
|
|
128
|
+
color: color.scale($positive, $lightness: -40%) !important;
|
|
129
|
+
background-color: color.scale($positive, $lightness: 85%);
|
|
124
130
|
border-color: $positive;
|
|
125
131
|
.markdown-note__title,
|
|
126
132
|
.markdown-link,
|
|
127
133
|
.markdown-token {
|
|
128
|
-
color: scale
|
|
134
|
+
color: color.scale($positive, $lightness: -40%);
|
|
129
135
|
}
|
|
130
136
|
.markdown-token {
|
|
131
|
-
border-color: scale
|
|
137
|
+
border-color: color.scale($positive, $lightness: -40%);
|
|
132
138
|
}
|
|
133
139
|
& strong {
|
|
134
140
|
font-weight: 700;
|
|
@@ -137,16 +143,16 @@ ul {
|
|
|
137
143
|
}
|
|
138
144
|
|
|
139
145
|
&--warning {
|
|
140
|
-
color: scale
|
|
141
|
-
background-color: scale
|
|
142
|
-
border-color: scale
|
|
146
|
+
color: color.scale($warning, $lightness: -40%);
|
|
147
|
+
background-color: color.scale($warning, $lightness: 85%);
|
|
148
|
+
border-color: color.scale($warning, $lightness: -30%);
|
|
143
149
|
.markdown-note__title,
|
|
144
150
|
.markdown-link,
|
|
145
151
|
.markdown-token {
|
|
146
|
-
color: scale
|
|
152
|
+
color: color.scale($warning, $lightness: -40%);
|
|
147
153
|
}
|
|
148
154
|
.markdown-token {
|
|
149
|
-
border-color: scale
|
|
155
|
+
border-color: color.scale($warning, $lightness: -40%);
|
|
150
156
|
}
|
|
151
157
|
& strong {
|
|
152
158
|
font-weight: 700;
|
|
@@ -155,8 +161,8 @@ ul {
|
|
|
155
161
|
}
|
|
156
162
|
|
|
157
163
|
&--danger {
|
|
158
|
-
color: scale
|
|
159
|
-
background-color: scale
|
|
164
|
+
color: color.scale($negative, $lightness: -40%);
|
|
165
|
+
background-color: color.scale($negative, $lightness: 90%);
|
|
160
166
|
border-color: $negative;
|
|
161
167
|
.markdown-note__title,
|
|
162
168
|
.markdown-link,
|
|
@@ -511,7 +517,7 @@ body.q-scroll--lock .q-page > .q-scroll--anchor {
|
|
|
511
517
|
.markdown-heading .q-badge,
|
|
512
518
|
.header-badge {
|
|
513
519
|
color: $brand-primary;
|
|
514
|
-
background: scale
|
|
520
|
+
background: color.scale($light-bg, $lightness: 15%);
|
|
515
521
|
vertical-align: super;
|
|
516
522
|
letter-spacing: $letter-spacing-brand;
|
|
517
523
|
padding: 4px 8px;
|
|
@@ -552,6 +558,12 @@ $letter-spacing-list: 40, 100, 225, 263, 300, 375, 450;
|
|
|
552
558
|
}
|
|
553
559
|
|
|
554
560
|
body.body--dark {
|
|
561
|
+
.markdown-token {
|
|
562
|
+
color: $brand-dark-text;
|
|
563
|
+
background-color: rgba($brand-primary, 0.18);
|
|
564
|
+
border-color: rgba($brand-primary, 0.72);
|
|
565
|
+
}
|
|
566
|
+
|
|
555
567
|
.markdown-technical {
|
|
556
568
|
color: $brand-dark-text;
|
|
557
569
|
background: $brand-dark-bg;
|
|
@@ -591,9 +603,9 @@ body.body--dark {
|
|
|
591
603
|
|
|
592
604
|
.markdown-note {
|
|
593
605
|
&:not(.markdown-note--tip, .markdown-note--warning, .markdown-note--danger) {
|
|
594
|
-
color: scale
|
|
606
|
+
color: color.scale($dark-pill, $lightness: 80%);
|
|
595
607
|
background-color: $dark-pill;
|
|
596
|
-
border-color: scale
|
|
608
|
+
border-color: color.scale($dark-pill, $lightness: 50%);
|
|
597
609
|
.markdown-token {
|
|
598
610
|
border-color: #ddd;
|
|
599
611
|
color: #ddd;
|
|
@@ -605,7 +617,7 @@ body.body--dark {
|
|
|
605
617
|
|
|
606
618
|
&--tip {
|
|
607
619
|
border-color: $positive;
|
|
608
|
-
background-color: scale
|
|
620
|
+
background-color: color.scale($positive, $lightness: -85%);
|
|
609
621
|
.markdown-note__title,
|
|
610
622
|
.markdown-link,
|
|
611
623
|
.markdown-token {
|
|
@@ -618,7 +630,7 @@ body.body--dark {
|
|
|
618
630
|
|
|
619
631
|
&--warning {
|
|
620
632
|
border-color: $warning;
|
|
621
|
-
background-color: scale
|
|
633
|
+
background-color: color.scale($warning, $lightness: -85%);
|
|
622
634
|
.markdown-note__title,
|
|
623
635
|
.markdown-link,
|
|
624
636
|
.markdown-token {
|
|
@@ -631,7 +643,7 @@ body.body--dark {
|
|
|
631
643
|
|
|
632
644
|
&--danger {
|
|
633
645
|
border-color: $negative;
|
|
634
|
-
background-color: scale
|
|
646
|
+
background-color: color.scale($negative, $lightness: -80%);
|
|
635
647
|
}
|
|
636
648
|
}
|
|
637
649
|
|
|
@@ -656,7 +668,7 @@ body.body--dark {
|
|
|
656
668
|
padding: 4px 8px 4px 28px;
|
|
657
669
|
position: relative;
|
|
658
670
|
border-radius: 3px 5px 5px 0;
|
|
659
|
-
background: scale
|
|
671
|
+
background: color.scale($brand-light, $lightness: -15%);
|
|
660
672
|
color: $brand-secondary;
|
|
661
673
|
font-size: ($font-size + 2px);
|
|
662
674
|
letter-spacing: $letter-spacing-brand;
|
|
@@ -670,7 +682,7 @@ body.body--dark {
|
|
|
670
682
|
height: 0;
|
|
671
683
|
border: 0 solid transparent;
|
|
672
684
|
border-width: 9px 0 0 11px;
|
|
673
|
-
border-top-color: scale
|
|
685
|
+
border-top-color: color.scale($brand-light, $lightness: -25%);
|
|
674
686
|
}
|
|
675
687
|
}
|
|
676
688
|
|
|
@@ -678,6 +690,6 @@ body.body--dark .markdown-card-title {
|
|
|
678
690
|
background: $brand-secondary;
|
|
679
691
|
color: $dark-text;
|
|
680
692
|
&:after {
|
|
681
|
-
border-top-color: scale
|
|
693
|
+
border-top-color: color.scale($brand-secondary, $lightness: -30%);
|
|
682
694
|
}
|
|
683
695
|
}
|