@scalar/sveltekit 0.2.8 → 0.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"scalar-api-reference.d.ts","sourceRoot":"","sources":["../src/scalar-api-reference.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAS3D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,oBAAoB,OAAO,CAAC,yBAAyB,CAAC,KAAG,CAAC,MAAM,QAAQ,CAc1G,CAAA"}
1
+ {"version":3,"file":"scalar-api-reference.d.ts","sourceRoot":"","sources":["../src/scalar-api-reference.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAS3D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,oBAAoB,OAAO,CAAC,yBAAyB,CAAC,KAAG,CAAC,MAAM,QAAQ,CAe1G,CAAA"}
@@ -1,4 +1,4 @@
1
- import { getHtmlDocument } from '@scalar/core/libs/html-rendering';
1
+ import { renderApiReference } from '@scalar/client-side-rendering';
2
2
  import { customTheme } from './custom-theme.js';
3
3
  /**
4
4
  * The default configuration for the API Reference.
@@ -18,7 +18,8 @@ export const ScalarApiReference = (givenConfiguration) => {
18
18
  ...givenConfiguration,
19
19
  };
20
20
  return () => {
21
- const referenceDocument = getHtmlDocument(configuration, customTheme);
21
+ const { cdn, pageTitle, ...config } = configuration;
22
+ const referenceDocument = renderApiReference({ config, pageTitle, cdn }, customTheme);
22
23
  return new Response(referenceDocument, {
23
24
  status: 200,
24
25
  headers: { 'Content-Type': 'text/html' },
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { HtmlRenderingConfiguration } from '@scalar/core/libs/html-rendering';
1
+ import type { HtmlRenderingConfiguration } from '@scalar/client-side-rendering';
2
2
  /**
3
3
  * The configuration for the Scalar API Reference for SvelteKit
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAA;AAElF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,0BAA0B,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAA;AAE/E;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,0BAA0B,CAAA"}
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "openapi",
19
19
  "swagger"
20
20
  ],
21
- "version": "0.2.8",
21
+ "version": "0.2.10",
22
22
  "engines": {
23
23
  "node": ">=22"
24
24
  },
@@ -58,7 +58,7 @@
58
58
  ],
59
59
  "svelte": "./dist/index.js",
60
60
  "dependencies": {
61
- "@scalar/core": "0.5.1"
61
+ "@scalar/client-side-rendering": "0.1.3"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@sveltejs/kit": "^2.57.1",
@@ -1,4 +1,4 @@
1
- import { getHtmlDocument } from '@scalar/core/libs/html-rendering'
1
+ import { renderApiReference } from '@scalar/client-side-rendering'
2
2
 
3
3
  import { customTheme } from './custom-theme.js'
4
4
  import type { ApiReferenceConfiguration } from './types.js'
@@ -23,7 +23,8 @@ export const ScalarApiReference = (givenConfiguration: Partial<ApiReferenceConfi
23
23
  }
24
24
 
25
25
  return () => {
26
- const referenceDocument = getHtmlDocument(configuration, customTheme)
26
+ const { cdn, pageTitle, ...config } = configuration
27
+ const referenceDocument = renderApiReference({ config, pageTitle, cdn }, customTheme)
27
28
  return new Response(referenceDocument, {
28
29
  status: 200,
29
30
  headers: { 'Content-Type': 'text/html' },
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { HtmlRenderingConfiguration } from '@scalar/core/libs/html-rendering'
1
+ import type { HtmlRenderingConfiguration } from '@scalar/client-side-rendering'
2
2
 
3
3
  /**
4
4
  * The configuration for the Scalar API Reference for SvelteKit