@scalar/api-reference 1.41.0 → 1.42.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 +84 -0
- package/dist/blocks/index.d.ts +0 -1
- package/dist/blocks/index.d.ts.map +1 -1
- package/dist/blocks/index.js +4 -6
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts +4 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +9 -13
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts +4 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +10 -9
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts +4 -0
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue2.js +4 -7
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts +7 -9
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js +9 -6
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.d.ts +2 -9
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js +13 -25
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.d.ts +8 -4
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +18 -41
- package/dist/browser/standalone.js +20336 -23246
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.d.ts +2 -254
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReference.vue2.js +71 -83
- package/dist/components/Content/Auth/Auth.vue.d.ts +17 -0
- package/dist/components/Content/Auth/Auth.vue.d.ts.map +1 -0
- package/dist/components/Content/Auth/Auth.vue.js +70 -0
- package/dist/components/Content/Auth/Auth.vue2.js +4 -0
- package/dist/components/Content/Auth/helpers/get-default-security.d.ts +18 -0
- package/dist/components/Content/Auth/helpers/get-default-security.d.ts.map +1 -0
- package/dist/components/Content/Auth/helpers/get-default-security.js +43 -0
- package/dist/components/Content/Auth/index.d.ts +2 -0
- package/dist/components/Content/Auth/index.d.ts.map +1 -0
- package/dist/components/Content/Content.vue.d.ts +9 -19
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +46 -47
- package/dist/components/Content/Models/Model.vue.d.ts +3 -6
- package/dist/components/Content/Models/Model.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Model.vue.js +2 -2
- package/dist/components/Content/Models/ModelTag.vue.d.ts +2 -7
- package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModelTag.vue.js +3 -3
- package/dist/components/Content/Models/components/ClassicLayout.vue.d.ts +3 -5
- package/dist/components/Content/Models/components/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/components/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Models/components/ClassicLayout.vue2.js +2 -8
- package/dist/components/Content/Models/components/ModernLayout.vue.d.ts +1 -1
- package/dist/components/Content/Models/components/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +20 -25
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js +38 -56
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/index.d.ts +0 -1
- package/dist/components/Content/index.d.ts.map +1 -1
- package/dist/components/ShowMoreButton.vue.d.ts +1 -4
- package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
- package/dist/components/ShowMoreButton.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue2.js +7 -17
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +12 -14
- package/dist/features/Operation/Operation.vue.d.ts +23 -25
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +28 -19
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +2 -4
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +17 -6
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +3 -5
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.js +3 -1
- package/dist/features/Operation/components/ParameterList.vue.d.ts +3 -6
- package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterList.vue.js +6 -8
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +3 -6
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue2.js +6 -8
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +2 -4
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +1 -5
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +2 -8
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js +35 -24
- package/dist/features/Operation/helpers/filter-selected-security.d.ts +9 -0
- package/dist/features/Operation/helpers/filter-selected-security.d.ts.map +1 -0
- package/dist/features/Operation/helpers/filter-selected-security.js +27 -0
- package/dist/features/Operation/helpers/get-first-server.d.ts +1 -1
- package/dist/features/Operation/helpers/get-first-server.d.ts.map +1 -1
- package/dist/features/Operation/helpers/get-first-server.js +3 -3
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +7 -23
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +24 -23
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +7 -23
- 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 +25 -27
- package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue2.js +1 -2
- package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue2.js +1 -2
- package/dist/features/test-request-button/TestRequestButton.vue.d.ts +3 -0
- package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue2.js +5 -9
- package/dist/helpers/index.d.ts +0 -4
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +1 -9
- package/dist/helpers/map-config-plugins.d.ts +5 -0
- package/dist/helpers/map-config-plugins.d.ts.map +1 -0
- package/dist/helpers/map-config-plugins.js +29 -0
- package/dist/helpers/map-config-to-workspace-store.d.ts.map +1 -1
- package/dist/helpers/map-config-to-workspace-store.js +5 -0
- package/dist/helpers/map-configuration.d.ts +2 -2
- package/dist/helpers/storage.d.ts +347 -0
- package/dist/helpers/storage.d.ts.map +1 -0
- package/dist/helpers/storage.js +61 -0
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/plugins/persistance-plugin.d.ts +16 -0
- package/dist/plugins/persistance-plugin.d.ts.map +1 -0
- package/dist/plugins/persistance-plugin.js +54 -0
- package/dist/style.css +228 -542
- package/package.json +16 -16
- package/dist/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +0 -11
- package/dist/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +0 -7
- package/dist/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +0 -259
- package/dist/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts +0 -21
- package/dist/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js +0 -66
- package/dist/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue2.js +0 -4
- package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +0 -17
- package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +0 -273
- package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue2.js +0 -4
- package/dist/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +0 -9
- package/dist/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +0 -150
- package/dist/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue2.js +0 -4
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +0 -20
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +0 -7
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue2.js +0 -116
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +0 -50
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +0 -55
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue2.js +0 -4
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +0 -17
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +0 -288
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue2.js +0 -4
- package/dist/blocks/scalar-auth-selector-block/helpers/filter-security-requirements.d.ts +0 -6
- package/dist/blocks/scalar-auth-selector-block/helpers/filter-security-requirements.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/helpers/update-scheme.d.ts +0 -8
- package/dist/blocks/scalar-auth-selector-block/helpers/update-scheme.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/helpers/update-scheme.js +0 -26
- package/dist/blocks/scalar-auth-selector-block/index.d.ts +0 -2
- package/dist/blocks/scalar-auth-selector-block/index.d.ts.map +0 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts +0 -16
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +0 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +0 -7
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +0 -142
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts +0 -13
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +0 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +0 -7
- package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +0 -125
- package/dist/components/Content/ClientLibraries/featured-clients.d.ts +0 -11
- package/dist/components/Content/ClientLibraries/featured-clients.d.ts.map +0 -1
- package/dist/components/Content/ClientLibraries/featured-clients.js +0 -24
- package/dist/components/Content/ClientLibraries/index.d.ts +0 -2
- package/dist/components/Content/ClientLibraries/index.d.ts.map +0 -1
- package/dist/features/example-responses/helpers/get-resolved-ref-deep.d.ts +0 -26
- package/dist/features/example-responses/helpers/get-resolved-ref-deep.d.ts.map +0 -1
- package/dist/features/example-responses/helpers/get-resolved-ref-deep.js +0 -39
- package/dist/helpers/convert-security-scheme.d.ts +0 -9
- package/dist/helpers/convert-security-scheme.d.ts.map +0 -1
- package/dist/helpers/convert-security-scheme.js +0 -34
- package/dist/helpers/map-config-to-client-store.d.ts +0 -72
- package/dist/helpers/map-config-to-client-store.d.ts.map +0 -1
- package/dist/helpers/map-config-to-client-store.js +0 -146
- package/dist/hooks/use-legacy-store-events.d.ts +0 -14
- package/dist/hooks/use-legacy-store-events.d.ts.map +0 -1
- package/dist/hooks/use-legacy-store-events.js +0 -91
- package/dist/hooks/use-workspace-store-events.d.ts +0 -4
- package/dist/hooks/use-workspace-store-events.d.ts.map +0 -1
- package/dist/hooks/use-workspace-store-events.js +0 -68
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# @scalar/api-reference
|
|
2
2
|
|
|
3
|
+
## 1.42.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#7605](https://github.com/scalar/scalar/pull/7605): feat: api client v2 integration
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
#### Updated Dependencies
|
|
12
|
+
|
|
13
|
+
- **@scalar/workspace-store@0.24.3**
|
|
14
|
+
- [#7605](https://github.com/scalar/scalar/pull/7605): fix: all issues for client modal v2 preparation
|
|
15
|
+
|
|
16
|
+
- **@scalar/api-client@2.17.4**
|
|
17
|
+
- [#7605](https://github.com/scalar/scalar/pull/7605): fix: all issues for client modal v2 preparation
|
|
18
|
+
|
|
19
|
+
- **@scalar/use-hooks@0.3.4**
|
|
20
|
+
- [#7605](https://github.com/scalar/scalar/pull/7605): fix: all issues for client modal v2 preparation
|
|
21
|
+
|
|
22
|
+
- **@scalar/helpers@0.2.5**
|
|
23
|
+
- [#7605](https://github.com/scalar/scalar/pull/7605): fix: all issues for client modal v2 preparation
|
|
24
|
+
|
|
25
|
+
- **@scalar/types@0.5.5**
|
|
26
|
+
- [#7605](https://github.com/scalar/scalar/pull/7605): fix: all issues for client modal v2 preparation
|
|
27
|
+
|
|
28
|
+
- **@scalar/oas-utils@0.6.13**
|
|
29
|
+
|
|
30
|
+
- **@scalar/sidebar@0.7.5**
|
|
31
|
+
|
|
32
|
+
- **@scalar/components@0.16.15**
|
|
33
|
+
|
|
34
|
+
- **@scalar/json-magic@0.8.9**
|
|
35
|
+
|
|
36
|
+
- **@scalar/object-utils@1.2.19**
|
|
37
|
+
|
|
38
|
+
- **@scalar/openapi-parser@0.23.10**
|
|
39
|
+
|
|
40
|
+
- **@scalar/openapi-upgrader@0.1.6**
|
|
41
|
+
|
|
42
|
+
- **@scalar/snippetz@0.6.2**
|
|
43
|
+
|
|
44
|
+
## 1.41.1
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
#### Updated Dependencies
|
|
49
|
+
|
|
50
|
+
- **@scalar/components@0.16.14**
|
|
51
|
+
- [#7654](https://github.com/scalar/scalar/pull/7654): fix(components): explicitly set line height for buttons and sections
|
|
52
|
+
|
|
53
|
+
- **@scalar/api-client@2.17.3**
|
|
54
|
+
|
|
55
|
+
- **@scalar/code-highlight@0.2.2**
|
|
56
|
+
|
|
57
|
+
- **@scalar/helpers@0.2.4**
|
|
58
|
+
|
|
59
|
+
- **@scalar/icons@0.5.2**
|
|
60
|
+
|
|
61
|
+
- **@scalar/json-magic@0.8.8**
|
|
62
|
+
|
|
63
|
+
- **@scalar/oas-utils@0.6.12**
|
|
64
|
+
|
|
65
|
+
- **@scalar/object-utils@1.2.18**
|
|
66
|
+
|
|
67
|
+
- **@scalar/openapi-parser@0.23.9**
|
|
68
|
+
|
|
69
|
+
- **@scalar/openapi-types@0.5.3**
|
|
70
|
+
|
|
71
|
+
- **@scalar/openapi-upgrader@0.1.6**
|
|
72
|
+
|
|
73
|
+
- **@scalar/sidebar@0.7.4**
|
|
74
|
+
|
|
75
|
+
- **@scalar/snippetz@0.6.1**
|
|
76
|
+
|
|
77
|
+
- **@scalar/themes@0.13.26**
|
|
78
|
+
|
|
79
|
+
- **@scalar/types@0.5.4**
|
|
80
|
+
|
|
81
|
+
- **@scalar/use-hooks@0.3.3**
|
|
82
|
+
|
|
83
|
+
- **@scalar/use-toasts@0.9.1**
|
|
84
|
+
|
|
85
|
+
- **@scalar/workspace-store@0.24.2**
|
|
86
|
+
|
|
3
87
|
## 1.41.0
|
|
4
88
|
|
|
5
89
|
### Minor Changes
|
package/dist/blocks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA"}
|
package/dist/blocks/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { default as default2 } from "./scalar-info-block/components/InfoBlock.vue.js";
|
|
2
2
|
import { default as default3 } from "./scalar-server-selector-block/components/ServerSelector.vue.js";
|
|
3
|
-
import { default as default4 } from "./scalar-
|
|
4
|
-
import { default as default5 } from "./scalar-
|
|
5
|
-
import { default as default6 } from "./scalar-info-block/components/IntroductionCardItem.vue.js";
|
|
3
|
+
import { default as default4 } from "./scalar-client-selector-block/components/ClientSelector.vue.js";
|
|
4
|
+
import { default as default5 } from "./scalar-info-block/components/IntroductionCardItem.vue.js";
|
|
6
5
|
export {
|
|
7
|
-
default4 as
|
|
8
|
-
default5 as ClientSelector,
|
|
6
|
+
default4 as ClientSelector,
|
|
9
7
|
default2 as InfoBlock,
|
|
10
|
-
|
|
8
|
+
default5 as IntroductionCardItem,
|
|
11
9
|
default3 as ServerSelector
|
|
12
10
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { type ClientOption, type ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample';
|
|
2
2
|
import type { AvailableClients } from '@scalar/types/snippetz';
|
|
3
|
+
import { type WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
4
|
type __VLS_Props = {
|
|
4
5
|
/** Client options */
|
|
5
6
|
clientOptions: ClientOptionGroup[];
|
|
6
7
|
/** The currently selected Http Client */
|
|
7
|
-
|
|
8
|
+
selectedClient?: AvailableClients[number];
|
|
8
9
|
/** List of featured clients */
|
|
9
10
|
featuredClients: ClientOption[];
|
|
11
|
+
/** Event bus */
|
|
12
|
+
eventBus: WorkspaceEventBus;
|
|
10
13
|
};
|
|
11
14
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
15
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-client-selector-block/components/ClientDropdown.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClientDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-client-selector-block/components/ClientDropdown.vue"],"names":[],"mappings":"AAwPA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAEvB,MAAM,oDAAoD,CAAA;AAG3D,OAAO,KAAK,EAAE,gBAAgB,EAAY,MAAM,wBAAwB,CAAA;AACxE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAKvE,KAAK,WAAW,GAAG;IACf,qBAAqB;IACrB,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,yCAAyC;IACzC,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACzC,+BAA+B;IAC/B,eAAe,EAAE,YAAY,EAAE,CAAA;IAC/B,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;AA+OJ,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./ClientDropdown.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const ClientDropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const ClientDropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6a49c111"]]);
|
|
5
5
|
export {
|
|
6
6
|
ClientDropdown as default
|
|
7
7
|
};
|
|
@@ -3,7 +3,6 @@ import { Tab } from "@headlessui/vue";
|
|
|
3
3
|
import { findClient } from "@scalar/api-client/v2/blocks/operation-code-sample";
|
|
4
4
|
import { ScalarIcon, ScalarCombobox } from "@scalar/components";
|
|
5
5
|
import { freezeElement } from "@scalar/helpers/dom/freeze-element";
|
|
6
|
-
import { emitCustomEvent } from "@scalar/workspace-store/events";
|
|
7
6
|
import { isFeaturedClient } from "../helpers/featured-clients.js";
|
|
8
7
|
const _hoisted_1 = { class: "client-libraries-text" };
|
|
9
8
|
const _hoisted_2 = {
|
|
@@ -27,8 +26,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
26
|
__name: "ClientDropdown",
|
|
28
27
|
props: {
|
|
29
28
|
clientOptions: {},
|
|
30
|
-
|
|
31
|
-
featuredClients: {}
|
|
29
|
+
selectedClient: {},
|
|
30
|
+
featuredClients: {},
|
|
31
|
+
eventBus: {}
|
|
32
32
|
},
|
|
33
33
|
setup(__props) {
|
|
34
34
|
const containerRef = ref();
|
|
@@ -42,15 +42,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
unfreeze();
|
|
43
43
|
}, 300);
|
|
44
44
|
if (option.clientKey !== "custom") {
|
|
45
|
-
|
|
46
|
-
containerRef.value,
|
|
47
|
-
"scalar-update-selected-client",
|
|
48
|
-
option.id
|
|
49
|
-
);
|
|
45
|
+
__props.eventBus.emit("workspace:update:selected-client", option.id);
|
|
50
46
|
}
|
|
51
47
|
};
|
|
52
48
|
const selectedTargetKey = computed(
|
|
53
|
-
() => __props.
|
|
49
|
+
() => __props.selectedClient?.split("/")[0]
|
|
54
50
|
);
|
|
55
51
|
return (_ctx, _cache) => {
|
|
56
52
|
return openBlock(), createElementBlock("div", {
|
|
@@ -62,7 +58,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
58
|
return openBlock(), createBlock(unref(Tab), {
|
|
63
59
|
key: featuredClient.clientKey,
|
|
64
60
|
class: normalizeClass(["client-libraries rendered-code-sdks", {
|
|
65
|
-
"client-libraries__active": featuredClient.id === _ctx.
|
|
61
|
+
"client-libraries__active": featuredClient.id === _ctx.selectedClient
|
|
66
62
|
}])
|
|
67
63
|
}, {
|
|
68
64
|
default: withCtx(() => [
|
|
@@ -80,7 +76,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
80
76
|
}, 1032, ["class"]);
|
|
81
77
|
}), 128)),
|
|
82
78
|
createVNode(unref(ScalarCombobox), {
|
|
83
|
-
modelValue: unref(findClient)(_ctx.clientOptions, _ctx.
|
|
79
|
+
modelValue: unref(findClient)(_ctx.clientOptions, _ctx.selectedClient),
|
|
84
80
|
options: _ctx.clientOptions,
|
|
85
81
|
placement: "bottom-end",
|
|
86
82
|
teleport: "",
|
|
@@ -89,12 +85,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
89
85
|
default: withCtx(() => [
|
|
90
86
|
createElementVNode("button", {
|
|
91
87
|
class: normalizeClass(["client-libraries client-libraries__select", {
|
|
92
|
-
"client-libraries__active": _ctx.
|
|
88
|
+
"client-libraries__active": _ctx.selectedClient && !unref(isFeaturedClient)(_ctx.selectedClient)
|
|
93
89
|
}]),
|
|
94
90
|
type: "button"
|
|
95
91
|
}, [
|
|
96
92
|
createElementVNode("div", _hoisted_2, [
|
|
97
|
-
_ctx.
|
|
93
|
+
_ctx.selectedClient && !unref(isFeaturedClient)(_ctx.selectedClient) ? (openBlock(), createElementBlock("div", {
|
|
98
94
|
key: 0,
|
|
99
95
|
class: normalizeClass(`client-libraries-icon__${selectedTargetKey.value}`)
|
|
100
96
|
}, [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample';
|
|
2
2
|
import type { AvailableClient } from '@scalar/snippetz';
|
|
3
|
+
import { type WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
4
|
import type { XScalarSdkInstallation } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-sdk-installation';
|
|
4
5
|
type __VLS_Props = {
|
|
5
6
|
/** Selected SDK installation instructions */
|
|
@@ -7,7 +8,9 @@ type __VLS_Props = {
|
|
|
7
8
|
/** Computed list of all available Http Client options */
|
|
8
9
|
clientOptions: ClientOptionGroup[];
|
|
9
10
|
/** The currently selected Http Client */
|
|
10
|
-
|
|
11
|
+
selectedClient?: AvailableClient;
|
|
12
|
+
/** Event bus */
|
|
13
|
+
eventBus: WorkspaceEventBus;
|
|
11
14
|
};
|
|
12
15
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
13
16
|
selectedClientOption: import("vue").ComputedRef<import("@scalar/api-client/v2/blocks/operation-code-sample").ClientOption | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientSelector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-client-selector-block/components/ClientSelector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClientSelector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-client-selector-block/components/ClientSelector.vue"],"names":[],"mappings":"AAgNA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,oDAAoD,CAAA;AAE3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+EAA+E,CAAA;AAU3H,KAAK,WAAW,GAAG;IACjB,6CAA6C;IAC7C,sBAAsB,CAAC,EAAE,sBAAsB,CAAC,2BAA2B,CAAC,CAAA;IAC5E,yDAAyD;IACzD,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,yCAAyC;IACzC,cAAc,CAAC,EAAE,eAAe,CAAA;IAChC,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;;;AA2RF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./ClientSelector.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const ClientSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const ClientSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e59e2ca0"]]);
|
|
5
5
|
export {
|
|
6
6
|
ClientSelector as default
|
|
7
7
|
};
|
|
@@ -2,7 +2,6 @@ import { defineComponent, useId, computed, useTemplateRef, createElementBlock, c
|
|
|
2
2
|
import { TabGroup, TabList, TabPanels, TabPanel } from "@headlessui/vue";
|
|
3
3
|
import { DEFAULT_CLIENT } from "@scalar/api-client/v2/blocks/operation-code-sample";
|
|
4
4
|
import { ScalarMarkdown, ScalarCodeBlock } from "@scalar/components";
|
|
5
|
-
import { emitCustomEvent } from "@scalar/workspace-store/events";
|
|
6
5
|
import { getFeaturedClients, isFeaturedClient } from "../helpers/featured-clients.js";
|
|
7
6
|
import ClientDropdown from "./ClientDropdown.vue.js";
|
|
8
7
|
const _hoisted_1 = {
|
|
@@ -22,20 +21,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
21
|
props: {
|
|
23
22
|
xScalarSdkInstallation: {},
|
|
24
23
|
clientOptions: {},
|
|
25
|
-
|
|
24
|
+
selectedClient: { default: () => DEFAULT_CLIENT },
|
|
25
|
+
eventBus: {}
|
|
26
26
|
},
|
|
27
27
|
setup(__props, { expose: __expose }) {
|
|
28
28
|
const headingId = useId();
|
|
29
29
|
const morePanel = useId();
|
|
30
30
|
const selectedClientOption = computed(
|
|
31
31
|
() => __props.clientOptions.flatMap(
|
|
32
|
-
(
|
|
32
|
+
(optionGroup) => optionGroup.options.find((option) => option.id === __props.selectedClient) ?? []
|
|
33
33
|
)[0]
|
|
34
34
|
);
|
|
35
35
|
const featuredClients = computed(() => getFeaturedClients(__props.clientOptions));
|
|
36
36
|
const tabIndex = computed(
|
|
37
37
|
() => featuredClients.value.findIndex(
|
|
38
|
-
(featuredClient) => __props.
|
|
38
|
+
(featuredClient) => __props.selectedClient === featuredClient.id
|
|
39
39
|
)
|
|
40
40
|
);
|
|
41
41
|
const wrapper = useTemplateRef("wrapper-ref");
|
|
@@ -44,14 +44,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44
44
|
if (!client || !wrapper.value) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
__props.eventBus.emit("workspace:update:selected-client", client.id);
|
|
48
48
|
};
|
|
49
49
|
const installationInstructions = computed(() => {
|
|
50
50
|
if (!Array.isArray(__props.xScalarSdkInstallation) || !__props.xScalarSdkInstallation?.length) {
|
|
51
51
|
return void 0;
|
|
52
52
|
}
|
|
53
53
|
const instruction = __props.xScalarSdkInstallation.find((instruction2) => {
|
|
54
|
-
const targetKey = __props.
|
|
54
|
+
const targetKey = __props.selectedClient?.split("/")[0]?.toLowerCase();
|
|
55
55
|
return instruction2.lang.toLowerCase() === targetKey;
|
|
56
56
|
});
|
|
57
57
|
if (!instruction) {
|
|
@@ -81,10 +81,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
81
81
|
default: withCtx(() => [
|
|
82
82
|
createVNode(ClientDropdown, {
|
|
83
83
|
clientOptions: _ctx.clientOptions,
|
|
84
|
+
eventBus: _ctx.eventBus,
|
|
84
85
|
featuredClients: featuredClients.value,
|
|
85
86
|
morePanel: unref(morePanel),
|
|
86
|
-
|
|
87
|
-
}, null, 8, ["clientOptions", "featuredClients", "morePanel", "
|
|
87
|
+
selectedClient: _ctx.selectedClient
|
|
88
|
+
}, null, 8, ["clientOptions", "eventBus", "featuredClients", "morePanel", "selectedClient"])
|
|
88
89
|
]),
|
|
89
90
|
_: 1
|
|
90
91
|
}, 8, ["aria-labelledby"]),
|
|
@@ -109,7 +110,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
109
110
|
lang: "shell"
|
|
110
111
|
}, null, 8, ["content"])
|
|
111
112
|
])) : createCommentVNode("", true)
|
|
112
|
-
], 64)) : unref(isFeaturedClient)(_ctx.
|
|
113
|
+
], 64)) : unref(isFeaturedClient)(_ctx.selectedClient) ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(featuredClients.value, (client) => {
|
|
113
114
|
return openBlock(), createBlock(unref(TabPanel), {
|
|
114
115
|
key: client.id,
|
|
115
116
|
class: "selected-client card-footer -outline-offset-2"
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
2
|
+
import { type WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
3
|
type __VLS_Props = {
|
|
4
|
+
/** The document download type. */
|
|
3
5
|
documentDownloadType: ApiReferenceConfiguration['documentDownloadType'];
|
|
6
|
+
/** The event bus for the handling all events. */
|
|
7
|
+
eventBus: WorkspaceEventBus;
|
|
4
8
|
};
|
|
5
9
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
10
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/DownloadLink.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/DownloadLink.vue"],"names":[],"mappings":"AA6LA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAIvE,KAAK,WAAW,GAAG;IACjB,kCAAkC;IAClC,oBAAoB,EAAE,yBAAyB,CAAC,sBAAsB,CAAC,CAAA;IACvE,iDAAiD;IACjD,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;AAiIF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./DownloadLink.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const DownloadLink = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const DownloadLink = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-79ed4949"]]);
|
|
5
5
|
export {
|
|
6
6
|
DownloadLink as default
|
|
7
7
|
};
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import { defineComponent,
|
|
2
|
-
import { emitCustomEvent } from "@scalar/workspace-store/events";
|
|
1
|
+
import { defineComponent, createElementBlock, createCommentVNode, openBlock, normalizeClass, withModifiers, createElementVNode, createVNode, withCtx, createTextVNode } from "vue";
|
|
3
2
|
import Badge from "../../../components/Badge/Badge.vue.js";
|
|
4
3
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
4
|
__name: "DownloadLink",
|
|
6
5
|
props: {
|
|
7
|
-
documentDownloadType: {}
|
|
6
|
+
documentDownloadType: {},
|
|
7
|
+
eventBus: {}
|
|
8
8
|
},
|
|
9
9
|
setup(__props) {
|
|
10
|
-
const el = useTemplateRef("el");
|
|
11
10
|
const handleDownloadClick = (format) => {
|
|
12
|
-
|
|
11
|
+
__props.eventBus.emit("ui:download:document", { format });
|
|
13
12
|
};
|
|
14
13
|
return (_ctx, _cache) => {
|
|
15
14
|
return ["yaml", "json", "both", "direct"].includes(_ctx.documentDownloadType) ? (openBlock(), createElementBlock("div", {
|
|
16
15
|
key: 0,
|
|
17
|
-
ref_key: "el",
|
|
18
|
-
ref: el,
|
|
19
16
|
class: normalizeClass(["download-container group", {
|
|
20
17
|
"download-both": _ctx.documentDownloadType === "both"
|
|
21
18
|
}])
|
|
@@ -16,15 +16,13 @@ type __VLS_Props = {
|
|
|
16
16
|
/** OpenAPI extension fields at the info object level. */
|
|
17
17
|
infoExtensions?: Record<string, unknown>;
|
|
18
18
|
/** The event bus for the handling all events. */
|
|
19
|
-
eventBus: WorkspaceEventBus
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
headingSlugGenerator: (heading: Heading) => string;
|
|
27
|
-
};
|
|
19
|
+
eventBus: WorkspaceEventBus;
|
|
20
|
+
/** Heading id generator for Markdown headings */
|
|
21
|
+
headingSlugGenerator: (heading: Heading) => string;
|
|
22
|
+
/** Determines the layout style for the info block ('modern' or 'classic'). */
|
|
23
|
+
layout?: 'modern' | 'classic';
|
|
24
|
+
/** The document download type. */
|
|
25
|
+
documentDownloadType?: ApiReferenceConfiguration['documentDownloadType'];
|
|
28
26
|
};
|
|
29
27
|
declare var __VLS_8: {};
|
|
30
28
|
type __VLS_Slots = {} & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/InfoBlock.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InfoBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/InfoBlock.vue"],"names":[],"mappings":"AA6EA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EACV,2BAA2B,EAC3B,UAAU,EACX,MAAM,8DAA8D,CAAA;AAQrE,KAAK,WAAW,GAAG;IACjB,qDAAqD;IACrD,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iDAAiD;IACjD,IAAI,EAAE,UAAU,GAAG,SAAS,CAAA;IAC5B,+EAA+E;IAC/E,YAAY,CAAC,EAAE,2BAA2B,CAAA;IAC1C,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5C,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACxC,iDAAiD;IACjD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,iDAAiD;IACjD,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAClD,8EAA8E;IAC9E,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC7B,kCAAkC;IAClC,oBAAoB,CAAC,EAAE,yBAAyB,CAAC,sBAAsB,CAAC,CAAA;CACzE,CAAC;AA+EF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAuBjD,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -12,11 +12,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12
12
|
documentExtensions: {},
|
|
13
13
|
infoExtensions: {},
|
|
14
14
|
eventBus: {},
|
|
15
|
-
|
|
15
|
+
headingSlugGenerator: { type: Function },
|
|
16
|
+
layout: {},
|
|
17
|
+
documentDownloadType: { default: "both" }
|
|
16
18
|
},
|
|
17
19
|
setup(__props) {
|
|
18
20
|
const introCardsSlot = computed(
|
|
19
|
-
() => __props.
|
|
21
|
+
() => __props.layout === "classic" ? "after" : "aside"
|
|
20
22
|
);
|
|
21
23
|
return (_ctx, _cache) => {
|
|
22
24
|
return openBlock(), createBlock(IntroductionLayout, {
|
|
@@ -24,14 +26,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
26
|
documentExtensions: _ctx.documentExtensions,
|
|
25
27
|
eventBus: _ctx.eventBus,
|
|
26
28
|
externalDocs: _ctx.externalDocs,
|
|
27
|
-
headingSlugGenerator: _ctx.
|
|
29
|
+
headingSlugGenerator: _ctx.headingSlugGenerator,
|
|
28
30
|
info: _ctx.info,
|
|
29
31
|
infoExtensions: _ctx.infoExtensions,
|
|
30
32
|
oasVersion: _ctx.oasVersion
|
|
31
33
|
}, {
|
|
32
34
|
[introCardsSlot.value]: withCtx(() => [
|
|
33
35
|
createVNode(IntroductionCard, {
|
|
34
|
-
row: _ctx.
|
|
36
|
+
row: _ctx.layout === "classic"
|
|
35
37
|
}, {
|
|
36
38
|
default: withCtx(() => [
|
|
37
39
|
renderSlot(_ctx.$slots, "selectors")
|
|
@@ -41,8 +43,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
43
|
]),
|
|
42
44
|
"download-link": withCtx(() => [
|
|
43
45
|
createVNode(DownloadLink, {
|
|
44
|
-
documentDownloadType: _ctx.
|
|
45
|
-
|
|
46
|
+
documentDownloadType: _ctx.documentDownloadType,
|
|
47
|
+
eventBus: _ctx.eventBus
|
|
48
|
+
}, null, 8, ["documentDownloadType", "eventBus"])
|
|
46
49
|
]),
|
|
47
50
|
_: 2
|
|
48
51
|
}, 1032, ["id", "documentExtensions", "eventBus", "externalDocs", "headingSlugGenerator", "info", "infoExtensions", "oasVersion"]);
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
/** The selected server URL */
|
|
4
|
-
|
|
4
|
+
selectedServer: ServerObject | null;
|
|
5
5
|
/** Available servers */
|
|
6
6
|
servers: ServerObject[];
|
|
7
7
|
/** The id of the target to use for the popover (e.g. address bar) */
|
|
8
8
|
target: string;
|
|
9
9
|
};
|
|
10
10
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
11
|
-
server: import("vue").ComputedRef<ServerObject | undefined>;
|
|
12
11
|
servers: ServerObject[];
|
|
13
12
|
serverUrlWithoutTrailingSlash: import("vue").ComputedRef<string>;
|
|
14
13
|
serverOptions: import("vue").ComputedRef<{
|
|
15
14
|
id: string;
|
|
16
15
|
label: string;
|
|
17
16
|
}[]>;
|
|
18
|
-
selectedServer:
|
|
19
|
-
id: string;
|
|
20
|
-
label: string;
|
|
21
|
-
} | undefined, {
|
|
22
|
-
id: string;
|
|
23
|
-
label: string;
|
|
24
|
-
} | undefined>;
|
|
17
|
+
selectedServer: ServerObject | null;
|
|
25
18
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
26
19
|
"update:modelValue": (value: string) => any;
|
|
27
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-server-selector-block/components/Selector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Selector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-server-selector-block/components/Selector.vue"],"names":[],"mappings":"AA6EA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,KAAK,WAAW,GAAG;IACjB,8BAA8B;IAC9B,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wBAAwB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;;;;;;;;;;;;;;AA6LF,wBAQG"}
|
|
@@ -10,7 +10,7 @@ const _hoisted_3 = { class: "overflow-x-auto" };
|
|
|
10
10
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
11
|
__name: "Selector",
|
|
12
12
|
props: {
|
|
13
|
-
|
|
13
|
+
selectedServer: {},
|
|
14
14
|
servers: {},
|
|
15
15
|
target: {}
|
|
16
16
|
},
|
|
@@ -18,46 +18,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18
18
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
19
19
|
const emit = __emit;
|
|
20
20
|
const serverOptions = computed(
|
|
21
|
-
() => __props.servers.map((
|
|
22
|
-
id:
|
|
23
|
-
label:
|
|
21
|
+
() => __props.servers.map((server) => ({
|
|
22
|
+
id: server.url,
|
|
23
|
+
label: server.url
|
|
24
24
|
}))
|
|
25
25
|
);
|
|
26
|
-
const server = computed(() => __props.servers.find((s) => s.url === __props.xSelectedServer));
|
|
27
26
|
const serverUrlWithoutTrailingSlash = computed(
|
|
28
|
-
() =>
|
|
27
|
+
() => __props.selectedServer?.url?.replace(/\/$/, "") || ""
|
|
28
|
+
);
|
|
29
|
+
const selectedServerOption = computed(
|
|
30
|
+
() => serverOptions.value.find((opt) => opt.id === __props.selectedServer?.url)
|
|
29
31
|
);
|
|
30
|
-
const selectedServer = computed({
|
|
31
|
-
get: () => {
|
|
32
|
-
if (__props.xSelectedServer && serverOptions.value.length > 0) {
|
|
33
|
-
return serverOptions.value.find((opt) => opt.id === __props.xSelectedServer);
|
|
34
|
-
}
|
|
35
|
-
return void 0;
|
|
36
|
-
},
|
|
37
|
-
set: (option) => {
|
|
38
|
-
if (option) {
|
|
39
|
-
emit("update:modelValue", option.id);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
32
|
__expose({
|
|
44
|
-
server,
|
|
45
33
|
servers: __props.servers,
|
|
46
34
|
serverUrlWithoutTrailingSlash,
|
|
47
35
|
serverOptions,
|
|
48
|
-
selectedServer
|
|
36
|
+
selectedServer: __props.selectedServer
|
|
49
37
|
});
|
|
50
38
|
return (_ctx, _cache) => {
|
|
51
39
|
return serverOptions.value.length > 1 ? (openBlock(), createBlock(unref(ScalarListbox), {
|
|
52
40
|
key: 0,
|
|
53
41
|
ref: "elem",
|
|
54
|
-
modelValue: selectedServer.value,
|
|
55
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedServer.value = $event),
|
|
56
42
|
class: "group",
|
|
43
|
+
modelValue: selectedServerOption.value,
|
|
57
44
|
options: serverOptions.value,
|
|
58
45
|
placement: "bottom-start",
|
|
59
46
|
resize: "",
|
|
60
|
-
target: _ctx.target
|
|
47
|
+
target: _ctx.target,
|
|
48
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = (e) => emit("update:modelValue", e.id))
|
|
61
49
|
}, {
|
|
62
50
|
default: withCtx(() => [
|
|
63
51
|
createVNode(unref(ScalarButton), {
|
|
@@ -66,7 +54,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
66
54
|
}, {
|
|
67
55
|
default: withCtx(() => [
|
|
68
56
|
_cache[1] || (_cache[1] = createElementVNode("span", { class: "sr-only" }, "Server:", -1)),
|
|
69
|
-
createElementVNode("span", _hoisted_1, toDisplayString(serverUrlWithoutTrailingSlash.value), 1),
|
|
57
|
+
createElementVNode("span", _hoisted_1, toDisplayString(serverUrlWithoutTrailingSlash.value || "Select a server"), 1),
|
|
70
58
|
createVNode(unref(ScalarIconCaretDown), {
|
|
71
59
|
class: "text-c-2 ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100",
|
|
72
60
|
weight: "bold"
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
1
2
|
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
3
|
export type SelectorProps = {
|
|
3
|
-
/** The
|
|
4
|
-
|
|
4
|
+
/** The event bus to use for emitting events */
|
|
5
|
+
eventBus: WorkspaceEventBus;
|
|
6
|
+
/** The selected server */
|
|
7
|
+
selectedServer: ServerObject | null;
|
|
5
8
|
/** Available servers */
|
|
6
9
|
servers: ServerObject[];
|
|
7
10
|
};
|
|
@@ -9,9 +12,10 @@ export type SelectorProps = {
|
|
|
9
12
|
* ServerSelector
|
|
10
13
|
*
|
|
11
14
|
* Core component for rendering a server selector block.
|
|
12
|
-
* Handles server selection and emits a '
|
|
15
|
+
* Handles server selection and emits a 'server:update:selected' event when the selected server changes.
|
|
13
16
|
*
|
|
14
|
-
* @event
|
|
17
|
+
* @event server:update:selected - Emitted when the selected server changes
|
|
18
|
+
* @event server:update:variables - Emitted when a server variable changes
|
|
15
19
|
*/
|
|
16
20
|
declare const _default: import("vue").DefineComponent<SelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SelectorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
21
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerSelector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-server-selector-block/components/ServerSelector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ServerSelector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-server-selector-block/components/ServerSelector.vue"],"names":[],"mappings":"AA4FA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,MAAM,MAAM,aAAa,GAAG;IAC1B,+CAA+C;IAC/C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,2BAA2B;IAC3B,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wBAAwB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB,CAAA;AAED;;;;;;;;GAQG;;AACH,wBAuJC"}
|