@scalar/agent-chat 0.5.18 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.vue.d.ts +2 -1
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/api.d.ts +3 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +54 -53
- package/dist/client-tools/execute-request.d.ts +1 -0
- package/dist/client-tools/execute-request.d.ts.map +1 -1
- package/dist/client-tools/execute-request.js +33 -27
- package/dist/components/FreeMessagesInfoSection.vue.d.ts.map +1 -1
- package/dist/components/FreeMessagesInfoSection.vue.js +1 -1
- package/dist/components/FreeMessagesInfoSection.vue2.js +27 -25
- package/dist/components/PaymentSection.vue.d.ts.map +1 -1
- package/dist/components/PaymentSection.vue.js +1 -1
- package/dist/components/PaymentSection.vue2.js +16 -20
- package/dist/components/ServerSelector.vue.d.ts.map +1 -1
- package/dist/components/ServerSelector.vue.js +27 -21
- package/dist/components/UploadSection.vue.js +2 -2
- package/dist/components/UploadSection.vue2.js +13 -13
- package/dist/consts/urls.d.ts +8 -0
- package/dist/consts/urls.d.ts.map +1 -0
- package/dist/consts/urls.js +10 -0
- package/dist/helpers.d.ts +4 -10
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +34 -45
- package/dist/hooks/use-agent-key-documents.js +6 -6
- package/dist/hooks/use-chat-approvals.d.ts.map +1 -1
- package/dist/hooks/use-chat-approvals.js +7 -6
- package/dist/hooks/use-signup-link.d.ts +12 -0
- package/dist/hooks/use-signup-link.d.ts.map +1 -0
- package/dist/hooks/use-signup-link.js +12 -0
- package/dist/hooks/use-upload-tmp-document.d.ts +3 -0
- package/dist/hooks/use-upload-tmp-document.d.ts.map +1 -1
- package/dist/hooks/use-upload-tmp-document.js +31 -28
- package/dist/package.json +1 -1
- package/dist/state/state.d.ts +2 -1
- package/dist/state/state.d.ts.map +1 -1
- package/dist/state/state.js +134 -127
- package/dist/style.css +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.js +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +12 -12
- package/dist/views/PromptForm.vue.d.ts.map +1 -1
- package/dist/views/PromptForm.vue.js +2 -2
- package/dist/views/PromptForm.vue2.js +100 -93
- package/dist/views/Settings/DocSettings.vue.js +1 -1
- package/dist/views/Settings/DocSettings.vue2.js +10 -10
- package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
- package/dist/views/Settings/Settings.vue.js +2 -2
- package/dist/views/Settings/Settings.vue2.js +53 -43
- package/dist/views/Start.vue.d.ts.map +1 -1
- package/dist/views/Start.vue.js +1 -1
- package/dist/views/Start.vue2.js +28 -27
- package/package.json +8 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as S, computed as n, createElementBlock as k, openBlock as u, normalizeClass as C, createElementVNode as d, createBlock as l, createCommentVNode as s, unref as i, withCtx as E, createTextVNode as I, createVNode as N } from "vue";
|
|
2
2
|
import { getSelectedServer as P } from "@scalar/api-client/v2/features/operation";
|
|
3
|
-
import { getActiveEnvironment as B, getServers as
|
|
4
|
-
import { ScalarButton as
|
|
5
|
-
import { ScalarIconArrowRight as
|
|
3
|
+
import { getActiveEnvironment as B, getServers as x } from "@scalar/api-client/v2/helpers";
|
|
4
|
+
import { ScalarButton as T } from "@scalar/components";
|
|
5
|
+
import { ScalarIconArrowRight as _ } from "@scalar/icons";
|
|
6
6
|
import O from "../../../components/AuthenticationProvided.vue.js";
|
|
7
7
|
import b from "../../../components/AuthenticationRequired.vue.js";
|
|
8
8
|
import { ASK_FOR_AUTHENTICATION_TOOL_NAME as w } from "../../../entities/tools/ask-for-authentication.js";
|
|
@@ -19,11 +19,11 @@ const V = { class: "toggleButton" }, q = { class: "authContent" }, F = { class:
|
|
|
19
19
|
const { workspaceStore: c, eventBus: f, config: p, chat: h } = L(), a = n(() => {
|
|
20
20
|
if (!t.messagePart.value.input?.uniqueIdentifier || t.messagePart.value.state !== "input-available")
|
|
21
21
|
return;
|
|
22
|
-
const [
|
|
22
|
+
const [r, o] = t.messagePart.value.input.uniqueIdentifier.split(
|
|
23
23
|
y
|
|
24
24
|
);
|
|
25
|
-
if (!(!
|
|
26
|
-
return z(
|
|
25
|
+
if (!(!r || !o))
|
|
26
|
+
return z(r, o);
|
|
27
27
|
}), e = n(() => {
|
|
28
28
|
if (a.value)
|
|
29
29
|
return c.workspace.documents[a.value];
|
|
@@ -33,10 +33,10 @@ const V = { class: "toggleButton" }, q = { class: "authContent" }, F = { class:
|
|
|
33
33
|
}), v = n(() => {
|
|
34
34
|
if (!e.value)
|
|
35
35
|
return;
|
|
36
|
-
const
|
|
36
|
+
const r = x(e.value.servers, {
|
|
37
37
|
documentUrl: e.value["x-scalar-original-source-url"]
|
|
38
38
|
});
|
|
39
|
-
return P(e.value
|
|
39
|
+
return P(r, e.value["x-scalar-selected-server"]);
|
|
40
40
|
}), g = n(
|
|
41
41
|
() => a.value && m.value && v.value
|
|
42
42
|
);
|
|
@@ -48,7 +48,7 @@ const V = { class: "toggleButton" }, q = { class: "authContent" }, F = { class:
|
|
|
48
48
|
state: "output-available"
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
return (
|
|
51
|
+
return (r, o) => (u(), k("div", {
|
|
52
52
|
class: C(["askForAuthentication", {
|
|
53
53
|
open: g.value
|
|
54
54
|
}])
|
|
@@ -56,15 +56,15 @@ const V = { class: "toggleButton" }, q = { class: "authContent" }, F = { class:
|
|
|
56
56
|
d("div", V, [
|
|
57
57
|
t.messagePart.value.state === "output-available" ? (u(), l(O, { key: 0 })) : s("", !0),
|
|
58
58
|
t.messagePart.value.state === "input-available" ? (u(), l(b, { key: 1 })) : s("", !0),
|
|
59
|
-
t.messagePart.value.state === "input-available" ? (u(), l(i(
|
|
59
|
+
t.messagePart.value.state === "input-available" ? (u(), l(i(T), {
|
|
60
60
|
key: 2,
|
|
61
61
|
class: "authorizeButton",
|
|
62
62
|
size: "xs",
|
|
63
63
|
onClick: A
|
|
64
64
|
}, {
|
|
65
65
|
default: E(() => [
|
|
66
|
-
|
|
67
|
-
N(i(
|
|
66
|
+
o[0] || (o[0] = I(" Authorize ", -1)),
|
|
67
|
+
N(i(_), { weight: "bold" })
|
|
68
68
|
]),
|
|
69
69
|
_: 1
|
|
70
70
|
})) : s("", !0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromptForm.vue.d.ts","sourceRoot":"","sources":["../../src/views/PromptForm.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PromptForm.vue.d.ts","sourceRoot":"","sources":["../../src/views/PromptForm.vue"],"names":[],"mappings":"AAmqBA,iBAAS,WAAW,SAEnB;AA4jBD,QAAA,MAAM,YAAY;;;;;;;;iFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./PromptForm.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e7c7c266"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { defineComponent as q, useTemplateRef as K, computed as d, watch as w, createElementBlock as r, openBlock as o, createBlock as u, createCommentVNode as a, createElementVNode as
|
|
2
|
-
import { ScalarIconButton as
|
|
3
|
-
import { ScalarIconPlus as I, ScalarIconX as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { defineComponent as q, useTemplateRef as K, computed as d, watch as w, createElementBlock as r, openBlock as o, createBlock as u, createCommentVNode as a, createElementVNode as n, unref as e, withModifiers as j, withDirectives as J, vModelText as O, Fragment as f, withCtx as h, createVNode as p, renderList as C, createTextVNode as T, toDisplayString as X } from "vue";
|
|
2
|
+
import { ScalarTooltip as Z, ScalarIconButton as P, ScalarLoading as G } from "@scalar/components";
|
|
3
|
+
import { ScalarIconPlus as I, ScalarIconX as Q, ScalarIconLockSimple as W, ScalarIconCheck as Y, ScalarIconArrowUp as ee } from "@scalar/icons";
|
|
4
|
+
import te from "../components/ActionsDropdown.vue.js";
|
|
5
|
+
import oe from "../components/ApprovalSection.vue.js";
|
|
6
|
+
import se from "../components/ErrorMessage.vue.js";
|
|
7
|
+
import le from "../components/FreeMessagesInfoSection.vue.js";
|
|
8
8
|
import ne from "../components/PaymentSection.vue.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { AgentErrorCodes as
|
|
12
|
-
import { MAX_PROMPT_SIZE as
|
|
13
|
-
import { useRequestApprovals as
|
|
14
|
-
import { useChatError as
|
|
15
|
-
import { useChatPendingClientToolParts as
|
|
16
|
-
import { useUploadTmpDocument as
|
|
17
|
-
import { useState as
|
|
18
|
-
const
|
|
9
|
+
import ae from "../components/SearchPopover.vue.js";
|
|
10
|
+
import re from "../components/UploadSection.vue.js";
|
|
11
|
+
import { AgentErrorCodes as D } from "../entities/error/constants.js";
|
|
12
|
+
import { MAX_PROMPT_SIZE as ie } from "../entities/prompt/constants.js";
|
|
13
|
+
import { useRequestApprovals as ue } from "../hooks/use-chat-approvals.js";
|
|
14
|
+
import { useChatError as ce } from "../hooks/use-chat-error.js";
|
|
15
|
+
import { useChatPendingClientToolParts as de } from "../hooks/use-chat-pending-client-tool-parts.js";
|
|
16
|
+
import { useUploadTmpDocument as pe } from "../hooks/use-upload-tmp-document.js";
|
|
17
|
+
import { useState as me } from "../state/state.js";
|
|
18
|
+
const ge = { class: "actionContainer" }, ve = ["disabled"], fe = { class: "inputActionsContainer" }, he = { class: "inputActionsLeft" }, ye = {
|
|
19
19
|
class: "addAPIButton",
|
|
20
20
|
type: "button"
|
|
21
|
-
},
|
|
21
|
+
}, Ae = {
|
|
22
22
|
class: "addAPIButton",
|
|
23
23
|
type: "button"
|
|
24
|
-
},
|
|
24
|
+
}, be = ["src"], ke = ["onClick"], _e = { class: "inputActionsRight" }, Se = { class: "sendCheckboxContinue" }, we = {
|
|
25
25
|
key: 0,
|
|
26
26
|
class: "relative flex items-center gap-1.5"
|
|
27
|
-
},
|
|
27
|
+
}, Ce = {
|
|
28
28
|
class: "termsAgree",
|
|
29
29
|
for: "agentTermsAgree"
|
|
30
|
-
},
|
|
30
|
+
}, Te = {
|
|
31
31
|
key: 5,
|
|
32
32
|
class: "addMoreContext"
|
|
33
|
-
}, Pe = { class: "ml-auto flex items-center gap-1" },
|
|
33
|
+
}, Pe = { class: "ml-auto flex items-center gap-1" }, Ie = ["onClick"], De = ["alt", "src"], Xe = /* @__PURE__ */ q({
|
|
34
34
|
__name: "PromptForm",
|
|
35
35
|
emits: ["submit", "uploadApi"],
|
|
36
|
-
setup(xe, { expose:
|
|
36
|
+
setup(xe, { expose: x, emit: L }) {
|
|
37
37
|
const E = L;
|
|
38
|
-
|
|
39
|
-
const c = K("agentPrompt"), t =
|
|
40
|
-
() => t.prompt.value.trim().length >
|
|
38
|
+
x({ focusPrompt: z });
|
|
39
|
+
const c = K("agentPrompt"), t = me(), M = d(() => t.prompt.value.trim().length > 0), R = d(
|
|
40
|
+
() => t.prompt.value.trim().length > ie
|
|
41
41
|
), B = d(
|
|
42
|
-
() => t.chat.messages.length > 1 && !t.getAgentKey?.() &&
|
|
42
|
+
() => t.chat.messages.length > 1 && !t.getAgentKey?.() && g?.value?.code !== D.LIMIT_REACHED
|
|
43
43
|
);
|
|
44
44
|
w(t.prompt, () => {
|
|
45
45
|
if (c?.value) {
|
|
@@ -51,7 +51,7 @@ const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "input
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
function U(i) {
|
|
54
|
-
t.loading.value || i.key === "Enter" && !i.shiftKey && (i.preventDefault(),
|
|
54
|
+
t.loading.value || i.key === "Enter" && !i.shiftKey && (i.preventDefault(), _(), window.scrollTo(0, document.body.scrollHeight));
|
|
55
55
|
}
|
|
56
56
|
function z() {
|
|
57
57
|
c.value?.focus();
|
|
@@ -62,76 +62,76 @@ const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "input
|
|
|
62
62
|
(i === "ready" || i === "error") && c.value?.focus();
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
|
-
const { approvalRequiredParts:
|
|
65
|
+
const { approvalRequiredParts: y, respondToRequestApprovals: A } = ue(), { pendingClientToolParts: $ } = de(), m = pe();
|
|
66
66
|
function V() {
|
|
67
|
-
t.terms.accept(), t.mode === "preview" && t.getActiveDocumentJson &&
|
|
67
|
+
t.terms.accept(), t.mode === "preview" && t.getActiveDocumentJson && m.uploadTempDocument(t.getActiveDocumentJson(), !0);
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const b = d(
|
|
70
70
|
() => Object.values(t.pendingDocuments).some(Boolean)
|
|
71
|
-
),
|
|
72
|
-
const i = R.value,
|
|
73
|
-
return i ||
|
|
71
|
+
), k = d(() => {
|
|
72
|
+
const i = R.value, l = !M.value, s = y.value.length > 0, v = $.value.length > 0, S = t.mode === "preview", F = S && !t.terms.accepted.value, H = S && !!m.uploadState.value, N = b.value;
|
|
73
|
+
return i || l || s || v || F || H || N;
|
|
74
74
|
});
|
|
75
|
-
function
|
|
76
|
-
|
|
75
|
+
function _() {
|
|
76
|
+
k.value || E("submit");
|
|
77
77
|
}
|
|
78
|
-
const
|
|
79
|
-
return (i,
|
|
80
|
-
e(
|
|
78
|
+
const g = ce();
|
|
79
|
+
return (i, l) => (o(), r("div", ge, [
|
|
80
|
+
e(m).uploadState.value || b.value ? (o(), u(re, {
|
|
81
81
|
key: 0,
|
|
82
|
-
uploadState: e(
|
|
82
|
+
uploadState: e(m).uploadState.value ?? { type: "loading" }
|
|
83
83
|
}, null, 8, ["uploadState"])) : a("", !0),
|
|
84
|
-
e(
|
|
84
|
+
e(g) ? (o(), u(se, {
|
|
85
85
|
key: 1,
|
|
86
|
-
error: e(
|
|
86
|
+
error: e(g)
|
|
87
87
|
}, null, 8, ["error"])) : a("", !0),
|
|
88
|
-
e(
|
|
88
|
+
e(y).length ? (o(), u(oe, {
|
|
89
89
|
key: 2,
|
|
90
|
-
onApprove:
|
|
91
|
-
onReject:
|
|
90
|
+
onApprove: l[0] || (l[0] = (s) => e(A)(!0)),
|
|
91
|
+
onReject: l[1] || (l[1] = (s) => e(A)(!1))
|
|
92
92
|
})) : a("", !0),
|
|
93
|
-
e(
|
|
94
|
-
B.value ? (o(), u(
|
|
95
|
-
|
|
93
|
+
e(g)?.code === e(D).LIMIT_REACHED ? (o(), u(ne, { key: 3 })) : a("", !0),
|
|
94
|
+
B.value ? (o(), u(le, { key: 4 })) : a("", !0),
|
|
95
|
+
n("form", {
|
|
96
96
|
class: "promptForm",
|
|
97
|
-
onSubmit: j(
|
|
97
|
+
onSubmit: j(_, ["prevent"])
|
|
98
98
|
}, [
|
|
99
|
-
|
|
99
|
+
l[6] || (l[6] = n("label", {
|
|
100
100
|
class: "agentLabel",
|
|
101
101
|
for: "agentTextarea"
|
|
102
102
|
}, " Type a Request To get Started ", -1)),
|
|
103
|
-
J(
|
|
103
|
+
J(n("textarea", {
|
|
104
104
|
id: "agentTextarea",
|
|
105
105
|
ref: "agentPrompt",
|
|
106
|
-
"onUpdate:modelValue":
|
|
106
|
+
"onUpdate:modelValue": l[2] || (l[2] = (s) => e(t).prompt.value = s),
|
|
107
107
|
class: "prompt custom-scroll",
|
|
108
108
|
disabled: e(t).loading.value,
|
|
109
109
|
name: "prompt",
|
|
110
|
-
placeholder: "Ask me anything
|
|
110
|
+
placeholder: "Ask me anything…",
|
|
111
111
|
onKeydown: U
|
|
112
|
-
}, null, 40,
|
|
112
|
+
}, null, 40, ve), [
|
|
113
113
|
[O, e(t).prompt.value]
|
|
114
114
|
]),
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
n("div", fe, [
|
|
116
|
+
n("div", he, [
|
|
117
117
|
e(t).hideAddApi ? a("", !0) : (o(), r(f, { key: 0 }, [
|
|
118
|
-
e(t).isLoggedIn?.value ? (o(), u(
|
|
118
|
+
e(t).isLoggedIn?.value ? (o(), u(te, {
|
|
119
119
|
key: 1,
|
|
120
|
-
onUploadApi:
|
|
120
|
+
onUploadApi: l[3] || (l[3] = (s) => i.$emit("uploadApi"))
|
|
121
121
|
}, {
|
|
122
|
-
default:
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
default: h(() => [
|
|
123
|
+
n("button", Ae, [
|
|
124
|
+
p(e(I), {
|
|
125
125
|
class: "size-4",
|
|
126
126
|
weight: "bold"
|
|
127
127
|
})
|
|
128
128
|
])
|
|
129
129
|
]),
|
|
130
130
|
_: 1
|
|
131
|
-
})) : (o(), u(
|
|
132
|
-
default:
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
})) : (o(), u(ae, { key: 0 }, {
|
|
132
|
+
default: h(() => [
|
|
133
|
+
n("button", ye, [
|
|
134
|
+
p(e(I), {
|
|
135
135
|
class: "size-4",
|
|
136
136
|
weight: "bold"
|
|
137
137
|
})
|
|
@@ -148,48 +148,55 @@ const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "input
|
|
|
148
148
|
key: 0,
|
|
149
149
|
class: "apiPillLogo",
|
|
150
150
|
src: s.logoUrl
|
|
151
|
-
}, null, 8,
|
|
152
|
-
|
|
151
|
+
}, null, 8, be)) : a("", !0),
|
|
152
|
+
T(" " + X(s.title) + " ", 1),
|
|
153
153
|
s.removable ? (o(), r("button", {
|
|
154
154
|
key: 1,
|
|
155
155
|
class: "apiPillRemove",
|
|
156
156
|
type: "button",
|
|
157
157
|
onClick: (v) => e(t).removeDocument(s)
|
|
158
158
|
}, [
|
|
159
|
-
|
|
159
|
+
p(e(Q), {
|
|
160
160
|
class: "size-4",
|
|
161
161
|
weight: "bold"
|
|
162
162
|
})
|
|
163
|
-
], 8,
|
|
163
|
+
], 8, ke)) : a("", !0)
|
|
164
164
|
]))), 128))
|
|
165
165
|
]),
|
|
166
|
-
|
|
167
|
-
e(t).loading.value ? a("", !0) : (o(), u(e(
|
|
166
|
+
n("div", _e, [
|
|
167
|
+
e(t).loading.value ? a("", !0) : (o(), u(e(Z), {
|
|
168
168
|
key: 0,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
169
|
+
content: "Settings"
|
|
170
|
+
}, {
|
|
171
|
+
default: h(() => [
|
|
172
|
+
p(e(P), {
|
|
173
|
+
class: "settingsButton h-7 w-7 p-1.5",
|
|
174
|
+
icon: e(W),
|
|
175
|
+
label: "Scalar",
|
|
176
|
+
size: "md",
|
|
177
|
+
weight: "bold",
|
|
178
|
+
onClick: l[4] || (l[4] = (s) => e(t).settingsModal.show())
|
|
179
|
+
}, null, 8, ["icon"])
|
|
180
|
+
]),
|
|
181
|
+
_: 1
|
|
182
|
+
})),
|
|
183
|
+
n("div", Se, [
|
|
177
184
|
!e(t).terms.accepted.value && e(t).mode === "preview" ? (o(), r("div", we, [
|
|
178
|
-
|
|
185
|
+
n("input", {
|
|
179
186
|
id: "agentTermsAgree",
|
|
180
187
|
class: "sr-only",
|
|
181
188
|
type: "checkbox",
|
|
182
189
|
onChange: V
|
|
183
190
|
}, null, 32),
|
|
184
|
-
|
|
185
|
-
|
|
191
|
+
n("label", Ce, [
|
|
192
|
+
p(e(Y), {
|
|
186
193
|
class: "termsAgreeIcon",
|
|
187
194
|
weight: "bold"
|
|
188
195
|
}),
|
|
189
|
-
|
|
196
|
+
l[5] || (l[5] = T(" Agree to Terms & Conditions ", -1))
|
|
190
197
|
])
|
|
191
198
|
])) : a("", !0),
|
|
192
|
-
e(t).loading.value ? (o(), u(e(
|
|
199
|
+
e(t).loading.value ? (o(), u(e(G), {
|
|
193
200
|
key: 2,
|
|
194
201
|
class: "loader h-7 w-7",
|
|
195
202
|
loader: {
|
|
@@ -207,11 +214,11 @@ const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "input
|
|
|
207
214
|
}
|
|
208
215
|
},
|
|
209
216
|
size: "2xl"
|
|
210
|
-
}, null, 8, ["loader"])) : (o(), u(e(
|
|
217
|
+
}, null, 8, ["loader"])) : (o(), u(e(P), {
|
|
211
218
|
key: 1,
|
|
212
219
|
class: "sendButton h-7 w-7 p-1.5",
|
|
213
|
-
disabled:
|
|
214
|
-
icon: e(
|
|
220
|
+
disabled: k.value,
|
|
221
|
+
icon: e(ee),
|
|
215
222
|
label: "Scalar",
|
|
216
223
|
size: "md",
|
|
217
224
|
type: "submit",
|
|
@@ -221,9 +228,9 @@ const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "input
|
|
|
221
228
|
])
|
|
222
229
|
])
|
|
223
230
|
], 32),
|
|
224
|
-
e(t).chat.messages.length <= 1 && !e(t).hideAddApi ? (o(), r("div",
|
|
225
|
-
|
|
226
|
-
|
|
231
|
+
e(t).chat.messages.length <= 1 && !e(t).hideAddApi ? (o(), r("div", Te, [
|
|
232
|
+
l[7] || (l[7] = n("span", null, "Load additional APIs", -1)),
|
|
233
|
+
n("div", Pe, [
|
|
227
234
|
(o(!0), r(f, null, C(e(t).curatedDocuments.value, (s) => (o(), r("button", {
|
|
228
235
|
key: s.id,
|
|
229
236
|
class: "addAPIContext",
|
|
@@ -235,13 +242,13 @@ const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "input
|
|
|
235
242
|
alt: s.title,
|
|
236
243
|
class: "size-4",
|
|
237
244
|
src: s.logoUrl
|
|
238
|
-
}, null, 8,
|
|
239
|
-
], 8,
|
|
245
|
+
}, null, 8, De)) : a("", !0)
|
|
246
|
+
], 8, Ie))), 128))
|
|
240
247
|
])
|
|
241
248
|
])) : a("", !0)
|
|
242
249
|
]));
|
|
243
250
|
}
|
|
244
251
|
});
|
|
245
252
|
export {
|
|
246
|
-
|
|
253
|
+
Xe as default
|
|
247
254
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DocSettings.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-31f052ad"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -2,35 +2,35 @@ import { defineComponent as a, computed as n, createElementBlock as d, openBlock
|
|
|
2
2
|
import { getSelectedServer as f } from "@scalar/api-client/v2/features/operation";
|
|
3
3
|
import { getActiveEnvironment as h, getServers as g } from "@scalar/api-client/v2/helpers";
|
|
4
4
|
import B from "../../components/ServerSelector.vue.js";
|
|
5
|
-
import { useState as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
5
|
+
import { useState as x } from "../../state/state.js";
|
|
6
|
+
import y from "./Auth.vue.js";
|
|
7
|
+
const k = { class: "docSettings" }, C = /* @__PURE__ */ a({
|
|
8
8
|
__name: "DocSettings",
|
|
9
9
|
props: {
|
|
10
10
|
document: {},
|
|
11
11
|
name: {}
|
|
12
12
|
},
|
|
13
13
|
setup(e) {
|
|
14
|
-
const { workspaceStore: r, config: i, eventBus: c } =
|
|
14
|
+
const { workspaceStore: r, config: i, eventBus: c } = x(), l = n(
|
|
15
15
|
() => h(r, e.document)
|
|
16
16
|
), o = n(() => {
|
|
17
17
|
const s = g(e.document.servers, {
|
|
18
18
|
documentUrl: e.document["x-scalar-original-source-url"]
|
|
19
19
|
});
|
|
20
|
-
return f(e.document
|
|
21
|
-
}),
|
|
20
|
+
return f(s, e.document["x-scalar-selected-server"]);
|
|
21
|
+
}), v = n(
|
|
22
22
|
() => e.document.components?.securitySchemes ?? {}
|
|
23
23
|
);
|
|
24
|
-
return (s,
|
|
24
|
+
return (s, p) => (S(), d("div", k, [
|
|
25
25
|
m("div", null, [
|
|
26
|
-
u(
|
|
26
|
+
u(y, {
|
|
27
27
|
authStore: t(r).auth,
|
|
28
28
|
document: e.document,
|
|
29
|
-
environment:
|
|
29
|
+
environment: l.value,
|
|
30
30
|
eventBus: t(c),
|
|
31
31
|
name: e.name,
|
|
32
32
|
options: t(i),
|
|
33
|
-
securitySchemes:
|
|
33
|
+
securitySchemes: v.value,
|
|
34
34
|
selectedServer: o.value
|
|
35
35
|
}, null, 8, ["authStore", "document", "environment", "eventBus", "name", "options", "securitySchemes", "selectedServer"])
|
|
36
36
|
]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/Settings.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/Settings.vue"],"names":[],"mappings":"AAkKA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAO3B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAC;AA8LF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -2,7 +2,7 @@ import t from "./Settings.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-5e4bca68"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
e as default
|
|
8
8
|
};
|
|
@@ -1,63 +1,73 @@
|
|
|
1
|
-
import { defineComponent as k, createBlock as
|
|
2
|
-
import { ScalarModal as
|
|
3
|
-
import { ScalarIconCaretDown as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as k, createBlock as c, openBlock as r, unref as e, withCtx as S, createElementVNode as o, createVNode as d, createElementBlock as a, Fragment as _, renderList as h, createCommentVNode as y, normalizeClass as C, createTextVNode as m, toDisplayString as v, isRef as R } from "vue";
|
|
2
|
+
import { ScalarModal as x, ScalarColorModeToggle as U, ScalarTextInput as w } from "@scalar/components";
|
|
3
|
+
import { ScalarIconCaretDown as D, ScalarIconCaretRight as b } from "@scalar/icons";
|
|
4
|
+
import { URLS as p } from "../../consts/urls.js";
|
|
5
|
+
import { useState as O } from "../../state/state.js";
|
|
6
|
+
import L from "./DocSettings.vue.js";
|
|
7
|
+
const V = { class: "settingsHeading" }, N = { class: "documentList" }, P = ["onClick"], T = { key: 0 }, A = {
|
|
7
8
|
key: 1,
|
|
8
9
|
class: "noDocuments"
|
|
9
|
-
},
|
|
10
|
+
}, E = { class: "proxyUrlContainer" }, I = ["href"], z = /* @__PURE__ */ k({
|
|
10
11
|
__name: "Settings",
|
|
11
12
|
props: {
|
|
12
13
|
modalState: {}
|
|
13
14
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const { workspaceStore:
|
|
16
|
-
function
|
|
17
|
-
|
|
15
|
+
setup(f) {
|
|
16
|
+
const { workspaceStore: s, proxyUrlRaw: i } = O();
|
|
17
|
+
function g(u) {
|
|
18
|
+
s.update("x-scalar-active-document", u);
|
|
18
19
|
}
|
|
19
|
-
return (
|
|
20
|
+
return (u, t) => (r(), c(e(x), {
|
|
20
21
|
class: "settingsModal",
|
|
21
|
-
state:
|
|
22
|
+
state: f.modalState
|
|
22
23
|
}, {
|
|
23
|
-
default:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
d(e(
|
|
24
|
+
default: S(() => [
|
|
25
|
+
o("div", V, [
|
|
26
|
+
t[1] || (t[1] = o("h1", null, "Settings", -1)),
|
|
27
|
+
d(e(U), { class: "colorToggle ml-auto" })
|
|
27
28
|
]),
|
|
28
|
-
|
|
29
|
-
Object.entries(e(
|
|
30
|
-
e(
|
|
31
|
-
), ([
|
|
32
|
-
key:
|
|
29
|
+
o("div", N, [
|
|
30
|
+
Object.entries(e(s).workspace.documents).length ? (r(!0), a(_, { key: 0 }, h(Object.entries(
|
|
31
|
+
e(s).workspace.documents
|
|
32
|
+
), ([l, n]) => (r(), a("div", {
|
|
33
|
+
key: l,
|
|
33
34
|
class: "document"
|
|
34
35
|
}, [
|
|
35
|
-
|
|
36
|
-
class:
|
|
37
|
-
documentNameActive: e(
|
|
36
|
+
o("button", {
|
|
37
|
+
class: C(["documentName", {
|
|
38
|
+
documentNameActive: e(s).workspace.activeDocument === n
|
|
38
39
|
}]),
|
|
39
40
|
type: "button",
|
|
40
|
-
onClick: (
|
|
41
|
+
onClick: (B) => g(l)
|
|
41
42
|
}, [
|
|
42
|
-
|
|
43
|
-
e(
|
|
44
|
-
], 10,
|
|
45
|
-
e(
|
|
46
|
-
d(
|
|
47
|
-
document:
|
|
48
|
-
name:
|
|
43
|
+
m(" @" + v(l) + " ", 1),
|
|
44
|
+
e(s).workspace.activeDocument === n ? (r(), c(e(D), { key: 0 })) : (r(), c(e(b), { key: 1 }))
|
|
45
|
+
], 10, P),
|
|
46
|
+
e(s).workspace.activeDocument === n ? (r(), a("div", T, [
|
|
47
|
+
d(L, {
|
|
48
|
+
document: n,
|
|
49
|
+
name: l
|
|
49
50
|
}, null, 8, ["document", "name"])
|
|
50
|
-
])) :
|
|
51
|
-
]))), 128)) : (
|
|
51
|
+
])) : y("", !0)
|
|
52
|
+
]))), 128)) : (r(), a("div", A, " There's no API definition loaded. Use the + button to load APIs. "))
|
|
52
53
|
]),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
o("div", E, [
|
|
55
|
+
t[3] || (t[3] = o("label", { for: "proxyUrl" }, "CORS Proxy", -1)),
|
|
56
|
+
o("p", null, [
|
|
57
|
+
t[2] || (t[2] = m(" All requests will be sent through the specified proxy URL to help avoid CORS (Cross-Origin Resource Sharing) issues. ", -1)),
|
|
58
|
+
o("a", {
|
|
59
|
+
class: "underline",
|
|
60
|
+
href: e(p).PROXY_SOURCE_CODE,
|
|
61
|
+
target: "_blank"
|
|
62
|
+
}, " Read more ", 8, I)
|
|
63
|
+
]),
|
|
64
|
+
d(e(w), {
|
|
56
65
|
id: "proxyUrl",
|
|
57
|
-
modelValue: e(
|
|
58
|
-
"onUpdate:modelValue":
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
modelValue: e(i),
|
|
67
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => R(i) ? i.value = l : null),
|
|
68
|
+
label: "Proxy URL",
|
|
69
|
+
placeholder: e(p).DEFAULT_PROXY_URL
|
|
70
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
61
71
|
])
|
|
62
72
|
]),
|
|
63
73
|
_: 1
|
|
@@ -65,5 +75,5 @@ const I = { class: "settingsHeading" }, T = { class: "documentList" }, B = ["onC
|
|
|
65
75
|
}
|
|
66
76
|
});
|
|
67
77
|
export {
|
|
68
|
-
|
|
78
|
+
z as default
|
|
69
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Start.vue.d.ts","sourceRoot":"","sources":["../../src/views/Start.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Start.vue.d.ts","sourceRoot":"","sources":["../../src/views/Start.vue"],"names":[],"mappings":"AAqMA,QAAA,MAAM,YAAY;;;;;;iFAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/views/Start.vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./Start.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-56f7e8dd"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|