@scalar/nuxt 0.2.81 → 0.2.83

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
@@ -48,7 +48,7 @@ export default defineNuxtConfig({
48
48
  })
49
49
  ```
50
50
 
51
- By default the docs will be hosted at `/scalar` but you an easily customize that, here's a more in
51
+ By default the docs will be hosted at `/docs` but you an easily customize that, here's a more in
52
52
  depth config example.
53
53
 
54
54
  ```ts
@@ -108,6 +108,17 @@ export default defineNuxtConfig({
108
108
  })
109
109
  ```
110
110
 
111
+ For theme configuration, you can pass a `theme` property to the configuration object. The default theme is `nuxt`, but you can also pass `default` to use the default theme.
112
+
113
+ ```ts
114
+ export default defineNuxtConfig({
115
+ modules: ['@scalar/nuxt'],
116
+ scalar: {
117
+ theme: 'nuxt',
118
+ },
119
+ })
120
+ ```
121
+
111
122
  ## Troubleshooting
112
123
 
113
124
  If you come across any `**** not default export` errors, its likely you are using `pnpm`.
package/dist/module.d.mts CHANGED
@@ -1,13 +1,19 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
  import { ReferenceConfiguration } from '@scalar/api-reference';
3
3
 
4
- type Configuration = Omit<ReferenceConfiguration, 'layout' | 'isEditable' | 'onSpecUpdate'> & {
4
+ type Configuration = Omit<ReferenceConfiguration, 'layout' | 'isEditable' | 'onSpecUpdate' | 'theme'> & {
5
5
  /**
6
6
  * Whether to show scalar in Nuxt DevTools
7
7
  *
8
8
  * @default true
9
9
  */
10
10
  devtools: boolean;
11
+ /**
12
+ * The theme to use for the reference
13
+ *
14
+ * @default 'nuxt'
15
+ */
16
+ theme?: ReferenceConfiguration['theme'] | 'nuxt';
11
17
  };
12
18
 
13
19
  type ModuleOptions = {
package/dist/module.d.ts CHANGED
@@ -1,13 +1,19 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
  import { ReferenceConfiguration } from '@scalar/api-reference';
3
3
 
4
- type Configuration = Omit<ReferenceConfiguration, 'layout' | 'isEditable' | 'onSpecUpdate'> & {
4
+ type Configuration = Omit<ReferenceConfiguration, 'layout' | 'isEditable' | 'onSpecUpdate' | 'theme'> & {
5
5
  /**
6
6
  * Whether to show scalar in Nuxt DevTools
7
7
  *
8
8
  * @default true
9
9
  */
10
10
  devtools: boolean;
11
+ /**
12
+ * The theme to use for the reference
13
+ *
14
+ * @default 'nuxt'
15
+ */
16
+ theme?: ReferenceConfiguration['theme'] | 'nuxt';
11
17
  };
12
18
 
13
19
  type ModuleOptions = {
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scalar/nuxt",
3
3
  "configKey": "scalar",
4
- "version": "0.2.81",
4
+ "version": "0.2.83",
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
+ theme: "nuxt"
20
21
  },
21
22
  setup(_options, _nuxt) {
22
23
  const resolver = createResolver(import.meta.url);
@@ -4,12 +4,21 @@ import { ModernLayout, parse } from '@scalar/api-reference'
4
4
  import { reactive, ref, toRaw } from 'vue'
5
5
  import type { Configuration } from '~/src/types'
6
6
 
7
- import './nuxt-theme.css'
8
-
9
7
  const props = defineProps<{
10
8
  configuration: Configuration
11
9
  }>()
12
10
 
11
+ if (props.configuration.theme === 'nuxt') {
12
+ useHead({
13
+ link: [
14
+ {
15
+ rel: 'stylesheet',
16
+ href: new URL('./nuxt-theme.css', import.meta.url).href,
17
+ },
18
+ ],
19
+ })
20
+ }
21
+
13
22
  const isDark = ref(props.configuration.darkMode)
14
23
 
15
24
  // Grab spec if we can
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "testing",
21
21
  "vue"
22
22
  ],
23
- "version": "0.2.81",
23
+ "version": "0.2.83",
24
24
  "engines": {
25
25
  "node": ">=18"
26
26
  },
@@ -39,8 +39,8 @@
39
39
  ],
40
40
  "dependencies": {
41
41
  "@nuxt/kit": "^3.12.3",
42
- "@scalar/api-client": "2.0.56",
43
- "@scalar/api-reference": "1.25.3"
42
+ "@scalar/api-client": "2.0.58",
43
+ "@scalar/api-reference": "1.25.5"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@nuxt/devtools": "^1.3.9",