@scalar/api-reference 1.32.4 → 1.32.6

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 (46) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/browser/standalone.js +9758 -9706
  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 +1 -1
  6. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +28 -26
  7. package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
  8. package/dist/components/Content/Tag/OperationsListItem.vue.js +2 -2
  9. package/dist/components/Content/Tag/OperationsListItem.vue2.js +1 -1
  10. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
  11. package/dist/features/Operation/components/ContentTypeSelect.vue.js +6 -6
  12. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  13. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  14. package/dist/features/Operation/components/RequestBody.vue2.js +13 -10
  15. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +4 -2
  16. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  17. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  18. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +71 -67
  19. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +4 -2
  20. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  21. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  22. package/dist/features/Operation/layouts/ModernLayout.vue2.js +30 -30
  23. package/dist/features/api-client-modal/useApiClient.d.ts +84 -4
  24. package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
  25. package/dist/features/download-link/DownloadLink.vue.d.ts.map +1 -1
  26. package/dist/features/download-link/DownloadLink.vue.js +1 -1
  27. package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -1
  28. package/dist/features/sidebar/components/SidebarElement.vue.js +2 -2
  29. package/dist/features/sidebar/components/SidebarElement.vue2.js +16 -15
  30. package/dist/index.js +1 -1
  31. package/dist/libs/openapi.d.ts +0 -13
  32. package/dist/libs/openapi.d.ts.map +1 -1
  33. package/dist/libs/openapi.js +49 -63
  34. package/dist/stores/useHttpClientStore.js +20 -20
  35. package/dist/style.css +1 -1
  36. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
  37. package/dist/v2/ApiReferenceWorkspace.vue.js +80 -72
  38. package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts +14 -0
  39. package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts.map +1 -0
  40. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +21 -72
  41. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +1 -1
  42. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts +1 -1
  43. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts.map +1 -1
  44. package/dist/v2/events/definitions.d.ts +9 -0
  45. package/dist/v2/events/definitions.d.ts.map +1 -1
  46. package/package.json +11 -10
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReferenceWorkspace.vue.d.ts","sourceRoot":"","sources":["../../src/v2/ApiReferenceWorkspace.vue"],"names":[],"mappings":"AA8SA,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAyBpE,KAAK,WAAW,GAAG;IACjB,aAAa,CAAC,EAAE,4BAA4B,CAAA;IAC5C,iBAAiB,EAAE,MAAM,cAAc,CAAA;CACxC,CAAC;AAyMF,iBAAS,cAAc;WA0GT,OAAO,IAA6B;;wBAVrB,GAAG;wBACH,GAAG;iCACM,GAAG;;;;EAaxC;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ApiReferenceWorkspace.vue.d.ts","sourceRoot":"","sources":["../../src/v2/ApiReferenceWorkspace.vue"],"names":[],"mappings":"AAoUA,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAyBpE,KAAK,WAAW,GAAG;IACjB,aAAa,CAAC,EAAE,4BAA4B,CAAA;IAC5C,iBAAiB,EAAE,MAAM,cAAc,CAAA;CACxC,CAAC;AAuNF,iBAAS,cAAc;WA0GT,OAAO,IAA6B;;wBAVrB,GAAG;wBACH,GAAG;iCACM,GAAG;;;;EAaxC;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,111 +1,119 @@
1
- import { defineComponent as w, ref as m, toRef as R, provide as T, shallowRef as $, onServerPrefetch as A, onMounted as B, watch as d, computed as N, createElementBlock as P, openBlock as D, Fragment as F, createBlock as I, createCommentVNode as U, createVNode as C, unref as r, resolveDynamicComponent as W, withCtx as n, createTextVNode as L, toDisplayString as O, renderSlot as p, isRef as Y } from "vue";
2
- import { parseJsonOrYaml as _, redirectToProxy as j } from "@scalar/oas-utils/helpers";
3
- import { useColorMode as J } from "@scalar/use-hooks/useColorMode";
4
- import { useSeoMeta as q } from "@unhead/vue";
5
- import { useFavicon as z } from "@vueuse/core";
6
- import G from "../components/ApiReferenceLayout.vue.js";
7
- import { NAV_STATE_SYMBOL as H } from "../hooks/useNavState.js";
8
- import { useMultipleDocuments as K } from "../features/multiple-documents/useMultipleDocuments.js";
9
- import { onCustomEvent as h } from "./events/listeners.js";
10
- import Q from "../features/multiple-documents/DocumentSelector.vue.js";
11
- const se = /* @__PURE__ */ w({
1
+ import { defineComponent as V, ref as f, toRef as b, provide as _, shallowRef as w, onServerPrefetch as $, onMounted as C, watch as d, computed as A, createElementBlock as B, openBlock as D, Fragment as F, createBlock as P, createCommentVNode as U, createVNode as S, unref as r, resolveDynamicComponent as W, withCtx as n, createTextVNode as Y, toDisplayString as O, renderSlot as p, isRef as j } from "vue";
2
+ import { safeLocalStorage as x, REFERENCE_LS_KEYS as h } from "@scalar/helpers/object/local-storage";
3
+ import { parseJsonOrYaml as J, redirectToProxy as K } from "@scalar/oas-utils/helpers";
4
+ import { useColorMode as q } from "@scalar/use-hooks/useColorMode";
5
+ import { useSeoMeta as z } from "@unhead/vue";
6
+ import { useFavicon as G } from "@vueuse/core";
7
+ import H from "../components/ApiReferenceLayout.vue.js";
8
+ import { NAV_STATE_SYMBOL as Q } from "../hooks/useNavState.js";
9
+ import { useMultipleDocuments as X } from "../features/multiple-documents/useMultipleDocuments.js";
10
+ import { onCustomEvent as v } from "./events/listeners.js";
11
+ import Z from "../features/multiple-documents/DocumentSelector.vue.js";
12
+ const ie = /* @__PURE__ */ V({
12
13
  __name: "ApiReferenceWorkspace",
13
14
  props: {
14
15
  configuration: {},
15
16
  getWorkspaceStore: { type: Function }
16
17
  },
17
18
  setup(M) {
18
- const f = M, {
19
- availableDocuments: u,
20
- selectedConfiguration: t,
21
- selectedDocumentIndex: l,
22
- isIntersectionEnabled: x,
19
+ const k = M, {
20
+ availableDocuments: l,
21
+ selectedConfiguration: a,
22
+ selectedDocumentIndex: s,
23
+ isIntersectionEnabled: g,
23
24
  hash: y,
24
- hashPrefix: S
25
- } = K({
26
- configuration: R(f, "configuration"),
27
- isIntersectionEnabled: m(!1),
28
- hash: m(""),
29
- hashPrefix: m("")
30
- }), g = (e, o) => fetch(
31
- j(t.value.proxyUrl, e.toString()),
32
- o
25
+ hashPrefix: T
26
+ } = X({
27
+ configuration: b(k, "configuration"),
28
+ isIntersectionEnabled: f(!1),
29
+ hash: f(""),
30
+ hashPrefix: f("")
31
+ }), L = (e, t) => fetch(
32
+ K(a.value.proxyUrl, e.toString()),
33
+ t
33
34
  );
34
- T(H, { isIntersectionEnabled: x, hash: y, hashPrefix: S });
35
- const v = $(null), a = f.getWorkspaceStore(), i = u, s = (e) => {
36
- if (a.workspace.documents[e.slug ?? "default"] === void 0) {
35
+ _(Q, { isIntersectionEnabled: g, hash: y, hashPrefix: T });
36
+ const c = w(null), o = k.getWorkspaceStore(), i = l, u = (e) => {
37
+ if (o.workspace.documents[e.slug ?? "default"] === void 0) {
37
38
  if (e.content) {
38
- const o = typeof e.content == "string" ? _(e.content) : e.content;
39
- return a.addDocumentSync({
39
+ const t = typeof e.content == "string" ? J(e.content) : e.content;
40
+ return o.addDocumentSync({
40
41
  name: e.slug ?? "default",
41
- document: typeof o == "function" ? o() : o
42
+ document: typeof t == "function" ? t() : t
42
43
  });
43
44
  }
44
45
  if (e.url)
45
- return a.addDocument({
46
+ return o.addDocument({
46
47
  name: e.slug ?? "default",
47
48
  url: e.url,
48
- fetch: g
49
+ fetch: L
49
50
  });
50
51
  }
51
52
  };
52
53
  i.value.forEach((e) => {
53
- e.content && s(e);
54
- }), A(() => {
54
+ e.content && u(e);
55
+ }), $(() => {
55
56
  i.value.forEach((e) => {
56
- e.url && s(e);
57
+ e.url && u(e);
57
58
  });
58
- }), B(() => {
59
+ }), C(() => {
59
60
  i.value.forEach((e) => {
60
- e.url && s(e);
61
+ e.url && u(e);
61
62
  });
62
- }), h(v, "scalar-update-dark-mode", (e) => {
63
- a.update("x-scalar-dark-mode", e.data.value);
64
- }), h(v, "scalar-update-active-document", (e) => {
65
- a.update("x-scalar-active-document", e.data.value);
63
+ }), v(c, "scalar-update-dark-mode", (e) => {
64
+ o.update("x-scalar-dark-mode", e.data.value);
65
+ }), v(c, "scalar-update-active-document", (e) => {
66
+ o.update("x-scalar-active-document", e.data.value);
67
+ }), v(c, "scalar-update-selected-client", (e) => {
68
+ o.update("x-scalar-default-client", e.data), x().setItem(h.SELECTED_CLIENT, e.data);
69
+ }), C(() => {
70
+ const e = x().getItem(
71
+ h.SELECTED_CLIENT
72
+ );
73
+ e && o.update("x-scalar-default-client", e);
66
74
  });
67
- const { toggleColorMode: E, isDarkMode: V } = J({
68
- initialColorMode: t.value.darkMode ? "dark" : void 0,
69
- overrideColorMode: t.value.forceDarkModeState
75
+ const { toggleColorMode: I, isDarkMode: N } = q({
76
+ initialColorMode: a.value.darkMode ? "dark" : void 0,
77
+ overrideColorMode: a.value.forceDarkModeState
70
78
  });
71
79
  d(
72
- () => t.value.darkMode,
73
- (e) => a.update("x-scalar-dark-mode", !!e)
80
+ () => a.value.darkMode,
81
+ (e) => o.update("x-scalar-dark-mode", !!e)
74
82
  ), d(
75
- () => V.value,
76
- (e) => a.update("x-scalar-dark-mode", e),
83
+ () => N.value,
84
+ (e) => o.update("x-scalar-dark-mode", e),
77
85
  { immediate: !0 }
78
86
  ), d(
79
- () => l.value,
87
+ () => s.value,
80
88
  (e) => {
81
- var o;
82
- return a.update(
89
+ var t;
90
+ return o.update(
83
91
  "x-scalar-active-document",
84
- (o = u.value[e]) == null ? void 0 : o.slug
92
+ (t = l.value[e]) == null ? void 0 : t.slug
85
93
  );
86
94
  },
87
95
  { immediate: !0 }
88
96
  ), d(
89
- () => u.value,
97
+ () => l.value,
90
98
  (e) => {
91
- e.forEach(s);
99
+ e.forEach(u);
92
100
  }
93
- ), t.value.metaData && q(t.value.metaData);
94
- const b = N(() => t.value.favicon);
95
- return z(b), (e, o) => {
96
- var k;
97
- return D(), P(F, null, [
98
- (k = r(t)) != null && k.customCss ? (D(), I(W("style"), { key: 0 }, {
101
+ ), a.value.metaData && z(a.value.metaData);
102
+ const R = A(() => a.value.favicon);
103
+ return G(R), (e, t) => {
104
+ var E;
105
+ return D(), B(F, null, [
106
+ (E = r(a)) != null && E.customCss ? (D(), P(W("style"), { key: 0 }, {
99
107
  default: n(() => [
100
- L(O(r(t).customCss), 1)
108
+ Y(O(r(a).customCss), 1)
101
109
  ]),
102
110
  _: 1
103
111
  })) : U("", !0),
104
- C(G, {
105
- configuration: r(t),
106
- isDark: !!r(a).workspace["x-scalar-dark-mode"],
107
- onToggleDarkMode: o[1] || (o[1] = () => r(E)()),
108
- onUpdateContent: o[2] || (o[2] = (c) => e.$emit("updateContent", c))
112
+ S(H, {
113
+ configuration: r(a),
114
+ isDark: !!r(o).workspace["x-scalar-dark-mode"],
115
+ onToggleDarkMode: t[1] || (t[1] = () => r(I)()),
116
+ onUpdateContent: t[2] || (t[2] = (m) => e.$emit("updateContent", m))
109
117
  }, {
110
118
  footer: n(() => [
111
119
  p(e.$slots, "footer")
@@ -114,10 +122,10 @@ const se = /* @__PURE__ */ w({
114
122
  p(e.$slots, "footer")
115
123
  ]),
116
124
  "document-selector": n(() => [
117
- C(r(Q), {
118
- modelValue: r(l),
119
- "onUpdate:modelValue": o[0] || (o[0] = (c) => Y(l) ? l.value = c : null),
120
- options: r(u)
125
+ S(r(Z), {
126
+ modelValue: r(s),
127
+ "onUpdate:modelValue": t[0] || (t[0] = (m) => j(s) ? s.value = m : null),
128
+ options: r(l)
121
129
  }, null, 8, ["modelValue", "options"])
122
130
  ]),
123
131
  "sidebar-start": n(() => [
@@ -130,5 +138,5 @@ const se = /* @__PURE__ */ w({
130
138
  }
131
139
  });
132
140
  export {
133
- se as default
141
+ ie as default
134
142
  };
@@ -0,0 +1,14 @@
1
+ import type { ExampleObject } from '@scalar/workspace-store/schemas/v3.1/strict/example';
2
+ type __VLS_Props = {
3
+ examples: Record<string, ExampleObject>;
4
+ };
5
+ type __VLS_PublicProps = {
6
+ modelValue: string;
7
+ } & __VLS_Props;
8
+ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ "update:modelValue": (value: string) => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
11
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ export default _default;
14
+ //# sourceMappingURL=ExamplePicker.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExamplePicker.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue"],"names":[],"mappings":"AA0EA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAA;AAKxF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;CACxC,CAAC;AA2CF,KAAK,iBAAiB,GAAG;IACzB,UAAU,EAAE,MAAM,CAAC;CAClB,GAAG,WAAW,CAAC;;;;;;AAyGhB,wBAQG"}
@@ -4,8 +4,7 @@ import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/stric
4
4
  import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/security-scheme';
5
5
  import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/server';
6
6
  import { type Dereference } from '@scalar/workspace-store/schemas/v3.1/type-guard';
7
- import { type ComponentPublicInstance } from 'vue';
8
- type Props = {
7
+ export type RequestExampleProps = {
9
8
  /**
10
9
  * List of all allowed clients, this will determine which clients are available in the dropdown
11
10
  *
@@ -24,7 +23,7 @@ type Props = {
24
23
  /**
25
24
  * Which server from the spec to use for the code example
26
25
  */
27
- selectedServer?: ServerObject;
26
+ selectedServer?: ServerObject | undefined;
28
27
  /**
29
28
  * The selected content type from the requestBody.content, this will determine which examples are available
30
29
  * as well as the content type of the code example
@@ -61,77 +60,27 @@ type Props = {
61
60
  */
62
61
  generateLabel?: () => string;
63
62
  /**
64
- * Config options for the block
63
+ * Whether to hide the client selector
64
+ * @default false
65
65
  */
66
- config?: {
67
- hideClientSelector?: boolean;
68
- };
69
- };
70
- declare function __VLS_template(): {
71
- attrs: Partial<{}>;
72
- slots: Readonly<{
73
- header: () => unknown;
74
- footer: () => unknown;
75
- }> & {
76
- header: () => unknown;
77
- footer: () => unknown;
78
- };
79
- refs: {
80
- elem: ({
81
- $: import("vue").ComponentInternalInstance;
82
- $data: {};
83
- $props: Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
84
- $attrs: {
85
- [x: string]: unknown;
86
- };
87
- $refs: {
88
- [x: string]: unknown;
89
- };
90
- $slots: Readonly<{
91
- [name: string]: import("vue").Slot<any> | undefined;
92
- }>;
93
- $root: ComponentPublicInstance | null;
94
- $parent: ComponentPublicInstance | null;
95
- $host: Element | null;
96
- $emit: (event: string, ...args: any[]) => void;
97
- $el: HTMLDivElement;
98
- $options: import("vue").ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
99
- beforeCreate?: (() => void) | (() => void)[];
100
- created?: (() => void) | (() => void)[];
101
- beforeMount?: (() => void) | (() => void)[];
102
- mounted?: (() => void) | (() => void)[];
103
- beforeUpdate?: (() => void) | (() => void)[];
104
- updated?: (() => void) | (() => void)[];
105
- activated?: (() => void) | (() => void)[];
106
- deactivated?: (() => void) | (() => void)[];
107
- beforeDestroy?: (() => void) | (() => void)[];
108
- beforeUnmount?: (() => void) | (() => void)[];
109
- destroyed?: (() => void) | (() => void)[];
110
- unmounted?: (() => void) | (() => void)[];
111
- renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
112
- renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
113
- errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
114
- };
115
- $forceUpdate: () => void;
116
- $nextTick: typeof import("vue").nextTick;
117
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
118
- } & Readonly<{}> & Omit<Readonly<{}> & Readonly<{}>, never> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
119
- $slots: {
120
- default?(_: {}): any;
121
- };
122
- }) | null;
123
- };
124
- rootEl: any;
66
+ hideClientSelector?: boolean;
125
67
  };
126
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
127
- declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
128
- "update:selectedClient": (id: "c/libcurl" | "clojure/clj_http" | "csharp/httpclient" | "csharp/restsharp" | "dart/http" | "go/native" | "http/http1.1" | "java/asynchttp" | "java/nethttp" | "java/okhttp" | "java/unirest" | "js/axios" | "js/fetch" | "js/jquery" | "js/ofetch" | "js/xhr" | "kotlin/okhttp" | "node/axios" | "node/fetch" | "node/ofetch" | "node/undici" | "objc/nsurlsession" | "ocaml/cohttp" | "php/curl" | "php/guzzle" | "powershell/restmethod" | "powershell/webrequest" | "python/python3" | "python/requests" | "python/httpx_sync" | "python/httpx_async" | "r/httr" | "ruby/native" | "rust/reqwest" | "shell/curl" | "shell/httpie" | "shell/wget" | "swift/nsurlsession") => any;
129
- "update:selectedExample": (name: string) => any;
130
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
131
- "onUpdate:selectedClient"?: ((id: "c/libcurl" | "clojure/clj_http" | "csharp/httpclient" | "csharp/restsharp" | "dart/http" | "go/native" | "http/http1.1" | "java/asynchttp" | "java/nethttp" | "java/okhttp" | "java/unirest" | "js/axios" | "js/fetch" | "js/jquery" | "js/ofetch" | "js/xhr" | "kotlin/okhttp" | "node/axios" | "node/fetch" | "node/ofetch" | "node/undici" | "objc/nsurlsession" | "ocaml/cohttp" | "php/curl" | "php/guzzle" | "powershell/restmethod" | "powershell/webrequest" | "python/python3" | "python/requests" | "python/httpx_sync" | "python/httpx_async" | "r/httr" | "ruby/native" | "rust/reqwest" | "shell/curl" | "shell/httpie" | "shell/wget" | "swift/nsurlsession") => any) | undefined;
132
- "onUpdate:selectedExample"?: ((name: string) => any) | undefined;
133
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
134
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
68
+ /**
69
+ * Request Example
70
+ *
71
+ * The core component for rendering a request example block,
72
+ * this component does not have much of its own state but operates on props and custom events
73
+ *
74
+ * @event scalar-update-selected-client - Emitted when the selected client changes
75
+ * @event scalar-update-selected-example - Emitted when the selected example changes
76
+ */
77
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<RequestExampleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RequestExampleProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, Readonly<{
78
+ header: () => unknown;
79
+ footer: () => unknown;
80
+ }> & {
81
+ header: () => unknown;
82
+ footer: () => unknown;
83
+ }>;
135
84
  export default _default;
136
85
  type __VLS_WithTemplateSlots<T, S> = T & {
137
86
  new (): {
@@ -1 +1 @@
1
- {"version":3,"file":"RequestExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/components/RequestExample.vue"],"names":[],"mappings":"AA4XA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAGrF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAA;AAClG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AACvG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AACtF,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iDAAiD,CAAA;AACxD,OAAO,EAA+B,KAAK,uBAAuB,EAAE,MAAM,KAAK,CAAA;AAiB/E,KAAK,KAAK,GAAG;IACX;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAA;IAC3C;;;;OAIG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACzC;;OAEG;IACH,cAAc,CAAC,EAAE,YAAY,CAAA;IAC7B;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;IACxC;;OAEG;IACH,MAAM,EAAE,cAAc,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IACvC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAA;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE;QACP,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAC7B,CAAA;CACF,CAAA;AA+ID,iBAAS,cAAc;WAuNT,OAAO,IAA6B;;gBA3UxC,MAAM,OAAO;gBACb,MAAM,OAAO;;gBADb,MAAM,OAAO;gBACb,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAmPM,GAAG,8CAE7B,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;EA0FvE;AA6BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"RequestExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/components/RequestExample.vue"],"names":[],"mappings":"AA2YA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAGrF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAA;AAClG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AACvG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AACtF,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iDAAiD,CAAA;AAmBxD,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAA;IAC3C;;;;OAIG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACzC;;OAEG;IACH,cAAc,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACzC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;IACxC;;OAEG;IACH,MAAM,EAAE,cAAc,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IACvC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAA;IAC5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,CAAA;AAED;;;;;;;;GAQG;;YAoBO,MAAM,OAAO;YACb,MAAM,OAAO;;YADb,MAAM,OAAO;YACb,MAAM,OAAO;;AApBvB,wBA+ZC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -9,7 +9,7 @@ import type { AvailableClients } from '@scalar/snippetz';
9
9
  *
10
10
  * @param options - Array of client option groups, each containing a label and array of client options
11
11
  * @param id - Optional client identifier to search for (e.g., 'js/fetch', 'python/requests')
12
- *
12
+
13
13
  * @returns The selected client option. If a specific ID is provided and found, returns that client.
14
14
  * If the ID is not found or not provided, returns the first available client option.
15
15
  *
@@ -1 +1 @@
1
- {"version":3,"file":"find-client.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/find-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AACrG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,UAAU,iBACP,iBAAiB,EAAE,aACtB,gBAAgB,CAAC,MAAM,CAAC,GAAG,SAAS,KAC9C,YAcF,CAAA"}
1
+ {"version":3,"file":"find-client.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/find-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AACrG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAIxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,UAAU,iBACP,iBAAiB,EAAE,aACtB,gBAAgB,CAAC,MAAM,CAAC,GAAG,SAAS,KAC9C,YAwBF,CAAA"}
@@ -1,3 +1,4 @@
1
+ import type { AvailableClients } from '@scalar/snippetz';
1
2
  /**
2
3
  * Event definitions for scalar blocks
3
4
  *
@@ -19,6 +20,14 @@ export type ApiReferenceEvents = {
19
20
  value: string;
20
21
  };
21
22
  };
23
+ /** Controls the selected client in our code example blocks */
24
+ 'scalar-update-selected-client': {
25
+ data: AvailableClients[number];
26
+ };
27
+ /** Controls the selected example key in our operation blocks + children */
28
+ 'scalar-update-selected-example': {
29
+ data: string;
30
+ };
22
31
  };
23
32
  export type ApiReferenceEvent = Prettify<keyof ApiReferenceEvents>;
24
33
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/v2/events/definitions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,uBAAuB,EAAE;QACvB,IAAI,EAAE;YACJ,KAAK,EAAE,OAAO,CAAA;SACf,CAAA;KACF,CAAA;IACD,yBAAyB,EAAE;QACzB,IAAI,EAAE;YACJ,KAAK,EAAE,OAAO,CAAA;SACf,CAAA;KACF,CAAA;IACD,+BAA+B,EAAE;QAC/B,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAA;SACd,CAAA;KACF,CAAA;CACF,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,kBAAkB,CAAC,CAAA;AAElE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,iBAAiB,EACzD,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,CAAC,EACR,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAKpC;AAED,8CAA8C;AAC9C,KAAK,QAAQ,CAAC,CAAC,IAAI;KAChB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,EAAE,CAAA"}
1
+ {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/v2/events/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,uBAAuB,EAAE;QACvB,IAAI,EAAE;YACJ,KAAK,EAAE,OAAO,CAAA;SACf,CAAA;KACF,CAAA;IACD,yBAAyB,EAAE;QACzB,IAAI,EAAE;YACJ,KAAK,EAAE,OAAO,CAAA;SACf,CAAA;KACF,CAAA;IACD,+BAA+B,EAAE;QAC/B,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAA;SACd,CAAA;KACF,CAAA;IACD,8DAA8D;IAC9D,+BAA+B,EAAE;QAC/B,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;KAC/B,CAAA;IACD,2EAA2E;IAC3E,gCAAgC,EAAE;QAChC,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;CACF,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,kBAAkB,CAAC,CAAA;AAElE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,iBAAiB,EACzD,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,CAAC,EACR,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAKpC;AAED,8CAA8C;AAC9C,KAAK,QAAQ,CAAC,CAAC,IAAI;KAChB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,EAAE,CAAA"}
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "vue",
21
21
  "vue3"
22
22
  ],
23
- "version": "1.32.4",
23
+ "version": "1.32.6",
24
24
  "engines": {
25
25
  "node": ">=20"
26
26
  },
@@ -54,20 +54,21 @@
54
54
  "nanoid": "5.1.5",
55
55
  "vue": "^3.5.12",
56
56
  "zod": "3.24.1",
57
- "@scalar/api-client": "2.5.15",
58
- "@scalar/code-highlight": "0.1.5",
59
- "@scalar/oas-utils": "0.4.11",
57
+ "@scalar/components": "0.14.17",
58
+ "@scalar/api-client": "2.5.16",
60
59
  "@scalar/helpers": "0.0.6",
60
+ "@scalar/icons": "0.4.6",
61
+ "@scalar/oas-utils": "0.4.12",
62
+ "@scalar/object-utils": "1.2.2",
61
63
  "@scalar/openapi-parser": "0.18.1",
62
- "@scalar/components": "0.14.16",
64
+ "@scalar/themes": "0.13.9",
65
+ "@scalar/snippetz": "0.4.1",
66
+ "@scalar/types": "0.2.8",
63
67
  "@scalar/openapi-types": "0.3.5",
64
- "@scalar/icons": "0.4.6",
65
- "@scalar/snippetz": "0.4.0",
66
- "@scalar/themes": "0.13.8",
67
- "@scalar/types": "0.2.7",
68
+ "@scalar/code-highlight": "0.1.6",
68
69
  "@scalar/use-hooks": "0.2.4",
69
70
  "@scalar/use-toasts": "0.8.0",
70
- "@scalar/workspace-store": "0.8.0"
71
+ "@scalar/workspace-store": "0.9.0"
71
72
  },
72
73
  "devDependencies": {
73
74
  "@tailwindcss/vite": "^4.1.7",