@scalar/agent-chat 0.10.13 → 0.10.15
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/dist/App.vue.js +3 -3
- package/dist/App.vue.script.js +24 -20
- package/dist/App.vue.script.js.map +1 -1
- package/dist/Chat.vue.js +3 -3
- package/dist/Chat.vue.script.js +50 -39
- package/dist/Chat.vue.script.js.map +1 -1
- package/dist/_virtual/_plugin-vue_export-helper.js +5 -5
- package/dist/api.js +66 -57
- package/dist/api.js.map +1 -1
- package/dist/client-tools/execute-request.js +84 -60
- package/dist/client-tools/execute-request.js.map +1 -1
- package/dist/components/ActionsDropdown.vue.js +4 -4
- package/dist/components/ActionsDropdown.vue.script.js +29 -25
- package/dist/components/ActionsDropdown.vue.script.js.map +1 -1
- package/dist/components/ApprovalSection.vue.js +4 -4
- package/dist/components/ApprovalSection.vue.script.js +23 -18
- package/dist/components/ApprovalSection.vue.script.js.map +1 -1
- package/dist/components/AuthenticationProvided.vue.js +8 -7
- package/dist/components/AuthenticationProvided.vue.js.map +1 -1
- package/dist/components/AuthenticationRequired.vue.js +8 -7
- package/dist/components/AuthenticationRequired.vue.js.map +1 -1
- package/dist/components/AutosendPaused.vue.js +8 -7
- package/dist/components/AutosendPaused.vue.js.map +1 -1
- package/dist/components/BuildingRequest.vue.js +9 -8
- package/dist/components/BuildingRequest.vue.js.map +1 -1
- package/dist/components/ContextItem.vue.js +4 -4
- package/dist/components/ContextItem.vue.script.js +8 -5
- package/dist/components/ContextItem.vue.script.js.map +1 -1
- package/dist/components/ErrorMessage.vue.js +4 -4
- package/dist/components/ErrorMessage.vue.script.js +15 -12
- package/dist/components/ErrorMessage.vue.script.js.map +1 -1
- package/dist/components/FreeMessagesInfoSection.vue.js +4 -4
- package/dist/components/FreeMessagesInfoSection.vue.script.js +45 -34
- package/dist/components/FreeMessagesInfoSection.vue.script.js.map +1 -1
- package/dist/components/LoadingOpenAPISpecsSummary.vue.js +8 -7
- package/dist/components/LoadingOpenAPISpecsSummary.vue.js.map +1 -1
- package/dist/components/LoadingSearchOpenAPIOperations.vue.js +8 -7
- package/dist/components/LoadingSearchOpenAPIOperations.vue.js.map +1 -1
- package/dist/components/Logo.vue.js +9 -8
- package/dist/components/Logo.vue.js.map +1 -1
- package/dist/components/PaymentSection.vue.js +4 -4
- package/dist/components/PaymentSection.vue.script.js +20 -15
- package/dist/components/PaymentSection.vue.script.js.map +1 -1
- package/dist/components/RequestApproved.vue.js +8 -7
- package/dist/components/RequestApproved.vue.js.map +1 -1
- package/dist/components/RequestFailed.vue.js +9 -8
- package/dist/components/RequestFailed.vue.js.map +1 -1
- package/dist/components/RequestPreview.vue.js +4 -4
- package/dist/components/RequestPreview.vue.script.js +96 -73
- package/dist/components/RequestPreview.vue.script.js.map +1 -1
- package/dist/components/RequestRejected.vue.js +9 -8
- package/dist/components/RequestRejected.vue.js.map +1 -1
- package/dist/components/RequestSuccess.vue.js +8 -7
- package/dist/components/RequestSuccess.vue.js.map +1 -1
- package/dist/components/ResponseBody/ResponseBody.vue.js +3 -3
- package/dist/components/ResponseBody/ResponseBody.vue.script.js +33 -30
- package/dist/components/ResponseBody/ResponseBody.vue.script.js.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyInfo.vue.js +9 -7
- package/dist/components/ResponseBody/ResponseBodyInfo.vue.js.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.js +4 -4
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.script.js +51 -44
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.script.js.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyRaw.vue.js +3 -3
- package/dist/components/ResponseBody/ResponseBodyRaw.vue.script.js +13 -11
- package/dist/components/ResponseBody/ResponseBodyRaw.vue.script.js.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.js +3 -3
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.script.js +17 -14
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.script.js.map +1 -1
- package/dist/components/ResponseBody/helpers/media-types.js +37 -35
- package/dist/components/ResponseBody/helpers/media-types.js.map +1 -1
- package/dist/components/ResponseBody/helpers/process-response-body.js +30 -20
- package/dist/components/ResponseBody/helpers/process-response-body.js.map +1 -1
- package/dist/components/SearchPopover.vue.js +4 -4
- package/dist/components/SearchPopover.vue.script.js +52 -42
- package/dist/components/SearchPopover.vue.script.js.map +1 -1
- package/dist/components/Selector.vue.js +3 -3
- package/dist/components/Selector.vue.script.js +54 -45
- package/dist/components/Selector.vue.script.js.map +1 -1
- package/dist/components/SendingRequest.vue.js +9 -8
- package/dist/components/SendingRequest.vue.js.map +1 -1
- package/dist/components/ServerSelector.vue.js +3 -3
- package/dist/components/ServerSelector.vue.script.js +52 -43
- package/dist/components/ServerSelector.vue.script.js.map +1 -1
- package/dist/components/UploadSection.vue.js +4 -4
- package/dist/components/UploadSection.vue.script.js +38 -29
- package/dist/components/UploadSection.vue.script.js.map +1 -1
- package/dist/consts/urls.js +2 -2
- package/dist/consts/urls.js.map +1 -1
- package/dist/entities/error/constants.js +2 -2
- package/dist/entities/error/constants.js.map +1 -1
- package/dist/entities/error/helpers.js +4 -4
- package/dist/entities/error/helpers.js.map +1 -1
- package/dist/entities/index.js +10 -10
- package/dist/entities/prompt/constants.js +2 -2
- package/dist/entities/prompt/constants.js.map +1 -1
- package/dist/entities/registry/document.js +9 -9
- package/dist/entities/registry/document.js.map +1 -1
- package/dist/entities/tools/ask-for-authentication.js +6 -5
- package/dist/entities/tools/ask-for-authentication.js.map +1 -1
- package/dist/entities/tools/execute-request.js +10 -9
- package/dist/entities/tools/execute-request.js.map +1 -1
- package/dist/entities/tools/get-openapi-specs-summary.js +2 -2
- package/dist/entities/tools/get-openapi-specs-summary.js.map +1 -1
- package/dist/entities/tools/search-openapi-operations.js +4 -3
- package/dist/entities/tools/search-openapi-operations.js.map +1 -1
- package/dist/helpers.js +53 -27
- package/dist/helpers.js.map +1 -1
- package/dist/hooks/use-agent-key-documents.js +16 -15
- package/dist/hooks/use-agent-key-documents.js.map +1 -1
- package/dist/hooks/use-chat-approvals.js +27 -24
- package/dist/hooks/use-chat-approvals.js.map +1 -1
- package/dist/hooks/use-chat-error.js +19 -17
- package/dist/hooks/use-chat-error.js.map +1 -1
- package/dist/hooks/use-chat-pending-client-tool-parts.js +10 -8
- package/dist/hooks/use-chat-pending-client-tool-parts.js.map +1 -1
- package/dist/hooks/use-chat-scroll.js +13 -10
- package/dist/hooks/use-chat-scroll.js.map +1 -1
- package/dist/hooks/use-curated-documents.js +9 -8
- package/dist/hooks/use-curated-documents.js.map +1 -1
- package/dist/hooks/use-search.js +25 -16
- package/dist/hooks/use-search.js.map +1 -1
- package/dist/hooks/use-signup-link.js +19 -9
- package/dist/hooks/use-signup-link.js.map +1 -1
- package/dist/hooks/use-term-and-conditions.js +12 -11
- package/dist/hooks/use-term-and-conditions.js.map +1 -1
- package/dist/hooks/use-upload-tmp-document.js +67 -54
- package/dist/hooks/use-upload-tmp-document.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/package.json +9 -2
- package/dist/plugins/persistance.js +18 -10
- package/dist/plugins/persistance.js.map +1 -1
- package/dist/registry/add-documents-to-store.js +39 -33
- package/dist/registry/add-documents-to-store.js.map +1 -1
- package/dist/registry/create-document-name.js +3 -3
- package/dist/registry/create-document-name.js.map +1 -1
- package/dist/state/state.js +176 -132
- package/dist/state/state.js.map +1 -1
- package/dist/style.css +6604 -1
- package/dist/styles/tailwind.config.css +12 -0
- package/dist/views/Catalog/Catalog.vue.js +4 -4
- package/dist/views/Catalog/Catalog.vue.script.js +56 -39
- package/dist/views/Catalog/Catalog.vue.script.js.map +1 -1
- package/dist/views/Chat/Chat.vue.js +4 -4
- package/dist/views/Chat/Chat.vue.script.js +55 -43
- package/dist/views/Chat/Chat.vue.script.js.map +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.js +4 -4
- package/dist/views/Chat/Messages/AskForAuthentication.vue.script.js +67 -55
- package/dist/views/Chat/Messages/AskForAuthentication.vue.script.js.map +1 -1
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +4 -4
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.script.js +29 -18
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.script.js.map +1 -1
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js +3 -3
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.script.js +15 -10
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.script.js.map +1 -1
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.js +4 -4
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.script.js +55 -40
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.script.js.map +1 -1
- package/dist/views/Chat/Messages/Text.vue.js +3 -3
- package/dist/views/Chat/Messages/Text.vue.script.js +8 -6
- package/dist/views/Chat/Messages/Text.vue.script.js.map +1 -1
- package/dist/views/Layout.vue.js +4 -4
- package/dist/views/Layout.vue.script.js +21 -17
- package/dist/views/Layout.vue.script.js.map +1 -1
- package/dist/views/PromptForm.vue.js +4 -4
- package/dist/views/PromptForm.vue.script.js +214 -170
- package/dist/views/PromptForm.vue.script.js.map +1 -1
- package/dist/views/Settings/Auth.vue.js +3 -3
- package/dist/views/Settings/Auth.vue.script.js +58 -46
- package/dist/views/Settings/Auth.vue.script.js.map +1 -1
- package/dist/views/Settings/DocSettings.vue.js +4 -4
- package/dist/views/Settings/DocSettings.vue.script.js +45 -39
- package/dist/views/Settings/DocSettings.vue.script.js.map +1 -1
- package/dist/views/Settings/Settings.vue.js +4 -4
- package/dist/views/Settings/Settings.vue.script.js +59 -48
- package/dist/views/Settings/Settings.vue.script.js.map +1 -1
- package/dist/views/Start.vue.js +4 -4
- package/dist/views/Start.vue.script.js +40 -33
- package/dist/views/Start.vue.script.js.map +1 -1
- package/dist/vue-styles.css +1341 -0
- package/package.json +17 -10
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useState
|
|
2
|
-
import { computed
|
|
3
|
-
import { getSecurityRequirements
|
|
4
|
-
import { AuthSelector
|
|
5
|
-
import { useFocusWithin
|
|
1
|
+
import { useState } from "../../state/state.js";
|
|
2
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, openBlock, shallowRef, unref, watch } from "vue";
|
|
3
|
+
import { getSecurityRequirements, getSelectedSecurity, mergeSecurity } from "@scalar/workspace-store/request-example";
|
|
4
|
+
import { AuthSelector } from "@scalar/api-client/blocks/scalar-auth-selector-block";
|
|
5
|
+
import { useFocusWithin } from "@vueuse/core";
|
|
6
6
|
//#region src/views/Settings/Auth.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var Auth_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "Auth",
|
|
9
9
|
props: {
|
|
10
10
|
options: {},
|
|
@@ -15,49 +15,61 @@ var h = /* @__PURE__ */ a({
|
|
|
15
15
|
selectedServer: {},
|
|
16
16
|
environment: {}
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const { workspaceStore } = useState();
|
|
20
|
+
/** Compute what the security requirements should be for the document */
|
|
21
|
+
const securityRequirements = computed(() => getSecurityRequirements(__props.document?.security));
|
|
22
|
+
/** Merge the security schemes with the authentication config and the auth store */
|
|
23
|
+
const securitySchemes = computed(() => mergeSecurity(__props.document?.components?.securitySchemes ?? {}, __props.options.authentication?.securitySchemes, __props.authStore, __props.name));
|
|
24
|
+
/** The selected security keys for the document */
|
|
25
|
+
const selectedSecurity = computed(() => getSelectedSecurity(__props.authStore.getAuthSelectedSchemas({
|
|
20
26
|
type: "document",
|
|
21
|
-
documentName:
|
|
22
|
-
}), void 0,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
27
|
+
documentName: __props.name
|
|
28
|
+
}), void 0, securityRequirements.value, securitySchemes.value, __props.options.authentication?.preferredSecurityScheme));
|
|
29
|
+
const focusRef = shallowRef();
|
|
30
|
+
const { focused } = useFocusWithin(focusRef);
|
|
31
|
+
watch(focused, (isFocused) => {
|
|
32
|
+
if (!isFocused) return;
|
|
33
|
+
workspaceStore.update("x-scalar-active-document", __props.name);
|
|
34
|
+
});
|
|
35
|
+
return (_ctx, _cache) => {
|
|
36
|
+
return openBlock(), createElementBlock("div", {
|
|
37
|
+
ref_key: "focusRef",
|
|
38
|
+
ref: focusRef,
|
|
39
|
+
tabindex: "0"
|
|
40
|
+
}, [Object.keys(securitySchemes.value).length ? (openBlock(), createBlock(unref(AuthSelector), {
|
|
41
|
+
key: 0,
|
|
42
|
+
authStore: __props.authStore,
|
|
43
|
+
documentSlug: __props.name,
|
|
44
|
+
environment: __props.environment,
|
|
45
|
+
eventBus: __props.eventBus,
|
|
46
|
+
isReadOnly: "",
|
|
47
|
+
isStatic: "",
|
|
48
|
+
layout: "reference",
|
|
49
|
+
meta: { type: "document" },
|
|
50
|
+
persistAuth: __props.options.persistAuth,
|
|
51
|
+
proxyUrl: __props.options.proxyUrl ?? "",
|
|
52
|
+
securityRequirements: securityRequirements.value,
|
|
53
|
+
securitySchemes: securitySchemes.value,
|
|
54
|
+
selectedSecurity: selectedSecurity.value,
|
|
55
|
+
server: __props.selectedServer,
|
|
56
|
+
title: "Authentication"
|
|
57
|
+
}, null, 8, [
|
|
58
|
+
"authStore",
|
|
59
|
+
"documentSlug",
|
|
60
|
+
"environment",
|
|
61
|
+
"eventBus",
|
|
62
|
+
"persistAuth",
|
|
63
|
+
"proxyUrl",
|
|
64
|
+
"securityRequirements",
|
|
65
|
+
"securitySchemes",
|
|
66
|
+
"selectedSecurity",
|
|
67
|
+
"server"
|
|
68
|
+
])) : createCommentVNode("", true)], 512);
|
|
69
|
+
};
|
|
58
70
|
}
|
|
59
71
|
});
|
|
60
72
|
//#endregion
|
|
61
|
-
export {
|
|
73
|
+
export { Auth_vue_vue_type_script_setup_true_lang_default as default };
|
|
62
74
|
|
|
63
75
|
//# sourceMappingURL=Auth.vue.script.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Auth.vue.script.js","names":[],"sources":["../../../src/views/Settings/Auth.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { AuthSelector } from '@scalar/api-client/blocks/scalar-auth-selector-block'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getSecurityRequirements,\n getSelectedSecurity,\n mergeSecurity,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace'\nimport { useFocusWithin } from '@vueuse/core'\nimport { computed, shallowRef, watch } from 'vue'\n\nimport { useState } from '@/state/state'\n\nconst { document, name, environment, eventBus, options, authStore } =\n defineProps<{\n options: Pick<\n ApiReferenceConfigurationRaw,\n 'authentication' | 'persistAuth' | 'proxyUrl'\n >\n name: string\n authStore: AuthStore\n document: WorkspaceDocument | undefined\n eventBus: WorkspaceEventBus\n selectedServer: ServerObject | null\n environment: XScalarEnvironment\n }>()\n\nconst { workspaceStore } = useState()\n\n/** Compute what the security requirements should be for the document */\nconst securityRequirements = computed(() =>\n getSecurityRequirements(document?.security),\n)\n\n/** Merge the security schemes with the authentication config and the auth store */\nconst securitySchemes = computed(() =>\n mergeSecurity(\n document?.components?.securitySchemes ?? {},\n options.authentication?.securitySchemes,\n authStore,\n name,\n ),\n)\n\n/** The selected security keys for the document */\nconst selectedSecurity = computed(() =>\n getSelectedSecurity(\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName: name,\n }),\n undefined,\n securityRequirements.value,\n securitySchemes.value,\n options.authentication?.preferredSecurityScheme,\n ),\n)\n\nconst focusRef = shallowRef()\nconst { focused } = useFocusWithin(focusRef)\n\nwatch(focused, (isFocused) => {\n if (!isFocused) {\n return\n }\n\n workspaceStore.update('x-scalar-active-document', name)\n})\n</script>\n<template>\n <div\n ref=\"focusRef\"\n tabindex=\"0\">\n <AuthSelector\n v-if=\"Object.keys(securitySchemes).length\"\n :authStore\n :documentSlug=\"name\"\n :environment\n :eventBus\n isReadOnly\n isStatic\n layout=\"reference\"\n :meta=\"{ type: 'document' }\"\n :persistAuth=\"options.persistAuth\"\n :proxyUrl=\"options.proxyUrl ?? ''\"\n :securityRequirements\n :securitySchemes\n :selectedSecurity\n :server=\"selectedServer\"\n title=\"Authentication\" />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAgCA,
|
|
1
|
+
{"version":3,"file":"Auth.vue.script.js","names":[],"sources":["../../../src/views/Settings/Auth.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { AuthSelector } from '@scalar/api-client/blocks/scalar-auth-selector-block'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getSecurityRequirements,\n getSelectedSecurity,\n mergeSecurity,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace'\nimport { useFocusWithin } from '@vueuse/core'\nimport { computed, shallowRef, watch } from 'vue'\n\nimport { useState } from '@/state/state'\n\nconst { document, name, environment, eventBus, options, authStore } =\n defineProps<{\n options: Pick<\n ApiReferenceConfigurationRaw,\n 'authentication' | 'persistAuth' | 'proxyUrl'\n >\n name: string\n authStore: AuthStore\n document: WorkspaceDocument | undefined\n eventBus: WorkspaceEventBus\n selectedServer: ServerObject | null\n environment: XScalarEnvironment\n }>()\n\nconst { workspaceStore } = useState()\n\n/** Compute what the security requirements should be for the document */\nconst securityRequirements = computed(() =>\n getSecurityRequirements(document?.security),\n)\n\n/** Merge the security schemes with the authentication config and the auth store */\nconst securitySchemes = computed(() =>\n mergeSecurity(\n document?.components?.securitySchemes ?? {},\n options.authentication?.securitySchemes,\n authStore,\n name,\n ),\n)\n\n/** The selected security keys for the document */\nconst selectedSecurity = computed(() =>\n getSelectedSecurity(\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName: name,\n }),\n undefined,\n securityRequirements.value,\n securitySchemes.value,\n options.authentication?.preferredSecurityScheme,\n ),\n)\n\nconst focusRef = shallowRef()\nconst { focused } = useFocusWithin(focusRef)\n\nwatch(focused, (isFocused) => {\n if (!isFocused) {\n return\n }\n\n workspaceStore.update('x-scalar-active-document', name)\n})\n</script>\n<template>\n <div\n ref=\"focusRef\"\n tabindex=\"0\">\n <AuthSelector\n v-if=\"Object.keys(securitySchemes).length\"\n :authStore\n :documentSlug=\"name\"\n :environment\n :eventBus\n isReadOnly\n isStatic\n layout=\"reference\"\n :meta=\"{ type: 'document' }\"\n :persistAuth=\"options.persistAuth\"\n :proxyUrl=\"options.proxyUrl ?? ''\"\n :securityRequirements\n :securitySchemes\n :selectedSecurity\n :server=\"selectedServer\"\n title=\"Authentication\" />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAgCA,MAAM,EAAE,mBAAmB,UAAS;;EAGpC,MAAM,uBAAuB,eAC3B,wBAAwB,QAAA,UAAU,SAAS,CAC7C;;EAGA,MAAM,kBAAkB,eACtB,cACE,QAAA,UAAU,YAAY,mBAAmB,EAAE,EAC3C,QAAA,QAAQ,gBAAgB,iBACxB,QAAA,WACA,QAAA,KACD,CACH;;EAGA,MAAM,mBAAmB,eACvB,oBACE,QAAA,UAAU,uBAAuB;GAC/B,MAAM;GACN,cAAc,QAAA;GACf,CAAC,EACF,KAAA,GACA,qBAAqB,OACrB,gBAAgB,OAChB,QAAA,QAAQ,gBAAgB,wBACzB,CACH;EAEA,MAAM,WAAW,YAAW;EAC5B,MAAM,EAAE,YAAY,eAAe,SAAQ;AAE3C,QAAM,UAAU,cAAc;AAC5B,OAAI,CAAC,UACH;AAGF,kBAAe,OAAO,4BAA4B,QAAA,KAAI;IACvD;;uBAGC,mBAoBM,OAAA;aAnBA;IAAJ,KAAI;IACJ,UAAS;OAED,OAAO,KAAK,gBAAA,MAAe,CAAE,UAAA,WAAA,EADrC,YAgB2B,MAAA,aAAA,EAAA;;IAdxB,WAAA,QAAA;IACA,cAAc,QAAA;IACd,aAAA,QAAA;IACA,UAAA,QAAA;IACD,YAAA;IACA,UAAA;IACA,QAAO;IACN,MAAM,EAAA,MAAA,YAAoB;IAC1B,aAAa,QAAA,QAAQ;IACrB,UAAU,QAAA,QAAQ,YAAQ;IAC1B,sBAAA,qBAAA;IACA,iBAAA,gBAAA;IACA,kBAAA,iBAAA;IACA,QAAQ,QAAA;IACT,OAAM"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import DocSettings_vue_vue_type_script_setup_true_lang_default from "./DocSettings.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/views/Settings/DocSettings.vue
|
|
5
|
-
var
|
|
5
|
+
var DocSettings_default = /* @__PURE__ */ _plugin_vue_export_helper_default(DocSettings_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-dd964244"]]);
|
|
6
6
|
//#endregion
|
|
7
|
-
export {
|
|
7
|
+
export { DocSettings_default as default };
|
|
8
8
|
|
|
9
9
|
//# sourceMappingURL=DocSettings.vue.js.map
|
|
@@ -1,50 +1,56 @@
|
|
|
1
|
-
import { useState
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { computed
|
|
5
|
-
import { getActiveEnvironment
|
|
1
|
+
import { useState } from "../../state/state.js";
|
|
2
|
+
import Auth_default from "./Auth.vue.js";
|
|
3
|
+
import ServerSelector_default from "../../components/ServerSelector.vue.js";
|
|
4
|
+
import { computed, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, unref } from "vue";
|
|
5
|
+
import { getActiveEnvironment, getSelectedServer, getServers } from "@scalar/workspace-store/request-example";
|
|
6
6
|
//#region src/views/Settings/DocSettings.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var _hoisted_1 = { class: "docSettings" };
|
|
8
|
+
var DocSettings_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
9
|
__name: "DocSettings",
|
|
9
10
|
props: {
|
|
10
11
|
document: {},
|
|
11
12
|
name: {}
|
|
12
13
|
},
|
|
13
|
-
setup(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const { workspaceStore, config, eventBus } = useState();
|
|
16
|
+
const environment = computed(() => getActiveEnvironment(workspaceStore, __props.document).environment);
|
|
17
|
+
const selectedServer = computed(() => {
|
|
18
|
+
const servers = getServers(__props.document.servers, { documentUrl: __props.document["x-scalar-original-source-url"] });
|
|
19
|
+
return getSelectedServer(__props.document, null, null, servers);
|
|
20
|
+
});
|
|
21
|
+
const securitySchemes = computed(() => __props.document.components?.securitySchemes ?? {});
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", null, [createVNode(Auth_default, {
|
|
24
|
+
authStore: unref(workspaceStore).auth,
|
|
25
|
+
document: __props.document,
|
|
26
|
+
environment: environment.value,
|
|
27
|
+
eventBus: unref(eventBus),
|
|
28
|
+
name: __props.name,
|
|
29
|
+
options: unref(config),
|
|
30
|
+
securitySchemes: securitySchemes.value,
|
|
31
|
+
selectedServer: selectedServer.value
|
|
32
|
+
}, null, 8, [
|
|
33
|
+
"authStore",
|
|
34
|
+
"document",
|
|
35
|
+
"environment",
|
|
36
|
+
"eventBus",
|
|
37
|
+
"name",
|
|
38
|
+
"options",
|
|
39
|
+
"securitySchemes",
|
|
40
|
+
"selectedServer"
|
|
41
|
+
])]), createElementVNode("div", null, [createVNode(ServerSelector_default, {
|
|
42
|
+
eventBus: unref(eventBus),
|
|
43
|
+
selectedServer: selectedServer.value,
|
|
44
|
+
servers: __props.document.servers ?? []
|
|
45
|
+
}, null, 8, [
|
|
46
|
+
"eventBus",
|
|
47
|
+
"selectedServer",
|
|
48
|
+
"servers"
|
|
49
|
+
])])]);
|
|
50
|
+
};
|
|
45
51
|
}
|
|
46
52
|
});
|
|
47
53
|
//#endregion
|
|
48
|
-
export {
|
|
54
|
+
export { DocSettings_vue_vue_type_script_setup_true_lang_default as default };
|
|
49
55
|
|
|
50
56
|
//# sourceMappingURL=DocSettings.vue.script.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocSettings.vue.script.js","names":[],"sources":["../../../src/views/Settings/DocSettings.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n getActiveEnvironment,\n getSelectedServer,\n getServers,\n} from '@scalar/workspace-store/request-example'\nimport { type WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace'\nimport { computed } from 'vue'\n\nimport ServerSelector from '@/components/ServerSelector.vue'\nimport { useState } from '@/state/state'\nimport Auth from '@/views/Settings/Auth.vue'\n\nconst { document, name } = defineProps<{\n document: WorkspaceDocument\n name: string\n}>()\n\nconst { workspaceStore, config, eventBus } = useState()\n\nconst environment = computed(\n () => getActiveEnvironment(workspaceStore, document).environment,\n)\n\nconst selectedServer = computed(() => {\n const servers = getServers(document.servers, {\n documentUrl: document['x-scalar-original-source-url'],\n })\n\n return getSelectedServer(document, null, null, servers)\n})\n\nconst securitySchemes = computed(\n () => document.components?.securitySchemes ?? {},\n)\n</script>\n\n<template>\n <div class=\"docSettings\">\n <div>\n <Auth\n :authStore=\"workspaceStore.auth\"\n :document\n :environment\n :eventBus\n :name\n :options=\"config\"\n :securitySchemes\n :selectedServer />\n </div>\n <div>\n <ServerSelector\n :eventBus\n :selectedServer\n :servers=\"document.servers ?? []\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.docSettings {\n display: flex;\n flex-direction: column;\n gap: 12px;\n margin-bottom: 12px;\n font-size: var(--scalar-font-size-3);\n max-height: 600px;\n}\n\n.documentName {\n font-weight: var(--scalar-semibold);\n}\n</style>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocSettings.vue.script.js","names":[],"sources":["../../../src/views/Settings/DocSettings.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n getActiveEnvironment,\n getSelectedServer,\n getServers,\n} from '@scalar/workspace-store/request-example'\nimport { type WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace'\nimport { computed } from 'vue'\n\nimport ServerSelector from '@/components/ServerSelector.vue'\nimport { useState } from '@/state/state'\nimport Auth from '@/views/Settings/Auth.vue'\n\nconst { document, name } = defineProps<{\n document: WorkspaceDocument\n name: string\n}>()\n\nconst { workspaceStore, config, eventBus } = useState()\n\nconst environment = computed(\n () => getActiveEnvironment(workspaceStore, document).environment,\n)\n\nconst selectedServer = computed(() => {\n const servers = getServers(document.servers, {\n documentUrl: document['x-scalar-original-source-url'],\n })\n\n return getSelectedServer(document, null, null, servers)\n})\n\nconst securitySchemes = computed(\n () => document.components?.securitySchemes ?? {},\n)\n</script>\n\n<template>\n <div class=\"docSettings\">\n <div>\n <Auth\n :authStore=\"workspaceStore.auth\"\n :document\n :environment\n :eventBus\n :name\n :options=\"config\"\n :securitySchemes\n :selectedServer />\n </div>\n <div>\n <ServerSelector\n :eventBus\n :selectedServer\n :servers=\"document.servers ?? []\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.docSettings {\n display: flex;\n flex-direction: column;\n gap: 12px;\n margin-bottom: 12px;\n font-size: var(--scalar-font-size-3);\n max-height: 600px;\n}\n\n.documentName {\n font-weight: var(--scalar-semibold);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;EAkBA,MAAM,EAAE,gBAAgB,QAAQ,aAAa,UAAS;EAEtD,MAAM,cAAc,eACZ,qBAAqB,gBAAgB,QAAA,SAAS,CAAC,YACvD;EAEA,MAAM,iBAAiB,eAAe;GACpC,MAAM,UAAU,WAAW,QAAA,SAAS,SAAS,EAC3C,aAAa,QAAA,SAAS,iCACvB,CAAA;AAED,UAAO,kBAAkB,QAAA,UAAU,MAAM,MAAM,QAAO;IACvD;EAED,MAAM,kBAAkB,eAChB,QAAA,SAAS,YAAY,mBAAmB,EAAE,CAClD;;uBAIE,mBAkBM,OAlBN,YAkBM,CAjBJ,mBAUM,OAAA,MAAA,CATJ,YAQoB,cAAA;IAPjB,WAAW,MAAA,eAAc,CAAC;IAC1B,UAAA,QAAA;IACA,aAAA,YAAA;IACA,UAAA,MAAA,SAAQ;IACR,MAAA,QAAA;IACA,SAAS,MAAA,OAAM;IACf,iBAAA,gBAAA;IACA,gBAAA,eAAA;;;;;;;;;;SAEL,mBAKM,OAAA,MAAA,CAJJ,YAGsC,wBAAA;IAFnC,UAAA,MAAA,SAAQ;IACR,gBAAA,eAAA;IACA,SAAS,QAAA,SAAS,WAAO,EAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import Settings_vue_vue_type_script_setup_true_lang_default from "./Settings.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region src/views/Settings/Settings.vue
|
|
6
|
-
var
|
|
6
|
+
var Settings_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Settings_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-5e4bca68"]]);
|
|
7
7
|
//#endregion
|
|
8
|
-
export {
|
|
8
|
+
export { Settings_default as default };
|
|
9
9
|
|
|
10
10
|
//# sourceMappingURL=Settings.vue.js.map
|
|
@@ -1,59 +1,70 @@
|
|
|
1
|
-
import { URLS
|
|
2
|
-
import { useState
|
|
3
|
-
import
|
|
4
|
-
import { Fragment
|
|
5
|
-
import { ScalarColorModeToggle
|
|
6
|
-
import { ScalarIconCaretDown
|
|
1
|
+
import { URLS } from "../../consts/urls.js";
|
|
2
|
+
import { useState } from "../../state/state.js";
|
|
3
|
+
import DocSettings_default from "./DocSettings.vue.js";
|
|
4
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, isRef, normalizeClass, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
5
|
+
import { ScalarColorModeToggle, ScalarModal, ScalarTextInput } from "@scalar/components";
|
|
6
|
+
import { ScalarIconCaretDown, ScalarIconCaretRight } from "@scalar/icons";
|
|
7
7
|
//#region src/views/Settings/Settings.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
8
|
+
var _hoisted_1 = { class: "settingsHeading" };
|
|
9
|
+
var _hoisted_2 = { class: "documentList" };
|
|
10
|
+
var _hoisted_3 = ["onClick"];
|
|
11
|
+
var _hoisted_4 = { key: 0 };
|
|
12
|
+
var _hoisted_5 = {
|
|
9
13
|
key: 1,
|
|
10
14
|
class: "noDocuments"
|
|
11
|
-
}
|
|
15
|
+
};
|
|
16
|
+
var _hoisted_6 = { class: "proxyUrlContainer" };
|
|
17
|
+
var _hoisted_7 = ["href"];
|
|
18
|
+
var Settings_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
12
19
|
__name: "Settings",
|
|
13
20
|
props: { modalState: {} },
|
|
14
|
-
setup(
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
21
|
+
setup(__props) {
|
|
22
|
+
const { workspaceStore, proxyUrlRaw } = useState();
|
|
23
|
+
function selectDocument(name) {
|
|
24
|
+
workspaceStore.update("x-scalar-active-document", name);
|
|
18
25
|
}
|
|
19
|
-
return (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
key:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
return openBlock(), createBlock(unref(ScalarModal), {
|
|
28
|
+
class: "settingsModal",
|
|
29
|
+
state: __props.modalState
|
|
30
|
+
}, {
|
|
31
|
+
default: withCtx(() => [
|
|
32
|
+
createElementVNode("div", _hoisted_1, [_cache[1] || (_cache[1] = createElementVNode("h1", null, "Settings", -1)), createVNode(unref(ScalarColorModeToggle), { class: "colorToggle ml-auto" })]),
|
|
33
|
+
createElementVNode("div", _hoisted_2, [Object.entries(unref(workspaceStore).workspace.documents).length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(Object.entries(unref(workspaceStore).workspace.documents), ([name, document]) => {
|
|
34
|
+
return openBlock(), createElementBlock("div", {
|
|
35
|
+
key: name,
|
|
36
|
+
class: "document"
|
|
37
|
+
}, [createElementVNode("button", {
|
|
38
|
+
class: normalizeClass(["documentName", { documentNameActive: unref(workspaceStore).workspace.activeDocument === document }]),
|
|
39
|
+
type: "button",
|
|
40
|
+
onClick: ($event) => selectDocument(name)
|
|
41
|
+
}, [createTextVNode(" @" + toDisplayString(name) + " ", 1), unref(workspaceStore).workspace.activeDocument === document ? (openBlock(), createBlock(unref(ScalarIconCaretDown), { key: 0 })) : (openBlock(), createBlock(unref(ScalarIconCaretRight), { key: 1 }))], 10, _hoisted_3), unref(workspaceStore).workspace.activeDocument === document ? (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(DocSettings_default, {
|
|
42
|
+
document,
|
|
43
|
+
name
|
|
44
|
+
}, null, 8, ["document", "name"])])) : createCommentVNode("", true)]);
|
|
45
|
+
}), 128)) : (openBlock(), createElementBlock("div", _hoisted_5, " There's no API definition loaded. Use the + button to load APIs. "))]),
|
|
46
|
+
createElementVNode("div", _hoisted_6, [
|
|
47
|
+
_cache[3] || (_cache[3] = createElementVNode("label", { for: "proxyUrl" }, "CORS Proxy", -1)),
|
|
48
|
+
createElementVNode("p", null, [_cache[2] || (_cache[2] = createTextVNode(" All requests will be sent through the specified proxy URL to help avoid CORS (Cross-Origin Resource Sharing) issues. ", -1)), createElementVNode("a", {
|
|
49
|
+
class: "underline",
|
|
50
|
+
href: unref(URLS).PROXY_SOURCE_CODE,
|
|
51
|
+
target: "_blank"
|
|
52
|
+
}, " Read more ", 8, _hoisted_7)]),
|
|
53
|
+
createVNode(unref(ScalarTextInput), {
|
|
54
|
+
id: "proxyUrl",
|
|
55
|
+
modelValue: unref(proxyUrlRaw),
|
|
56
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(proxyUrlRaw) ? proxyUrlRaw.value = $event : null),
|
|
57
|
+
label: "Proxy URL",
|
|
58
|
+
placeholder: unref(URLS).DEFAULT_PROXY_URL
|
|
59
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
60
|
+
])
|
|
61
|
+
]),
|
|
62
|
+
_: 1
|
|
63
|
+
}, 8, ["state"]);
|
|
64
|
+
};
|
|
54
65
|
}
|
|
55
66
|
});
|
|
56
67
|
//#endregion
|
|
57
|
-
export {
|
|
68
|
+
export { Settings_vue_vue_type_script_setup_true_lang_default as default };
|
|
58
69
|
|
|
59
70
|
//# sourceMappingURL=Settings.vue.script.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.vue.script.js","names":[],"sources":["../../../src/views/Settings/Settings.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarColorModeToggle,\n ScalarModal,\n ScalarTextInput,\n type ModalState,\n} from '@scalar/components'\nimport { ScalarIconCaretDown, ScalarIconCaretRight } from '@scalar/icons'\n\nimport { URLS } from '@/consts/urls'\nimport { useState } from '@/state/state'\nimport DocSettings from '@/views/Settings/DocSettings.vue'\n\nconst { modalState } = defineProps<{\n modalState: ModalState\n}>()\n\nconst { workspaceStore, proxyUrlRaw } = useState()\n\nfunction selectDocument(name: string) {\n workspaceStore.update('x-scalar-active-document', name)\n}\n</script>\n\n<template>\n <ScalarModal\n class=\"settingsModal\"\n :state=\"modalState\">\n <div class=\"settingsHeading\">\n <h1>Settings</h1>\n <ScalarColorModeToggle class=\"colorToggle ml-auto\" />\n </div>\n <div class=\"documentList\">\n <template\n v-if=\"Object.entries(workspaceStore.workspace.documents).length\">\n <div\n v-for=\"[name, document] of Object.entries(\n workspaceStore.workspace.documents,\n )\"\n :key=\"name\"\n class=\"document\">\n <button\n class=\"documentName\"\n :class=\"{\n documentNameActive:\n workspaceStore.workspace.activeDocument === document,\n }\"\n type=\"button\"\n @click=\"selectDocument(name)\">\n @{{ name }}\n <ScalarIconCaretDown\n v-if=\"workspaceStore.workspace.activeDocument === document\" />\n <ScalarIconCaretRight v-else />\n </button>\n <div v-if=\"workspaceStore.workspace.activeDocument === document\">\n <DocSettings\n :document\n :name />\n </div>\n </div>\n </template>\n <div\n v-else\n class=\"noDocuments\">\n There's no API definition loaded. Use the + button to load APIs.\n </div>\n </div>\n\n <div class=\"proxyUrlContainer\">\n <label for=\"proxyUrl\">CORS Proxy</label>\n <p>\n All requests will be sent through the specified proxy URL to help avoid\n CORS (Cross-Origin Resource Sharing) issues.\n <a\n class=\"underline\"\n :href=\"URLS.PROXY_SOURCE_CODE\"\n target=\"_blank\">\n Read more\n </a>\n </p>\n <ScalarTextInput\n id=\"proxyUrl\"\n v-model=\"proxyUrlRaw\"\n label=\"Proxy URL\"\n :placeholder=\"URLS.DEFAULT_PROXY_URL\" />\n </div>\n </ScalarModal>\n</template>\n\n<style>\n/* Prevent auth method dropdown from going behind the modal */\n.settingsModal .scalar-modal-layout {\n z-index: 10 !important;\n}\n\n.settingsModal .scalar-modal-body {\n overflow-y: auto;\n overflow-x: hidden;\n}\n</style>\n\n<style scoped>\n.documentList {\n display: flex;\n flex-direction: column;\n font-size: var(--scalar-font-size-3);\n margin-bottom: 12px;\n}\n\n.document {\n display: flex;\n flex-direction: column;\n width: calc(100% + 24px);\n left: -12px;\n position: relative;\n padding: 0 12px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.document:first-of-type:not(:last-of-type) {\n border-bottom: none;\n}\n\n.documentName {\n gap: 4px;\n display: flex;\n align-items: center;\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-2);\n padding: 12px 0;\n}\n\n.documentNameActive {\n color: var(--scalar-color-1);\n}\n\n.settingsHeading {\n font-size: 19px;\n margin-bottom: 12px;\n display: flex;\n gap: 5px;\n align-items: center;\n font-weight: var(--scalar-semibold);\n}\n\n.proxyUrlContainer {\n font-size: var(--scalar-font-size-3);\n display: flex;\n gap: 5px;\n flex-direction: column;\n}\n.proxyUrlContainer label {\n font-weight: var(--scalar-semibold);\n}\n.noDocuments {\n color: var(--scalar-color-2);\n margin-bottom: 10px;\n}\n</style>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Settings.vue.script.js","names":[],"sources":["../../../src/views/Settings/Settings.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarColorModeToggle,\n ScalarModal,\n ScalarTextInput,\n type ModalState,\n} from '@scalar/components'\nimport { ScalarIconCaretDown, ScalarIconCaretRight } from '@scalar/icons'\n\nimport { URLS } from '@/consts/urls'\nimport { useState } from '@/state/state'\nimport DocSettings from '@/views/Settings/DocSettings.vue'\n\nconst { modalState } = defineProps<{\n modalState: ModalState\n}>()\n\nconst { workspaceStore, proxyUrlRaw } = useState()\n\nfunction selectDocument(name: string) {\n workspaceStore.update('x-scalar-active-document', name)\n}\n</script>\n\n<template>\n <ScalarModal\n class=\"settingsModal\"\n :state=\"modalState\">\n <div class=\"settingsHeading\">\n <h1>Settings</h1>\n <ScalarColorModeToggle class=\"colorToggle ml-auto\" />\n </div>\n <div class=\"documentList\">\n <template\n v-if=\"Object.entries(workspaceStore.workspace.documents).length\">\n <div\n v-for=\"[name, document] of Object.entries(\n workspaceStore.workspace.documents,\n )\"\n :key=\"name\"\n class=\"document\">\n <button\n class=\"documentName\"\n :class=\"{\n documentNameActive:\n workspaceStore.workspace.activeDocument === document,\n }\"\n type=\"button\"\n @click=\"selectDocument(name)\">\n @{{ name }}\n <ScalarIconCaretDown\n v-if=\"workspaceStore.workspace.activeDocument === document\" />\n <ScalarIconCaretRight v-else />\n </button>\n <div v-if=\"workspaceStore.workspace.activeDocument === document\">\n <DocSettings\n :document\n :name />\n </div>\n </div>\n </template>\n <div\n v-else\n class=\"noDocuments\">\n There's no API definition loaded. Use the + button to load APIs.\n </div>\n </div>\n\n <div class=\"proxyUrlContainer\">\n <label for=\"proxyUrl\">CORS Proxy</label>\n <p>\n All requests will be sent through the specified proxy URL to help avoid\n CORS (Cross-Origin Resource Sharing) issues.\n <a\n class=\"underline\"\n :href=\"URLS.PROXY_SOURCE_CODE\"\n target=\"_blank\">\n Read more\n </a>\n </p>\n <ScalarTextInput\n id=\"proxyUrl\"\n v-model=\"proxyUrlRaw\"\n label=\"Proxy URL\"\n :placeholder=\"URLS.DEFAULT_PROXY_URL\" />\n </div>\n </ScalarModal>\n</template>\n\n<style>\n/* Prevent auth method dropdown from going behind the modal */\n.settingsModal .scalar-modal-layout {\n z-index: 10 !important;\n}\n\n.settingsModal .scalar-modal-body {\n overflow-y: auto;\n overflow-x: hidden;\n}\n</style>\n\n<style scoped>\n.documentList {\n display: flex;\n flex-direction: column;\n font-size: var(--scalar-font-size-3);\n margin-bottom: 12px;\n}\n\n.document {\n display: flex;\n flex-direction: column;\n width: calc(100% + 24px);\n left: -12px;\n position: relative;\n padding: 0 12px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.document:first-of-type:not(:last-of-type) {\n border-bottom: none;\n}\n\n.documentName {\n gap: 4px;\n display: flex;\n align-items: center;\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-2);\n padding: 12px 0;\n}\n\n.documentNameActive {\n color: var(--scalar-color-1);\n}\n\n.settingsHeading {\n font-size: 19px;\n margin-bottom: 12px;\n display: flex;\n gap: 5px;\n align-items: center;\n font-weight: var(--scalar-semibold);\n}\n\n.proxyUrlContainer {\n font-size: var(--scalar-font-size-3);\n display: flex;\n gap: 5px;\n flex-direction: column;\n}\n.proxyUrlContainer label {\n font-weight: var(--scalar-semibold);\n}\n.noDocuments {\n color: var(--scalar-color-2);\n margin-bottom: 10px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,EAAE,gBAAgB,gBAAgB,UAAS;EAEjD,SAAS,eAAe,MAAc;AACpC,kBAAe,OAAO,4BAA4B,KAAI;;;uBAKtD,YA6Dc,MAAA,YAAA,EAAA;IA5DZ,OAAM;IACL,OAAO,QAAA;;2BAIF;KAHN,mBAGM,OAHN,YAGM,CAAA,OAAA,OAAA,OAAA,KAFJ,mBAAiB,MAAA,MAAb,YAAQ,GAAA,GACZ,YAAqD,MAAA,sBAAA,EAAA,EAA9B,OAAM,uBAAqB,CAAA,CAAA,CAAA;KAEpD,mBAkCM,OAlCN,YAkCM,CAhCI,OAAO,QAAQ,MAAA,eAAc,CAAC,UAAU,UAAS,CAAE,UAAA,UAAA,KAAA,EACzD,mBAwBM,UAAA,EAAA,KAAA,GAAA,EAAA,WAvBuB,OAAO,QAAqB,MAAA,eAAc,CAAC,UAAU,UAAA,GAAA,CAAxE,MAAM,cAAQ;0BADxB,mBAwBM,OAAA;OApBH,KAAK;OACN,OAAM;UACN,mBAYS,UAAA;OAXP,OAAK,eAAA,CAAC,gBAAc,EAAA,oBACwC,MAAA,eAAc,CAAC,UAAU,mBAAmB,UAAA,CAAA,CAAA;OAIxG,MAAK;OACJ,UAAK,WAAE,eAAe,KAAI;0BAAG,OAC7B,gBAAG,KAAI,GAAG,KACX,EAAA,EACQ,MAAA,eAAc,CAAC,UAAU,mBAAmB,YAAA,WAAA,EADpD,YACgE,MAAA,oBAAA,EAAA,EAAA,KAAA,GAAA,CAAA,KAAA,WAAA,EAChE,YAA+B,MAAA,qBAAA,EAAA,EAAA,KAAA,GAAA,CAAA,EAAA,EAAA,IAAA,WAAA,EAEtB,MAAA,eAAc,CAAC,UAAU,mBAAmB,YAAA,WAAA,EAAvD,mBAIM,OAAA,YAAA,CAHJ,YAEU,qBAAA;OADP;OACA;;+BAIT,mBAIM,OAJN,YAEsB,qEAEtB,EAAA,CAAA;KAGF,mBAiBM,OAjBN,YAiBM;gCAhBJ,mBAAwC,SAAA,EAAjC,KAAI,YAAU,EAAC,cAAU,GAAA;MAChC,mBASI,KAAA,MAAA,CAAA,OAAA,OAAA,OAAA,KAAA,gBATD,0HAGD,GAAA,GAAA,mBAKI,KAAA;OAJF,OAAM;OACL,MAAM,MAAA,KAAI,CAAC;OACZ,QAAO;SAAS,eAElB,GAAA,WAAA,CAAA,CAAA;MAEF,YAI0C,MAAA,gBAAA,EAAA;OAHxC,IAAG;mBACM,MAAA,YAAW;qGAAA,QAAA,SAAA;OACpB,OAAM;OACL,aAAa,MAAA,KAAI,CAAC"}
|
package/dist/views/Start.vue.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import _plugin_vue_export_helper_default from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import Start_vue_vue_type_script_setup_true_lang_default from "./Start.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/views/Start.vue
|
|
5
|
-
var
|
|
5
|
+
var Start_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Start_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-56f7e8dd"]]);
|
|
6
6
|
//#endregion
|
|
7
|
-
export {
|
|
7
|
+
export { Start_default as default };
|
|
8
8
|
|
|
9
9
|
//# sourceMappingURL=Start.vue.js.map
|
|
@@ -1,41 +1,48 @@
|
|
|
1
|
-
import { URLS
|
|
2
|
-
import { useState
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Fragment
|
|
1
|
+
import { URLS } from "../consts/urls.js";
|
|
2
|
+
import { useState } from "../state/state.js";
|
|
3
|
+
import PromptForm_default from "./PromptForm.vue.js";
|
|
4
|
+
import Logo_default from "../components/Logo.vue.js";
|
|
5
|
+
import { Fragment, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, unref } from "vue";
|
|
6
6
|
//#region src/views/Start.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var _hoisted_1 = { class: "startContainer" };
|
|
8
|
+
var _hoisted_2 = { class: "disclaimerText" };
|
|
9
|
+
var _hoisted_3 = ["href"];
|
|
10
|
+
var _hoisted_4 = ["href"];
|
|
11
|
+
var Start_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
12
|
__name: "Start",
|
|
9
13
|
emits: ["submit", "uploadApi"],
|
|
10
|
-
setup(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
14
|
+
setup(__props, { emit: __emit }) {
|
|
15
|
+
const emit = __emit;
|
|
16
|
+
const { mode } = useState();
|
|
17
|
+
return (_ctx, _cache) => {
|
|
18
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
19
|
+
createVNode(Logo_default, { class: "agentLogo" }),
|
|
20
|
+
_cache[4] || (_cache[4] = createElementVNode("h1", { class: "heading" }, "How can I help you today?", -1)),
|
|
21
|
+
createVNode(PromptForm_default, {
|
|
22
|
+
ref: "promptFormField",
|
|
23
|
+
onSubmit: _cache[0] || (_cache[0] = ($event) => emit("submit")),
|
|
24
|
+
onUploadApi: _cache[1] || (_cache[1] = ($event) => emit("uploadApi"))
|
|
25
|
+
}, null, 512),
|
|
26
|
+
createElementVNode("p", _hoisted_2, [
|
|
27
|
+
unref(mode) === "preview" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" By messaging Agent Scalar your OpenAPI document will be temporarily uploaded to Scalar's servers. You must agree to our ")], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode("By messaging Agent Scalar you agree to our ")], 64)),
|
|
28
|
+
createElementVNode("a", {
|
|
29
|
+
class: "disclaimerLink",
|
|
30
|
+
href: unref(URLS).TERMS_AND_CONDITIONS,
|
|
31
|
+
target: "_blank"
|
|
32
|
+
}, "Terms", 8, _hoisted_3),
|
|
33
|
+
_cache[2] || (_cache[2] = createTextVNode(" and ", -1)),
|
|
34
|
+
createElementVNode("a", {
|
|
35
|
+
class: "disclaimerLink",
|
|
36
|
+
href: unref(URLS).PRIVACY_POLICY,
|
|
37
|
+
target: "_blank"
|
|
38
|
+
}, "Privacy Policy", 8, _hoisted_4),
|
|
39
|
+
_cache[3] || (_cache[3] = createTextVNode(". ", -1))
|
|
40
|
+
])
|
|
41
|
+
]);
|
|
42
|
+
};
|
|
36
43
|
}
|
|
37
44
|
});
|
|
38
45
|
//#endregion
|
|
39
|
-
export {
|
|
46
|
+
export { Start_vue_vue_type_script_setup_true_lang_default as default };
|
|
40
47
|
|
|
41
48
|
//# sourceMappingURL=Start.vue.script.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Start.vue.script.js","names":[],"sources":["../../src/views/Start.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport Logo from '@/components/Logo.vue'\nimport { URLS } from '@/consts/urls'\nimport { useState } from '@/state/state'\nimport PromptForm from '@/views/PromptForm.vue'\n\nconst emit = defineEmits<{\n (e: 'submit'): void\n (e: 'uploadApi'): void\n}>()\n\nconst { mode } = useState()\n</script>\n\n<template>\n <div class=\"startContainer\">\n <Logo class=\"agentLogo\" />\n <h1 class=\"heading\">How can I help you today?</h1>\n <PromptForm\n ref=\"promptFormField\"\n @submit=\"emit('submit')\"\n @uploadApi=\"emit('uploadApi')\" />\n <p class=\"disclaimerText\">\n <template v-if=\"mode === 'preview'\">\n By messaging Agent Scalar your OpenAPI document will be temporarily\n uploaded to Scalar's servers. You must agree to our\n </template>\n <template v-else>By messaging Agent Scalar you agree to our </template>\n <a\n class=\"disclaimerLink\"\n :href=\"URLS.TERMS_AND_CONDITIONS\"\n target=\"_blank\"\n >Terms</a\n >\n and\n <a\n class=\"disclaimerLink\"\n :href=\"URLS.PRIVACY_POLICY\"\n target=\"_blank\"\n >Privacy Policy</a\n >.\n </p>\n </div>\n</template>\n\n<style scoped>\n.agentLogo {\n margin-bottom: 15px;\n}\n\n.startContainer {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n max-width: 720px;\n position: relative;\n}\n\n.heading {\n font-size: 1.5rem;\n font-weight: var(--scalar-font-bold);\n margin-bottom: 50px;\n}\n\n.disclaimerText {\n text-align: center;\n color: var(--scalar-color-3);\n font-size: var(--scalar-font-size-3);\n text-wrap: balance;\n line-height: 1.44;\n margin-top: 40px;\n}\n\n.disclaimerLink {\n text-decoration: underline;\n}\n</style>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Start.vue.script.js","names":[],"sources":["../../src/views/Start.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport Logo from '@/components/Logo.vue'\nimport { URLS } from '@/consts/urls'\nimport { useState } from '@/state/state'\nimport PromptForm from '@/views/PromptForm.vue'\n\nconst emit = defineEmits<{\n (e: 'submit'): void\n (e: 'uploadApi'): void\n}>()\n\nconst { mode } = useState()\n</script>\n\n<template>\n <div class=\"startContainer\">\n <Logo class=\"agentLogo\" />\n <h1 class=\"heading\">How can I help you today?</h1>\n <PromptForm\n ref=\"promptFormField\"\n @submit=\"emit('submit')\"\n @uploadApi=\"emit('uploadApi')\" />\n <p class=\"disclaimerText\">\n <template v-if=\"mode === 'preview'\">\n By messaging Agent Scalar your OpenAPI document will be temporarily\n uploaded to Scalar's servers. You must agree to our\n </template>\n <template v-else>By messaging Agent Scalar you agree to our </template>\n <a\n class=\"disclaimerLink\"\n :href=\"URLS.TERMS_AND_CONDITIONS\"\n target=\"_blank\"\n >Terms</a\n >\n and\n <a\n class=\"disclaimerLink\"\n :href=\"URLS.PRIVACY_POLICY\"\n target=\"_blank\"\n >Privacy Policy</a\n >.\n </p>\n </div>\n</template>\n\n<style scoped>\n.agentLogo {\n margin-bottom: 15px;\n}\n\n.startContainer {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n max-width: 720px;\n position: relative;\n}\n\n.heading {\n font-size: 1.5rem;\n font-weight: var(--scalar-font-bold);\n margin-bottom: 50px;\n}\n\n.disclaimerText {\n text-align: center;\n color: var(--scalar-color-3);\n font-size: var(--scalar-font-size-3);\n text-wrap: balance;\n line-height: 1.44;\n margin-top: 40px;\n}\n\n.disclaimerLink {\n text-decoration: underline;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;EAMA,MAAM,OAAO;EAKb,MAAM,EAAE,SAAS,UAAS;;uBAIxB,mBA2BM,OA3BN,YA2BM;IA1BJ,YAA0B,cAAA,EAApB,OAAM,aAAW,CAAA;8BACvB,mBAAkD,MAAA,EAA9C,OAAM,WAAS,EAAC,6BAAyB,GAAA;IAC7C,YAGmC,oBAAA;KAFjC,KAAI;KACH,UAAM,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,SAAA;KACZ,aAAS,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,YAAA;;IAClB,mBAmBI,KAnBJ,YAmBI;KAlBc,MAAA,KAAI,KAAA,aAAA,WAAA,EAApB,mBAGW,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAHyB,4HAGpC,CAAA,EAAA,GAAA,KAAA,WAAA,EACA,mBAAuE,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAtD,8CAA2C,CAAA,EAAA,GAAA;KAC5D,mBAKC,KAAA;MAJC,OAAM;MACL,MAAM,MAAA,KAAI,CAAC;MACZ,QAAO;QACN,SAAK,GAAA,WAAA;+CACP,SAED,GAAA;KAAA,mBAKC,KAAA;MAJC,OAAM;MACL,MAAM,MAAA,KAAI,CAAC;MACZ,QAAO;QACN,kBAAc,GAAA,WAAA;+CAChB,MACH,GAAA"}
|