@scalar/api-client 2.1.17 → 2.1.19

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 (194) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts +5 -1
  3. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  4. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  5. package/dist/components/AddressBar/AddressBar.vue2.js +78 -75
  6. package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
  7. package/dist/components/AddressBar/AddressBarHistory.vue2.js +8 -8
  8. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  9. package/dist/components/AddressBar/AddressBarServer.vue.js +6 -6
  10. package/dist/components/CodeInput/CodeInput.vue.d.ts +6 -2
  11. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  12. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  13. package/dist/components/CodeInput/CodeInput.vue2.js +57 -49
  14. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +3 -0
  15. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
  16. package/dist/components/CommandPalette/CommandActionForm.vue.js +13 -11
  17. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +0 -2
  18. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
  19. package/dist/components/CommandPalette/CommandActionInput.vue.js +36 -38
  20. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts +1 -1
  21. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
  22. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts +1 -1
  23. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  24. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +100 -80
  25. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +1 -1
  26. package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts +1 -1
  27. package/dist/components/CommandPalette/CommandPaletteTag.vue.d.ts +1 -1
  28. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts +1 -1
  29. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +7 -7
  30. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  31. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  32. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +42 -42
  33. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  34. package/dist/components/ContextBar.vue.js +2 -2
  35. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts +19 -3
  36. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  37. package/dist/components/DataTable/DataTableCheckbox.vue.js +27 -14
  38. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  39. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +8 -8
  40. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  41. package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts +39 -0
  42. package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts.map +1 -0
  43. package/dist/components/ImportCurl/ImportCurlModal.vue.js +7 -0
  44. package/dist/components/ImportCurl/ImportCurlModal.vue2.js +88 -0
  45. package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -1
  46. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  47. package/dist/components/SideNav/SideNav.vue.js +1 -1
  48. package/dist/components/SideNav/SideNav.vue2.js +37 -26
  49. package/dist/components/SideNav/SideNavLink.vue.d.ts +2 -2
  50. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  51. package/dist/components/SideNav/SideNavLink.vue.js +10 -11
  52. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts +1 -1
  53. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  54. package/dist/components/Sidebar/Sidebar.vue.js +1 -1
  55. package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
  56. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  57. package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
  58. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +24 -3
  59. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  60. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  61. package/dist/components/Sidebar/SidebarListElement.vue2.js +26 -22
  62. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts +4 -0
  63. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  64. package/dist/components/Sidebar/SidebarListElementActions.vue.js +35 -32
  65. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  66. package/dist/components/TopNav/TopNav.vue.js +1 -1
  67. package/dist/components/TopNav/TopNav.vue2.js +1 -1
  68. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  69. package/dist/components/ViewLayout/ViewLayout.vue.js +7 -7
  70. package/dist/components/ViewLayout/ViewLayoutContent.vue.d.ts.map +1 -1
  71. package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -1
  72. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  73. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +11 -11
  74. package/dist/constants.d.ts +4 -0
  75. package/dist/constants.d.ts.map +1 -1
  76. package/dist/constants.js +2 -1
  77. package/dist/hooks/useDarkModeState.d.ts +4 -3
  78. package/dist/hooks/useDarkModeState.d.ts.map +1 -1
  79. package/dist/hooks/useDarkModeState.js +36 -21
  80. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  81. package/dist/layouts/App/ApiClientApp.vue.js +34 -41
  82. package/dist/layouts/App/create-api-client-app.d.ts +35 -32
  83. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  84. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  85. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  86. package/dist/layouts/Modal/ApiClientModal.vue2.js +6 -6
  87. package/dist/layouts/Modal/create-api-client-modal.d.ts +70 -64
  88. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  89. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  90. package/dist/layouts/Web/ApiClientWeb.vue.js +35 -42
  91. package/dist/layouts/Web/create-api-client-web.d.ts +35 -32
  92. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  93. package/dist/libs/create-client.d.ts +35 -32
  94. package/dist/libs/create-client.d.ts.map +1 -1
  95. package/dist/libs/event-busses/hot-keys-bus.d.ts +1 -1
  96. package/dist/libs/extractAttachmentFilename.d.ts +2 -0
  97. package/dist/libs/extractAttachmentFilename.d.ts.map +1 -0
  98. package/dist/libs/extractAttachmentFilename.js +20 -0
  99. package/dist/libs/getOpenApiDocumentDetails.d.ts +10 -0
  100. package/dist/libs/getOpenApiDocumentDetails.d.ts.map +1 -0
  101. package/dist/libs/getOpenApiDocumentDetails.js +40 -0
  102. package/dist/libs/importers/curl.d.ts +3 -0
  103. package/dist/libs/importers/curl.d.ts.map +1 -0
  104. package/dist/libs/importers/curl.js +61 -0
  105. package/dist/libs/importers/index.d.ts +2 -0
  106. package/dist/libs/importers/index.d.ts.map +1 -0
  107. package/dist/libs/importers/index.js +4 -0
  108. package/dist/libs/index.d.ts +2 -2
  109. package/dist/libs/index.d.ts.map +1 -1
  110. package/dist/libs/index.js +22 -22
  111. package/dist/libs/isUrl.d.ts +1 -1
  112. package/dist/libs/isUrl.d.ts.map +1 -1
  113. package/dist/libs/isUrl.js +4 -3
  114. package/dist/libs/parse-curl.d.ts +12 -0
  115. package/dist/libs/parse-curl.d.ts.map +1 -0
  116. package/dist/libs/parse-curl.js +70 -0
  117. package/dist/router.d.ts +2 -1
  118. package/dist/router.d.ts.map +1 -1
  119. package/dist/router.js +33 -24
  120. package/dist/store/collections.d.ts +4 -4
  121. package/dist/store/cookies.d.ts +4 -4
  122. package/dist/store/environment.d.ts +4 -4
  123. package/dist/store/import-spec.d.ts.map +1 -1
  124. package/dist/store/import-spec.js +21 -26
  125. package/dist/store/request-example.d.ts +4 -4
  126. package/dist/store/requests.d.ts +4 -4
  127. package/dist/store/router-params.d.ts +1 -0
  128. package/dist/store/router-params.d.ts.map +1 -1
  129. package/dist/store/router-params.js +2 -1
  130. package/dist/store/servers.d.ts +4 -4
  131. package/dist/store/store.d.ts +70 -64
  132. package/dist/store/store.d.ts.map +1 -1
  133. package/dist/store/store.js +126 -119
  134. package/dist/store/tags.d.ts +4 -4
  135. package/dist/store/workspace.d.ts +4 -4
  136. package/dist/style.css +1 -1
  137. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  138. package/dist/views/Cookies/Cookies.vue2.js +18 -18
  139. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  140. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +9 -9
  141. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  142. package/dist/views/Request/Request.vue.js +1 -1
  143. package/dist/views/Request/Request.vue2.js +146 -96
  144. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  145. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  146. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +1 -1
  147. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  148. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +4 -4
  149. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  150. package/dist/views/Request/RequestSidebar.vue.js +3 -3
  151. package/dist/views/Request/RequestSidebar.vue2.js +2 -2
  152. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  153. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  154. package/dist/views/Request/RequestSidebarItem.vue2.js +49 -49
  155. package/dist/views/Request/RequestSubpageHeader.vue.d.ts +2 -0
  156. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  157. package/dist/views/Request/RequestSubpageHeader.vue.js +4 -4
  158. package/dist/views/Request/RequestSubpageHeader.vue2.js +17 -15
  159. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
  160. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +63 -55
  161. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts +2 -0
  162. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
  163. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +14 -14
  164. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  165. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  166. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +1 -1
  167. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +1 -1
  168. package/dist/views/Settings/Settings.vue.d.ts +4 -0
  169. package/dist/views/Settings/Settings.vue.d.ts.map +1 -0
  170. package/dist/views/Settings/Settings.vue.js +4 -0
  171. package/dist/views/Settings/Settings.vue2.js +59 -0
  172. package/dist/{components/DarkModeToggle/DarkModeIconToggle.vue.d.ts → views/Settings/SettingsGeneral.vue.d.ts} +1 -1
  173. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -0
  174. package/dist/views/Settings/SettingsGeneral.vue.js +124 -0
  175. package/dist/views/Settings/SettingsGeneral.vue2.js +4 -0
  176. package/dist/views/Settings/SettingsGeneralMode.vue.d.ts +3 -0
  177. package/dist/views/Settings/SettingsGeneralMode.vue.d.ts.map +1 -0
  178. package/dist/views/Settings/SettingsGeneralMode.vue.js +78 -0
  179. package/dist/views/Settings/SettingsGeneralMode.vue2.js +4 -0
  180. package/package.json +60 -36
  181. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +0 -1
  182. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +0 -31
  183. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue2.js +0 -4
  184. package/dist/components/DarkModeToggle/index.d.ts +0 -2
  185. package/dist/components/DarkModeToggle/index.d.ts.map +0 -1
  186. package/dist/components/DarkModeToggle/index.js +0 -4
  187. package/dist/components/ScreenReader.vue.js +0 -7
  188. package/dist/components/ScreenReader.vue2.js +0 -18
  189. package/dist/libs/getOpenApiDocumentVersion.d.ts +0 -8
  190. package/dist/libs/getOpenApiDocumentVersion.d.ts.map +0 -1
  191. package/dist/libs/getOpenApiDocumentVersion.js +0 -20
  192. package/dist/libs/isDocument.d.ts +0 -3
  193. package/dist/libs/isDocument.d.ts.map +0 -1
  194. package/dist/libs/isDocument.js +0 -7
@@ -1,9 +1,9 @@
1
- import { defineComponent as T, useAttrs as A, ref as a, toRef as l, watch as U, computed as _, openBlock as t, createElementBlock as s, Fragment as j, createBlock as c, mergeProps as Q, unref as r, renderSlot as C, createCommentVNode as m } from "vue";
2
- import { useCodeMirror as W, useDropdown as z, colorPicker as G } from "@scalar/use-codemirror";
3
- import { nanoid as H } from "nanoid";
1
+ import { defineComponent as T, useAttrs as A, ref as u, toRef as t, watch as U, computed as C, openBlock as a, createElementBlock as s, Fragment as W, createBlock as p, mergeProps as j, unref as i, renderSlot as _, createCommentVNode as m } from "vue";
2
+ import { useCodeMirror as L, useDropdown as Q, colorPicker as z } from "@scalar/use-codemirror";
3
+ import { nanoid as G } from "nanoid";
4
4
  import x from "../DataTable/DataTableInputSelect.vue.js";
5
- import { pillPlugin as J, backspaceCommand as K } from "./codeVariableWidget.js";
6
- import L from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
5
+ import { pillPlugin as H, backspaceCommand as J } from "./codeVariableWidget.js";
6
+ import K from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
7
7
  import { useWorkspace as X } from "../../store/store.js";
8
8
  const Y = ["id"], Z = {
9
9
  key: 3,
@@ -34,32 +34,40 @@ const Y = ["id"], Z = {
34
34
  enum: {},
35
35
  type: {},
36
36
  nullable: { type: Boolean, default: !1 },
37
- withVariables: { type: Boolean, default: !0 }
37
+ withVariables: { type: Boolean, default: !0 },
38
+ importCurl: { type: Boolean }
38
39
  },
39
- emits: ["submit", "update:modelValue"],
40
- setup(F, { expose: P, emit: S }) {
40
+ emits: ["submit", "update:modelValue", "curl"],
41
+ setup(S, { expose: F, emit: P }) {
41
42
  var B;
42
- const e = F, u = S, f = A(), q = f.id || `id-${H()}`, b = a(!1), y = a(!1), h = a(""), v = a({ left: 0, top: 0 }), { activeEnvVariables: g, isReadOnly: V, environments: E, router: $ } = X();
43
+ const e = S, r = P, f = A(), q = f.id || `id-${G()}`, b = u(!1), h = u(!1), y = u(""), v = u({ left: 0, top: 0 }), { activeEnvVariables: g, isReadOnly: V, environments: E, router: $ } = X();
43
44
  function O(o) {
44
- return o === e.modelValue ? null : e.handleFieldChange ? e.handleFieldChange(o) : u("update:modelValue", o);
45
+ var n;
46
+ return o === e.modelValue ? null : e.importCurl && o.trim().toLowerCase().startsWith("curl") ? (r("curl", o), (n = l.value) == null || n.dispatch({
47
+ changes: {
48
+ from: 0,
49
+ to: l.value.state.doc.length,
50
+ insert: String(e.modelValue)
51
+ }
52
+ }), null) : e.handleFieldChange ? e.handleFieldChange(o) : r("update:modelValue", o);
45
53
  }
46
54
  function R(o) {
47
- return e.handleFieldSubmit ? e.handleFieldSubmit(o) : u("submit", o);
55
+ return e.handleFieldSubmit ? e.handleFieldSubmit(o) : r("submit", o);
48
56
  }
49
57
  function D(o) {
50
58
  b.value = !1, e.emitOnBlur && e.modelValue && R(o);
51
59
  }
52
60
  const d = [];
53
- e.colorPicker && d.push(G), d.push(
54
- J({
61
+ e.colorPicker && d.push(z), d.push(
62
+ H({
55
63
  environments: E,
56
64
  activeEnvVariables: g,
57
65
  isReadOnly: V
58
66
  }),
59
- K
67
+ J
60
68
  );
61
- const w = a(null), { codeMirror: n } = W({
62
- content: l(
69
+ const w = u(null), { codeMirror: l } = L({
70
+ content: t(
63
71
  () => e.modelValue !== void 0 ? String(e.modelValue) : ""
64
72
  ),
65
73
  onChange: (o) => {
@@ -68,48 +76,48 @@ const Y = ["id"], Z = {
68
76
  onFocus: () => b.value = !0,
69
77
  onBlur: (o) => D(o),
70
78
  codeMirrorRef: w,
71
- disableTabIndent: l(() => e.disableTabIndent),
72
- disableEnter: l(() => e.disableEnter),
73
- disableCloseBrackets: l(() => e.disableCloseBrackets),
74
- lineNumbers: l(() => e.lineNumbers),
75
- language: l(() => e.language),
76
- lint: l(() => e.lint),
79
+ disableTabIndent: t(() => e.disableTabIndent),
80
+ disableEnter: t(() => e.disableEnter),
81
+ disableCloseBrackets: t(() => e.disableCloseBrackets),
82
+ lineNumbers: t(() => e.lineNumbers),
83
+ language: t(() => e.language),
84
+ lint: t(() => e.lint),
77
85
  extensions: d,
78
- placeholder: l(() => e.placeholder)
86
+ placeholder: t(() => e.placeholder)
79
87
  });
80
- (B = n.value) == null || B.focus(), U(n, () => {
81
- n.value && Object.prototype.hasOwnProperty.call(f, "autofocus") && n.value.focus();
88
+ (B = l.value) == null || B.focus(), U(l, () => {
89
+ l.value && Object.prototype.hasOwnProperty.call(f, "autofocus") && l.value.focus();
82
90
  });
83
- const { handleDropdownSelect: I, updateDropdownVisibility: M } = z({
84
- codeMirror: n,
85
- query: h,
86
- showDropdown: y,
91
+ const { handleDropdownSelect: I, updateDropdownVisibility: M } = Q({
92
+ codeMirror: l,
93
+ query: y,
94
+ showDropdown: h,
87
95
  dropdownPosition: v
88
- }), N = _(() => {
96
+ }), N = C(() => {
89
97
  var o;
90
98
  return e.type === "boolean" || (o = e.type) != null && o.includes("boolean") || e.nullable ? ["true", "false", "null"] : ["true", "false"];
91
99
  });
92
- return P({
100
+ return F({
93
101
  focus: () => {
94
102
  var o;
95
- (o = n.value) == null || o.focus();
103
+ (o = l.value) == null || o.focus();
96
104
  }
97
- }), (o, i) => {
105
+ }), (o, n) => {
98
106
  var k;
99
- return t(), s(j, null, [
100
- e.enum && e.enum.length ? (t(), c(x, {
107
+ return a(), s(W, null, [
108
+ e.enum && e.enum.length ? (a(), p(x, {
101
109
  key: 0,
102
110
  modelValue: e.modelValue,
103
111
  value: e.enum,
104
- "onUpdate:modelValue": i[0] || (i[0] = (p) => u("update:modelValue", p))
105
- }, null, 8, ["modelValue", "value"])) : e.type === "boolean" || (k = e.type) != null && k.includes("boolean") ? (t(), c(x, {
112
+ "onUpdate:modelValue": n[0] || (n[0] = (c) => r("update:modelValue", c))
113
+ }, null, 8, ["modelValue", "value"])) : e.type === "boolean" || (k = e.type) != null && k.includes("boolean") ? (a(), p(x, {
106
114
  key: 1,
107
115
  modelValue: e.modelValue,
108
116
  value: N.value,
109
- "onUpdate:modelValue": i[1] || (i[1] = (p) => u("update:modelValue", p))
110
- }, null, 8, ["modelValue", "value"])) : (t(), s("div", Q({
117
+ "onUpdate:modelValue": n[1] || (n[1] = (c) => r("update:modelValue", c))
118
+ }, null, 8, ["modelValue", "value"])) : (a(), s("div", j({
111
119
  key: 2,
112
- id: r(q)
120
+ id: i(q)
113
121
  }, o.$attrs, {
114
122
  ref_key: "codeMirrorRef",
115
123
  ref: w,
@@ -117,18 +125,18 @@ const Y = ["id"], Z = {
117
125
  "flow-code-input--error": o.error
118
126
  }]
119
127
  }), null, 16, Y)),
120
- o.$slots.warning ? (t(), s("div", Z, [
121
- C(o.$slots, "warning", {}, void 0, !0)
128
+ o.$slots.warning ? (a(), s("div", Z, [
129
+ _(o.$slots, "warning", {}, void 0, !0)
122
130
  ])) : m("", !0),
123
- C(o.$slots, "icon", {}, void 0, !0),
124
- o.required ? (t(), s("div", ee, " Required ")) : m("", !0),
125
- y.value && e.withVariables && !r(V) ? (t(), c(L, {
131
+ _(o.$slots, "icon", {}, void 0, !0),
132
+ o.required ? (a(), s("div", ee, " Required ")) : m("", !0),
133
+ h.value && e.withVariables && !i(V) ? (a(), p(K, {
126
134
  key: 5,
127
- activeEnvVariables: _(() => r(g)),
135
+ activeEnvVariables: C(() => i(g)),
128
136
  dropdownPosition: v.value,
129
- query: h.value,
130
- router: r($),
131
- onSelect: r(I)
137
+ query: y.value,
138
+ router: i($),
139
+ onSelect: i(I)
132
140
  }, null, 8, ["activeEnvVariables", "dropdownPosition", "query", "router", "onSelect"])) : m("", !0)
133
141
  ], 64);
134
142
  };
@@ -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
  };
@@ -2,8 +2,8 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
2
2
  close: () => void;
3
3
  back: (e: KeyboardEvent) => void;
4
4
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
5
- onBack?: ((e: KeyboardEvent) => any) | undefined;
6
5
  onClose?: (() => any) | undefined;
6
+ onBack?: ((e: KeyboardEvent) => any) | undefined;
7
7
  }, {}, {}>;
8
8
  export default _default;
9
9
  //# sourceMappingURL=CommandPaletteCollection.vue.d.ts.map
@@ -12,8 +12,8 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
12
12
  itemUid: string;
13
13
  };
14
14
  }>>> & {
15
- onBack?: ((e: KeyboardEvent) => any) | undefined;
16
15
  onClose?: (() => any) | undefined;
16
+ onBack?: ((e: KeyboardEvent) => any) | undefined;
17
17
  }, {}, {}>;
18
18
  export default _default;
19
19
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -2,8 +2,8 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
2
2
  close: () => void;
3
3
  back: (e: KeyboardEvent) => void;
4
4
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
5
- onBack?: ((e: KeyboardEvent) => any) | undefined;
6
5
  onClose?: (() => any) | undefined;
6
+ onBack?: ((e: KeyboardEvent) => any) | undefined;
7
7
  }, {}, {}>;
8
8
  export default _default;
9
9
  //# sourceMappingURL=CommandPaletteImport.vue.d.ts.map
@@ -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"}
@@ -1,76 +1,83 @@
1
- import { defineComponent as V, ref as _, openBlock as s, createBlock as u, withCtx as l, createVNode as p, unref as r, createTextVNode as d, createElementBlock as h, Fragment as A, createCommentVNode as O } from "vue";
2
- import { ScalarButton as x, ScalarIcon as P, ScalarCodeBlock as B } from "@scalar/components";
3
- import { useToasts as $ } from "@scalar/use-toasts";
4
- import N from "./CommandActionForm.vue.js";
5
- import T from "./CommandActionInput.vue.js";
6
- import { useFileDialog as L } from "../../hooks/useFileDialog.js";
7
- import { getOpenApiDocumentVersion as f } from "../../libs/getOpenApiDocumentVersion.js";
8
- import { isUrl as v } from "../../libs/isUrl.js";
9
- import { isDocument as M } from "../../libs/isDocument.js";
10
- import { useWorkspace as R } from "../../store/store.js";
11
- const X = /* @__PURE__ */ V({
1
+ import { defineComponent as O, ref as P, computed as v, openBlock as l, createBlock as k, unref as n, withCtx as p, createVNode as y, createTextVNode as s, createElementBlock as c, Fragment as u, toDisplayString as _, createElementVNode as w, createCommentVNode as $ } from "vue";
2
+ import { useLoadingState as R, ScalarButton as h, ScalarIcon as T, ScalarCodeBlock as j } from "@scalar/components";
3
+ import { useToasts as M } from "@scalar/use-toasts";
4
+ import z from "./CommandActionForm.vue.js";
5
+ import E from "./CommandActionInput.vue.js";
6
+ import { getOpenApiDocumentDetails as W } from "../../libs/getOpenApiDocumentDetails.js";
7
+ import { isUrl as x } from "../../libs/isUrl.js";
8
+ import { useFileDialog as J } from "../../hooks/useFileDialog.js";
9
+ import { useWorkspace as Y } from "../../store/store.js";
10
+ const q = { class: "flex justify-between" }, G = /* @__PURE__ */ w("div", { class: "pl-8 text-xs min-h-8 py-2 text-c-2" }, "Preview", -1), ne = /* @__PURE__ */ O({
12
11
  __name: "CommandPaletteImport",
13
12
  emits: ["close", "back"],
14
- setup(j, { emit: b }) {
15
- const m = b, { activeWorkspace: c, importSpecFile: g, importSpecFromUrl: C } = R(), { toast: n } = $(), e = _(""), { open: y } = L({
13
+ setup(H, { emit: U }) {
14
+ const f = U, { activeWorkspace: g, importSpecFile: b, importSpecFromUrl: D } = Y(), { toast: m } = M(), i = R(), e = P(""), o = v(
15
+ () => W(e.value)
16
+ ), C = v(
17
+ () => o.value ? o.value.type : "json"
18
+ ), S = v(() => x(e.value)), F = v(() => !!o.value), { open: L } = J({
16
19
  onChange: async (a) => {
17
- const o = a == null ? void 0 : a[0];
18
- if (o) {
19
- const t = new FileReader();
20
- t.onload = async (w) => {
21
- var k;
22
- const F = (k = w.target) == null ? void 0 : k.result;
20
+ const t = a == null ? void 0 : a[0];
21
+ if (t) {
22
+ const r = new FileReader();
23
+ r.onload = async (A) => {
24
+ var I;
25
+ const B = (I = A.target) == null ? void 0 : I.result;
23
26
  try {
24
- await g(F, c.value.uid), n("Import successful", "info"), m("close");
25
- } catch (i) {
26
- console.error(i);
27
- const U = (i == null ? void 0 : i.message) || "Unknown error";
28
- n(`Import failed: ${U}`, "error");
27
+ await b(B, g.value.uid), m("Import successful", "info"), f("close");
28
+ } catch (d) {
29
+ console.error(d);
30
+ const N = (d == null ? void 0 : d.message) || "Unknown error";
31
+ m(`Import failed: ${N}`, "error");
29
32
  }
30
- }, t.readAsText(o);
33
+ }, r.readAsText(t);
31
34
  }
32
35
  },
33
36
  multiple: !1,
34
37
  accept: ".json,.yaml,.yml"
35
38
  });
36
- async function I() {
37
- try {
38
- e.value && (v(e.value) ? await C(
39
- e.value,
40
- void 0,
41
- void 0,
42
- c.value.uid
43
- ) : M(e.value) ? await g(
44
- String(e.value),
45
- c.value.uid
46
- ) : n("Import failed: Invalid URL or OpenAPI document", "error")), m("close"), n("Import successful", "info");
47
- } catch (a) {
48
- console.error("[importCollection]", a);
49
- const o = (a == null ? void 0 : a.message) || "Unknown error";
50
- n(`Import failed: ${o}`, "error");
39
+ async function V() {
40
+ if (!(!e.value || i.isLoading)) {
41
+ i.startLoading();
42
+ try {
43
+ if (S.value)
44
+ await D(
45
+ e.value,
46
+ void 0,
47
+ void 0,
48
+ g.value.uid
49
+ );
50
+ else if (F.value)
51
+ await b(
52
+ String(e.value),
53
+ g.value.uid
54
+ );
55
+ else {
56
+ m("Import failed: Invalid URL or OpenAPI document", "error"), i.invalidate(2e3, !0);
57
+ return;
58
+ }
59
+ i.clear(), f("close"), m("Import successful", "info");
60
+ } catch (a) {
61
+ console.error("[importCollection]", a);
62
+ const t = (a == null ? void 0 : a.message) || "Unknown error";
63
+ i.invalidate(2e3, !0), m(`Import failed: ${t}`, "error");
64
+ }
51
65
  }
52
66
  }
53
- function S() {
54
- return (f(e.value) || {}).type ?? "json";
55
- }
56
- function D(a) {
57
- var t;
58
- const o = (t = a.clipboardData) == null ? void 0 : t.getData("text");
59
- o && (e.value = o);
60
- }
61
- return (a, o) => (s(), u(N, {
67
+ return (a, t) => (l(), k(z, {
62
68
  disabled: !e.value.trim(),
63
- onSubmit: I
69
+ loading: n(i),
70
+ onSubmit: V
64
71
  }, {
65
- options: l(() => [
66
- p(r(x), {
72
+ options: p(() => [
73
+ y(n(h), {
67
74
  class: "p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
68
75
  variant: "outlined",
69
- onClick: r(y)
76
+ onClick: n(L)
70
77
  }, {
71
- default: l(() => [
72
- d(" JSON, or YAML File "),
73
- p(r(P), {
78
+ default: p(() => [
79
+ s(" JSON, or YAML File "),
80
+ y(n(T), {
74
81
  class: "text-c-3",
75
82
  icon: "UploadSimple",
76
83
  size: "md"
@@ -79,41 +86,54 @@ const X = /* @__PURE__ */ V({
79
86
  _: 1
80
87
  }, 8, ["onClick"])
81
88
  ]),
82
- submit: l(() => [
83
- d("Import Collection")
89
+ submit: p(() => [
90
+ s(" Import "),
91
+ S.value ? (l(), c(u, { key: 0 }, [
92
+ s(" from URL ")
93
+ ], 64)) : o.value && C.value ? (l(), c(u, { key: 1 }, [
94
+ o.value.title ? (l(), c(u, { key: 0 }, [
95
+ s(' "' + _(o.value.title) + '" ', 1)
96
+ ], 64)) : (l(), c(u, { key: 1 }, [
97
+ s(_(o.value.version) + " Spec", 1)
98
+ ], 64))
99
+ ], 64)) : (l(), c(u, { key: 2 }, [
100
+ s("Collection")
101
+ ], 64))
84
102
  ]),
85
- default: l(() => [
86
- !r(f)(e.value) || r(v)(e.value) ? (s(), u(T, {
103
+ default: p(() => [
104
+ !o.value || n(x)(e.value) ? (l(), k(E, {
87
105
  key: 0,
88
106
  modelValue: e.value,
89
- "onUpdate:modelValue": o[0] || (o[0] = (t) => e.value = t),
107
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => e.value = r),
90
108
  placeholder: "Paste Swagger/OpenAPI File URL or content",
91
- onOnDelete: o[1] || (o[1] = (t) => m("back", t)),
92
- onPaste: o[2] || (o[2] = (t) => D(t))
93
- }, null, 8, ["modelValue"])) : (s(), h(A, { key: 1 }, [
94
- p(r(x), {
95
- class: "ml-auto p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
96
- variant: "ghost",
97
- onClick: o[3] || (o[3] = (t) => e.value = "")
98
- }, {
99
- default: l(() => [
100
- d(" Clear ")
101
- ]),
102
- _: 1
103
- }),
104
- r(f)(e.value) && !r(v)(e.value) ? (s(), u(r(B), {
109
+ onOnDelete: t[1] || (t[1] = (r) => f("back", r))
110
+ }, null, 8, ["modelValue"])) : (l(), c(u, { key: 1 }, [
111
+ w("div", q, [
112
+ G,
113
+ y(n(h), {
114
+ class: "ml-auto p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
115
+ variant: "ghost",
116
+ onClick: t[2] || (t[2] = (r) => e.value = "")
117
+ }, {
118
+ default: p(() => [
119
+ s(" Clear ")
120
+ ]),
121
+ _: 1
122
+ })
123
+ ]),
124
+ o.value && !n(x)(e.value) ? (l(), k(n(j), {
105
125
  key: 0,
106
- class: "bg-backdropdark border max-h-[25dvh] mt-2 rounded",
126
+ class: "border max-h-[40dvh] mt-1 bg-b-2 rounded [--scalar-small:--scalar-font-size-4]",
107
127
  content: e.value,
108
128
  copy: !1,
109
- lang: S()
110
- }, null, 8, ["content", "lang"])) : O("", !0)
129
+ lang: C.value
130
+ }, null, 8, ["content", "lang"])) : $("", !0)
111
131
  ], 64))
112
132
  ]),
113
133
  _: 1
114
- }, 8, ["disabled"]));
134
+ }, 8, ["disabled", "loading"]));
115
135
  }
116
136
  });
117
137
  export {
118
- X as default
138
+ ne as default
119
139
  };
@@ -12,8 +12,8 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
12
12
  parentUid: string;
13
13
  };
14
14
  }>>> & {
15
- onBack?: ((e: KeyboardEvent) => any) | undefined;
16
15
  onClose?: (() => any) | undefined;
16
+ onBack?: ((e: KeyboardEvent) => any) | undefined;
17
17
  }, {}, {}>;
18
18
  export default _default;
19
19
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;