@scalar/api-client 2.1.16 → 2.1.18

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 (71) hide show
  1. package/CHANGELOG.md +22 -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 +67 -66
  5. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +3 -0
  6. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/CommandActionForm.vue.js +13 -11
  8. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +0 -2
  9. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/CommandActionInput.vue.js +36 -38
  11. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  12. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +100 -80
  13. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  14. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +24 -24
  15. package/dist/components/ContextBar.vue.js +2 -2
  16. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +2 -2
  17. package/dist/components/SideNav/SideNav.vue.js +2 -2
  18. package/dist/components/SideNav/SideNav.vue2.js +1 -1
  19. package/dist/components/TopNav/TopNav.vue.js +2 -2
  20. package/dist/components/TopNav/TopNav.vue2.js +11 -11
  21. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
  22. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  23. package/dist/layouts/App/ApiClientApp.vue.js +36 -40
  24. package/dist/layouts/App/hotkeys.d.ts +6 -0
  25. package/dist/layouts/App/hotkeys.d.ts.map +1 -0
  26. package/dist/layouts/App/hotkeys.js +21 -0
  27. package/dist/layouts/Web/ApiClientWeb.vue.d.ts +3 -0
  28. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -0
  29. package/dist/layouts/Web/ApiClientWeb.vue.js +54 -0
  30. package/dist/layouts/Web/ApiClientWeb.vue3.js +5 -0
  31. package/dist/layouts/Web/create-api-client-web.d.ts +3593 -0
  32. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -0
  33. package/dist/layouts/Web/create-api-client-web.js +18 -0
  34. package/dist/layouts/Web/index.d.ts +3 -0
  35. package/dist/layouts/Web/index.d.ts.map +1 -0
  36. package/dist/layouts/Web/index.js +7 -0
  37. package/dist/libs/event-busses/hot-keys-bus.d.ts +0 -1
  38. package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
  39. package/dist/libs/event-busses/hot-keys-bus.js +19 -35
  40. package/dist/libs/extractAttachmentFilename.d.ts +2 -0
  41. package/dist/libs/extractAttachmentFilename.d.ts.map +1 -0
  42. package/dist/libs/extractAttachmentFilename.js +20 -0
  43. package/dist/libs/getOpenApiDocumentDetails.d.ts +10 -0
  44. package/dist/libs/getOpenApiDocumentDetails.d.ts.map +1 -0
  45. package/dist/libs/getOpenApiDocumentDetails.js +40 -0
  46. package/dist/libs/index.d.ts +1 -2
  47. package/dist/libs/index.d.ts.map +1 -1
  48. package/dist/libs/index.js +21 -23
  49. package/dist/libs/isUrl.d.ts +1 -1
  50. package/dist/libs/isUrl.d.ts.map +1 -1
  51. package/dist/libs/isUrl.js +4 -3
  52. package/dist/store/import-spec.d.ts.map +1 -1
  53. package/dist/store/import-spec.js +21 -26
  54. package/dist/style.css +1 -1
  55. package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
  56. package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
  57. package/dist/views/Request/RequestSubpageHeader.vue2.js +2 -2
  58. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
  59. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +63 -55
  60. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts +2 -0
  61. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
  62. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +14 -14
  63. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  64. package/dist/views/Request/components/WorkspaceDropdown.vue.js +2 -2
  65. package/package.json +10 -6
  66. package/dist/libs/getOpenApiDocumentVersion.d.ts +0 -8
  67. package/dist/libs/getOpenApiDocumentVersion.d.ts.map +0 -1
  68. package/dist/libs/getOpenApiDocumentVersion.js +0 -20
  69. package/dist/libs/isDocument.d.ts +0 -3
  70. package/dist/libs/isDocument.d.ts.map +0 -1
  71. package/dist/libs/isDocument.js +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.1.18
4
+
5
+ ### Patch Changes
6
+
7
+ - 7c2e291: style: removes comamand palette command label + style fixtures
8
+ - 46a55ae: feat(api-client): improve client import ux
9
+ - 5d996a8: feat: download response with filename
10
+ - b26144c: fix(themes): remove variables from theme layer and move selection to default (base) theme
11
+ - Updated dependencies [46a55ae]
12
+ - Updated dependencies [b26144c]
13
+ - @scalar/oas-utils@0.2.53
14
+ - @scalar/themes@0.9.35
15
+ - @scalar/components@0.12.50
16
+
17
+ ## 2.1.17
18
+
19
+ ### Patch Changes
20
+
21
+ - 8396e92: style: updates overall alignments
22
+ - 6279c59: feat (api-client): remove tabs on client.scalar.com
23
+ - 5581a28: fix: displays address bar placeholder according to active server
24
+
3
25
  ## 2.1.16
4
26
 
5
27
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";AAiuBA,wBAKG"}
1
+ {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";AAouBA,wBAKG"}
@@ -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 f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1a9f572a"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-ef489963"]]);
5
5
  export {
6
- f as default
6
+ e as default
7
7
  };
@@ -1,112 +1,113 @@
1
- import { defineComponent as U, ref as i, watch as L, onMounted as O, onBeforeUnmount as A, unref as l, openBlock as K, createElementBlock as N, createElementVNode as o, createVNode as s, withCtx as w, normalizeClass as B, normalizeStyle as T, createCommentVNode as $, pushScopeId as D, popScopeId as P } from "vue";
2
- import Q from "../CodeInput/CodeInput.vue.js";
3
- import { Listbox as W } from "@headlessui/vue";
4
- import { ScalarButton as j, ScalarIcon as F } from "@scalar/components";
5
- import { REQUEST_METHODS as G } from "@scalar/oas-utils/helpers";
6
- import { isMacOS as J } from "@scalar/use-tooltip";
7
- import { useMagicKeys as X, whenever as Y } from "@vueuse/core";
8
- import Z from "../HttpMethod/HttpMethod.vue.js";
9
- import ee from "./AddressBarHistory.vue.js";
10
- import te from "./AddressBarServer.vue.js";
11
- import { executeRequestBus as k } from "../../libs/event-busses/execute-request-bus.js";
12
- import { useWorkspace as le } from "../../store/store.js";
13
- import { requestStatusBus as oe } from "../../libs/event-busses/request-status-bus.js";
14
- import { hotKeyBus as y } from "../../libs/event-busses/hot-keys-bus.js";
15
- const v = (d) => (D("data-v-1a9f572a"), d = d(), P(), d), ae = {
1
+ import { defineComponent as L, ref as i, watch as O, onMounted as A, onBeforeUnmount as K, unref as l, openBlock as N, createElementBlock as T, createElementVNode as o, createVNode as s, withCtx as w, normalizeClass as B, normalizeStyle as $, createCommentVNode as D, pushScopeId as P, popScopeId as Q } from "vue";
2
+ import W from "../CodeInput/CodeInput.vue.js";
3
+ import { Listbox as j } from "@headlessui/vue";
4
+ import { ScalarButton as F, ScalarIcon as G } from "@scalar/components";
5
+ import { REQUEST_METHODS as J } from "@scalar/oas-utils/helpers";
6
+ import { isMacOS as X } from "@scalar/use-tooltip";
7
+ import { useMagicKeys as Y, whenever as Z } from "@vueuse/core";
8
+ import ee from "../HttpMethod/HttpMethod.vue.js";
9
+ import te from "./AddressBarHistory.vue.js";
10
+ import le from "./AddressBarServer.vue.js";
11
+ import { executeRequestBus as S } from "../../libs/event-busses/execute-request-bus.js";
12
+ import { useWorkspace as oe } from "../../store/store.js";
13
+ import { requestStatusBus as ae } from "../../libs/event-busses/request-status-bus.js";
14
+ import { hotKeyBus as k } from "../../libs/event-busses/hot-keys-bus.js";
15
+ const v = (d) => (P("data-v-ef489963"), d = d(), Q(), d), re = {
16
16
  key: 0,
17
17
  class: "order-last lg:order-none lg:w-auto w-full"
18
- }, re = { class: "m-auto flex flex-row items-center" }, se = { class: "pointer-events-none absolute left-0 top-0 z-10 block h-full w-full overflow-hidden" }, ne = { class: "flex gap-1" }, ie = { class: "codemirror-bg-switcher scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, ue = /* @__PURE__ */ v(() => /* @__PURE__ */ o("div", { class: "fade-left" }, null, -1)), de = /* @__PURE__ */ v(() => /* @__PURE__ */ o("div", { class: "fade-right" }, null, -1)), fe = /* @__PURE__ */ v(() => /* @__PURE__ */ o("span", { class: "text-xxs relative z-10 lg:flex hidden" }, "Send", -1)), qe = /* @__PURE__ */ U({
18
+ }, se = { class: "m-auto flex flex-row items-center" }, ne = { class: "pointer-events-none absolute left-0 top-0 z-10 block h-full w-full overflow-hidden" }, ie = { class: "flex gap-1" }, ue = { class: "codemirror-bg-switcher scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, de = /* @__PURE__ */ v(() => /* @__PURE__ */ o("div", { class: "fade-left" }, null, -1)), ce = /* @__PURE__ */ v(() => /* @__PURE__ */ o("div", { class: "fade-right" }, null, -1)), fe = /* @__PURE__ */ v(() => /* @__PURE__ */ o("span", { class: "text-xxs relative z-10 lg:flex hidden" }, "Send", -1)), Ce = /* @__PURE__ */ L({
19
19
  __name: "AddressBar",
20
20
  setup(d) {
21
21
  const {
22
22
  activeRequest: t,
23
- activeExample: S,
23
+ activeExample: y,
24
+ activeServer: q,
24
25
  isReadOnly: m,
25
- requestMutators: c,
26
- requestHistory: q
27
- } = le(), p = i(q[0]), h = i(null), _ = X();
28
- Y(
29
- J() ? _.meta_enter : _.ctrl_enter,
30
- () => k.emit()
26
+ requestMutators: f,
27
+ requestHistory: C
28
+ } = oe(), p = i(C[0]), h = i(null), _ = Y();
29
+ Z(
30
+ X() ? _.meta_enter : _.ctrl_enter,
31
+ () => S.emit()
31
32
  );
32
- const C = (e) => {
33
- !t.value || t.value.path === e || c.edit(t.value.uid, "path", e);
33
+ const E = (e) => {
34
+ !t.value || t.value.path === e || f.edit(t.value.uid, "path", e);
34
35
  };
35
- L(
36
+ O(
36
37
  () => {
37
38
  var e;
38
39
  return (e = t.value) == null ? void 0 : e.path;
39
40
  },
40
41
  (e) => {
41
- !t.value || !e || C(e);
42
+ !t.value || !e || E(e);
42
43
  }
43
44
  );
44
45
  const a = i(100), x = i(0), r = i(!1), n = i();
45
- function E() {
46
- r.value ? a.value -= (a.value - 15) / 60 : a.value -= x.value / 20, a.value <= 0 && (clearInterval(n.value), n.value = void 0, a.value = 100, r.value = !1);
47
- }
48
46
  function R() {
49
- n.value || (r.value = !0, n.value = setInterval(E, 20));
47
+ r.value ? a.value -= (a.value - 15) / 60 : a.value -= x.value / 20, a.value <= 0 && (clearInterval(n.value), n.value = void 0, a.value = 100, r.value = !1);
50
48
  }
51
49
  function I() {
52
- x.value = a.value, r.value = !1;
50
+ n.value || (r.value = !0, n.value = setInterval(R, 20));
53
51
  }
54
52
  function V() {
53
+ x.value = a.value, r.value = !1;
54
+ }
55
+ function z() {
55
56
  clearInterval(n.value), n.value = void 0, a.value = 100, r.value = !1;
56
57
  }
57
- oe.on((e) => {
58
- e === "start" && R(), e === "stop" && I(), e === "abort" && V();
58
+ ae.on((e) => {
59
+ e === "start" && I(), e === "stop" && V(), e === "abort" && z();
59
60
  });
60
- function z(e) {
61
- t.value && c.edit(t.value.uid, "method", e);
61
+ function M(e) {
62
+ t.value && f.edit(t.value.uid, "method", e);
62
63
  }
63
- function M() {
64
+ function H() {
64
65
  if (!t.value) return;
65
66
  const { method: e } = t.value;
66
- return G[e].backgroundColor;
67
+ return J[e].backgroundColor;
67
68
  }
68
69
  function b() {
69
- r.value || (r.value = !0, k.emit());
70
+ r.value || (r.value = !0, S.emit());
70
71
  }
71
- function H(e) {
72
- t.value && c.edit(t.value.uid, "path", e);
72
+ function U(e) {
73
+ t.value && f.edit(t.value.uid, "path", e);
73
74
  }
74
75
  function g(e) {
75
76
  var u;
76
77
  e.focusAddressBar && ((u = h.value) == null || u.focus());
77
78
  }
78
- return O(() => y.on(g)), A(() => y.off(g)), (e, u) => l(t) && l(S) ? (K(), N("div", ae, [
79
- o("div", re, [
80
- s(l(W), {
79
+ return A(() => k.on(g)), K(() => k.off(g)), (e, u) => l(t) && l(y) ? (N(), T("div", re, [
80
+ o("div", se, [
81
+ s(l(j), {
81
82
  modelValue: p.value,
82
- "onUpdate:modelValue": u[0] || (u[0] = (f) => p.value = f)
83
+ "onUpdate:modelValue": u[0] || (u[0] = (c) => p.value = c)
83
84
  }, {
84
- default: w(({ open: f }) => [
85
+ default: w(({ open: c }) => [
85
86
  o("div", {
86
87
  class: B([
87
88
  "addressbar-bg-states text-xxs relative flex w-full lg:min-w-[720px] lg:max-w-[720px] order-last overflow-hidden lg:order-none flex-1 flex-row items-stretch rounded-lg border-1/2 p-[3px]",
88
- { "border-transparent overflow-visible rounded-b-none": f }
89
+ { "border-transparent overflow-visible rounded-b-none": c }
89
90
  ])
90
91
  }, [
91
- o("div", se, [
92
+ o("div", ne, [
92
93
  o("div", {
93
- class: B(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 h-full w-full", M()]),
94
- style: T({ transform: `translate3d(-${a.value}%,0,0)` })
94
+ class: B(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 h-full w-full", H()]),
95
+ style: $({ transform: `translate3d(-${a.value}%,0,0)` })
95
96
  }, null, 6)
96
97
  ]),
97
- o("div", ne, [
98
- s(Z, {
98
+ o("div", ie, [
99
+ s(ee, {
99
100
  isEditable: !l(m),
100
101
  isSquare: "",
101
102
  method: l(t).method,
102
103
  teleport: ".scalar-client",
103
- onChange: z
104
+ onChange: M
104
105
  }, null, 8, ["isEditable", "method"])
105
106
  ]),
106
- o("div", ie, [
107
- ue,
108
- s(te),
109
- s(Q, {
107
+ o("div", ue, [
108
+ de,
109
+ s(le),
110
+ s(W, {
110
111
  ref_key: "addressBarRef",
111
112
  ref: h,
112
113
  disableCloseBrackets: "",
@@ -115,21 +116,21 @@ const v = (d) => (D("data-v-1a9f572a"), d = d(), P(), d), ae = {
115
116
  disableTabIndent: "",
116
117
  emitOnBlur: !1,
117
118
  modelValue: l(t).path,
118
- placeholder: "Enter URL to get started",
119
+ placeholder: l(q) ? "" : "Enter URL to get started",
119
120
  server: "",
120
121
  onSubmit: b,
121
- "onUpdate:modelValue": H
122
- }, null, 8, ["disabled", "modelValue"]),
123
- de
122
+ "onUpdate:modelValue": U
123
+ }, null, 8, ["disabled", "modelValue", "placeholder"]),
124
+ ce
124
125
  ]),
125
- s(ee, { open: f }, null, 8, ["open"]),
126
- s(l(j), {
126
+ s(te, { open: c }, null, 8, ["open"]),
127
+ s(l(F), {
127
128
  class: "relative h-auto shrink-0 gap-1 overflow-hidden pl-2 pr-2.5 py-1 z-[1] font-bold",
128
129
  disabled: r.value,
129
130
  onClick: b
130
131
  }, {
131
132
  default: w(() => [
132
- s(l(F), {
133
+ s(l(G), {
133
134
  class: "relative z-10 shrink-0 fill-current",
134
135
  icon: "Play",
135
136
  size: "xs"
@@ -143,9 +144,9 @@ const v = (d) => (D("data-v-1a9f572a"), d = d(), P(), d), ae = {
143
144
  _: 1
144
145
  }, 8, ["modelValue"])
145
146
  ])
146
- ])) : $("", !0);
147
+ ])) : D("", !0);
147
148
  }
148
149
  });
149
150
  export {
150
- qe as default
151
+ Ce as default
151
152
  };
@@ -1,15 +1,18 @@
1
+ import { type useLoadingState } from '@scalar/components';
1
2
  declare function __VLS_template(): {
2
3
  default?(_: {}): any;
3
4
  options?(_: {}): any;
4
5
  submit?(_: {}): any;
5
6
  };
6
7
  declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<{
8
+ loading?: ReturnType<typeof useLoadingState>;
7
9
  disabled?: boolean;
8
10
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
11
  submit: () => void;
10
12
  cancel: () => void;
11
13
  back: (e: KeyboardEvent) => void;
12
14
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
15
+ loading?: ReturnType<typeof useLoadingState>;
13
16
  disabled?: boolean;
14
17
  }>>> & {
15
18
  onSubmit?: (() => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"CommandActionForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandActionForm.vue"],"names":[],"mappings":"AAyDA,iBAAS,cAAc;qBA8DM,GAAG;qBACH,GAAG;oBACJ,GAAG;EAgB9B;AACD,QAAA,MAAM,eAAe;eAjGR,OAAO;;;;;;eAAP,OAAO;;;;;UAwGlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"CommandActionForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandActionForm.vue"],"names":[],"mappings":"AAsCA,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAsBvE,iBAAS,cAAc;qBA+DM,GAAG;qBACH,GAAG;oBACJ,GAAG;EAgB9B;AACD,QAAA,MAAM,eAAe;cAnGT,UAAU,CAAC,OAAO,eAAe,CAAC;eACjC,OAAO;;;;;;cADR,UAAU,CAAC,OAAO,eAAe,CAAC;eACjC,OAAO;;;;;UAyGlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,28 +1,30 @@
1
- import { defineComponent as n, openBlock as i, createElementBlock as a, withKeys as d, withModifiers as l, createElementVNode as o, renderSlot as s, createVNode as r, unref as m, withCtx as p, createTextVNode as f } from "vue";
1
+ import { defineComponent as n, openBlock as i, createElementBlock as a, withKeys as d, withModifiers as l, createElementVNode as t, renderSlot as s, createVNode as r, unref as m, withCtx as p, createTextVNode as f } from "vue";
2
2
  import { ScalarButton as u } from "@scalar/components";
3
- const c = { class: "gap-3 rounded min-h-20 relative" }, b = { class: "flex gap-2" }, x = { class: "flex flex-1 max-h-8" }, $ = /* @__PURE__ */ n({
3
+ const c = { class: "flex flex-col rounded min-h-20 relative" }, b = { class: "flex gap-2" }, x = { class: "flex flex-1 max-h-8" }, _ = /* @__PURE__ */ n({
4
4
  __name: "CommandActionForm",
5
5
  props: {
6
+ loading: {},
6
7
  disabled: { type: Boolean }
7
8
  },
8
9
  emits: ["submit", "cancel", "back"],
9
- setup(h) {
10
- return (e, t) => (i(), a("form", {
10
+ setup(g) {
11
+ return (e, o) => (i(), a("form", {
11
12
  class: "flex w-full flex-col gap-3",
12
- onKeydown: t[0] || (t[0] = d(l(() => {
13
+ onKeydown: o[0] || (o[0] = d(l(() => {
13
14
  }, ["stop"]), ["enter"])),
14
- onSubmit: t[1] || (t[1] = l((v) => e.$emit("submit"), ["prevent", "stop"]))
15
+ onSubmit: o[1] || (o[1] = l((h) => e.$emit("submit"), ["prevent", "stop"]))
15
16
  }, [
16
- o("div", c, [
17
+ t("div", c, [
17
18
  s(e.$slots, "default")
18
19
  ]),
19
- o("div", b, [
20
- o("div", x, [
20
+ t("div", b, [
21
+ t("div", x, [
21
22
  s(e.$slots, "options")
22
23
  ]),
23
24
  r(m(u), {
24
25
  class: "max-h-8 text-xs p-0 px-3",
25
26
  disabled: e.disabled,
27
+ loading: e.loading,
26
28
  type: "submit"
27
29
  }, {
28
30
  default: p(() => [
@@ -31,11 +33,11 @@ const c = { class: "gap-3 rounded min-h-20 relative" }, b = { class: "flex gap-2
31
33
  ])
32
34
  ]),
33
35
  _: 3
34
- }, 8, ["disabled"])
36
+ }, 8, ["disabled", "loading"])
35
37
  ])
36
38
  ], 32));
37
39
  }
38
40
  });
39
41
  export {
40
- $ as default
42
+ _ as default
41
43
  };
@@ -4,12 +4,10 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
4
4
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
5
  "update:modelValue": (v: string) => void;
6
6
  onDelete: (event: KeyboardEvent) => void;
7
- paste: (event: ClipboardEvent) => void;
8
7
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
9
8
  modelValue?: string;
10
9
  placeholder?: string;
11
10
  }>>> & {
12
- onPaste?: ((event: ClipboardEvent) => any) | undefined;
13
11
  "onUpdate:modelValue"?: ((v: string) => any) | undefined;
14
12
  onOnDelete?: ((event: KeyboardEvent) => any) | undefined;
15
13
  }, {}, {}>;
@@ -1 +1 @@
1
- {"version":3,"file":"CommandActionInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandActionInput.vue"],"names":[],"mappings":";iBA6De,MAAM;kBACL,MAAM;;;;;;iBADP,MAAM;kBACL,MAAM;;;;;;AAoGtB,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"CommandActionInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandActionInput.vue"],"names":[],"mappings":";iBA0De,MAAM;kBACL,MAAM;;;;;iBADP,MAAM;kBACL,MAAM;;;;;AAiGtB,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,51 +1,49 @@
1
- import { defineComponent as f, ref as h, onMounted as y, nextTick as v, computed as w, openBlock as V, createElementBlock as k, Fragment as g, createElementVNode as u, unref as d, withDirectives as x, mergeProps as D, withKeys as _, withModifiers as b, vModelDynamic as B } from "vue";
2
- import { nanoid as M } from "nanoid";
3
- const P = ["for"], A = ["id", "placeholder"], K = /* @__PURE__ */ f({
1
+ import { defineComponent as f, ref as c, onMounted as h, nextTick as g, computed as v, withDirectives as w, openBlock as x, createElementBlock as k, mergeProps as y, withKeys as s, vModelText as D } from "vue";
2
+ const E = ["placeholder"], b = /* @__PURE__ */ f({
4
3
  inheritAttrs: !1,
5
4
  __name: "CommandActionInput",
6
5
  props: {
7
6
  modelValue: {},
8
7
  placeholder: {}
9
8
  },
10
- emits: ["update:modelValue", "onDelete", "paste"],
9
+ emits: ["update:modelValue", "onDelete"],
11
10
  setup(i, { emit: p }) {
12
- const r = i, l = p, a = M(), s = h(null);
13
- y(() => v(() => {
11
+ const l = i, r = p, a = c(null);
12
+ h(() => g(() => {
14
13
  var e;
15
- return (e = s.value) == null ? void 0 : e.focus();
14
+ return (e = a.value) == null ? void 0 : e.focus();
16
15
  }));
17
- const n = w({
18
- get: () => r.modelValue ?? "",
19
- set: (e) => l("update:modelValue", e)
20
- }), m = (e) => {
21
- n.value === "" && l("onDelete", e);
22
- }, c = (e) => {
23
- l("paste", e);
24
- };
25
- return (e, t) => (V(), k(g, null, [
26
- u("label", {
27
- class: "absolute w-full h-full opacity-0 cursor-text",
28
- for: d(a)
29
- }, null, 8, P),
30
- x(u("input", D({
31
- id: d(a),
32
- ref_key: "input",
33
- ref: s,
34
- "onUpdate:modelValue": t[0] || (t[0] = (o) => n.value = o),
35
- autocomplete: "off",
36
- class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
37
- "data-form-type": "other",
38
- "data-lpignore": "true",
39
- placeholder: r.placeholder
40
- }, e.$attrs, {
41
- onKeydown: t[1] || (t[1] = _(b((o) => m(o), ["stop"]), ["delete"])),
42
- onPaste: t[2] || (t[2] = (o) => c(o))
43
- }), null, 16, A), [
44
- [B, n.value]
45
- ])
46
- ], 64));
16
+ const o = v({
17
+ get: () => l.modelValue ?? "",
18
+ set: (e) => r("update:modelValue", e)
19
+ });
20
+ function d(e) {
21
+ var u;
22
+ if (e.shiftKey || !e.target) return;
23
+ e.preventDefault();
24
+ const t = e.target, n = new Event("submit", { cancelable: !0 });
25
+ (u = t.form) == null || u.dispatchEvent(n);
26
+ }
27
+ function m(e) {
28
+ o.value === "" && (e.preventDefault(), e.stopPropagation(), r("onDelete", e));
29
+ }
30
+ return (e, t) => w((x(), k("textarea", y({
31
+ ref_key: "input",
32
+ ref: a,
33
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => o.value = n),
34
+ class: "border-none outline-none flex-1 w-full pl-8 text-sm min-h-8 py-1.5 resize-none",
35
+ placeholder: l.placeholder,
36
+ wrap: "hard"
37
+ }, e.$attrs, {
38
+ onKeydown: [
39
+ t[1] || (t[1] = s((n) => m(n), ["delete"])),
40
+ t[2] || (t[2] = s((n) => d(n), ["enter"]))
41
+ ]
42
+ }), null, 16, E)), [
43
+ [D, o.value]
44
+ ]);
47
45
  }
48
46
  });
49
47
  export {
50
- K as default
48
+ b as default
51
49
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AA0bA,wBAMG"}
1
+ {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AA6eA,wBAMG"}