@scalar/api-client 2.22.2 → 2.22.3

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -1
  4. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +9 -9
  5. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  6. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  7. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +100 -91
  8. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts +2 -0
  9. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  10. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +2 -2
  11. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue2.js +43 -37
  12. package/dist/v2/components/layout/ValueEmitter.vue.d.ts +6 -2
  13. package/dist/v2/components/layout/ValueEmitter.vue.d.ts.map +1 -1
  14. package/dist/v2/components/layout/ValueEmitter.vue.js +10 -10
  15. package/dist/v2/components/server/ServerDropdown.vue.d.ts +2 -0
  16. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  17. package/dist/v2/components/server/ServerDropdown.vue.js +48 -42
  18. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  19. package/dist/v2/features/app/App.vue.js +48 -46
  20. package/dist/v2/features/app/app-state.d.ts +23 -12
  21. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  22. package/dist/v2/features/app/app-state.js +194 -163
  23. package/dist/v2/features/app/helpers/routes.d.ts +1 -1
  24. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  25. package/dist/v2/features/app/helpers/routes.js +7 -7
  26. package/dist/v2/features/operation/Operation.vue.js +1 -1
  27. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  28. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"get-default-headers.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/helpers/get-default-headers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAanG;;;GAGG;AACH,KAAK,aAAa,GAAG;IACnB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IACZ,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAA;IACpB,qFAAqF;IACrF,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AAgBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,GAAI,yDAK/B;IACD,MAAM,EAAE,UAAU,CAAA;IAClB,SAAS,EAAE,eAAe,CAAA;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B,KAAG,aAAa,EAqChB,CAAA"}
1
+ {"version":3,"file":"get-default-headers.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/helpers/get-default-headers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAanG;;;GAGG;AACH,KAAK,aAAa,GAAG;IACnB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IACZ,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAA;IACpB,qFAAqF;IACrF,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AAgBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,GAAI,yDAK/B;IACD,MAAM,EAAE,UAAU,CAAA;IAClB,SAAS,EAAE,eAAe,CAAA;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B,KAAG,aAAa,EAsChB,CAAA"}
@@ -1,24 +1,24 @@
1
1
  import { canMethodHaveBody as p } from "@scalar/helpers/http/can-method-have-body";
2
2
  import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
3
  import { isElectron as u } from "../../../../libs/electron.js";
4
- const i = "2.22.2", m = "application/json", h = "*/*", c = (r, t, a) => ({
4
+ const i = "2.22.3", m = "application/json", h = "*/*", c = (r, t, o) => ({
5
5
  name: r,
6
6
  defaultValue: t,
7
- isOverridden: a.has(r.toLowerCase())
7
+ isOverridden: o.has(r.toLowerCase())
8
8
  }), y = ({
9
9
  method: r,
10
10
  operation: t,
11
- exampleKey: a,
12
- hideDisabledHeaders: l = !1
11
+ exampleKey: o,
12
+ hideDisabledHeaders: f = !1
13
13
  }) => {
14
- const o = new Set(
14
+ const a = new Set(
15
15
  t.parameters?.filter((e) => n(e).in === "header").map((e) => n(e).name.toLowerCase()) ?? []
16
- ), f = t["x-scalar-disable-parameters"]?.["default-headers"]?.[a] ?? {}, s = [], d = n(t.requestBody);
16
+ ), l = t["x-scalar-disable-parameters"]?.["default-headers"]?.[o] ?? {}, s = [], d = n(t.requestBody);
17
17
  if (p(r)) {
18
- const e = d?.["x-scalar-selected-content-type"]?.[a] ?? Object.keys(d?.content ?? {})[0] ?? m;
19
- s.push(c("Content-Type", e, o));
18
+ const e = d?.["x-scalar-selected-content-type"]?.[o] ?? Object.keys(d?.content ?? {})[0] ?? m;
19
+ e !== "none" && s.push(c("Content-Type", e, a));
20
20
  }
21
- return s.push(c("Accept", h, o)), u() && i && s.push(c("User-Agent", `Scalar/${i}`, o)), l ? s.filter((e) => f[e.name.toLowerCase()] !== !0) : s;
21
+ return s.push(c("Accept", h, a)), u() && i && s.push(c("User-Agent", `Scalar/${i}`, a)), f ? s.filter((e) => l[e.name.toLowerCase()] !== !0) : s;
22
22
  };
23
23
  export {
24
24
  y as getDefaultHeaders
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBar.vue"],"names":[],"mappings":"AAgbA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAGrF,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAWhG,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAM3C,OAA0B,EAAE,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEzE,KAAK,WAAW,GAAG;IACjB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,cAAc,CAAA;IACtB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kBAAkB;IAClB,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;;;;;;eAkB6C,MAAM;;;;;;eAAN,MAAM;;;AAqkBrD,wBAQG"}
1
+ {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBar.vue"],"names":[],"mappings":"AA4bA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAGrF,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAWhG,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAM3C,OAA0B,EAAE,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEzE,KAAK,WAAW,GAAG;IACjB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,cAAc,CAAA;IACtB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kBAAkB;IAClB,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;;;;;;eAkB6C,MAAM;;;;;;eAAN,MAAM;;;AAqlBrD,wBAQG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./AddressBar.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-35d07de1"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-791e0491"]]);
5
5
  export {
6
- a as default
6
+ e as default
7
7
  };
@@ -1,21 +1,21 @@
1
- import { defineComponent as F, useId as H, computed as k, ref as w, useTemplateRef as S, onMounted as W, onBeforeUnmount as O, createElementBlock as U, openBlock as h, unref as l, createElementVNode as o, normalizeClass as P, createVNode as a, createCommentVNode as z, normalizeStyle as K, createBlock as Q, withCtx as R, createTextVNode as x, toDisplayString as c } from "vue";
2
- import { ScalarButton as E, ScalarWrappingText as j, ScalarIcon as G } from "@scalar/components";
3
- import { REQUEST_METHODS as J } from "@scalar/helpers/http/http-info";
4
- import { ScalarIconCopy as X, ScalarIconWarningCircle as Y } from "@scalar/icons";
5
- import { useClipboard as Z } from "@scalar/use-hooks/useClipboard";
6
- import { getResolvedUrl as _ } from "../../operation-block/helpers/get-resolved-url.js";
7
- import { useLoadingAnimation as ee } from "../hooks/use-loading-animation.js";
8
- import te from "./AddressBarHistory.vue.js";
9
- import ne from "../../../../components/HttpMethod/HttpMethod.vue.js";
10
- import oe from "../../../components/server/ServerDropdown.vue.js";
11
- import le from "../../../components/code-input/CodeInput.vue.js";
12
- const se = ["id"], ae = { class: "pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border" }, re = { class: "z-context-plus flex gap-1" }, ie = { class: "scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal" }, de = {
1
+ import { defineComponent as P, useId as K, computed as x, ref as v, useTemplateRef as E, onMounted as Q, onBeforeUnmount as j, createElementBlock as $, openBlock as b, unref as s, createElementVNode as l, normalizeClass as V, createVNode as a, createCommentVNode as q, normalizeStyle as G, createBlock as J, withCtx as T, createTextVNode as g, toDisplayString as f } from "vue";
2
+ import { ScalarButton as z, ScalarWrappingText as X, ScalarIcon as Y } from "@scalar/components";
3
+ import { REQUEST_METHODS as Z } from "@scalar/helpers/http/http-info";
4
+ import { ScalarIconCopy as _, ScalarIconWarningCircle as ee } from "@scalar/icons";
5
+ import { useClipboard as te } from "@scalar/use-hooks/useClipboard";
6
+ import { getResolvedUrl as ne } from "../../operation-block/helpers/get-resolved-url.js";
7
+ import { useLoadingAnimation as oe } from "../hooks/use-loading-animation.js";
8
+ import le from "./AddressBarHistory.vue.js";
9
+ import se from "../../../../components/HttpMethod/HttpMethod.vue.js";
10
+ import ae from "../../../components/server/ServerDropdown.vue.js";
11
+ import re from "../../../components/code-input/CodeInput.vue.js";
12
+ const ie = ["id"], de = { class: "flex gap-1" }, ue = { class: "scroll-timeline-x scroll-timeline-x-hidden relative flex w-full bg-blend-normal" }, me = {
13
13
  key: 0,
14
- class: "z-context absolute inset-x-0 top-[calc(100%+4px)] flex flex-col items-center rounded px-6"
15
- }, ue = { class: "text-c-danger bg-b-danger border-c-danger flex items-center gap-1 rounded border p-1" }, me = { class: "min-w-0 flex-1" }, ce = {
14
+ class: "absolute inset-x-0 top-[calc(100%+4px)] flex flex-col items-center rounded px-6"
15
+ }, ve = { class: "text-c-danger bg-b-danger border-c-danger flex items-center gap-1 rounded border p-1" }, fe = { class: "min-w-0 flex-1" }, ce = {
16
16
  "aria-hidden": "true",
17
17
  class: "inline-flex items-center gap-1"
18
- }, fe = { class: "sr-only" }, Se = /* @__PURE__ */ F({
18
+ }, he = { class: "sr-only" }, Re = /* @__PURE__ */ P({
19
19
  __name: "AddressBar",
20
20
  props: {
21
21
  path: {},
@@ -28,84 +28,92 @@ const se = ["id"], ae = { class: "pointer-events-none absolute top-0 left-0 bloc
28
28
  environment: {}
29
29
  },
30
30
  emits: ["execute", "update:servers", "select:history:item"],
31
- setup(e, { expose: $, emit: V }) {
32
- const d = V, f = H(), { percentage: q, startLoading: b, stopLoading: v, isLoading: T } = ee(), I = k(() => ({
33
- backgroundColor: `color-mix(in srgb, transparent 90%, ${J[e.method].colorVar})`,
34
- transform: `translate3d(-${q.value}%,0,0)`
35
- })), i = w(null), r = w(null), g = k(() => r.value || i.value), y = (n, t, s) => {
36
- const D = u.value?.cursorPosition();
31
+ setup(e, { expose: D, emit: I }) {
32
+ const d = I, c = K(), { percentage: L, startLoading: y, stopLoading: h, isLoading: A } = oe(), M = x(() => ({
33
+ backgroundColor: `color-mix(in srgb, transparent 90%, ${Z[e.method].colorVar})`,
34
+ transform: `translate3d(-${L.value}%,0,0)`
35
+ })), i = v(null), r = v(null), B = x(() => r.value || i.value), p = (n, t, o) => {
36
+ const W = u.value?.cursorPosition();
37
37
  e.eventBus.emit(
38
38
  "operation:update:pathMethod",
39
39
  {
40
40
  meta: { method: e.method, path: e.path },
41
41
  payload: { method: n, path: t },
42
42
  callback: (m) => {
43
- (m === "success" || m === "no-change") && (r.value = null, i.value = null), m === "success" ? e.eventBus.emit("ui:focus:address-bar", { position: D }) : m === "conflict" && (n !== e.method && (r.value = n), t !== e.path && (i.value = t));
43
+ (m === "success" || m === "no-change") && (r.value = null, i.value = null), m === "success" ? e.eventBus.emit("ui:focus:address-bar", { position: W }) : m === "conflict" && (n !== e.method && (r.value = n), t !== e.path && (i.value = t));
44
44
  }
45
45
  },
46
- s
46
+ o
47
47
  );
48
- }, L = (n) => y(n, i.value ?? e.path), A = (n) => {
48
+ }, O = (n) => p(n, i.value ?? e.path), H = (n) => {
49
49
  const t = n.startsWith("/") ? n : `/${n}`;
50
- y(r.value ?? e.method, t, {
50
+ p(r.value ?? e.method, t, {
51
51
  debounceKey: `operation:update:pathMethod-${e.path}-${e.method}`
52
52
  });
53
- }, B = S("sendButtonRef"), u = S("addressBarRef"), C = () => B.value?.$el?.focus(), p = (n) => {
53
+ }, C = E("sendButtonRef"), u = E("addressBarRef"), w = () => C.value?.$el?.focus(), k = (n) => {
54
54
  if (u.value?.isFocused && e.layout !== "desktop")
55
55
  return;
56
56
  const t = n && "position" in n ? n.position : "end";
57
57
  u.value?.focus(t), n && "event" in n && n.event.preventDefault();
58
58
  };
59
- W(() => {
60
- e.eventBus.on("ui:focus:address-bar", p), e.eventBus.on("ui:focus:send-button", C), e.eventBus.on("hooks:on:request:sent", b), e.eventBus.on("hooks:on:request:complete", v);
61
- }), O(() => {
62
- e.eventBus.off("ui:focus:address-bar", p), e.eventBus.off("ui:focus:send-button", C), e.eventBus.off("hooks:on:request:sent", b), e.eventBus.off("hooks:on:request:complete", v), v();
59
+ Q(() => {
60
+ e.eventBus.on("ui:focus:address-bar", k), e.eventBus.on("ui:focus:send-button", w), e.eventBus.on("hooks:on:request:sent", y), e.eventBus.on("hooks:on:request:complete", h);
61
+ }), j(() => {
62
+ e.eventBus.off("ui:focus:address-bar", k), e.eventBus.off("ui:focus:send-button", w), e.eventBus.off("hooks:on:request:sent", y), e.eventBus.off("hooks:on:request:complete", h), h();
63
63
  });
64
- const { copyToClipboard: M } = Z(), N = async () => {
65
- await M(
66
- _({ environment: e.environment, server: e.server, path: e.path, pathVariables: {} })
64
+ const { copyToClipboard: N } = te(), F = async () => {
65
+ await N(
66
+ ne({ environment: e.environment, server: e.server, path: e.path, pathVariables: {} })
67
67
  );
68
- };
69
- return $({
68
+ }, S = v(!1), U = v(!1), R = x(
69
+ () => S.value || U.value
70
+ );
71
+ return D({
70
72
  methodConflict: r,
71
73
  pathConflict: i
72
- }), (n, t) => (h(), U("div", {
73
- id: l(f),
74
- class: "scalar-address-bar order-last flex h-(--scalar-address-bar-height) w-full [--scalar-address-bar-height:32px] lg:order-none lg:w-auto"
74
+ }), (n, t) => (b(), $("div", {
75
+ id: s(c),
76
+ class: "scalar-address-bar order-last flex h-(--scalar-address-bar-height) w-full [--scalar-address-bar-height:32px] lg:order-0 lg:w-auto"
75
77
  }, [
76
- o("div", {
77
- class: P(["address-bar-bg-states text-xxs group relative order-last flex w-full max-w-[calc(100dvw-24px)] flex-1 flex-row items-stretch rounded-lg p-0.75 lg:order-none lg:max-w-[580px] lg:min-w-[580px] xl:max-w-[720px] xl:min-w-[720px]", {
78
- "outline-c-danger outline": g.value
78
+ l("div", {
79
+ class: V(["address-bar-bg-states text-xxs group relative order-last flex w-full max-w-[calc(100dvw-24px)] flex-1 flex-row items-stretch rounded-lg p-0.75 lg:order-none lg:max-w-[580px] lg:min-w-[580px] xl:max-w-[720px] xl:min-w-[720px]", {
80
+ "outline-c-danger outline": B.value,
81
+ "rounded-b-none": R.value
79
82
  }])
80
83
  }, [
81
- o("div", ae, [
82
- o("div", {
83
- class: "absolute top-0 left-0 z-[1002] h-full w-full",
84
- style: K(I.value)
84
+ l("div", {
85
+ class: V(["pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border", {
86
+ "rounded-b-none": R.value
87
+ }])
88
+ }, [
89
+ l("div", {
90
+ class: "absolute top-0 left-0 h-full w-full",
91
+ style: G(M.value)
85
92
  }, null, 4)
86
- ]),
87
- o("div", re, [
88
- a(l(ne), {
93
+ ], 2),
94
+ l("div", de, [
95
+ a(s(se), {
89
96
  isEditable: e.layout !== "modal",
90
97
  isSquare: "",
91
98
  method: r.value ?? e.method,
92
99
  teleport: "",
93
- onChange: L
100
+ onChange: O
94
101
  }, null, 8, ["isEditable", "method"])
95
102
  ]),
96
- o("div", ie, [
97
- e.servers.length ? (h(), Q(l(oe), {
103
+ l("div", ue, [
104
+ e.servers.length ? (b(), J(s(ae), {
98
105
  key: 0,
99
106
  layout: e.layout,
100
107
  server: e.server,
101
108
  servers: e.servers,
102
- target: l(f),
103
- "onUpdate:selectedServer": t[0] || (t[0] = (s) => e.eventBus.emit("server:update:selected", s)),
104
- "onUpdate:servers": t[1] || (t[1] = (s) => d("update:servers")),
105
- "onUpdate:variable": t[2] || (t[2] = (s) => e.eventBus.emit("server:update:variables", s))
106
- }, null, 8, ["layout", "server", "servers", "target"])) : z("", !0),
107
- t[6] || (t[6] = o("div", { class: "fade-left" }, null, -1)),
108
- a(l(le), {
109
+ target: s(c),
110
+ "onUpdate:open": t[0] || (t[0] = (o) => S.value = o),
111
+ "onUpdate:selectedServer": t[1] || (t[1] = (o) => e.eventBus.emit("server:update:selected", o)),
112
+ "onUpdate:servers": t[2] || (t[2] = (o) => d("update:servers")),
113
+ "onUpdate:variable": t[3] || (t[3] = (o) => e.eventBus.emit("server:update:variables", o))
114
+ }, null, 8, ["layout", "server", "servers", "target"])) : q("", !0),
115
+ t[8] || (t[8] = l("div", { class: "fade-left" }, null, -1)),
116
+ a(s(re), {
109
117
  ref_key: "addressBarRef",
110
118
  ref: u,
111
119
  alwaysEmitChange: "",
@@ -122,66 +130,67 @@ const se = ["id"], ae = { class: "pointer-events-none absolute top-0 left-0 bloc
122
130
  modelValue: e.path,
123
131
  placeholder: e.server ? "" : "Enter a URL",
124
132
  server: "",
125
- onSubmit: t[3] || (t[3] = (s) => d("execute")),
126
- "onUpdate:modelValue": A
133
+ onSubmit: t[4] || (t[4] = (o) => d("execute")),
134
+ "onUpdate:modelValue": H
127
135
  }, null, 8, ["disabled", "environment", "layout", "modelValue", "placeholder"]),
128
- t[7] || (t[7] = o("div", { class: "fade-right" }, null, -1))
136
+ t[9] || (t[9] = l("div", { class: "fade-right" }, null, -1))
129
137
  ]),
130
- a(l(E), {
138
+ a(s(z), {
131
139
  class: "hover:bg-b-3 mx-1",
132
140
  size: "xs",
133
141
  variant: "ghost",
134
- onClick: N
142
+ onClick: F
135
143
  }, {
136
- default: R(() => [
137
- a(l(X)),
138
- t[8] || (t[8] = o("span", { class: "sr-only" }, "Copy URL", -1))
144
+ default: T(() => [
145
+ a(s(_)),
146
+ t[10] || (t[10] = l("span", { class: "sr-only" }, "Copy URL", -1))
139
147
  ]),
140
148
  _: 1
141
149
  }),
142
- a(te, {
150
+ a(le, {
143
151
  history: e.history,
144
- target: l(f),
145
- "onSelect:history:item": t[4] || (t[4] = (s) => d("select:history:item", s))
152
+ target: s(c),
153
+ "onSelect:history:item": t[5] || (t[5] = (o) => d("select:history:item", o)),
154
+ "onUpdate:open": t[6] || (t[6] = (o) => U.value = o)
146
155
  }, null, 8, ["history", "target"]),
147
- g.value ? (h(), U("div", de, [
148
- o("div", ue, [
149
- a(l(Y), { size: "sm" }),
150
- o("div", me, [
151
- t[9] || (t[9] = x(" A ", -1)),
152
- o("em", null, c(r.value?.toUpperCase() ?? e.method.toUpperCase()), 1),
153
- t[10] || (t[10] = x(" request to ", -1)),
154
- a(l(j), {
156
+ B.value ? (b(), $("div", me, [
157
+ l("div", ve, [
158
+ a(s(ee), { size: "sm" }),
159
+ l("div", fe, [
160
+ t[11] || (t[11] = g(" A ", -1)),
161
+ l("em", null, f(r.value?.toUpperCase() ?? e.method.toUpperCase()), 1),
162
+ t[12] || (t[12] = g(" request to ", -1)),
163
+ a(s(X), {
155
164
  text: i.value ?? e.path
156
165
  }, null, 8, ["text"]),
157
- t[11] || (t[11] = x(" already exists in this document ", -1))
166
+ t[13] || (t[13] = g(" already exists in this document ", -1))
158
167
  ])
159
168
  ])
160
- ])) : z("", !0),
161
- a(l(E), {
169
+ ])) : q("", !0),
170
+ a(s(z), {
162
171
  ref_key: "sendButtonRef",
163
- ref: B,
164
- class: "z-context-plus relative h-auto shrink-0 overflow-hidden py-1 pr-2.5 pl-2 font-bold",
165
- disabled: l(T),
166
- onClick: t[5] || (t[5] = (s) => d("execute"))
172
+ ref: C,
173
+ class: "relative h-auto shrink-0 overflow-hidden py-1 pr-2.5 pl-2 font-bold",
174
+ disabled: s(A),
175
+ onClick: t[7] || (t[7] = (o) => d("execute"))
167
176
  }, {
168
- default: R(() => [
169
- o("span", ce, [
170
- a(l(G), {
177
+ default: T(() => [
178
+ l("span", ce, [
179
+ a(s(Y), {
171
180
  class: "relative shrink-0 fill-current",
172
181
  icon: "Play",
173
182
  size: "xs"
174
183
  }),
175
- t[12] || (t[12] = o("span", { class: "text-xxs hidden lg:flex" }, "Send", -1))
184
+ t[14] || (t[14] = l("span", { class: "text-xxs hidden lg:flex" }, "Send", -1))
176
185
  ]),
177
- o("span", fe, " Send " + c(e.method) + " request to " + c(e.server?.url ?? "") + c(e.path), 1)
186
+ l("span", he, " Send " + f(e.method) + " request to " + f(e.server?.url ?? "") + f(e.path), 1)
178
187
  ]),
179
188
  _: 1
180
189
  }, 8, ["disabled"])
181
190
  ], 2)
182
- ], 8, se));
191
+ ], 8, ie));
183
192
  }
184
193
  });
185
194
  export {
186
- Se as default
195
+ Re as default
187
196
  };
@@ -12,10 +12,12 @@ type __VLS_Props = {
12
12
  history: History[];
13
13
  };
14
14
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
15
+ "update:open": (value: boolean) => any;
15
16
  "select:history:item": (payload: {
16
17
  index: number;
17
18
  }) => any;
18
19
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
20
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
19
21
  "onSelect:history:item"?: ((payload: {
20
22
  index: number;
21
23
  }) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue"],"names":[],"mappings":"AA2GA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAQrF,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,cAAc,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,OAAO,EAAE,OAAO,EAAE,CAAA;CACnB,CAAC;;;eAK6C,MAAM;;;;eAAN,MAAM;;;AAyOrD,wBAOG"}
1
+ {"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue"],"names":[],"mappings":"AAmHA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AASrF,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,cAAc,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,OAAO,EAAE,OAAO,EAAE,CAAA;CACnB,CAAC;;;;eAK6C,MAAM;;;;;eAAN,MAAM;;;AAiQrD,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./AddressBarHistory.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b45f1e9d"]]);
4
+ const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-c15c6573"]]);
5
5
  export {
6
- d as default
6
+ c as default
7
7
  };
@@ -1,80 +1,86 @@
1
- import { defineComponent as h, createBlock as c, openBlock as a, unref as t, withCtx as o, createVNode as r, createSlots as g, createCommentVNode as x, createElementVNode as s, normalizeStyle as v, createElementBlock as y, Fragment as _, renderList as k, toDisplayString as l, normalizeClass as C } from "vue";
1
+ import { defineComponent as g, createBlock as c, openBlock as l, unref as t, withCtx as s, createVNode as r, createSlots as h, createCommentVNode as v, createElementVNode as n, normalizeStyle as x, createElementBlock as y, Fragment as k, renderList as C, toDisplayString as i, normalizeClass as _ } from "vue";
2
2
  import { Menu as S, MenuButton as b, MenuItems as B, MenuItem as M } from "@headlessui/vue";
3
3
  import { ScalarFloating as z, ScalarIcon as H, ScalarFloatingBackdrop as w } from "@scalar/components";
4
4
  import { httpStatusCodes as F } from "@scalar/oas-utils/helpers";
5
5
  import { formatMs as I } from "../../../../libs/formatters.js";
6
- import { getStatusCodeColor as N } from "./httpStatusCodeColors.js";
7
- import V from "../../../../components/HttpMethod/HttpMethod.vue.js";
8
- const E = { class: "min-w-0" }, q = { class: "text-c-1 min-w-0 truncate" }, O = /* @__PURE__ */ h({
6
+ import N from "../../../components/layout/ValueEmitter.vue.js";
7
+ import { getStatusCodeColor as V } from "./httpStatusCodeColors.js";
8
+ import $ from "../../../../components/HttpMethod/HttpMethod.vue.js";
9
+ const E = { class: "min-w-0" }, q = { class: "text-c-1 min-w-0 truncate" }, P = /* @__PURE__ */ g({
9
10
  __name: "AddressBarHistory",
10
11
  props: {
11
12
  target: {},
12
13
  history: {}
13
14
  },
14
- emits: ["select:history:item"],
15
- setup(i, { emit: d }) {
16
- const u = d;
17
- return (A, m) => (a(), c(t(S), { as: "div" }, {
18
- default: o(({ open: f }) => [
15
+ emits: ["select:history:item", "update:open"],
16
+ setup(u, { emit: p }) {
17
+ const m = p;
18
+ return (A, e) => (l(), c(t(S), { as: "div" }, {
19
+ default: s(({ open: f }) => [
20
+ r(N, {
21
+ value: f,
22
+ onChange: e[0] || (e[0] = (a) => m("update:open", a)),
23
+ onUnmount: e[1] || (e[1] = (a) => m("update:open", !1))
24
+ }, null, 8, ["value"]),
19
25
  r(t(z), {
20
26
  offset: 0,
21
27
  resize: "",
22
- target: i.target
23
- }, g({
24
- default: o(() => [
25
- i.history.length ? (a(), c(t(b), {
28
+ target: u.target
29
+ }, h({
30
+ default: s(() => [
31
+ u.history.length ? (l(), c(t(b), {
26
32
  key: 0,
27
- class: "address-bar-history-button z-context-plus text-c-3 focus:text-c-1 relative mr-1 rounded-lg p-1.5"
33
+ class: "address-bar-history-button text-c-3 focus:text-c-1 relative mr-1 rounded-lg p-1.5"
28
34
  }, {
29
- default: o(() => [
35
+ default: s(() => [
30
36
  r(t(H), {
31
37
  icon: "History",
32
38
  size: "sm",
33
39
  thickness: "2.25"
34
40
  }),
35
- m[0] || (m[0] = s("span", { class: "sr-only" }, "Request History", -1))
41
+ e[2] || (e[2] = n("span", { class: "sr-only" }, "Request History", -1))
36
42
  ]),
37
43
  _: 1
38
- })) : x("", !0)
44
+ })) : v("", !0)
39
45
  ]),
40
46
  _: 2
41
47
  }, [
42
48
  f ? {
43
49
  name: "floating",
44
- fn: o(({ width: p }) => [
50
+ fn: s(({ width: a }) => [
45
51
  r(t(B), {
46
- class: "custom-scroll grid max-h-[inherit] grid-cols-[44px_1fr_repeat(3,auto)] items-center border-t p-0.75",
52
+ class: "custom-scroll grid max-h-[inherit] grid-cols-[44px_1fr_repeat(3,auto)] items-center p-0.75",
47
53
  static: "",
48
- style: v({ width: p })
54
+ style: x({ width: a })
49
55
  }, {
50
- default: o(() => [
51
- (a(!0), y(_, null, k(i.history, (e, n) => (a(), c(t(M), {
52
- key: n,
56
+ default: s(() => [
57
+ (l(!0), y(k, null, C(u.history, (o, d) => (l(), c(t(M), {
58
+ key: d,
53
59
  as: "button",
54
60
  class: "font-code ui-active:*:bg-b-2 text-c-2 contents text-sm font-medium *:flex *:h-8 *:cursor-pointer *:items-center *:rounded-none *:px-1.5 *:first:rounded-l *:last:rounded-r",
55
- value: n,
56
- onClick: (D) => u("select:history:item", { index: n })
61
+ value: d,
62
+ onClick: (D) => m("select:history:item", { index: d })
57
63
  }, {
58
- default: o(() => [
59
- r(t(V), {
64
+ default: s(() => [
65
+ r(t($), {
60
66
  class: "text-[11px]",
61
- method: e.method
67
+ method: o.method
62
68
  }, null, 8, ["method"]),
63
- s("div", E, [
64
- s("div", q, l(e.path), 1)
69
+ n("div", E, [
70
+ n("div", q, i(o.path), 1)
65
71
  ]),
66
- s("div", null, l(t(I)(e.duration)), 1),
67
- s("div", {
68
- class: C([t(N)(e.status).color])
69
- }, l(e.status), 3),
70
- s("div", null, l(t(F)[e.status]?.name), 1)
72
+ n("div", null, i(t(I)(o.duration)), 1),
73
+ n("div", {
74
+ class: _([t(V)(o.status).color])
75
+ }, i(o.status), 3),
76
+ n("div", null, i(t(F)[o.status]?.name), 1)
71
77
  ]),
72
78
  _: 2
73
79
  }, 1032, ["value", "onClick"]))), 128))
74
80
  ]),
75
81
  _: 1
76
82
  }, 8, ["style"]),
77
- r(t(w), { class: "-top-(--scalar-address-bar-height) rounded-lg" })
83
+ r(t(w), { class: "inset-x-px rounded-none rounded-b-lg" })
78
84
  ]),
79
85
  key: "0"
80
86
  } : void 0
@@ -85,5 +91,5 @@ const E = { class: "min-w-0" }, q = { class: "text-c-1 min-w-0 truncate" }, O =
85
91
  }
86
92
  });
87
93
  export {
88
- O as default
94
+ P as default
89
95
  };
@@ -6,13 +6,17 @@
6
6
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
7
7
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
8
8
  readonly onChange?: ((value: T) => any) | undefined;
9
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange"> & {
9
+ readonly onUnmount?: (() => any) | undefined;
10
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange" | "onUnmount"> & {
10
11
  value: T;
11
12
  } & Partial<{}>> & import("vue").PublicProps;
12
13
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
13
14
  attrs: any;
14
15
  slots: {};
15
- emit: (e: "change", value: T) => void;
16
+ emit: {
17
+ (e: "change", value: T): void;
18
+ (e: "unmount"): void;
19
+ };
16
20
  }>) => import("vue").VNode & {
17
21
  __ctx?: Awaited<typeof __VLS_setup>;
18
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ValueEmitter.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/layout/ValueEmitter.vue"],"names":[],"mappings":"AAiCA;;;;GAIG;yBACc,CAAC,EACjB,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WA+CO,mBAAmB,CAAC;;;eA9CA,CAAC;QA8CoC,OAAO,IAAsB,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;cA9Ca,QAAQ,SAAS,CAAC,KAAG,IAAI;EAkD7C,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA1DzE,wBA2DC;AACD,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"ValueEmitter.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/layout/ValueEmitter.vue"],"names":[],"mappings":"AAsCA;;;;GAIG;yBACc,CAAC,EACjB,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAoDO,mBAAmB,CAAC;;;;eAnDA,CAAC;QAmDoC,OAAO,IAAsB,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;YAlDL,QAAQ,SAAS,CAAC,GAAG,IAAI;YACzB,SAAS,GAAG,IAAI;;EAqDlB,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA/DzE,wBAgEC;AACD,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -1,21 +1,21 @@
1
- import { defineComponent as m, watch as c } from "vue";
1
+ import { defineComponent as m, watch as o, onBeforeUnmount as a } from "vue";
2
2
  const r = {
3
3
  name: "ValueEmitter"
4
- }, o = /* @__PURE__ */ m({
4
+ }, s = /* @__PURE__ */ m({
5
5
  ...r,
6
6
  props: {
7
7
  value: {}
8
8
  },
9
- emits: ["change"],
10
- setup(t, { emit: a }) {
11
- const n = a;
12
- return c(
13
- () => t.value,
14
- (e) => n("change", e),
9
+ emits: ["change", "unmount"],
10
+ setup(n, { emit: u }) {
11
+ const e = u;
12
+ return o(
13
+ () => n.value,
14
+ (t) => e("change", t),
15
15
  { immediate: !0 }
16
- ), (e, u) => null;
16
+ ), a(() => e("unmount")), (t, c) => null;
17
17
  }
18
18
  });
19
19
  export {
20
- o as default
20
+ s as default
21
21
  };
@@ -20,6 +20,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
20
20
  url: string;
21
21
  }) => any;
22
22
  "update:servers": () => any;
23
+ "update:open": (value: boolean) => any;
23
24
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
24
25
  "onUpdate:variable"?: ((payload: {
25
26
  index: number;
@@ -30,6 +31,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
30
31
  url: string;
31
32
  }) => any) | undefined;
32
33
  "onUpdate:servers"?: (() => any) | undefined;
34
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
33
35
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
36
  export default _default;
35
37
  //# sourceMappingURL=ServerDropdown.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ServerDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/server/ServerDropdown.vue"],"names":[],"mappings":"AAyHA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAI3C,KAAK,WAAW,GAAG;IACjB,0EAA0E;IAC1E,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;IACd,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;CACrB,CAAC;;;;;;;;;;;;;;;;;;;;;;AAkPF,wBAOG"}
1
+ {"version":3,"file":"ServerDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/server/ServerDropdown.vue"],"names":[],"mappings":"AAkIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAK3C,KAAK,WAAW,GAAG;IACjB,0EAA0E;IAC1E,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;IACd,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;CACrB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AA2QF,wBAOG"}