@scalar/api-reference 1.32.5 → 1.32.7
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/CHANGELOG.md +50 -0
- package/dist/browser/standalone.js +9924 -9851
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +8 -8
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +28 -26
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.vue2.js +97 -156
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.d.ts +7 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue2.js +25 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +73 -90
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +21 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +92 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue2.js +4 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -2
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +54 -55
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +0 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +81 -97
- package/dist/components/Content/Schema/helpers/{formatExample.d.ts → format-example.d.ts} +1 -1
- package/dist/components/Content/Schema/helpers/format-example.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/is-type-object.d.ts +3 -0
- package/dist/components/Content/Schema/helpers/is-type-object.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/is-type-object.js +17 -0
- package/dist/components/Content/Schema/helpers/{optimizeValueForDisplay.d.ts → optimize-value-for-display.d.ts} +1 -1
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts.map +1 -0
- package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/OperationsListItem.vue.js +2 -2
- package/dist/components/Content/Tag/OperationsListItem.vue2.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +4 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +8 -8
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +4 -2
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +30 -30
- package/dist/features/api-client-modal/useApiClient.d.ts +84 -4
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/download-link/DownloadLink.vue.d.ts.map +1 -1
- package/dist/features/download-link/DownloadLink.vue.js +1 -1
- package/dist/features/example-request/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/example-request/ExampleRequest.vue.js +1 -1
- package/dist/features/example-request/ExampleRequest.vue2.js +126 -124
- package/dist/features/example-responses/ExampleResponse.vue.js +2 -2
- package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
- package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue.js +2 -2
- package/dist/features/sidebar/components/SidebarElement.vue2.js +16 -15
- package/dist/helpers/convert-security-scheme.d.ts +9 -0
- package/dist/helpers/convert-security-scheme.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/libs/openapi.d.ts +0 -13
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +49 -63
- package/dist/stores/useHttpClientStore.js +20 -20
- package/dist/style.css +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +84 -75
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts +19 -0
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +21 -72
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts +4 -2
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +5 -0
- package/dist/v2/blocks/scalar-request-example-block/index.d.ts +1 -0
- package/dist/v2/blocks/scalar-request-example-block/index.d.ts.map +1 -1
- package/dist/v2/events/definitions.d.ts +13 -4
- package/dist/v2/events/definitions.d.ts.map +1 -1
- package/dist/v2/hooks/useStore.d.ts +9 -0
- package/dist/v2/hooks/useStore.d.ts.map +1 -0
- package/package.json +13 -12
- package/dist/components/Content/Schema/helpers/formatExample.d.ts.map +0 -1
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +0 -1
- /package/dist/components/Content/Schema/helpers/{formatExample.js → format-example.js} +0 -0
- /package/dist/components/Content/Schema/helpers/{optimizeValueForDisplay.js → optimize-value-for-display.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReferenceWorkspace.vue.d.ts","sourceRoot":"","sources":["../../src/v2/ApiReferenceWorkspace.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiReferenceWorkspace.vue.d.ts","sourceRoot":"","sources":["../../src/v2/ApiReferenceWorkspace.vue"],"names":[],"mappings":"AAqUA,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAA;AA0BpE,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,120 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import G from "
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
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 { isClient as X } from "./blocks/scalar-request-example-block/helpers/find-client.js";
|
|
10
|
+
import { useMultipleDocuments as Z } from "../features/multiple-documents/useMultipleDocuments.js";
|
|
11
|
+
import { onCustomEvent as v } from "./events/listeners.js";
|
|
12
|
+
import ee from "../features/multiple-documents/DocumentSelector.vue.js";
|
|
13
|
+
const fe = /* @__PURE__ */ V({
|
|
12
14
|
__name: "ApiReferenceWorkspace",
|
|
13
15
|
props: {
|
|
14
16
|
configuration: {},
|
|
15
17
|
getWorkspaceStore: { type: Function }
|
|
16
18
|
},
|
|
17
19
|
setup(M) {
|
|
18
|
-
const
|
|
19
|
-
availableDocuments:
|
|
20
|
-
selectedConfiguration:
|
|
21
|
-
selectedDocumentIndex:
|
|
22
|
-
isIntersectionEnabled:
|
|
20
|
+
const k = M, {
|
|
21
|
+
availableDocuments: l,
|
|
22
|
+
selectedConfiguration: a,
|
|
23
|
+
selectedDocumentIndex: s,
|
|
24
|
+
isIntersectionEnabled: g,
|
|
23
25
|
hash: y,
|
|
24
|
-
hashPrefix:
|
|
25
|
-
} =
|
|
26
|
-
configuration:
|
|
27
|
-
isIntersectionEnabled:
|
|
28
|
-
hash:
|
|
29
|
-
hashPrefix:
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
hashPrefix: T
|
|
27
|
+
} = Z({
|
|
28
|
+
configuration: b(k, "configuration"),
|
|
29
|
+
isIntersectionEnabled: f(!1),
|
|
30
|
+
hash: f(""),
|
|
31
|
+
hashPrefix: f("")
|
|
32
|
+
}), L = (e, t) => fetch(
|
|
33
|
+
K(a.value.proxyUrl, e.toString()),
|
|
34
|
+
t
|
|
33
35
|
);
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
36
|
+
_(Q, { isIntersectionEnabled: g, hash: y, hashPrefix: T });
|
|
37
|
+
const i = w(null), o = k.getWorkspaceStore(), c = l, u = (e) => {
|
|
38
|
+
if (o.workspace.documents[e.slug ?? "default"] === void 0) {
|
|
37
39
|
if (e.content) {
|
|
38
|
-
const
|
|
39
|
-
return
|
|
40
|
+
const t = typeof e.content == "string" ? J(e.content) : e.content;
|
|
41
|
+
return o.addDocumentSync({
|
|
40
42
|
name: e.slug ?? "default",
|
|
41
|
-
document: typeof
|
|
43
|
+
document: typeof t == "function" ? t() : t
|
|
42
44
|
});
|
|
43
45
|
}
|
|
44
46
|
if (e.url)
|
|
45
|
-
return
|
|
47
|
+
return o.addDocument({
|
|
46
48
|
name: e.slug ?? "default",
|
|
47
49
|
url: e.url,
|
|
48
|
-
fetch:
|
|
50
|
+
fetch: L
|
|
49
51
|
});
|
|
50
52
|
}
|
|
51
53
|
};
|
|
52
|
-
|
|
53
|
-
e.content &&
|
|
54
|
-
}),
|
|
55
|
-
|
|
56
|
-
e.url &&
|
|
54
|
+
c.value.forEach((e) => {
|
|
55
|
+
e.content && u(e);
|
|
56
|
+
}), $(() => {
|
|
57
|
+
c.value.forEach((e) => {
|
|
58
|
+
e.url && u(e);
|
|
57
59
|
});
|
|
58
|
-
}),
|
|
59
|
-
|
|
60
|
-
e.url &&
|
|
60
|
+
}), C(() => {
|
|
61
|
+
c.value.forEach((e) => {
|
|
62
|
+
e.url && u(e);
|
|
61
63
|
});
|
|
62
|
-
}),
|
|
63
|
-
|
|
64
|
-
}),
|
|
65
|
-
|
|
64
|
+
}), v(i, "scalar-update-dark-mode", (e) => {
|
|
65
|
+
o.update("x-scalar-dark-mode", e.detail.value);
|
|
66
|
+
}), v(i, "scalar-update-active-document", (e) => {
|
|
67
|
+
o.update("x-scalar-active-document", e.detail.value);
|
|
68
|
+
}), v(i, "scalar-update-selected-client", (e) => {
|
|
69
|
+
o.update("x-scalar-default-client", e.detail), x().setItem(h.SELECTED_CLIENT, e.detail);
|
|
70
|
+
}), C(() => {
|
|
71
|
+
const e = x().getItem(
|
|
72
|
+
h.SELECTED_CLIENT
|
|
73
|
+
);
|
|
74
|
+
X(e) && o.update("x-scalar-default-client", e);
|
|
66
75
|
});
|
|
67
|
-
const { toggleColorMode:
|
|
68
|
-
initialColorMode:
|
|
69
|
-
overrideColorMode:
|
|
76
|
+
const { toggleColorMode: I, isDarkMode: N } = q({
|
|
77
|
+
initialColorMode: a.value.darkMode ? "dark" : void 0,
|
|
78
|
+
overrideColorMode: a.value.forceDarkModeState
|
|
70
79
|
});
|
|
71
80
|
d(
|
|
72
|
-
() =>
|
|
73
|
-
(e) =>
|
|
81
|
+
() => a.value.darkMode,
|
|
82
|
+
(e) => o.update("x-scalar-dark-mode", !!e)
|
|
74
83
|
), d(
|
|
75
|
-
() =>
|
|
76
|
-
(e) =>
|
|
84
|
+
() => N.value,
|
|
85
|
+
(e) => o.update("x-scalar-dark-mode", e),
|
|
77
86
|
{ immediate: !0 }
|
|
78
87
|
), d(
|
|
79
|
-
() =>
|
|
88
|
+
() => s.value,
|
|
80
89
|
(e) => {
|
|
81
|
-
var
|
|
82
|
-
return
|
|
90
|
+
var t;
|
|
91
|
+
return o.update(
|
|
83
92
|
"x-scalar-active-document",
|
|
84
|
-
(
|
|
93
|
+
(t = l.value[e]) == null ? void 0 : t.slug
|
|
85
94
|
);
|
|
86
95
|
},
|
|
87
96
|
{ immediate: !0 }
|
|
88
97
|
), d(
|
|
89
|
-
() =>
|
|
98
|
+
() => l.value,
|
|
90
99
|
(e) => {
|
|
91
|
-
e.forEach(
|
|
100
|
+
e.forEach(u);
|
|
92
101
|
}
|
|
93
|
-
),
|
|
94
|
-
const
|
|
95
|
-
return
|
|
96
|
-
var
|
|
97
|
-
return D(),
|
|
98
|
-
(
|
|
102
|
+
), a.value.metaData && z(a.value.metaData);
|
|
103
|
+
const R = A(() => a.value.favicon);
|
|
104
|
+
return G(R), (e, t) => {
|
|
105
|
+
var E;
|
|
106
|
+
return D(), B(F, null, [
|
|
107
|
+
(E = r(a)) != null && E.customCss ? (D(), P(W("style"), { key: 0 }, {
|
|
99
108
|
default: n(() => [
|
|
100
|
-
|
|
109
|
+
Y(O(r(a).customCss), 1)
|
|
101
110
|
]),
|
|
102
111
|
_: 1
|
|
103
112
|
})) : U("", !0),
|
|
104
|
-
|
|
105
|
-
configuration: r(
|
|
106
|
-
isDark: !!r(
|
|
107
|
-
onToggleDarkMode:
|
|
108
|
-
onUpdateContent:
|
|
113
|
+
S(H, {
|
|
114
|
+
configuration: r(a),
|
|
115
|
+
isDark: !!r(o).workspace["x-scalar-dark-mode"],
|
|
116
|
+
onToggleDarkMode: t[1] || (t[1] = () => r(I)()),
|
|
117
|
+
onUpdateContent: t[2] || (t[2] = (m) => e.$emit("updateContent", m))
|
|
109
118
|
}, {
|
|
110
119
|
footer: n(() => [
|
|
111
120
|
p(e.$slots, "footer")
|
|
@@ -114,10 +123,10 @@ const se = /* @__PURE__ */ w({
|
|
|
114
123
|
p(e.$slots, "footer")
|
|
115
124
|
]),
|
|
116
125
|
"document-selector": n(() => [
|
|
117
|
-
|
|
118
|
-
modelValue: r(
|
|
119
|
-
"onUpdate:modelValue":
|
|
120
|
-
options: r(
|
|
126
|
+
S(r(ee), {
|
|
127
|
+
modelValue: r(s),
|
|
128
|
+
"onUpdate:modelValue": t[0] || (t[0] = (m) => j(s) ? s.value = m : null),
|
|
129
|
+
options: r(l)
|
|
121
130
|
}, null, 8, ["modelValue", "options"])
|
|
122
131
|
]),
|
|
123
132
|
"sidebar-start": n(() => [
|
|
@@ -130,5 +139,5 @@ const se = /* @__PURE__ */ w({
|
|
|
130
139
|
}
|
|
131
140
|
});
|
|
132
141
|
export {
|
|
133
|
-
|
|
142
|
+
fe as default
|
|
134
143
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ScalarComboboxOption } from '@scalar/components';
|
|
2
|
+
import type { ExampleObject } from '@scalar/workspace-store/schemas/v3.1/strict/example';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
examples: Record<string, ExampleObject>;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = {
|
|
7
|
+
modelValue: string;
|
|
8
|
+
} & __VLS_Props;
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
10
|
+
getLabel: (key: string | null) => string;
|
|
11
|
+
selectedExample: import("vue").ComputedRef<ScalarComboboxOption>;
|
|
12
|
+
selectedExampleKey: import("vue").ModelRef<string, string, string, string>;
|
|
13
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (value: string) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
export default _default;
|
|
19
|
+
//# 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":"AA2EA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAA;AAKxF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;CACxC,CAAC;AAuDF,KAAK,iBAAiB,GAAG;IACzB,UAAU,EAAE,MAAM,CAAC;CAClB,GAAG,WAAW,CAAC;;oBAnCO,MAAM,GAAG,IAAI;;;;;;;;AA4IpC,wBASG"}
|
|
@@ -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
|
-
|
|
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
|
-
*
|
|
63
|
+
* Whether to hide the client selector
|
|
64
|
+
* @default false
|
|
65
65
|
*/
|
|
66
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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":"
|
|
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"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ClientOption, ClientOptionGroup } from '../../../../v2/blocks/scalar-request-example-block/types';
|
|
2
|
-
import type
|
|
2
|
+
import { type AvailableClients } from '@scalar/snippetz';
|
|
3
|
+
/** Type guard to check if a string is a valid client id */
|
|
4
|
+
export declare const isClient: (id: any) => id is AvailableClients[number];
|
|
3
5
|
/**
|
|
4
6
|
* Finds and returns the appropriate client option from a list of client option groups.
|
|
5
7
|
*
|
|
@@ -9,7 +11,7 @@ import type { AvailableClients } from '@scalar/snippetz';
|
|
|
9
11
|
*
|
|
10
12
|
* @param options - Array of client option groups, each containing a label and array of client options
|
|
11
13
|
* @param id - Optional client identifier to search for (e.g., 'js/fetch', 'python/requests')
|
|
12
|
-
|
|
14
|
+
|
|
13
15
|
* @returns The selected client option. If a specific ID is provided and found, returns that client.
|
|
14
16
|
* If the ID is not found or not provided, returns the first available client option.
|
|
15
17
|
*
|
|
@@ -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,
|
|
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,EAAqB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAI3E,2DAA2D;AAC3D,eAAO,MAAM,QAAQ,OAAQ,GAAG,KAAG,EAAE,IAAI,gBAAgB,CAAC,MAAM,CAAmC,CAAA;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,UAAU,iBACP,iBAAiB,EAAE,aACtB,gBAAgB,CAAC,MAAM,CAAC,GAAG,SAAS,KAC9C,YAwBF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/scalar-request-example-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/scalar-request-example-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AvailableClients } from '@scalar/snippetz';
|
|
1
2
|
/**
|
|
2
3
|
* Event definitions for scalar blocks
|
|
3
4
|
*
|
|
@@ -5,20 +6,28 @@
|
|
|
5
6
|
*/
|
|
6
7
|
export type ApiReferenceEvents = {
|
|
7
8
|
'scalar-update-sidebar': {
|
|
8
|
-
|
|
9
|
+
detail: {
|
|
9
10
|
value: boolean;
|
|
10
11
|
};
|
|
11
12
|
};
|
|
12
13
|
'scalar-update-dark-mode': {
|
|
13
|
-
|
|
14
|
+
detail: {
|
|
14
15
|
value: boolean;
|
|
15
16
|
};
|
|
16
17
|
};
|
|
17
18
|
'scalar-update-active-document': {
|
|
18
|
-
|
|
19
|
+
detail: {
|
|
19
20
|
value: string;
|
|
20
21
|
};
|
|
21
22
|
};
|
|
23
|
+
/** Controls the selected client in our code example blocks */
|
|
24
|
+
'scalar-update-selected-client': {
|
|
25
|
+
detail: AvailableClients[number];
|
|
26
|
+
};
|
|
27
|
+
/** Controls the selected example key in our operation blocks + children */
|
|
28
|
+
'scalar-update-selected-example': {
|
|
29
|
+
detail: string;
|
|
30
|
+
};
|
|
22
31
|
};
|
|
23
32
|
export type ApiReferenceEvent = Prettify<keyof ApiReferenceEvents>;
|
|
24
33
|
/**
|
|
@@ -26,7 +35,7 @@ export type ApiReferenceEvent = Prettify<keyof ApiReferenceEvents>;
|
|
|
26
35
|
*
|
|
27
36
|
* Event can include typed payloads using the `data` property. A target for the dispatch must be provided.
|
|
28
37
|
*/
|
|
29
|
-
export declare function emitCustomEvent<E extends ApiReferenceEvent>(target: HTMLElement, event: E,
|
|
38
|
+
export declare function emitCustomEvent<E extends ApiReferenceEvent>(target: HTMLElement, event: E, detail: ApiReferenceEvents[E]['detail']): void;
|
|
30
39
|
/** Type helper for expanding complex types */
|
|
31
40
|
type Prettify<T> = {
|
|
32
41
|
[K in keyof T]: T[K];
|
|
@@ -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,
|
|
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,MAAM,EAAE;YACN,KAAK,EAAE,OAAO,CAAA;SACf,CAAA;KACF,CAAA;IACD,yBAAyB,EAAE;QACzB,MAAM,EAAE;YACN,KAAK,EAAE,OAAO,CAAA;SACf,CAAA;KACF,CAAA;IACD,+BAA+B,EAAE;QAC/B,MAAM,EAAE;YACN,KAAK,EAAE,MAAM,CAAA;SACd,CAAA;KACF,CAAA;IACD,8DAA8D;IAC9D,+BAA+B,EAAE;QAC/B,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;KACjC,CAAA;IACD,2EAA2E;IAC3E,gCAAgC,EAAE;QAChC,MAAM,EAAE,MAAM,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,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAKxC;AAED,8CAA8C;AAC9C,KAAK,QAAQ,CAAC,CAAC,IAAI;KAChB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,EAAE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for accessing the new workspace store
|
|
4
|
+
*
|
|
5
|
+
* When called with a store it provides that store
|
|
6
|
+
* When called without parameters, it returns the injected store
|
|
7
|
+
*/
|
|
8
|
+
export declare const useStore: (store?: WorkspaceStore) => WorkspaceStore;
|
|
9
|
+
//# sourceMappingURL=useStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStore.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/useStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAKpE;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,WAAY,cAAc,mBAe9C,CAAA"}
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"vue",
|
|
21
21
|
"vue3"
|
|
22
22
|
],
|
|
23
|
-
"version": "1.32.
|
|
23
|
+
"version": "1.32.7",
|
|
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.
|
|
58
|
-
"@scalar/
|
|
59
|
-
"@scalar/code-highlight": "0.1.5",
|
|
57
|
+
"@scalar/api-client": "2.5.17",
|
|
58
|
+
"@scalar/code-highlight": "0.1.7",
|
|
60
59
|
"@scalar/helpers": "0.0.6",
|
|
60
|
+
"@scalar/components": "0.14.18",
|
|
61
|
+
"@scalar/oas-utils": "0.4.13",
|
|
62
|
+
"@scalar/object-utils": "1.2.2",
|
|
61
63
|
"@scalar/icons": "0.4.6",
|
|
62
64
|
"@scalar/openapi-parser": "0.18.1",
|
|
63
|
-
"@scalar/oas-utils": "0.4.11",
|
|
64
65
|
"@scalar/openapi-types": "0.3.5",
|
|
65
|
-
"@scalar/
|
|
66
|
-
"@scalar/
|
|
67
|
-
"@scalar/
|
|
66
|
+
"@scalar/snippetz": "0.4.1",
|
|
67
|
+
"@scalar/themes": "0.13.9",
|
|
68
|
+
"@scalar/types": "0.2.8",
|
|
68
69
|
"@scalar/use-hooks": "0.2.4",
|
|
69
|
-
"@scalar/
|
|
70
|
-
"@scalar/
|
|
70
|
+
"@scalar/use-toasts": "0.8.0",
|
|
71
|
+
"@scalar/workspace-store": "0.10.0"
|
|
71
72
|
},
|
|
72
73
|
"devDependencies": {
|
|
73
74
|
"@tailwindcss/vite": "^4.1.7",
|
|
@@ -85,8 +86,8 @@
|
|
|
85
86
|
"vite-plugin-css-injected-by-js": "^3.4.0",
|
|
86
87
|
"vitest": "^1.6.1",
|
|
87
88
|
"@scalar/build-tooling": "0.2.4",
|
|
88
|
-
"@scalar/
|
|
89
|
-
"@scalar/
|
|
89
|
+
"@scalar/react-renderer": "0.2.1",
|
|
90
|
+
"@scalar/galaxy": "0.5.3"
|
|
90
91
|
},
|
|
91
92
|
"scripts": {
|
|
92
93
|
"build": "pnpm build:default && pnpm build:standalone && pnpm types:build && tsc-alias -p tsconfig.build.json",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatExample.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/formatExample.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAkD/D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"optimizeValueForDisplay.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/optimizeValueForDisplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAE9D,eAAO,MAAM,YAAY,EAAE,kBAAkB,EAAuC,CAAA;AAEpF;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAuEzG"}
|
|
File without changes
|
|
File without changes
|