@scalar/api-reference 1.28.23 → 1.28.25

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/browser/standalone.js +5904 -5810
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  5. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  6. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +100 -57
  7. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  8. package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
  9. package/dist/components/Content/Introduction/Introduction.vue2.js +43 -42
  10. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +1 -1
  11. package/dist/components/SpecificationExtension/SpecificationExtension.vue.d.ts.map +1 -1
  12. package/dist/components/SpecificationExtension/SpecificationExtension.vue.js +26 -21
  13. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  14. package/dist/features/ApiClientModal/ApiClientModal.vue.js +35 -31
  15. package/dist/features/ApiClientModal/useApiClient.d.ts +122 -22
  16. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  17. package/dist/helpers/get-request.d.ts.map +1 -1
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/standalone/lib/html-api.d.ts +1 -20
  22. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  23. package/dist/standalone/lib/html-api.js +11 -11
  24. package/dist/standalone/lib/register-globals.d.ts +1 -1
  25. package/dist/standalone/lib/register-globals.d.ts.map +1 -1
  26. package/dist/style.css +1 -1
  27. package/package.json +10 -9
@@ -1,5 +1,4 @@
1
- import { type AnyApiReferenceConfiguration, type ApiReferenceConfiguration } from '@scalar/types/api-reference';
2
- import { type App } from 'vue';
1
+ import { type ApiReferenceConfiguration, type CreateApiReference } from '@scalar/types/api-reference';
3
2
  /**
4
3
  * Reading the configuration from the data-attributes.
5
4
  */
@@ -10,30 +9,12 @@ export declare function getConfigurationFromDataAttributes(doc: Document): ApiRe
10
9
  */
11
10
  export declare function findDataAttributes(doc: Document, configuration: ApiReferenceConfiguration): void;
12
11
  export declare const createContainer: (doc: Document, element?: Element | null) => Element | null;
13
- export type ApiReferenceInstance = {
14
- /** The vue app instance */
15
- app: App<Element>;
16
- /** Destroy the current API Reference instance */
17
- destroy: () => void;
18
- /** Get the current configuration[s] */
19
- getConfiguration: () => AnyApiReferenceConfiguration;
20
- /** Update all configuration[s] */
21
- updateConfiguration: (newConfig: AnyApiReferenceConfiguration) => void;
22
- };
23
- /** Function overload for createApiReference to allow multiple different signatures */
24
- export type CreateApiReference = {
25
- /** Pass in the configuration only */
26
- (configuration: AnyApiReferenceConfiguration): ApiReferenceInstance;
27
- /** Pass in the element or selector and configuration */
28
- (elementOrSelector: Element | string, configuration: AnyApiReferenceConfiguration): ApiReferenceInstance;
29
- };
30
12
  /**
31
13
  * Create (and mount) a new Scalar API Reference
32
14
  *
33
15
  * @example createApiReference({ url: '/scalar.json' }).mount('#app')
34
16
  * @example createApiReference('#app', { url: '/scalar.json' })
35
17
  * @example createApiReference(document.getElementById('app'), { url: '/scalar.json' })
36
- *
37
18
  */
38
19
  export declare const createApiReference: CreateApiReference;
39
20
  //# sourceMappingURL=html-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"html-api.d.ts","sourceRoot":"","sources":["../../../src/standalone/lib/html-api.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAE/B,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAAE,KAAK,GAAG,EAA0B,MAAM,KAAK,CAAA;AAMtD;;GAEG;AACH,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,QAAQ,GAAG,yBAAyB,CA+G3F;AAED;;;GAGG;AACH,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+1,13 @@
1
- import { createHead as s } from "@unhead/vue";
1
+ import { createHead as r } from "@unhead/vue";
2
2
  import { reactive as u, createApp as c, h as d } from "vue";
3
3
  import i from "../../components/ApiReference.vue.js";
4
- const m = (n, o) => {
4
+ const y = (n, s) => {
5
5
  const t = u({
6
6
  // Either the configuration will be the second arugment or it MUST be the first (configuration only)
7
- configuration: o ?? n ?? {}
7
+ configuration: s ?? n ?? {}
8
8
  });
9
9
  let a = c(() => d(i, t));
10
- if (a.use(s()), o) {
10
+ if (a.use(r()), s) {
11
11
  const e = typeof n == "string" ? document.querySelector(n) : n;
12
12
  e ? a.mount(e) : console.error("Could not find a mount point for API References:", n);
13
13
  }
@@ -15,28 +15,28 @@ const m = (n, o) => {
15
15
  "scalar:reload-references",
16
16
  () => {
17
17
  if (console.warn(
18
- "scalar:reload-references event has been deprecated, please use the window.Scalar.app.mount method instead"
18
+ "scalar:reload-references event has been deprecated, please use the scalarInstance.app.mount method instead."
19
19
  ), !t.configuration)
20
20
  return;
21
21
  const e = typeof n == "string" ? document.querySelector(n) : n;
22
- e && (e && !document.body.contains(e) && document.body.appendChild(e), a.unmount(), a = c(() => d(i, t)), a.use(s()), a.mount(e));
22
+ e && (e && !document.body.contains(e) && document.body.appendChild(e), a.unmount(), a = c(() => d(i, t)), a.use(r()), a.mount(e));
23
23
  },
24
24
  !1
25
25
  );
26
- const r = () => {
26
+ const o = () => {
27
27
  delete t.configuration, a.unmount();
28
28
  };
29
29
  return document.addEventListener(
30
30
  "scalar:destroy-references",
31
31
  () => {
32
- console.warn("scalar:destroy-references event has been deprecated, please use window.Scalar.destroy instead"), r();
32
+ console.warn("scalar:destroy-references event has been deprecated, please use scalarInstance.destroy instead."), o();
33
33
  },
34
34
  !1
35
35
  ), document.addEventListener(
36
36
  "scalar:update-references-config",
37
37
  (e) => {
38
38
  console.warn(
39
- "scalar:update-references-config event has been deprecated, please use window.Scalar.updateConfiguration instead"
39
+ "scalar:update-references-config event has been deprecated, please use scalarInstance.updateConfiguration instead."
40
40
  ), "detail" in e && Object.assign(t, e.detail);
41
41
  },
42
42
  !1
@@ -46,9 +46,9 @@ const m = (n, o) => {
46
46
  updateConfiguration: (e) => {
47
47
  t.configuration = e;
48
48
  },
49
- destroy: r
49
+ destroy: o
50
50
  };
51
51
  };
52
52
  export {
53
- m as createApiReference
53
+ y as createApiReference
54
54
  };
@@ -1,4 +1,4 @@
1
- import { type CreateApiReference } from '../../standalone/lib/html-api.js';
1
+ import type { CreateApiReference } from '@scalar/types/api-reference';
2
2
  declare global {
3
3
  interface Window {
4
4
  Scalar: {
@@ -1 +1 @@
1
- {"version":3,"file":"register-globals.d.ts","sourceRoot":"","sources":["../../../src/standalone/lib/register-globals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAGvF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE;YACN,kBAAkB,EAAE,kBAAkB,CAAA;SACvC,CAAA;KACF;CACF;AAED,2GAA2G;AAC3G,eAAO,MAAM,eAAe,YAW3B,CAAA"}
1
+ {"version":3,"file":"register-globals.d.ts","sourceRoot":"","sources":["../../../src/standalone/lib/register-globals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAGrE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE;YACN,kBAAkB,EAAE,kBAAkB,CAAA;SACvC,CAAA;KACF;CACF;AAED,2GAA2G;AAC3G,eAAO,MAAM,eAAe,YAS3B,CAAA"}