@scalar/api-reference 1.33.0 → 1.34.0
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 +29 -0
- package/dist/browser/standalone.js +13260 -13196
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Anchor/WithBreadcrumb.vue.d.ts +24 -0
- package/dist/components/Anchor/WithBreadcrumb.vue.d.ts.map +1 -0
- package/dist/components/Anchor/WithBreadcrumb.vue.js +4 -0
- package/dist/components/Anchor/WithBreadcrumb.vue2.js +46 -0
- package/dist/components/Anchor/index.d.ts +1 -0
- package/dist/components/Anchor/index.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +184 -201
- package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue2.js +1 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js +34 -32
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +33 -29
- package/dist/components/Content/Operations/get-current-index.d.ts +4 -0
- package/dist/components/Content/Operations/get-current-index.d.ts.map +1 -0
- package/dist/components/Content/Operations/get-current-index.js +16 -0
- package/dist/components/Content/Schema/Schema.preview.d.ts +28 -0
- package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +2 -0
- 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 +164 -157
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +1 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +58 -53
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +1 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +52 -40
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -0
- 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 +100 -87
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +3 -3
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +4 -1
- package/dist/components/Lazy/Lazy.vue.d.ts +1 -0
- package/dist/components/Lazy/Lazy.vue.d.ts.map +1 -1
- package/dist/components/Lazy/Lazy.vue2.js +12 -11
- package/dist/components/Lazy/lazyBus.d.ts +5 -3
- package/dist/components/Lazy/lazyBus.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.js +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts +4 -4
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +1 -0
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +49 -43
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +1 -0
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.js +4 -3
- package/dist/features/Operation/components/ParameterHeaders.vue.d.ts +1 -0
- package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterHeaders.vue.js +2 -2
- package/dist/features/Operation/components/ParameterHeaders.vue2.js +28 -26
- package/dist/features/Operation/components/ParameterList.vue.d.ts +1 -0
- package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterList.vue.js +2 -2
- package/dist/features/Operation/components/ParameterList.vue2.js +17 -15
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +1 -0
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue2.js +17 -16
- package/dist/features/Operation/components/RequestBody.vue.d.ts +2 -2
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +2 -2
- package/dist/features/Operation/components/RequestBody.vue2.js +47 -39
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +1 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +3 -3
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +12 -11
- package/dist/features/Operation/components/callbacks/Callback.vue3.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +63 -61
- package/dist/features/Search/{SearchButton.vue.d.ts → components/SearchButton.vue.d.ts} +0 -2
- package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -0
- package/dist/features/Search/components/SearchButton.vue.js +65 -0
- package/dist/features/Search/{SearchModal.vue.d.ts → components/SearchModal.vue.d.ts} +0 -2
- package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -0
- package/dist/features/Search/components/SearchModal.vue.js +7 -0
- package/dist/features/Search/components/SearchModal.vue2.js +199 -0
- package/dist/features/Search/helpers/create-fuse-instance.d.ts +9 -0
- package/dist/features/Search/helpers/create-fuse-instance.d.ts.map +1 -0
- package/dist/features/Search/helpers/create-fuse-instance.js +46 -0
- package/dist/features/Search/helpers/create-search-index.d.ts +7 -0
- package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -0
- package/dist/features/Search/helpers/create-search-index.js +109 -0
- package/dist/features/Search/hooks/useSearchIndex.d.ts +14 -0
- package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -0
- package/dist/features/Search/hooks/useSearchIndex.js +46 -0
- package/dist/features/Search/index.d.ts +2 -2
- package/dist/features/Search/index.d.ts.map +1 -1
- package/dist/features/Search/types.d.ts +15 -0
- package/dist/features/Search/types.d.ts.map +1 -0
- package/dist/features/api-client-modal/useApiClient.d.ts +14 -14
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +3 -1
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -1
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -1
- package/dist/features/traverse-schema/helpers/traverse-schemas.js +18 -18
- package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +1 -1
- package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +1 -1
- package/dist/features/traverse-schema/types.d.ts +10 -6
- package/dist/features/traverse-schema/types.d.ts.map +1 -1
- package/dist/helpers/test-utils.d.ts +9 -0
- package/dist/helpers/test-utils.d.ts.map +1 -1
- package/dist/hooks/useNavState.d.ts +4 -1
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -19
- package/dist/libs/openapi.d.ts +11 -8
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +34 -55
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +120 -111
- package/dist/v2/helpers/get-document-name.d.ts +13 -0
- package/dist/v2/helpers/get-document-name.d.ts.map +1 -0
- package/dist/v2/helpers/get-document-name.js +15 -0
- package/dist/v2/helpers/normalize-content.d.ts +3 -0
- package/dist/v2/helpers/normalize-content.d.ts.map +1 -0
- package/dist/v2/helpers/normalize-content.js +8 -0
- package/package.json +14 -8
- package/dist/features/Search/SearchButton.vue.d.ts.map +0 -1
- package/dist/features/Search/SearchButton.vue.js +0 -66
- package/dist/features/Search/SearchModal.vue.d.ts.map +0 -1
- package/dist/features/Search/SearchModal.vue.js +0 -7
- package/dist/features/Search/SearchModal.vue2.js +0 -207
- package/dist/features/Search/useSearchIndex.d.ts +0 -32
- package/dist/features/Search/useSearchIndex.d.ts.map +0 -1
- package/dist/features/Search/useSearchIndex.js +0 -170
- package/dist/helpers/parse.d.ts +0 -10
- package/dist/helpers/parse.d.ts.map +0 -1
- package/dist/helpers/parse.js +0 -81
- /package/dist/features/Search/{SearchButton.vue2.js → components/SearchButton.vue2.js} +0 -0
- /package/dist/features/Search/{SearchModal.vue3.js → components/SearchModal.vue3.js} +0 -0
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnyApiReferenceConfiguration, ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
2
|
-
import type { OpenAPIV3_1
|
|
2
|
+
import type { OpenAPIV3_1 } from '@scalar/types/legacy';
|
|
3
3
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
4
4
|
export type { ApiReferenceConfiguration };
|
|
5
5
|
export type ReferenceProps = {
|
|
@@ -29,10 +29,6 @@ export type ReferenceLayoutProps = {
|
|
|
29
29
|
*/
|
|
30
30
|
originalDocument?: string;
|
|
31
31
|
isDark: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* @deprecated We can't use this anymore. Use `dereferencedDocument` instead.
|
|
34
|
-
*/
|
|
35
|
-
parsedSpec?: Spec;
|
|
36
32
|
/**
|
|
37
33
|
* @deprecated Use `originalDocument` instead.
|
|
38
34
|
*/
|
|
@@ -70,7 +66,6 @@ export type DocumentSelectorSlot = {
|
|
|
70
66
|
'document-selector': any;
|
|
71
67
|
};
|
|
72
68
|
export type ReferenceSlotProps = {
|
|
73
|
-
spec: Spec;
|
|
74
69
|
breadcrumb: string;
|
|
75
70
|
};
|
|
76
71
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC1G,OAAO,KAAK,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC1G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,YAAY,EAAE,yBAAyB,EAAE,CAAA;AAEzC,MAAM,MAAM,cAAc,GAAG;IAC3B,aAAa,CAAC,EAAE,4BAA4B,CAAA;CAC7C,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAA;IACjD;;;;;;;;;;;;OAYG;IACH,oBAAoB,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAA;IAC3C;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,MAAM,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,KAAK,EAAE,cAAc,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,eAAe,CAAA;AAEjE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;QACf,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,UAAU,CAAC,EAAE,iBAAiB,CAAA;KAC/B,CAAA;CACF,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;QACnB,UAAU,EAAE,iBAAiB,CAAA;KAC9B,CAAA;CACF,CAAA;AACD,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,eAAe,GACf,aAAa,GACb,eAAe,GACf,aAAa,CAAA;AAEjB,MAAM,MAAM,oBAAoB,GAAG;KAChC,CAAC,IAAI,mBAAmB,GAAG,CAAC,KAAK,EAAE,kBAAkB,KAAK,GAAG;CAC/D,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,mBAAmB,EAAE,GAAG,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA"}
|
|
@@ -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":"AAmVA,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAA;AA2BpE,KAAK,WAAW,GAAG;IACjB,aAAa,CAAC,EAAE,4BAA4B,CAAA;IAC5C,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AA+NF,iBAAS,cAAc;WA8GT,OAAO,IAA6B;;wBAXrB,GAAG;wBACH,GAAG;iCACM,GAAG;;;;;;EAcxC;AAgBD,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,153 +1,162 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { safeLocalStorage as x, REFERENCE_LS_KEYS as
|
|
3
|
-
import { makeUrlAbsolute as
|
|
4
|
-
import {
|
|
5
|
-
import { useColorMode as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
1
|
+
import { defineComponent as R, ref as c, toRef as _, provide as $, useTemplateRef as w, onBeforeMount as V, watch as u, computed as A, createElementBlock as B, openBlock as D, createBlock as P, createCommentVNode as U, createVNode as E, unref as n, resolveDynamicComponent as K, withCtx as s, createTextVNode as F, toDisplayString as O, renderSlot as p, isRef as Y } from "vue";
|
|
2
|
+
import { safeLocalStorage as x, REFERENCE_LS_KEYS as g } from "@scalar/helpers/object/local-storage";
|
|
3
|
+
import { makeUrlAbsolute as z } from "@scalar/helpers/url/make-url-absolute";
|
|
4
|
+
import { redirectToProxy as H } from "@scalar/oas-utils/helpers";
|
|
5
|
+
import { useColorMode as W } from "@scalar/use-hooks/useColorMode";
|
|
6
|
+
import { deepClone as j } from "@scalar/workspace-store/helpers/general";
|
|
7
|
+
import { useSeoMeta as q } from "@unhead/vue";
|
|
8
|
+
import { useFavicon as G } from "@vueuse/core";
|
|
9
|
+
import J from "../components/ApiReferenceLayout.vue.js";
|
|
10
|
+
import { NAV_STATE_SYMBOL as Q } from "../hooks/useNavState.js";
|
|
11
|
+
import { isClient as M } from "./blocks/scalar-request-example-block/helpers/find-client.js";
|
|
12
|
+
import { getDocumentName as X } from "./helpers/get-document-name.js";
|
|
13
|
+
import { normalizeContent as Z } from "./helpers/normalize-content.js";
|
|
11
14
|
import { useMultipleDocuments as ee } from "../features/multiple-documents/useMultipleDocuments.js";
|
|
12
|
-
import { onCustomEvent as
|
|
15
|
+
import { onCustomEvent as f } from "./events/listeners.js";
|
|
13
16
|
import te from "../features/multiple-documents/DocumentSelector.vue.js";
|
|
14
|
-
const
|
|
17
|
+
const De = /* @__PURE__ */ R({
|
|
15
18
|
__name: "ApiReferenceWorkspace",
|
|
16
19
|
props: {
|
|
17
20
|
configuration: {},
|
|
18
21
|
store: {}
|
|
19
22
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
availableDocuments:
|
|
23
|
-
selectedConfiguration:
|
|
23
|
+
setup(y) {
|
|
24
|
+
const v = y, {
|
|
25
|
+
availableDocuments: C,
|
|
26
|
+
selectedConfiguration: o,
|
|
24
27
|
selectedDocumentIndex: i,
|
|
25
|
-
isIntersectionEnabled:
|
|
26
|
-
hash:
|
|
28
|
+
isIntersectionEnabled: m,
|
|
29
|
+
hash: S,
|
|
27
30
|
hashPrefix: T
|
|
28
31
|
} = ee({
|
|
29
|
-
configuration: _(
|
|
30
|
-
isIntersectionEnabled:
|
|
31
|
-
hash:
|
|
32
|
-
hashPrefix:
|
|
33
|
-
}),
|
|
34
|
-
|
|
32
|
+
configuration: _(v, "configuration"),
|
|
33
|
+
isIntersectionEnabled: c(!1),
|
|
34
|
+
hash: c(""),
|
|
35
|
+
hashPrefix: c("")
|
|
36
|
+
}), h = (e, t) => fetch(
|
|
37
|
+
H(o.value.proxyUrl, e.toString()),
|
|
35
38
|
t
|
|
36
39
|
);
|
|
37
|
-
$(
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
if (o.workspace.documents[e.slug ?? "default"] === void 0) {
|
|
41
|
-
if (e.content) {
|
|
42
|
-
const n = typeof e.content == "string" ? W(e.content) : e.content;
|
|
43
|
-
return o.addDocumentSync({
|
|
44
|
-
name: e.slug ?? "default",
|
|
45
|
-
document: typeof n == "function" ? n() : n
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
if (e.url)
|
|
49
|
-
return o.addDocument({
|
|
50
|
-
name: e.slug ?? "default",
|
|
51
|
-
url: J(e.url, {
|
|
52
|
-
basePath: (t = a.value.pathRouting) == null ? void 0 : t.basePath
|
|
53
|
-
}),
|
|
54
|
-
fetch: b
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
f.value.forEach((e) => {
|
|
59
|
-
e.content && m(e);
|
|
60
|
-
}), V(() => {
|
|
61
|
-
f.value.forEach((e) => {
|
|
62
|
-
e.url && m(e);
|
|
63
|
-
});
|
|
64
|
-
}), A(() => {
|
|
40
|
+
$(Q, { isIntersectionEnabled: m, hash: S, hashPrefix: T });
|
|
41
|
+
const d = w("root"), a = v.store;
|
|
42
|
+
V(() => {
|
|
65
43
|
const e = x().getItem(
|
|
66
|
-
|
|
44
|
+
g.SELECTED_CLIENT
|
|
67
45
|
);
|
|
68
|
-
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
|
|
46
|
+
M(e) && !a.workspace["x-scalar-default-client"] && a.update("x-scalar-default-client", e);
|
|
47
|
+
});
|
|
48
|
+
const k = async (e) => {
|
|
49
|
+
var l;
|
|
50
|
+
const t = Z(e.content), r = X({
|
|
51
|
+
name: e.slug || e.title,
|
|
52
|
+
url: e.url,
|
|
53
|
+
document: t
|
|
72
54
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
55
|
+
if (a.workspace.documents[r]) {
|
|
56
|
+
if (t) {
|
|
57
|
+
m.value = !1;
|
|
58
|
+
const N = j(t);
|
|
59
|
+
a.replaceDocument(r, N), a.update("x-scalar-active-document", r), setTimeout(() => {
|
|
60
|
+
m.value = !0;
|
|
61
|
+
}, 300);
|
|
62
|
+
}
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (t)
|
|
66
|
+
return await a.addDocument({
|
|
67
|
+
name: r,
|
|
68
|
+
document: t
|
|
69
|
+
});
|
|
70
|
+
if (e.url)
|
|
71
|
+
return await a.addDocument({
|
|
72
|
+
name: e.slug ?? "default",
|
|
73
|
+
url: z(e.url, {
|
|
74
|
+
basePath: (l = o.value.pathRouting) == null ? void 0 : l.basePath
|
|
75
|
+
}),
|
|
76
|
+
fetch: h
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
u(
|
|
80
|
+
() => o.value.url,
|
|
81
|
+
(e) => e && k(o.value),
|
|
82
|
+
{ immediate: !0 }
|
|
83
|
+
), u(
|
|
84
|
+
() => o.value.content,
|
|
85
|
+
(e) => e && k(o.value),
|
|
86
|
+
{ immediate: !0, deep: !0 }
|
|
87
|
+
), f(d, "scalar-update-dark-mode", (e) => {
|
|
88
|
+
a.update("x-scalar-dark-mode", e.detail.value);
|
|
89
|
+
}), f(d, "scalar-update-active-document", (e) => {
|
|
90
|
+
a.update("x-scalar-active-document", e.detail.value);
|
|
91
|
+
}), f(d, "scalar-update-selected-client", (e) => {
|
|
92
|
+
a.update("x-scalar-default-client", e.detail), x().setItem(g.SELECTED_CLIENT, e.detail);
|
|
93
|
+
}), u(
|
|
94
|
+
() => o.value.defaultHttpClient,
|
|
81
95
|
(e) => {
|
|
82
96
|
if (e) {
|
|
83
|
-
const { targetKey: t, clientKey:
|
|
84
|
-
|
|
97
|
+
const { targetKey: t, clientKey: r } = e, l = `${t}/${r}`;
|
|
98
|
+
M(l) && a.update("x-scalar-default-client", l);
|
|
85
99
|
}
|
|
86
100
|
},
|
|
87
101
|
{ immediate: !0 }
|
|
88
102
|
);
|
|
89
|
-
const { toggleColorMode:
|
|
90
|
-
initialColorMode:
|
|
91
|
-
overrideColorMode:
|
|
103
|
+
const { toggleColorMode: b, isDarkMode: I } = W({
|
|
104
|
+
initialColorMode: o.value.darkMode ? "dark" : void 0,
|
|
105
|
+
overrideColorMode: o.value.forceDarkModeState
|
|
92
106
|
});
|
|
93
|
-
|
|
94
|
-
() =>
|
|
95
|
-
(e) =>
|
|
96
|
-
),
|
|
97
|
-
() =>
|
|
98
|
-
(e) =>
|
|
107
|
+
u(
|
|
108
|
+
() => o.value.darkMode,
|
|
109
|
+
(e) => a.update("x-scalar-dark-mode", !!e)
|
|
110
|
+
), u(
|
|
111
|
+
() => I.value,
|
|
112
|
+
(e) => a.update("x-scalar-dark-mode", e),
|
|
99
113
|
{ immediate: !0 }
|
|
100
|
-
),
|
|
114
|
+
), u(
|
|
101
115
|
() => i.value,
|
|
102
116
|
(e) => {
|
|
103
117
|
var t;
|
|
104
|
-
return
|
|
118
|
+
return a.update(
|
|
105
119
|
"x-scalar-active-document",
|
|
106
|
-
(t =
|
|
120
|
+
(t = C.value[e]) == null ? void 0 : t.slug
|
|
107
121
|
);
|
|
108
122
|
},
|
|
109
123
|
{ immediate: !0 }
|
|
110
|
-
),
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
), a.value.metaData && G(a.value.metaData);
|
|
116
|
-
const R = w(() => a.value.favicon);
|
|
117
|
-
return Q(R), (e, t) => {
|
|
118
|
-
var n;
|
|
119
|
-
return E(), U("div", {
|
|
124
|
+
), o.value.metaData && q(o.value.metaData);
|
|
125
|
+
const L = A(() => o.value.favicon);
|
|
126
|
+
return G(L), (e, t) => {
|
|
127
|
+
var r;
|
|
128
|
+
return D(), B("div", {
|
|
120
129
|
ref_key: "root",
|
|
121
|
-
ref:
|
|
130
|
+
ref: d
|
|
122
131
|
}, [
|
|
123
|
-
(
|
|
124
|
-
default:
|
|
125
|
-
O(
|
|
132
|
+
(r = n(o)) != null && r.customCss ? (D(), P(K("style"), { key: 0 }, {
|
|
133
|
+
default: s(() => [
|
|
134
|
+
F(O(n(o).customCss), 1)
|
|
126
135
|
]),
|
|
127
136
|
_: 1
|
|
128
|
-
})) :
|
|
129
|
-
|
|
130
|
-
configuration:
|
|
131
|
-
isDark: !!
|
|
132
|
-
store:
|
|
133
|
-
onToggleDarkMode: t[1] || (t[1] = () =>
|
|
137
|
+
})) : U("", !0),
|
|
138
|
+
E(J, {
|
|
139
|
+
configuration: n(o),
|
|
140
|
+
isDark: !!n(a).workspace["x-scalar-dark-mode"],
|
|
141
|
+
store: n(a),
|
|
142
|
+
onToggleDarkMode: t[1] || (t[1] = () => n(b)()),
|
|
134
143
|
onUpdateContent: t[2] || (t[2] = (l) => e.$emit("updateContent", l))
|
|
135
144
|
}, {
|
|
136
|
-
footer:
|
|
137
|
-
|
|
145
|
+
footer: s(() => [
|
|
146
|
+
p(e.$slots, "footer")
|
|
138
147
|
]),
|
|
139
|
-
"content-end":
|
|
140
|
-
|
|
148
|
+
"content-end": s(() => [
|
|
149
|
+
p(e.$slots, "footer")
|
|
141
150
|
]),
|
|
142
|
-
"document-selector":
|
|
143
|
-
|
|
144
|
-
modelValue:
|
|
145
|
-
"onUpdate:modelValue": t[0] || (t[0] = (l) =>
|
|
146
|
-
options:
|
|
151
|
+
"document-selector": s(() => [
|
|
152
|
+
E(n(te), {
|
|
153
|
+
modelValue: n(i),
|
|
154
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => Y(i) ? i.value = l : null),
|
|
155
|
+
options: n(C)
|
|
147
156
|
}, null, 8, ["modelValue", "options"])
|
|
148
157
|
]),
|
|
149
|
-
"sidebar-start":
|
|
150
|
-
|
|
158
|
+
"sidebar-start": s(() => [
|
|
159
|
+
p(e.$slots, "sidebar-start")
|
|
151
160
|
]),
|
|
152
161
|
_: 3
|
|
153
162
|
}, 8, ["configuration", "isDark", "store"])
|
|
@@ -156,5 +165,5 @@ const ve = /* @__PURE__ */ N({
|
|
|
156
165
|
}
|
|
157
166
|
});
|
|
158
167
|
export {
|
|
159
|
-
|
|
168
|
+
De as default
|
|
160
169
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ObjectDoc, UrlDoc } from '@scalar/workspace-store/client';
|
|
2
|
+
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
3
|
+
/**
|
|
4
|
+
* Calculate a default name for the document to make the workspace store name parameter optional
|
|
5
|
+
*
|
|
6
|
+
* @param params.name - If we have a name already, like config.slug
|
|
7
|
+
* @param params.url - URL of the document
|
|
8
|
+
* @param params.document - The document object
|
|
9
|
+
* @param documents - Optional documents record which will automatically iterate the title if we have a duplicate
|
|
10
|
+
* @returns The name of the document
|
|
11
|
+
*/
|
|
12
|
+
export declare const getDocumentName: ({ name, url, document }?: Partial<UrlDoc> & Partial<ObjectDoc>, documents?: Record<string, OpenApiDocument>) => string;
|
|
13
|
+
//# sourceMappingURL=get-document-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-document-name.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/get-document-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAEnG;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,6BACD,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,cACjD,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,KAC1C,MA2BF,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const n = ({ name: i, url: f, document: t } = {}, e) => {
|
|
2
|
+
if (i)
|
|
3
|
+
return i;
|
|
4
|
+
if (f)
|
|
5
|
+
return f;
|
|
6
|
+
if (t != null && t.info) {
|
|
7
|
+
const r = t.info;
|
|
8
|
+
if (r.title)
|
|
9
|
+
return r.title;
|
|
10
|
+
}
|
|
11
|
+
return "default";
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
n as getDocumentName
|
|
15
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Normalize content into a JS object or return null if it is falsey */
|
|
2
|
+
export declare const normalizeContent: (content: string | Record<string, unknown> | (() => string | Record<string, unknown>) | undefined | null) => Record<string, unknown> | undefined;
|
|
3
|
+
//# sourceMappingURL=normalize-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-content.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/normalize-content.ts"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,YAClB,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,KACtG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAc5B,CAAA"}
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"vue",
|
|
21
21
|
"vue3"
|
|
22
22
|
],
|
|
23
|
-
"version": "1.
|
|
23
|
+
"version": "1.34.0",
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=20"
|
|
26
26
|
},
|
|
@@ -54,21 +54,21 @@
|
|
|
54
54
|
"nanoid": "5.1.5",
|
|
55
55
|
"vue": "^3.5.17",
|
|
56
56
|
"zod": "3.24.1",
|
|
57
|
+
"@scalar/components": "0.14.22",
|
|
58
|
+
"@scalar/api-client": "2.5.21",
|
|
57
59
|
"@scalar/code-highlight": "0.1.9",
|
|
58
|
-
"@scalar/components": "0.14.21",
|
|
59
60
|
"@scalar/helpers": "0.0.7",
|
|
60
61
|
"@scalar/icons": "0.4.6",
|
|
61
62
|
"@scalar/object-utils": "1.2.3",
|
|
62
|
-
"@scalar/openapi-parser": "0.
|
|
63
|
-
"@scalar/api-client": "2.5.20",
|
|
64
|
-
"@scalar/oas-utils": "0.4.16",
|
|
63
|
+
"@scalar/openapi-parser": "0.19.0",
|
|
65
64
|
"@scalar/openapi-types": "0.3.7",
|
|
65
|
+
"@scalar/oas-utils": "0.4.17",
|
|
66
66
|
"@scalar/snippetz": "0.4.4",
|
|
67
67
|
"@scalar/themes": "0.13.12",
|
|
68
68
|
"@scalar/types": "0.2.11",
|
|
69
69
|
"@scalar/use-hooks": "0.2.4",
|
|
70
70
|
"@scalar/use-toasts": "0.8.0",
|
|
71
|
-
"@scalar/workspace-store": "0.
|
|
71
|
+
"@scalar/workspace-store": "0.12.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@tailwindcss/vite": "^4.1.7",
|
|
@@ -85,9 +85,13 @@
|
|
|
85
85
|
"vite-plugin-banner": "^0.7.1",
|
|
86
86
|
"vite-plugin-css-injected-by-js": "^3.4.0",
|
|
87
87
|
"vitest": "^3.2.4",
|
|
88
|
-
"@
|
|
88
|
+
"@hono/node-server": "^1.11.0",
|
|
89
|
+
"@playwright/test": "^1.49.1",
|
|
90
|
+
"hono": "^4.6.5",
|
|
91
|
+
"@scalar/galaxy": "0.5.5",
|
|
89
92
|
"@scalar/react-renderer": "0.2.1",
|
|
90
|
-
"@scalar/
|
|
93
|
+
"@scalar/core": "0.3.11",
|
|
94
|
+
"@scalar/build-tooling": "0.2.4"
|
|
91
95
|
},
|
|
92
96
|
"scripts": {
|
|
93
97
|
"build": "pnpm build:default && pnpm build:standalone && pnpm types:build && tsc-alias -p tsconfig.build.json",
|
|
@@ -103,6 +107,8 @@
|
|
|
103
107
|
"playground:vue": "vite ./playground/vue -c ./playground/vue/vite.config.ts",
|
|
104
108
|
"preview": "vite preview",
|
|
105
109
|
"test": "vitest",
|
|
110
|
+
"test:e2e": "playwright test",
|
|
111
|
+
"test:e2e:ui": "playwright test --ui",
|
|
106
112
|
"types:build": "scalar-types-build-vue",
|
|
107
113
|
"types:check": "scalar-types-check-vue"
|
|
108
114
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"AAmFA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAQhD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;;AAiJF,wBAMG"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { defineComponent as k, ref as w, watch as M, nextTick as C, onMounted as v, onBeforeUnmount as B, createElementBlock as n, openBlock as r, Fragment as s, createVNode as u, unref as l, normalizeClass as K, withCtx as c, createElementVNode as a, createTextVNode as m, toDisplayString as b } from "vue";
|
|
2
|
-
import { useModal as E, ScalarSidebarSearchButton as H } from "@scalar/components";
|
|
3
|
-
import { isMacOS as f } from "@scalar/helpers/general/is-mac-os";
|
|
4
|
-
import g from "./SearchModal.vue.js";
|
|
5
|
-
import { useApiClient as L } from "../api-client-modal/useApiClient.js";
|
|
6
|
-
const $ = /* @__PURE__ */ k({
|
|
7
|
-
__name: "SearchButton",
|
|
8
|
-
props: {
|
|
9
|
-
spec: {},
|
|
10
|
-
searchHotKey: { default: "k" },
|
|
11
|
-
hideModels: { type: Boolean, default: !1 }
|
|
12
|
-
},
|
|
13
|
-
setup(h) {
|
|
14
|
-
const d = w(), t = E(), { client: y } = L(), i = (o) => {
|
|
15
|
-
var e;
|
|
16
|
-
(f() ? o.metaKey : o.ctrlKey) && o.key === h.searchHotKey && !((e = y.value) != null && e.modalState.open) && (o.preventDefault(), o.stopPropagation(), t.open ? t.hide() : t.show());
|
|
17
|
-
};
|
|
18
|
-
M(
|
|
19
|
-
() => t.open,
|
|
20
|
-
(o, e) => {
|
|
21
|
-
!o && e && C(() => {
|
|
22
|
-
var p;
|
|
23
|
-
(p = d.value) == null || p.$el.focus();
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
), v(() => window.addEventListener("keydown", i)), B(() => window.removeEventListener("keydown", i));
|
|
27
|
-
function S() {
|
|
28
|
-
t.show();
|
|
29
|
-
}
|
|
30
|
-
return (o, e) => (r(), n(s, null, [
|
|
31
|
-
u(l(H), {
|
|
32
|
-
ref_key: "button",
|
|
33
|
-
ref: d,
|
|
34
|
-
class: K(["w-full", o.$attrs.class]),
|
|
35
|
-
onClick: S
|
|
36
|
-
}, {
|
|
37
|
-
shortcut: c(() => [
|
|
38
|
-
l(f)() ? (r(), n(s, { key: 0 }, [
|
|
39
|
-
m("⌘")
|
|
40
|
-
], 64)) : (r(), n(s, { key: 1 }, [
|
|
41
|
-
e[0] || (e[0] = a("span", { class: "sr-only" }, "CTRL", -1)),
|
|
42
|
-
e[1] || (e[1] = a("span", { "aria-hidden": "true" }, "⌃", -1))
|
|
43
|
-
], 64)),
|
|
44
|
-
m(" " + b(o.searchHotKey), 1)
|
|
45
|
-
]),
|
|
46
|
-
default: c(() => [
|
|
47
|
-
e[2] || (e[2] = a("span", { class: "sr-only" }, "Open Search", -1)),
|
|
48
|
-
e[3] || (e[3] = a("span", {
|
|
49
|
-
"aria-hidden": "true",
|
|
50
|
-
class: "sidebar-search-placeholder"
|
|
51
|
-
}, " Search ", -1))
|
|
52
|
-
]),
|
|
53
|
-
_: 1,
|
|
54
|
-
__: [2, 3]
|
|
55
|
-
}, 8, ["class"]),
|
|
56
|
-
u(g, {
|
|
57
|
-
modalState: l(t),
|
|
58
|
-
hideModels: o.hideModels,
|
|
59
|
-
parsedSpec: o.spec
|
|
60
|
-
}, null, 8, ["modalState", "hideModels", "parsedSpec"])
|
|
61
|
-
], 64));
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
export {
|
|
65
|
-
$ as default
|
|
66
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchModal.vue"],"names":[],"mappings":"AAoTA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAU3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAgBhD,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,UAAU,CAAA;IACtB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;;AAoaF,wBAOG"}
|