@scalar/api-client 2.18.4 → 2.19.0

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 (223) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/components/AddressBar/AddressBar.vue2.js +5 -5
  3. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +6 -6
  4. package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
  5. package/dist/components/ImportCollection/DropEventListener.vue.js +26 -28
  6. package/dist/components/ImportCollection/utils/get-openapi-version.d.ts.map +1 -1
  7. package/dist/components/ImportCollection/utils/import-collection.d.ts +1 -1
  8. package/dist/components/ImportCollection/utils/import-collection.d.ts.map +1 -1
  9. package/dist/components/Search/useSearch.d.ts.map +1 -1
  10. package/dist/components/Search/useSearch.js +16 -16
  11. package/dist/components/Server/index.d.ts +1 -1
  12. package/dist/components/Server/index.d.ts.map +1 -1
  13. package/dist/components/Server/index.js +6 -6
  14. package/dist/components/SideNav/SideNav.vue.js +3 -3
  15. package/dist/components/Sidebar/index.d.ts +1 -2
  16. package/dist/components/Sidebar/index.d.ts.map +1 -1
  17. package/dist/components/index.d.ts +2 -2
  18. package/dist/components/index.d.ts.map +1 -1
  19. package/dist/hooks/index.d.ts +2 -2
  20. package/dist/hooks/index.d.ts.map +1 -1
  21. package/dist/hooks/useResponseBody.d.ts +1 -1
  22. package/dist/hooks/useResponseBody.d.ts.map +1 -1
  23. package/dist/hooks/useResponseBody.js +4 -4
  24. package/dist/hooks/useSidebar.d.ts +1 -1
  25. package/dist/hooks/useSidebar.d.ts.map +1 -1
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/layouts/App/ApiClientApp.vue.js +5 -5
  29. package/dist/layouts/App/MainLayout.vue.js +4 -4
  30. package/dist/layouts/App/create-api-client-app.d.ts +12 -12
  31. package/dist/layouts/App/index.d.ts +1 -1
  32. package/dist/layouts/App/index.d.ts.map +1 -1
  33. package/dist/layouts/Web/ApiClientWeb.vue.js +6 -6
  34. package/dist/layouts/Web/create-api-client-web.d.ts +12 -12
  35. package/dist/layouts/Web/index.d.ts +1 -1
  36. package/dist/layouts/Web/index.d.ts.map +1 -1
  37. package/dist/libs/create-client.d.ts +12 -12
  38. package/dist/libs/get-request-uid-by-path-method.d.ts +1 -1
  39. package/dist/libs/get-request-uid-by-path-method.d.ts.map +1 -1
  40. package/dist/libs/hot-keys.d.ts +2 -2
  41. package/dist/libs/hot-keys.d.ts.map +1 -1
  42. package/dist/libs/importers/curl.d.ts.map +1 -1
  43. package/dist/libs/index.d.ts +14 -15
  44. package/dist/libs/index.d.ts.map +1 -1
  45. package/dist/libs/index.js +33 -33
  46. package/dist/libs/parse-curl.js +4 -4
  47. package/dist/libs/send-request/create-fetch-body.d.ts +1 -1
  48. package/dist/libs/send-request/create-fetch-body.d.ts.map +1 -1
  49. package/dist/libs/send-request/create-fetch-body.js +1 -1
  50. package/dist/libs/send-request/create-fetch-headers.d.ts.map +1 -1
  51. package/dist/libs/send-request/create-fetch-query-params.d.ts.map +1 -1
  52. package/dist/libs/send-request/create-fetch-query-params.js +2 -1
  53. package/dist/libs/send-request/index.d.ts +1 -1
  54. package/dist/libs/send-request/index.d.ts.map +1 -1
  55. package/dist/libs/send-request/index.js +4 -4
  56. package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -1
  57. package/dist/libs/send-request/set-request-cookies.js +4 -4
  58. package/dist/store/active-entities.d.ts +1 -1
  59. package/dist/store/collections.d.ts +1 -1
  60. package/dist/store/collections.d.ts.map +1 -1
  61. package/dist/store/collections.js +4 -4
  62. package/dist/store/environment.d.ts +1 -1
  63. package/dist/store/environment.d.ts.map +1 -1
  64. package/dist/store/environment.js +4 -4
  65. package/dist/store/import-spec.d.ts +2 -2
  66. package/dist/store/import-spec.d.ts.map +1 -1
  67. package/dist/store/index.d.ts +1 -1
  68. package/dist/store/index.d.ts.map +1 -1
  69. package/dist/store/request-example.d.ts +1 -1
  70. package/dist/store/request-example.d.ts.map +1 -1
  71. package/dist/store/request-example.js +6 -6
  72. package/dist/store/requests.d.ts +1 -1
  73. package/dist/store/requests.d.ts.map +1 -1
  74. package/dist/store/requests.js +8 -8
  75. package/dist/store/security-schemes.d.ts +1 -1
  76. package/dist/store/security-schemes.d.ts.map +1 -1
  77. package/dist/store/security-schemes.js +4 -4
  78. package/dist/store/servers.d.ts +1 -1
  79. package/dist/store/servers.d.ts.map +1 -1
  80. package/dist/store/servers.js +4 -4
  81. package/dist/store/store.d.ts +12 -12
  82. package/dist/store/tags.d.ts +1 -1
  83. package/dist/store/tags.d.ts.map +1 -1
  84. package/dist/store/tags.js +5 -5
  85. package/dist/store/workspace.d.ts +13 -13
  86. package/dist/store/workspace.d.ts.map +1 -1
  87. package/dist/store/workspace.js +7 -7
  88. package/dist/style.css +1 -1
  89. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +4 -5
  90. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  91. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +17 -16
  92. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +3 -3
  93. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -1
  94. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +22 -22
  95. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
  96. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +14 -13
  97. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
  98. package/dist/v2/blocks/operation-block/helpers/build-request.js +43 -41
  99. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts +14 -0
  100. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts.map +1 -0
  101. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js +14 -0
  102. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts +25 -0
  103. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts.map +1 -0
  104. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js +17 -0
  105. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +10 -0
  106. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  107. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  108. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +29 -25
  109. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +6 -1
  110. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  111. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +27 -23
  112. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +10 -1
  113. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  114. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +48 -39
  115. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  116. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +49 -46
  117. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.d.ts +1 -1
  118. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.d.ts.map +1 -1
  119. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.js +1 -1
  120. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +6 -2
  121. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  122. package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
  123. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +200 -115
  124. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +4 -4
  125. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  126. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +21 -17
  127. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +16 -10
  128. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  129. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +32 -45
  130. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +16 -13
  131. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  132. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +4 -4
  133. package/dist/v2/blocks/request-block/components/RequestTable.vue2.js +32 -33
  134. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +33 -18
  135. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  136. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +106 -106
  137. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +10 -5
  138. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
  139. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +60 -31
  140. package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts +41 -0
  141. package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -0
  142. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +25 -0
  143. package/dist/v2/blocks/request-block/helpers/group-by.d.ts +1 -1
  144. package/dist/v2/blocks/request-block/helpers/group-by.d.ts.map +1 -1
  145. package/dist/v2/blocks/request-block/helpers/group-by.js +6 -3
  146. package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts +13 -0
  147. package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts.map +1 -0
  148. package/dist/v2/blocks/request-block/helpers/is-param-disabled.js +7 -0
  149. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  150. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  151. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +61 -63
  152. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +1 -2
  153. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  154. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +2 -2
  155. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +2 -2
  156. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +1 -2
  157. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  158. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -2
  159. package/dist/v2/components/code-input/CodeInput.vue.d.ts +2 -0
  160. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  161. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  162. package/dist/v2/components/code-input/CodeInput.vue2.js +57 -51
  163. package/dist/v2/features/app/App.vue.js +6 -6
  164. package/dist/v2/features/app/app-events.d.ts +5 -9
  165. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  166. package/dist/v2/features/app/app-events.js +146 -120
  167. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  168. package/dist/v2/features/app/app-state.js +69 -71
  169. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  170. package/dist/v2/features/app/components/AppSidebar.vue2.js +5 -5
  171. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  172. package/dist/v2/features/modal/Modal.vue.js +1 -1
  173. package/dist/v2/features/modal/Modal.vue2.js +21 -22
  174. package/dist/v2/features/modal/index.d.ts +1 -1
  175. package/dist/v2/features/modal/index.d.ts.map +1 -1
  176. package/dist/v2/features/modal/index.js +4 -4
  177. package/dist/v2/features/modal/modal-events.d.ts +13 -0
  178. package/dist/v2/features/modal/modal-events.d.ts.map +1 -0
  179. package/dist/v2/features/modal/modal-events.js +31 -0
  180. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  181. package/dist/v2/features/operation/Operation.vue.js +30 -43
  182. package/dist/v2/workspace-events.d.ts +25 -0
  183. package/dist/v2/workspace-events.d.ts.map +1 -0
  184. package/dist/v2/workspace-events.js +202 -0
  185. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.d.ts.map +1 -1
  186. package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts +1 -1
  187. package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts.map +1 -1
  188. package/dist/views/Cookies/Cookies.vue2.js +3 -3
  189. package/dist/views/Environment/handle-drag.d.ts +1 -1
  190. package/dist/views/Environment/handle-drag.d.ts.map +1 -1
  191. package/dist/views/Request/RequestRoot.vue2.js +9 -9
  192. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +4 -4
  193. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +4 -4
  194. package/dist/views/Request/RequestSection/RequestSection.vue2.js +5 -5
  195. package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts.map +1 -1
  196. package/dist/views/Request/RequestSidebar.vue2.js +6 -6
  197. package/dist/views/Request/RequestSidebarItem.vue2.js +6 -6
  198. package/dist/views/Request/RequestSubpageHeader.vue2.js +4 -4
  199. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  200. package/dist/views/Request/ResponseSection/index.d.ts +1 -1
  201. package/dist/views/Request/ResponseSection/index.d.ts.map +1 -1
  202. package/dist/views/Request/ResponseSection/index.js +4 -4
  203. package/dist/views/Request/consts/index.d.ts +2 -3
  204. package/dist/views/Request/consts/index.d.ts.map +1 -1
  205. package/dist/views/Request/consts/new-auth-options.d.ts +1 -1
  206. package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -1
  207. package/dist/views/Request/handle-drag.d.ts +1 -1
  208. package/dist/views/Request/handle-drag.d.ts.map +1 -1
  209. package/dist/views/Request/hooks/useOpenApiWatcher.d.ts.map +1 -1
  210. package/dist/views/Request/hooks/useOpenApiWatcher.js +14 -14
  211. package/dist/views/Request/libs/auth.d.ts +1 -1
  212. package/dist/views/Request/libs/auth.d.ts.map +1 -1
  213. package/dist/views/Request/libs/index.d.ts +3 -3
  214. package/dist/views/Request/libs/index.d.ts.map +1 -1
  215. package/dist/views/Request/libs/oauth2.js +1 -1
  216. package/dist/views/Request/libs/watch-mode.js +6 -6
  217. package/dist/views/Request/types/index.d.ts +1 -1
  218. package/dist/views/Request/types/index.d.ts.map +1 -1
  219. package/package.json +13 -13
  220. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +0 -18
  221. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +0 -1
  222. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +0 -39
  223. package/dist/v2/features/operation/helpers/get-operation-header.js +0 -12
@@ -1,24 +1,21 @@
1
- import { defineComponent as W, useId as D, computed as S, ref as U, useTemplateRef as V, onMounted as F, onBeforeUnmount as H, createElementBlock as z, openBlock as x, unref as l, createElementVNode as o, normalizeClass as P, createVNode as a, createCommentVNode as E, normalizeStyle as O, createBlock as K, withCtx as R, createTextVNode as b, toDisplayString as m } from "vue";
1
+ import { defineComponent as D, useId as F, computed as w, ref as S, useTemplateRef as U, onMounted as H, onBeforeUnmount as W, createElementBlock as R, openBlock as h, unref as l, createElementVNode as o, normalizeClass as O, createVNode as a, createCommentVNode as z, normalizeStyle as P, createBlock as K, withCtx as E, createTextVNode as x, toDisplayString as m } from "vue";
2
2
  import { ScalarButton as $, ScalarWrappingText as Q, ScalarIcon as j } from "@scalar/components";
3
3
  import { REQUEST_METHODS as G } from "@scalar/helpers/http/http-info";
4
- import { replaceVariables as J } from "@scalar/helpers/regex/replace-variables";
5
- import { mergeUrls as X } from "@scalar/helpers/url/merge-urls";
6
- import { ScalarIconCopy as Y, ScalarIconWarningCircle as Z } from "@scalar/icons";
7
- import { useClipboard as _ } from "@scalar/use-hooks/useClipboard";
8
- import { getEnvironmentVariables as ee } from "../../operation-block/helpers/get-environment-variables.js";
9
- import { getServerUrl as te } from "../../operation-block/helpers/get-server-url.js";
10
- import { useLoadingAnimation as ne } from "../hooks/use-loading-animation.js";
11
- import oe from "./AddressBarHistory.vue.js";
12
- import le from "../../../../components/HttpMethod/HttpMethod.vue.js";
13
- import se from "../../../components/server/ServerDropdown.vue.js";
14
- import ae from "../../../components/code-input/CodeInput.vue.js";
15
- const re = ["id"], ie = { class: "pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border" }, de = { class: "z-context-plus flex gap-1" }, ue = { class: "scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal" }, me = {
4
+ import { ScalarIconCopy as J, ScalarIconWarningCircle as X } from "@scalar/icons";
5
+ import { useClipboard as Y } from "@scalar/use-hooks/useClipboard";
6
+ import { getResolvedUrl as Z } from "../../operation-block/helpers/get-resolved-url.js";
7
+ import { useLoadingAnimation as _ } from "../hooks/use-loading-animation.js";
8
+ import ee from "./AddressBarHistory.vue.js";
9
+ import te from "../../../../components/HttpMethod/HttpMethod.vue.js";
10
+ import ne from "../../../components/server/ServerDropdown.vue.js";
11
+ import oe from "../../../components/code-input/CodeInput.vue.js";
12
+ const le = ["id"], se = { class: "pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border" }, ae = { class: "z-context-plus flex gap-1" }, re = { class: "scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal" }, ie = {
16
13
  key: 0,
17
14
  class: "z-context absolute inset-x-0 top-[calc(100%+4px)] flex flex-col items-center rounded px-6"
18
- }, ce = { class: "text-c-danger bg-b-danger border-c-danger flex items-center gap-1 rounded border p-1" }, fe = { class: "min-w-0 flex-1" }, ve = {
15
+ }, de = { class: "text-c-danger bg-b-danger border-c-danger flex items-center gap-1 rounded border p-1" }, ue = { class: "min-w-0 flex-1" }, me = {
19
16
  "aria-hidden": "true",
20
17
  class: "inline-flex items-center gap-1"
21
- }, he = { class: "sr-only" }, Re = /* @__PURE__ */ W({
18
+ }, ce = { class: "sr-only" }, we = /* @__PURE__ */ D({
22
19
  __name: "AddressBar",
23
20
  props: {
24
21
  path: {},
@@ -31,72 +28,73 @@ const re = ["id"], ie = { class: "pointer-events-none absolute top-0 left-0 bloc
31
28
  environment: {}
32
29
  },
33
30
  emits: ["execute", "update:servers"],
34
- setup(e, { expose: q, emit: T }) {
35
- const c = T, f = D(), { percentage: g, startLoading: y, stopLoading: v } = ne(), I = S(() => ({
31
+ setup(e, { expose: V, emit: q }) {
32
+ const c = q, f = F(), { percentage: b, startLoading: g, stopLoading: v } = _(), T = w(() => ({
36
33
  backgroundColor: `color-mix(in srgb, transparent 90%, ${G[e.method].colorVar})`,
37
- transform: `translate3d(-${g.value}%,0,0)`
38
- })), i = U(null), r = U(null), B = S(() => r.value || i.value), p = (n, t, s) => {
39
- const h = d.value?.cursorPosition();
34
+ transform: `translate3d(-${b.value}%,0,0)`
35
+ })), i = S(null), r = S(null), y = w(() => r.value || i.value), B = (n, t, s) => {
36
+ const N = d.value?.cursorPosition();
40
37
  e.eventBus.emit(
41
38
  "operation:update:pathMethod",
42
39
  {
43
40
  meta: { method: e.method, path: e.path },
44
41
  payload: { method: n, path: t },
45
42
  callback: (u) => {
46
- (u === "success" || u === "no-change") && (r.value = null, i.value = null), u === "success" ? e.eventBus.emit("ui:focus:address-bar", { position: h }) : u === "conflict" && (n !== e.method && (r.value = n), t !== e.path && (i.value = t));
43
+ (u === "success" || u === "no-change") && (r.value = null, i.value = null), u === "success" ? e.eventBus.emit("ui:focus:address-bar", { position: N }) : u === "conflict" && (n !== e.method && (r.value = n), t !== e.path && (i.value = t));
47
44
  }
48
45
  },
49
46
  s
50
47
  );
51
- }, L = (n) => p(n, i.value ?? e.path), A = (n) => {
48
+ }, I = (n) => B(n, i.value ?? e.path), L = (n) => {
52
49
  const t = n.startsWith("/") ? n : `/${n}`;
53
- p(r.value ?? e.method, t, {
50
+ B(r.value ?? e.method, t, {
54
51
  debounceKey: `operation:update:pathMethod-${e.path}-${e.method}`
55
52
  });
56
- }, C = V("sendButtonRef"), d = V("addressBarRef"), k = () => C.value?.$el?.focus(), w = (n) => {
53
+ }, C = U("sendButtonRef"), d = U("addressBarRef"), p = () => C.value?.$el?.focus(), k = (n) => {
57
54
  if (d.value?.isFocused && e.layout !== "desktop")
58
55
  return;
59
56
  const t = n && "position" in n ? n.position : "end";
60
57
  d.value?.focus(t), n && "event" in n && n.event.preventDefault();
61
58
  };
62
- F(() => {
63
- e.eventBus.on("ui:focus:address-bar", w), e.eventBus.on("ui:focus:send-button", k), e.eventBus.on("hooks:on:request:sent", y), e.eventBus.on("hooks:on:request:complete", v);
64
- }), H(() => {
65
- e.eventBus.off("ui:focus:address-bar", w), e.eventBus.off("ui:focus:send-button", k), e.eventBus.off("hooks:on:request:sent", y), e.eventBus.off("hooks:on:request:complete", v), v();
59
+ H(() => {
60
+ e.eventBus.on("ui:focus:address-bar", k), e.eventBus.on("ui:focus:send-button", p), e.eventBus.on("hooks:on:request:sent", g), e.eventBus.on("hooks:on:request:complete", v);
61
+ }), W(() => {
62
+ e.eventBus.off("ui:focus:address-bar", k), e.eventBus.off("ui:focus:send-button", p), e.eventBus.off("hooks:on:request:sent", g), e.eventBus.off("hooks:on:request:complete", v), v();
66
63
  });
67
- const { copyToClipboard: M } = _(), N = async () => {
68
- const n = ee(e.environment), t = te(e.server, n), s = J(e.path, n), h = X(t, s);
69
- await M(h);
64
+ const { copyToClipboard: A } = Y(), M = async () => {
65
+ await A(
66
+ Z({ environment: e.environment, server: e.server, path: e.path, pathVariables: {} })
67
+ );
70
68
  };
71
- return q({
69
+ return V({
72
70
  methodConflict: r,
73
71
  pathConflict: i
74
- }), (n, t) => (x(), z("div", {
72
+ }), (n, t) => (h(), R("div", {
75
73
  id: l(f),
76
74
  class: "scalar-address-bar order-last flex h-(--scalar-address-bar-height) w-full [--scalar-address-bar-height:32px] lg:order-none lg:w-auto"
77
75
  }, [
78
76
  o("div", {
79
- class: P(["address-bar-bg-states text-xxs group relative order-last flex w-full max-w-[calc(100dvw-24px)] flex-1 flex-row items-stretch rounded-lg p-0.75 lg:order-none lg:max-w-[580px] lg:min-w-[580px] xl:max-w-[720px] xl:min-w-[720px]", {
80
- "outline-c-danger outline": B.value
77
+ class: O(["address-bar-bg-states text-xxs group relative order-last flex w-full max-w-[calc(100dvw-24px)] flex-1 flex-row items-stretch rounded-lg p-0.75 lg:order-none lg:max-w-[580px] lg:min-w-[580px] xl:max-w-[720px] xl:min-w-[720px]", {
78
+ "outline-c-danger outline": y.value
81
79
  }])
82
80
  }, [
83
- o("div", ie, [
81
+ o("div", se, [
84
82
  o("div", {
85
83
  class: "absolute top-0 left-0 z-[1002] h-full w-full",
86
- style: O(I.value)
84
+ style: P(T.value)
87
85
  }, null, 4)
88
86
  ]),
89
- o("div", de, [
90
- a(l(le), {
87
+ o("div", ae, [
88
+ a(l(te), {
91
89
  isEditable: e.layout !== "modal",
92
90
  isSquare: "",
93
91
  method: r.value ?? e.method,
94
92
  teleport: "",
95
- onChange: L
93
+ onChange: I
96
94
  }, null, 8, ["isEditable", "method"])
97
95
  ]),
98
- o("div", ue, [
99
- e.servers.length ? (x(), K(l(se), {
96
+ o("div", re, [
97
+ e.servers.length ? (h(), K(l(ne), {
100
98
  key: 0,
101
99
  layout: e.layout,
102
100
  server: e.server,
@@ -105,9 +103,9 @@ const re = ["id"], ie = { class: "pointer-events-none absolute top-0 left-0 bloc
105
103
  "onUpdate:selectedServer": t[0] || (t[0] = (s) => e.eventBus.emit("server:update:selected", s)),
106
104
  "onUpdate:servers": t[1] || (t[1] = (s) => c("update:servers")),
107
105
  "onUpdate:variable": t[2] || (t[2] = (s) => e.eventBus.emit("server:update:variables", s))
108
- }, null, 8, ["layout", "server", "servers", "target"])) : E("", !0),
106
+ }, null, 8, ["layout", "server", "servers", "target"])) : z("", !0),
109
107
  t[6] || (t[6] = o("div", { class: "fade-left" }, null, -1)),
110
- a(l(ae), {
108
+ a(l(oe), {
111
109
  ref_key: "addressBarRef",
112
110
  ref: d,
113
111
  alwaysEmitChange: "",
@@ -131,7 +129,7 @@ const re = ["id"], ie = { class: "pointer-events-none absolute top-0 left-0 bloc
131
129
  }
132
130
  })),
133
131
  onSubmit: t[4] || (t[4] = (s) => c("execute")),
134
- "onUpdate:modelValue": A
132
+ "onUpdate:modelValue": L
135
133
  }, null, 8, ["disabled", "environment", "layout", "modelValue", "placeholder"]),
136
134
  t[7] || (t[7] = o("div", { class: "fade-right" }, null, -1))
137
135
  ]),
@@ -139,41 +137,41 @@ const re = ["id"], ie = { class: "pointer-events-none absolute top-0 left-0 bloc
139
137
  class: "hover:bg-b-3 mx-1",
140
138
  size: "xs",
141
139
  variant: "ghost",
142
- onClick: N
140
+ onClick: M
143
141
  }, {
144
- default: R(() => [
145
- a(l(Y)),
142
+ default: E(() => [
143
+ a(l(J)),
146
144
  t[8] || (t[8] = o("span", { class: "sr-only" }, "Copy URL", -1))
147
145
  ]),
148
146
  _: 1
149
147
  }),
150
- a(oe, {
148
+ a(ee, {
151
149
  history: e.history,
152
150
  target: l(f)
153
151
  }, null, 8, ["history", "target"]),
154
- B.value ? (x(), z("div", me, [
155
- o("div", ce, [
156
- a(l(Z), { size: "sm" }),
157
- o("div", fe, [
158
- t[9] || (t[9] = b(" A ", -1)),
152
+ y.value ? (h(), R("div", ie, [
153
+ o("div", de, [
154
+ a(l(X), { size: "sm" }),
155
+ o("div", ue, [
156
+ t[9] || (t[9] = x(" A ", -1)),
159
157
  o("em", null, m(r.value?.toUpperCase() ?? e.method.toUpperCase()), 1),
160
- t[10] || (t[10] = b(" request to ", -1)),
158
+ t[10] || (t[10] = x(" request to ", -1)),
161
159
  a(l(Q), {
162
160
  text: i.value ?? e.path
163
161
  }, null, 8, ["text"]),
164
- t[11] || (t[11] = b(" already exists in this document ", -1))
162
+ t[11] || (t[11] = x(" already exists in this document ", -1))
165
163
  ])
166
164
  ])
167
- ])) : E("", !0),
165
+ ])) : z("", !0),
168
166
  a(l($), {
169
167
  ref_key: "sendButtonRef",
170
168
  ref: C,
171
169
  class: "z-context-plus relative h-auto shrink-0 overflow-hidden py-1 pr-2.5 pl-2 font-bold",
172
- disabled: l(g) < 100,
170
+ disabled: l(b) < 100,
173
171
  onClick: t[5] || (t[5] = (s) => c("execute"))
174
172
  }, {
175
- default: R(() => [
176
- o("span", ve, [
173
+ default: E(() => [
174
+ o("span", me, [
177
175
  a(l(j), {
178
176
  class: "relative shrink-0 fill-current",
179
177
  icon: "Play",
@@ -181,14 +179,14 @@ const re = ["id"], ie = { class: "pointer-events-none absolute top-0 left-0 bloc
181
179
  }),
182
180
  t[12] || (t[12] = o("span", { class: "text-xxs hidden lg:flex" }, "Send", -1))
183
181
  ]),
184
- o("span", he, " Send " + m(e.method) + " request to " + m(e.server?.url ?? "") + m(e.path), 1)
182
+ o("span", ce, " Send " + m(e.method) + " request to " + m(e.server?.url ?? "") + m(e.path), 1)
185
183
  ]),
186
184
  _: 1
187
185
  }, 8, ["disabled"])
188
186
  ], 2)
189
- ], 8, re));
187
+ ], 8, le));
190
188
  }
191
189
  });
192
190
  export {
193
- Re as default
191
+ we as default
194
192
  };
@@ -1,6 +1,5 @@
1
1
  import { type Icon } from '@scalar/components';
2
- import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
- import type { AuthMeta } from '@scalar/workspace-store/mutators';
2
+ import type { AuthMeta, WorkspaceEventBus } from '@scalar/workspace-store/events';
4
3
  import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
5
4
  import type { OpenApiDocument, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
6
5
  import { type SecuritySchemeOption } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js';
@@ -1 +1 @@
1
- {"version":3,"file":"AuthSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue"],"names":[],"mappings":"AAkTA,OAAO,EAML,KAAK,IAAI,EAEV,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,eAAe,EAEf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,gEAAgE,CAAA;AAKvE,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,oBAAoB,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACjD,eAAe,EAAE,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAA;IAC9E,gBAAgB,EAAE,eAAe,CAAC,4BAA4B,CAAC,CAAA;IAC/D,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;;cA+BqC,IAAI;cAAQ,MAAM;;;;;AA6bzD,wBAOG"}
1
+ {"version":3,"file":"AuthSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue"],"names":[],"mappings":"AAoTA,OAAO,EAML,KAAK,IAAI,EAEV,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAGvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,eAAe,EAEf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,gEAAgE,CAAA;AAKvE,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,oBAAoB,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACjD,eAAe,EAAE,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAA;IAC9E,gBAAgB,EAAE,eAAe,CAAC,4BAA4B,CAAC,CAAA;IAC/D,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;;cA+BqC,IAAI;cAAQ,MAAM;;;;;AA6bzD,wBAOG"}
@@ -18,7 +18,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
18
18
  description: string;
19
19
  flowType: keyof OAuthFlowsObject;
20
20
  };
21
- meta: import("@scalar/workspace-store/mutators").AuthMeta;
21
+ meta: import("@scalar/workspace-store/events").AuthMeta;
22
22
  }, "scopes" | "newScopePayload">) => any;
23
23
  "update:securityScheme": (payload: ({
24
24
  type: "http";
@@ -118,7 +118,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
118
118
  description: string;
119
119
  flowType: keyof OAuthFlowsObject;
120
120
  };
121
- meta: import("@scalar/workspace-store/mutators").AuthMeta;
121
+ meta: import("@scalar/workspace-store/events").AuthMeta;
122
122
  }, "scopes" | "newScopePayload">) => any) | undefined;
123
123
  "onUpdate:securityScheme"?: ((payload: ({
124
124
  type: "http";
@@ -14,7 +14,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
14
14
  description: string;
15
15
  flowType: keyof OAuthFlowsObject;
16
16
  };
17
- meta: import("@scalar/workspace-store/mutators").AuthMeta;
17
+ meta: import("@scalar/workspace-store/events").AuthMeta;
18
18
  }, "scopes" | "newScopePayload">) => any;
19
19
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
20
20
  "onUpdate:selectedScopes"?: ((payload: Pick<{
@@ -26,7 +26,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
26
26
  description: string;
27
27
  flowType: keyof OAuthFlowsObject;
28
28
  };
29
- meta: import("@scalar/workspace-store/mutators").AuthMeta;
29
+ meta: import("@scalar/workspace-store/events").AuthMeta;
30
30
  }, "scopes" | "newScopePayload">) => any) | undefined;
31
31
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
32
  export default _default;
@@ -1,5 +1,4 @@
1
- import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
- import type { AuthMeta } from '@scalar/workspace-store/mutators';
1
+ import type { AuthMeta, WorkspaceEventBus } from '@scalar/workspace-store/events';
3
2
  import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
4
3
  import type { ComponentsObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
5
4
  import type { SecuritySchemeOption } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js';
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAwJA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAK1G,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IACpD,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;AA2OF,wBAOG"}
1
+ {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAwJA,OAAO,KAAK,EAEV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAK1G,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IACpD,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;AA2OF,wBAOG"}
@@ -19,7 +19,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
19
19
  description: string;
20
20
  flowType: keyof import("@scalar/workspace-store/schemas/v3.1/strict/oauthflows").OAuthFlowsObject;
21
21
  };
22
- meta: import("@scalar/workspace-store/mutators").AuthMeta;
22
+ meta: import("@scalar/workspace-store/events").AuthMeta;
23
23
  }, "meta">) => any;
24
24
  "update:securityScheme": (payload: ({
25
25
  type: "http";
@@ -119,7 +119,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
119
119
  description: string;
120
120
  flowType: keyof import("@scalar/workspace-store/schemas/v3.1/strict/oauthflows").OAuthFlowsObject;
121
121
  };
122
- meta: import("@scalar/workspace-store/mutators").AuthMeta;
122
+ meta: import("@scalar/workspace-store/events").AuthMeta;
123
123
  }, "meta">) => any) | undefined;
124
124
  "onUpdate:securityScheme"?: ((payload: ({
125
125
  type: "http";
@@ -86,6 +86,8 @@ declare const _default: <T extends CodeInputModelValue>(__VLS_props: NonNullable
86
86
  handleFieldChange?: (value: T) => void;
87
87
  /** Custom submit handler, prevents default emit */
88
88
  handleFieldSubmit?: (value: string) => void;
89
+ /** Put a linethrough on the input text */
90
+ linethrough?: boolean;
89
91
  } & Partial<{}>> & import("vue").PublicProps;
90
92
  expose(exposed: import("vue").ShallowUnwrapRef<{
91
93
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/code-input/CodeInput.vue"],"names":[],"mappings":"AA4tBA,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAEnH,OAAO,EAAyC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAIrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKrD,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAE3B;;;;;;;;;;;;;;;;;;;;;GAqBG;yBACc,CAAC,SAAS,mBAAmB,EAC7C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WA0wBO,mBAAmB,CAAC;;;;;;;oBAlwBd,CAAC;QACb,6FAA6F;qBAChF,kBAAkB,GAAG,SAAS;QAC3C,mEAAmE;eAC5D,MAAM,GAAG,MAAM,EAAE;QACxB,sCAAsC;mBAC3B,OAAO;QAClB,yBAAyB;gBACjB,OAAO;QACf,kDAAkD;iBACzC,YAAY;QACrB,mDAAmD;eAC5C,MAAM,EAAE;QACf,2CAA2C;mBAChC,MAAM,EAAE;QACnB,2CAA2C;;QAE3C,2CAA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-helper.js";
5
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d6129762"]]);
5
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e2bff922"]]);
6
6
  export {
7
- a as default
7
+ e as default
8
8
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as Q, useAttrs as G, ref as d, computed as s, toRef as r, watch as X, createElementBlock as i, openBlock as o, Fragment as Y, createBlock as y, createCommentVNode as c, normalizeClass as Z, createElementVNode as V, toDisplayString as _, mergeProps as ee, unref as O, withKeys as b, withModifiers as $, createTextVNode as p, renderSlot as I } from "vue";
1
+ import { defineComponent as Q, useAttrs as G, ref as d, computed as s, toRef as r, watch as X, createElementBlock as i, openBlock as a, Fragment as Y, createBlock as y, createCommentVNode as c, normalizeClass as Z, createElementVNode as V, toDisplayString as _, mergeProps as ee, unref as O, withKeys as h, withModifiers as $, createTextVNode as p, renderSlot as I } from "vue";
2
2
  import { isDefined as te } from "@scalar/helpers/array/is-defined";
3
- import { useCodeMirror as ne, useDropdown as le, colorPicker as ae } from "@scalar/use-codemirror";
4
- import { nanoid as oe } from "nanoid";
3
+ import { useCodeMirror as le, useDropdown as ne, colorPicker as oe } from "@scalar/use-codemirror";
4
+ import { nanoid as ae } from "nanoid";
5
5
  import B from "../data-table/DataTableInputSelect.vue.js";
6
6
  import re from "../../features/environments/components/EnvironmentVariablesDropdown.vue.js";
7
7
  import { pillPlugin as ie, backspaceCommand as ue } from "./code-variable-widget.js";
@@ -18,10 +18,10 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
18
18
  }, ye = {
19
19
  key: 7,
20
20
  class: "required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 mr-0.5 pt-px pr-2 opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 group-[.alert]:bg-transparent group-[.alert]:shadow-none group-[.error]:bg-transparent group-[.error]:shadow-none peer-has-[.cm-focused]:opacity-0"
21
- }, be = {
21
+ }, he = {
22
22
  inheritAttrs: !1
23
23
  }, ke = /* @__PURE__ */ Q({
24
- ...be,
24
+ ...he,
25
25
  __name: "CodeInput",
26
26
  props: {
27
27
  modelValue: {},
@@ -50,34 +50,35 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
50
50
  importCurl: { type: Boolean, default: !1 },
51
51
  alwaysEmitChange: { type: Boolean, default: !1 },
52
52
  handleFieldChange: { type: Function },
53
- handleFieldSubmit: { type: Function }
53
+ handleFieldSubmit: { type: Function },
54
+ linethrough: { type: Boolean }
54
55
  },
55
56
  emits: ["update:modelValue", "submit", "blur", "curl", "redirectToEnvironment"],
56
57
  setup(e, { expose: M, emit: N }) {
57
- const u = N, k = G(), R = k.id || `id-${oe()}`, h = d(!1), q = s(() => e.enum?.length ? !1 : e.type === "boolean" || Array.isArray(e.type) && e.type.includes("boolean")), C = s(() => e.nullable ? ["true", "false", "null"] : ["true", "false"]), z = s(() => Array.isArray(e.type) ? e.type.find((t) => t !== "null") ?? "string" : e.type), E = (t) => {
58
+ const u = N, k = G(), R = k.id || `id-${ae()}`, b = d(!1), q = s(() => e.enum?.length ? !1 : e.type === "boolean" || Array.isArray(e.type) && e.type.includes("boolean")), C = s(() => e.nullable ? ["true", "false", "null"] : ["true", "false"]), z = s(() => Array.isArray(e.type) ? e.type.find((t) => t !== "null") ?? "string" : e.type), E = (t) => {
58
59
  if (!e.alwaysEmitChange && t === f(e.modelValue))
59
60
  return;
60
61
  if (typeof t == "string" && e.importCurl && t.trim().toLowerCase().startsWith("curl")) {
61
- u("curl", t), l.value && l.value.dispatch({
62
+ u("curl", t), n.value && n.value.dispatch({
62
63
  changes: {
63
64
  from: 0,
64
- to: l.value.state.doc.length,
65
+ to: n.value.state.doc.length,
65
66
  insert: f(e.modelValue)
66
67
  }
67
68
  });
68
69
  return;
69
70
  }
70
- const n = T(t);
71
- e.handleFieldChange ? e.handleFieldChange(n) : u("update:modelValue", n);
71
+ const l = T(t);
72
+ e.handleFieldChange ? e.handleFieldChange(l) : u("update:modelValue", l);
72
73
  }, g = (t) => {
73
74
  e.handleFieldSubmit ? e.handleFieldSubmit(t) : u("submit", t);
74
75
  }, S = (t) => {
75
- h.value = !1, e.emitOnBlur && e.modelValue && g(t), u("blur", t);
76
+ b.value = !1, e.emitOnBlur && e.modelValue && g(t), u("blur", t);
76
77
  }, v = (t) => {
77
78
  u("update:modelValue", t);
78
79
  }, W = () => {
79
80
  const t = [...e.extensions];
80
- return e.colorPicker && t.push(ae), t;
81
+ return e.colorPicker && t.push(oe), t;
81
82
  }, K = s(
82
83
  () => ie({
83
84
  environment: e.environment,
@@ -88,22 +89,22 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
88
89
  K.value,
89
90
  ue
90
91
  ]), P = d(null), f = (t) => typeof t == "object" ? JSON.stringify(t) : String(t ?? ""), T = (t) => {
91
- const n = t.trim(), a = n.startsWith("[") || n.startsWith("{"), F = typeof e.modelValue;
92
- if (Array.isArray(e.modelValue) && !a && n.includes(","))
93
- return n.split(",").map((H) => H.trim());
94
- if (a || F === "number" || F === "boolean")
92
+ const l = t.trim(), o = l.startsWith("[") || l.startsWith("{"), F = typeof e.modelValue;
93
+ if (Array.isArray(e.modelValue) && !o && l.includes(","))
94
+ return l.split(",").map((H) => H.trim());
95
+ if (o || F === "number" || F === "boolean")
95
96
  try {
96
97
  return JSON.parse(t);
97
98
  } catch {
98
99
  }
99
100
  return t;
100
- }, { codeMirror: l } = ne({
101
+ }, { codeMirror: n } = le({
101
102
  content: r(() => f(e.modelValue)),
102
103
  onChange: (t) => {
103
104
  E(t), J();
104
105
  },
105
106
  onFocus: () => {
106
- h.value = !0;
107
+ b.value = !0;
107
108
  },
108
109
  onBlur: S,
109
110
  codeMirrorRef: P,
@@ -116,20 +117,20 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
116
117
  extensions: L,
117
118
  placeholder: r(() => e.placeholder)
118
119
  });
119
- X(l, () => {
120
- l.value && Object.hasOwn(k, "autofocus") && l.value.focus();
120
+ X(n, () => {
121
+ n.value && Object.hasOwn(k, "autofocus") && n.value.focus();
121
122
  });
122
- const w = d(!1), A = d(""), D = d({ left: 0, top: 0 }), x = d(null), { handleDropdownSelect: j, updateDropdownVisibility: J } = le({
123
- codeMirror: l,
123
+ const w = d(!1), A = d(""), D = d({ left: 0, top: 0 }), x = d(null), { handleDropdownSelect: j, updateDropdownVisibility: J } = ne({
124
+ codeMirror: n,
124
125
  query: A,
125
126
  showDropdown: w,
126
127
  dropdownPosition: D
127
- }), U = s(() => w.value && e.withVariables && e.layout !== "modal" && !!e.environment), m = (t, n) => {
128
+ }), U = s(() => w.value && e.withVariables && e.layout !== "modal" && !!e.environment), m = (t, l) => {
128
129
  if (w.value) {
129
- t === "down" || t === "up" ? (n.preventDefault(), x.value?.handleArrowKey(t)) : t === "enter" && (n.preventDefault(), x.value?.handleSelect());
130
+ t === "down" || t === "up" ? (l.preventDefault(), x.value?.handleArrowKey(t)) : t === "enter" && (l.preventDefault(), x.value?.handleSelect());
130
131
  return;
131
132
  }
132
- t === "escape" && !e.disableTabIndent && n.stopPropagation(), t === "enter" && n.target instanceof HTMLDivElement && g(n.target.textContent ?? "");
133
+ t === "escape" && !e.disableTabIndent && l.stopPropagation(), t === "enter" && l.target instanceof HTMLDivElement && g(l.target.textContent ?? "");
133
134
  };
134
135
  return M({
135
136
  /**
@@ -138,51 +139,55 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
138
139
  * @param cursorAtEnd boolean place the cursor at the end of the input
139
140
  */
140
141
  focus: (t) => {
141
- if (!l.value || (l.value.focus(), !te(t)))
142
+ if (!n.value || (n.value.focus(), !te(t)))
142
143
  return;
143
- const n = t === "start" ? 0 : t === "end" ? l.value.state.doc.length : t;
144
- l.value.dispatch({
145
- selection: { anchor: n },
144
+ const l = t === "start" ? 0 : t === "end" ? n.value.state.doc.length : t;
145
+ n.value.dispatch({
146
+ selection: { anchor: l },
146
147
  scrollIntoView: !0
147
148
  });
148
149
  },
149
- isFocused: h,
150
+ isFocused: b,
150
151
  handleChange: E,
151
152
  handleSubmit: g,
152
153
  handleBlur: S,
153
154
  booleanOptions: C,
154
- codeMirror: l,
155
+ codeMirror: n,
155
156
  modelValue: e.modelValue,
156
- cursorPosition: () => l.value?.state.selection.main.head,
157
+ cursorPosition: () => n.value?.state.selection.main.head,
157
158
  serializeValue: f,
158
159
  deserializeValue: T
159
- }), (t, n) => (o(), i(Y, null, [
160
- e.disabled ? (o(), i("div", {
160
+ }), (t, l) => (a(), i(Y, null, [
161
+ e.disabled ? (a(), i("div", {
161
162
  key: 0,
162
- class: Z(["text-c-2 flex cursor-default items-center justify-center", e.layout === "modal" ? "font-code pr-2 pl-1 text-base" : "px-2"]),
163
+ class: Z(["text-c-2 flex cursor-default items-center justify-center", {
164
+ "font-code pr-2 pl-1 text-base": e.layout === "modal",
165
+ "px-2": e.layout !== "modal",
166
+ "line-through": e.linethrough
167
+ }]),
163
168
  "data-testid": "code-input-disabled"
164
169
  }, [
165
170
  V("span", de, _(e.modelValue), 1)
166
- ], 2)) : e.enum?.length ? (o(), y(B, {
171
+ ], 2)) : e.enum?.length ? (a(), y(B, {
167
172
  key: 1,
168
173
  default: e.default,
169
174
  modelValue: e.modelValue,
170
175
  type: z.value,
171
176
  value: e.enum,
172
177
  "onUpdate:modelValue": v
173
- }, null, 8, ["default", "modelValue", "type", "value"])) : q.value ? (o(), y(B, {
178
+ }, null, 8, ["default", "modelValue", "type", "value"])) : q.value ? (a(), y(B, {
174
179
  key: 2,
175
180
  default: e.default,
176
181
  modelValue: e.modelValue,
177
182
  value: C.value,
178
183
  "onUpdate:modelValue": v
179
- }, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (o(), y(B, {
184
+ }, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (a(), y(B, {
180
185
  key: 3,
181
186
  default: e.default,
182
187
  modelValue: e.modelValue,
183
188
  value: e.examples,
184
189
  "onUpdate:modelValue": v
185
- }, null, 8, ["default", "modelValue", "value"])) : (o(), i("div", ee({
190
+ }, null, 8, ["default", "modelValue", "value"])) : (a(), i("div", ee({
186
191
  key: 4,
187
192
  id: O(R)
188
193
  }, t.$attrs, {
@@ -190,16 +195,17 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
190
195
  ref: P,
191
196
  class: ["group/input group-[.alert]:outline-orange group-[.error]:outline-red font-code peer relative w-full overflow-hidden text-xs leading-[1.44] whitespace-nowrap -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline", {
192
197
  "line-wrapping has-[:focus-visible]:bg-b-1 has-[:focus-visible]:absolute has-[:focus-visible]:z-1": e.lineWrapping,
193
- "flow-code-input--error": e.error
198
+ "flow-code-input--error": e.error,
199
+ "line-through": e.linethrough
194
200
  }],
195
201
  onKeydown: [
196
- n[0] || (n[0] = b($((a) => m("down", a), ["stop"]), ["down"])),
197
- n[1] || (n[1] = b((a) => m("enter", a), ["enter"])),
198
- n[2] || (n[2] = b((a) => m("escape", a), ["escape"])),
199
- n[3] || (n[3] = b($((a) => m("up", a), ["stop"]), ["up"]))
202
+ l[0] || (l[0] = h($((o) => m("down", o), ["stop"]), ["down"])),
203
+ l[1] || (l[1] = h((o) => m("enter", o), ["enter"])),
204
+ l[2] || (l[2] = h((o) => m("escape", o), ["escape"])),
205
+ l[3] || (l[3] = h($((o) => m("up", o), ["stop"]), ["up"]))
200
206
  ]
201
207
  }), [
202
- e.disableTabIndent ? c("", !0) : (o(), i("div", ce, [...n[5] || (n[5] = [
208
+ e.disableTabIndent ? c("", !0) : (a(), i("div", ce, [...l[5] || (l[5] = [
203
209
  p(" Press ", -1),
204
210
  V("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Esc", -1),
205
211
  p(" then ", -1),
@@ -207,21 +213,21 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
207
213
  p(" to exit ", -1)
208
214
  ])]))
209
215
  ], 16, se)),
210
- t.$slots.warning ? (o(), i("div", fe, [
216
+ t.$slots.warning ? (a(), i("div", fe, [
211
217
  I(t.$slots, "warning", {}, void 0, !0)
212
218
  ])) : c("", !0),
213
- t.$slots.icon ? (o(), i("div", me, [
219
+ t.$slots.icon ? (a(), i("div", me, [
214
220
  I(t.$slots, "icon", {}, void 0, !0)
215
221
  ])) : c("", !0),
216
- e.required ? (o(), i("div", ye, " Required ")) : c("", !0),
217
- U.value && e.environment ? (o(), y(re, {
222
+ e.required ? (a(), i("div", ye, " Required ")) : c("", !0),
223
+ U.value && e.environment ? (a(), y(re, {
218
224
  key: 8,
219
225
  ref_key: "dropdownRef",
220
226
  ref: x,
221
227
  dropdownPosition: D.value,
222
228
  environment: e.environment,
223
229
  query: A.value,
224
- onRedirect: n[4] || (n[4] = (a) => u("redirectToEnvironment")),
230
+ onRedirect: l[4] || (l[4] = (o) => u("redirectToEnvironment")),
225
231
  onSelect: O(j)
226
232
  }, null, 8, ["dropdownPosition", "environment", "query", "onSelect"])) : c("", !0)
227
233
  ], 64));