@scalar/api-client 2.2.57 → 2.2.60

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 (75) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +88 -80
  5. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  6. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  7. package/dist/components/CodeInput/CodeInput.vue2.js +93 -81
  8. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +2 -0
  9. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  10. package/dist/components/IconSelector.vue.d.ts.map +1 -1
  11. package/dist/components/IconSelector.vue.js +1 -0
  12. package/dist/components/SectionFilter.vue.d.ts +23 -0
  13. package/dist/components/SectionFilter.vue.d.ts.map +1 -0
  14. package/dist/components/SectionFilter.vue.js +7 -0
  15. package/dist/components/SectionFilter.vue2.js +67 -0
  16. package/dist/components/SectionFilterButton.vue.d.ts +22 -0
  17. package/dist/components/SectionFilterButton.vue.d.ts.map +1 -0
  18. package/dist/components/SectionFilterButton.vue.js +23 -0
  19. package/dist/components/SectionFilterButton.vue2.js +4 -0
  20. package/dist/components/Server/ServerDropdown.vue.d.ts.map +1 -1
  21. package/dist/components/Server/ServerDropdown.vue.js +1 -0
  22. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  23. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +62 -44
  24. package/dist/layouts/App/create-api-client-app.d.ts +16 -5
  25. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  26. package/dist/layouts/Modal/create-api-client-modal.d.ts +32 -10
  27. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  28. package/dist/layouts/Web/create-api-client-web.d.ts +16 -5
  29. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  30. package/dist/libs/create-client.d.ts +15 -4
  31. package/dist/libs/create-client.d.ts.map +1 -1
  32. package/dist/libs/find-request.d.ts +1 -0
  33. package/dist/libs/find-request.d.ts.map +1 -1
  34. package/dist/libs/send-request/create-request-operation.test.d.ts +1 -0
  35. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  36. package/dist/store/active-entities.d.ts +1 -0
  37. package/dist/store/active-entities.d.ts.map +1 -1
  38. package/dist/store/events.d.ts +4 -0
  39. package/dist/store/events.d.ts.map +1 -1
  40. package/dist/store/events.js +4 -0
  41. package/dist/store/requests.d.ts +15 -4
  42. package/dist/store/requests.d.ts.map +1 -1
  43. package/dist/store/store.d.ts +15 -4
  44. package/dist/store/store.d.ts.map +1 -1
  45. package/dist/style.css +1 -1
  46. package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts.map +1 -1
  47. package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +10 -10
  48. package/dist/views/Request/RequestSection/RequestBody.vue.js +3 -3
  49. package/dist/views/Request/RequestSection/RequestBody.vue2.js +1 -1
  50. package/dist/views/Request/RequestSection/RequestCodeExample.test.d.ts +2 -0
  51. package/dist/views/Request/RequestSection/RequestCodeExample.test.d.ts.map +1 -0
  52. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
  53. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
  54. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +36 -36
  55. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  56. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  57. package/dist/views/Request/RequestSection/RequestSection.vue2.js +103 -83
  58. package/dist/views/Request/RequestSidebarItem.vue.d.ts +2 -1
  59. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  60. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  61. package/dist/views/Request/RequestSidebarItem.vue2.js +81 -81
  62. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +1 -1
  63. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +9 -9
  64. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts.map +1 -1
  65. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +2 -2
  66. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +26 -21
  67. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  68. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  69. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  70. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +80 -65
  71. package/package.json +15 -15
  72. package/dist/components/ContextBar.vue.d.ts +0 -11
  73. package/dist/components/ContextBar.vue.d.ts.map +0 -1
  74. package/dist/components/ContextBar.vue.js +0 -7
  75. package/dist/components/ContextBar.vue2.js +0 -47
package/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.2.60
4
+
5
+ ### Patch Changes
6
+
7
+ - df4dee8: fix(api-client): improve api client request and response area a11y
8
+ - 23bac9d: fix: use operation security scheme if available in request
9
+ - Updated dependencies [df4dee8]
10
+ - Updated dependencies [8c5b0c6]
11
+ - Updated dependencies [fb22645]
12
+ - @scalar/components@0.13.32
13
+ - @scalar/oas-utils@0.2.114
14
+ - @scalar/use-codemirror@0.11.77
15
+ - @scalar/import@0.2.34
16
+ - @scalar/postman-to-openapi@0.1.37
17
+
18
+ ## 2.2.59
19
+
20
+ ### Patch Changes
21
+
22
+ - 168e609: fix: body showing none instead of json
23
+ - Updated dependencies [3f99afc]
24
+ - Updated dependencies [bab7990]
25
+ - Updated dependencies [2c621d4]
26
+ - Updated dependencies [a31973c]
27
+ - @scalar/components@0.13.31
28
+ - @scalar/types@0.0.39
29
+ - @scalar/snippetz@0.2.16
30
+ - @scalar/oas-utils@0.2.113
31
+ - @scalar/use-codemirror@0.11.76
32
+ - @scalar/openapi-parser@0.10.9
33
+ - @scalar/themes@0.9.74
34
+ - @scalar/import@0.2.33
35
+ - @scalar/postman-to-openapi@0.1.36
36
+ - @scalar/use-hooks@0.1.28
37
+
38
+ ## 2.2.58
39
+
40
+ ### Patch Changes
41
+
42
+ - 4682a6f: fix: add keyboard instructions for code inputs
43
+ - Updated dependencies [7f1a40e]
44
+ - @scalar/types@0.0.38
45
+ - @scalar/oas-utils@0.2.112
46
+ - @scalar/openapi-parser@0.10.9
47
+ - @scalar/themes@0.9.73
48
+ - @scalar/import@0.2.32
49
+ - @scalar/postman-to-openapi@0.1.35
50
+ - @scalar/components@0.13.30
51
+ - @scalar/use-codemirror@0.11.75
52
+ - @scalar/use-hooks@0.1.27
53
+
3
54
  ## 2.2.57
4
55
 
5
56
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":"AAqVA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EAET,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAQrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAO1D,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;;;;;AAgaJ,wBAQG"}
1
+ {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":"AAiWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EAET,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAQrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAO1D,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;;;;;AAibJ,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 s = /* @__PURE__ */ r(o, [["__scopeId", "data-v-c8bfbadd"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-5e5a3c5f"]]);
5
5
  export {
6
- s as default
6
+ e as default
7
7
  };
@@ -1,16 +1,16 @@
1
- import { defineComponent as S, useId as V, ref as i, watch as z, openBlock as b, createElementBlock as I, unref as r, createElementVNode as l, normalizeClass as L, normalizeStyle as U, createVNode as d, createBlock as M, createCommentVNode as A, withCtx as H } from "vue";
2
- import { ScalarButton as N, ScalarIcon as T } from "@scalar/components";
3
- import { REQUEST_METHODS as $ } from "@scalar/oas-utils/helpers";
4
- import O from "../CodeInput/CodeInput.vue.js";
5
- import P from "../HttpMethod/HttpMethod.vue.js";
6
- import D from "./AddressBarHistory.vue.js";
7
- import K from "../Server/ServerDropdown.vue.js";
8
- import { useWorkspace as Q } from "../../store/store.js";
9
- import { useLayout as W } from "../../hooks/useLayout.js";
10
- const j = ["id"], F = { class: "m-auto flex flex-row items-center" }, G = { class: "address-bar-bg-states text-xxs p-0.75 group relative order-last flex w-full max-w-[calc(100dvw-24px)] flex-1 flex-row items-stretch rounded-lg lg:order-none lg:min-w-[580px] lg:max-w-[580px] xl:min-w-[720px] xl:max-w-[720px]" }, J = { class: "pointer-events-none absolute left-0 top-0 block h-full w-full overflow-hidden rounded-lg border" }, X = { class: "z-context-plus flex gap-1" }, Y = { class: "scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal" }, Z = {
1
+ import { defineComponent as z, useId as I, ref as i, watch as A, openBlock as k, createElementBlock as L, unref as r, createElementVNode as l, normalizeClass as U, normalizeStyle as M, createVNode as u, createBlock as $, createCommentVNode as H, withCtx as N, toDisplayString as x } from "vue";
2
+ import { ScalarButton as T, ScalarIcon as D } from "@scalar/components";
3
+ import { REQUEST_METHODS as O } from "@scalar/oas-utils/helpers";
4
+ import P from "../CodeInput/CodeInput.vue.js";
5
+ import K from "../HttpMethod/HttpMethod.vue.js";
6
+ import Q from "./AddressBarHistory.vue.js";
7
+ import W from "../Server/ServerDropdown.vue.js";
8
+ import { useWorkspace as j } from "../../store/store.js";
9
+ import { useLayout as F } from "../../hooks/useLayout.js";
10
+ const G = ["id"], J = { class: "m-auto flex flex-row items-center" }, X = { class: "address-bar-bg-states text-xxs p-0.75 group relative order-last flex w-full max-w-[calc(100dvw-24px)] flex-1 flex-row items-stretch rounded-lg lg:order-none lg:min-w-[580px] lg:max-w-[580px] xl:min-w-[720px] xl:max-w-[720px]" }, Y = { class: "pointer-events-none absolute left-0 top-0 block h-full w-full overflow-hidden rounded-lg border" }, Z = { class: "z-context-plus flex gap-1" }, _ = { class: "scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal" }, ee = {
11
11
  "aria-hidden": "true",
12
12
  class: "inline-flex items-center gap-1"
13
- }, ie = /* @__PURE__ */ S({
13
+ }, oe = { class: "sr-only" }, ce = /* @__PURE__ */ z({
14
14
  __name: "AddressBar",
15
15
  props: {
16
16
  collection: {},
@@ -22,88 +22,91 @@ const j = ["id"], F = { class: "m-auto flex flex-row items-center" }, G = { clas
22
22
  },
23
23
  emits: ["importCurl"],
24
24
  setup(n) {
25
- const u = V(), { requestMutators: c, events: f } = Q(), { layout: p } = W(), v = i(null), x = (e) => {
26
- n.operation.path !== e && c.edit(n.operation.uid, "path", e);
25
+ const p = I(), { requestMutators: v, events: c } = j(), { layout: h } = F(), f = i(null), g = i(null), B = (e) => {
26
+ n.operation.path !== e && v.edit(n.operation.uid, "path", e);
27
27
  };
28
- z(
28
+ A(
29
29
  () => n.operation.path,
30
30
  (e) => {
31
- e && x(e);
31
+ e && B(e);
32
32
  }
33
33
  );
34
- const o = i(100), h = i(0), a = i(!1), s = i();
35
- function w() {
36
- a.value ? o.value -= (o.value - 15) / 60 : o.value -= h.value / 20, o.value <= 0 && (clearInterval(s.value), s.value = void 0, o.value = 100, a.value = !1);
37
- }
38
- function k() {
39
- s.value || (a.value = !0, s.value = setInterval(w, 20));
40
- }
34
+ const t = i(100), w = i(0), a = i(!1), s = i();
41
35
  function C() {
42
- h.value = o.value, a.value = !1;
36
+ a.value ? t.value -= (t.value - 15) / 60 : t.value -= w.value / 20, t.value <= 0 && (clearInterval(s.value), s.value = void 0, t.value = 100, a.value = !1);
43
37
  }
44
38
  function y() {
45
- clearInterval(s.value), s.value = void 0, o.value = 100, a.value = !1;
39
+ s.value || (a.value = !0, s.value = setInterval(C, 20));
46
40
  }
47
- f.requestStatus.on((e) => {
48
- e === "start" && k(), e === "stop" && C(), e === "abort" && y();
49
- });
50
- function B(e) {
51
- c.edit(n.operation.uid, "method", e);
41
+ function R() {
42
+ w.value = t.value, a.value = !1;
52
43
  }
53
44
  function q() {
45
+ clearInterval(s.value), s.value = void 0, t.value = 100, a.value = !1;
46
+ }
47
+ c.requestStatus.on((e) => {
48
+ e === "start" && y(), e === "stop" && R(), e === "abort" && q();
49
+ }), c.focusAddressBar.on(() => {
50
+ var e, o, d;
51
+ console.log("focusAddressBar", g.value, f.value), h === "modal" ? (o = (e = g.value) == null ? void 0 : e.$el) == null || o.focus() : (d = f.value) == null || d.focus();
52
+ });
53
+ function S(e) {
54
+ v.edit(n.operation.uid, "method", e);
55
+ }
56
+ function E() {
54
57
  const { method: e } = n.operation;
55
- return $[e].backgroundColor;
58
+ return O[e].backgroundColor;
56
59
  }
57
- function m() {
58
- a.value || (a.value = !0, f.executeRequest.emit({ requestUid: n.operation.uid }));
60
+ function b() {
61
+ a.value || (a.value = !0, c.executeRequest.emit({ requestUid: n.operation.uid }));
59
62
  }
60
- f.hotKeys.on((e) => {
61
- var t;
62
- e != null && e.focusAddressBar && ((t = v.value) == null || t.focus()), e != null && e.executeRequest && m();
63
+ c.hotKeys.on((e) => {
64
+ var o;
65
+ e != null && e.focusAddressBar && ((o = f.value) == null || o.focus()), e != null && e.executeRequest && b();
63
66
  });
64
- function R(e) {
65
- c.edit(n.operation.uid, "path", e);
67
+ function V(e) {
68
+ v.edit(n.operation.uid, "path", e);
66
69
  }
67
- return (e, t) => {
68
- var g;
69
- return b(), I("div", {
70
- id: r(u),
70
+ return (e, o) => {
71
+ var d;
72
+ return k(), L("div", {
73
+ id: r(p),
71
74
  class: "scalar-address-bar order-last h-[--scalar-address-bar-height] w-full [--scalar-address-bar-height:32px] lg:order-none lg:w-auto"
72
75
  }, [
73
- l("div", F, [
74
- l("div", G, [
75
- l("div", J, [
76
+ l("div", J, [
77
+ l("div", X, [
78
+ l("div", Y, [
76
79
  l("div", {
77
- class: L(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 z-[1002] h-full w-full", q()]),
78
- style: U({ transform: `translate3d(-${o.value}%,0,0)` })
80
+ class: U(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 z-[1002] h-full w-full", E()]),
81
+ style: M({ transform: `translate3d(-${t.value}%,0,0)` })
79
82
  }, null, 6)
80
83
  ]),
81
- l("div", X, [
82
- d(P, {
83
- isEditable: r(p) !== "modal",
84
+ l("div", Z, [
85
+ u(K, {
86
+ isEditable: r(h) !== "modal",
84
87
  isSquare: "",
85
88
  method: e.operation.method,
86
89
  teleport: "",
87
- onChange: B
90
+ onChange: S
88
91
  }, null, 8, ["isEditable", "method"])
89
92
  ]),
90
- l("div", Y, [
91
- e.collection.servers.length ? (b(), M(r(K), {
93
+ l("div", _, [
94
+ e.collection.servers.length ? (k(), $(r(W), {
92
95
  key: 0,
93
96
  collection: e.collection,
94
97
  layout: "client",
95
98
  operation: e.operation,
96
99
  server: e.server,
97
- target: r(u)
98
- }, null, 8, ["collection", "operation", "server", "target"])) : A("", !0),
99
- t[1] || (t[1] = l("div", { class: "fade-left" }, null, -1)),
100
- d(O, {
100
+ target: r(p)
101
+ }, null, 8, ["collection", "operation", "server", "target"])) : H("", !0),
102
+ o[1] || (o[1] = l("div", { class: "fade-left" }, null, -1)),
103
+ u(P, {
101
104
  ref_key: "addressBarRef",
102
- ref: v,
105
+ ref: f,
103
106
  "aria-label": "Path",
104
107
  class: "min-w-fit outline-none",
105
108
  disableCloseBrackets: "",
106
- disabled: r(p) === "modal",
109
+ disabled: r(h) === "modal",
107
110
  disableEnter: "",
108
111
  disableTabIndent: "",
109
112
  emitOnBlur: !1,
@@ -111,43 +114,48 @@ const j = ["id"], F = { class: "m-auto flex flex-row items-center" }, G = { clas
111
114
  environment: e.environment,
112
115
  importCurl: "",
113
116
  modelValue: e.operation.path,
114
- placeholder: (g = e.server) != null && g.uid && e.collection.servers.includes(e.server.uid) ? "" : "Enter a URL or cURL command",
117
+ placeholder: (d = e.server) != null && d.uid && e.collection.servers.includes(e.server.uid) ? "" : "Enter a URL or cURL command",
115
118
  server: "",
116
119
  workspace: e.workspace,
117
- onCurl: t[0] || (t[0] = (E) => e.$emit("importCurl", E)),
118
- onSubmit: m,
119
- "onUpdate:modelValue": R
120
+ onCurl: o[0] || (o[0] = (m) => e.$emit("importCurl", m)),
121
+ onSubmit: b,
122
+ "onUpdate:modelValue": V
120
123
  }, null, 8, ["disabled", "envVariables", "environment", "modelValue", "placeholder", "workspace"]),
121
- t[2] || (t[2] = l("div", { class: "fade-right" }, null, -1))
124
+ o[2] || (o[2] = l("div", { class: "fade-right" }, null, -1))
122
125
  ]),
123
- d(D, {
126
+ u(Q, {
124
127
  operation: e.operation,
125
- target: r(u)
128
+ target: r(p)
126
129
  }, null, 8, ["operation", "target"]),
127
- d(r(N), {
130
+ u(r(T), {
131
+ ref_key: "sendButtonRef",
132
+ ref: g,
128
133
  class: "z-context-plus relative h-auto shrink-0 overflow-hidden py-1 pl-2 pr-2.5 font-bold",
129
134
  disabled: a.value,
130
- onClick: m
135
+ onClick: b
131
136
  }, {
132
- default: H(() => [
133
- l("span", Z, [
134
- d(r(T), {
135
- class: "relative shrink-0 fill-current",
136
- icon: "Play",
137
- size: "xs"
138
- }),
139
- t[3] || (t[3] = l("span", { class: "text-xxs hidden lg:flex" }, "Send", -1))
140
- ]),
141
- t[4] || (t[4] = l("span", { class: "sr-only" }, " Send Request ", -1))
142
- ]),
137
+ default: N(() => {
138
+ var m;
139
+ return [
140
+ l("span", ee, [
141
+ u(r(D), {
142
+ class: "relative shrink-0 fill-current",
143
+ icon: "Play",
144
+ size: "xs"
145
+ }),
146
+ o[3] || (o[3] = l("span", { class: "text-xxs hidden lg:flex" }, "Send", -1))
147
+ ]),
148
+ l("span", oe, " Send " + x(e.operation.method) + " request to " + x(((m = e.server) == null ? void 0 : m.url) ?? "") + x(e.operation.path), 1)
149
+ ];
150
+ }),
143
151
  _: 1
144
152
  }, 8, ["disabled"])
145
153
  ])
146
154
  ])
147
- ], 8, j);
155
+ ], 8, G);
148
156
  };
149
157
  }
150
158
  });
151
159
  export {
152
- ie as default
160
+ ce as default
153
161
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAkfA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAEzE,OAAO,EAIL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;AAM/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;;kBAYxC,OAAO;eACV,OAAO;gBACN,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;eACJ,MAAM,EAAE;WACZ,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;eACzB,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;iBACZ,WAAW;kBACV,WAAW,EAAE;eAChB,SAAS;;;;;;;;;kBAzBN,OAAO;eACV,OAAO;gBACN,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;eACJ,MAAM,EAAE;WACZ,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;eACzB,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;iBACZ,WAAW;kBACV,WAAW,EAAE;eAChB,SAAS;;;;;;;cAPT,OAAO;cAjBP,OAAO;iBADJ,OAAO;gBAIR,OAAO;sBAGD,OAAO;kBAMX,OAAO;0BACC,OAAO;mBAKd,OAAO;gBAEV,OAAO;;qBA4dM,GAAG;kBACN,GAAG;;AArf9B,wBAgjBC;AAeD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AA6fA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAEzE,OAAO,EAIL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;AAM/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;;kBAYxC,OAAO;eACV,OAAO;gBACN,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;eACJ,MAAM,EAAE;WACZ,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;eACzB,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;iBACZ,WAAW;kBACV,WAAW,EAAE;eAChB,SAAS;;;;;;;;;kBAzBN,OAAO;eACV,OAAO;gBACN,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;eACJ,MAAM,EAAE;WACZ,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;eACzB,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;iBACZ,WAAW;kBACV,WAAW,EAAE;eAChB,SAAS;;;;;;;cAPT,OAAO;cAjBP,OAAO;iBADJ,OAAO;gBAIR,OAAO;sBAGD,OAAO;kBAMX,OAAO;0BACC,OAAO;mBAKd,OAAO;gBAEV,OAAO;;qBA4fM,GAAG;kBACN,GAAG;;AArhB9B,wBAglBC;AAeD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-18f34311"]]);
5
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-082b146a"]]);
6
6
  export {
7
7
  _ as default
8
8
  };
@@ -1,26 +1,30 @@
1
- import { defineComponent as j, useAttrs as H, ref as d, toRef as r, watch as J, computed as $, openBlock as n, createElementBlock as i, Fragment as Q, normalizeClass as W, unref as u, createElementVNode as w, toDisplayString as G, createBlock as f, mergeProps as X, withKeys as h, withModifiers as q, createVNode as Y, createCommentVNode as c, renderSlot as R } from "vue";
2
- import { ScalarIcon as Z } from "@scalar/components";
3
- import { prettyPrintJson as _ } from "@scalar/oas-utils/helpers";
4
- import { useCodeMirror as ee, useDropdown as oe, colorPicker as le } from "@scalar/use-codemirror";
5
- import { useClipboard as te } from "@scalar/use-hooks/useClipboard";
6
- import { nanoid as ne } from "nanoid";
7
- import ae from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
8
- import V from "../DataTable/DataTableInputSelect.vue.js";
9
- import { pillPlugin as re, backspaceCommand as se } from "./codeVariableWidget.js";
10
- import { useLayout as ue } from "../../hooks/useLayout.js";
11
- const de = { class: "whitespace-nowrap" }, ie = ["id"], pe = {
1
+ import { defineComponent as H, useAttrs as J, ref as i, toRef as r, watch as Q, computed as $, openBlock as n, createElementBlock as u, Fragment as W, normalizeClass as G, unref as d, createElementVNode as m, toDisplayString as X, createBlock as y, mergeProps as Y, withKeys as g, withModifiers as q, createVNode as Z, createCommentVNode as f, createTextVNode as V, renderSlot as E } from "vue";
2
+ import { ScalarIcon as _ } from "@scalar/components";
3
+ import { prettyPrintJson as ee } from "@scalar/oas-utils/helpers";
4
+ import { useCodeMirror as oe, useDropdown as te, colorPicker as le } from "@scalar/use-codemirror";
5
+ import { useClipboard as ne } from "@scalar/use-hooks/useClipboard";
6
+ import { nanoid as ae } from "nanoid";
7
+ import re from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
8
+ import k from "../DataTable/DataTableInputSelect.vue.js";
9
+ import { pillPlugin as se, backspaceCommand as ue } from "./codeVariableWidget.js";
10
+ import { useLayout as de } from "../../hooks/useLayout.js";
11
+ const ie = { class: "whitespace-nowrap" }, pe = ["id"], me = {
12
12
  key: 0,
13
13
  class: "scalar-code-copy z-context"
14
- }, me = {
14
+ }, fe = {
15
+ key: 1,
16
+ class: "z-context text-c-2 absolute bottom-1 right-1.5 hidden font-sans group-has-[:focus-visible]/input:block",
17
+ role: "alert"
18
+ }, ce = {
15
19
  key: 5,
16
20
  class: "centered-y text-orange absolute right-7 text-xs"
17
- }, fe = {
21
+ }, be = {
18
22
  key: 6,
19
23
  class: "required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 pr-2 pt-px opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 group-[.alert]:bg-transparent group-[.error]:bg-transparent group-[.alert]:shadow-none group-[.error]:shadow-none peer-has-[.cm-focused]:opacity-0"
20
- }, ce = {
24
+ }, ye = {
21
25
  inheritAttrs: !1
22
- }, Se = /* @__PURE__ */ j({
23
- ...ce,
26
+ }, Pe = /* @__PURE__ */ H({
27
+ ...ye,
24
28
  __name: "CodeInput",
25
29
  props: {
26
30
  colorPicker: { type: Boolean, default: !1 },
@@ -51,12 +55,12 @@ const de = { class: "whitespace-nowrap" }, ie = ["id"], pe = {
51
55
  workspace: {}
52
56
  },
53
57
  emits: ["submit", "update:modelValue", "curl", "blur"],
54
- setup(A, { expose: E, emit: M }) {
55
- var P;
56
- const o = A, s = M, C = H(), N = C.id || `id-${ne()}`, B = d(!1), y = d(!1), k = d(""), S = d({ left: 0, top: 0 }), m = d(null), { layout: b } = ue(), { copyToClipboard: O } = te();
57
- function T(e) {
58
- var l;
59
- return e === o.modelValue ? null : o.importCurl && e.trim().toLowerCase().startsWith("curl") ? (s("curl", e), (l = a.value) == null || l.dispatch({
58
+ setup(I, { expose: N, emit: R }) {
59
+ var T;
60
+ const o = I, s = R, C = J(), A = C.id || `id-${ae()}`, B = i(!1), v = i(!1), x = i(""), S = i({ left: 0, top: 0 }), c = i(null), { layout: w } = de(), { copyToClipboard: M } = ne();
61
+ function O(e) {
62
+ var t;
63
+ return e === o.modelValue ? null : o.importCurl && e.trim().toLowerCase().startsWith("curl") ? (s("curl", e), (t = a.value) == null || t.dispatch({
60
64
  changes: {
61
65
  from: 0,
62
66
  to: a.value.state.doc.length,
@@ -64,31 +68,31 @@ const de = { class: "whitespace-nowrap" }, ie = ["id"], pe = {
64
68
  }
65
69
  }), null) : o.handleFieldChange ? o.handleFieldChange(e) : s("update:modelValue", e);
66
70
  }
67
- function x(e) {
71
+ function P(e) {
68
72
  return o.handleFieldSubmit ? o.handleFieldSubmit(e) : s("submit", e);
69
73
  }
70
- function I(e) {
71
- B.value = !1, o.emitOnBlur && o.modelValue && x(e), s("blur", e);
74
+ function K(e) {
75
+ B.value = !1, o.emitOnBlur && o.modelValue && P(e), s("blur", e);
72
76
  }
73
- const v = [];
74
- o.colorPicker && v.push(le), v.push(
75
- re({
77
+ const h = [];
78
+ o.colorPicker && h.push(le), h.push(
79
+ se({
76
80
  environment: o.environment,
77
81
  envVariables: o.envVariables,
78
82
  workspace: o.workspace,
79
- isReadOnly: b === "modal"
83
+ isReadOnly: w === "modal"
80
84
  }),
81
- se
85
+ ue
82
86
  );
83
- const D = d(null), { codeMirror: a } = ee({
87
+ const D = i(null), { codeMirror: a } = oe({
84
88
  content: r(
85
89
  () => o.modelValue !== void 0 ? String(o.modelValue) : ""
86
90
  ),
87
91
  onChange: (e) => {
88
- T(e), z();
92
+ O(e), L();
89
93
  },
90
94
  onFocus: () => B.value = !0,
91
- onBlur: (e) => I(e),
95
+ onBlur: (e) => K(e),
92
96
  codeMirrorRef: D,
93
97
  disableTabIndent: r(() => o.disableTabIndent),
94
98
  disableEnter: r(() => o.disableEnter),
@@ -96,112 +100,120 @@ const de = { class: "whitespace-nowrap" }, ie = ["id"], pe = {
96
100
  lineNumbers: r(() => o.lineNumbers),
97
101
  language: r(() => o.language),
98
102
  lint: r(() => o.lint),
99
- extensions: v,
103
+ extensions: h,
100
104
  placeholder: r(() => o.placeholder)
101
105
  });
102
- (P = a.value) == null || P.focus(), J(a, () => {
106
+ (T = a.value) == null || T.focus(), Q(a, () => {
103
107
  a.value && Object.prototype.hasOwnProperty.call(C, "autofocus") && a.value.focus();
104
108
  });
105
- const { handleDropdownSelect: K, updateDropdownVisibility: z } = oe({
109
+ const { handleDropdownSelect: z, updateDropdownVisibility: L } = te({
106
110
  codeMirror: a,
107
- query: k,
108
- showDropdown: y,
111
+ query: x,
112
+ showDropdown: v,
109
113
  dropdownPosition: S
110
- }), L = $(() => {
114
+ }), U = $(() => {
111
115
  var e;
112
116
  return o.type === "boolean" || (e = o.type) != null && e.includes("boolean") || o.nullable ? ["true", "false", "null"] : ["true", "false"];
113
117
  });
114
- E({
118
+ N({
115
119
  focus: () => {
116
120
  var e;
117
121
  (e = a.value) == null || e.focus();
118
122
  }
119
123
  });
120
- const g = (e, l) => {
121
- var p, t, F;
122
- y.value ? e === "down" ? (l.preventDefault(), (p = m.value) == null || p.handleArrowKey("down")) : e === "up" ? (l.preventDefault(), (t = m.value) == null || t.handleArrowKey("up")) : e === "enter" && (l.preventDefault(), (F = m.value) == null || F.handleSelect()) : e === "enter" && l.target instanceof HTMLDivElement && x(l.target.textContent ?? "");
123
- }, U = $(() => Array.isArray(o.type) ? (
124
+ const b = (e, t) => {
125
+ var p, l, F;
126
+ v.value ? e === "down" ? (t.preventDefault(), (p = c.value) == null || p.handleArrowKey("down")) : e === "up" ? (t.preventDefault(), (l = c.value) == null || l.handleArrowKey("up")) : e === "enter" && (t.preventDefault(), (F = c.value) == null || F.handleSelect()) : e === "escape" ? o.disableTabIndent || t.stopPropagation() : e === "enter" && t.target instanceof HTMLDivElement && P(t.target.textContent ?? "");
127
+ }, j = $(() => Array.isArray(o.type) ? (
124
128
  // Find the first type, that’s not 'null'
125
129
  o.type.find((e) => e !== "null") ?? "string"
126
130
  ) : (
127
131
  // If it’s not an array, just return the type
128
132
  o.type
129
133
  ));
130
- return (e, l) => {
134
+ return (e, t) => {
131
135
  var p;
132
- return n(), i(Q, null, [
133
- e.disabled ? (n(), i("div", {
136
+ return n(), u(W, null, [
137
+ e.disabled ? (n(), u("div", {
134
138
  key: 0,
135
- class: W(["text-c-2 flex cursor-default items-center justify-center", u(b) === "modal" ? "font-code pl-1 pr-2 text-sm" : "px-2"])
139
+ class: G(["text-c-2 flex cursor-default items-center justify-center", d(w) === "modal" ? "font-code pl-1 pr-2 text-sm" : "px-2"])
136
140
  }, [
137
- w("span", de, G(e.modelValue), 1)
138
- ], 2)) : o.enum && o.enum.length ? (n(), f(V, {
141
+ m("span", ie, X(e.modelValue), 1)
142
+ ], 2)) : o.enum && o.enum.length ? (n(), y(k, {
139
143
  key: 1,
140
144
  default: o.default,
141
145
  modelValue: e.modelValue,
142
- type: U.value,
146
+ type: j.value,
143
147
  value: o.enum,
144
- "onUpdate:modelValue": l[0] || (l[0] = (t) => s("update:modelValue", t))
145
- }, null, 8, ["default", "modelValue", "type", "value"])) : e.type === "boolean" || (p = e.type) != null && p.includes("boolean") ? (n(), f(V, {
148
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => s("update:modelValue", l))
149
+ }, null, 8, ["default", "modelValue", "type", "value"])) : e.type === "boolean" || (p = e.type) != null && p.includes("boolean") ? (n(), y(k, {
146
150
  key: 2,
147
151
  default: o.default,
148
152
  modelValue: e.modelValue,
149
- value: L.value,
150
- "onUpdate:modelValue": l[1] || (l[1] = (t) => s("update:modelValue", t))
151
- }, null, 8, ["default", "modelValue", "value"])) : o.examples && o.examples.length ? (n(), f(V, {
153
+ value: U.value,
154
+ "onUpdate:modelValue": t[1] || (t[1] = (l) => s("update:modelValue", l))
155
+ }, null, 8, ["default", "modelValue", "value"])) : o.examples && o.examples.length ? (n(), y(k, {
152
156
  key: 3,
153
157
  default: o.default,
154
158
  modelValue: o.modelValue,
155
159
  value: o.examples,
156
- "onUpdate:modelValue": l[2] || (l[2] = (t) => s("update:modelValue", t))
157
- }, null, 8, ["default", "modelValue", "value"])) : (n(), i("div", X({
160
+ "onUpdate:modelValue": t[2] || (t[2] = (l) => s("update:modelValue", l))
161
+ }, null, 8, ["default", "modelValue", "value"])) : (n(), u("div", Y({
158
162
  key: 4,
159
- id: u(N)
163
+ id: d(A)
160
164
  }, e.$attrs, {
161
165
  ref_key: "codeMirrorRef",
162
166
  ref: D,
163
- class: ["group-[.alert]:outline-orange group-[.error]:outline-red font-code peer relative w-full overflow-hidden whitespace-nowrap text-xs leading-[1.44] -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline", {
167
+ class: ["group/input group-[.alert]:outline-orange group-[.error]:outline-red font-code peer relative w-full overflow-hidden whitespace-nowrap text-xs leading-[1.44] -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline", {
164
168
  "flow-code-input--error": e.error
165
169
  }],
166
170
  onKeydown: [
167
- l[4] || (l[4] = h(q((t) => g("down", t), ["stop"]), ["down"])),
168
- l[5] || (l[5] = h((t) => g("enter", t), ["enter"])),
169
- l[6] || (l[6] = h(q((t) => g("up", t), ["stop"]), ["up"]))
171
+ t[4] || (t[4] = g(q((l) => b("down", l), ["stop"]), ["down"])),
172
+ t[5] || (t[5] = g((l) => b("enter", l), ["enter"])),
173
+ t[6] || (t[6] = g((l) => b("escape", l), ["escape"])),
174
+ t[7] || (t[7] = g(q((l) => b("up", l), ["stop"]), ["up"]))
170
175
  ]
171
176
  }), [
172
- e.isCopyable ? (n(), i("div", pe, [
173
- w("button", {
177
+ e.isCopyable ? (n(), u("div", me, [
178
+ m("button", {
174
179
  class: "copy-button",
175
180
  type: "button",
176
- onClick: l[3] || (l[3] = (t) => u(O)(u(_)(e.modelValue)))
181
+ onClick: t[3] || (t[3] = (l) => d(M)(d(ee)(e.modelValue)))
177
182
  }, [
178
- l[7] || (l[7] = w("span", { class: "sr-only" }, "Copy content", -1)),
179
- Y(u(Z), {
183
+ t[8] || (t[8] = m("span", { class: "sr-only" }, "Copy content", -1)),
184
+ Z(d(_), {
180
185
  icon: "Clipboard",
181
186
  size: "md"
182
187
  })
183
188
  ])
184
- ])) : c("", !0)
185
- ], 16, ie)),
186
- e.$slots.warning ? (n(), i("div", me, [
187
- R(e.$slots, "warning", {}, void 0, !0)
188
- ])) : c("", !0),
189
- R(e.$slots, "icon", {}, void 0, !0),
190
- e.required ? (n(), i("div", fe, " Required ")) : c("", !0),
191
- y.value && e.withVariables && u(b) !== "modal" && e.environment ? (n(), f(ae, {
189
+ ])) : f("", !0),
190
+ e.disableTabIndent ? f("", !0) : (n(), u("div", fe, t[9] || (t[9] = [
191
+ V(" Press "),
192
+ m("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Esc", -1),
193
+ V(" then "),
194
+ m("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Tab", -1),
195
+ V(" to exit ")
196
+ ])))
197
+ ], 16, pe)),
198
+ e.$slots.warning ? (n(), u("div", ce, [
199
+ E(e.$slots, "warning", {}, void 0, !0)
200
+ ])) : f("", !0),
201
+ E(e.$slots, "icon", {}, void 0, !0),
202
+ e.required ? (n(), u("div", be, " Required ")) : f("", !0),
203
+ v.value && e.withVariables && d(w) !== "modal" && e.environment ? (n(), y(re, {
192
204
  key: 7,
193
205
  ref_key: "dropdownRef",
194
- ref: m,
206
+ ref: c,
195
207
  dropdownPosition: S.value,
196
208
  envVariables: e.envVariables,
197
209
  environment: e.environment,
198
- query: k.value,
199
- onSelect: u(K)
200
- }, null, 8, ["dropdownPosition", "envVariables", "environment", "query", "onSelect"])) : c("", !0)
210
+ query: x.value,
211
+ onSelect: d(z)
212
+ }, null, 8, ["dropdownPosition", "envVariables", "environment", "query", "onSelect"])) : f("", !0)
201
213
  ], 64);
202
214
  };
203
215
  }
204
216
  });
205
217
  export {
206
- Se as default
218
+ Pe as default
207
219
  };
@@ -106,6 +106,7 @@ export declare const PaletteComponents: {
106
106
  }[] | undefined;
107
107
  requestBody?: any;
108
108
  responses?: Record<string, any> | undefined;
109
+ 'x-scalar-stability'?: unknown;
109
110
  method?: "options" | "connect" | "delete" | "get" | "head" | "patch" | "post" | "put" | "trace" | undefined;
110
111
  } & {
111
112
  url?: string;
@@ -154,6 +155,7 @@ export declare const PaletteComponents: {
154
155
  }[] | undefined;
155
156
  requestBody?: any;
156
157
  responses?: Record<string, any> | undefined;
158
+ 'x-scalar-stability'?: unknown;
157
159
  method?: "options" | "connect" | "delete" | "get" | "head" | "patch" | "post" | "put" | "trace" | undefined;
158
160
  } & {
159
161
  url?: string;