@md-plugins/quasar-app-extension-q-press 0.1.0-alpha.10

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.
Files changed (200) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +230 -0
  3. package/old/prompts.js +44 -0
  4. package/old/uninstall.js +9 -0
  5. package/package.json +60 -0
  6. package/scripts/build.js +33 -0
  7. package/src/index.js +63 -0
  8. package/src/install.js +49 -0
  9. package/src/templates/.gitkeep +0 -0
  10. package/src/templates/init/src/_q-press/.gitkeep +0 -0
  11. package/src/templates/init/src/_q-press/api/components/DarkModeToggle.json +37 -0
  12. package/src/templates/init/src/_q-press/api/components/MarkdownApi.json +67 -0
  13. package/src/templates/init/src/_q-press/api/components/MarkdownApiEntry.json +76 -0
  14. package/src/templates/init/src/_q-press/api/components/MarkdownCardLink.json +28 -0
  15. package/src/templates/init/src/_q-press/api/components/MarkdownCardTitle.json +48 -0
  16. package/src/templates/init/src/_q-press/api/components/MarkdownCode.json +37 -0
  17. package/src/templates/init/src/_q-press/api/components/MarkdownCodePrism.json +29 -0
  18. package/src/templates/init/src/_q-press/api/components/MarkdownCodepen.json +21 -0
  19. package/src/templates/init/src/_q-press/api/components/MarkdownCopyButton.json +36 -0
  20. package/src/templates/init/src/_q-press/api/components/MarkdownDrawerSidebar.json +17 -0
  21. package/src/templates/init/src/_q-press/api/components/MarkdownDrawerToc.json +17 -0
  22. package/src/templates/init/src/_q-press/api/components/MarkdownExample.json +22 -0
  23. package/src/templates/init/src/_q-press/api/components/MarkdownHeader.json +28 -0
  24. package/src/templates/init/src/_q-press/api/components/MarkdownHeaderIconLinks.json +16 -0
  25. package/src/templates/init/src/_q-press/api/components/MarkdownHeaderMenu.json +77 -0
  26. package/src/templates/init/src/_q-press/api/components/MarkdownHeaderTextLinks.json +33 -0
  27. package/src/templates/init/src/_q-press/api/components/MarkdownInstallation.json +33 -0
  28. package/src/templates/init/src/_q-press/api/components/MarkdownLayout.json +52 -0
  29. package/src/templates/init/src/_q-press/api/components/MarkdownLink.json +23 -0
  30. package/src/templates/init/src/_q-press/api/components/MarkdownPage.json +71 -0
  31. package/src/templates/init/src/_q-press/api/components/MarkdownPageFooter.json +21 -0
  32. package/src/templates/init/src/_q-press/api/components/MarkdownPageSidebar.json +56 -0
  33. package/src/templates/init/src/_q-press/api/components/MarkdownPageToc.json +17 -0
  34. package/src/templates/init/src/_q-press/api/components/MarkdownPrerender.json +25 -0
  35. package/src/templates/init/src/_q-press/api/components/MarkdownTree.json +27 -0
  36. package/src/templates/init/src/_q-press/api/composables/dark.json +29 -0
  37. package/src/templates/init/src/_q-press/api/composables/scroll.json +34 -0
  38. package/src/templates/init/src/_q-press/assets/get-meta.ts +29 -0
  39. package/src/templates/init/src/_q-press/components/DarkModeToggle.vue +105 -0
  40. package/src/templates/init/src/_q-press/components/MarkdownApi.vue +588 -0
  41. package/src/templates/init/src/_q-press/components/MarkdownApiEntry.ts +594 -0
  42. package/src/templates/init/src/_q-press/components/MarkdownCardLink.vue +25 -0
  43. package/src/templates/init/src/_q-press/components/MarkdownCardTitle.vue +21 -0
  44. package/src/templates/init/src/_q-press/components/MarkdownCode.vue +25 -0
  45. package/src/templates/init/src/_q-press/components/MarkdownCodePrism.ts +36 -0
  46. package/src/templates/init/src/_q-press/components/MarkdownCodepen.vue +183 -0
  47. package/src/templates/init/src/_q-press/components/MarkdownCopyButton.vue +104 -0
  48. package/src/templates/init/src/_q-press/components/MarkdownExample.vue +221 -0
  49. package/src/templates/init/src/_q-press/components/MarkdownInstallation.vue +166 -0
  50. package/src/templates/init/src/_q-press/components/MarkdownLink.vue +38 -0
  51. package/src/templates/init/src/_q-press/components/MarkdownPrerender.ts +82 -0
  52. package/src/templates/init/src/_q-press/components/MarkdownTree.vue +105 -0
  53. package/src/templates/init/src/_q-press/components/markdown-utils.ts +105 -0
  54. package/src/templates/init/src/_q-press/composables/dark.ts +39 -0
  55. package/src/templates/init/src/_q-press/composables/scroll.ts +115 -0
  56. package/src/templates/init/src/_q-press/css/app.scss +662 -0
  57. package/src/templates/init/src/_q-press/css/fonts.scss +100 -0
  58. package/src/templates/init/src/_q-press/css/prism-theme.scss +298 -0
  59. package/src/templates/init/src/_q-press/css/themes/default.scss +68 -0
  60. package/src/templates/init/src/_q-press/css/themes/newspaper.scss +69 -0
  61. package/src/templates/init/src/_q-press/css/themes/sunrise.scss +67 -0
  62. package/src/templates/init/src/_q-press/css/themes/tawny.scss +69 -0
  63. package/src/templates/init/src/_q-press/layouts/MarkdownDrawerSidebar.vue +32 -0
  64. package/src/templates/init/src/_q-press/layouts/MarkdownDrawerToc.vue +37 -0
  65. package/src/templates/init/src/_q-press/layouts/MarkdownHeader.vue +412 -0
  66. package/src/templates/init/src/_q-press/layouts/MarkdownHeaderIconLinks.vue +31 -0
  67. package/src/templates/init/src/_q-press/layouts/MarkdownHeaderMenu.ts +93 -0
  68. package/src/templates/init/src/_q-press/layouts/MarkdownHeaderTextLinks.vue +37 -0
  69. package/src/templates/init/src/_q-press/layouts/MarkdownLayout.vue +239 -0
  70. package/src/templates/init/src/_q-press/layouts/MarkdownPage.vue +307 -0
  71. package/src/templates/init/src/_q-press/layouts/MarkdownPageFooter.vue +187 -0
  72. package/src/templates/init/src/_q-press/layouts/MarkdownPageSidebar.scss +54 -0
  73. package/src/templates/init/src/_q-press/layouts/MarkdownPageSidebar.ts +218 -0
  74. package/src/templates/init/src/_q-press/layouts/MarkdownPageToc.vue +23 -0
  75. package/src/templates/init/src/_q-press/layouts/MarkdownSearch.vue +449 -0
  76. package/src/templates/init/src/_q-press/stores/markdown.ts +101 -0
  77. package/src/templates/init/src/components/LandingPage/LandingPage.vue +341 -0
  78. package/src/templates/init/src/components/Releases/PackageReleases.vue +164 -0
  79. package/src/templates/init/src/components/Releases/PublicReleases.vue +149 -0
  80. package/src/templates/init/src/components/Releases/ReleasesAvailable.vue +74 -0
  81. package/src/templates/init/src/examples/QAvatar/BasicExample.vue +11 -0
  82. package/src/templates/init/src/markdown/__elements.md +548 -0
  83. package/src/templates/init/src/markdown/__elements2.md +347 -0
  84. package/src/templates/init/src/markdown/faq/best-practices.md +0 -0
  85. package/src/templates/init/src/markdown/faq/general.md +0 -0
  86. package/src/templates/init/src/markdown/faq/troubleshooting.md +0 -0
  87. package/src/templates/init/src/markdown/getting-started/introduction.md +67 -0
  88. package/src/templates/init/src/markdown/guides/contributing.md +101 -0
  89. package/src/templates/init/src/markdown/guides/faq.md +115 -0
  90. package/src/templates/init/src/markdown/guides/release-notes.md +0 -0
  91. package/src/templates/init/src/markdown/guides/style-guide.md +0 -0
  92. package/src/templates/init/src/markdown/landing-page.md +11 -0
  93. package/src/templates/init/src/markdown/listing.ts +3 -0
  94. package/src/templates/init/src/markdown/md-plugins/blockquote/advanced.md +83 -0
  95. package/src/templates/init/src/markdown/md-plugins/blockquote/overview.md +183 -0
  96. package/src/templates/init/src/markdown/md-plugins/codeblocks/advanced.md +210 -0
  97. package/src/templates/init/src/markdown/md-plugins/codeblocks/overview.md +616 -0
  98. package/src/templates/init/src/markdown/md-plugins/containers/advanced.md +301 -0
  99. package/src/templates/init/src/markdown/md-plugins/containers/overview.md +206 -0
  100. package/src/templates/init/src/markdown/md-plugins/frontmatter/advanced.md +164 -0
  101. package/src/templates/init/src/markdown/md-plugins/frontmatter/overview.md +131 -0
  102. package/src/templates/init/src/markdown/md-plugins/headers/advanced.md +236 -0
  103. package/src/templates/init/src/markdown/md-plugins/headers/overview.md +134 -0
  104. package/src/templates/init/src/markdown/md-plugins/image/advanced.md +114 -0
  105. package/src/templates/init/src/markdown/md-plugins/image/overview.md +124 -0
  106. package/src/templates/init/src/markdown/md-plugins/imports/advanced.md +105 -0
  107. package/src/templates/init/src/markdown/md-plugins/imports/overview.md +80 -0
  108. package/src/templates/init/src/markdown/md-plugins/inline-code/advanced.md +133 -0
  109. package/src/templates/init/src/markdown/md-plugins/inline-code/overview.md +101 -0
  110. package/src/templates/init/src/markdown/md-plugins/link/advanced.md +157 -0
  111. package/src/templates/init/src/markdown/md-plugins/link/overview.md +126 -0
  112. package/src/templates/init/src/markdown/md-plugins/shared/overview.md +175 -0
  113. package/src/templates/init/src/markdown/md-plugins/table/advanced.md +190 -0
  114. package/src/templates/init/src/markdown/md-plugins/table/overview.md +186 -0
  115. package/src/templates/init/src/markdown/md-plugins/title/advanced.md +88 -0
  116. package/src/templates/init/src/markdown/md-plugins/title/overview.md +99 -0
  117. package/src/templates/init/src/markdown/other/release-notes.md +12 -0
  118. package/src/templates/init/src/markdown/privacy-policy.md +12 -0
  119. package/src/templates/init/src/markdown/quasar-app-extensions/qpress/advanced.md +101 -0
  120. package/src/templates/init/src/markdown/quasar-app-extensions/qpress/components.md +69 -0
  121. package/src/templates/init/src/markdown/quasar-app-extensions/qpress/overview.md +254 -0
  122. package/src/templates/init/src/markdown/quasar-app-extensions/qpress/themes.md +4 -0
  123. package/src/templates/init/src/markdown/quasar-app-extensions/vitemdpluginappext/advanced.md +4 -0
  124. package/src/templates/init/src/markdown/quasar-app-extensions/vitemdpluginappext/overview.md +103 -0
  125. package/src/templates/init/src/markdown/vite-plugins/index.md +6 -0
  126. package/src/templates/init/src/markdown/vite-plugins/viteexamplesplugin/advanced.md +138 -0
  127. package/src/templates/init/src/markdown/vite-plugins/viteexamplesplugin/overview.md +88 -0
  128. package/src/templates/init/src/markdown/vite-plugins/vitemdplugin/advanced.md +226 -0
  129. package/src/templates/init/src/markdown/vite-plugins/vitemdplugin/index.md +6 -0
  130. package/src/templates/init/src/markdown/vite-plugins/vitemdplugin/overview.md +166 -0
  131. package/src/templates/init/src/q-press.globals.d.ts +36 -0
  132. package/src/templates/init/src/siteConfig/index.ts +440 -0
  133. package/src/templates/update/src/_q-press/.gitkeep +0 -0
  134. package/src/templates/update/src/_q-press/api/components/DarkModeToggle.json +37 -0
  135. package/src/templates/update/src/_q-press/api/components/MarkdownApi.json +67 -0
  136. package/src/templates/update/src/_q-press/api/components/MarkdownApiEntry.json +76 -0
  137. package/src/templates/update/src/_q-press/api/components/MarkdownCardLink.json +28 -0
  138. package/src/templates/update/src/_q-press/api/components/MarkdownCardTitle.json +48 -0
  139. package/src/templates/update/src/_q-press/api/components/MarkdownCode.json +37 -0
  140. package/src/templates/update/src/_q-press/api/components/MarkdownCodePrism.json +29 -0
  141. package/src/templates/update/src/_q-press/api/components/MarkdownCodepen.json +21 -0
  142. package/src/templates/update/src/_q-press/api/components/MarkdownCopyButton.json +36 -0
  143. package/src/templates/update/src/_q-press/api/components/MarkdownDrawerSidebar.json +17 -0
  144. package/src/templates/update/src/_q-press/api/components/MarkdownDrawerToc.json +17 -0
  145. package/src/templates/update/src/_q-press/api/components/MarkdownExample.json +22 -0
  146. package/src/templates/update/src/_q-press/api/components/MarkdownHeader.json +28 -0
  147. package/src/templates/update/src/_q-press/api/components/MarkdownHeaderIconLinks.json +16 -0
  148. package/src/templates/update/src/_q-press/api/components/MarkdownHeaderMenu.json +77 -0
  149. package/src/templates/update/src/_q-press/api/components/MarkdownHeaderTextLinks.json +33 -0
  150. package/src/templates/update/src/_q-press/api/components/MarkdownInstallation.json +33 -0
  151. package/src/templates/update/src/_q-press/api/components/MarkdownLayout.json +52 -0
  152. package/src/templates/update/src/_q-press/api/components/MarkdownLink.json +23 -0
  153. package/src/templates/update/src/_q-press/api/components/MarkdownPage.json +71 -0
  154. package/src/templates/update/src/_q-press/api/components/MarkdownPageFooter.json +21 -0
  155. package/src/templates/update/src/_q-press/api/components/MarkdownPageSidebar.json +56 -0
  156. package/src/templates/update/src/_q-press/api/components/MarkdownPageToc.json +17 -0
  157. package/src/templates/update/src/_q-press/api/components/MarkdownPrerender.json +25 -0
  158. package/src/templates/update/src/_q-press/api/components/MarkdownTree.json +27 -0
  159. package/src/templates/update/src/_q-press/api/composables/dark.json +29 -0
  160. package/src/templates/update/src/_q-press/api/composables/scroll.json +34 -0
  161. package/src/templates/update/src/_q-press/assets/get-meta.ts +29 -0
  162. package/src/templates/update/src/_q-press/components/DarkModeToggle.vue +105 -0
  163. package/src/templates/update/src/_q-press/components/MarkdownApi.vue +588 -0
  164. package/src/templates/update/src/_q-press/components/MarkdownApiEntry.ts +594 -0
  165. package/src/templates/update/src/_q-press/components/MarkdownCardLink.vue +25 -0
  166. package/src/templates/update/src/_q-press/components/MarkdownCardTitle.vue +21 -0
  167. package/src/templates/update/src/_q-press/components/MarkdownCode.vue +25 -0
  168. package/src/templates/update/src/_q-press/components/MarkdownCodePrism.ts +36 -0
  169. package/src/templates/update/src/_q-press/components/MarkdownCodepen.vue +183 -0
  170. package/src/templates/update/src/_q-press/components/MarkdownCopyButton.vue +104 -0
  171. package/src/templates/update/src/_q-press/components/MarkdownExample.vue +221 -0
  172. package/src/templates/update/src/_q-press/components/MarkdownInstallation.vue +166 -0
  173. package/src/templates/update/src/_q-press/components/MarkdownLink.vue +38 -0
  174. package/src/templates/update/src/_q-press/components/MarkdownPrerender.ts +82 -0
  175. package/src/templates/update/src/_q-press/components/MarkdownTree.vue +105 -0
  176. package/src/templates/update/src/_q-press/components/markdown-utils.ts +105 -0
  177. package/src/templates/update/src/_q-press/composables/dark.ts +39 -0
  178. package/src/templates/update/src/_q-press/composables/scroll.ts +115 -0
  179. package/src/templates/update/src/_q-press/css/app.scss +662 -0
  180. package/src/templates/update/src/_q-press/css/fonts.scss +100 -0
  181. package/src/templates/update/src/_q-press/css/prism-theme.scss +298 -0
  182. package/src/templates/update/src/_q-press/css/themes/default.scss +68 -0
  183. package/src/templates/update/src/_q-press/css/themes/newspaper.scss +69 -0
  184. package/src/templates/update/src/_q-press/css/themes/sunrise.scss +67 -0
  185. package/src/templates/update/src/_q-press/css/themes/tawny.scss +69 -0
  186. package/src/templates/update/src/_q-press/layouts/MarkdownDrawerSidebar.vue +32 -0
  187. package/src/templates/update/src/_q-press/layouts/MarkdownDrawerToc.vue +37 -0
  188. package/src/templates/update/src/_q-press/layouts/MarkdownHeader.vue +412 -0
  189. package/src/templates/update/src/_q-press/layouts/MarkdownHeaderIconLinks.vue +31 -0
  190. package/src/templates/update/src/_q-press/layouts/MarkdownHeaderMenu.ts +93 -0
  191. package/src/templates/update/src/_q-press/layouts/MarkdownHeaderTextLinks.vue +37 -0
  192. package/src/templates/update/src/_q-press/layouts/MarkdownLayout.vue +239 -0
  193. package/src/templates/update/src/_q-press/layouts/MarkdownPage.vue +307 -0
  194. package/src/templates/update/src/_q-press/layouts/MarkdownPageFooter.vue +187 -0
  195. package/src/templates/update/src/_q-press/layouts/MarkdownPageSidebar.scss +54 -0
  196. package/src/templates/update/src/_q-press/layouts/MarkdownPageSidebar.ts +218 -0
  197. package/src/templates/update/src/_q-press/layouts/MarkdownPageToc.vue +23 -0
  198. package/src/templates/update/src/_q-press/layouts/MarkdownSearch.vue +449 -0
  199. package/src/templates/update/src/_q-press/stores/markdown.ts +101 -0
  200. package/src/templates/update/src/q-press.globals.d.ts +36 -0
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <q-drawer
3
+ id="toc-drawer"
4
+ v-model="markdownStore.tocDrawer"
5
+ side="right"
6
+ class="markdown-drawer"
7
+ behavior="mobile"
8
+ aria-labelledby="toc-drawer-title"
9
+ role="navigation"
10
+ >
11
+ <div class="markdown-drawer__header row justify-end no-wrap q-pt-sm q-pb-md q-px-sm">
12
+ <q-btn
13
+ :icon="mdiClose"
14
+ round
15
+ dense
16
+ flat
17
+ color="brand-accent"
18
+ @click="markdownStore.toggleTocDrawer"
19
+ />
20
+ </div>
21
+
22
+ <div id="toc-drawer-title" class="markdown-drawer__title q-px-md text-weight-bold">
23
+ On this page
24
+ </div>
25
+ <MarkdownPageToc class="q-pt-sm q-px-md q-pb-lg" />
26
+ </q-drawer>
27
+ </template>
28
+
29
+ <script setup lang="ts">
30
+ import { mdiClose } from '@quasar/extras/mdi-v7'
31
+
32
+ import { useMarkdownStore } from 'src/.q-press/stores/markdown'
33
+
34
+ import MarkdownPageToc from './MarkdownPageToc.vue'
35
+
36
+ const markdownStore = useMarkdownStore()
37
+ </script>
@@ -0,0 +1,412 @@
1
+ <template>
2
+ <q-header
3
+ class="markdown-header header-toolbar markdown-brand"
4
+ bordered
5
+ :height-hint="siteConfig.config.headerHeightHint || 128"
6
+ >
7
+ <q-toolbar
8
+ v-if="siteConfig.config.usePrimaryHeader"
9
+ class="markdown-header__primary q-pl-lg q-pr-md no-wrap items-stretch gt-750"
10
+ >
11
+ <q-btn
12
+ v-if="!siteConfig.config.useSecondaryHeader"
13
+ class="header-btn markdown-header__leftmost q-mr-xs lt-1300"
14
+ flat
15
+ round
16
+ icon="menu"
17
+ aria-label="Menu"
18
+ :aria-expanded="markdownStore.menuDrawer ? 'true' : 'false'"
19
+ aria-controls="menu-drawer"
20
+ @click="markdownStore.toggleMenuDrawer"
21
+ >
22
+ <q-tooltip>Menu</q-tooltip>
23
+ </q-btn>
24
+
25
+ <router-link
26
+ v-if="siteConfig.logoConfig.showLogo"
27
+ to="/"
28
+ class="markdown-header__logo row items-center no-wrap cursor-pointer"
29
+ >
30
+ <img
31
+ class="markdown-header__logo-img"
32
+ :src="logo.img"
33
+ :alt="logo.alt"
34
+ width="48"
35
+ height="48"
36
+ />
37
+ </router-link>
38
+
39
+ <template v-if="siteConfig.versionConfig.showOnHeader">
40
+ <div
41
+ v-if="siteConfig.versionConfig.showTitle"
42
+ class="row items-center no-wrap cursor-pointer gt-750"
43
+ >
44
+ <q-btn
45
+ to="/"
46
+ no-caps
47
+ flat
48
+ class="markdown-header__logo row items-center no-wrap cursor-pointer"
49
+ >
50
+ <div class="column">
51
+ <div class="col text-weight-bold">
52
+ {{ siteConfig.title }}
53
+ </div>
54
+ <div v-if="siteConfig.versionConfig.showVersion" class="col text-weight-light">
55
+ {{ siteConfig.version }}
56
+ </div>
57
+ </div>
58
+ </q-btn>
59
+ </div>
60
+ </template>
61
+
62
+ <div class="markdown-header__primary-left-spacer gt-lg" />
63
+
64
+ <MarkdownHeaderTextLinks
65
+ class="markdown-header__links col text-size-16 gt-1000"
66
+ :menu="siteConfig.links.primaryHeaderLinks"
67
+ mq-prefix="gt"
68
+ nav-class="text-uppercase text-size-16 letter-spacing-300"
69
+ />
70
+
71
+ <!-- <MarkdownSearch /> -->
72
+
73
+ <div
74
+ v-if="showThemeChanger"
75
+ class="markdown-header-icon-links q-ml-sm row no-wrap items-center"
76
+ >
77
+ <!-- <q-btn class="header-btn" type="a" flat round :icon="mdiCompare" @click="toggleDark" /> -->
78
+ <DarkModeToggle />
79
+ </div>
80
+ </q-toolbar>
81
+
82
+ <q-toolbar
83
+ v-if="siteConfig.config.useSecondaryHeader"
84
+ class="markdown-header__secondary q-pl-lg q-pr-md no-wrap"
85
+ >
86
+ <q-btn
87
+ class="header-btn markdown-header__leftmost q-mr-xs lt-1300"
88
+ flat
89
+ round
90
+ icon="menu"
91
+ aria-label="Menu"
92
+ :aria-expanded="markdownStore.menuDrawer ? 'true' : 'false'"
93
+ aria-controls="menu-drawer"
94
+ @click="markdownStore.toggleMenuDrawer"
95
+ >
96
+ <q-tooltip>Menu</q-tooltip>
97
+ </q-btn>
98
+
99
+ <router-link
100
+ v-if="!siteConfig.config.usePrimaryHeader && siteConfig.logoConfig.showLogo"
101
+ to="/"
102
+ class="markdown-header__logo row items-center no-wrap cursor-pointer"
103
+ >
104
+ <img
105
+ class="markdown-header__logo-img"
106
+ :src="logo.img"
107
+ :alt="logo.alt"
108
+ width="48"
109
+ height="48"
110
+ />
111
+ </router-link>
112
+
113
+ <template v-if="!siteConfig.config.usePrimaryHeader && siteConfig.versionConfig.showOnHeader">
114
+ <div
115
+ v-if="siteConfig.versionConfig.showTitle"
116
+ class="row items-center no-wrap cursor-pointer gt-1190"
117
+ >
118
+ <q-btn
119
+ to="/"
120
+ no-caps
121
+ flat
122
+ class="markdown-header__logo row items-center no-wrap cursor-pointer"
123
+ >
124
+ <div class="column">
125
+ <div class="col text-weight-bold">
126
+ {{ siteConfig.title }}
127
+ </div>
128
+ <div v-if="siteConfig.versionConfig.showVersion" class="col text-weight-light">
129
+ {{ siteConfig.version }}
130
+ </div>
131
+ </div>
132
+ </q-btn>
133
+ </div>
134
+ </template>
135
+
136
+ <div class="markdown-header__secondary-left-spacer gt-lg" />
137
+
138
+ <div class="markdown-header__links col row items-center no-wrap">
139
+ <MarkdownHeaderTextLinks
140
+ :menu="siteConfig.links.secondaryHeaderLinks"
141
+ nav-class="text-size-14 letter-spacing-100"
142
+ mq-prefix="gt"
143
+ />
144
+ <MarkdownHeaderTextLinks
145
+ v-if="siteConfig.config.useMoreLinks === true && hasMoreLinks"
146
+ :menu="siteConfig.links.moreLinks"
147
+ nav-class="text-size-14 letter-spacing-100 lt-1400"
148
+ mq-prefix="lt"
149
+ />
150
+ </div>
151
+
152
+ <MarkdownHeaderIconLinks class="gt-1400" :menu="siteConfig.links.socialLinks" />
153
+
154
+ <div
155
+ v-if="siteConfig.config.useToc && hasToc"
156
+ class="markdown-header-icon-links q-ml-sm lt-md row no-wrap items-center"
157
+ >
158
+ <q-btn
159
+ class="header-btn"
160
+ flat
161
+ round
162
+ :icon="mdiFolderPound"
163
+ aria-label="Table of Contents"
164
+ :aria-expanded="markdownStore.tocDrawer ? 'true' : 'false'"
165
+ aria-controls="toc-drawer"
166
+ @click="markdownStore.toggleTocDrawer"
167
+ >
168
+ <q-tooltip>Table of Contents</q-tooltip>
169
+ </q-btn>
170
+ </div>
171
+
172
+ <div
173
+ v-if="!siteConfig.config.usePrimaryHeader"
174
+ class="markdown-header-icon-links q-ml-sm row no-wrap items-center"
175
+ >
176
+ <!-- <q-btn class="header-btn" type="a" flat round :icon="mdiCompare" @click="toggleDark" /> -->
177
+ <DarkModeToggle />
178
+ </div>
179
+ </q-toolbar>
180
+ </q-header>
181
+ </template>
182
+
183
+ <script setup lang="ts">
184
+ import { computed } from 'vue'
185
+ import { mdiFolderPound } from '@quasar/extras/mdi-v7'
186
+ import siteConfig from '../../siteConfig'
187
+
188
+ import DarkModeToggle from '../components/DarkModeToggle.vue'
189
+
190
+ // import MarkdownSearch from './MarkdownSearch.vue'
191
+ import MarkdownHeaderTextLinks from './MarkdownHeaderTextLinks.vue'
192
+ import MarkdownHeaderIconLinks from './MarkdownHeaderIconLinks.vue'
193
+
194
+ import { useRoute } from 'vue-router'
195
+ import { useMarkdownStore } from '../stores/markdown'
196
+ import { useDark } from '../composables/dark'
197
+
198
+ const markdownStore = useMarkdownStore()
199
+ const route = useRoute()
200
+ const { isDark } = useDark()
201
+
202
+ const logo = computed(() => {
203
+ if (isDark.value === true)
204
+ return {
205
+ img: siteConfig.logoConfig.logoDark,
206
+ alt: siteConfig.logoConfig.logoAlt,
207
+ }
208
+ return {
209
+ img: siteConfig.logoConfig.logoLight,
210
+ alt: siteConfig.logoConfig.logoAlt,
211
+ }
212
+ })
213
+
214
+ const showThemeChanger = computed(() => route.meta.dark !== true)
215
+ const hasToc = computed(
216
+ () =>
217
+ route.meta.fullwidth !== true &&
218
+ route.meta.fullscreen !== true &&
219
+ siteConfig.config.useToc &&
220
+ markdownStore.toc.length !== 0,
221
+ )
222
+ const hasMoreLinks = computed(() => siteConfig.links.moreLinks.length > 0)
223
+ </script>
224
+
225
+ <style lang="scss">
226
+ .markdown-header {
227
+ transition: none;
228
+
229
+ &__primary {
230
+ height: 72px;
231
+ border-bottom: 1px solid $separator-color;
232
+ }
233
+
234
+ &__secondary {
235
+ height: 55px;
236
+ }
237
+
238
+ &__logo-img {
239
+ border-radius: 50%;
240
+ }
241
+
242
+ &__logo {
243
+ padding-right: 24px;
244
+ }
245
+
246
+ &__version {
247
+ color: #000;
248
+ border: 1px solid $brand-primary;
249
+ transition: none;
250
+
251
+ .q-focus-helper {
252
+ color: $brand-primary;
253
+ }
254
+ }
255
+
256
+ &__leftmost {
257
+ margin-left: -8px;
258
+ }
259
+
260
+ /**
261
+ Spacers are used to align the links dead center
262
+ */
263
+ &__primary-left-spacer {
264
+ width: 198px;
265
+ }
266
+ &__secondary-left-spacer {
267
+ width: 296px;
268
+ }
269
+
270
+ @media (max-width: 320px) {
271
+ .q-btn {
272
+ font-size: 12px;
273
+ }
274
+ .q-btn--rectangle {
275
+ padding: 8px 2px 8px 10px !important;
276
+ }
277
+ }
278
+
279
+ @media (max-width: 1059px) {
280
+ &__logo-text {
281
+ display: none;
282
+ }
283
+ }
284
+
285
+ @media (max-width: 699px) {
286
+ .q-toolbar {
287
+ padding-left: 16px;
288
+ padding-right: 8px;
289
+ }
290
+ &__logo {
291
+ padding-right: 16px;
292
+ }
293
+ .markdown-search {
294
+ width: 100%;
295
+ }
296
+ }
297
+
298
+ @media (min-width: 700px) {
299
+ .markdown-search {
300
+ margin-left: 8px;
301
+
302
+ .markdown-search__logo {
303
+ display: none;
304
+ }
305
+ }
306
+ }
307
+
308
+ &__links {
309
+ justify-content: end;
310
+
311
+ @media (min-width: 1921px) {
312
+ justify-content: center;
313
+ }
314
+ }
315
+ }
316
+
317
+ .markdown-header-menu {
318
+ letter-spacing: $letter-spacing-brand;
319
+ border: 1px solid $separator-color;
320
+ font-size: ($font-size - 2px);
321
+ box-shadow: none !important;
322
+ background-color: #fff;
323
+
324
+ .q-item.q-router-link--active,
325
+ .q-item--active {
326
+ color: $brand-primary;
327
+ }
328
+
329
+ .q-item {
330
+ height: 36px;
331
+ }
332
+
333
+ .q-item__label--header {
334
+ color: $brand-accent;
335
+ padding: 16px;
336
+
337
+ &:first-child {
338
+ padding-top: 8px;
339
+ }
340
+ }
341
+
342
+ .q-item__section--side .q-icon {
343
+ color: $brand-primary;
344
+ }
345
+
346
+ &__arrow {
347
+ margin-right: -8px;
348
+ }
349
+ }
350
+
351
+ .markdown-header-text-links__item {
352
+ .q-icon {
353
+ margin-left: 0;
354
+ }
355
+ }
356
+
357
+ body.body--dark {
358
+ .markdown-header__primary {
359
+ border-bottom-color: $separator-dark-color;
360
+ }
361
+
362
+ .markdown-header-menu {
363
+ background: $dark-bg;
364
+ border-color: $separator-dark-color;
365
+
366
+ .q-item.q-router-link--active,
367
+ .q-item--active {
368
+ color: $brand-primary;
369
+ }
370
+ }
371
+
372
+ .markdown-header {
373
+ &__version {
374
+ color: #fff;
375
+ }
376
+ }
377
+
378
+ .markdown-header-icon-links {
379
+ color: $brand-primary;
380
+ }
381
+ }
382
+
383
+ $mq-list:
384
+ 375,
385
+ 470,
386
+ 510,
387
+ 600,
388
+ 780,
389
+ 860,
390
+ 910,
391
+ 1000,
392
+ 1020,
393
+ 1100,
394
+ 1130,
395
+ 1190,
396
+ 1300 /* drawer */,
397
+ 1310,
398
+ 1400;
399
+ @each $query in $mq-list {
400
+ @media (min-width: #{$query}px) {
401
+ .lt-#{$query} {
402
+ display: none;
403
+ }
404
+ }
405
+
406
+ @media (max-width: #{$query - 1}px) {
407
+ .gt-#{$query} {
408
+ display: none;
409
+ }
410
+ }
411
+ }
412
+ </style>
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <div class="markdown-header-icon-links row no-wrap items-center">
3
+ <q-btn
4
+ v-for="(entry, index) in props.menu"
5
+ :key="index"
6
+ class="header-btn"
7
+ flat
8
+ round
9
+ :icon="entry.icon"
10
+ :to="entry.path"
11
+ :href="entry.external ? entry.path : void 0"
12
+ :target="entry.external ? '_blank' : void 0"
13
+ :aria-label="entry.name"
14
+ />
15
+ </div>
16
+ </template>
17
+
18
+ <script setup lang="ts">
19
+ interface MenuEntry {
20
+ icon: string
21
+ path: string
22
+ external?: boolean
23
+ name: string
24
+ }
25
+
26
+ const props = defineProps<{
27
+ menu: MenuEntry[]
28
+ }>()
29
+
30
+ console.log('props.menu:', props.menu)
31
+ </script>
@@ -0,0 +1,93 @@
1
+ import { QMenu, QIcon, QList, QItem, QItemSection, QItemLabel, QSeparator, Screen } from 'quasar'
2
+ import { h } from 'vue'
3
+ import { mdiMenuRight } from '@quasar/extras/mdi-v7'
4
+
5
+ interface MenuElement {
6
+ header?: string
7
+ separator?: boolean
8
+ path?: string
9
+ external?: boolean
10
+ icon?: string
11
+ name?: string
12
+ mq?: string
13
+ children?: MenuElement[]
14
+ }
15
+
16
+ interface Props {
17
+ elements: MenuElement[]
18
+ mqPrefix: string
19
+ }
20
+
21
+ const offset = [0, 4]
22
+
23
+ export default {
24
+ props: {
25
+ elements: Array,
26
+ mqPrefix: String,
27
+ },
28
+
29
+ setup(props: Props) {
30
+ function getChildren(list: MenuElement[]) {
31
+ return h(QList, { dense: true, padding: true }, () =>
32
+ list.map((entry) => {
33
+ if (entry.header !== void 0) {
34
+ return h(QItemLabel, { header: true }, () => entry.header)
35
+ }
36
+ if (entry.separator === true) {
37
+ return h(QSeparator, { spaced: true })
38
+ }
39
+ if (!entry.name) {
40
+ return null
41
+ }
42
+
43
+ return h(
44
+ QItem,
45
+ {
46
+ class: `${props.mqPrefix}-${entry.mq || 'none'}`,
47
+ clickable: true,
48
+ to: entry.path,
49
+ href: entry.external ? entry.path : void 0,
50
+ target: entry.external ? '_blank' : void 0,
51
+ },
52
+ () => {
53
+ const acc: any[] = []
54
+
55
+ if (entry.icon !== void 0) {
56
+ acc.push(h(QItemSection, { side: true }, () => h(QIcon, { name: entry.icon })))
57
+ }
58
+
59
+ acc.push(h(QItemSection, { class: 'text-no-wrap' }, () => entry.name))
60
+
61
+ if (entry.children !== void 0) {
62
+ acc.push(
63
+ h(QItemSection, { side: true, class: 'markdown-header-menu__arrow' }, () =>
64
+ h(QIcon, { name: mdiMenuRight }),
65
+ ),
66
+ h(
67
+ QMenu,
68
+ {
69
+ anchor: 'top right',
70
+ self: 'top left',
71
+ class: 'markdown-header-menu markdown-technical',
72
+ cover: Screen.lt.sm,
73
+ },
74
+ () => getChildren(entry.children!),
75
+ ),
76
+ )
77
+ }
78
+
79
+ return acc
80
+ },
81
+ )
82
+ }),
83
+ )
84
+ }
85
+
86
+ function getMenu() {
87
+ return getChildren(props.elements)
88
+ }
89
+
90
+ return () =>
91
+ h(QMenu, { fit: true, class: 'markdown-header-menu markdown-technical', offset }, getMenu)
92
+ },
93
+ }
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <div class="row no-wrap items-center">
3
+ <q-btn
4
+ v-for="(entry, index) in props.menu"
5
+ :key="index"
6
+ flat
7
+ class="header-btn markdown-header-text-links__item text-weight-bold"
8
+ :class="`${props.mqPrefix}-${entry.mq || 'none'} ${props.navClass}`"
9
+ :padding="entry.children ? '8px 8px 8px 16px' : '8px 12px'"
10
+ :label="entry.name"
11
+ no-caps
12
+ no-wrap
13
+ :icon-right="entry.children ? mdiMenuDown : void 0"
14
+ :to="entry.path"
15
+ :href="entry.external ? entry.path : void 0"
16
+ :target="entry.external ? '_blank' : void 0"
17
+ >
18
+ <MarkdownHeaderMenu
19
+ v-if="entry.children"
20
+ :elements="entry.children"
21
+ :mq-prefix="props.mqPrefix"
22
+ />
23
+ </q-btn>
24
+ </div>
25
+ </template>
26
+
27
+ <script setup lang="ts">
28
+ import { mdiMenuDown } from '@quasar/extras/mdi-v7'
29
+ import MarkdownHeaderMenu from './MarkdownHeaderMenu'
30
+ import type { SiteMenuItem } from '../../siteConfig'
31
+
32
+ const props = defineProps({
33
+ menu: Array<SiteMenuItem>,
34
+ mqPrefix: String,
35
+ navClass: String,
36
+ })
37
+ </script>