@scalar/api-client 2.17.4 → 2.17.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +3 -3
- package/dist/components/DataTable/DataTableInput.vue2.js +40 -33
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +9 -9
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +3 -3
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js +2 -2
- package/dist/v2/components/data-table/DataTableInput.vue2.js +42 -35
- package/dist/v2/features/modal/Modal.vue.d.ts +5 -5
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +2 -2
- package/dist/v2/features/modal/Modal.vue2.js +41 -41
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +5 -5
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +3 -3
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +15 -15
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { getResolvedRef as
|
|
1
|
+
import { getResolvedRef as f } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
2
|
import { getResolvedRefDeep as s } from "../../operation-code-sample/helpers/get-resolved-ref-deep.js";
|
|
3
|
-
const
|
|
3
|
+
const r = (n, c, m) => {
|
|
4
4
|
if ("content" in n) {
|
|
5
|
-
const t = n.content?.[
|
|
6
|
-
return typeof
|
|
5
|
+
const t = n.content?.[m ?? Object.keys(n.content)[0] ?? ""], o = t?.examples ?? {}, i = c ?? Object.keys(o)[0] ?? "", l = s(o[i]);
|
|
6
|
+
return typeof l < "u" ? l : !c && t?.example ? { value: s(t.example) } : void 0;
|
|
7
7
|
}
|
|
8
8
|
if ("examples" in n || "example" in n) {
|
|
9
|
-
const t =
|
|
10
|
-
if (typeof
|
|
11
|
-
return
|
|
12
|
-
if (
|
|
9
|
+
const t = f(n.examples) ?? {}, o = c ?? Object.keys(t)[0] ?? "", i = s(t?.[o]);
|
|
10
|
+
if (typeof i < "u")
|
|
11
|
+
return i;
|
|
12
|
+
if (!c && n.example)
|
|
13
13
|
return { value: s(n.example) };
|
|
14
14
|
}
|
|
15
15
|
const e = s(n);
|
|
@@ -23,5 +23,5 @@ const d = (n, o, u) => {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
r as getExample
|
|
27
27
|
};
|
|
@@ -16,7 +16,7 @@ const p = (i) => {
|
|
|
16
16
|
} else
|
|
17
17
|
n.push({ name: a, value: String(e) });
|
|
18
18
|
return n;
|
|
19
|
-
},
|
|
19
|
+
}, g = ({ requestBody: i, contentType: n, example: a }) => {
|
|
20
20
|
const e = n || Object.keys(i.content)[0] || "", r = e === "multipart/form-data" || e === "application/x-www-form-urlencoded", m = e === "application/xml", t = u(i, a, n)?.value;
|
|
21
21
|
if (typeof t < "u")
|
|
22
22
|
return r && typeof t == "object" && t !== null ? {
|
|
@@ -44,10 +44,10 @@ const p = (i) => {
|
|
|
44
44
|
text: s(o)
|
|
45
45
|
} : {
|
|
46
46
|
mimeType: e,
|
|
47
|
-
text: JSON.stringify(o)
|
|
47
|
+
text: typeof o == "string" ? o : JSON.stringify(o)
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
export {
|
|
52
|
-
|
|
52
|
+
g as processBody
|
|
53
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"names":[],"mappings":"AAuMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM/C,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,sEAAsE;IACtE,cAAc,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,0EAA0E;IAC1E,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,kBAAkB,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC;AAoUJ,QAAA,IAAI,OAAO,IAAU,EAAuB,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACvF,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAoC7C,QAAA,MAAM,eAAe;;;;;;;;;;;cAvXN,OAAO;cAIP,OAAO;kBAMH,OAAO;2BAPE,OAAO;6EA4XjC,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./DataTableInput.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-d6948ce7"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIconButton as
|
|
3
|
-
import { ScalarIconEye as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as b, ref as p, computed as B, createBlock as d, openBlock as n, normalizeClass as $, withCtx as I, createElementBlock as u, createCommentVNode as i, createElementVNode as O, renderSlot as m, createTextVNode as S, Fragment as E, mergeProps as c, unref as r } from "vue";
|
|
2
|
+
import { ScalarIconButton as v } from "@scalar/components";
|
|
3
|
+
import { ScalarIconX as h, ScalarIconEye as A, ScalarIconEyeSlash as W } from "@scalar/icons";
|
|
4
|
+
import q from "./DataTableCell.vue.js";
|
|
5
|
+
import F from "./DataTableInputSelect.vue.js";
|
|
6
|
+
import T from "../code-input/CodeInput.vue.js";
|
|
7
|
+
const N = ["for"], P = { class: "relative flex min-w-0 flex-1" }, D = ["readOnly", "type", "value"], U = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "centered-y text-orange absolute right-7 text-xs"
|
|
10
|
-
}, J = /* @__PURE__ */
|
|
10
|
+
}, J = /* @__PURE__ */ b({
|
|
11
11
|
inheritAttrs: !1,
|
|
12
12
|
__name: "DataTableInput",
|
|
13
13
|
props: {
|
|
@@ -26,34 +26,34 @@ const T = ["for"], N = { class: "relative flex min-w-0 flex-1" }, P = ["readOnly
|
|
|
26
26
|
lineWrapping: { type: Boolean, default: !1 }
|
|
27
27
|
},
|
|
28
28
|
emits: ["update:modelValue", "inputFocus", "inputBlur", "selectVariable"],
|
|
29
|
-
setup(
|
|
30
|
-
const a =
|
|
29
|
+
setup(V, { emit: w }) {
|
|
30
|
+
const a = V, t = w, s = p(!0), k = p(!1), f = p(null), g = () => !k.value && t("inputBlur"), y = B(
|
|
31
31
|
() => a.type === "password" ? "text" : a.type ?? "text"
|
|
32
|
-
),
|
|
32
|
+
), C = () => {
|
|
33
33
|
!a.enum?.length && !a.readOnly && f.value?.focus();
|
|
34
34
|
};
|
|
35
|
-
return (e, l) => (n(),
|
|
36
|
-
class:
|
|
35
|
+
return (e, l) => (n(), d(q, {
|
|
36
|
+
class: $(["relative flex", e.containerClass])
|
|
37
37
|
}, {
|
|
38
|
-
default:
|
|
39
|
-
e.$slots.default ? (n(),
|
|
38
|
+
default: I(() => [
|
|
39
|
+
e.$slots.default ? (n(), u("div", {
|
|
40
40
|
key: 0,
|
|
41
41
|
class: "text-c-1 flex items-center pr-0 pl-3",
|
|
42
42
|
for: e.id ?? "",
|
|
43
|
-
onClick:
|
|
43
|
+
onClick: C
|
|
44
44
|
}, [
|
|
45
45
|
m(e.$slots, "default", {}, void 0, !0),
|
|
46
|
-
l[
|
|
47
|
-
], 8,
|
|
48
|
-
|
|
49
|
-
a.enum && a.enum.length ? (n(),
|
|
46
|
+
l[6] || (l[6] = S(": ", -1))
|
|
47
|
+
], 8, N)) : i("", !0),
|
|
48
|
+
O("div", P, [
|
|
49
|
+
a.enum && a.enum.length ? (n(), d(F, {
|
|
50
50
|
key: 0,
|
|
51
51
|
canAddCustomValue: a.canAddCustomEnumValue,
|
|
52
52
|
modelValue: a.modelValue,
|
|
53
53
|
value: a.enum,
|
|
54
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
55
|
-
}, null, 8, ["canAddCustomValue", "modelValue", "value"])) : (n(),
|
|
56
|
-
s.value && e.type === "password" ? (n(),
|
|
54
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => t("update:modelValue", o))
|
|
55
|
+
}, null, 8, ["canAddCustomValue", "modelValue", "value"])) : (n(), u(E, { key: 1 }, [
|
|
56
|
+
s.value && e.type === "password" ? (n(), u("input", c({ key: 0 }, e.id ? { ...e.$attrs, id: e.id } : e.$attrs, {
|
|
57
57
|
autocomplete: "off",
|
|
58
58
|
class: ["text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none px-2 py-1.25 -outline-offset-1", { "scalar-password-input": e.type === "password" }],
|
|
59
59
|
"data-1p-ignore": "",
|
|
@@ -61,11 +61,11 @@ const T = ["for"], N = { class: "relative flex min-w-0 flex-1" }, P = ["readOnly
|
|
|
61
61
|
spellcheck: "false",
|
|
62
62
|
type: y.value,
|
|
63
63
|
value: e.modelValue,
|
|
64
|
-
onInput: l[1] || (l[1] = (
|
|
64
|
+
onInput: l[1] || (l[1] = (o) => t(
|
|
65
65
|
"update:modelValue",
|
|
66
|
-
|
|
66
|
+
o.target.value ?? ""
|
|
67
67
|
))
|
|
68
|
-
}), null, 16,
|
|
68
|
+
}), null, 16, D)) : (n(), d(r(T), c({ key: 1 }, e.$attrs, {
|
|
69
69
|
id: e.id,
|
|
70
70
|
ref_key: "codeInput",
|
|
71
71
|
ref: f,
|
|
@@ -86,24 +86,31 @@ const T = ["for"], N = { class: "relative flex min-w-0 flex-1" }, P = ["readOnly
|
|
|
86
86
|
required: !!e.required,
|
|
87
87
|
spellcheck: "false",
|
|
88
88
|
type: y.value,
|
|
89
|
-
onBlur:
|
|
90
|
-
onFocus: l[2] || (l[2] = (
|
|
91
|
-
"onUpdate:modelValue": l[3] || (l[3] = (
|
|
89
|
+
onBlur: g,
|
|
90
|
+
onFocus: l[2] || (l[2] = (o) => t("inputFocus")),
|
|
91
|
+
"onUpdate:modelValue": l[3] || (l[3] = (o) => t("update:modelValue", o))
|
|
92
92
|
}), null, 16, ["id", "class", "description", "environment", "lineWrapping", "max", "min", "modelValue", "readOnly", "required", "type"]))
|
|
93
93
|
], 64))
|
|
94
94
|
]),
|
|
95
|
-
e.$slots.warning ? (n(),
|
|
95
|
+
e.$slots.warning ? (n(), u("div", U, [
|
|
96
96
|
m(e.$slots, "warning", {}, void 0, !0)
|
|
97
|
-
])) :
|
|
97
|
+
])) : i("", !0),
|
|
98
98
|
m(e.$slots, "icon", {}, void 0, !0),
|
|
99
|
-
e.
|
|
99
|
+
e.modelValue ? (n(), d(r(v), {
|
|
100
100
|
key: 2,
|
|
101
|
+
class: "-ml-.25 h-6 w-6 self-center p-1.25",
|
|
102
|
+
icon: r(h),
|
|
103
|
+
label: "Clear Value",
|
|
104
|
+
onClick: l[4] || (l[4] = (o) => t("update:modelValue", ""))
|
|
105
|
+
}, null, 8, ["icon"])) : i("", !0),
|
|
106
|
+
e.type === "password" ? (n(), d(r(v), {
|
|
107
|
+
key: 3,
|
|
101
108
|
class: "-ml-.5 mr-1.25 h-6 w-6 self-center p-1.25",
|
|
102
109
|
"data-testid": "data-table-password-toggle",
|
|
103
|
-
icon: s.value ?
|
|
110
|
+
icon: s.value ? r(A) : r(W),
|
|
104
111
|
label: s.value ? "Show Password" : "Hide Password",
|
|
105
|
-
onClick: l[
|
|
106
|
-
}, null, 8, ["icon", "label"])) :
|
|
112
|
+
onClick: l[5] || (l[5] = (o) => s.value = !s.value)
|
|
113
|
+
}, null, 8, ["icon", "label"])) : i("", !0)
|
|
107
114
|
]),
|
|
108
115
|
_: 3
|
|
109
116
|
}, 8, ["class"]));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type ModalState } from '@scalar/components';
|
|
2
2
|
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference';
|
|
4
4
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
5
5
|
import { type WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
6
6
|
import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
|
|
7
|
-
import { type ComputedRef } from 'vue';
|
|
7
|
+
import { type ComputedRef, type MaybeRefOrGetter } from 'vue';
|
|
8
8
|
import { type UseModalSidebarReturn } from '../../../v2/features/modal/hooks/use-modal-sidebar.js';
|
|
9
9
|
import type { ClientPlugin } from '../../../v2/helpers/plugins.js';
|
|
10
10
|
export type ModalProps = {
|
|
@@ -25,9 +25,9 @@ export type ModalProps = {
|
|
|
25
25
|
/** The sidebar state must be initialized and passed in */
|
|
26
26
|
sidebarState: UseModalSidebarReturn;
|
|
27
27
|
/** Api client plugins to include in the modal */
|
|
28
|
-
plugins
|
|
29
|
-
/**
|
|
30
|
-
|
|
28
|
+
plugins: ClientPlugin[];
|
|
29
|
+
/** Subset of the configuration options for the modal */
|
|
30
|
+
options: MaybeRefOrGetter<Pick<ApiReferenceConfigurationRaw, 'authentication'>>;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
33
|
* Scalar Api Client Modal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"AAyYA,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;AAKZ,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAGxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAQxD,MAAM,MAAM,UAAU,GAAG;IACvB,4DAA4D;IAC5D,cAAc,EAAE,cAAc,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACrC,4CAA4C;IAC5C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,mDAAmD;IACnD,MAAM,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC3C,yDAAyD;IACzD,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAA;IACtB,0DAA0D;IAC1D,YAAY,EAAE,qBAAqB,CAAA;IACnC,iDAAiD;IACjD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,CACvB,IAAI,CAAC,4BAA4B,EAAE,gBAAgB,CAAC,CACrD,CAAA;CACF,CAAA;AAED;;;;GAIG;;;;;AACH,wBAuWC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Modal.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f2ee8eaf"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as I, ref as h, useId as N, watch as D, nextTick as E, onBeforeMount as F, onBeforeUnmount as U, computed as
|
|
2
|
-
import { addScalarClassesToHeadless as A, ScalarTeleportRoot as
|
|
3
|
-
import { ScalarToasts as
|
|
4
|
-
import { useFocusTrap as
|
|
5
|
-
import { mergeAuthConfig as
|
|
6
|
-
import
|
|
7
|
-
import { getActiveEnvironment as
|
|
8
|
-
import { useColorMode as
|
|
9
|
-
import { useGlobalHotKeys as
|
|
10
|
-
import { useScrollLock as
|
|
11
|
-
import { useWorkspaceClientModalEvents as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
const
|
|
1
|
+
import { defineComponent as I, ref as h, useId as N, watch as D, nextTick as E, onBeforeMount as F, onBeforeUnmount as U, computed as d, toValue as V, withDirectives as w, createElementBlock as u, openBlock as c, createElementVNode as i, unref as o, createVNode as l, withCtx as x, vShow as k } from "vue";
|
|
2
|
+
import { addScalarClassesToHeadless as A, ScalarTeleportRoot as $ } from "@scalar/components";
|
|
3
|
+
import { ScalarToasts as M } from "@scalar/use-toasts";
|
|
4
|
+
import { useFocusTrap as H } from "@vueuse/integrations/useFocusTrap";
|
|
5
|
+
import { mergeAuthConfig as L } from "../../blocks/scalar-auth-selector-block/helpers/merge-auth-config.js";
|
|
6
|
+
import z from "../operation/Operation.vue.js";
|
|
7
|
+
import { getActiveEnvironment as O } from "../../helpers/get-active-environment.js";
|
|
8
|
+
import { useColorMode as R } from "../../hooks/use-color-mode.js";
|
|
9
|
+
import { useGlobalHotKeys as j } from "../../hooks/use-global-hot-keys.js";
|
|
10
|
+
import { useScrollLock as q } from "../../hooks/use-scroll-lock.js";
|
|
11
|
+
import { useWorkspaceClientModalEvents as G } from "./hooks/use-workspace-client-modal-events.js";
|
|
12
|
+
import K from "../../components/sidebar/SidebarToggle.vue.js";
|
|
13
|
+
import P from "../../components/sidebar/Sidebar.vue.js";
|
|
14
|
+
const J = { class: "scalar scalar-app" }, Q = { class: "scalar-container" }, X = ["id"], Y = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "relative flex flex-1"
|
|
17
|
-
},
|
|
17
|
+
}, Z = {
|
|
18
18
|
key: 1,
|
|
19
19
|
class: "flex h-full w-full items-center justify-center"
|
|
20
|
-
},
|
|
21
|
-
...
|
|
20
|
+
}, _ = {}, fe = /* @__PURE__ */ I({
|
|
21
|
+
..._,
|
|
22
22
|
__name: "Modal",
|
|
23
23
|
props: {
|
|
24
24
|
workspaceStore: {},
|
|
@@ -29,50 +29,50 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
|
|
|
29
29
|
exampleName: {},
|
|
30
30
|
modalState: {},
|
|
31
31
|
sidebarState: {},
|
|
32
|
-
plugins: {
|
|
33
|
-
|
|
32
|
+
plugins: {},
|
|
33
|
+
options: {}
|
|
34
34
|
},
|
|
35
35
|
setup(t, { expose: b }) {
|
|
36
|
-
typeof window < "u" && (window.dataDumpWorkspace = () => t.workspaceStore),
|
|
36
|
+
typeof window < "u" && (window.dataDumpWorkspace = () => t.workspaceStore), R({ workspaceStore: t.workspaceStore });
|
|
37
37
|
const m = {
|
|
38
38
|
name: "default",
|
|
39
39
|
id: "default"
|
|
40
40
|
}, s = h(!1);
|
|
41
|
-
|
|
41
|
+
G({
|
|
42
42
|
eventBus: t.eventBus,
|
|
43
43
|
document: t.document,
|
|
44
44
|
workspaceStore: t.workspaceStore,
|
|
45
45
|
isSidebarOpen: s,
|
|
46
46
|
sidebarState: t.sidebarState,
|
|
47
47
|
modalState: t.modalState
|
|
48
|
-
}),
|
|
49
|
-
const f = h(null), v = N(), { activate: y, deactivate: B } =
|
|
48
|
+
}), j(t.eventBus, "modal");
|
|
49
|
+
const f = h(null), v = N(), { activate: y, deactivate: B } = H(f, {
|
|
50
50
|
allowOutsideClick: !0,
|
|
51
51
|
fallbackFocus: `#${v}`
|
|
52
52
|
}), p = () => {
|
|
53
53
|
B(), t.eventBus.emit("operation:cancel:request");
|
|
54
|
-
}, g =
|
|
54
|
+
}, g = q(() => typeof window < "u" ? window.document.body : null);
|
|
55
55
|
D(
|
|
56
56
|
() => t.modalState.open,
|
|
57
57
|
(e) => {
|
|
58
58
|
g.value = e, e ? y({ checkCanFocusTrap: () => E() }) : p();
|
|
59
59
|
}
|
|
60
60
|
), F(() => A()), U(() => p());
|
|
61
|
-
const C = 288, r =
|
|
61
|
+
const C = 288, r = d(
|
|
62
62
|
() => t.workspaceStore?.workspace?.["x-scalar-sidebar-width"] ?? C
|
|
63
|
-
), T = (e) => t.workspaceStore?.update("x-scalar-sidebar-width", e), S =
|
|
64
|
-
() =>
|
|
65
|
-
), W =
|
|
66
|
-
() =>
|
|
63
|
+
), T = (e) => t.workspaceStore?.update("x-scalar-sidebar-width", e), S = d(
|
|
64
|
+
() => O(t.workspaceStore, t.document.value)
|
|
65
|
+
), W = d(
|
|
66
|
+
() => L(
|
|
67
67
|
t.document.value?.components?.securitySchemes,
|
|
68
|
-
t.
|
|
68
|
+
V(t.options)?.authentication?.securitySchemes
|
|
69
69
|
)
|
|
70
70
|
);
|
|
71
71
|
return b({
|
|
72
72
|
sidebarWidth: r,
|
|
73
73
|
environment: S
|
|
74
|
-
}), (e, a) => w((c(),
|
|
75
|
-
i("div",
|
|
74
|
+
}), (e, a) => w((c(), u("div", J, [
|
|
75
|
+
i("div", Q, [
|
|
76
76
|
i("div", {
|
|
77
77
|
id: o(v),
|
|
78
78
|
ref_key: "client",
|
|
@@ -83,16 +83,16 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
|
|
|
83
83
|
role: "dialog",
|
|
84
84
|
tabindex: "-1"
|
|
85
85
|
}, [
|
|
86
|
-
l(o(
|
|
86
|
+
l(o($), null, {
|
|
87
87
|
default: x(() => [
|
|
88
|
-
l(o(
|
|
89
|
-
e.document.value && e.path?.value && e.method?.value ? (c(),
|
|
90
|
-
l(o(
|
|
88
|
+
l(o(M)),
|
|
89
|
+
e.document.value && e.path?.value && e.method?.value ? (c(), u("main", Y, [
|
|
90
|
+
l(o(K), {
|
|
91
91
|
modelValue: s.value,
|
|
92
92
|
"onUpdate:modelValue": a[0] || (a[0] = (n) => s.value = n),
|
|
93
93
|
class: "absolute top-2 left-3 z-[10001]"
|
|
94
94
|
}, null, 8, ["modelValue"]),
|
|
95
|
-
w(l(o(
|
|
95
|
+
w(l(o(P), {
|
|
96
96
|
sidebarWidth: r.value,
|
|
97
97
|
"onUpdate:sidebarWidth": [
|
|
98
98
|
a[1] || (a[1] = (n) => r.value = n),
|
|
@@ -110,7 +110,7 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
|
|
|
110
110
|
}, null, 8, ["sidebarWidth", "documents", "eventBus", "sidebarState", "onSelectItem"]), [
|
|
111
111
|
[k, s.value]
|
|
112
112
|
]),
|
|
113
|
-
l(
|
|
113
|
+
l(z, {
|
|
114
114
|
activeWorkspace: m,
|
|
115
115
|
class: "flex-1",
|
|
116
116
|
document: e.document.value,
|
|
@@ -125,13 +125,13 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
|
|
|
125
125
|
securitySchemes: W.value,
|
|
126
126
|
workspaceStore: e.workspaceStore
|
|
127
127
|
}, null, 8, ["document", "documentSlug", "environment", "eventBus", "exampleName", "method", "path", "plugins", "securitySchemes", "workspaceStore"])
|
|
128
|
-
])) : (c(),
|
|
128
|
+
])) : (c(), u("div", Z, [...a[3] || (a[3] = [
|
|
129
129
|
i("span", { class: "text-c-3" }, "No document selected", -1)
|
|
130
130
|
])]))
|
|
131
131
|
]),
|
|
132
132
|
_: 1
|
|
133
133
|
})
|
|
134
|
-
], 8,
|
|
134
|
+
], 8, X),
|
|
135
135
|
i("div", {
|
|
136
136
|
class: "scalar-app-exit",
|
|
137
137
|
onClick: a[2] || (a[2] = (n) => e.modalState.hide())
|
|
@@ -143,5 +143,5 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
export {
|
|
146
|
-
|
|
146
|
+
fe as default
|
|
147
147
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ModalState } from '@scalar/components';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference';
|
|
3
3
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
4
4
|
import { type WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
5
|
-
import { type App } from 'vue';
|
|
5
|
+
import { type App, type MaybeRefOrGetter } from 'vue';
|
|
6
6
|
import { type RoutePayload } from '../../../../v2/features/modal/helpers/resolve-route-parameters.js';
|
|
7
7
|
import type { ClientPlugin } from '../../../../v2/helpers/plugins.js';
|
|
8
8
|
export type CreateApiClientModalOptions = {
|
|
@@ -19,8 +19,8 @@ export type CreateApiClientModalOptions = {
|
|
|
19
19
|
workspaceStore: WorkspaceStore;
|
|
20
20
|
/** Api client plugins to include in the modal */
|
|
21
21
|
plugins?: ClientPlugin[];
|
|
22
|
-
/**
|
|
23
|
-
|
|
22
|
+
/** Subset of the configuration options for the modal, if you want it to be reactive ensure its a ref */
|
|
23
|
+
options?: MaybeRefOrGetter<Pick<ApiReferenceConfigurationRaw, 'authentication' | 'proxyUrl'>>;
|
|
24
24
|
};
|
|
25
25
|
export type ApiClientModal = {
|
|
26
26
|
app: App;
|
|
@@ -35,5 +35,5 @@ export type ApiClientModal = {
|
|
|
35
35
|
* The modal does not require a router. Instead, navigation is handled by setting
|
|
36
36
|
* active entities directly through the returned `route` function.
|
|
37
37
|
*/
|
|
38
|
-
export declare const createApiClientModal: ({ el, eventBus, mountOnInitialize, plugins, workspaceStore,
|
|
38
|
+
export declare const createApiClientModal: ({ el, eventBus, mountOnInitialize, plugins, workspaceStore, options, }: CreateApiClientModalOptions) => ApiClientModal;
|
|
39
39
|
//# sourceMappingURL=create-api-client-modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-api-client-modal.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/modal/helpers/create-api-client-modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,oBAAoB,CAAA;AAC9D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"create-api-client-modal.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/modal/helpers/create-api-client-modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,oBAAoB,CAAA;AAC9D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,gCAAgC,CAAA;AAChG,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,gBAAgB,EAAiC,MAAM,KAAK,CAAA;AAEpF,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,sDAAsD,CAAA;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,MAAM,2BAA2B,GAAG;IACxC,4CAA4C;IAC5C,EAAE,EAAE,WAAW,GAAG,IAAI,CAAA;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,kFAAkF;IAClF,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,6DAA6D;IAC7D,cAAc,EAAE,cAAc,CAAA;IAC9B,iDAAiD;IACjD,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,wGAAwG;IACxG,OAAO,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,EAAE,gBAAgB,GAAG,UAAU,CAAC,CAAC,CAAA;CAC9F,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,GAAG,CAAA;IACR,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,KAAK,IAAI,CAAA;IACtC,KAAK,EAAE,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;IAC/C,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAA;IACtC,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,wEASlC,2BAA2B,KAAG,cAsFhC,CAAA"}
|
|
@@ -10,9 +10,9 @@ const T = ({
|
|
|
10
10
|
debug: !1
|
|
11
11
|
}),
|
|
12
12
|
mountOnInitialize: h = !0,
|
|
13
|
-
plugins: g,
|
|
13
|
+
plugins: g = [],
|
|
14
14
|
workspaceStore: a,
|
|
15
|
-
|
|
15
|
+
options: x = {}
|
|
16
16
|
}) => {
|
|
17
17
|
const n = {
|
|
18
18
|
path: "default",
|
|
@@ -38,7 +38,7 @@ const T = ({
|
|
|
38
38
|
plugins: g,
|
|
39
39
|
sidebarState: b,
|
|
40
40
|
workspaceStore: a,
|
|
41
|
-
|
|
41
|
+
options: x
|
|
42
42
|
});
|
|
43
43
|
l.config.idPrefix = "scalar-client";
|
|
44
44
|
const p = (e = f) => {
|
|
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
|
|
|
33
33
|
}));
|
|
34
34
|
}, f = (o) => {
|
|
35
35
|
o?.createNew && g.name === "request" && d();
|
|
36
|
-
}, v = "2.17.
|
|
36
|
+
}, v = "2.17.6";
|
|
37
37
|
return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (o, e) => (i(), l("div", W, [
|
|
38
38
|
s("div", {
|
|
39
39
|
class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.17.
|
|
21
|
+
"version": "2.17.6",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
@@ -327,25 +327,25 @@
|
|
|
327
327
|
"yaml": "^2.8.0",
|
|
328
328
|
"zod": "^4.1.11",
|
|
329
329
|
"@scalar/analytics-client": "1.0.1",
|
|
330
|
-
"@scalar/components": "0.16.
|
|
330
|
+
"@scalar/components": "0.16.16",
|
|
331
331
|
"@scalar/draggable": "0.3.0",
|
|
332
|
-
"@scalar/helpers": "0.2.
|
|
332
|
+
"@scalar/helpers": "0.2.6",
|
|
333
333
|
"@scalar/icons": "0.5.2",
|
|
334
|
-
"@scalar/
|
|
335
|
-
"@scalar/
|
|
336
|
-
"@scalar/oas-utils": "0.6.
|
|
337
|
-
"@scalar/
|
|
338
|
-
"@scalar/
|
|
339
|
-
"@scalar/postman-to-openapi": "0.3.
|
|
340
|
-
"@scalar/sidebar": "0.7.5",
|
|
334
|
+
"@scalar/json-magic": "0.8.10",
|
|
335
|
+
"@scalar/import": "0.4.43",
|
|
336
|
+
"@scalar/oas-utils": "0.6.14",
|
|
337
|
+
"@scalar/object-utils": "1.2.20",
|
|
338
|
+
"@scalar/openapi-parser": "0.23.11",
|
|
339
|
+
"@scalar/postman-to-openapi": "0.3.55",
|
|
341
340
|
"@scalar/openapi-types": "0.5.3",
|
|
341
|
+
"@scalar/sidebar": "0.7.6",
|
|
342
|
+
"@scalar/snippetz": "0.6.3",
|
|
342
343
|
"@scalar/themes": "0.13.26",
|
|
343
|
-
"@scalar/
|
|
344
|
-
"@scalar/use-codemirror": "0.13.
|
|
345
|
-
"@scalar/use-hooks": "0.3.4",
|
|
346
|
-
"@scalar/types": "0.5.5",
|
|
344
|
+
"@scalar/types": "0.5.6",
|
|
345
|
+
"@scalar/use-codemirror": "0.13.10",
|
|
347
346
|
"@scalar/use-toasts": "0.9.1",
|
|
348
|
-
"@scalar/
|
|
347
|
+
"@scalar/use-hooks": "0.3.5",
|
|
348
|
+
"@scalar/workspace-store": "0.24.4"
|
|
349
349
|
},
|
|
350
350
|
"devDependencies": {
|
|
351
351
|
"@tailwindcss/vite": "^4.1.7",
|