@md-plugins/quasar-app-extension-q-press 0.1.0-alpha.15 → 0.1.0-alpha.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@md-plugins/quasar-app-extension-q-press",
3
- "version": "0.1.0-alpha.15",
3
+ "version": "0.1.0-alpha.17",
4
4
  "description": "QPress - The Ultimate Markdown Solution for Quasar Framework",
5
5
  "author": "hawkeye64 <galbraith64@gmail.com>",
6
6
  "keywords": [
@@ -29,19 +29,19 @@
29
29
  "dependencies": {
30
30
  "@types/markdown-it": "^14.1.2",
31
31
  "markdown-it": "^14.1.0",
32
- "@md-plugins/md-plugin-containers": "0.1.0-alpha.15",
33
- "@md-plugins/md-plugin-blockquote": "0.1.0-alpha.15",
34
- "@md-plugins/md-plugin-frontmatter": "0.1.0-alpha.15",
35
- "@md-plugins/md-plugin-headers": "0.1.0-alpha.15",
36
- "@md-plugins/md-plugin-imports": "0.1.0-alpha.15",
37
- "@md-plugins/md-plugin-image": "0.1.0-alpha.15",
38
- "@md-plugins/md-plugin-inlinecode": "0.1.0-alpha.15",
39
- "@md-plugins/md-plugin-table": "0.1.0-alpha.15",
40
- "@md-plugins/md-plugin-link": "0.1.0-alpha.15",
41
- "@md-plugins/md-plugin-title": "0.1.0-alpha.15",
42
- "@md-plugins/shared": "0.1.0-alpha.15",
43
- "@md-plugins/md-plugin-codeblocks": "0.1.0-alpha.15",
44
- "@md-plugins/vite-md-plugin": "0.1.0-alpha.15"
32
+ "@md-plugins/md-plugin-blockquote": "0.1.0-alpha.17",
33
+ "@md-plugins/md-plugin-containers": "0.1.0-alpha.17",
34
+ "@md-plugins/md-plugin-codeblocks": "0.1.0-alpha.17",
35
+ "@md-plugins/md-plugin-image": "0.1.0-alpha.17",
36
+ "@md-plugins/md-plugin-frontmatter": "0.1.0-alpha.17",
37
+ "@md-plugins/md-plugin-headers": "0.1.0-alpha.17",
38
+ "@md-plugins/md-plugin-imports": "0.1.0-alpha.17",
39
+ "@md-plugins/md-plugin-inlinecode": "0.1.0-alpha.17",
40
+ "@md-plugins/md-plugin-link": "0.1.0-alpha.17",
41
+ "@md-plugins/md-plugin-table": "0.1.0-alpha.17",
42
+ "@md-plugins/md-plugin-title": "0.1.0-alpha.17",
43
+ "@md-plugins/shared": "0.1.0-alpha.17",
44
+ "@md-plugins/vite-md-plugin": "0.1.0-alpha.17"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/markdown-it": "^14.1.2",
@@ -110,6 +110,8 @@ import MarkdownCode from './MarkdownCode.vue'
110
110
  import MarkdownCodepen from './MarkdownCodepen.vue'
111
111
  import MarkdownCardTitle from './MarkdownCardTitle.vue'
112
112
 
113
+ import siteConfig from '../../siteConfig'
114
+
113
115
  const props = defineProps({
114
116
  title: String,
115
117
  file: String,
@@ -167,7 +169,7 @@ function parseComponent(comp) {
167
169
 
168
170
  function openGitHub() {
169
171
  openURL(
170
- `https://github.com/quasarframework/quasar/tree/${process.env.DOCS_BRANCH}/docs/src/examples/${examples.name}/${props.file}.vue`,
172
+ `${siteConfig.githubEditRootSrc}/examples/${examples.name}/${props.file}.vue`,
171
173
  )
172
174
  }
173
175
 
@@ -136,7 +136,7 @@ if (props.toc !== void 0) {
136
136
  markdownStore.setToc(props.toc)
137
137
  }
138
138
 
139
- const editHref = computed(() => `${siteConfig.githubEditRoot}${props.editLink}.md`)
139
+ const editHref = computed(() => `${siteConfig.githubEditRootSrc}/markdown/${props.editLink}.md`)
140
140
 
141
141
  const isFullscreen = computed(() => route.meta.fullscreen === true || props.fullscreen)
142
142
 
@@ -4,9 +4,3 @@ desc: The changelog for MD-Plugins packages.
4
4
  ---
5
5
 
6
6
  Release notes (with changelog) for MD-Plugins packages are available on [GitHub Releases](https://github.com/md-plugins/md-plugins/releases).
7
-
8
- <!-- <script import>
9
- import PublicReleases from 'components/Releases/PublicReleases.vue'
10
- </script>
11
-
12
- <PublicReleases /> -->
@@ -68,6 +68,16 @@ pnpm i prismjs
68
68
 
69
69
  ## Configuration
70
70
 
71
+ ### Modify `tsconfig.json`
72
+
73
+ Add the `resolveJsonModule: true` to your `tsconfig.json` file in your route folder:
74
+
75
+ ```json
76
+ "compilerOptions": {
77
+ "resolveJsonModule": true
78
+ }
79
+ ```
80
+
71
81
  ### Modify `src/css/quasar.variables.scss`
72
82
 
73
83
  Import a Q-Press theme (`default`, `sunrise`, `newspaper`, `tawny`, `mystic`, your own or a 3rd-party theme):
@@ -210,6 +220,16 @@ Update your `App.vue`:
210
220
 
211
221
  :::
212
222
 
223
+ :::details Q. I see linting issues regarding `any`, what should I do?
224
+
225
+ **A.** In your `eslint.config.js` file, add/replace the following in your rules:
226
+
227
+ ```js
228
+ '@typescript-eslint/no-explicit-any': 'off',
229
+ ```
230
+
231
+ :::
232
+
213
233
  :::details Q. Every time I save a markdown file, `prettier` changes it so that it breaks. How can I prevent this?
214
234
 
215
235
  **A.** This is both a `prettier` and `eslint` issue. In `eslint.config.js`, add the following to the top of the file, right after `export default [`:
@@ -77,7 +77,7 @@ export interface SiteConfig {
77
77
  theme: string
78
78
  version: string
79
79
  copyright: CopyrightConfig
80
- githubEditRoot: string
80
+ githubEditRootSrc: string // src folder for github edit links (appended with 'markdown' and 'examples')
81
81
  license: LicenseConfig
82
82
  privacy: PrivacyConfig
83
83
  logoConfig: LogoConfig
@@ -385,7 +385,7 @@ const config = {
385
385
  line1: `Copyright © 2024-${new Date().getFullYear()} MD-PLUGINS`,
386
386
  line2: '',
387
387
  } as CopyrightConfig,
388
- githubEditRoot: 'https://github.com/md-plugins/md-plugins/edit/dev/packages/docs/src/markdown/',
388
+ githubEditRootSrc: 'https://github.com/md-plugins/md-plugins/edit/dev/packages/docs/src/',
389
389
  license: {
390
390
  label: 'MIT License',
391
391
  link: 'https://github.com/md-plugins/md-plugins/blob/dev/LICENSE.md',
@@ -110,6 +110,8 @@ import MarkdownCode from './MarkdownCode.vue'
110
110
  import MarkdownCodepen from './MarkdownCodepen.vue'
111
111
  import MarkdownCardTitle from './MarkdownCardTitle.vue'
112
112
 
113
+ import siteConfig from '../../siteConfig'
114
+
113
115
  const props = defineProps({
114
116
  title: String,
115
117
  file: String,
@@ -167,7 +169,7 @@ function parseComponent(comp) {
167
169
 
168
170
  function openGitHub() {
169
171
  openURL(
170
- `https://github.com/quasarframework/quasar/tree/${process.env.DOCS_BRANCH}/docs/src/examples/${examples.name}/${props.file}.vue`,
172
+ `${siteConfig.githubEditRootSrc}/examples/${examples.name}/${props.file}.vue`,
171
173
  )
172
174
  }
173
175
 
@@ -136,7 +136,7 @@ if (props.toc !== void 0) {
136
136
  markdownStore.setToc(props.toc)
137
137
  }
138
138
 
139
- const editHref = computed(() => `${siteConfig.githubEditRoot}${props.editLink}.md`)
139
+ const editHref = computed(() => `${siteConfig.githubEditRootSrc}/markdown/${props.editLink}.md`)
140
140
 
141
141
  const isFullscreen = computed(() => route.meta.fullscreen === true || props.fullscreen)
142
142
 
@@ -1,164 +0,0 @@
1
- <template>
2
- <div>
3
- <q-input class="header-toolbar q-px-md" v-model="search" dense square borderless color="white" placeholder="Search..." clearable>
4
- <template #prepend>
5
- <q-icon :name="mdiMagnify" />
6
- </template>
7
- </q-input>
8
-
9
- <q-separator />
10
-
11
- <q-splitter class="release__splitter" :model-value="20" :limits="[14, 90]">
12
- <template #before>
13
- <q-scroll-area>
14
- <q-tabs class="header-tabs" vertical v-model="selectedVersion" active-color="brand-primary" indicator-color="brand-primary">
15
- <q-tab v-for="releaseInfo in filteredReleases" class="header-btn" :key="releaseInfo.version" :name="releaseInfo.version" no-caps>
16
- <div class="release__tab-label q-pt-xs">{{ releaseInfo.version }}</div>
17
- <div class="release__tab-date q-pb-xs">{{ releaseInfo.date }}</div>
18
- </q-tab>
19
- </q-tabs>
20
- </q-scroll-area>
21
- </template>
22
-
23
- <template #after>
24
- <q-tab-panels class="releases-container" v-model="selectedVersion" animated transition-prev="slide-down" transition-next="slide-up">
25
- <q-tab-panel class="q-pa-none" v-for="releaseInfo in filteredReleases" :key="releaseInfo.version" :name="releaseInfo.version">
26
- <q-scroll-area>
27
- <div class="release__body q-pa-md" v-html="currentReleaseBody" />
28
- </q-scroll-area>
29
- </q-tab-panel>
30
- </q-tab-panels>
31
- </template>
32
- </q-splitter>
33
- </div>
34
- </template>
35
-
36
- <script setup lang="ts">
37
- import { ref, computed, watch } from 'vue'
38
- import { mdiMagnify } from '@quasar/extras/mdi-v6'
39
-
40
- interface Release {
41
- version: string
42
- body: string
43
- date: string
44
- label: string
45
- }
46
-
47
- const props = defineProps<{ releases: Release[] }>()
48
-
49
- const search = ref('')
50
- const selectedVersion = ref(getLatestVersion())
51
-
52
- watch(
53
- () => props.releases,
54
- () => { selectedVersion.value = getLatestVersion() }
55
- )
56
-
57
- function getLatestVersion (): string {
58
- return props.releases && props.releases.length > 0 ? props.releases[0]!.version : 'unknown'
59
- }
60
-
61
- const filteredReleases = computed(() => {
62
- if (search.value) {
63
- const val = search.value.toLowerCase()
64
- return props.releases.filter(release => (
65
- release.version.indexOf(val) !== -1 ||
66
- release.body.toLowerCase().indexOf(val) !== -1
67
- ))
68
- }
69
-
70
- return props.releases
71
- })
72
-
73
- const currentReleaseBody = computed(() => {
74
- const release = props.releases.find(r => r.version === selectedVersion.value)
75
- return release ? release.body : ''
76
- })
77
- </script>
78
-
79
- <style lang="scss">
80
- .release__splitter .q-scrollarea {
81
- height: 600px;
82
- }
83
-
84
- .release__tab-label {
85
- font-size: $font-size;
86
- font-weight: 700;
87
- line-height: ($font-size + 3px);
88
- }
89
-
90
- .release__tab-date {
91
- font-size: ($font-size - 3px);
92
- line-height: ($font-size + 3px);
93
- }
94
-
95
- .release__body {
96
- h1, h2, h3, h4, h5, h6 {
97
- padding: 0;
98
- margin: .7em 0 .5em;
99
- line-height: 1.1em;
100
- color: $brand-primary;
101
-
102
- &:first-child {
103
- margin-top: 0;
104
- }
105
- }
106
-
107
- h1 {
108
- font-size: ($font-size + 18px);
109
- }
110
-
111
- h2 {
112
- font-size: ($font-size + 14px);
113
- }
114
-
115
- h3 {
116
- font-size: ($font-size + 10px);
117
- }
118
-
119
- h4 {
120
- font-size: ($font-size + 6px);
121
- }
122
-
123
- h5 {
124
- font-size: ($font-size + 4px);
125
- }
126
-
127
- h6 {
128
- font-size: ($font-size + 2px);
129
- }
130
-
131
- table {
132
- white-space: normal;
133
- border: 1px solid $separator-color;
134
- border-radius: $generic-border-radius;
135
- width: 100%;
136
- max-width: 100%;
137
- border-collapse: separate;
138
- border-spacing: 0;
139
-
140
- th, td {
141
- text-align: left;
142
- padding: 8px 16px;
143
- }
144
-
145
- th {
146
- font-weight: 700;
147
- letter-spacing: $letter-spacing-brand;
148
- border-bottom: 1px solid $separator-color;
149
- }
150
-
151
- tr:not(:first-child) td {
152
- border-top: 1px solid $separator-color;
153
- }
154
- }
155
- }
156
-
157
- body.body--dark .release__body {
158
- table {
159
- &, th, tr:not(:first-child) td {
160
- border-color: $separator-dark-color;
161
- }
162
- }
163
- }
164
- </style>
@@ -1,149 +0,0 @@
1
- <template>
2
- <q-card flat bordered>
3
- <q-card-section v-if="error" class="row no-wrap items-center">
4
- <q-icon name="warning" size="24px" color="negative" class="q-mr-sm" />
5
- <div>Cannot connect to GitHub. Try again later.</div>
6
- </q-card-section>
7
-
8
- <q-card-section v-else-if="loading" class="row no-wrap items-center">
9
- <q-spinner size="24px" color="primary" class="q-mr-sm" />
10
- <div>Loading release notes from GitHub</div>
11
- </q-card-section>
12
-
13
- <template v-else>
14
- <q-separator />
15
- <q-tab-panels v-model="currentPackage" animated class="packages-container">
16
- <q-tab-panel
17
- v-for="(packageReleases, packageName) in packages"
18
- :key="packageName"
19
- :name="packageName"
20
- class="q-pa-none"
21
- >
22
- <PackageReleases
23
- v-if="String(latestVersions[packageName]) && packageReleases.length > 0"
24
- :latest-version="String(latestVersions[packageName])"
25
- :releases="packageReleases"
26
- />
27
- </q-tab-panel>
28
- </q-tab-panels>
29
- </template>
30
- </q-card>
31
- </template>
32
-
33
- <script setup lang="ts">
34
- import { ref, onMounted } from 'vue'
35
- import { date } from 'quasar'
36
-
37
- import PackageReleases from './PackageReleases.vue'
38
-
39
- const { extractDate, formatDate } = date
40
-
41
- // Types
42
- interface ReleaseInfo {
43
- version: string
44
- date: string
45
- body: string
46
- label: string
47
- }
48
-
49
- interface PackageReleasesMap {
50
- [key: string]: ReleaseInfo[]
51
- }
52
-
53
- // Reactive state
54
- const packages = ref<PackageReleasesMap>({
55
- 'MD-Plugins': [],
56
- })
57
- const loading = ref<boolean>(false)
58
- const error = ref<boolean>(false)
59
- const currentPackage = ref<string>('MD-Plugins')
60
- const latestVersions = ref<Record<string, string>>({})
61
-
62
- function queryReleases(page = 1): void {
63
- loading.value = true
64
- error.value = false
65
-
66
- const xhr = new XMLHttpRequest()
67
-
68
- xhr.addEventListener('load', function () {
69
- const releases = JSON.parse(this.responseText)
70
-
71
- if (!releases || releases.length === 0) {
72
- error.value = true
73
- return
74
- }
75
-
76
- error.value = false
77
- let stopQuery = true
78
-
79
- for (const release of releases) {
80
- const [name, version] = release.name.split('v')
81
-
82
- if (name.startsWith('@quasar')) {
83
- continue
84
- }
85
-
86
- const packageName = currentPackage.value
87
-
88
- if (!version) {
89
- stopQuery = true
90
- continue
91
- }
92
-
93
- if (!packages.value[packageName]) {
94
- packages.value[packageName] = []
95
- }
96
-
97
- const releaseInfo: ReleaseInfo = {
98
- version,
99
- date: formatDate(extractDate(release.published_at, 'YYYY-MM-DD'), 'YYYY-MM-DD'),
100
- body: release.body,
101
- label: version,
102
- }
103
-
104
- packages.value[packageName].push(releaseInfo)
105
-
106
- if (!latestVersions.value[packageName]) {
107
- latestVersions.value[packageName] = releaseInfo.label
108
- }
109
- }
110
-
111
- if (!stopQuery) {
112
- queryReleases(page + 1)
113
- }
114
-
115
- if (packages.value['MD-Plugins']) {
116
- packages.value['MD-Plugins'].sort((a, b) => {
117
- return parseInt(b.date.replace(/-/g, ''), 10) - parseInt(a.date.replace(/-/g, ''), 10)
118
- })
119
- }
120
-
121
- loading.value = false
122
- console.log('Packages:', packages.value)
123
- console.log('Latest versions:', latestVersions.value)
124
- })
125
-
126
- xhr.addEventListener('error', () => {
127
- error.value = true
128
- })
129
-
130
- xhr.open(
131
- 'GET',
132
- `https://api.github.com/repos/md-plugins/md-plugins/releases?page=${page}&per_page=100`,
133
- )
134
- xhr.send()
135
- }
136
-
137
- onMounted(() => {
138
- queryReleases()
139
- })
140
- </script>
141
-
142
- <style lang="scss">
143
- .packages-container {
144
- .q-tab-panel {
145
- padding-right: 0;
146
- padding-top: 0;
147
- }
148
- }
149
- </style>
@@ -1,74 +0,0 @@
1
- <template>
2
- <q-card flat bordered>
3
- <q-card-section class="row no-wrap items-center" v-if="error">
4
- <q-icon class="q-mr-md" name="warning" size="24px" color="negative" />
5
- <div>Cannot fetch the release notes. Please use the links above instead.</div>
6
- </q-card-section>
7
-
8
- <q-card-section class="row no-wrap items-center" v-else-if="loading">
9
- <q-spinner class="q-mr-md" size="24px" color="brand-primary" />
10
- <div>Loading release notes...</div>
11
- </q-card-section>
12
-
13
- <template v-else>
14
- <q-tabs class="header-tabs" v-model="currentPackage" no-caps align="left" active-color="brand-primary" indicator-color="brand-primary">
15
- <q-tab v-for="packageName in packageList" class="header-btn" :name="packageName" :key="packageName">
16
- {{ packageName }}
17
- </q-tab>
18
- </q-tabs>
19
-
20
- <q-separator />
21
-
22
- <q-tab-panels class="packages-container" v-model="currentPackage" animated>
23
- <q-tab-panel class="q-pa-none" v-for="(packageReleases, packageName) in packages" :key="packageName" :name="packageName">
24
- <PackageReleases :releases="packageReleases" />
25
- </q-tab-panel>
26
- </q-tab-panels>
27
- </template>
28
- </q-card>
29
- </template>
30
-
31
- <script setup>
32
- import { ref, onMounted } from 'vue'
33
- import { date } from 'quasar'
34
-
35
- import PackageReleases from './PackageReleases.vue'
36
-
37
- const { extractDate } = date
38
-
39
- const loading = ref(true)
40
- const error = ref(false)
41
-
42
- const currentPackage = ref('quasar')
43
- const packages = ref({})
44
- const packageList = ref([])
45
-
46
- function queryReleases () {
47
- fetch('https://cdn.quasar.dev/release-notes/v2.json')
48
- .then(response => response.json())
49
- .then(data => {
50
- const list = Object.keys(data)
51
-
52
- for (const packageName of list) {
53
- const target = data[ packageName ]
54
- target.forEach(entry => {
55
- entry.date = extractDate(entry.date, 'YYYY-MM-DD').toLocaleDateString()
56
- })
57
- }
58
-
59
- packages.value = data
60
- packageList.value = list
61
-
62
- loading.value = false
63
- })
64
- .catch(err => {
65
- console.error(err)
66
- error.value = true
67
- })
68
- }
69
-
70
- onMounted(() => { queryReleases() })
71
- </script>
72
-
73
- <style lang="sass">
74
- </style>