@scalar/nuxt 0.3.32 → 0.3.34

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 CHANGED
@@ -46,7 +46,7 @@ export default defineNuxtConfig({
46
46
  })
47
47
  ```
48
48
 
49
- By default the docs will be hosted at `/docs` but you an easily customize that, here's a more in
49
+ By default the docs will be hosted at `/docs` but you can easily customize that, here's a more in
50
50
  depth config example.
51
51
 
52
52
  ```ts
@@ -54,7 +54,7 @@ export default defineNuxtConfig({
54
54
  modules: ['@scalar/nuxt'],
55
55
  scalar: {
56
56
  darkMode: true,
57
- hideModals: false,
57
+ hideModels: false,
58
58
  hideDownloadButton: false,
59
59
  metaData: {
60
60
  title: 'API Documentation by Scalar',
package/dist/module.d.mts CHANGED
@@ -22,6 +22,7 @@ type ModuleOptions = {
22
22
  * configurations. These configurations will extend over the base config
23
23
  */
24
24
  configurations: Omit<Configuration, 'devtools'>[];
25
+ layout: string | false;
25
26
  } & Configuration;
26
27
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
27
28
 
package/dist/module.d.ts CHANGED
@@ -22,6 +22,7 @@ type ModuleOptions = {
22
22
  * configurations. These configurations will extend over the base config
23
23
  */
24
24
  configurations: Omit<Configuration, 'devtools'>[];
25
+ layout: string | false;
25
26
  } & Configuration;
26
27
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
27
28
 
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scalar/nuxt",
3
3
  "configKey": "scalar",
4
- "version": "0.3.32",
4
+ "version": "0.3.34",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.1",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -16,7 +16,8 @@ const module = defineNuxtModule({
16
16
  },
17
17
  showSidebar: true,
18
18
  devtools: true,
19
- configurations: []
19
+ configurations: [],
20
+ layout: false
20
21
  },
21
22
  setup(_options, _nuxt) {
22
23
  const resolver = createResolver(import.meta.url);
@@ -57,6 +58,7 @@ const module = defineNuxtModule({
57
58
  name: "scalar-" + index,
58
59
  path: configuration.pathRouting?.basePath + ":pathMatch(.*)*",
59
60
  meta: {
61
+ layout: _options.layout,
60
62
  configuration,
61
63
  isOpenApiEnabled
62
64
  },
@@ -68,6 +70,7 @@ const module = defineNuxtModule({
68
70
  name: "scalar",
69
71
  path: _options.pathRouting?.basePath + ":pathMatch(.*)*",
70
72
  meta: {
73
+ layout: _options.layout,
71
74
  configuration: _options,
72
75
  isOpenApiEnabled
73
76
  },
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { ModernLayout, parse } from '@scalar/api-reference'
3
3
  import type { ApiReferenceConfiguration } from '@scalar/types/api-reference'
4
- import { useHead, useRequestURL, useSeoMeta } from '#imports'
4
+ import { useFetch, useHead, useRequestURL, useSeoMeta } from '#imports'
5
5
  import type { Configuration } from '~/src/types'
6
6
  import { reactive, ref, toRaw } from 'vue'
7
7
 
@@ -23,8 +23,9 @@ const document =
23
23
  : content
24
24
  ? toRaw(content)
25
25
  : url
26
- ? await $fetch<string>(url)
27
- : await $fetch<string>('/_openapi.json')
26
+ ? (await useFetch<string>(url, { responseType: 'text' })).data.value
27
+ : (await useFetch<string>('/_openapi.json', { responseType: 'text' }))
28
+ .data.value
28
29
 
29
30
  // Check for empty spec
30
31
  if (!document) {
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "testing",
21
21
  "vue"
22
22
  ],
23
- "version": "0.3.32",
23
+ "version": "0.3.34",
24
24
  "engines": {
25
25
  "node": ">=18"
26
26
  },
@@ -39,9 +39,9 @@
39
39
  ],
40
40
  "dependencies": {
41
41
  "@nuxt/kit": "^3.12.3",
42
- "@scalar/api-client": "2.3.32",
43
- "@scalar/types": "0.1.14",
44
- "@scalar/api-reference": "1.28.32"
42
+ "@scalar/api-client": "2.3.34",
43
+ "@scalar/api-reference": "1.28.34",
44
+ "@scalar/types": "0.1.16"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@nuxt/devtools": "^1.3.9",