@scalar/api-client 2.5.32 → 2.5.33

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 (235) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/AddressBar/AddressBar.vue.js +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue2.js +120 -128
  4. package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
  5. package/dist/components/AddressBar/AddressBarHistory.vue2.js +57 -63
  6. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  7. package/dist/components/CodeInput/CodeInput.vue2.js +143 -150
  8. package/dist/components/CodeInput/codeVariableWidget.js +70 -75
  9. package/dist/components/CommandPalette/CommandActionInput.vue.js +17 -19
  10. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +26 -27
  11. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +53 -55
  12. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +129 -133
  13. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +1 -1
  14. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +84 -98
  15. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +64 -74
  16. package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -11
  17. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  18. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +164 -183
  19. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  20. package/dist/components/DataTable/DataTableInput.vue.js +4 -4
  21. package/dist/components/DataTable/DataTableInput.vue2.js +31 -31
  22. package/dist/components/DataTable/DataTableInputSelect.vue.js +1 -2
  23. package/dist/components/EmptyState.vue.js +1 -1
  24. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +75 -84
  25. package/dist/components/Form/LabelInput.vue.js +1 -1
  26. package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
  27. package/dist/components/HttpMethod/HttpMethod.vue2.js +11 -11
  28. package/dist/components/ImportCollection/DropEventListener.vue.js +42 -44
  29. package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -23
  30. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +141 -149
  31. package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +1 -1
  32. package/dist/components/ImportCollection/ImportNowButton.vue.js +22 -23
  33. package/dist/components/ImportCollection/IntegrationLogo.vue.js +12 -13
  34. package/dist/components/ImportCollection/PasteEventListener.vue.js +11 -12
  35. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +69 -76
  36. package/dist/components/ImportCollection/utils/get-openapi-version.js +8 -8
  37. package/dist/components/ImportCollection/utils/import-collection.js +14 -14
  38. package/dist/components/OpenApiClientButton.vue.js +1 -1
  39. package/dist/components/OpenApiClientButton.vue2.js +10 -10
  40. package/dist/components/ScalarAsciiArt.vue.js +1 -1
  41. package/dist/components/ScalarAsciiArt.vue2.js +19 -22
  42. package/dist/components/Search/useSearch.js +51 -61
  43. package/dist/components/SectionFilter.vue.js +1 -1
  44. package/dist/components/SectionFilter.vue2.js +26 -29
  45. package/dist/components/Server/ServerDropdown.vue.js +70 -96
  46. package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
  47. package/dist/components/Server/ServerDropdownItem.vue2.js +57 -67
  48. package/dist/components/Server/ServerSelector.vue.js +44 -55
  49. package/dist/components/Server/ServerVariablesForm.vue.js +36 -42
  50. package/dist/components/Server/ServerVariablesSelect.vue.js +6 -6
  51. package/dist/components/SideNav/DownloadAppButton.vue.js +1 -1
  52. package/dist/components/SideNav/SideNav.vue.js +68 -74
  53. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
  54. package/dist/components/Sidebar/Sidebar.vue.js +1 -1
  55. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  56. package/dist/components/TopNav/TopNav.vue.js +107 -122
  57. package/dist/components/TopNav/TopNavItem.vue.js +1 -1
  58. package/dist/hooks/useFileDialog.js +12 -12
  59. package/dist/hooks/useResponseBody.js +14 -16
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.js +2 -2
  62. package/dist/layouts/App/ApiClientApp.vue.js +50 -56
  63. package/dist/layouts/App/ApiClientApp.vue3.js +1 -1
  64. package/dist/layouts/App/create-api-client-app.js +19 -20
  65. package/dist/layouts/App/index.js +1 -1
  66. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  67. package/dist/layouts/Modal/ApiClientModal.vue2.js +18 -21
  68. package/dist/layouts/Web/ApiClientWeb.vue.js +45 -51
  69. package/dist/layouts/Web/ApiClientWeb.vue3.js +1 -1
  70. package/dist/layouts/Web/create-api-client-web.js +19 -20
  71. package/dist/layouts/Web/index.js +1 -1
  72. package/dist/libs/create-client.js +102 -109
  73. package/dist/libs/env-helpers.js +3 -3
  74. package/dist/libs/event-bus.js +15 -15
  75. package/dist/libs/extractAttachmentFilename.js +5 -6
  76. package/dist/libs/find-request.js +9 -10
  77. package/dist/libs/get-request-uid-by-path-method.js +12 -12
  78. package/dist/libs/getOpenApiDocumentDetails.js +7 -7
  79. package/dist/libs/importers/curl.js +3 -3
  80. package/dist/libs/normalize-headers.js +9 -10
  81. package/dist/libs/postman.js +15 -17
  82. package/dist/libs/send-request/build-request-security.js +9 -10
  83. package/dist/libs/send-request/create-fetch-body.js +11 -12
  84. package/dist/libs/send-request/create-fetch-query-params.js +13 -13
  85. package/dist/libs/send-request/create-request-operation.js +83 -84
  86. package/dist/libs/send-request/decode-buffer.d.ts.map +1 -1
  87. package/dist/libs/send-request/set-request-cookies.js +12 -12
  88. package/dist/libs/string-template.js +21 -21
  89. package/dist/libs/validate-parameters.js +5 -8
  90. package/dist/plugins/plugin-manager.js +11 -17
  91. package/dist/store/active-entities.js +90 -117
  92. package/dist/store/collections.js +41 -42
  93. package/dist/store/import-spec.js +25 -26
  94. package/dist/store/request-example.js +20 -24
  95. package/dist/store/requests.js +63 -81
  96. package/dist/store/router-params.js +7 -7
  97. package/dist/store/security-schemes.js +35 -36
  98. package/dist/store/store.js +2 -2
  99. package/dist/store/tags.js +20 -21
  100. package/dist/style.css +1 -1
  101. package/dist/views/Collection/Collection.vue2.js +21 -22
  102. package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
  103. package/dist/views/Collection/CollectionAuthentication.vue2.js +43 -47
  104. package/dist/views/Collection/CollectionEnvironment.vue.js +1 -1
  105. package/dist/views/Collection/CollectionEnvironment.vue2.js +196 -207
  106. package/dist/views/Collection/CollectionInfoForm.vue.js +1 -1
  107. package/dist/views/Collection/CollectionInfoForm.vue2.js +34 -41
  108. package/dist/views/Collection/CollectionNavigation.vue.js +116 -125
  109. package/dist/views/Collection/CollectionOverview.vue2.js +22 -25
  110. package/dist/views/Collection/CollectionServerForm.vue.js +39 -45
  111. package/dist/views/Collection/CollectionServers.vue2.js +88 -98
  112. package/dist/views/Collection/CollectionSettings.vue.js +1 -1
  113. package/dist/views/Collection/CollectionSettings.vue2.js +101 -108
  114. package/dist/views/Collection/components/EnvironmentForm.vue.js +1 -1
  115. package/dist/views/Collection/components/EnvironmentForm.vue2.js +141 -145
  116. package/dist/views/Collection/components/MarkdownInput.vue.js +1 -1
  117. package/dist/views/Collection/components/MarkdownInput.vue2.js +1 -2
  118. package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +15 -15
  119. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +15 -16
  120. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +61 -64
  121. package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +9 -10
  122. package/dist/views/Cookies/CookieModal.vue.js +1 -1
  123. package/dist/views/Cookies/Cookies.vue2.js +90 -93
  124. package/dist/views/Environment/Environment.vue2.js +267 -295
  125. package/dist/views/Environment/EnvironmentModal.vue.js +63 -70
  126. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -42
  127. package/dist/views/Request/Request.vue.js +1 -1
  128. package/dist/views/Request/Request.vue2.js +60 -67
  129. package/dist/views/Request/RequestRoot.vue.js +1 -1
  130. package/dist/views/Request/RequestRoot.vue2.js +78 -89
  131. package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +37 -44
  132. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +44 -45
  133. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +111 -127
  134. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  135. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +120 -139
  136. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
  137. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +97 -97
  138. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  139. package/dist/views/Request/RequestSection/RequestBody.vue2.js +287 -310
  140. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +1 -1
  141. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +86 -94
  142. package/dist/views/Request/RequestSection/RequestParams.vue.js +37 -38
  143. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +36 -38
  144. package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
  145. package/dist/views/Request/RequestSection/RequestSection.vue2.js +28 -31
  146. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  147. package/dist/views/Request/RequestSection/RequestTable.vue2.js +49 -52
  148. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
  149. package/dist/views/Request/RequestSection/helpers/filter-security-requirements.js +16 -16
  150. package/dist/views/Request/RequestSection/helpers/getting-started.js +7 -11
  151. package/dist/views/Request/RequestSection/helpers/update-scheme.js +7 -8
  152. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  153. package/dist/views/Request/RequestSidebar.vue2.js +199 -211
  154. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  155. package/dist/views/Request/RequestSidebarItem.vue2.js +332 -349
  156. package/dist/views/Request/RequestSidebarItemMenu.vue.js +1 -1
  157. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +210 -240
  158. package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
  159. package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +38 -41
  160. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +1 -1
  161. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +58 -64
  162. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +1 -2
  163. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
  164. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +1 -1
  165. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +20 -23
  166. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +1 -1
  167. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  168. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +29 -30
  169. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +38 -41
  170. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +1 -1
  171. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +28 -29
  172. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  173. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +128 -140
  174. package/dist/views/Request/components/WorkspaceDropdown.vue.js +116 -124
  175. package/dist/views/Request/consts/mediaTypes.js +2 -3
  176. package/dist/views/Request/handle-drag.js +24 -28
  177. package/dist/views/Request/hooks/useOpenApiWatcher.js +26 -33
  178. package/dist/views/Request/libs/auth.js +37 -43
  179. package/dist/views/Request/libs/oauth2.js +30 -32
  180. package/dist/views/Request/libs/watch-mode.js +100 -103
  181. package/dist/views/Settings/SettingsGeneral.vue.js +206 -236
  182. package/package.json +22 -22
  183. package/dist/components/AddressBar/AddressBar.vue3.js +0 -4
  184. package/dist/components/AddressBar/AddressBarHistory.vue3.js +0 -4
  185. package/dist/components/CodeInput/CodeInput.vue3.js +0 -4
  186. package/dist/components/CodeInput/CodeInput.vue4.js +0 -4
  187. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue3.js +0 -4
  188. package/dist/components/CommandPalette/TheCommandPalette.vue3.js +0 -4
  189. package/dist/components/DataTable/DataTableInput.vue3.js +0 -4
  190. package/dist/components/EmptyState.vue3.js +0 -4
  191. package/dist/components/Form/LabelInput.vue3.js +0 -4
  192. package/dist/components/HttpMethod/HttpMethod.vue3.js +0 -4
  193. package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
  194. package/dist/components/OpenApiClientButton.vue3.js +0 -4
  195. package/dist/components/ScalarAsciiArt.vue3.js +0 -4
  196. package/dist/components/SectionFilter.vue3.js +0 -4
  197. package/dist/components/Server/ServerDropdownItem.vue3.js +0 -4
  198. package/dist/components/SideNav/DownloadAppButton.vue3.js +0 -4
  199. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue3.js +0 -4
  200. package/dist/components/Sidebar/Sidebar.vue3.js +0 -4
  201. package/dist/components/Sidebar/SidebarListElement.vue3.js +0 -4
  202. package/dist/components/Sidebar/SidebarListElement.vue4.js +0 -4
  203. package/dist/components/TopNav/TopNavItem.vue3.js +0 -4
  204. package/dist/layouts/App/ApiClientApp.vue2.js +0 -4
  205. package/dist/layouts/Modal/ApiClientModal.vue3.js +0 -4
  206. package/dist/layouts/Web/ApiClientWeb.vue2.js +0 -4
  207. package/dist/style.css.js +0 -4
  208. package/dist/views/Collection/CollectionAuthentication.vue3.js +0 -4
  209. package/dist/views/Collection/CollectionEnvironment.vue3.js +0 -4
  210. package/dist/views/Collection/CollectionInfoForm.vue3.js +0 -4
  211. package/dist/views/Collection/CollectionSettings.vue3.js +0 -4
  212. package/dist/views/Collection/components/EnvironmentForm.vue3.js +0 -4
  213. package/dist/views/Collection/components/MarkdownInput.vue3.js +0 -4
  214. package/dist/views/Cookies/CookieModal.vue3.js +0 -4
  215. package/dist/views/Request/Request.vue3.js +0 -4
  216. package/dist/views/Request/RequestRoot.vue3.js +0 -4
  217. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue3.js +0 -4
  218. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue3.js +0 -4
  219. package/dist/views/Request/RequestSection/RequestBody.vue3.js +0 -4
  220. package/dist/views/Request/RequestSection/RequestCodeExample.vue3.js +0 -4
  221. package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -4
  222. package/dist/views/Request/RequestSection/RequestTable.vue3.js +0 -4
  223. package/dist/views/Request/RequestSection/RequestTableTooltip.vue3.js +0 -4
  224. package/dist/views/Request/RequestSidebar.vue3.js +0 -4
  225. package/dist/views/Request/RequestSidebarItem.vue3.js +0 -4
  226. package/dist/views/Request/RequestSidebarItem.vue4.js +0 -4
  227. package/dist/views/Request/RequestSidebarItemMenu.vue3.js +0 -4
  228. package/dist/views/Request/RequestSubpageHeader.vue3.js +0 -4
  229. package/dist/views/Request/ResponseSection/ResponseBody.vue3.js +0 -4
  230. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue3.js +0 -4
  231. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue3.js +0 -4
  232. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue2.js +0 -4
  233. package/dist/views/Request/ResponseSection/ResponseEmpty.vue3.js +0 -4
  234. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue3.js +0 -4
  235. package/dist/views/Request/ResponseSection/ResponseSection.vue3.js +0 -4
@@ -1,10 +1,10 @@
1
- import { defineComponent as z, computed as u, watch as E, useTemplateRef as L, createBlock as p, openBlock as s, unref as a, withCtx as v, createVNode as c, createElementBlock as n, Fragment as d, createElementVNode as i, createTextVNode as T, toDisplayString as W, createCommentVNode as h, renderList as k } from "vue";
2
- import { ScalarPopover as q, ScalarButton as F, ScalarIcon as x, ScalarFloatingBackdrop as I, ScalarDropdownDivider as M } from "@scalar/components";
3
- import { emitCustomEvent as P } from "@scalar/workspace-store/events";
4
- import { useLayout as $ } from "../../hooks/useLayout.js";
5
- import { useWorkspace as j } from "../../store/store.js";
6
- import y from "./ServerDropdownItem.vue.js";
7
- const R = ["onClick"], G = { class: "flex h-4 w-4 items-center justify-center" }, Z = /* @__PURE__ */ z({
1
+ import { defineComponent as V, computed as u, watch as z, useTemplateRef as E, createBlock as p, openBlock as o, unref as n, withCtx as v, createVNode as c, createElementBlock as a, Fragment as d, createElementVNode as s, createTextVNode as L, toDisplayString as T, createCommentVNode as g, renderList as h } from "vue";
2
+ import { ScalarPopover as W, ScalarButton as q, ScalarIcon as k, ScalarFloatingBackdrop as F, ScalarDropdownDivider as I } from "@scalar/components";
3
+ import { emitCustomEvent as M } from "@scalar/workspace-store/events";
4
+ import { useLayout as O } from "../../hooks/useLayout.js";
5
+ import { useWorkspace as P } from "../../store/store.js";
6
+ import w from "./ServerDropdownItem.vue.js";
7
+ const $ = ["onClick"], j = { class: "flex h-4 w-4 items-center justify-center" }, X = /* @__PURE__ */ V({
8
8
  __name: "ServerDropdown",
9
9
  props: {
10
10
  collection: {},
@@ -12,65 +12,42 @@ const R = ["onClick"], G = { class: "flex h-4 w-4 items-center justify-center" }
12
12
  server: {},
13
13
  target: {}
14
14
  },
15
- setup(l) {
16
- const { layout: w } = $(), { servers: m, collectionMutators: U, events: C, serverMutators: A } = j(), f = u(
17
- () => {
18
- var e, r;
19
- return (r = (e = l.operation) == null ? void 0 : e.servers) == null ? void 0 : r.map((t) => {
20
- var o;
21
- return {
22
- id: t,
23
- label: ((o = m[t]) == null ? void 0 : o.url) ?? "Unknown server"
24
- };
25
- });
26
- }
15
+ setup(r) {
16
+ const { layout: x } = O(), { servers: m, collectionMutators: y, events: U, serverMutators: C } = P(), f = u(
17
+ () => r.operation?.servers?.map((e) => ({
18
+ id: e,
19
+ label: m[e]?.url ?? "Unknown server"
20
+ }))
27
21
  ), b = u(
28
- () => {
29
- var e, r;
30
- return (
31
- // Filters out servers already present in the request
32
- (r = (e = l.collection) == null ? void 0 : e.servers) == null ? void 0 : r.filter((t) => {
33
- var o, g;
34
- return !((g = (o = l.operation) == null ? void 0 : o.servers) != null && g.includes(t));
35
- }).map((t) => {
36
- var o;
37
- return {
38
- id: t,
39
- label: ((o = m[t]) == null ? void 0 : o.url) ?? "Unknown server"
40
- };
41
- })
42
- );
43
- }
44
- ), D = u(
45
- () => {
46
- var e, r;
47
- return ((e = f.value) == null ? void 0 : e.length) && ((r = b.value) == null ? void 0 : r.length);
48
- }
22
+ () => (
23
+ // Filters out servers already present in the request
24
+ r.collection?.servers?.filter((e) => !r.operation?.servers?.includes(e)).map((e) => ({
25
+ id: e,
26
+ label: m[e]?.url ?? "Unknown server"
27
+ }))
28
+ )
29
+ ), A = u(
30
+ () => f.value?.length && b.value?.length
49
31
  );
50
- E([() => l.collection, () => l.operation], ([e, r]) => {
51
- var o;
52
- if (!e || e.selectedServerUid || r != null && r.selectedServerUid)
32
+ z([() => r.collection, () => r.operation], ([e, t]) => {
33
+ if (!e || e.selectedServerUid || t?.selectedServerUid)
53
34
  return;
54
- const t = (o = l.collection.servers) == null ? void 0 : o[0];
55
- t && U.edit(l.collection.uid, "selectedServerUid", t);
35
+ const l = r.collection.servers?.[0];
36
+ l && y.edit(r.collection.uid, "selectedServerUid", l);
56
37
  });
57
- const B = () => C.commandPalette.emit({
38
+ const D = () => U.commandPalette.emit({
58
39
  commandName: "Add Server"
59
- }), N = u(() => {
60
- var e, r, t;
61
- return (r = (e = l.server) == null ? void 0 : e.url) != null && r.endsWith("/") ? l.server.url.slice(0, -1) : ((t = l.server) == null ? void 0 : t.url) || "";
62
- }), S = (e, r) => {
63
- var o;
64
- if (!l.server)
40
+ }), B = u(() => r.server?.url?.endsWith("/") ? r.server.url.slice(0, -1) : r.server?.url || ""), S = (e, t) => {
41
+ if (!r.server)
65
42
  return;
66
- const t = l.server.variables || {};
67
- t[e] = { ...t[e], default: r }, A.edit(l.server.uid, "variables", t), P(
68
- (o = V.value) == null ? void 0 : o.$el,
43
+ const l = r.server.variables || {};
44
+ l[e] = { ...l[e], default: t }, C.edit(r.server.uid, "variables", l), M(
45
+ N.value?.$el,
69
46
  "scalar-update-selected-server-variables",
70
- { key: e, value: r }
47
+ { key: e, value: t }
71
48
  );
72
- }, V = L("wrapper-ref");
73
- return (e, r) => (s(), p(a(q), {
49
+ }, N = E("wrapper-ref");
50
+ return (e, t) => (o(), p(n(W), {
74
51
  ref: "wrapper-ref",
75
52
  class: "max-h-[inherit] p-0 text-base",
76
53
  focus: "",
@@ -80,72 +57,69 @@ const R = ["onClick"], G = { class: "flex h-4 w-4 items-center justify-center" }
80
57
  target: e.target,
81
58
  teleport: `#${e.target}`
82
59
  }, {
83
- popover: v(({ close: t }) => [
84
- i("div", {
60
+ popover: v(({ close: l }) => [
61
+ s("div", {
85
62
  class: "custom-scroll flex max-h-[inherit] flex-col gap-1 border-t p-1",
86
- onClick: t
63
+ onClick: l
87
64
  }, [
88
- (s(!0), n(d, null, k(f.value, (o) => (s(), p(y, {
89
- key: o.id,
65
+ (o(!0), a(d, null, h(f.value, (i) => (o(), p(w, {
66
+ key: i.id,
90
67
  collection: e.collection,
91
68
  operation: e.operation,
92
69
  server: e.server,
93
- serverOption: o,
70
+ serverOption: i,
94
71
  type: "request",
95
72
  "onUpdate:variable": S
96
73
  }, null, 8, ["collection", "operation", "server", "serverOption"]))), 128)),
97
- D.value ? (s(), n(d, { key: 0 }, [
98
- c(a(M)),
99
- r[2] || (r[2] = i("div", { class: "text-xxs text-c-2 px-2.5 py-1" }, "Collection", -1))
100
- ], 64)) : h("", !0),
101
- (s(!0), n(d, null, k(b.value, (o) => (s(), p(y, {
102
- key: o.id,
74
+ A.value ? (o(), a(d, { key: 0 }, [
75
+ c(n(I)),
76
+ t[2] || (t[2] = s("div", { class: "text-xxs text-c-2 px-2.5 py-1" }, "Collection", -1))
77
+ ], 64)) : g("", !0),
78
+ (o(!0), a(d, null, h(b.value, (i) => (o(), p(w, {
79
+ key: i.id,
103
80
  collection: e.collection,
104
81
  operation: e.operation,
105
82
  server: e.server,
106
- serverOption: o,
83
+ serverOption: i,
107
84
  type: "collection",
108
85
  "onUpdate:variable": S
109
86
  }, null, 8, ["collection", "operation", "server", "serverOption"]))), 128)),
110
- a(w) !== "modal" ? (s(), n("button", {
87
+ n(x) !== "modal" ? (o(), a("button", {
111
88
  key: 1,
112
89
  class: "text-xxs hover:bg-b-2 flex cursor-pointer items-center gap-1.5 rounded p-1.75",
113
90
  type: "button",
114
- onClick: B
91
+ onClick: D
115
92
  }, [
116
- i("div", G, [
117
- c(a(x), {
93
+ s("div", j, [
94
+ c(n(k), {
118
95
  icon: "Add",
119
96
  size: "sm"
120
97
  })
121
98
  ]),
122
- r[3] || (r[3] = i("span", null, "Add Server", -1))
123
- ])) : h("", !0)
124
- ], 8, R)
99
+ t[3] || (t[3] = s("span", null, "Add Server", -1))
100
+ ])) : g("", !0)
101
+ ], 8, $)
125
102
  ]),
126
103
  backdrop: v(() => [
127
- c(a(I), { class: "-top-(--scalar-address-bar-height) rounded-lg" })
104
+ c(n(F), { class: "-top-(--scalar-address-bar-height) rounded-lg" })
128
105
  ]),
129
106
  default: v(() => [
130
- c(a(F), {
107
+ c(n(q), {
131
108
  class: "z-context-plus hover:bg-b-2 font-code text-c-2 ml-0.75 h-auto gap-0.75 rounded border px-1.5 text-base whitespace-nowrap",
132
109
  variant: "ghost"
133
110
  }, {
134
- default: v(() => {
135
- var t;
136
- return [
137
- (t = e.operation) != null && t.selectedServerUid || e.collection.selectedServerUid ? (s(), n(d, { key: 0 }, [
138
- r[0] || (r[0] = i("span", { class: "sr-only" }, "Server:", -1)),
139
- T(" " + W(N.value), 1)
140
- ], 64)) : (s(), n(d, { key: 1 }, [
141
- r[1] || (r[1] = i("span", { class: "sr-only" }, "Add Server", -1)),
142
- c(a(x), {
143
- icon: "Add",
144
- size: "xs"
145
- })
146
- ], 64))
147
- ];
148
- }),
111
+ default: v(() => [
112
+ e.operation?.selectedServerUid || e.collection.selectedServerUid ? (o(), a(d, { key: 0 }, [
113
+ t[0] || (t[0] = s("span", { class: "sr-only" }, "Server:", -1)),
114
+ L(" " + T(B.value), 1)
115
+ ], 64)) : (o(), a(d, { key: 1 }, [
116
+ t[1] || (t[1] = s("span", { class: "sr-only" }, "Add Server", -1)),
117
+ c(n(k), {
118
+ icon: "Add",
119
+ size: "xs"
120
+ })
121
+ ], 64))
122
+ ]),
149
123
  _: 1
150
124
  })
151
125
  ]),
@@ -154,5 +128,5 @@ const R = ["onClick"], G = { class: "flex h-4 w-4 items-center justify-center" }
154
128
  }
155
129
  });
156
130
  export {
157
- Z as default
131
+ X as default
158
132
  };
@@ -1,5 +1,5 @@
1
1
  import o from "./ServerDropdownItem.vue2.js";
2
- import "./ServerDropdownItem.vue3.js";
2
+ /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-92012388"]]);
5
5
  export {
@@ -1,9 +1,9 @@
1
- import { defineComponent as q, useId as E, computed as k, useTemplateRef as M, createElementBlock as p, openBlock as c, normalizeClass as I, createElementVNode as u, createCommentVNode as x, mergeProps as N, unref as n, createVNode as v, toDisplayString as B, withModifiers as D } from "vue";
2
- import { ScalarListboxCheckbox as P, ScalarMarkdown as j } from "@scalar/components";
3
- import { emitCustomEvent as w } from "@scalar/workspace-store/events";
4
- import z from "./ServerVariablesForm.vue.js";
5
- import { useWorkspace as L } from "../../store/store.js";
6
- const R = ["aria-expanded"], T = { class: "overflow-hidden text-ellipsis whitespace-nowrap" }, W = ["id"], $ = { key: 0 }, A = { class: "description text-c-3 px-3 py-1.5" }, Q = /* @__PURE__ */ q({
1
+ import { defineComponent as O, useId as U, computed as b, useTemplateRef as C, createElementBlock as a, openBlock as n, normalizeClass as V, createElementVNode as d, createCommentVNode as S, mergeProps as q, unref as s, createVNode as p, toDisplayString as E, withModifiers as M } from "vue";
2
+ import { ScalarListboxCheckbox as I, ScalarMarkdown as N } from "@scalar/components";
3
+ import { emitCustomEvent as y } from "@scalar/workspace-store/events";
4
+ import B from "./ServerVariablesForm.vue.js";
5
+ import { useWorkspace as D } from "../../store/store.js";
6
+ const P = ["aria-expanded"], j = { class: "overflow-hidden text-ellipsis whitespace-nowrap" }, z = ["id"], L = { key: 0 }, R = { class: "description text-c-3 px-3 py-1.5" }, G = /* @__PURE__ */ O({
7
7
  __name: "ServerDropdownItem",
8
8
  props: {
9
9
  collection: {},
@@ -13,82 +13,72 @@ const R = ["aria-expanded"], T = { class: "overflow-hidden text-ellipsis whitesp
13
13
  type: {}
14
14
  },
15
15
  emits: ["update:variable"],
16
- setup(_, { emit: O }) {
17
- const e = _, U = O, f = E(), { collectionMutators: m, requestMutators: l, servers: b } = L(), C = (r, t) => {
18
- var i, s, a, h, g;
19
- if (S(r) && (t == null || t.stopPropagation()), o.value) {
20
- (s = (i = e.operation) == null ? void 0 : i.servers) != null && s.length && l.edit(e.operation.uid, "selectedServerUid", null), e.type === "collection" ? (m.edit(
16
+ setup(h, { emit: g }) {
17
+ const e = h, k = g, c = U(), { collectionMutators: u, requestMutators: i, servers: v } = D(), x = (r, t) => {
18
+ if (f(r) && t?.stopPropagation(), o.value) {
19
+ e.operation?.servers?.length && i.edit(e.operation.uid, "selectedServerUid", null), e.type === "collection" ? (u.edit(
21
20
  e.collection.uid,
22
21
  "selectedServerUid",
23
22
  void 0
24
- ), w(y.value, "scalar-update-selected-server", {
23
+ ), y(m.value, "scalar-update-selected-server", {
25
24
  value: void 0,
26
25
  options: { disableOldStoreUpdate: !0 }
27
- })) : e.type === "request" && e.operation && l.edit(e.operation.uid, "selectedServerUid", null);
26
+ })) : e.type === "request" && e.operation && i.edit(e.operation.uid, "selectedServerUid", null);
28
27
  return;
29
28
  }
30
- e.type === "collection" && e.collection ? ((h = (a = e.operation) == null ? void 0 : a.servers) != null && h.length && l.edit(e.operation.uid, "selectedServerUid", null), m.edit(
29
+ e.type === "collection" && e.collection ? (e.operation?.servers?.length && i.edit(e.operation.uid, "selectedServerUid", null), u.edit(
31
30
  e.collection.uid,
32
31
  "selectedServerUid",
33
32
  r
34
- ), w(y.value, "scalar-update-selected-server", {
35
- value: (g = b[r]) == null ? void 0 : g.url,
33
+ ), y(m.value, "scalar-update-selected-server", {
34
+ value: v[r]?.url,
36
35
  options: { disableOldStoreUpdate: !0 }
37
- })) : e.type === "request" && e.operation && l.edit(e.operation.uid, "selectedServerUid", r);
38
- }, o = k(() => {
39
- var r;
40
- return e.type === "collection" ? e.collection.selectedServerUid === e.serverOption.id && !((r = e.operation) != null && r.selectedServerUid) : e.type === "request" && e.operation ? e.operation.selectedServerUid === e.serverOption.id : !1;
41
- }), S = (r) => {
36
+ })) : e.type === "request" && e.operation && i.edit(e.operation.uid, "selectedServerUid", r);
37
+ }, o = b(() => e.type === "collection" ? e.collection.selectedServerUid === e.serverOption.id && !e.operation?.selectedServerUid : e.type === "request" && e.operation ? e.operation.selectedServerUid === e.serverOption.id : !1), f = (r) => {
42
38
  if (!r)
43
39
  return !1;
44
- const t = b[r];
45
- return Object.keys((t == null ? void 0 : t.variables) ?? {}).length > 0;
46
- }, d = k(
47
- () => {
48
- var r;
49
- return o.value && S(((r = e.server) == null ? void 0 : r.uid) ?? "");
50
- }
51
- ), V = (r, t) => {
52
- U("update:variable", r, t);
53
- }, y = M("wrapper-ref");
54
- return (r, t) => {
55
- var i, s;
56
- return c(), p("div", {
57
- ref: "wrapper-ref",
58
- class: I(["group/item flex min-h-fit flex-col rounded border", { "border-transparent": !o.value }])
40
+ const t = v[r];
41
+ return Object.keys(t?.variables ?? {}).length > 0;
42
+ }, l = b(
43
+ () => o.value && f(e.server?.uid ?? "")
44
+ ), w = (r, t) => {
45
+ k("update:variable", r, t);
46
+ }, m = C("wrapper-ref");
47
+ return (r, t) => (n(), a("div", {
48
+ ref: "wrapper-ref",
49
+ class: V(["group/item flex min-h-fit flex-col rounded border", { "border-transparent": !o.value }])
50
+ }, [
51
+ d("button", q(l.value ? { "aria-controls": s(c) } : {}, {
52
+ "aria-expanded": l.value,
53
+ class: ["flex min-h-8 cursor-pointer items-center gap-1.5 rounded px-1.5", o.value ? "text-c-1 bg-b-2" : "hover:bg-b-2"],
54
+ type: "button",
55
+ onClick: t[0] || (t[0] = (_) => x(r.serverOption.id, _))
56
+ }), [
57
+ p(s(I), { selected: o.value }, null, 8, ["selected"]),
58
+ d("span", j, E(r.serverOption.label), 1)
59
+ ], 16, P),
60
+ l.value ? (n(), a("div", {
61
+ key: 0,
62
+ id: s(c),
63
+ class: "bg-b-2 divide divide-y rounded-b border-t *:pl-4",
64
+ onClick: t[1] || (t[1] = M(() => {
65
+ }, ["stop"]))
59
66
  }, [
60
- u("button", N(d.value ? { "aria-controls": n(f) } : {}, {
61
- "aria-expanded": d.value,
62
- class: ["flex min-h-8 cursor-pointer items-center gap-1.5 rounded px-1.5", o.value ? "text-c-1 bg-b-2" : "hover:bg-b-2"],
63
- type: "button",
64
- onClick: t[0] || (t[0] = (a) => C(r.serverOption.id, a))
65
- }), [
66
- v(n(P), { selected: o.value }, null, 8, ["selected"]),
67
- u("span", T, B(r.serverOption.label), 1)
68
- ], 16, R),
69
- d.value ? (c(), p("div", {
70
- key: 0,
71
- id: n(f),
72
- class: "bg-b-2 divide divide-y rounded-b border-t *:pl-4",
73
- onClick: t[1] || (t[1] = D(() => {
74
- }, ["stop"]))
75
- }, [
76
- v(z, {
77
- variables: (i = r.server) == null ? void 0 : i.variables,
78
- "onUpdate:variable": V
79
- }, null, 8, ["variables"]),
80
- (s = r.server) != null && s.description ? (c(), p("div", $, [
81
- u("div", A, [
82
- v(n(j), {
83
- value: r.server.description
84
- }, null, 8, ["value"])
85
- ])
86
- ])) : x("", !0)
87
- ], 8, W)) : x("", !0)
88
- ], 2);
89
- };
67
+ p(B, {
68
+ variables: r.server?.variables,
69
+ "onUpdate:variable": w
70
+ }, null, 8, ["variables"]),
71
+ r.server?.description ? (n(), a("div", L, [
72
+ d("div", R, [
73
+ p(s(N), {
74
+ value: r.server.description
75
+ }, null, 8, ["value"])
76
+ ])
77
+ ])) : S("", !0)
78
+ ], 8, z)) : S("", !0)
79
+ ], 2));
90
80
  }
91
81
  });
92
82
  export {
93
- Q as default
83
+ G as default
94
84
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as w, computed as n, watch as b, createBlock as h, createElementBlock as y, openBlock as m, unref as i, withCtx as p, createVNode as g, createElementVNode as s, toDisplayString as S } from "vue";
2
- import { ScalarListbox as k, ScalarButton as U } from "@scalar/components";
3
- import { ScalarIconCaretDown as V } from "@scalar/icons";
4
- import { useWorkspace as B } from "../../store/store.js";
5
- const W = { class: "overflow-x-auto" }, z = {
1
+ import { defineComponent as x, computed as a, watch as w, createBlock as b, createElementBlock as h, openBlock as v, unref as n, withCtx as f, createVNode as m, createElementVNode as l, toDisplayString as p } from "vue";
2
+ import { ScalarListbox as y, ScalarButton as k } from "@scalar/components";
3
+ import { ScalarIconCaretDown as U } from "@scalar/icons";
4
+ import { useWorkspace as V } from "../../store/store.js";
5
+ const B = { class: "overflow-x-auto" }, W = {
6
6
  key: 1,
7
7
  class: "text-c-1 flex h-auto w-full items-center gap-0.75 rounded-b-lg px-3 py-1.5 text-base leading-[20px] whitespace-nowrap"
8
- }, C = { class: "overflow-x-auto" }, I = /* @__PURE__ */ w({
8
+ }, z = { class: "overflow-x-auto" }, j = /* @__PURE__ */ x({
9
9
  __name: "ServerSelector",
10
10
  props: {
11
11
  collection: {},
@@ -13,67 +13,56 @@ const W = { class: "overflow-x-auto" }, z = {
13
13
  target: {}
14
14
  },
15
15
  emits: ["updateServer"],
16
- setup(o, { emit: x }) {
17
- const u = x, { servers: l, collectionMutators: c } = B(), a = n(
18
- () => {
19
- var t;
20
- return (t = o.collection) == null ? void 0 : t.servers.map((e) => {
21
- var r;
22
- return {
23
- id: e,
24
- label: ((r = l[e]) == null ? void 0 : r.url) ?? "Unknown server"
25
- };
26
- });
27
- }
28
- ), d = n({
29
- get: () => o.server ? a.value.find((t) => t.id === o.server.uid) : void 0,
30
- set: (t) => {
31
- var r;
32
- if (!t)
16
+ setup(r, { emit: g }) {
17
+ const i = g, { servers: o, collectionMutators: u } = V(), s = a(
18
+ () => r.collection?.servers.map((e) => ({
19
+ id: e,
20
+ label: o[e]?.url ?? "Unknown server"
21
+ }))
22
+ ), c = a({
23
+ get: () => r.server ? s.value.find((e) => e.id === r.server.uid) : void 0,
24
+ set: (e) => {
25
+ if (!e)
33
26
  return;
34
- c.edit(
35
- o.collection.uid,
27
+ u.edit(
28
+ r.collection.uid,
36
29
  "selectedServerUid",
37
- t.id
30
+ e.id
38
31
  );
39
- const e = (r = l[t.id]) == null ? void 0 : r.url;
40
- e && u("updateServer", e);
32
+ const t = o[e.id]?.url;
33
+ t && i("updateServer", t);
41
34
  }
42
35
  });
43
- b(
44
- () => o.collection,
45
- (t) => {
46
- var r, f;
47
- if (!t || t.selectedServerUid)
36
+ w(
37
+ () => r.collection,
38
+ (e) => {
39
+ if (!e || e.selectedServerUid)
48
40
  return;
49
- const e = (r = o.collection.servers) == null ? void 0 : r[0];
50
- e && (c.edit(o.collection.uid, "selectedServerUid", e), (f = l[e]) != null && f.url && u("updateServer", l[e].url));
41
+ const t = r.collection.servers?.[0];
42
+ t && (u.edit(r.collection.uid, "selectedServerUid", t), o[t]?.url && i("updateServer", o[t].url));
51
43
  }
52
44
  );
53
- const v = n(() => {
54
- var t, e, r;
55
- return (e = (t = o.server) == null ? void 0 : t.url) != null && e.endsWith("/") ? o.server.url.slice(0, -1) : ((r = o.server) == null ? void 0 : r.url) || "";
56
- });
57
- return (t, e) => a.value.length > 1 ? (m(), h(i(k), {
45
+ const d = a(() => r.server?.url?.endsWith("/") ? r.server.url.slice(0, -1) : r.server?.url || "");
46
+ return (e, t) => s.value.length > 1 ? (v(), b(n(y), {
58
47
  key: 0,
59
- modelValue: d.value,
60
- "onUpdate:modelValue": e[0] || (e[0] = (r) => d.value = r),
61
- options: a.value,
48
+ modelValue: c.value,
49
+ "onUpdate:modelValue": t[0] || (t[0] = (S) => c.value = S),
50
+ options: s.value,
62
51
  placement: "bottom-start",
63
52
  resize: "",
64
- target: t.target,
65
- teleport: `#${t.target}`,
53
+ target: e.target,
54
+ teleport: `#${e.target}`,
66
55
  class: "group"
67
56
  }, {
68
- default: p(() => [
69
- g(i(U), {
57
+ default: f(() => [
58
+ m(n(k), {
70
59
  class: "bg-b-1 text-c-1 h-auto w-full justify-start gap-1.5 overflow-x-auto rounded-t-none rounded-b-lg px-3 py-1.5 text-base font-normal whitespace-nowrap -outline-offset-1",
71
60
  variant: "ghost"
72
61
  }, {
73
- default: p(() => [
74
- e[1] || (e[1] = s("span", { class: "sr-only" }, "Server:", -1)),
75
- s("span", W, S(v.value), 1),
76
- g(i(V), {
62
+ default: f(() => [
63
+ t[1] || (t[1] = l("span", { class: "sr-only" }, "Server:", -1)),
64
+ l("span", B, p(d.value), 1),
65
+ m(n(U), {
77
66
  weight: "bold",
78
67
  class: "text-c-2 ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100"
79
68
  })
@@ -83,12 +72,12 @@ const W = { class: "overflow-x-auto" }, z = {
83
72
  })
84
73
  ]),
85
74
  _: 1
86
- }, 8, ["modelValue", "options", "target", "teleport"])) : (m(), y("div", z, [
87
- e[2] || (e[2] = s("span", { class: "sr-only" }, "Server:", -1)),
88
- s("span", C, S(v.value), 1)
75
+ }, 8, ["modelValue", "options", "target", "teleport"])) : (v(), h("div", W, [
76
+ t[2] || (t[2] = l("span", { class: "sr-only" }, "Server:", -1)),
77
+ l("span", z, p(d.value), 1)
89
78
  ]));
90
79
  }
91
80
  });
92
81
  export {
93
- I as default
82
+ j as default
94
83
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as h, useId as k, createElementBlock as v, createCommentVNode as $, openBlock as a, Fragment as C, renderList as V, normalizeClass as B, createElementVNode as S, createBlock as p, unref as s, toDisplayString as j } from "vue";
2
- import E from "./ServerVariablesSelect.vue.js";
3
- import F from "./ServerVariablesTextbox.vue.js";
4
- const N = ["for"], z = /* @__PURE__ */ h({
1
+ import { defineComponent as m, useId as v, createElementBlock as c, createCommentVNode as p, openBlock as t, Fragment as g, renderList as y, normalizeClass as h, createElementVNode as k, createBlock as b, unref as a, toDisplayString as $ } from "vue";
2
+ import C from "./ServerVariablesSelect.vue.js";
3
+ import V from "./ServerVariablesTextbox.vue.js";
4
+ const B = ["for"], F = /* @__PURE__ */ m({
5
5
  __name: "ServerVariablesForm",
6
6
  props: {
7
7
  variables: {},
@@ -10,46 +10,40 @@ const N = ["for"], z = /* @__PURE__ */ h({
10
10
  layout: { default: "client" }
11
11
  },
12
12
  emits: ["update:variable"],
13
- setup(i, { emit: g }) {
14
- const y = g, n = k();
15
- function u(r, l) {
16
- y("update:variable", r, l);
13
+ setup(n, { emit: d }) {
14
+ const f = d, o = v();
15
+ function s(e, u) {
16
+ f("update:variable", e, u);
17
17
  }
18
- const c = (r) => {
19
- var l, e, t;
20
- return (((l = i.values) == null ? void 0 : l[r]) ?? ((t = (e = i.variables) == null ? void 0 : e[r]) == null ? void 0 : t.default) ?? "").toString();
21
- };
22
- return (r, l) => r.variables && Object.keys(r.variables ?? {}).length ? (a(!0), v(C, { key: 0 }, V(Object.keys(r.variables), (e) => {
23
- var t, b, d, f, m;
24
- return a(), v("div", {
25
- key: e,
26
- class: B([
27
- "group/label flex w-full",
28
- r.layout === "reference" && "items-center border-x border-b last:rounded-b-lg"
29
- ])
30
- }, [
31
- S("label", {
32
- for: `${s(n)}-${e}`,
33
- class: "flex items-center py-1.5 pl-3 group-has-[input]/label:mr-0 after:content-[':']"
34
- }, j(e), 9, N),
35
- (d = (b = (t = r.variables) == null ? void 0 : t[e]) == null ? void 0 : b.enum) != null && d.length ? (a(), p(E, {
36
- key: 0,
37
- id: `${s(n)}-${e}`,
38
- controls: r.controls,
39
- enum: ((m = (f = r.variables[e]) == null ? void 0 : f.enum) == null ? void 0 : m.map((o) => `${o}`)) ?? [],
40
- value: c(e),
41
- onChange: (o) => u(e, o)
42
- }, null, 8, ["id", "controls", "enum", "value", "onChange"])) : (a(), p(F, {
43
- key: 1,
44
- id: `${s(n)}-${e}`,
45
- controls: r.controls,
46
- value: c(e),
47
- onChange: (o) => u(e, o)
48
- }, null, 8, ["id", "controls", "value", "onChange"]))
49
- ], 2);
50
- }), 128)) : $("", !0);
18
+ const i = (e) => (n.values?.[e] ?? n.variables?.[e]?.default ?? "").toString();
19
+ return (e, u) => e.variables && Object.keys(e.variables ?? {}).length ? (t(!0), c(g, { key: 0 }, y(Object.keys(e.variables), (r) => (t(), c("div", {
20
+ key: r,
21
+ class: h([
22
+ "group/label flex w-full",
23
+ e.layout === "reference" && "items-center border-x border-b last:rounded-b-lg"
24
+ ])
25
+ }, [
26
+ k("label", {
27
+ for: `${a(o)}-${r}`,
28
+ class: "flex items-center py-1.5 pl-3 group-has-[input]/label:mr-0 after:content-[':']"
29
+ }, $(r), 9, B),
30
+ e.variables?.[r]?.enum?.length ? (t(), b(C, {
31
+ key: 0,
32
+ id: `${a(o)}-${r}`,
33
+ controls: e.controls,
34
+ enum: e.variables[r]?.enum?.map((l) => `${l}`) ?? [],
35
+ value: i(r),
36
+ onChange: (l) => s(r, l)
37
+ }, null, 8, ["id", "controls", "enum", "value", "onChange"])) : (t(), b(V, {
38
+ key: 1,
39
+ id: `${a(o)}-${r}`,
40
+ controls: e.controls,
41
+ value: i(r),
42
+ onChange: (l) => s(r, l)
43
+ }, null, 8, ["id", "controls", "value", "onChange"]))
44
+ ], 2))), 128)) : p("", !0);
51
45
  }
52
46
  });
53
47
  export {
54
- z as default
48
+ F as default
55
49
  };