@scalar/agent-chat 0.12.61 → 0.12.63
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 +46 -4
- package/dist/App.vue.js.map +1 -1
- package/dist/App2.vue.js +6 -0
- package/dist/App2.vue.js.map +1 -0
- package/dist/Chat.vue.js +83 -4
- package/dist/Chat.vue.js.map +1 -1
- package/dist/Chat2.vue.js +6 -0
- package/dist/Chat2.vue.js.map +1 -0
- package/dist/client-tools/execute-request.js.map +1 -1
- package/dist/components/ActionsDropdown.vue.js +35 -6
- package/dist/components/ActionsDropdown.vue.js.map +1 -1
- package/dist/components/ActionsDropdown3.vue.js +8 -0
- package/dist/components/ActionsDropdown3.vue.js.map +1 -0
- package/dist/components/ApprovalSection.vue.js +28 -6
- package/dist/components/ApprovalSection.vue.js.map +1 -1
- package/dist/components/ApprovalSection3.vue.js +8 -0
- package/dist/components/ApprovalSection3.vue.js.map +1 -0
- package/dist/components/{AuthenticationProvided.vue.js → AuthenticationProvided2.vue.js} +2 -2
- package/dist/components/AuthenticationProvided2.vue.js.map +1 -0
- package/dist/components/{AuthenticationRequired.vue.js → AuthenticationRequired2.vue.js} +2 -2
- package/dist/components/AuthenticationRequired2.vue.js.map +1 -0
- package/dist/components/{AutosendPaused.vue.js → AutosendPaused2.vue.js} +2 -2
- package/dist/components/AutosendPaused2.vue.js.map +1 -0
- package/dist/components/{BuildingRequest.vue.js → BuildingRequest2.vue.js} +2 -2
- package/dist/components/BuildingRequest2.vue.js.map +1 -0
- package/dist/components/ContextItem.vue.js +13 -6
- package/dist/components/ContextItem.vue.js.map +1 -1
- package/dist/components/ContextItem3.vue.js +8 -0
- package/dist/components/ContextItem3.vue.js.map +1 -0
- package/dist/components/ErrorMessage.vue.js +22 -6
- package/dist/components/ErrorMessage.vue.js.map +1 -1
- package/dist/components/ErrorMessage3.vue.js +8 -0
- package/dist/components/ErrorMessage3.vue.js.map +1 -0
- package/dist/components/FreeMessagesInfoSection.vue.js +51 -6
- package/dist/components/FreeMessagesInfoSection.vue.js.map +1 -1
- package/dist/components/FreeMessagesInfoSection3.vue.js +8 -0
- package/dist/components/FreeMessagesInfoSection3.vue.js.map +1 -0
- package/dist/components/{LoadingOpenAPISpecsSummary.vue.js → LoadingOpenAPISpecsSummary2.vue.js} +2 -2
- package/dist/components/LoadingOpenAPISpecsSummary2.vue.js.map +1 -0
- package/dist/components/{LoadingSearchOpenAPIOperations.vue.js → LoadingSearchOpenAPIOperations2.vue.js} +2 -2
- package/dist/components/LoadingSearchOpenAPIOperations2.vue.js.map +1 -0
- package/dist/components/PaymentSection.vue.js +24 -6
- package/dist/components/PaymentSection.vue.js.map +1 -1
- package/dist/components/PaymentSection3.vue.js +8 -0
- package/dist/components/PaymentSection3.vue.js.map +1 -0
- package/dist/components/{RequestApproved.vue.js → RequestApproved2.vue.js} +2 -2
- package/dist/components/RequestApproved2.vue.js.map +1 -0
- package/dist/components/{RequestFailed.vue.js → RequestFailed2.vue.js} +2 -2
- package/dist/components/RequestFailed2.vue.js.map +1 -0
- package/dist/components/RequestPreview.vue.js +137 -6
- package/dist/components/RequestPreview.vue.js.map +1 -1
- package/dist/components/RequestPreview3.vue.js +8 -0
- package/dist/components/RequestPreview3.vue.js.map +1 -0
- package/dist/components/{RequestRejected.vue.js → RequestRejected2.vue.js} +2 -2
- package/dist/components/RequestRejected2.vue.js.map +1 -0
- package/dist/components/{RequestSuccess.vue.js → RequestSuccess2.vue.js} +2 -2
- package/dist/components/RequestSuccess2.vue.js.map +1 -0
- package/dist/components/ResponseBody/ResponseBody.vue.js +42 -4
- package/dist/components/ResponseBody/ResponseBody.vue.js.map +1 -1
- package/dist/components/ResponseBody/ResponseBody2.vue.js +6 -0
- package/dist/components/ResponseBody/ResponseBody2.vue.js.map +1 -0
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.js +63 -6
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.js.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyPreview3.vue.js +8 -0
- package/dist/components/ResponseBody/ResponseBodyPreview3.vue.js.map +1 -0
- package/dist/components/ResponseBody/ResponseBodyRaw.vue.js +21 -4
- package/dist/components/ResponseBody/ResponseBodyRaw.vue.js.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyRaw2.vue.js +6 -0
- package/dist/components/ResponseBody/ResponseBodyRaw2.vue.js.map +1 -0
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.js +23 -4
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.js.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyToggle2.vue.js +6 -0
- package/dist/components/ResponseBody/ResponseBodyToggle2.vue.js.map +1 -0
- package/dist/components/ResponseBody/helpers/media-types.d.ts +7 -8
- package/dist/components/ResponseBody/helpers/media-types.d.ts.map +1 -1
- package/dist/components/ResponseBody/helpers/media-types.js +10 -229
- package/dist/components/ResponseBody/helpers/media-types.js.map +1 -1
- package/dist/components/SearchPopover.vue.js +61 -6
- package/dist/components/SearchPopover.vue.js.map +1 -1
- package/dist/components/SearchPopover3.vue.js +8 -0
- package/dist/components/SearchPopover3.vue.js.map +1 -0
- package/dist/components/Selector.vue.d.ts.map +1 -1
- package/dist/components/Selector.vue.js +78 -4
- package/dist/components/Selector.vue.js.map +1 -1
- package/dist/components/Selector2.vue.js +6 -0
- package/dist/components/Selector2.vue.js.map +1 -0
- package/dist/components/{SendingRequest.vue.js → SendingRequest2.vue.js} +2 -2
- package/dist/components/SendingRequest2.vue.js.map +1 -0
- package/dist/components/ServerSelector.vue.d.ts.map +1 -1
- package/dist/components/ServerSelector.vue.js +67 -4
- package/dist/components/ServerSelector.vue.js.map +1 -1
- package/dist/components/ServerSelector2.vue.js +6 -0
- package/dist/components/ServerSelector2.vue.js.map +1 -0
- package/dist/components/UploadSection.vue.js +58 -6
- package/dist/components/UploadSection.vue.js.map +1 -1
- package/dist/components/UploadSection3.vue.js +8 -0
- package/dist/components/UploadSection3.vue.js.map +1 -0
- package/dist/hooks/use-search.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/package.json +1 -1
- package/dist/state/state.js.map +1 -1
- package/dist/style.css +26 -13
- package/dist/views/Catalog/Catalog.vue.js +66 -7
- package/dist/views/Catalog/Catalog.vue.js.map +1 -1
- package/dist/views/Catalog/Catalog4.vue.js +9 -0
- package/dist/views/Catalog/Catalog4.vue.js.map +1 -0
- package/dist/views/Chat/Chat.vue.js +64 -6
- package/dist/views/Chat/Chat.vue.js.map +1 -1
- package/dist/views/Chat/Chat3.vue.js +8 -0
- package/dist/views/Chat/Chat3.vue.js.map +1 -0
- package/dist/views/Chat/Messages/AskForAuthentication.vue.js +87 -6
- package/dist/views/Chat/Messages/AskForAuthentication.vue.js.map +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication3.vue.js +8 -0
- package/dist/views/Chat/Messages/AskForAuthentication3.vue.js.map +1 -0
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +39 -6
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js.map +1 -1
- package/dist/views/Chat/Messages/ExecuteRequestTool3.vue.js +8 -0
- package/dist/views/Chat/Messages/ExecuteRequestTool3.vue.js.map +1 -0
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js +23 -4
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js.map +1 -1
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary2.vue.js +6 -0
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary2.vue.js.map +1 -0
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.js +66 -6
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.js.map +1 -1
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool3.vue.js +8 -0
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool3.vue.js.map +1 -0
- package/dist/views/Chat/Messages/Text.vue.js +13 -4
- package/dist/views/Chat/Messages/Text.vue.js.map +1 -1
- package/dist/views/Chat/Messages/Text2.vue.js +6 -0
- package/dist/views/Chat/Messages/Text2.vue.js.map +1 -0
- package/dist/views/Layout.vue.js +26 -6
- package/dist/views/Layout.vue.js.map +1 -1
- package/dist/views/Layout3.vue.js +8 -0
- package/dist/views/Layout3.vue.js.map +1 -0
- package/dist/views/PromptForm.vue.js +245 -6
- package/dist/views/PromptForm.vue.js.map +1 -1
- package/dist/views/PromptForm3.vue.js +8 -0
- package/dist/views/PromptForm3.vue.js.map +1 -0
- package/dist/views/Settings/Auth.vue.js +72 -4
- package/dist/views/Settings/Auth.vue.js.map +1 -1
- package/dist/views/Settings/Auth2.vue.js +6 -0
- package/dist/views/Settings/Auth2.vue.js.map +1 -0
- package/dist/views/Settings/DocSettings.vue.js +51 -6
- package/dist/views/Settings/DocSettings.vue.js.map +1 -1
- package/dist/views/Settings/DocSettings3.vue.js +8 -0
- package/dist/views/Settings/DocSettings3.vue.js.map +1 -0
- package/dist/views/Settings/Settings.vue.js +74 -7
- package/dist/views/Settings/Settings.vue.js.map +1 -1
- package/dist/views/Settings/Settings4.vue.js +9 -0
- package/dist/views/Settings/Settings4.vue.js.map +1 -0
- package/dist/views/Start.vue.js +45 -6
- package/dist/views/Start.vue.js.map +1 -1
- package/dist/views/Start3.vue.js +8 -0
- package/dist/views/Start3.vue.js.map +1 -0
- package/package.json +16 -16
- package/dist/App.vue_vue_type_script_setup_true_lang.js +0 -48
- package/dist/App.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/Chat.vue_vue_type_script_setup_true_lang.js +0 -85
- package/dist/Chat.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/ActionsDropdown.vue_vue_type_script_setup_true_lang.js +0 -37
- package/dist/components/ActionsDropdown.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/ApprovalSection.vue_vue_type_script_setup_true_lang.js +0 -30
- package/dist/components/ApprovalSection.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/AuthenticationProvided.vue.js.map +0 -1
- package/dist/components/AuthenticationRequired.vue.js.map +0 -1
- package/dist/components/AutosendPaused.vue.js.map +0 -1
- package/dist/components/BuildingRequest.vue.js.map +0 -1
- package/dist/components/ContextItem.vue_vue_type_script_setup_true_lang.js +0 -15
- package/dist/components/ContextItem.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/ErrorMessage.vue_vue_type_script_setup_true_lang.js +0 -24
- package/dist/components/ErrorMessage.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/FreeMessagesInfoSection.vue_vue_type_script_setup_true_lang.js +0 -53
- package/dist/components/FreeMessagesInfoSection.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/LoadingOpenAPISpecsSummary.vue.js.map +0 -1
- package/dist/components/LoadingSearchOpenAPIOperations.vue.js.map +0 -1
- package/dist/components/PaymentSection.vue_vue_type_script_setup_true_lang.js +0 -26
- package/dist/components/PaymentSection.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/RequestApproved.vue.js.map +0 -1
- package/dist/components/RequestFailed.vue.js.map +0 -1
- package/dist/components/RequestPreview.vue_vue_type_script_setup_true_lang.js +0 -139
- package/dist/components/RequestPreview.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/RequestRejected.vue.js.map +0 -1
- package/dist/components/RequestSuccess.vue.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBody.vue_vue_type_script_setup_true_lang.js +0 -44
- package/dist/components/ResponseBody/ResponseBody.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBodyPreview.vue_vue_type_script_setup_true_lang.js +0 -65
- package/dist/components/ResponseBody/ResponseBodyPreview.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBodyRaw.vue_vue_type_script_setup_true_lang.js +0 -23
- package/dist/components/ResponseBody/ResponseBodyRaw.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBodyToggle.vue_vue_type_script_setup_true_lang.js +0 -25
- package/dist/components/ResponseBody/ResponseBodyToggle.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/SearchPopover.vue_vue_type_script_setup_true_lang.js +0 -63
- package/dist/components/SearchPopover.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/Selector.vue_vue_type_script_setup_true_lang.js +0 -72
- package/dist/components/Selector.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/SendingRequest.vue.js.map +0 -1
- package/dist/components/ServerSelector.vue_vue_type_script_setup_true_lang.js +0 -68
- package/dist/components/ServerSelector.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/UploadSection.vue_vue_type_script_setup_true_lang.js +0 -60
- package/dist/components/UploadSection.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/Catalog/Catalog.vue_vue_type_script_setup_true_lang.js +0 -68
- package/dist/views/Catalog/Catalog.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/Chat/Chat.vue_vue_type_script_setup_true_lang.js +0 -66
- package/dist/views/Chat/Chat.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue_vue_type_script_setup_true_lang.js +0 -89
- package/dist/views/Chat/Messages/AskForAuthentication.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue_vue_type_script_setup_true_lang.js +0 -41
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue_vue_type_script_setup_true_lang.js +0 -25
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue_vue_type_script_setup_true_lang.js +0 -68
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/Chat/Messages/Text.vue_vue_type_script_setup_true_lang.js +0 -15
- package/dist/views/Chat/Messages/Text.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/Layout.vue_vue_type_script_setup_true_lang.js +0 -28
- package/dist/views/Layout.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/PromptForm.vue_vue_type_script_setup_true_lang.js +0 -247
- package/dist/views/PromptForm.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/Settings/Auth.vue_vue_type_script_setup_true_lang.js +0 -74
- package/dist/views/Settings/Auth.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/Settings/DocSettings.vue_vue_type_script_setup_true_lang.js +0 -53
- package/dist/views/Settings/DocSettings.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/Settings/Settings.vue_vue_type_script_setup_true_lang.js +0 -76
- package/dist/views/Settings/Settings.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/views/Start.vue_vue_type_script_setup_true_lang.js +0 -47
- package/dist/views/Start.vue_vue_type_script_setup_true_lang.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestFailed.vue.js","names":["_openBlock","_createElementBlock","_createElementVNode","_createTextVNode"],"sources":["../../src/components/RequestFailed.vue"],"sourcesContent":["<template>\n <div class=\"requestFailed\">\n <i class=\"requestFailedIcon\">\n <svg\n fill=\"currentColor\"\n height=\"100%\"\n viewBox=\"0 0 256 256\"\n width=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M216,48V208a16,16,0,0,1-16,16H160a16,16,0,0,1-16-16V48a16,16,0,0,1,16-16h40A16,16,0,0,1,216,48ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Z\"></path>\n </svg>\n </i>\n Request Failed\n </div>\n</template>\n\n<style scoped>\n.requestFailed {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--scalar-color-red);\n font-weight: var(--scalar-semibold);\n min-height: 40px;\n font-size: var(--scalar-font-size-3);\n position: relative;\n}\n.requestFailedIcon {\n box-shadow: inset 0 0 0 1.5px currentColor;\n padding: 4px;\n padding: 4px;\n width: 16px;\n height: 16px;\n border-radius: var(--scalar-radius-full);\n}\n</style>\n"],"mappings":";;;;;AACO,IAAA,aAAA,EAAA,OAAM,gBAAe;;CAA1B,OAAAA,UAAA,GAAAC,mBAaM,OAbN,YAaM,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAZJC,mBAUI,KAAA,EAVD,OAAM,oBAAmB,GAAA,CAC1BA,mBAQM,OAAA;EAPJ,MAAK;EACL,QAAO;EACP,SAAQ;EACR,OAAM;EACN,OAAM;C,IACNA,mBACyM,QAAA,EAAvM,GAAE,8LAA6L,CAAA,C,UAEjMC,gBAAA,oBAEN,EAAA,C"}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import AutosendPaused_default from "./AutosendPaused.vue.js";
|
|
2
|
-
import BuildingRequest_default from "./BuildingRequest.vue.js";
|
|
3
|
-
import RequestApproved_default from "./RequestApproved.vue.js";
|
|
4
|
-
import RequestFailed_default from "./RequestFailed.vue.js";
|
|
5
|
-
import RequestRejected_default from "./RequestRejected.vue.js";
|
|
6
|
-
import RequestSuccess_default from "./RequestSuccess.vue.js";
|
|
7
|
-
import { getMediaTypeConfig } from "./ResponseBody/helpers/media-types.js";
|
|
8
|
-
import { processResponseBody } from "./ResponseBody/helpers/process-response-body.js";
|
|
9
|
-
import ResponseBody_default from "./ResponseBody/ResponseBody.vue.js";
|
|
10
|
-
import ResponseBodyToggle_default from "./ResponseBody/ResponseBodyToggle.vue.js";
|
|
11
|
-
import SendingRequest_default from "./SendingRequest.vue.js";
|
|
12
|
-
import { createDocumentSettings } from "../helpers.js";
|
|
13
|
-
import { useState } from "../state/state.js";
|
|
14
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, toDisplayString, unref } from "vue";
|
|
15
|
-
import { getResolvedUrl } from "@scalar/workspace-store/request-example";
|
|
16
|
-
import { ScalarIconCaretDown, ScalarIconCaretRight } from "@scalar/icons";
|
|
17
|
-
import { ScalarCodeBlock } from "@scalar/components/code-block";
|
|
18
|
-
// src/components/RequestPreview.vue?vue&type=script&setup=true&lang.ts
|
|
19
|
-
var _hoisted_1 = {
|
|
20
|
-
key: 0,
|
|
21
|
-
class: "text-c-2 py-2 font-mono text-sm break-all"
|
|
22
|
-
};
|
|
23
|
-
var _hoisted_2 = {
|
|
24
|
-
key: 2,
|
|
25
|
-
class: "autosendContainer"
|
|
26
|
-
};
|
|
27
|
-
var _hoisted_3 = {
|
|
28
|
-
key: 3,
|
|
29
|
-
class: "autosendContainer"
|
|
30
|
-
};
|
|
31
|
-
var _hoisted_4 = { class: "requestContent" };
|
|
32
|
-
var _hoisted_5 = { class: "requestContentInner" };
|
|
33
|
-
var _hoisted_6 = {
|
|
34
|
-
key: 0,
|
|
35
|
-
class: "code"
|
|
36
|
-
};
|
|
37
|
-
var _hoisted_7 = {
|
|
38
|
-
key: 1,
|
|
39
|
-
class: "code"
|
|
40
|
-
};
|
|
41
|
-
var _hoisted_8 = { class: "requestHeaderContainer" };
|
|
42
|
-
var RequestPreview_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
43
|
-
__name: "RequestPreview",
|
|
44
|
-
props: {
|
|
45
|
-
request: {},
|
|
46
|
-
response: {},
|
|
47
|
-
state: {}
|
|
48
|
-
},
|
|
49
|
-
setup(__props) {
|
|
50
|
-
const chatState = useState();
|
|
51
|
-
const requestDestination = computed(() => {
|
|
52
|
-
if (!__props.request?.documentName || !__props.request.path || !__props.request.method) return;
|
|
53
|
-
const settings = createDocumentSettings(chatState.workspaceStore, chatState.config.value.authentication)[__props.request.documentName];
|
|
54
|
-
if (!settings?.activeServer?.url) return `${__props.request.method.toUpperCase()} ${__props.request.path} (no server selected)`;
|
|
55
|
-
return `${__props.request.method.toUpperCase()} ${getResolvedUrl({
|
|
56
|
-
server: settings.activeServer,
|
|
57
|
-
path: __props.request.path
|
|
58
|
-
})}`;
|
|
59
|
-
});
|
|
60
|
-
const responseData = computed(() => {
|
|
61
|
-
if (__props.response?.success) return {
|
|
62
|
-
data: __props.response.data.responseBody,
|
|
63
|
-
headers: __props.response.data.headers
|
|
64
|
-
};
|
|
65
|
-
if (__props.response?.error?.code === "REQUEST_NOT_OK") return {
|
|
66
|
-
data: __props.response.error.detail.responseBody,
|
|
67
|
-
headers: __props.response.error.detail.headers
|
|
68
|
-
};
|
|
69
|
-
});
|
|
70
|
-
const showRequestToggle = ref(false);
|
|
71
|
-
/** Show request preview automatically for failed requests or when approval is required. */
|
|
72
|
-
const shouldShowRequest = computed(() => {
|
|
73
|
-
if (__props.state === "requestFailed" || __props.state === "requiresApproval") return true;
|
|
74
|
-
return showRequestToggle.value;
|
|
75
|
-
});
|
|
76
|
-
const responseBody = computed(() => processResponseBody({
|
|
77
|
-
data: responseData.value?.data,
|
|
78
|
-
headers: responseData.value?.headers
|
|
79
|
-
}));
|
|
80
|
-
const mediaConfig = computed(() => getMediaTypeConfig(responseBody.value.mimeType?.essence ?? ""));
|
|
81
|
-
const displayToggle = ref();
|
|
82
|
-
function toggleDisplay(mode) {
|
|
83
|
-
displayToggle.value = mode;
|
|
84
|
-
}
|
|
85
|
-
const displayMode = computed(() => {
|
|
86
|
-
if (displayToggle.value) return displayToggle.value;
|
|
87
|
-
if (mediaConfig.value?.raw && !mediaConfig.value.preview) return "raw";
|
|
88
|
-
if (mediaConfig.value?.preview) return "preview";
|
|
89
|
-
return "raw";
|
|
90
|
-
});
|
|
91
|
-
return (_ctx, _cache) => {
|
|
92
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(["requestPreview", {
|
|
93
|
-
open: shouldShowRequest.value,
|
|
94
|
-
succeeded: __props.state === "requestSucceeded"
|
|
95
|
-
}]) }, [
|
|
96
|
-
requestDestination.value ? (openBlock(), createElementBlock("p", _hoisted_1, toDisplayString(__props.request?.documentName) + " · " + toDisplayString(requestDestination.value), 1)) : createCommentVNode("", true),
|
|
97
|
-
__props.state === "approved" ? (openBlock(), createBlock(RequestApproved_default, { key: 1 })) : __props.state === "buildingRequest" ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(BuildingRequest_default)])) : __props.state === "requiresApproval" ? (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(AutosendPaused_default)])) : __props.state === "sendingRequest" ? (openBlock(), createElementBlock("button", {
|
|
98
|
-
key: 4,
|
|
99
|
-
class: "toggleButton",
|
|
100
|
-
type: "button",
|
|
101
|
-
onClick: _cache[0] || (_cache[0] = ($event) => showRequestToggle.value = !showRequestToggle.value)
|
|
102
|
-
}, [createVNode(SendingRequest_default), shouldShowRequest.value ? (openBlock(), createBlock(unref(ScalarIconCaretDown), { key: 0 })) : (openBlock(), createBlock(unref(ScalarIconCaretRight), { key: 1 }))])) : __props.state === "requestSucceeded" ? (openBlock(), createElementBlock("button", {
|
|
103
|
-
key: 5,
|
|
104
|
-
class: "toggleButton",
|
|
105
|
-
type: "button",
|
|
106
|
-
onClick: _cache[1] || (_cache[1] = ($event) => showRequestToggle.value = !showRequestToggle.value)
|
|
107
|
-
}, [createVNode(RequestSuccess_default), shouldShowRequest.value ? (openBlock(), createBlock(unref(ScalarIconCaretDown), { key: 0 })) : (openBlock(), createBlock(unref(ScalarIconCaretRight), { key: 1 }))])) : __props.state === "rejected" ? (openBlock(), createElementBlock("button", {
|
|
108
|
-
key: 6,
|
|
109
|
-
class: "toggleButton",
|
|
110
|
-
type: "button",
|
|
111
|
-
onClick: _cache[2] || (_cache[2] = ($event) => showRequestToggle.value = !showRequestToggle.value)
|
|
112
|
-
}, [createVNode(RequestRejected_default), shouldShowRequest.value ? (openBlock(), createBlock(unref(ScalarIconCaretDown), { key: 0 })) : (openBlock(), createBlock(unref(ScalarIconCaretRight), { key: 1 }))])) : __props.state === "requestFailed" ? (openBlock(), createBlock(RequestFailed_default, { key: 7 })) : createCommentVNode("", true),
|
|
113
|
-
createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [__props.request ? (openBlock(), createElementBlock("div", _hoisted_6, [_cache[4] || (_cache[4] = createElementVNode("div", { class: "requestHeaderContainer" }, [createElementVNode("h1", null, "Request")], -1)), createVNode(unref(ScalarCodeBlock), {
|
|
114
|
-
class: "codeBlock",
|
|
115
|
-
content: JSON.stringify(__props.request, null, 2),
|
|
116
|
-
lang: "json"
|
|
117
|
-
}, null, 8, ["content"])])) : createCommentVNode("", true), responseData.value ? (openBlock(), createElementBlock("div", _hoisted_7, [createElementVNode("div", _hoisted_8, [_cache[5] || (_cache[5] = createElementVNode("h1", null, "Response", -1)), mediaConfig.value?.raw && mediaConfig.value.preview ? (openBlock(), createBlock(ResponseBodyToggle_default, {
|
|
118
|
-
key: 0,
|
|
119
|
-
modelValue: displayMode.value,
|
|
120
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => displayMode.value = $event),
|
|
121
|
-
onToggle: toggleDisplay
|
|
122
|
-
}, null, 8, ["modelValue"])) : createCommentVNode("", true)]), createVNode(ResponseBody_default, {
|
|
123
|
-
data: responseData.value.data,
|
|
124
|
-
display: displayMode.value,
|
|
125
|
-
mediaConfig: mediaConfig.value,
|
|
126
|
-
responseBody: responseBody.value
|
|
127
|
-
}, null, 8, [
|
|
128
|
-
"data",
|
|
129
|
-
"display",
|
|
130
|
-
"mediaConfig",
|
|
131
|
-
"responseBody"
|
|
132
|
-
])])) : createCommentVNode("", true)])])
|
|
133
|
-
], 2);
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
export { RequestPreview_vue_vue_type_script_setup_true_lang_default as default };
|
|
138
|
-
|
|
139
|
-
//# sourceMappingURL=RequestPreview.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestPreview.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_toDisplayString","_createBlock","RequestApproved","_createVNode","BuildingRequest","AutosendPaused","SendingRequest","_unref","RequestSuccess","RequestRejected","RequestFailed","_createElementVNode","ResponseBodyToggle","ResponseBody"],"sources":["../../src/components/RequestPreview.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport { ScalarIconCaretDown, ScalarIconCaretRight } from '@scalar/icons'\nimport { getResolvedUrl } from '@scalar/workspace-store/request-example'\nimport { type DeepPartial } from 'ai'\nimport { computed, ref } from 'vue'\n\nimport AutosendPaused from '@/components/AutosendPaused.vue'\nimport BuildingRequest from '@/components/BuildingRequest.vue'\nimport RequestApproved from '@/components/RequestApproved.vue'\nimport RequestFailed from '@/components/RequestFailed.vue'\nimport RequestRejected from '@/components/RequestRejected.vue'\nimport RequestSuccess from '@/components/RequestSuccess.vue'\nimport { getMediaTypeConfig } from '@/components/ResponseBody/helpers/media-types'\nimport { processResponseBody } from '@/components/ResponseBody/helpers/process-response-body'\nimport ResponseBody from '@/components/ResponseBody/ResponseBody.vue'\nimport ResponseBodyToggle from '@/components/ResponseBody/ResponseBodyToggle.vue'\nimport SendingRequest from '@/components/SendingRequest.vue'\nimport type {\n ExecuteClientSideRequestToolInput,\n ExecuteClientSideRequestToolOutput,\n} from '@/entities/tools/execute-request'\n\nimport { createDocumentSettings } from '@/helpers'\nimport { useState } from '@/state/state'\n\nconst { request, response, state } = defineProps<{\n request?:\n | ExecuteClientSideRequestToolInput\n | DeepPartial<ExecuteClientSideRequestToolInput>\n response?: ExecuteClientSideRequestToolOutput\n state:\n | 'requiresApproval'\n | 'sendingRequest'\n | 'requestSucceeded'\n | 'requestFailed'\n | 'approved'\n | 'rejected'\n | 'buildingRequest'\n}>()\n\nconst chatState = useState()\nconst requestDestination = computed(() => {\n if (!request?.documentName || !request.path || !request.method) {\n return undefined\n }\n const settings = createDocumentSettings(\n chatState.workspaceStore,\n chatState.config.value.authentication,\n )[request.documentName]\n if (!settings?.activeServer?.url) {\n return `${request.method.toUpperCase()} ${request.path} (no server selected)`\n }\n return `${request.method.toUpperCase()} ${getResolvedUrl({ server: settings.activeServer, path: request.path })}`\n})\n\nconst responseData = computed(() => {\n if (response?.success) {\n return {\n data: response.data.responseBody,\n headers: response.data.headers,\n }\n }\n\n if (response?.error?.code === 'REQUEST_NOT_OK') {\n return {\n data: response.error.detail.responseBody,\n headers: response.error.detail.headers,\n }\n }\n\n return undefined\n})\n\nconst showRequestToggle = ref(false)\n\n/** Show request preview automatically for failed requests or when approval is required. */\nconst shouldShowRequest = computed(() => {\n if (state === 'requestFailed' || state === 'requiresApproval') {\n return true\n }\n return showRequestToggle.value\n})\n\nconst responseBody = computed(() =>\n processResponseBody({\n data: responseData.value?.data,\n headers: responseData.value?.headers,\n }),\n)\n\nconst mediaConfig = computed(() =>\n getMediaTypeConfig(responseBody.value.mimeType?.essence ?? ''),\n)\n\nconst displayToggle = ref<'preview' | 'raw'>()\nfunction toggleDisplay(mode: 'preview' | 'raw') {\n displayToggle.value = mode\n}\n\nconst displayMode = computed(() => {\n if (displayToggle.value) {\n return displayToggle.value\n }\n\n if (mediaConfig.value?.raw && !mediaConfig.value.preview) {\n return 'raw'\n }\n if (mediaConfig.value?.preview) {\n return 'preview'\n }\n\n return 'raw'\n})\n</script>\n\n<template>\n <div\n class=\"requestPreview\"\n :class=\"{\n open: shouldShowRequest,\n succeeded: state === 'requestSucceeded',\n }\">\n <p\n v-if=\"requestDestination\"\n class=\"text-c-2 py-2 font-mono text-sm break-all\">\n {{ request?.documentName }} · {{ requestDestination }}\n </p>\n <RequestApproved v-if=\"state === 'approved'\" />\n <div\n v-else-if=\"state === 'buildingRequest'\"\n class=\"autosendContainer\">\n <BuildingRequest />\n </div>\n <div\n v-else-if=\"state === 'requiresApproval'\"\n class=\"autosendContainer\">\n <AutosendPaused />\n </div>\n <button\n v-else-if=\"state === 'sendingRequest'\"\n class=\"toggleButton\"\n type=\"button\"\n @click=\"showRequestToggle = !showRequestToggle\">\n <SendingRequest />\n\n <ScalarIconCaretDown v-if=\"shouldShowRequest\" />\n <ScalarIconCaretRight v-else />\n </button>\n <button\n v-else-if=\"state === 'requestSucceeded'\"\n class=\"toggleButton\"\n type=\"button\"\n @click=\"showRequestToggle = !showRequestToggle\">\n <RequestSuccess />\n\n <ScalarIconCaretDown v-if=\"shouldShowRequest\" />\n <ScalarIconCaretRight v-else />\n </button>\n <button\n v-else-if=\"state === 'rejected'\"\n class=\"toggleButton\"\n type=\"button\"\n @click=\"showRequestToggle = !showRequestToggle\">\n <RequestRejected />\n\n <ScalarIconCaretDown v-if=\"shouldShowRequest\" />\n <ScalarIconCaretRight v-else />\n </button>\n <RequestFailed v-else-if=\"state === 'requestFailed'\" />\n <div class=\"requestContent\">\n <div class=\"requestContentInner\">\n <div\n v-if=\"request\"\n class=\"code\">\n <div class=\"requestHeaderContainer\">\n <h1>Request</h1>\n </div>\n <ScalarCodeBlock\n class=\"codeBlock\"\n :content=\"JSON.stringify(request, null, 2)\"\n lang=\"json\" />\n </div>\n <div\n v-if=\"responseData\"\n class=\"code\">\n <div class=\"requestHeaderContainer\">\n <h1>Response</h1>\n <ResponseBodyToggle\n v-if=\"mediaConfig?.raw && mediaConfig.preview\"\n v-model=\"displayMode\"\n @toggle=\"toggleDisplay\" />\n </div>\n <ResponseBody\n :data=\"responseData.data\"\n :display=\"displayMode\"\n :mediaConfig=\"mediaConfig\"\n :responseBody=\"responseBody\" />\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<style scoped>\n.requestHeaderContainer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 5px;\n}\n\n.requestPreview {\n border-radius: var(--scalar-radius-2xl);\n display: flex;\n flex-direction: column;\n width: 100%;\n position: relative;\n}\n\n.requestContent {\n display: grid;\n grid-template-rows: 0fr;\n min-height: 0;\n overflow: hidden;\n transition: grid-template-rows 0.2s ease-out;\n}\n\n.requestPreview.open .requestContent {\n grid-template-rows: 1fr;\n}\n.requestPreview.succeeded {\n padding: 0;\n}\n\n.requestContentInner {\n min-height: 0;\n overflow: hidden;\n}\n.code {\n display: flex;\n flex-direction: column;\n font-size: var(--scalar-font-size-4);\n border-radius: var(--scalar-radius-2xl);\n background: color-mix(\n in srgb,\n var(--scalar-background-2),\n var(--scalar-background-1)\n );\n overflow: hidden;\n margin-bottom: 12px;\n}\n.dark-mode .code {\n background: var(--scalar-background-2);\n}\n.code h1 {\n font-size: var(--scalar-font-size-3);\n color: var(--scalar-color-3);\n padding: 8px;\n}\n.code :deep(.codeBlock) {\n max-height: calc(50vh - 100px);\n padding-top: 0;\n}\n.autosendContainer {\n display: flex;\n justify-content: space-between;\n}\n\n.sendButton {\n background: var(--scalar-color-blue);\n color: white;\n font-weight: var(--scalar-semibold);\n padding: 5px 10px;\n}\n.sendButton:hover,\n.sendButton:active {\n background: color-mix(in srgb, var(--scalar-color-blue), black 10%);\n color: white !important;\n}\n\n.toggleButton {\n background: none;\n border: none;\n cursor: pointer;\n text-align: left;\n position: relative;\n display: flex;\n align-items: center;\n color: var(--scalar-color-3);\n justify-content: space-between;\n border-radius: var(--scalar-radius-lg);\n}\n\n.toggleButton:hover {\n text-decoration: underline;\n}\n</style>\n"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestRejected.vue.js","names":["_openBlock","_createElementBlock","_createElementVNode","_createTextVNode"],"sources":["../../src/components/RequestRejected.vue"],"sourcesContent":["<template>\n <div class=\"requestRejected\">\n <svg\n fill=\"currentColor\"\n height=\"16\"\n viewBox=\"0 0 256 256\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M56.88,31.93A12,12,0,1,0,39.12,48.07l7.81,8.59A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81a108.08,108.08,0,0,0,112.55-8.66l7.8,8.58a12,12,0,0,0,17.76-16.14ZM128,212a83.91,83.91,0,0,1-42-11.27,12,12,0,0,0-9.82-1l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.82,84,84,0,0,1,7.94-95.49l111.84,123A83.83,83.83,0,0,1,128,212Zm108-84a107.22,107.22,0,0,1-8.65,42.4A12,12,0,0,1,205.28,161a84.07,84.07,0,0,0-102.77-113,12,12,0,0,1-7.27-22.87A108.08,108.08,0,0,1,236,128Z\"></path>\n </svg>\n Request Rejected\n </div>\n</template>\n\n<style scoped>\n.requestRejected {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--scalar-color-red);\n font-weight: var(--scalar-semibold);\n min-height: 40px;\n font-size: var(--scalar-font-size-3);\n position: relative;\n}\n</style>\n"],"mappings":";;;;;AACO,IAAA,aAAA,EAAA,OAAM,kBAAiB;;CAA5B,OAAAA,UAAA,GAAAC,mBAWM,OAXN,YAWM,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAVJC,mBAQM,OAAA;EAPJ,MAAK;EACL,QAAO;EACP,SAAQ;EACR,OAAM;EACN,OAAM;C,IACNA,mBAC+e,QAAA,EAA7e,GAAE,oeAAme,CAAA,C,QACneC,gBAAA,sBAER,EAAA,C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSuccess.vue.js","names":["_openBlock","_createElementBlock"],"sources":["../../src/components/RequestSuccess.vue"],"sourcesContent":["<template>\n <div class=\"requestSuccess\">\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <rect\n height=\"14.25\"\n rx=\"7.125\"\n width=\"14.25\"\n x=\"0.875\"\n y=\"0.875\" />\n <rect\n height=\"14.25\"\n rx=\"7.125\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n width=\"14.25\"\n x=\"0.875\"\n y=\"0.875\" />\n <g clip-path=\"url(#clip0_74_840)\">\n <path\n d=\"M11.6037 6.841L7.59117 10.8535C7.49742 10.9472 7.37029 10.9998 7.23774 10.9998C7.10519 10.9998 6.97806 10.9472 6.8843 10.8535L4.64617 8.6035C4.55257 8.50975 4.5 8.38269 4.5 8.25022C4.5 8.11774 4.55257 7.99068 4.64617 7.89694L5.27117 7.27194C5.36488 7.17862 5.49174 7.12623 5.62399 7.12623C5.75623 7.12623 5.88309 7.17862 5.9768 7.27194L7.25024 8.50694L10.274 5.52037C10.3677 5.42696 10.4946 5.37451 10.627 5.37451C10.7593 5.37451 10.8862 5.42696 10.9799 5.52037L11.6034 6.131C11.6502 6.17746 11.6875 6.23274 11.7129 6.29366C11.7383 6.35458 11.7514 6.41993 11.7514 6.48593C11.7514 6.55194 11.7384 6.6173 11.713 6.67824C11.6877 6.73918 11.6505 6.7945 11.6037 6.841Z\"\n fill=\"currentColor\" />\n </g>\n <defs>\n <clipPath id=\"clip0_74_840\">\n <rect\n height=\"8\"\n rx=\"4\"\n width=\"8\"\n x=\"4\"\n y=\"4\" />\n </clipPath>\n </defs>\n </svg>\n Request Succeeded\n </div>\n</template>\n\n<style scoped>\n.requestSuccess {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--scalar-color-1);\n font-weight: var(--scalar-semibold);\n min-height: 40px;\n font-size: var(--scalar-font-size-3);\n position: relative;\n}\n</style>\n"],"mappings":";;;;;AACO,IAAA,aAAA,EAAA,OAAM,iBAAgB;;CAA3B,OAAAA,UAAA,GAAAC,mBAsCM,OAtCN,YAsCM,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,C"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import ResponseBodyInfo_default from "./ResponseBodyInfo.vue.js";
|
|
2
|
-
import ResponseBodyPreview_default from "./ResponseBodyPreview.vue.js";
|
|
3
|
-
import ResponseBodyRaw_default from "./ResponseBodyRaw.vue.js";
|
|
4
|
-
import { Fragment, createBlock, createCommentVNode, createElementBlock, createTextVNode, defineComponent, openBlock, withCtx } from "vue";
|
|
5
|
-
// src/components/ResponseBody/ResponseBody.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var ResponseBody_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
|
-
__name: "ResponseBody",
|
|
8
|
-
props: {
|
|
9
|
-
data: {},
|
|
10
|
-
responseBody: {},
|
|
11
|
-
mediaConfig: {},
|
|
12
|
-
display: {}
|
|
13
|
-
},
|
|
14
|
-
setup(__props) {
|
|
15
|
-
return (_ctx, _cache) => {
|
|
16
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
17
|
-
__props.mediaConfig?.raw && __props.display === "raw" && __props.mediaConfig.language ? (openBlock(), createBlock(ResponseBodyRaw_default, {
|
|
18
|
-
key: __props.responseBody.dataUrl,
|
|
19
|
-
content: __props.data,
|
|
20
|
-
language: __props.mediaConfig.language
|
|
21
|
-
}, null, 8, ["content", "language"])) : createCommentVNode("", true),
|
|
22
|
-
__props.mediaConfig?.preview && __props.display === "preview" ? (openBlock(), createBlock(ResponseBodyPreview_default, {
|
|
23
|
-
key: __props.responseBody.dataUrl,
|
|
24
|
-
alpha: __props.mediaConfig.alpha,
|
|
25
|
-
mode: __props.mediaConfig.preview,
|
|
26
|
-
src: __props.responseBody.dataUrl,
|
|
27
|
-
type: __props.responseBody.mimeType?.essence ?? ""
|
|
28
|
-
}, null, 8, [
|
|
29
|
-
"alpha",
|
|
30
|
-
"mode",
|
|
31
|
-
"src",
|
|
32
|
-
"type"
|
|
33
|
-
])) : createCommentVNode("", true),
|
|
34
|
-
!__props.mediaConfig?.raw && !__props.mediaConfig?.preview ? (openBlock(), createBlock(ResponseBodyInfo_default, { key: 2 }, {
|
|
35
|
-
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Binary file ", -1)])]),
|
|
36
|
-
_: 1
|
|
37
|
-
})) : createCommentVNode("", true)
|
|
38
|
-
], 64);
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
export { ResponseBody_vue_vue_type_script_setup_true_lang_default as default };
|
|
43
|
-
|
|
44
|
-
//# sourceMappingURL=ResponseBody.vue_vue_type_script_setup_true_lang.js.map
|
package/dist/components/ResponseBody/ResponseBody.vue_vue_type_script_setup_true_lang.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBody.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","ResponseBodyRaw","ResponseBodyPreview","ResponseBodyInfo","_withCtx","_createTextVNode"],"sources":["../../../src/components/ResponseBody/ResponseBody.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type MediaConfig } from '@/components/ResponseBody/helpers/media-types'\nimport ResponseBodyInfo from '@/components/ResponseBody/ResponseBodyInfo.vue'\nimport ResponseBodyPreview from '@/components/ResponseBody/ResponseBodyPreview.vue'\nimport ResponseBodyRaw from '@/components/ResponseBody/ResponseBodyRaw.vue'\nimport type { MimeType } from '@/types/mime-type'\n\nconst { data, responseBody, mediaConfig, display } = defineProps<{\n data: unknown\n responseBody: {\n mimeType?: MimeType\n attachmentFilename: string\n dataUrl: string\n }\n mediaConfig?: MediaConfig\n display?: 'preview' | 'raw'\n}>()\n</script>\n\n<template>\n <ResponseBodyRaw\n v-if=\"mediaConfig?.raw && display === 'raw' && mediaConfig.language\"\n :key=\"responseBody.dataUrl\"\n :content=\"data\"\n :language=\"mediaConfig.language\" />\n <ResponseBodyPreview\n v-if=\"mediaConfig?.preview && display === 'preview'\"\n :key=\"responseBody.dataUrl\"\n :alpha=\"mediaConfig.alpha\"\n :mode=\"mediaConfig.preview\"\n :src=\"responseBody.dataUrl\"\n :type=\"responseBody.mimeType?.essence ?? ''\" />\n <ResponseBodyInfo v-if=\"!mediaConfig?.raw && !mediaConfig?.preview\">\n Binary file\n </ResponseBodyInfo>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;IAqBU,QAAA,aAAa,OAAO,QAAA,YAAO,SAAc,QAAA,YAAY,YAD7DA,UAAA,GAAAC,YAIqCC,yBAAA;KAFlC,KAAK,QAAA,aAAa;KAClB,SAAS,QAAA;KACT,UAAU,QAAA,YAAY;;IAEjB,QAAA,aAAa,WAAW,QAAA,YAAO,aADvCF,UAAA,GAAAC,YAMiDE,6BAAA;KAJ9C,KAAK,QAAA,aAAa;KAClB,OAAO,QAAA,YAAY;KACnB,MAAM,QAAA,YAAY;KAClB,KAAK,QAAA,aAAa;KAClB,MAAM,QAAA,aAAa,UAAU,WAAO;;;;;;;IACd,CAAA,QAAA,aAAa,OAAG,CAAK,QAAA,aAAa,WAA3DH,UAAA,GAAAC,YAEmBG,0BAAA,EAAA,KAAA,EAAA,GAAA;KAFiD,SAAAC,cAEpE,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAFoEC,gBAAA,iBAEpE,EAAA,C"}
|
package/dist/components/ResponseBody/ResponseBodyPreview.vue_vue_type_script_setup_true_lang.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import ResponseBodyInfo_default from "./ResponseBodyInfo.vue.js";
|
|
2
|
-
import { createBlock, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, openBlock, ref, watch, withCtx } from "vue";
|
|
3
|
-
// src/components/ResponseBody/ResponseBodyPreview.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var _hoisted_1 = ["src"];
|
|
5
|
-
var _hoisted_2 = ["src", "type"];
|
|
6
|
-
var _hoisted_3 = ["src", "type"];
|
|
7
|
-
var _hoisted_4 = ["data", "type"];
|
|
8
|
-
var ResponseBodyPreview_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
|
-
__name: "ResponseBodyPreview",
|
|
10
|
-
props: {
|
|
11
|
-
src: {},
|
|
12
|
-
type: {},
|
|
13
|
-
mode: {},
|
|
14
|
-
alpha: {
|
|
15
|
-
type: Boolean,
|
|
16
|
-
default: false
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
setup(__props) {
|
|
20
|
-
const error = ref(false);
|
|
21
|
-
watch(() => __props.src, () => {
|
|
22
|
-
error.value = false;
|
|
23
|
-
});
|
|
24
|
-
return (_ctx, _cache) => {
|
|
25
|
-
return !error.value && __props.src ? (openBlock(), createElementBlock("div", {
|
|
26
|
-
key: 0,
|
|
27
|
-
class: normalizeClass(["flex justify-center overflow-auto rounded-b", { "bg-preview p-2": __props.alpha }])
|
|
28
|
-
}, [__props.mode === "image" ? (openBlock(), createElementBlock("img", {
|
|
29
|
-
key: 0,
|
|
30
|
-
class: normalizeClass(["h-full max-w-full", { rounded: __props.alpha }]),
|
|
31
|
-
src: __props.src,
|
|
32
|
-
onError: _cache[0] || (_cache[0] = ($event) => error.value = true)
|
|
33
|
-
}, null, 42, _hoisted_1)) : __props.mode === "video" ? (openBlock(), createElementBlock("video", {
|
|
34
|
-
key: 1,
|
|
35
|
-
autoplay: "",
|
|
36
|
-
controls: "",
|
|
37
|
-
width: "100%",
|
|
38
|
-
onError: _cache[1] || (_cache[1] = ($event) => error.value = true)
|
|
39
|
-
}, [createElementVNode("source", {
|
|
40
|
-
src: __props.src,
|
|
41
|
-
type: __props.type
|
|
42
|
-
}, null, 8, _hoisted_2)], 32)) : __props.mode === "audio" ? (openBlock(), createElementBlock("audio", {
|
|
43
|
-
key: 2,
|
|
44
|
-
class: "my-12",
|
|
45
|
-
controls: "",
|
|
46
|
-
onError: _cache[2] || (_cache[2] = ($event) => error.value = true)
|
|
47
|
-
}, [createElementVNode("source", {
|
|
48
|
-
src: __props.src,
|
|
49
|
-
type: __props.type
|
|
50
|
-
}, null, 8, _hoisted_3)], 32)) : (openBlock(), createElementBlock("object", {
|
|
51
|
-
key: 3,
|
|
52
|
-
class: "aspect-[4/3] w-full",
|
|
53
|
-
data: __props.src,
|
|
54
|
-
type: __props.type,
|
|
55
|
-
onError: _cache[3] || (_cache[3] = ($event) => error.value = true)
|
|
56
|
-
}, null, 40, _hoisted_4))], 2)) : (openBlock(), createBlock(ResponseBodyInfo_default, { key: 1 }, {
|
|
57
|
-
default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode("Preview unavailable", -1)])]),
|
|
58
|
-
_: 1
|
|
59
|
-
}));
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
export { ResponseBodyPreview_vue_vue_type_script_setup_true_lang_default as default };
|
|
64
|
-
|
|
65
|
-
//# sourceMappingURL=ResponseBodyPreview.vue_vue_type_script_setup_true_lang.js.map
|
package/dist/components/ResponseBody/ResponseBodyPreview.vue_vue_type_script_setup_true_lang.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBodyPreview.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_createBlock","ResponseBodyInfo","_withCtx","_createTextVNode"],"sources":["../../../src/components/ResponseBody/ResponseBodyPreview.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ref, watch } from 'vue'\n\nimport { type MediaPreview } from '@/components/ResponseBody/helpers/media-types'\nimport ResponseBodyInfo from '@/components/ResponseBody/ResponseBodyInfo.vue'\n\nconst {\n src,\n type,\n mode,\n alpha = false,\n} = defineProps<{\n src: string\n type: string\n mode: MediaPreview\n alpha?: boolean | undefined\n}>()\n\nconst error = ref(false)\n\nwatch(\n () => src,\n () => {\n error.value = false\n },\n)\n</script>\n<template>\n <div\n v-if=\"!error && src\"\n class=\"flex justify-center overflow-auto rounded-b\"\n :class=\"{ 'bg-preview p-2': alpha }\">\n <img\n v-if=\"mode === 'image'\"\n class=\"h-full max-w-full\"\n :class=\"{ rounded: alpha }\"\n :src=\"src\"\n @error=\"error = true\" />\n <video\n v-else-if=\"mode === 'video'\"\n autoplay\n controls\n width=\"100%\"\n @error=\"error = true\">\n <source\n :src=\"src\"\n :type=\"type\" />\n </video>\n <audio\n v-else-if=\"mode === 'audio'\"\n class=\"my-12\"\n controls\n @error=\"error = true\">\n <source\n :src=\"src\"\n :type=\"type\" />\n </audio>\n <object\n v-else\n class=\"aspect-[4/3] w-full\"\n :data=\"src\"\n :type=\"type\"\n @error=\"error = true\" />\n </div>\n <ResponseBodyInfo v-else>Preview unavailable</ResponseBodyInfo>\n</template>\n<style scoped>\n.light-mode .bg-preview {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23000' fill-opacity='10%25'%3E%3Crect width='8' height='8' /%3E%3Crect x='8' y='8' width='8' height='8' /%3E%3C/svg%3E\");\n}\n.dark-mode .bg-preview {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23FFF' fill-opacity='10%25'%3E%3Crect width='8' height='8' /%3E%3Crect x='8' y='8' width='8' height='8' /%3E%3C/svg%3E\");\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAkBA,MAAM,QAAQ,IAAI,KAAK;EAEvB,YACQ,QAAA,WACA;GACJ,MAAM,QAAQ;EAChB,CACF;;GAIW,OAAA,CAAA,MAAA,SAAS,QAAA,OADlBA,UAAA,GAAAC,mBAmCM,OAAA;;IAjCJ,OAAKC,eAAA,CAAC,+CAA6C,EAAA,kBACvB,QAAA,MAAK,CAAA,CAAA;G,IAEzB,QAAA,SAAI,WADZF,UAAA,GAAAC,mBAK0B,OAAA;;IAHxB,OAAKC,eAAA,CAAC,qBAAmB,EAAA,SACN,QAAA,MAAK,CAAA,CAAA;IACvB,KAAK,QAAA;IACL,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,QAAK;G,4BAEF,QAAA,SAAI,WADjBF,UAAA,GAAAC,mBASQ,SAAA;;IAPN,UAAA;IACA,UAAA;IACA,OAAM;IACL,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,QAAK;G,IACbE,mBAEiB,UAAA;IADd,KAAK,QAAA;IACL,MAAM,QAAA;G,iCAGE,QAAA,SAAI,WADjBH,UAAA,GAAAC,mBAQQ,SAAA;;IANN,OAAM;IACN,UAAA;IACC,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,QAAK;G,IACbE,mBAEiB,UAAA;IADd,KAAK,QAAA;IACL,MAAM,QAAA;G,kCAEXH,UAAA,GAAAC,mBAK0B,UAAA;;IAHxB,OAAM;IACL,MAAM,QAAA;IACN,MAAM,QAAA;IACN,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,QAAK;G,mCAEjBD,UAAA,GAAAI,YAA+DC,0BAAA,EAAA,KAAA,EAAA,GAAA;IAAtC,SAAAC,cAAmB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAnBC,gBAAA,uBAAmB,EAAA,C"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createBlock, defineComponent, openBlock, unref } from "vue";
|
|
2
|
-
import { ScalarCodeBlock } from "@scalar/components/code-block";
|
|
3
|
-
// src/components/ResponseBody/ResponseBodyRaw.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var ResponseBodyRaw_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
|
-
__name: "ResponseBodyRaw",
|
|
6
|
-
props: {
|
|
7
|
-
content: {},
|
|
8
|
-
language: {}
|
|
9
|
-
},
|
|
10
|
-
setup(__props) {
|
|
11
|
-
const props = __props;
|
|
12
|
-
return (_ctx, _cache) => {
|
|
13
|
-
return openBlock(), createBlock(unref(ScalarCodeBlock), {
|
|
14
|
-
class: "codeBlock",
|
|
15
|
-
content: props.content,
|
|
16
|
-
lang: __props.language
|
|
17
|
-
}, null, 8, ["content", "lang"]);
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
export { ResponseBodyRaw_vue_vue_type_script_setup_true_lang_default as default };
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=ResponseBodyRaw.vue_vue_type_script_setup_true_lang.js.map
|
package/dist/components/ResponseBody/ResponseBodyRaw.vue_vue_type_script_setup_true_lang.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBodyRaw.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref"],"sources":["../../../src/components/ResponseBody/ResponseBodyRaw.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\n\nconst props = defineProps<{\n content: any\n language: string\n}>()\n</script>\n\n<template>\n <ScalarCodeBlock\n class=\"codeBlock\"\n :content=\"props.content\"\n :lang=\"language\" />\n</template>\n"],"mappings":";;;;;;;;;;EAGA,MAAM,QAAQ;;GAOZ,OAAAA,UAAA,GAAAC,YAGqBC,MAAA,eAAA,GAAA;IAFnB,OAAM;IACL,SAAS,MAAM;IACf,MAAM,QAAA"}
|
package/dist/components/ResponseBody/ResponseBodyToggle.vue_vue_type_script_setup_true_lang.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createElementBlock, createElementVNode, defineComponent, normalizeClass, openBlock, withModifiers } from "vue";
|
|
2
|
-
// src/components/ResponseBody/ResponseBodyToggle.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var _hoisted_1 = { class: "text-c-3 text-xxs -my-1 flex justify-center gap-0.5 rounded p-0.5" };
|
|
4
|
-
var ResponseBodyToggle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
|
-
__name: "ResponseBodyToggle",
|
|
6
|
-
props: { modelValue: {} },
|
|
7
|
-
emits: ["toggle"],
|
|
8
|
-
setup(__props, { emit: __emit }) {
|
|
9
|
-
const emit = __emit;
|
|
10
|
-
return (_ctx, _cache) => {
|
|
11
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("button", {
|
|
12
|
-
class: normalizeClass(["hover:bg-b-3 rounded px-1", { "bg-b-3 text-c-1 cursor-default": __props.modelValue === "preview" }]),
|
|
13
|
-
type: "button",
|
|
14
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("toggle", "preview"), ["stop"]))
|
|
15
|
-
}, " Preview ", 2), createElementVNode("button", {
|
|
16
|
-
class: normalizeClass(["hover:bg-b-3 rounded px-1", { "bg-b-3 text-c-1 cursor-default": __props.modelValue === "raw" }]),
|
|
17
|
-
type: "button",
|
|
18
|
-
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => emit("toggle", "raw"), ["stop"]))
|
|
19
|
-
}, " Raw ", 2)]);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
export { ResponseBodyToggle_vue_vue_type_script_setup_true_lang_default as default };
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=ResponseBodyToggle.vue_vue_type_script_setup_true_lang.js.map
|
package/dist/components/ResponseBody/ResponseBodyToggle.vue_vue_type_script_setup_true_lang.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBodyToggle.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_normalizeClass","_withModifiers"],"sources":["../../../src/components/ResponseBody/ResponseBodyToggle.vue"],"sourcesContent":["<script lang=\"ts\" setup>\ndefineProps<{\n modelValue?: 'preview' | 'raw'\n}>()\n\nconst emit = defineEmits<{\n (e: 'toggle', v: 'preview' | 'raw'): void\n}>()\n</script>\n<template>\n <div\n class=\"text-c-3 text-xxs -my-1 flex justify-center gap-0.5 rounded p-0.5\">\n <button\n class=\"hover:bg-b-3 rounded px-1\"\n :class=\"{ 'bg-b-3 text-c-1 cursor-default': modelValue === 'preview' }\"\n type=\"button\"\n @click.stop=\"emit('toggle', 'preview')\">\n Preview\n </button>\n <button\n class=\"hover:bg-b-3 rounded px-1\"\n :class=\"{ 'bg-b-3 text-c-1 cursor-default': modelValue === 'raw' }\"\n type=\"button\"\n @click.stop=\"emit('toggle', 'raw')\">\n Raw\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;EAKA,MAAM,OAAO;;GAKX,OAAAA,UAAA,GAAAC,mBAgBM,OAhBN,YAgBM,CAdJC,mBAMS,UAAA;IALP,OAAKC,eAAA,CAAC,6BAA2B,EAAA,kCACW,QAAA,eAAU,UAAA,CAAA,CAAA;IACtD,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,KAAAC,eAAA,WAAO,KAAI,UAAA,SAAA,GAAA,CAAA,MAAA,CAAA;GAAuB,GAAA,aAE1C,CAAA,GACAF,mBAMS,UAAA;IALP,OAAKC,eAAA,CAAC,6BAA2B,EAAA,kCACW,QAAA,eAAU,MAAA,CAAA,CAAA;IACtD,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,KAAAC,eAAA,WAAO,KAAI,UAAA,KAAA,GAAA,CAAA,MAAA,CAAA;GAAmB,GAAA,SAEtC,CAAA,C"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { useSearch } from "../hooks/use-search.js";
|
|
2
|
-
import { useState } from "../state/state.js";
|
|
3
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
4
|
-
import { ScalarIconMagnifyingGlass } from "@scalar/icons";
|
|
5
|
-
import { ScalarPopover } from "@scalar/components/popover";
|
|
6
|
-
import { ScalarTextInput } from "@scalar/components/text-input";
|
|
7
|
-
// src/components/SearchPopover.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var _hoisted_1 = ["onClick"];
|
|
9
|
-
var _hoisted_2 = ["src"];
|
|
10
|
-
var _hoisted_3 = {
|
|
11
|
-
key: 1,
|
|
12
|
-
class: "searchResultsEmpty"
|
|
13
|
-
};
|
|
14
|
-
var SearchPopover_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
15
|
-
__name: "SearchPopover",
|
|
16
|
-
setup(__props) {
|
|
17
|
-
const state = useState();
|
|
18
|
-
const search = useSearch();
|
|
19
|
-
const searchOptions = computed(() => search.results.value.filter((r) => !state.registryDocuments.value.some((d) => d.namespace === r.namespace && d.slug === r.slug)).map((result) => ({
|
|
20
|
-
...result,
|
|
21
|
-
label: result.title,
|
|
22
|
-
id: result.id
|
|
23
|
-
})));
|
|
24
|
-
return (_ctx, _cache) => {
|
|
25
|
-
return openBlock(), createBlock(unref(ScalarPopover), {
|
|
26
|
-
offset: 0,
|
|
27
|
-
placement: "top-start",
|
|
28
|
-
resize: "",
|
|
29
|
-
style: { "width": "220px" }
|
|
30
|
-
}, {
|
|
31
|
-
popover: withCtx(({ close }) => [createVNode(unref(ScalarTextInput), {
|
|
32
|
-
autofocus: "",
|
|
33
|
-
class: "searchInput",
|
|
34
|
-
modelValue: unref(search).query.value,
|
|
35
|
-
placeholder: "Add an API",
|
|
36
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = (v) => unref(search).query.value = v ?? "")
|
|
37
|
-
}, {
|
|
38
|
-
prefix: withCtx(() => [createVNode(unref(ScalarIconMagnifyingGlass), { class: "searchIcon" })]),
|
|
39
|
-
_: 1
|
|
40
|
-
}, 8, ["modelValue"]), searchOptions.value.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(searchOptions.value, (option) => {
|
|
41
|
-
return openBlock(), createElementBlock("button", {
|
|
42
|
-
key: option.id,
|
|
43
|
-
class: "searchItem",
|
|
44
|
-
type: "button",
|
|
45
|
-
onClick: () => {
|
|
46
|
-
unref(state).addDocument(option);
|
|
47
|
-
close();
|
|
48
|
-
}
|
|
49
|
-
}, [option.logoUrl ? (openBlock(), createElementBlock("img", {
|
|
50
|
-
key: 0,
|
|
51
|
-
class: "searchItemLogo",
|
|
52
|
-
src: option.logoUrl
|
|
53
|
-
}, null, 8, _hoisted_2)) : createCommentVNode("", true), createElementVNode("span", null, toDisplayString(option.title), 1)], 8, _hoisted_1);
|
|
54
|
-
}), 128)) : (openBlock(), createElementBlock("span", _hoisted_3, " No APIs found "))]),
|
|
55
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
|
|
56
|
-
_: 3
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
export { SearchPopover_vue_vue_type_script_setup_true_lang_default as default };
|
|
62
|
-
|
|
63
|
-
//# sourceMappingURL=SearchPopover.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchPopover.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createVNode","_createElementBlock","_Fragment","_renderList","_createElementVNode","_toDisplayString","_renderSlot"],"sources":["../../src/components/SearchPopover.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarTextInput } from '@scalar/components/text-input'\nimport { ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport { computed } from 'vue'\n\nimport { useSearch } from '@/hooks/use-search'\nimport { useState } from '@/state/state'\n\nconst state = useState()\n\nconst search = useSearch()\n\nconst searchOptions = computed(() =>\n search.results.value\n .filter(\n (r) =>\n !state.registryDocuments.value.some(\n (d) => d.namespace === r.namespace && d.slug === r.slug,\n ),\n )\n .map((result) => ({\n ...result,\n label: result.title,\n id: result.id,\n })),\n)\n</script>\n\n<template>\n <ScalarPopover\n :offset=\"0\"\n placement=\"top-start\"\n resize\n style=\"width: 220px\">\n <slot />\n <template #popover=\"{ close }\">\n <ScalarTextInput\n autofocus\n class=\"searchInput\"\n :modelValue=\"search.query.value\"\n placeholder=\"Add an API\"\n @update:modelValue=\"(v) => (search.query.value = v ?? '')\">\n <template #prefix>\n <ScalarIconMagnifyingGlass class=\"searchIcon\" />\n </template>\n </ScalarTextInput>\n\n <template v-if=\"searchOptions.length\">\n <button\n v-for=\"option in searchOptions\"\n :key=\"option.id\"\n class=\"searchItem\"\n type=\"button\"\n @click=\"\n () => {\n state.addDocument(option)\n close()\n }\n \">\n <img\n v-if=\"option.logoUrl\"\n class=\"searchItemLogo\"\n :src=\"option.logoUrl\" />\n <span>{{ option.title }}</span>\n </button>\n </template>\n\n <span\n v-else\n class=\"searchResultsEmpty\">\n No APIs found\n </span>\n </template>\n </ScalarPopover>\n</template>\n\n<style scoped>\n.searchItem {\n display: flex;\n align-items: center;\n gap: 9px;\n padding: 8px 10px;\n font-size: var(--scalar-font-size-3);\n}\n\n.searchInput {\n margin-bottom: 5px;\n}\n\n.searchItem:hover {\n background: var(--scalar-background-2);\n}\n\n.searchItemLogo {\n width: 15px;\n}\n\n.searchIcon {\n margin-right: 7px;\n}\n\n.searchResultsEmpty {\n font-size: var(--scalar-font-size-3);\n color: var(--scalar-color-2);\n margin: 10px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;EASA,MAAM,QAAQ,SAAS;EAEvB,MAAM,SAAS,UAAU;EAEzB,MAAM,gBAAgB,eACpB,OAAO,QAAQ,MACZ,QACE,MACC,CAAC,MAAM,kBAAkB,MAAM,MAC5B,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,IACrD,CACJ,CAAA,CACC,KAAK,YAAY;GAChB,GAAG;GACH,OAAO,OAAO;GACd,IAAI,OAAO;EACb,EAAE,CACN;;GAIE,OAAAA,UAAA,GAAAC,YA4CgBC,MAAA,aAAA,GAAA;IA3Cb,QAAQ;IACT,WAAU;IACV,QAAA;IACA,OAAA,EAAA,SAAA,QAAA;;IAEW,SAAOC,SAUE,EAVE,YAAK,CACzBC,YASkBF,MAAA,eAAA,GAAA;KARhB,WAAA;KACA,OAAM;KACL,YAAYA,MAAA,MAAA,CAAM,CAAC,MAAM;KAC1B,aAAY;KACX,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAO,MAAA,MAAA,CAAM,CAAC,MAAM,QAAQ,KAAC;;KACvC,QAAMC,cACiC,CAAhDC,YAAgDF,MAAA,yBAAA,GAAA,EAArB,OAAM,aAAY,CAAA,C;;I,uBAIjC,cAAA,MAAc,UAC5BF,UAAA,IAAA,GAAAK,mBAgBSC,UAAA,EAAA,KAAA,EAAA,GAAAC,WAfU,cAAA,QAAV,WAAM;KADf,OAAAP,UAAA,GAAAK,mBAgBS,UAAA;MAdN,KAAK,OAAO;MACb,OAAM;MACN,MAAK;MACJ,e;OAA0C,MAAA,KAAA,CAAK,CAAC,YAAY,MAAM;OAAgB,MAAK;;K,IAOhF,OAAO,WADfL,UAAA,GAAAK,mBAG0B,OAAA;;MADxB,OAAM;MACL,KAAK,OAAO;K,yDACfG,mBAA+B,QAAA,MAAAC,gBAAtB,OAAO,KAAK,GAAA,CAAA,C;I,aAIzBT,UAAA,GAAAK,mBAIO,QAJP,YAE6B,iBAE7B,E;IArCF,SAAAF,cAAQ,CAARO,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,IAAA,C"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
2
|
-
import { resolveServerUrlTemplate } from "@scalar/workspace-store/request-example";
|
|
3
|
-
import { ScalarButton } from "@scalar/components/button";
|
|
4
|
-
import { ScalarIconCaretDown } from "@scalar/icons";
|
|
5
|
-
import { ScalarListbox } from "@scalar/components/listbox";
|
|
6
|
-
// src/components/Selector.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var _hoisted_1 = { class: "overflow-x-auto" };
|
|
8
|
-
var _hoisted_2 = {
|
|
9
|
-
key: 1,
|
|
10
|
-
class: "text-c-1 flex h-auto w-full items-center gap-0.75 rounded-b-lg px-3 py-1.5 text-base leading-[20px] whitespace-nowrap"
|
|
11
|
-
};
|
|
12
|
-
var _hoisted_3 = { class: "overflow-x-auto" };
|
|
13
|
-
var Selector_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
14
|
-
__name: "Selector",
|
|
15
|
-
props: {
|
|
16
|
-
selectedServer: {},
|
|
17
|
-
servers: {},
|
|
18
|
-
target: {}
|
|
19
|
-
},
|
|
20
|
-
emits: ["update:modelValue"],
|
|
21
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
22
|
-
const emit = __emit;
|
|
23
|
-
const serverOptions = computed(() => __props.servers.map((server) => ({
|
|
24
|
-
id: server.url,
|
|
25
|
-
label: server.url
|
|
26
|
-
})));
|
|
27
|
-
const serverUrlWithoutTrailingSlash = computed(() => __props.selectedServer ? resolveServerUrlTemplate(__props.selectedServer).replace(/\/$/, "") : "");
|
|
28
|
-
const selectedServerOption = computed(() => serverOptions.value.find((opt) => opt.id === __props.selectedServer?.url));
|
|
29
|
-
__expose({
|
|
30
|
-
servers: __props.servers,
|
|
31
|
-
serverUrlWithoutTrailingSlash,
|
|
32
|
-
serverOptions,
|
|
33
|
-
selectedServer: __props.selectedServer
|
|
34
|
-
});
|
|
35
|
-
return (_ctx, _cache) => {
|
|
36
|
-
return serverOptions.value.length > 1 ? (openBlock(), createBlock(unref(ScalarListbox), {
|
|
37
|
-
key: 0,
|
|
38
|
-
ref: "elem",
|
|
39
|
-
class: "group",
|
|
40
|
-
modelValue: selectedServerOption.value,
|
|
41
|
-
options: serverOptions.value,
|
|
42
|
-
placement: "bottom-start",
|
|
43
|
-
resize: "",
|
|
44
|
-
target: __props.target,
|
|
45
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = (e) => emit("update:modelValue", e.id))
|
|
46
|
-
}, {
|
|
47
|
-
default: withCtx(() => [createVNode(unref(ScalarButton), {
|
|
48
|
-
class: "bg-b-1 text-c-1 h-auto w-full justify-start gap-1.5 overflow-x-auto rounded-t-none rounded-b-xl px-3 py-1.5 text-base font-normal whitespace-nowrap -outline-offset-1",
|
|
49
|
-
variant: "ghost"
|
|
50
|
-
}, {
|
|
51
|
-
default: withCtx(() => [
|
|
52
|
-
_cache[1] || (_cache[1] = createElementVNode("span", { class: "sr-only" }, "Server:", -1)),
|
|
53
|
-
createElementVNode("span", _hoisted_1, toDisplayString(serverUrlWithoutTrailingSlash.value || "Select a server"), 1),
|
|
54
|
-
createVNode(unref(ScalarIconCaretDown), {
|
|
55
|
-
class: "text-c-2 ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100",
|
|
56
|
-
weight: "bold"
|
|
57
|
-
})
|
|
58
|
-
]),
|
|
59
|
-
_: 1
|
|
60
|
-
})]),
|
|
61
|
-
_: 1
|
|
62
|
-
}, 8, [
|
|
63
|
-
"modelValue",
|
|
64
|
-
"options",
|
|
65
|
-
"target"
|
|
66
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_2, [_cache[2] || (_cache[2] = createElementVNode("span", { class: "sr-only" }, "Server:", -1)), createElementVNode("span", _hoisted_3, toDisplayString(serverUrlWithoutTrailingSlash.value), 1)]));
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
export { Selector_vue_vue_type_script_setup_true_lang_default as default };
|
|
71
|
-
|
|
72
|
-
//# sourceMappingURL=Selector.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createVNode","_createElementVNode","_toDisplayString","_createElementBlock"],"sources":["../../src/components/Selector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarListbox } from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport { resolveServerUrlTemplate } from '@scalar/workspace-store/request-example'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nconst { target, servers, selectedServer } = defineProps<{\n /** The selected server URL */\n selectedServer: ServerObject | null\n /** Available servers */\n servers: ServerObject[]\n /** The id of the target to use for the popover (e.g. address bar) */\n target: string\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the selected server changes */\n (e: 'update:modelValue', value: string): void\n}>()\n\nconst serverOptions = computed(() =>\n servers.map((server) => ({\n id: server.url,\n label: server.url,\n })),\n)\n\nconst serverUrlWithoutTrailingSlash = computed(() =>\n selectedServer\n ? resolveServerUrlTemplate(selectedServer).replace(/\\/$/, '')\n : '',\n)\n\nconst selectedServerOption = computed(() =>\n serverOptions.value.find((opt) => opt.id === selectedServer?.url),\n)\n\n// For testing\ndefineExpose({\n servers,\n serverUrlWithoutTrailingSlash,\n serverOptions,\n selectedServer,\n})\n</script>\n<template>\n <ScalarListbox\n v-if=\"serverOptions.length > 1\"\n ref=\"elem\"\n class=\"group\"\n :modelValue=\"selectedServerOption\"\n :options=\"serverOptions\"\n placement=\"bottom-start\"\n resize\n :target=\"target\"\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <ScalarButton\n class=\"bg-b-1 text-c-1 h-auto w-full justify-start gap-1.5 overflow-x-auto rounded-t-none rounded-b-xl px-3 py-1.5 text-base font-normal whitespace-nowrap -outline-offset-1\"\n variant=\"ghost\">\n <span class=\"sr-only\">Server:</span>\n <span class=\"overflow-x-auto\">{{\n serverUrlWithoutTrailingSlash || 'Select a server'\n }}</span>\n <ScalarIconCaretDown\n class=\"text-c-2 ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100\"\n weight=\"bold\" />\n </ScalarButton>\n </ScalarListbox>\n <div\n v-else\n class=\"text-c-1 flex h-auto w-full items-center gap-0.75 rounded-b-lg px-3 py-1.5 text-base leading-[20px] whitespace-nowrap\">\n <span class=\"sr-only\">Server:</span>\n <span class=\"overflow-x-auto\">{{ serverUrlWithoutTrailingSlash }}</span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,OAAO;EAKb,MAAM,gBAAgB,eACpB,QAAA,QAAQ,KAAK,YAAY;GACvB,IAAI,OAAO;GACX,OAAO,OAAO;EAChB,EAAE,CACJ;EAEA,MAAM,gCAAgC,eACpC,QAAA,iBACI,yBAAyB,QAAA,cAAc,CAAC,CAAC,QAAQ,OAAO,EAAE,IAC1D,EACN;EAEA,MAAM,uBAAuB,eAC3B,cAAc,MAAM,MAAM,QAAQ,IAAI,OAAO,QAAA,gBAAgB,GAAG,CAClE;EAGA,SAAa;GACX,SAAM,QAAA;GACN;GACA;GACA,gBAAa,QAAA;EACf,CAAC;;GAIS,OAAA,cAAA,MAAc,SAAM,KAD5BA,UAAA,GAAAC,YAqBgBC,MAAA,aAAA,GAAA;;IAnBd,KAAI;IACJ,OAAM;IACL,YAAY,qBAAA;IACZ,SAAS,cAAA;IACV,WAAU;IACV,QAAA;IACC,QAAQ,QAAA;IACR,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAM,KAAI,qBAAsB,EAAE,EAAE;;IACzD,SAAAC,cAUe,CAVfC,YAUeF,MAAA,YAAA,GAAA;KATb,OAAM;KACN,SAAQ;;KACR,SAAAC,cAAoC;MAApC,OAAA,OAAA,OAAA,KAAAE,mBAAoC,QAAA,EAA9B,OAAM,UAAS,GAAC,WAAO,EAAA;MAC7BA,mBAES,QAFT,YAESC,gBADP,8BAAA,SAA6B,iBAAA,GAAA,CAAA;MAE/BF,YAEkBF,MAAA,mBAAA,GAAA;OADhB,OAAM;OACN,QAAO;;;;;;;;;;G,OAGbF,UAAA,GAAAO,mBAKM,OALN,YAKM,CAFJ,OAAA,OAAA,OAAA,KAAAF,mBAAoC,QAAA,EAA9B,OAAM,UAAS,GAAC,WAAO,EAAA,IAC7BA,mBAAwE,QAAxE,YAAwEC,gBAAvC,8BAAA,KAA6B,GAAA,CAAA,C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SendingRequest.vue.js","names":["_openBlock","_createElementBlock","_createElementVNode","_createTextVNode"],"sources":["../../src/components/SendingRequest.vue"],"sourcesContent":["<template>\n <div class=\"sendingRequest\">\n <div class=\"playIcon\">\n <svg\n fill=\"currentColor\"\n height=\"32\"\n viewBox=\"0 0 256 256\"\n width=\"32\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z\"></path>\n </svg>\n </div>\n Sending Request to Endpoint\n </div>\n</template>\n\n<style scoped>\n.playIcon {\n padding: 4px;\n height: 16px;\n width: 16px;\n z-index: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n background: var(--scalar-background-1);\n border-radius: var(--scalar-radius-full);\n}\n\n.playIcon::before {\n content: '';\n width: 16px;\n height: 16px;\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n border-width: 1.75px;\n border-style: solid;\n border-color: currentcolor currentcolor transparent;\n border-image: initial;\n border-radius: var(--scalar-radius-full);\n background: var(--scalar-background-1);\n animation: 0.42s linear 0s infinite normal none running rotation;\n}\n\n.sendingRequest {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--scalar-color-blue);\n font-weight: var(--scalar-semibold);\n min-height: 40px;\n font-size: var(--scalar-font-size-3);\n position: relative;\n}\n\n.sendingRequest svg {\n width: 100%;\n height: 100%;\n z-index: 1;\n border-radius: var(--scalar-radius-full);\n}\n\n@keyframes rotation {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n</style>\n"],"mappings":";;;;;AACO,IAAA,aAAA,EAAA,OAAM,iBAAgB;;CAA3B,OAAAA,UAAA,GAAAC,mBAaM,OAbN,YAaM,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAZJC,mBAUM,OAAA,EAVD,OAAM,WAAU,GAAA,CACnBA,mBAQM,OAAA;EAPJ,MAAK;EACL,QAAO;EACP,SAAQ;EACR,OAAM;EACN,OAAM;C,IACNA,mBAC4M,QAAA,EAA1M,GAAE,iMAAgM,CAAA,C,UAElMC,gBAAA,iCAER,EAAA,C"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import Selector_default from "./Selector.vue.js";
|
|
2
|
-
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, unref, useId } from "vue";
|
|
3
|
-
import { ScalarMarkdown } from "@scalar/components/markdown";
|
|
4
|
-
import { ServerVariablesForm } from "@scalar/api-client/components/Server";
|
|
5
|
-
// src/components/ServerSelector.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var _hoisted_1 = ["id"];
|
|
7
|
-
var ServerSelector_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
8
|
-
__name: "ServerSelector",
|
|
9
|
-
props: {
|
|
10
|
-
eventBus: {},
|
|
11
|
-
selectedServer: {},
|
|
12
|
-
servers: {}
|
|
13
|
-
},
|
|
14
|
-
setup(__props) {
|
|
15
|
-
const id = useId();
|
|
16
|
-
/** Update the selected server */
|
|
17
|
-
const updateServer = (newServer) => {
|
|
18
|
-
__props.eventBus.emit("server:update:selected", {
|
|
19
|
-
url: __props.selectedServer?.url === newServer ? "" : newServer,
|
|
20
|
-
meta: { type: "document" }
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
/** Update the server variable */
|
|
24
|
-
const updateServerVariable = (key, value) => {
|
|
25
|
-
/** Find the index of the selected server */
|
|
26
|
-
const index = __props.servers.findIndex((s) => s.url === __props.selectedServer?.url);
|
|
27
|
-
if (index === -1) return;
|
|
28
|
-
__props.eventBus.emit("server:update:variables", {
|
|
29
|
-
index,
|
|
30
|
-
key,
|
|
31
|
-
value,
|
|
32
|
-
meta: { type: "document" }
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
return (_ctx, _cache) => {
|
|
36
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
37
|
-
_cache[0] || (_cache[0] = createElementVNode("label", { class: "bg-b-2 flex h-8 items-center rounded-t-xl border-x border-t px-3 py-2.5 font-medium" }, " Server ", -1)),
|
|
38
|
-
createElementVNode("div", {
|
|
39
|
-
id: unref(id),
|
|
40
|
-
class: normalizeClass(["border", { "rounded-b-xl": !__props.selectedServer?.description && !__props.selectedServer?.variables }])
|
|
41
|
-
}, [__props.servers.length ? (openBlock(), createBlock(Selector_default, {
|
|
42
|
-
key: 0,
|
|
43
|
-
selectedServer: __props.selectedServer,
|
|
44
|
-
servers: __props.servers,
|
|
45
|
-
target: unref(id),
|
|
46
|
-
"onUpdate:modelValue": updateServer
|
|
47
|
-
}, null, 8, [
|
|
48
|
-
"selectedServer",
|
|
49
|
-
"servers",
|
|
50
|
-
"target"
|
|
51
|
-
])) : createCommentVNode("", true)], 10, _hoisted_1),
|
|
52
|
-
createVNode(unref(ServerVariablesForm), {
|
|
53
|
-
layout: "reference",
|
|
54
|
-
variables: __props.selectedServer?.variables,
|
|
55
|
-
"onUpdate:variable": updateServerVariable
|
|
56
|
-
}, null, 8, ["variables"]),
|
|
57
|
-
__props.selectedServer?.description ? (openBlock(), createBlock(unref(ScalarMarkdown), {
|
|
58
|
-
key: 0,
|
|
59
|
-
class: "text-c-3 rounded-b-xl border-x border-b px-3 py-1.5",
|
|
60
|
-
value: __props.selectedServer.description
|
|
61
|
-
}, null, 8, ["value"])) : createCommentVNode("", true)
|
|
62
|
-
], 64);
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
export { ServerSelector_vue_vue_type_script_setup_true_lang_default as default };
|
|
67
|
-
|
|
68
|
-
//# sourceMappingURL=ServerSelector.vue_vue_type_script_setup_true_lang.js.map
|