@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
|
@@ -11,48 +11,308 @@
|
|
|
11
11
|
</form>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
|
-
<script setup>
|
|
14
|
+
<script setup lang="ts">
|
|
15
15
|
import { Quasar } from 'quasar'
|
|
16
16
|
import { ref, reactive, computed, nextTick } from 'vue'
|
|
17
17
|
|
|
18
|
-
import
|
|
18
|
+
import siteConfig from '../../siteConfig'
|
|
19
|
+
import { slugify } from './markdown-utils'
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
type CodepenParts = {
|
|
22
|
+
Template?: string
|
|
23
|
+
Script?: string
|
|
24
|
+
Style?: string
|
|
25
|
+
[key: string]: string | undefined
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type CodepenGlobalPackage = {
|
|
29
|
+
packageName: string
|
|
30
|
+
globalName: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const defaultCssResources = [
|
|
21
34
|
'https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons',
|
|
22
35
|
`https://cdn.jsdelivr.net/npm/quasar@${Quasar.version}/dist/quasar.min.css`,
|
|
23
|
-
]
|
|
36
|
+
]
|
|
24
37
|
|
|
25
|
-
const
|
|
38
|
+
const defaultJsResources = [
|
|
26
39
|
'https://cdn.jsdelivr.net/npm/vue@3/dist/vue.global.prod.js',
|
|
27
40
|
`https://cdn.jsdelivr.net/npm/quasar@${Quasar.version}/dist/quasar.umd.prod.js`,
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
function getAbsolutePublicUrl(path: string) {
|
|
44
|
+
const normalizedPath = path.startsWith('/') ? path : `/${path}`
|
|
45
|
+
|
|
46
|
+
return typeof location === 'undefined' ? normalizedPath : `${location.origin}${normalizedPath}`
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function rewriteRootRelativeUrls(content: string) {
|
|
50
|
+
return content
|
|
51
|
+
.replace(
|
|
52
|
+
/\b(src|href|poster)=("|')\/(?!\/)([^"']*)\2/g,
|
|
53
|
+
(_match: string, attr: string, quote: string, path: string) =>
|
|
54
|
+
`${attr}=${quote}${getAbsolutePublicUrl(path)}${quote}`,
|
|
55
|
+
)
|
|
56
|
+
.replace(
|
|
57
|
+
/url\(\s*(["']?)\/(?!\/)([^"')]+)\1\s*\)/g,
|
|
58
|
+
(_match: string, quote: string, path: string) =>
|
|
59
|
+
`url(${quote}${getAbsolutePublicUrl(path)}${quote})`,
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function indent(code: string, spaces = 2) {
|
|
64
|
+
const padding = ' '.repeat(spaces)
|
|
65
|
+
let isInsideTemplateLiteral = false
|
|
66
|
+
|
|
67
|
+
return code
|
|
68
|
+
.split('\n')
|
|
69
|
+
.map((line) => {
|
|
70
|
+
const shouldIndent = line.trim().length > 0 && isInsideTemplateLiteral === false
|
|
71
|
+
|
|
72
|
+
for (let index = 0; index < line.length; index++) {
|
|
73
|
+
if (line[index] !== '`') {
|
|
74
|
+
continue
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let escapeCount = 0
|
|
78
|
+
|
|
79
|
+
for (let escapeIndex = index - 1; escapeIndex >= 0 && line[escapeIndex] === '\\'; escapeIndex--) {
|
|
80
|
+
escapeCount++
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (escapeCount % 2 === 0) {
|
|
84
|
+
isInsideTemplateLiteral = !isInsideTemplateLiteral
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return shouldIndent ? padding + line : line
|
|
89
|
+
})
|
|
90
|
+
.join('\n')
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function getImportParts(content: string, packageName: string) {
|
|
94
|
+
const parts: { importName: string; bindingName: string }[] = []
|
|
95
|
+
const escapedPackageName = packageName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
96
|
+
const importRe = new RegExp(
|
|
97
|
+
`import\\s+(?!type\\b){([^}]*)}\\s+from\\s+['"]${escapedPackageName}['"];?`,
|
|
98
|
+
'g',
|
|
99
|
+
)
|
|
100
|
+
let match: RegExpExecArray | null
|
|
101
|
+
|
|
102
|
+
while ((match = importRe.exec(content)) !== null) {
|
|
103
|
+
for (const part of (match[1] ?? '').split(',')) {
|
|
104
|
+
const rawName = part.trim()
|
|
105
|
+
|
|
106
|
+
if (rawName.length === 0 || rawName.startsWith('type ')) {
|
|
107
|
+
continue
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const [importName, bindingName = importName] = rawName.split(/\s+as\s+/)
|
|
111
|
+
|
|
112
|
+
if (importName !== undefined && importName.length > 0) {
|
|
113
|
+
parts.push({
|
|
114
|
+
importName,
|
|
115
|
+
bindingName,
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return parts
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function getImportNames(content: string, packageName: string) {
|
|
125
|
+
return [
|
|
126
|
+
...new Set(
|
|
127
|
+
getImportParts(content, packageName).map(({ importName, bindingName }) =>
|
|
128
|
+
importName === bindingName ? importName : `${importName}: ${bindingName}`,
|
|
129
|
+
),
|
|
130
|
+
),
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function getImportBindingNames(content: string, packageName: string) {
|
|
135
|
+
return [...new Set(getImportParts(content, packageName).map(({ bindingName }) => bindingName))]
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function getGlobalPackageImportLines(content: string) {
|
|
139
|
+
return (siteConfig.codepen?.globalPackages ?? [])
|
|
140
|
+
.map(({ packageName, globalName }: CodepenGlobalPackage) => {
|
|
141
|
+
const imports = getImportNames(content, packageName)
|
|
142
|
+
|
|
143
|
+
return imports.length > 0 ? `const { ${imports.join(', ')} } = ${globalName}` : ''
|
|
144
|
+
})
|
|
145
|
+
.filter((line) => line.length > 0)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function getGlobalImportLines(content: string) {
|
|
149
|
+
const vueImports = getImportNames(content, 'vue')
|
|
150
|
+
const quasarImports = getImportNames(content, 'quasar')
|
|
151
|
+
|
|
152
|
+
return [
|
|
153
|
+
vueImports.length > 0 ? `const { ${vueImports.join(', ')} } = Vue` : '',
|
|
154
|
+
quasarImports.length > 0 ? `const { ${quasarImports.join(', ')} } = Quasar` : '',
|
|
155
|
+
...getGlobalPackageImportLines(content),
|
|
156
|
+
].filter((line) => line.length > 0)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function getGlobalImportBindingNames(content: string) {
|
|
160
|
+
return [
|
|
161
|
+
...getImportBindingNames(content, 'vue'),
|
|
162
|
+
...getImportBindingNames(content, 'quasar'),
|
|
163
|
+
...(siteConfig.codepen?.globalPackages ?? []).flatMap(({ packageName }: CodepenGlobalPackage) =>
|
|
164
|
+
getImportBindingNames(content, packageName),
|
|
165
|
+
),
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function stripImports(content: string) {
|
|
170
|
+
return content
|
|
171
|
+
.replace(/^\s*import\s+type\s+[\s\S]*?\s+from\s+['"][^'"]+['"];?\s*$/gm, '')
|
|
172
|
+
.replace(/^\s*import\s+[\s\S]*?\s+from\s+['"][^'"]+['"];?\s*$/gm, '')
|
|
173
|
+
.replace(/^\s*import\s+['"][^'"]+['"];?\s*$/gm, '')
|
|
174
|
+
.trim()
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function stripCompilerMacros(content: string) {
|
|
178
|
+
return content
|
|
179
|
+
.replace(/^\s*defineOptions\(\s*\{[\s\S]*?\}\s*\)\s*;?\s*$/gm, '')
|
|
180
|
+
.replace(/^\s*defineExpose\(\s*\{[\s\S]*?\}\s*\)\s*;?\s*$/gm, '')
|
|
181
|
+
.trim()
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function getScriptBlock(script: string, setup: boolean) {
|
|
185
|
+
const re = setup
|
|
186
|
+
? /<script\s+setup([^>]*)>([\s\S]*?)<\/script>/
|
|
187
|
+
: /<script(?!\s+setup)([^>]*)>([\s\S]*?)<\/script>/
|
|
188
|
+
const match = re.exec(script)
|
|
189
|
+
|
|
190
|
+
return {
|
|
191
|
+
attrs: match?.[1] ?? '',
|
|
192
|
+
content: match?.[2] ?? '',
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function getSetupReturnNames(content: string) {
|
|
197
|
+
const names = new Set<string>()
|
|
198
|
+
const topLevelContent = getTopLevelContent(content)
|
|
199
|
+
const declarationRe =
|
|
200
|
+
/(?:^|\n)\s*(?:const|let|var)\s+([\s\S]*?)(?=\n\s*(?:const|let|var|function|interface|type|class)\s+|\s*$)/g
|
|
201
|
+
const variableNameRe = /(?:^|\n)\s*([A-Za-z_$][\w$]*)\s*(?:[:=,]|$)/g
|
|
202
|
+
const functionRe = /(?:^|\n)\s*(?:async\s+)?function\s+([A-Za-z_$][\w$]*)/g
|
|
203
|
+
let match: RegExpExecArray | null
|
|
204
|
+
|
|
205
|
+
while ((match = declarationRe.exec(topLevelContent)) !== null) {
|
|
206
|
+
let variableMatch: RegExpExecArray | null
|
|
207
|
+
|
|
208
|
+
while ((variableMatch = variableNameRe.exec(match[1] ?? '')) !== null) {
|
|
209
|
+
if (variableMatch[1] !== undefined) {
|
|
210
|
+
names.add(variableMatch[1])
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
while ((match = functionRe.exec(topLevelContent)) !== null) {
|
|
216
|
+
if (match[1] !== undefined) {
|
|
217
|
+
names.add(match[1])
|
|
44
218
|
}
|
|
45
|
-
return text.join('\n')
|
|
46
219
|
}
|
|
47
220
|
|
|
221
|
+
return [...names]
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function getTopLevelContent(content: string) {
|
|
225
|
+
let depth = 0
|
|
226
|
+
let output = ''
|
|
227
|
+
|
|
228
|
+
for (const char of content) {
|
|
229
|
+
if (depth === 0 || char === '\n') {
|
|
230
|
+
output += char
|
|
231
|
+
} else {
|
|
232
|
+
output += ' '
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (char === '{') {
|
|
236
|
+
depth++
|
|
237
|
+
} else if (char === '}') {
|
|
238
|
+
depth = Math.max(0, depth - 1)
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return output
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function getAppSetup() {
|
|
246
|
+
return ['app.use(Quasar, { config: {} })', siteConfig.codepen?.jsSetup ?? '']
|
|
247
|
+
.map((line) => line.trim())
|
|
248
|
+
.filter((line) => line.length > 0)
|
|
249
|
+
.join('\n')
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function createSetupScript(script: string) {
|
|
253
|
+
const { content } = getScriptBlock(script, true)
|
|
254
|
+
const globalImports = getGlobalImportLines(content)
|
|
255
|
+
const setupContent = stripCompilerMacros(stripImports(content))
|
|
256
|
+
const returnNames = [
|
|
257
|
+
...new Set([...getGlobalImportBindingNames(content), ...getSetupReturnNames(setupContent)]),
|
|
258
|
+
]
|
|
259
|
+
const setupBody = [
|
|
260
|
+
setupContent.length > 0 ? indent(setupContent, 4) : '',
|
|
261
|
+
returnNames.length > 0 ? ` return { ${returnNames.join(', ')} }` : '',
|
|
262
|
+
]
|
|
263
|
+
.filter((line) => line.length > 0)
|
|
264
|
+
.join('\n\n')
|
|
265
|
+
|
|
266
|
+
return [
|
|
267
|
+
...globalImports,
|
|
268
|
+
`const app = Vue.createApp({
|
|
269
|
+
setup () {
|
|
270
|
+
${setupBody}
|
|
271
|
+
}
|
|
272
|
+
})`,
|
|
273
|
+
getAppSetup(),
|
|
274
|
+
"app.mount('#q-app')",
|
|
275
|
+
].join('\n\n')
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function createOptionsScript(script: string) {
|
|
279
|
+
const { content } = getScriptBlock(script, false)
|
|
280
|
+
const globalImports = getGlobalImportLines(content)
|
|
281
|
+
const match = /export\s+default\s+{([\s\S]*)}/.exec(content)
|
|
282
|
+
const beforeDefault = match === null ? stripImports(content) : stripImports(content.slice(0, match.index))
|
|
283
|
+
let component = match?.[1]?.trim() ?? ''
|
|
284
|
+
|
|
285
|
+
if (component.length > 0) {
|
|
286
|
+
component = '\n ' + component + '\n'
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return [
|
|
290
|
+
...globalImports,
|
|
291
|
+
beforeDefault,
|
|
292
|
+
`const app = Vue.createApp({${component}})`,
|
|
293
|
+
getAppSetup(),
|
|
294
|
+
"app.mount('#q-app')",
|
|
295
|
+
]
|
|
296
|
+
.filter((line) => line.length > 0)
|
|
297
|
+
.join('\n\n')
|
|
298
|
+
}
|
|
299
|
+
|
|
48
300
|
const props = defineProps({ title: { type: String, required: true } })
|
|
49
301
|
|
|
50
302
|
const active = ref(false)
|
|
51
|
-
const formRef = ref(null)
|
|
52
|
-
const def = reactive({ parts: {} })
|
|
303
|
+
const formRef = ref<HTMLFormElement | null>(null)
|
|
304
|
+
const def = reactive<{ parts: CodepenParts }>({ parts: {} })
|
|
305
|
+
|
|
306
|
+
const cssResources = computed(() => {
|
|
307
|
+
return [...defaultCssResources, ...(siteConfig.codepen?.cssExternal ?? [])].join(';')
|
|
308
|
+
})
|
|
309
|
+
|
|
310
|
+
const jsResources = computed(() => {
|
|
311
|
+
return [...defaultJsResources, ...(siteConfig.codepen?.jsExternal ?? [])].join(';')
|
|
312
|
+
})
|
|
53
313
|
|
|
54
314
|
const css = computed(() => {
|
|
55
|
-
return (def.parts.Style || '').replace(/(<style.*?>|<\/style>)/g, '').trim()
|
|
315
|
+
return rewriteRootRelativeUrls((def.parts.Style || '').replace(/(<style.*?>|<\/style>)/g, '').trim())
|
|
56
316
|
})
|
|
57
317
|
|
|
58
318
|
const cssPreprocessor = computed(() => {
|
|
@@ -62,42 +322,32 @@ const cssPreprocessor = computed(() => {
|
|
|
62
322
|
})
|
|
63
323
|
|
|
64
324
|
const js = computed(() => {
|
|
65
|
-
const
|
|
66
|
-
const vueImports = /import\s+{([^}'\n]+)}\s+from\s+'vue'/g
|
|
67
|
-
const otherImports = /import ([^'\n]*) from ([^\n]*)/g
|
|
68
|
-
let component = /export default {([\s\S]*)}/g.exec(def.parts.Script || '')
|
|
325
|
+
const script = def.parts.Script ?? ''
|
|
69
326
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
let script = /<script>([\s\S]*)export default {/g.exec(def.parts.Script || '')
|
|
76
|
-
script = ((script && script[1]) || '')
|
|
77
|
-
.replace(quasarImports, replace('Quasar'))
|
|
78
|
-
.replace(vueImports, replace('Vue'))
|
|
79
|
-
.replace(otherImports, '')
|
|
80
|
-
.trim()
|
|
327
|
+
return script.includes('<script setup') === true
|
|
328
|
+
? createSetupScript(script)
|
|
329
|
+
: createOptionsScript(script)
|
|
330
|
+
})
|
|
81
331
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
332
|
+
const jsPreProcessor = computed(() => {
|
|
333
|
+
const setupBlock = getScriptBlock(def.parts.Script ?? '', true)
|
|
334
|
+
const optionsBlock = getScriptBlock(def.parts.Script ?? '', false)
|
|
335
|
+
const attrs = setupBlock.content.length > 0 ? setupBlock.attrs : optionsBlock.attrs
|
|
86
336
|
|
|
87
|
-
|
|
88
|
-
app.mount('#q-app')
|
|
89
|
-
`
|
|
90
|
-
)
|
|
337
|
+
return siteConfig.codepen?.jsPreProcessor ?? (/lang=["']ts["']/.test(attrs) ? 'typescript' : 'babel')
|
|
91
338
|
})
|
|
92
339
|
|
|
93
340
|
const html = computed(() => {
|
|
94
|
-
|
|
341
|
+
const content = (def.parts.Template || '')
|
|
95
342
|
.replace(/(<template>|<\/template>$)/g, '')
|
|
96
343
|
.replace(/\n/g, '\n ')
|
|
97
344
|
.replace(/([\w]+=")([^"]*?)(")/g, function (match, p1, p2, p3) {
|
|
98
345
|
return p1 + p2.replace(/>/g, '___TEMP_REPLACEMENT___') + p3
|
|
99
346
|
})
|
|
100
|
-
.replace(
|
|
347
|
+
.replace(
|
|
348
|
+
/<([A-Z][\w-]*|[a-z][\w]*-[\w-]+|div)([^>]*?)\s*?([\n\r][\t ]+)?\/>/gs,
|
|
349
|
+
'<$1$2$3></$1>',
|
|
350
|
+
)
|
|
101
351
|
.replace(
|
|
102
352
|
/(<template[^>]*>)(\s*?(?:[\n\r][\t ]+)?)<(thead|tbody|tfoot)/gs,
|
|
103
353
|
'$1$2<___PREVENT_TEMPLATE___$3',
|
|
@@ -122,18 +372,25 @@ const html = computed(() => {
|
|
|
122
372
|
.replace(/___TEMP_REPLACEMENT___/g, '>')
|
|
123
373
|
.replace(/^\s{2}/gm, '')
|
|
124
374
|
.trim()
|
|
375
|
+
|
|
376
|
+
return rewriteRootRelativeUrls(content)
|
|
125
377
|
})
|
|
126
378
|
|
|
127
379
|
const editors = computed(() => {
|
|
128
|
-
const flag =
|
|
380
|
+
const flag =
|
|
381
|
+
(html.value.length > 0 ? 0b100 : 0) |
|
|
382
|
+
(css.value.length > 0 ? 0b010 : 0) |
|
|
383
|
+
(js.value.length > 0 ? 0b001 : 0)
|
|
129
384
|
return flag.toString(2)
|
|
130
385
|
})
|
|
131
386
|
|
|
132
387
|
const computedTitle = computed(() => {
|
|
388
|
+
const titleSuffix = siteConfig.codepen?.titleSuffix ?? `Quasar v${Quasar.version}`
|
|
389
|
+
|
|
133
390
|
return (
|
|
134
391
|
(typeof document !== 'undefined' ? document.title.split(' | ')[0] + ': ' : '') +
|
|
135
392
|
(props.title ? props.title + ' - ' : '') +
|
|
136
|
-
|
|
393
|
+
titleSuffix
|
|
137
394
|
)
|
|
138
395
|
})
|
|
139
396
|
|
|
@@ -157,14 +414,14 @@ ${location.origin + location.pathname}#${slugifiedTitle.value}
|
|
|
157
414
|
<div id="q-app" style="min-height: 100vh;">
|
|
158
415
|
${html.value}
|
|
159
416
|
</div>`,
|
|
160
|
-
head: '',
|
|
161
417
|
html_pre_processor: 'none',
|
|
162
418
|
css: css.value,
|
|
163
419
|
css_pre_processor: cssPreprocessor.value,
|
|
164
|
-
css_external: cssResources,
|
|
420
|
+
css_external: cssResources.value,
|
|
165
421
|
js: js.value,
|
|
166
|
-
js_pre_processor:
|
|
167
|
-
js_external: jsResources,
|
|
422
|
+
js_pre_processor: jsPreProcessor.value,
|
|
423
|
+
js_external: jsResources.value,
|
|
424
|
+
head: siteConfig.codepen?.head ?? '',
|
|
168
425
|
editors: editors.value,
|
|
169
426
|
}
|
|
170
427
|
return JSON.stringify(data)
|
|
@@ -175,18 +432,18 @@ ${html.value}
|
|
|
175
432
|
*
|
|
176
433
|
* @param {string} whichParts - The parts of the application to open.
|
|
177
434
|
*/
|
|
178
|
-
function open(whichParts) {
|
|
435
|
+
function open(whichParts: CodepenParts) {
|
|
179
436
|
def.parts = whichParts
|
|
180
437
|
|
|
181
438
|
if (active.value) {
|
|
182
|
-
formRef.value
|
|
439
|
+
formRef.value?.submit()
|
|
183
440
|
return
|
|
184
441
|
}
|
|
185
442
|
|
|
186
443
|
active.value = true
|
|
187
444
|
|
|
188
445
|
nextTick(() => {
|
|
189
|
-
formRef.value
|
|
446
|
+
formRef.value?.submit()
|
|
190
447
|
})
|
|
191
448
|
}
|
|
192
449
|
|
|
@@ -92,11 +92,11 @@
|
|
|
92
92
|
</q-card>
|
|
93
93
|
</template>
|
|
94
94
|
|
|
95
|
-
<script setup>
|
|
96
|
-
import { computed, inject, markRaw, ref, reactive, onMounted } from 'vue'
|
|
95
|
+
<script setup lang="ts">
|
|
96
|
+
import { computed, inject, markRaw, ref, reactive, onBeforeUnmount, onMounted } from 'vue'
|
|
97
97
|
import { openURL } from 'quasar'
|
|
98
98
|
|
|
99
|
-
import { fabGithub, fabCodepen } from '@quasar/extras/fontawesome-
|
|
99
|
+
import { fabGithub, fabCodepen } from '@quasar/extras/fontawesome-v7'
|
|
100
100
|
// import { mdiCompare } from '@quasar/extras/mdi-v7'
|
|
101
101
|
|
|
102
102
|
import MarkdownCode from './MarkdownCode.vue'
|
|
@@ -134,6 +134,7 @@ const def = reactive({
|
|
|
134
134
|
})
|
|
135
135
|
const currentTab = ref('Template')
|
|
136
136
|
const expanded = ref(false)
|
|
137
|
+
let removeHmrListener = () => {}
|
|
137
138
|
|
|
138
139
|
/**
|
|
139
140
|
* A computed property that returns the CSS class for the component.
|
|
@@ -186,7 +187,8 @@ function parseComponent(comp) {
|
|
|
186
187
|
}
|
|
187
188
|
|
|
188
189
|
function openGitHub() {
|
|
189
|
-
|
|
190
|
+
const root = siteConfig.githubSourceRootSrc ?? siteConfig.githubEditRootSrc.replace('/edit/', '/tree/')
|
|
191
|
+
openURL(`${root}/examples/${examples.name}/${props.file}.vue`)
|
|
190
192
|
}
|
|
191
193
|
|
|
192
194
|
function openCodepen() {
|
|
@@ -197,23 +199,56 @@ function toggleExpand() {
|
|
|
197
199
|
expanded.value = expanded.value === false
|
|
198
200
|
}
|
|
199
201
|
|
|
202
|
+
async function loadExample() {
|
|
203
|
+
const list = await examples.list
|
|
204
|
+
const devFile = `/src/examples/${examples.name}/${props.file}.vue`
|
|
205
|
+
|
|
206
|
+
if (import.meta.env.QUASAR_DEV) {
|
|
207
|
+
const loadComponent = list.code[devFile]
|
|
208
|
+
const loadSource = list.source[devFile]
|
|
209
|
+
|
|
210
|
+
if (loadComponent === void 0 || loadSource === void 0) {
|
|
211
|
+
throw new Error(`Markdown example not found: ${devFile}`)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const componentModule = await loadComponent()
|
|
215
|
+
const source = await loadSource()
|
|
216
|
+
|
|
217
|
+
component.value = markRaw(componentModule.default)
|
|
218
|
+
parseComponent(source)
|
|
219
|
+
} else {
|
|
220
|
+
component.value = markRaw(list[props.file])
|
|
221
|
+
parseComponent(list[`Raw${props.file}`])
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
isBusy.value = false
|
|
225
|
+
}
|
|
226
|
+
|
|
200
227
|
if (import.meta.env.QUASAR_CLIENT) {
|
|
201
228
|
onMounted(() => {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
229
|
+
void loadExample()
|
|
230
|
+
|
|
231
|
+
if (import.meta.hot) {
|
|
232
|
+
const examplePath = `/src/examples/${examples.name}/${props.file}.vue`
|
|
233
|
+
const onAfterUpdate = (payload) => {
|
|
234
|
+
const shouldReload = payload.updates.some(
|
|
235
|
+
(update) => update.path === examplePath || update.acceptedPath === examplePath,
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
if (shouldReload === true) {
|
|
239
|
+
void loadExample()
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
import.meta.hot.on('vite:afterUpdate', onAfterUpdate)
|
|
244
|
+
removeHmrListener = () => {
|
|
245
|
+
import.meta.hot?.off('vite:afterUpdate', onAfterUpdate)
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
})
|
|
249
|
+
|
|
250
|
+
onBeforeUnmount(() => {
|
|
251
|
+
removeHmrListener()
|
|
217
252
|
})
|
|
218
253
|
}
|
|
219
254
|
</script>
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
</a>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
|
-
<script setup>
|
|
11
|
+
<script setup lang="ts">
|
|
12
12
|
import { computed } from 'vue'
|
|
13
|
-
import { mdiLaunch } from '@quasar/extras/mdi-
|
|
13
|
+
import { mdiLaunch } from '@quasar/extras/mdi-v7'
|
|
14
14
|
|
|
15
15
|
const props = defineProps({ to: { type: String, required: true } })
|
|
16
16
|
const internal = computed(
|
|
@@ -20,14 +20,14 @@ const internal = computed(
|
|
|
20
20
|
|
|
21
21
|
<style lang="scss">
|
|
22
22
|
.markdown-link {
|
|
23
|
-
color:
|
|
23
|
+
color: $brand-light-text;
|
|
24
24
|
text-decoration: none;
|
|
25
|
-
border-bottom: 1px dotted
|
|
25
|
+
border-bottom: 1px dotted rgba($brand-primary, 0.78);
|
|
26
26
|
outline: 0;
|
|
27
27
|
transition: color $header-quick-transition;
|
|
28
28
|
|
|
29
29
|
body.body--dark & {
|
|
30
|
-
color: $brand-
|
|
30
|
+
color: $brand-dark-text;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
&:hover {
|