@md-plugins/quasar-app-extension-q-press 0.1.0-beta.6 → 0.1.0-beta.7
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 +2 -4
- package/dist/index.js +17 -0
- package/dist/q-press-globals.d.ts +49 -0
- package/dist/templates/init/src/_q-press/layouts/MarkdownPage.vue +1 -2
- package/dist/templates/init/src/_q-press/stores/markdown.ts +1 -2
- package/dist/templates/init/src/markdown/guides/upgrade-guide.md +2 -8
- package/dist/templates/init/src/markdown/quasar-app-extensions/qpress/overview.md +1 -3
- package/dist/templates/update/src/_q-press/layouts/MarkdownPage.vue +1 -2
- package/dist/templates/update/src/_q-press/stores/markdown.ts +1 -2
- package/package.json +15 -14
- package/src/index.ts +33 -0
- package/src/q-press-globals.d.ts +49 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownPage.vue +1 -2
- package/src/templates/init/src/_q-press/stores/markdown.ts +1 -2
- package/src/templates/init/src/markdown/guides/upgrade-guide.md +2 -8
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/overview.md +1 -3
- package/src/templates/update/src/_q-press/layouts/MarkdownPage.vue +1 -2
- package/src/templates/update/src/_q-press/stores/markdown.ts +1 -2
- package/dist/templates/init/src/q-press.globals.d.ts +0 -56
- package/dist/templates/update/src/q-press.globals.d.ts +0 -56
- package/src/templates/init/src/q-press.globals.d.ts +0 -56
- package/src/templates/update/src/q-press.globals.d.ts +0 -56
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ The Ultimate Markdown Solution for the Quasar Framework.
|
|
|
4
4
|
|
|
5
5
|
See the [documentation](https://md-plugins.netlify.app/quasar-app-extensions/qpress/overview) for more information.
|
|
6
6
|
|
|
7
|
-
> Current beta release: `0.1.0-beta.
|
|
7
|
+
> Current beta release: `0.1.0-beta.7`.
|
|
8
8
|
>
|
|
9
9
|
> Q-Press currently targets Quasar Vite projects using `@quasar/app-vite` `>=3.0.0-beta.26`. TypeScript processing is required.
|
|
10
10
|
|
|
@@ -26,14 +26,12 @@ See the [documentation](https://md-plugins.netlify.app/quasar-app-extensions/qpr
|
|
|
26
26
|
- `quasar ext add @md-plugins/q-press`
|
|
27
27
|
- Here is what gets installed on a **new** install:
|
|
28
28
|
- `src/.q-press`
|
|
29
|
-
- `src/q-press.globals.d.ts`
|
|
30
29
|
- `src/components`
|
|
31
30
|
- `src/markdown`
|
|
32
31
|
- `src/examples`
|
|
33
32
|
- `src/siteConfig`
|
|
34
33
|
- Here is what gets installed on an **update** install:
|
|
35
34
|
- `src/.q-press`
|
|
36
|
-
- `src/q-press.globals.d.ts`
|
|
37
35
|
|
|
38
36
|
2. Install `markdown-it` and `@types/markdown-it` in your project devDependencies
|
|
39
37
|
|
|
@@ -220,7 +218,7 @@ If you don't have a `.prettierignore` file, create one and add the following:
|
|
|
220
218
|
|
|
221
219
|
## Updating
|
|
222
220
|
|
|
223
|
-
When you update, only the `src/.q-press` folder will be updated
|
|
221
|
+
When you update, only the `src/.q-press` folder will be updated. If you want to re-install everything, just remove the `src/siteConfig` folder.
|
|
224
222
|
|
|
225
223
|
To make it easier to update, you can use the following command:
|
|
226
224
|
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* Docs: https://quasar.dev/app-extensions/development-guide/index-api
|
|
6
6
|
*/
|
|
7
7
|
import { defineIndexScript } from '@quasar/app-vite';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
const qPressGlobalsTsConfigPath = fileURLToPath(new URL('./q-press-globals.d.ts', import.meta.url)).replace(/\\/g, '/');
|
|
8
10
|
function normalizeAlias(alias) {
|
|
9
11
|
if (Array.isArray(alias)) {
|
|
10
12
|
return [...alias];
|
|
@@ -25,6 +27,19 @@ function addQuasarSourceAlias(viteConf, appDir) {
|
|
|
25
27
|
},
|
|
26
28
|
];
|
|
27
29
|
}
|
|
30
|
+
function addQPressGlobalsToTsConfig(tsConfig) {
|
|
31
|
+
tsConfig.files ??= [];
|
|
32
|
+
if (!tsConfig.files.includes(qPressGlobalsTsConfigPath)) {
|
|
33
|
+
tsConfig.files.push(qPressGlobalsTsConfigPath);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function extendTypeScriptConfig(typescriptConfig) {
|
|
37
|
+
const userExtendTsConfig = typescriptConfig.extendTsConfig;
|
|
38
|
+
typescriptConfig.extendTsConfig = (tsConfig) => {
|
|
39
|
+
userExtendTsConfig?.(tsConfig);
|
|
40
|
+
addQPressGlobalsToTsConfig(tsConfig);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
28
43
|
export default defineIndexScript((api) => {
|
|
29
44
|
// verify this is a Vite project
|
|
30
45
|
if (!api.hasVite) {
|
|
@@ -35,8 +50,10 @@ export default defineIndexScript((api) => {
|
|
|
35
50
|
// here we extend /quasar.config, so we can add some Vite/Vue stuff
|
|
36
51
|
api.extendQuasarConf(async (config) => {
|
|
37
52
|
config.build ??= {};
|
|
53
|
+
config.build.typescript ??= {};
|
|
38
54
|
config.build.viteVuePluginOptions ??= {};
|
|
39
55
|
config.framework ??= {};
|
|
56
|
+
extendTypeScriptConfig(config.build.typescript);
|
|
40
57
|
// make sure 'vueRouterMode' has 'history' mode
|
|
41
58
|
if (config.build.vueRouterMode !== 'history') {
|
|
42
59
|
console.warn('Changing vueRouterMode to "history" - required for hash links to work correctly');
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/// <reference types="@quasar/app-vite/client" />
|
|
2
|
+
|
|
3
|
+
declare module '*.md'
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
interface ImportMetaHot {
|
|
7
|
+
accept(callback?: (..._args: unknown[]) => unknown): void
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface ImportMeta {
|
|
11
|
+
readonly env: ImportMetaEnv
|
|
12
|
+
glob: <T = unknown>(pattern: string) => Record<string, () => Promise<T>>
|
|
13
|
+
hot?: ImportMetaHot
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface TocMenuItem {
|
|
17
|
+
id: string
|
|
18
|
+
level: number
|
|
19
|
+
title: string
|
|
20
|
+
link?: string
|
|
21
|
+
deep?: boolean
|
|
22
|
+
sub?: boolean
|
|
23
|
+
onClick?: () => void
|
|
24
|
+
children?: TocMenuItem[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface MarkdownModule {
|
|
28
|
+
title?: string
|
|
29
|
+
headers?: TocMenuItem[]
|
|
30
|
+
frontmatter?: Record<string, unknown>
|
|
31
|
+
filename?: string
|
|
32
|
+
render: (..._args: unknown[]) => unknown
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface MenuItem {
|
|
36
|
+
name: string
|
|
37
|
+
path?: string
|
|
38
|
+
icon?: string
|
|
39
|
+
iconColor?: string
|
|
40
|
+
rightIcon?: string
|
|
41
|
+
rightIconColor?: string
|
|
42
|
+
badge?: string
|
|
43
|
+
children?: MenuItem[] | undefined
|
|
44
|
+
external?: boolean
|
|
45
|
+
expanded?: boolean
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export {}
|
|
@@ -94,7 +94,6 @@ import { useRoute } from 'vue-router'
|
|
|
94
94
|
import { mdiPencil, mdiFlash, mdiLaunch } from '@quasar/extras/mdi-v7'
|
|
95
95
|
|
|
96
96
|
import type { NavItem, RelatedItem } from '@md-plugins/vite-md-plugin'
|
|
97
|
-
import type { TocItem } from '@md-plugins/md-plugin-headers'
|
|
98
97
|
import MarkdownLink from '../components/MarkdownLink.vue'
|
|
99
98
|
import MarkdownPageToc from './MarkdownPageToc.vue'
|
|
100
99
|
|
|
@@ -129,7 +128,7 @@ const props = defineProps({
|
|
|
129
128
|
},
|
|
130
129
|
|
|
131
130
|
toc: {
|
|
132
|
-
type: Array<
|
|
131
|
+
type: Array<TocMenuItem>,
|
|
133
132
|
default: () => [],
|
|
134
133
|
},
|
|
135
134
|
related: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineStore, acceptHMRUpdate } from 'pinia'
|
|
2
2
|
import { useRoute } from 'vue-router'
|
|
3
3
|
import { useScroll } from '../composables/scroll'
|
|
4
|
-
import type { TocItem } from '@md-plugins/md-plugin-headers'
|
|
5
4
|
|
|
6
5
|
export const useMarkdownStore = defineStore('markdown-store', {
|
|
7
6
|
state: () => ({
|
|
@@ -60,7 +59,7 @@ export const useMarkdownStore = defineStore('markdown-store', {
|
|
|
60
59
|
}
|
|
61
60
|
},
|
|
62
61
|
|
|
63
|
-
setToc(toc:
|
|
62
|
+
setToc(toc: TocMenuItem[]) {
|
|
64
63
|
const { scrollTo } = useScroll()
|
|
65
64
|
this.toc =
|
|
66
65
|
toc !== void 0
|
|
@@ -39,15 +39,9 @@ For direct Vite plugin usage, update the packages you consume:
|
|
|
39
39
|
pnpm up @md-plugins/vite-md-plugin@beta @md-plugins/vite-examples-plugin@beta
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Q-Press Type Globals
|
|
43
43
|
|
|
44
|
-
Q-Press
|
|
45
|
-
|
|
46
|
-
```text
|
|
47
|
-
src/q-press.globals.d.ts
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
If your project still references `src/q-press.global.d.ts`, rename the reference to the plural `globals` filename.
|
|
44
|
+
Q-Press now provides its shared Markdown, menu and `ImportMeta` globals directly from the app extension package. After upgrading to this release line and running `quasar prepare`, projects no longer need to keep a local `src/q-press.globals.d.ts` file.
|
|
51
45
|
|
|
52
46
|
## Environment Variable Changes
|
|
53
47
|
|
|
@@ -33,14 +33,12 @@ quasar ext add @md-plugins/q-press
|
|
|
33
33
|
|
|
34
34
|
- **New Install:**
|
|
35
35
|
- `src/.q-press`
|
|
36
|
-
- `src/q-press.globals.d.ts`
|
|
37
36
|
- `src/components`
|
|
38
37
|
- `src/markdown`
|
|
39
38
|
- `src/examples`
|
|
40
39
|
- `src/siteConfig`
|
|
41
40
|
- **Update Install:**
|
|
42
41
|
- `src/.q-press`
|
|
43
|
-
- `src/q-press.globals.d.ts`
|
|
44
42
|
|
|
45
43
|
### Additional Dependencies
|
|
46
44
|
|
|
@@ -311,7 +309,7 @@ If you don't have a `.prettierignore` file, create one in the root of your proje
|
|
|
311
309
|
|
|
312
310
|
## Updating
|
|
313
311
|
|
|
314
|
-
When you update, only the `src/.q-press` folder will be updated
|
|
312
|
+
When you update, only the `src/.q-press` folder will be updated. If you want to re-install everything, just remove the `src/siteConfig` folder.
|
|
315
313
|
|
|
316
314
|
To make it easier to update, you can use the following command:
|
|
317
315
|
|
|
@@ -94,7 +94,6 @@ import { useRoute } from 'vue-router'
|
|
|
94
94
|
import { mdiPencil, mdiFlash, mdiLaunch } from '@quasar/extras/mdi-v7'
|
|
95
95
|
|
|
96
96
|
import type { NavItem, RelatedItem } from '@md-plugins/vite-md-plugin'
|
|
97
|
-
import type { TocItem } from '@md-plugins/md-plugin-headers'
|
|
98
97
|
import MarkdownLink from '../components/MarkdownLink.vue'
|
|
99
98
|
import MarkdownPageToc from './MarkdownPageToc.vue'
|
|
100
99
|
|
|
@@ -129,7 +128,7 @@ const props = defineProps({
|
|
|
129
128
|
},
|
|
130
129
|
|
|
131
130
|
toc: {
|
|
132
|
-
type: Array<
|
|
131
|
+
type: Array<TocMenuItem>,
|
|
133
132
|
default: () => [],
|
|
134
133
|
},
|
|
135
134
|
related: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineStore, acceptHMRUpdate } from 'pinia'
|
|
2
2
|
import { useRoute } from 'vue-router'
|
|
3
3
|
import { useScroll } from '../composables/scroll'
|
|
4
|
-
import type { TocItem } from '@md-plugins/md-plugin-headers'
|
|
5
4
|
|
|
6
5
|
export const useMarkdownStore = defineStore('markdown-store', {
|
|
7
6
|
state: () => ({
|
|
@@ -60,7 +59,7 @@ export const useMarkdownStore = defineStore('markdown-store', {
|
|
|
60
59
|
}
|
|
61
60
|
},
|
|
62
61
|
|
|
63
|
-
setToc(toc:
|
|
62
|
+
setToc(toc: TocMenuItem[]) {
|
|
64
63
|
const { scrollTo } = useScroll()
|
|
65
64
|
this.toc =
|
|
66
65
|
toc !== void 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@md-plugins/quasar-app-extension-q-press",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.7",
|
|
4
4
|
"description": "QPress - The Ultimate Markdown Solution for Quasar Framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"main": "dist/index.js",
|
|
25
|
+
"types": "dist/q-press-globals.d.ts",
|
|
25
26
|
"publishConfig": {
|
|
26
27
|
"access": "public"
|
|
27
28
|
},
|
|
@@ -29,19 +30,19 @@
|
|
|
29
30
|
"@types/markdown-it": "^14.1.2",
|
|
30
31
|
"fs-extra": "^11.3.5",
|
|
31
32
|
"markdown-it": "^14.1.1",
|
|
32
|
-
"@md-plugins/md-plugin-
|
|
33
|
-
"@md-plugins/md-plugin-
|
|
34
|
-
"@md-plugins/md-plugin-
|
|
35
|
-
"@md-plugins/md-plugin-
|
|
36
|
-
"@md-plugins/md-plugin-
|
|
37
|
-
"@md-plugins/md-plugin-
|
|
38
|
-
"@md-plugins/md-plugin-
|
|
39
|
-
"@md-plugins/md-plugin-
|
|
40
|
-
"@md-plugins/md-plugin-
|
|
41
|
-
"@md-plugins/md-plugin-
|
|
42
|
-
"@md-plugins/md-plugin-
|
|
43
|
-
"@md-plugins/shared": "0.1.0-beta.
|
|
44
|
-
"@md-plugins/vite-md-plugin": "0.1.0-beta.
|
|
33
|
+
"@md-plugins/md-plugin-codeblocks": "0.1.0-beta.7",
|
|
34
|
+
"@md-plugins/md-plugin-containers": "0.1.0-beta.7",
|
|
35
|
+
"@md-plugins/md-plugin-blockquote": "0.1.0-beta.7",
|
|
36
|
+
"@md-plugins/md-plugin-image": "0.1.0-beta.7",
|
|
37
|
+
"@md-plugins/md-plugin-frontmatter": "0.1.0-beta.7",
|
|
38
|
+
"@md-plugins/md-plugin-headers": "0.1.0-beta.7",
|
|
39
|
+
"@md-plugins/md-plugin-imports": "0.1.0-beta.7",
|
|
40
|
+
"@md-plugins/md-plugin-inlinecode": "0.1.0-beta.7",
|
|
41
|
+
"@md-plugins/md-plugin-table": "0.1.0-beta.7",
|
|
42
|
+
"@md-plugins/md-plugin-link": "0.1.0-beta.7",
|
|
43
|
+
"@md-plugins/md-plugin-title": "0.1.0-beta.7",
|
|
44
|
+
"@md-plugins/shared": "0.1.0-beta.7",
|
|
45
|
+
"@md-plugins/vite-md-plugin": "0.1.0-beta.7"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@quasar/app-vite": "3.0.0-beta.26",
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { defineIndexScript } from '@quasar/app-vite'
|
|
9
|
+
import { fileURLToPath } from 'node:url'
|
|
9
10
|
|
|
10
11
|
// import fse from 'fs-extra'
|
|
11
12
|
// import { viteMdPlugin } from '@md-plugins/vite-md-plugin'
|
|
@@ -23,6 +24,18 @@ type ViteConfigWithAlias = {
|
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
type QuasarTsConfig = {
|
|
28
|
+
files?: string[]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type QuasarTypescriptConfig = {
|
|
32
|
+
extendTsConfig?: (tsConfig: QuasarTsConfig) => void
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const qPressGlobalsTsConfigPath = fileURLToPath(
|
|
36
|
+
new URL('./q-press-globals.d.ts', import.meta.url),
|
|
37
|
+
).replace(/\\/g, '/')
|
|
38
|
+
|
|
26
39
|
function normalizeAlias(alias: ViteAlias | undefined): ViteAliasEntry[] {
|
|
27
40
|
if (Array.isArray(alias)) {
|
|
28
41
|
return [...alias]
|
|
@@ -47,6 +60,23 @@ function addQuasarSourceAlias(viteConf: ViteConfigWithAlias, appDir: string): vo
|
|
|
47
60
|
]
|
|
48
61
|
}
|
|
49
62
|
|
|
63
|
+
function addQPressGlobalsToTsConfig(tsConfig: QuasarTsConfig): void {
|
|
64
|
+
tsConfig.files ??= []
|
|
65
|
+
|
|
66
|
+
if (!tsConfig.files.includes(qPressGlobalsTsConfigPath)) {
|
|
67
|
+
tsConfig.files.push(qPressGlobalsTsConfigPath)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function extendTypeScriptConfig(typescriptConfig: QuasarTypescriptConfig): void {
|
|
72
|
+
const userExtendTsConfig = typescriptConfig.extendTsConfig
|
|
73
|
+
|
|
74
|
+
typescriptConfig.extendTsConfig = (tsConfig) => {
|
|
75
|
+
userExtendTsConfig?.(tsConfig)
|
|
76
|
+
addQPressGlobalsToTsConfig(tsConfig)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
50
80
|
export default defineIndexScript((api) => {
|
|
51
81
|
// verify this is a Vite project
|
|
52
82
|
if (!api.hasVite) {
|
|
@@ -59,9 +89,12 @@ export default defineIndexScript((api) => {
|
|
|
59
89
|
// here we extend /quasar.config, so we can add some Vite/Vue stuff
|
|
60
90
|
api.extendQuasarConf(async (config) => {
|
|
61
91
|
config.build ??= {}
|
|
92
|
+
config.build.typescript ??= {}
|
|
62
93
|
config.build.viteVuePluginOptions ??= {}
|
|
63
94
|
config.framework ??= {}
|
|
64
95
|
|
|
96
|
+
extendTypeScriptConfig(config.build.typescript)
|
|
97
|
+
|
|
65
98
|
// make sure 'vueRouterMode' has 'history' mode
|
|
66
99
|
if (config.build.vueRouterMode !== 'history') {
|
|
67
100
|
console.warn(
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/// <reference types="@quasar/app-vite/client" />
|
|
2
|
+
|
|
3
|
+
declare module '*.md'
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
interface ImportMetaHot {
|
|
7
|
+
accept(callback?: (..._args: unknown[]) => unknown): void
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface ImportMeta {
|
|
11
|
+
readonly env: ImportMetaEnv
|
|
12
|
+
glob: <T = unknown>(pattern: string) => Record<string, () => Promise<T>>
|
|
13
|
+
hot?: ImportMetaHot
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface TocMenuItem {
|
|
17
|
+
id: string
|
|
18
|
+
level: number
|
|
19
|
+
title: string
|
|
20
|
+
link?: string
|
|
21
|
+
deep?: boolean
|
|
22
|
+
sub?: boolean
|
|
23
|
+
onClick?: () => void
|
|
24
|
+
children?: TocMenuItem[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface MarkdownModule {
|
|
28
|
+
title?: string
|
|
29
|
+
headers?: TocMenuItem[]
|
|
30
|
+
frontmatter?: Record<string, unknown>
|
|
31
|
+
filename?: string
|
|
32
|
+
render: (..._args: unknown[]) => unknown
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface MenuItem {
|
|
36
|
+
name: string
|
|
37
|
+
path?: string
|
|
38
|
+
icon?: string
|
|
39
|
+
iconColor?: string
|
|
40
|
+
rightIcon?: string
|
|
41
|
+
rightIconColor?: string
|
|
42
|
+
badge?: string
|
|
43
|
+
children?: MenuItem[] | undefined
|
|
44
|
+
external?: boolean
|
|
45
|
+
expanded?: boolean
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export {}
|
|
@@ -94,7 +94,6 @@ import { useRoute } from 'vue-router'
|
|
|
94
94
|
import { mdiPencil, mdiFlash, mdiLaunch } from '@quasar/extras/mdi-v7'
|
|
95
95
|
|
|
96
96
|
import type { NavItem, RelatedItem } from '@md-plugins/vite-md-plugin'
|
|
97
|
-
import type { TocItem } from '@md-plugins/md-plugin-headers'
|
|
98
97
|
import MarkdownLink from '../components/MarkdownLink.vue'
|
|
99
98
|
import MarkdownPageToc from './MarkdownPageToc.vue'
|
|
100
99
|
|
|
@@ -129,7 +128,7 @@ const props = defineProps({
|
|
|
129
128
|
},
|
|
130
129
|
|
|
131
130
|
toc: {
|
|
132
|
-
type: Array<
|
|
131
|
+
type: Array<TocMenuItem>,
|
|
133
132
|
default: () => [],
|
|
134
133
|
},
|
|
135
134
|
related: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineStore, acceptHMRUpdate } from 'pinia'
|
|
2
2
|
import { useRoute } from 'vue-router'
|
|
3
3
|
import { useScroll } from '../composables/scroll'
|
|
4
|
-
import type { TocItem } from '@md-plugins/md-plugin-headers'
|
|
5
4
|
|
|
6
5
|
export const useMarkdownStore = defineStore('markdown-store', {
|
|
7
6
|
state: () => ({
|
|
@@ -60,7 +59,7 @@ export const useMarkdownStore = defineStore('markdown-store', {
|
|
|
60
59
|
}
|
|
61
60
|
},
|
|
62
61
|
|
|
63
|
-
setToc(toc:
|
|
62
|
+
setToc(toc: TocMenuItem[]) {
|
|
64
63
|
const { scrollTo } = useScroll()
|
|
65
64
|
this.toc =
|
|
66
65
|
toc !== void 0
|
|
@@ -39,15 +39,9 @@ For direct Vite plugin usage, update the packages you consume:
|
|
|
39
39
|
pnpm up @md-plugins/vite-md-plugin@beta @md-plugins/vite-examples-plugin@beta
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Q-Press Type Globals
|
|
43
43
|
|
|
44
|
-
Q-Press
|
|
45
|
-
|
|
46
|
-
```text
|
|
47
|
-
src/q-press.globals.d.ts
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
If your project still references `src/q-press.global.d.ts`, rename the reference to the plural `globals` filename.
|
|
44
|
+
Q-Press now provides its shared Markdown, menu and `ImportMeta` globals directly from the app extension package. After upgrading to this release line and running `quasar prepare`, projects no longer need to keep a local `src/q-press.globals.d.ts` file.
|
|
51
45
|
|
|
52
46
|
## Environment Variable Changes
|
|
53
47
|
|
|
@@ -33,14 +33,12 @@ quasar ext add @md-plugins/q-press
|
|
|
33
33
|
|
|
34
34
|
- **New Install:**
|
|
35
35
|
- `src/.q-press`
|
|
36
|
-
- `src/q-press.globals.d.ts`
|
|
37
36
|
- `src/components`
|
|
38
37
|
- `src/markdown`
|
|
39
38
|
- `src/examples`
|
|
40
39
|
- `src/siteConfig`
|
|
41
40
|
- **Update Install:**
|
|
42
41
|
- `src/.q-press`
|
|
43
|
-
- `src/q-press.globals.d.ts`
|
|
44
42
|
|
|
45
43
|
### Additional Dependencies
|
|
46
44
|
|
|
@@ -311,7 +309,7 @@ If you don't have a `.prettierignore` file, create one in the root of your proje
|
|
|
311
309
|
|
|
312
310
|
## Updating
|
|
313
311
|
|
|
314
|
-
When you update, only the `src/.q-press` folder will be updated
|
|
312
|
+
When you update, only the `src/.q-press` folder will be updated. If you want to re-install everything, just remove the `src/siteConfig` folder.
|
|
315
313
|
|
|
316
314
|
To make it easier to update, you can use the following command:
|
|
317
315
|
|
|
@@ -94,7 +94,6 @@ import { useRoute } from 'vue-router'
|
|
|
94
94
|
import { mdiPencil, mdiFlash, mdiLaunch } from '@quasar/extras/mdi-v7'
|
|
95
95
|
|
|
96
96
|
import type { NavItem, RelatedItem } from '@md-plugins/vite-md-plugin'
|
|
97
|
-
import type { TocItem } from '@md-plugins/md-plugin-headers'
|
|
98
97
|
import MarkdownLink from '../components/MarkdownLink.vue'
|
|
99
98
|
import MarkdownPageToc from './MarkdownPageToc.vue'
|
|
100
99
|
|
|
@@ -129,7 +128,7 @@ const props = defineProps({
|
|
|
129
128
|
},
|
|
130
129
|
|
|
131
130
|
toc: {
|
|
132
|
-
type: Array<
|
|
131
|
+
type: Array<TocMenuItem>,
|
|
133
132
|
default: () => [],
|
|
134
133
|
},
|
|
135
134
|
related: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineStore, acceptHMRUpdate } from 'pinia'
|
|
2
2
|
import { useRoute } from 'vue-router'
|
|
3
3
|
import { useScroll } from '../composables/scroll'
|
|
4
|
-
import type { TocItem } from '@md-plugins/md-plugin-headers'
|
|
5
4
|
|
|
6
5
|
export const useMarkdownStore = defineStore('markdown-store', {
|
|
7
6
|
state: () => ({
|
|
@@ -60,7 +59,7 @@ export const useMarkdownStore = defineStore('markdown-store', {
|
|
|
60
59
|
}
|
|
61
60
|
},
|
|
62
61
|
|
|
63
|
-
setToc(toc:
|
|
62
|
+
setToc(toc: TocMenuItem[]) {
|
|
64
63
|
const { scrollTo } = useScroll()
|
|
65
64
|
this.toc =
|
|
66
65
|
toc !== void 0
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/// <reference types="@quasar/app-vite/client" />
|
|
2
|
-
|
|
3
|
-
declare module '*.md'
|
|
4
|
-
|
|
5
|
-
declare module '@md-plugins/md-plugin-headers' {
|
|
6
|
-
export interface TocItem {
|
|
7
|
-
id: string
|
|
8
|
-
level: number
|
|
9
|
-
title: string
|
|
10
|
-
[key: string]: unknown
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface ImportMetaHot {
|
|
15
|
-
accept(callback?: (..._args: unknown[]) => unknown): void
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface ImportMeta {
|
|
19
|
-
readonly env: ImportMetaEnv
|
|
20
|
-
glob: <T = unknown>(pattern: string) => Record<string, () => Promise<T>>
|
|
21
|
-
hot?: ImportMetaHot
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface TocMenuItem {
|
|
25
|
-
id: string
|
|
26
|
-
level: number
|
|
27
|
-
title: string
|
|
28
|
-
link?: string
|
|
29
|
-
deep?: boolean
|
|
30
|
-
sub?: boolean
|
|
31
|
-
onClick?: () => void
|
|
32
|
-
children?: TocMenuItem[]
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Define types for Markdown modules
|
|
36
|
-
interface MarkdownModule {
|
|
37
|
-
title?: string
|
|
38
|
-
headers?: TocMenuItem[]
|
|
39
|
-
frontmatter?: Record<string, unknown>
|
|
40
|
-
filename?: string
|
|
41
|
-
render: (..._args: unknown[]) => unknown
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Define types for menu items
|
|
45
|
-
interface MenuItem {
|
|
46
|
-
name: string
|
|
47
|
-
path?: string
|
|
48
|
-
icon?: string
|
|
49
|
-
iconColor?: string
|
|
50
|
-
rightIcon?: string
|
|
51
|
-
rightIconColor?: string
|
|
52
|
-
badge?: string
|
|
53
|
-
children?: MenuItem[] | undefined
|
|
54
|
-
external?: boolean
|
|
55
|
-
expanded?: boolean
|
|
56
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/// <reference types="@quasar/app-vite/client" />
|
|
2
|
-
|
|
3
|
-
declare module '*.md'
|
|
4
|
-
|
|
5
|
-
declare module '@md-plugins/md-plugin-headers' {
|
|
6
|
-
export interface TocItem {
|
|
7
|
-
id: string
|
|
8
|
-
level: number
|
|
9
|
-
title: string
|
|
10
|
-
[key: string]: unknown
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface ImportMetaHot {
|
|
15
|
-
accept(callback?: (..._args: unknown[]) => unknown): void
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface ImportMeta {
|
|
19
|
-
readonly env: ImportMetaEnv
|
|
20
|
-
glob: <T = unknown>(pattern: string) => Record<string, () => Promise<T>>
|
|
21
|
-
hot?: ImportMetaHot
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface TocMenuItem {
|
|
25
|
-
id: string
|
|
26
|
-
level: number
|
|
27
|
-
title: string
|
|
28
|
-
link?: string
|
|
29
|
-
deep?: boolean
|
|
30
|
-
sub?: boolean
|
|
31
|
-
onClick?: () => void
|
|
32
|
-
children?: TocMenuItem[]
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Define types for Markdown modules
|
|
36
|
-
interface MarkdownModule {
|
|
37
|
-
title?: string
|
|
38
|
-
headers?: TocMenuItem[]
|
|
39
|
-
frontmatter?: Record<string, unknown>
|
|
40
|
-
filename?: string
|
|
41
|
-
render: (..._args: unknown[]) => unknown
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Define types for menu items
|
|
45
|
-
interface MenuItem {
|
|
46
|
-
name: string
|
|
47
|
-
path?: string
|
|
48
|
-
icon?: string
|
|
49
|
-
iconColor?: string
|
|
50
|
-
rightIcon?: string
|
|
51
|
-
rightIconColor?: string
|
|
52
|
-
badge?: string
|
|
53
|
-
children?: MenuItem[] | undefined
|
|
54
|
-
external?: boolean
|
|
55
|
-
expanded?: boolean
|
|
56
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/// <reference types="@quasar/app-vite/client" />
|
|
2
|
-
|
|
3
|
-
declare module '*.md'
|
|
4
|
-
|
|
5
|
-
declare module '@md-plugins/md-plugin-headers' {
|
|
6
|
-
export interface TocItem {
|
|
7
|
-
id: string
|
|
8
|
-
level: number
|
|
9
|
-
title: string
|
|
10
|
-
[key: string]: unknown
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface ImportMetaHot {
|
|
15
|
-
accept(callback?: (..._args: unknown[]) => unknown): void
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface ImportMeta {
|
|
19
|
-
readonly env: ImportMetaEnv
|
|
20
|
-
glob: <T = unknown>(pattern: string) => Record<string, () => Promise<T>>
|
|
21
|
-
hot?: ImportMetaHot
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface TocMenuItem {
|
|
25
|
-
id: string
|
|
26
|
-
level: number
|
|
27
|
-
title: string
|
|
28
|
-
link?: string
|
|
29
|
-
deep?: boolean
|
|
30
|
-
sub?: boolean
|
|
31
|
-
onClick?: () => void
|
|
32
|
-
children?: TocMenuItem[]
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Define types for Markdown modules
|
|
36
|
-
interface MarkdownModule {
|
|
37
|
-
title?: string
|
|
38
|
-
headers?: TocMenuItem[]
|
|
39
|
-
frontmatter?: Record<string, unknown>
|
|
40
|
-
filename?: string
|
|
41
|
-
render: (..._args: unknown[]) => unknown
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Define types for menu items
|
|
45
|
-
interface MenuItem {
|
|
46
|
-
name: string
|
|
47
|
-
path?: string
|
|
48
|
-
icon?: string
|
|
49
|
-
iconColor?: string
|
|
50
|
-
rightIcon?: string
|
|
51
|
-
rightIconColor?: string
|
|
52
|
-
badge?: string
|
|
53
|
-
children?: MenuItem[] | undefined
|
|
54
|
-
external?: boolean
|
|
55
|
-
expanded?: boolean
|
|
56
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/// <reference types="@quasar/app-vite/client" />
|
|
2
|
-
|
|
3
|
-
declare module '*.md'
|
|
4
|
-
|
|
5
|
-
declare module '@md-plugins/md-plugin-headers' {
|
|
6
|
-
export interface TocItem {
|
|
7
|
-
id: string
|
|
8
|
-
level: number
|
|
9
|
-
title: string
|
|
10
|
-
[key: string]: unknown
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface ImportMetaHot {
|
|
15
|
-
accept(callback?: (..._args: unknown[]) => unknown): void
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface ImportMeta {
|
|
19
|
-
readonly env: ImportMetaEnv
|
|
20
|
-
glob: <T = unknown>(pattern: string) => Record<string, () => Promise<T>>
|
|
21
|
-
hot?: ImportMetaHot
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface TocMenuItem {
|
|
25
|
-
id: string
|
|
26
|
-
level: number
|
|
27
|
-
title: string
|
|
28
|
-
link?: string
|
|
29
|
-
deep?: boolean
|
|
30
|
-
sub?: boolean
|
|
31
|
-
onClick?: () => void
|
|
32
|
-
children?: TocMenuItem[]
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Define types for Markdown modules
|
|
36
|
-
interface MarkdownModule {
|
|
37
|
-
title?: string
|
|
38
|
-
headers?: TocMenuItem[]
|
|
39
|
-
frontmatter?: Record<string, unknown>
|
|
40
|
-
filename?: string
|
|
41
|
-
render: (..._args: unknown[]) => unknown
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Define types for menu items
|
|
45
|
-
interface MenuItem {
|
|
46
|
-
name: string
|
|
47
|
-
path?: string
|
|
48
|
-
icon?: string
|
|
49
|
-
iconColor?: string
|
|
50
|
-
rightIcon?: string
|
|
51
|
-
rightIconColor?: string
|
|
52
|
-
badge?: string
|
|
53
|
-
children?: MenuItem[] | undefined
|
|
54
|
-
external?: boolean
|
|
55
|
-
expanded?: boolean
|
|
56
|
-
}
|