@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
@@ -2,14 +2,14 @@ import { isDefined as C } from "@scalar/helpers/array/is-defined";
2
2
  import { sortByOrder as $ } from "@scalar/helpers/array/sort-by-order";
3
3
  import { isHttpMethod as H } from "@scalar/helpers/http/is-http-method";
4
4
  import { createSidebarState as V, generateReverseIndex as Y } from "@scalar/sidebar";
5
- import { createWorkspaceStore as R } from "@scalar/workspace-store/client";
5
+ import { createWorkspaceStore as D } from "@scalar/workspace-store/client";
6
6
  import { createWorkspaceEventBus as j } from "@scalar/workspace-store/events";
7
7
  import { generateUniqueValue as q } from "@scalar/workspace-store/helpers/generate-unique-value";
8
8
  import { getParentEntry as p } from "@scalar/workspace-store/navigation";
9
9
  import { createWorkspaceStorePersistence as z } from "@scalar/workspace-store/persistence";
10
10
  import { persistencePlugin as J } from "@scalar/workspace-store/plugins/client";
11
11
  import { extensions as M } from "@scalar/workspace-store/schemas/extensions";
12
- import { shallowRef as S, computed as l, ref as i, watch as G } from "vue";
12
+ import { shallowRef as g, computed as i, ref as u, watch as G } from "vue";
13
13
  import { getActiveEnvironment as Q } from "../../helpers/get-active-environment.js";
14
14
  import { getTabDetails as X } from "../../helpers/get-tab-details.js";
15
15
  import { slugify as Z } from "../../helpers/slugify.js";
@@ -18,33 +18,33 @@ import { useCommandPaletteState as te } from "../command-palette/hooks/use-comma
18
18
  import { initializeAppEventHandlers as ae } from "./app-events.js";
19
19
  const ne = 1e3, m = j({
20
20
  debug: !1
21
- }), b = i(void 0), v = i(void 0), D = i(void 0), A = i(void 0), U = i(void 0), d = i(!1), c = S(null);
21
+ }), x = u(void 0), v = u(void 0), R = u(void 0), A = u(void 0), U = u(void 0), d = u(!1), c = g(null);
22
22
  G(c, (e) => {
23
23
  e && e.afterEach((t) => we(t));
24
24
  });
25
- const f = l(() => c.value?.currentRoute.value ?? null);
25
+ const f = i(() => c.value?.currentRoute.value ?? null);
26
26
  function s(e, t) {
27
27
  const a = t?.params[e];
28
28
  if (typeof a == "string")
29
29
  return e === "method" ? a && H(a) ? a : void 0 : decodeURIComponent(a);
30
30
  }
31
- const y = S(null), E = i([]), n = S(null), h = l(() => n.value?.workspace.documents[v.value ?? ""] || null), oe = l(() => Q(n.value, h.value)), { workspace: w } = await z();
32
- E.value = await w.getAll().then((e) => e.map(({ id: t, name: a }) => ({ id: t, label: a })));
33
- const re = async ({ workspaceId: e }) => R({
31
+ const S = g(null), y = u([]), n = g(null), E = i(() => n.value?.workspace.documents[v.value ?? ""] || null), re = i(() => Q(n.value, E.value)), { workspace: h } = await z();
32
+ y.value = await h.getAll().then((e) => e.map(({ id: t, name: a }) => ({ id: t, label: a })));
33
+ const oe = async ({ workspaceId: e }) => D({
34
34
  plugins: [await J({ workspaceId: e, debounceDelay: ne })]
35
35
  }), se = async (e) => {
36
- const t = await w.getItem(e);
36
+ const t = await h.getItem(e);
37
37
  if (!t)
38
38
  return {
39
39
  success: !1
40
40
  };
41
- const a = await re({ workspaceId: e });
42
- return a.loadWorkspace(t.workspace), y.value = { id: e, label: t.name }, n.value = a, {
41
+ const a = await oe({ workspaceId: e });
42
+ return a.loadWorkspace(t.workspace), S.value = { id: e, label: t.name }, n.value = a, {
43
43
  success: !0,
44
44
  workspace: a.workspace
45
45
  };
46
46
  }, ce = async ({ id: e, name: t }) => {
47
- const a = R();
47
+ const a = D();
48
48
  await a.addDocument({
49
49
  name: "drafts",
50
50
  document: {
@@ -61,10 +61,10 @@ const re = async ({ workspaceId: e }) => R({
61
61
  "x-scalar-original-document-hash": "drafts",
62
62
  "x-scalar-icon": "interface-edit-tool-pencil"
63
63
  }
64
- }), await w.setItem(e, {
64
+ }), await h.setItem(e, {
65
65
  name: t,
66
66
  workspace: a.exportWorkspace()
67
- }), E.value.push({ id: e, label: t });
67
+ }), y.value.push({ id: e, label: t });
68
68
  }, B = async (e) => {
69
69
  e && await c.value?.push({
70
70
  name: "workspace.environment",
@@ -78,22 +78,22 @@ const re = async ({ workspaceId: e }) => R({
78
78
  const a = await q({
79
79
  defaultValue: e ?? t,
80
80
  // Use the provided id if it exists, otherwise use the name
81
- validation: async (u) => !await w.has(u),
81
+ validation: async (l) => !await h.has(l),
82
82
  maxRetries: 100,
83
83
  transformation: Z
84
84
  });
85
85
  if (!a)
86
86
  return;
87
- const r = { id: a, name: t };
88
- return await ce(r), await B(a), r;
89
- }, le = async (e) => {
87
+ const o = { id: a, name: t };
88
+ return await ce(o), await B(a), o;
89
+ }, ie = async (e) => {
90
90
  n.value = null, d.value = !0;
91
91
  const t = await se(e);
92
92
  if (t.success) {
93
- const r = t.workspace["x-scalar-active-tab"] ?? 0, u = t.workspace["x-scalar-tabs"], W = u?.[r];
94
- W && await c.value?.replace(W.path), u && r >= u.length && m.emit("tabs:update:tabs", {
93
+ const o = t.workspace["x-scalar-active-tab"] ?? 0, l = t.workspace["x-scalar-tabs"], W = l?.[o];
94
+ W && await c.value?.replace(W.path), l && o >= l.length && m.emit("tabs:update:tabs", {
95
95
  "x-scalar-active-tab": 0
96
- }), u || m.emit("tabs:update:tabs", {
96
+ }), l || m.emit("tabs:update:tabs", {
97
97
  "x-scalar-tabs": [I(f.value)],
98
98
  "x-scalar-active-tab": 0
99
99
  }), d.value = !1;
@@ -105,26 +105,26 @@ const re = async ({ workspaceId: e }) => R({
105
105
  });
106
106
  if (d.value = !1, !a)
107
107
  return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
108
- o.reset();
109
- }, O = l(() => {
108
+ r.reset();
109
+ }, O = i(() => {
110
110
  const e = n.value;
111
111
  if (!e)
112
112
  return [];
113
113
  const t = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
114
114
  return $(Object.keys(e.workspace.documents), t, (a) => a).map((a) => e.workspace.documents[a]?.["x-scalar-navigation"]).filter(C);
115
- }), o = V(O), g = ({
115
+ }), r = V(O), b = ({
116
116
  document: e,
117
117
  path: t,
118
118
  method: a,
119
- example: r
120
- }) => JSON.stringify([e, t, a, r].filter(C)), T = l(
119
+ example: o
120
+ }) => JSON.stringify([e, t, a, o].filter(C)), T = i(
121
121
  () => Y({
122
122
  items: O.value,
123
123
  nestedKey: "children",
124
124
  filter: (e) => e.type === "document" || e.type === "operation" || e.type === "example",
125
125
  getId: (e) => {
126
126
  const t = p("document", e), a = p("operation", e);
127
- return g({
127
+ return b({
128
128
  document: t?.name ?? "",
129
129
  path: a?.path,
130
130
  method: a?.method,
@@ -132,33 +132,33 @@ const re = async ({ workspaceId: e }) => R({
132
132
  });
133
133
  }
134
134
  })
135
- ), x = (e) => {
136
- const t = T.value.get(g(e));
135
+ ), w = (e) => {
136
+ const t = T.value.get(b(e));
137
137
  return t || T.value.get(
138
- g({
138
+ b({
139
139
  document: e.document,
140
140
  path: e.path,
141
141
  method: e.method
142
142
  })
143
143
  );
144
144
  }, L = (e) => {
145
- const t = o.getEntryById(e);
145
+ const t = r.getEntryById(e);
146
146
  if (!t) {
147
147
  console.warn(`Could not find sidebar entry with id ${e} to select`);
148
148
  return;
149
149
  }
150
150
  if (t.type === "document")
151
- return o.setSelected(e), o.setExpanded(e, !o.isExpanded(e)), c.value?.push({
151
+ return r.setSelected(e), r.setExpanded(e, !r.isExpanded(e)), c.value?.push({
152
152
  name: "document.overview",
153
153
  params: { documentSlug: t.name }
154
154
  });
155
155
  if (t.type === "operation") {
156
- if (o.isSelected(e)) {
157
- o.setExpanded(e, !o.isExpanded(e));
156
+ if (r.isSelected(e)) {
157
+ r.setExpanded(e, !r.isExpanded(e));
158
158
  return;
159
159
  }
160
- const a = t.children?.find((r) => r.type === "example");
161
- return a ? (o.setSelected(a.id), o.setExpanded(a.id, !0)) : o.setSelected(e), c.value?.push({
160
+ const a = t.children?.find((o) => o.type === "example");
161
+ return a ? (r.setSelected(a.id), r.setExpanded(a.id, !0)) : r.setSelected(e), c.value?.push({
162
162
  name: "example",
163
163
  params: {
164
164
  documentSlug: p("document", t)?.name,
@@ -169,7 +169,7 @@ const re = async ({ workspaceId: e }) => R({
169
169
  });
170
170
  }
171
171
  if (t.type === "example") {
172
- o.setSelected(e), o.setExpanded(e, !0);
172
+ r.setSelected(e), r.setExpanded(e, !0);
173
173
  const a = p("operation", t);
174
174
  return c.value?.push({
175
175
  name: "example",
@@ -188,38 +188,38 @@ const re = async ({ workspaceId: e }) => R({
188
188
  documentSlug: p("document", t)?.name
189
189
  }
190
190
  });
191
- o.setExpanded(e, !o.isExpanded(e));
192
- }, ue = async () => {
191
+ r.setExpanded(e, !r.isExpanded(e));
192
+ }, le = async () => {
193
193
  if (!n.value)
194
194
  return;
195
195
  const e = n.value.workspace["x-scalar-active-tab"] ?? 0, t = n.value.workspace["x-scalar-tabs"]?.[e];
196
196
  t && await c.value?.replace(t.path);
197
197
  }, N = (e) => {
198
198
  e && n.value?.buildSidebar(e);
199
- }, ie = (e) => {
200
- const t = h.value?.["x-scalar-navigation"]?.name;
199
+ }, ue = (e) => {
200
+ const t = E.value?.["x-scalar-navigation"]?.name;
201
201
  if (!t)
202
202
  return;
203
- const a = x({
203
+ const a = w({
204
204
  document: t,
205
205
  path: e.path,
206
206
  method: e.method,
207
207
  example: e.exampleKey
208
208
  });
209
209
  (!a || a.type !== "example") && N(t);
210
- }, pe = 288, de = l(() => n.value?.workspace?.["x-scalar-sidebar-width"] ?? pe), me = (e) => n.value?.update("x-scalar-sidebar-width", e), k = i(!0), ve = "x-scalar-tabs", fe = "x-scalar-active-tab", I = (e) => {
211
- const t = s("method", e), a = s("pathEncoded", e), r = s("documentSlug", e), u = s("workspaceSlug", e);
210
+ }, pe = 288, de = i(() => n.value?.workspace?.["x-scalar-sidebar-width"] ?? pe), me = (e) => n.value?.update("x-scalar-sidebar-width", e), k = u(!0), ve = "x-scalar-tabs", fe = "x-scalar-active-tab", I = (e) => {
211
+ const t = s("method", e), a = s("pathEncoded", e), o = s("documentSlug", e), l = s("workspaceSlug", e);
212
212
  return {
213
213
  ...X({
214
- workspace: u,
215
- document: r,
214
+ workspace: l,
215
+ document: o,
216
216
  path: a,
217
217
  method: t,
218
- getEntryByLocation: x
218
+ getEntryByLocation: w
219
219
  }),
220
220
  path: f.value?.path ?? ""
221
221
  };
222
- }, _ = l(() => n.value?.workspace[ve] ?? [I(f.value)]), he = l(() => n.value?.workspace[fe] ?? 0), F = async (e) => {
222
+ }, _ = i(() => n.value?.workspace[ve] ?? [I(f.value)]), he = i(() => n.value?.workspace[fe] ?? 0), F = async (e) => {
223
223
  const t = _.value[e];
224
224
  if (!t) {
225
225
  console.warn(`Cannot copy URL: tab at index ${e} does not exist`);
@@ -228,44 +228,42 @@ const re = async ({ workspaceId: e }) => R({
228
228
  const a = `${window.location.origin}${t.path}`;
229
229
  try {
230
230
  await navigator.clipboard.writeText(a);
231
- } catch (r) {
232
- console.error("Failed to copy URL to clipboard:", r);
231
+ } catch (o) {
232
+ console.error("Failed to copy URL to clipboard:", o);
233
233
  }
234
234
  }, we = (e) => {
235
- console.log({ message: "handleRouteChange", to: e });
236
235
  const t = s("workspaceSlug", e), a = s("documentSlug", e);
237
- if (b.value = t, v.value = a, D.value = s("method", e), A.value = s("pathEncoded", e), U.value = s("exampleName", e), !!t) {
238
- if (e.path !== "" && ee.setCurrentPath(e.path), t !== y.value?.id)
239
- return le(t);
236
+ if (x.value = t, v.value = a, R.value = s("method", e), A.value = s("pathEncoded", e), U.value = s("exampleName", e), !!t) {
237
+ if (e.path !== "" && ee.setCurrentPath(e.path), t !== S.value?.id)
238
+ return ie(t);
240
239
  if (a && a !== n.value?.workspace[M.workspace.activeDocument])
241
240
  return n?.value?.update("x-scalar-active-document", a);
242
241
  xe(e), be(e);
243
242
  }
244
243
  }, xe = (e) => {
245
- const t = n.value?.workspace["x-scalar-tabs"] ?? [], a = n.value?.workspace["x-scalar-active-tab"] ?? 0, r = t[a];
246
- !r || r.path === e.path || (t[a] = I(e));
244
+ const t = n.value?.workspace["x-scalar-tabs"] ?? [], a = n.value?.workspace["x-scalar-active-tab"] ?? 0, o = t[a];
245
+ !o || o.path === e.path || (t[a] = I(e));
247
246
  }, be = (e) => {
248
247
  const t = s("documentSlug", e);
249
248
  if (!t) {
250
- o.setSelected(null);
249
+ r.setSelected(null);
251
250
  return;
252
251
  }
253
- const a = x({
252
+ const a = w({
254
253
  document: t,
255
254
  path: s("pathEncoded", e),
256
255
  method: s("method", e),
257
256
  example: s("exampleName", e)
258
257
  });
259
- a && (o.setSelected(a.id), o.setExpanded(a.id, !0));
258
+ a && (r.setSelected(a.id), r.setExpanded(a.id, !0));
260
259
  }, K = te();
261
260
  ae({
262
261
  eventBus: m,
263
262
  router: c,
264
- getStore: () => n.value,
265
- document: h,
266
- navigateToCurrentTab: ue,
263
+ store: n,
264
+ navigateToCurrentTab: le,
267
265
  rebuildSidebar: N,
268
- onAfterExampleCreation: ie,
266
+ onAfterExampleCreation: ue,
269
267
  onOpenCommandPalette: K.open,
270
268
  onSelectSidebarItem: L,
271
269
  onCopyTabUrl: (e) => F(e),
@@ -276,12 +274,12 @@ function _e(e) {
276
274
  /** Active workspace store */
277
275
  store: n,
278
276
  sidebar: {
279
- state: o,
277
+ state: r,
280
278
  width: de,
281
279
  isOpen: k,
282
280
  handleSelectItem: L,
283
281
  handleSidebarWidthUpdate: me,
284
- getEntryByLocation: x
282
+ getEntryByLocation: w
285
283
  },
286
284
  tabs: {
287
285
  state: _,
@@ -290,10 +288,10 @@ function _e(e) {
290
288
  },
291
289
  workspace: {
292
290
  create: P,
293
- workspaceList: E,
294
- activeWorkspace: y,
291
+ workspaceList: y,
292
+ activeWorkspace: S,
295
293
  setId: B,
296
- isOpen: l(() => !!(b.value && !v.value))
294
+ isOpen: i(() => !!(x.value && !v.value))
297
295
  },
298
296
  commandPalette: K,
299
297
  eventBus: m,
@@ -301,14 +299,14 @@ function _e(e) {
301
299
  currentRoute: f,
302
300
  loading: d,
303
301
  activeEntities: {
304
- workspaceSlug: b,
302
+ workspaceSlug: x,
305
303
  documentSlug: v,
306
304
  path: A,
307
- method: D,
305
+ method: R,
308
306
  exampleName: U
309
307
  },
310
- environment: oe,
311
- document: h
308
+ environment: re,
309
+ document: E
312
310
  };
313
311
  }
314
312
  export {
@@ -1,7 +1,7 @@
1
1
  import o from "./AppSidebar.vue2.js";
2
2
  /* empty css */
3
3
  import p from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-9f160e4c"]]);
4
+ const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-59eb2624"]]);
5
5
  export {
6
6
  e as default
7
7
  };
@@ -33,12 +33,12 @@ const ie = { class: "flex" }, se = {
33
33
  }),
34
34
  emits: /* @__PURE__ */ x(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
35
35
  setup(o, { emit: O }) {
36
- const p = O, D = b(() => V(o.activeWorkspace.label)), B = C(o, "isSidebarOpen"), M = C(o, "sidebarWidth"), S = b(() => o.sidebarState.items.value.length <= 1), h = b(
36
+ const p = O, A = b(() => V(o.activeWorkspace.label)), B = C(o, "isSidebarOpen"), M = C(o, "sidebarWidth"), S = b(() => o.sidebarState.items.value.length <= 1), h = b(
37
37
  () => oe({
38
38
  store: o.store,
39
39
  sidebarState: o.sidebarState
40
40
  })
41
- ), A = (a, e) => h.value.handleDragEnd(a, e), N = (a, e) => h.value.isDroppable(a, e), s = G(null), v = U(), T = b(() => {
41
+ ), D = (a, e) => h.value.handleDragEnd(a, e), N = (a, e) => h.value.isDroppable(a, e), s = G(null), v = U(), T = b(() => {
42
42
  const a = s.value?.item;
43
43
  return a?.type === "document" ? "This cannot be undone. You're about to delete the document and all tags and operations inside it." : `Are you sure you want to delete this ${a?.type ?? "item"}? This action cannot be undone.`;
44
44
  }), z = () => {
@@ -111,11 +111,11 @@ const ie = { class: "flex" }, se = {
111
111
  sidebarState: o.sidebarState,
112
112
  workspaces: o.workspaces,
113
113
  "onCreate:workspace": e[5] || (e[5] = (t) => p("create:workspace")),
114
- onReorder: e[6] || (e[6] = (t, n) => A(t, n)),
114
+ onReorder: e[6] || (e[6] = (t, n) => D(t, n)),
115
115
  "onSelect:workspace": e[7] || (e[7] = (t) => p("select:workspace", t)),
116
116
  onSelectItem: e[8] || (e[8] = (t) => p("selectItem", t))
117
117
  }, R({
118
- "sidebar-menu-actions": r(() => [
118
+ sidebarMenuActions: r(() => [
119
119
  F(a.$slots, "sidebarMenuActions", {}, void 0, !0)
120
120
  ]),
121
121
  workspaceButton: r(() => [
@@ -126,7 +126,7 @@ const ie = { class: "flex" }, se = {
126
126
  onClick: e[0] || (e[0] = (t) => p("click:workspace"))
127
127
  }, {
128
128
  default: r(() => [
129
- y(j(D.value), 1)
129
+ y(j(A.value), 1)
130
130
  ]),
131
131
  _: 1
132
132
  }, 8, ["active", "icon"])
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"AAwYA,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;AAIZ,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAGxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAOxD,MAAM,MAAM,UAAU,GAAG;IACvB,4DAA4D;IAC5D,cAAc,EAAE,cAAc,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACrC,4CAA4C;IAC5C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,mDAAmD;IACnD,MAAM,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC3C,yDAAyD;IACzD,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAA;IACtB,0DAA0D;IAC1D,YAAY,EAAE,qBAAqB,CAAA;IACnC,iDAAiD;IACjD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,CACvB,OAAO,CACL,IAAI,CAAC,4BAA4B,EAAE,gBAAgB,GAAG,kBAAkB,CAAC,CAC1E,CACF,CAAA;CACF,CAAA;AAED;;;;GAIG;;;;;AACH,wBAuWC"}
1
+ {"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"AAsYA,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;AAIZ,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAIxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKxD,MAAM,MAAM,UAAU,GAAG;IACvB,4DAA4D;IAC5D,cAAc,EAAE,cAAc,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACrC,4CAA4C;IAC5C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,mDAAmD;IACnD,MAAM,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC3C,yDAAyD;IACzD,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAA;IACtB,0DAA0D;IAC1D,YAAY,EAAE,qBAAqB,CAAA;IACnC,iDAAiD;IACjD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,CACvB,OAAO,CACL,IAAI,CAAC,4BAA4B,EAAE,gBAAgB,GAAG,kBAAkB,CAAC,CAC1E,CACF,CAAA;CACF,CAAA;AAED;;;;GAIG;;;;;AACH,wBAsWC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Modal.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2d195805"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6c81e410"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as I, ref as w, useId as N, watch as D, nextTick as E, onBeforeMount as F, onBeforeUnmount as U, computed as d, toValue as k, withDirectives as b, createElementBlock as u, openBlock as m, createElementVNode as s, unref as o, createVNode as l, withCtx as V, vShow as x } from "vue";
2
2
  import { addScalarClassesToHeadless as A, ScalarTeleportRoot as $ } from "@scalar/components";
3
- import { ScalarToasts as H } from "@scalar/use-toasts";
4
- import { useFocusTrap as L } from "@vueuse/integrations/useFocusTrap";
5
- import { mergeAuthConfig as M } from "../../blocks/scalar-auth-selector-block/helpers/merge-auth-config.js";
6
- import z from "../operation/Operation.vue.js";
7
- import { getActiveEnvironment as O } from "../../helpers/get-active-environment.js";
8
- import { useGlobalHotKeys as R } from "../../hooks/use-global-hot-keys.js";
9
- import { useScrollLock as j } from "../../hooks/use-scroll-lock.js";
10
- import { useWorkspaceClientModalEvents as q } from "./hooks/use-workspace-client-modal-events.js";
3
+ import { ScalarToasts as z } from "@scalar/use-toasts";
4
+ import { useFocusTrap as H } from "@vueuse/integrations/useFocusTrap";
5
+ import { mergeAuthConfig as L } from "../../blocks/scalar-auth-selector-block/helpers/merge-auth-config.js";
6
+ import { initializeModalEvents as M } from "./modal-events.js";
7
+ import O from "../operation/Operation.vue.js";
8
+ import { getActiveEnvironment as R } from "../../helpers/get-active-environment.js";
9
+ import { useGlobalHotKeys as j } from "../../hooks/use-global-hot-keys.js";
10
+ import { useScrollLock as q } from "../../hooks/use-scroll-lock.js";
11
11
  import G from "../../components/sidebar/SidebarToggle.vue.js";
12
12
  import K from "../../components/sidebar/Sidebar.vue.js";
13
13
  const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q = ["id"], X = {
@@ -37,32 +37,31 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
37
37
  label: "default",
38
38
  id: "default"
39
39
  }, n = w(!1);
40
- q({
40
+ M({
41
41
  eventBus: e.eventBus,
42
- document: e.document,
43
- workspaceStore: e.workspaceStore,
44
42
  isSidebarOpen: n,
45
43
  sidebarState: e.sidebarState,
46
- modalState: e.modalState
47
- }), R(e.eventBus, "modal");
48
- const f = w(null), v = N(), { activate: y, deactivate: p } = L(f, {
44
+ modalState: e.modalState,
45
+ store: e.workspaceStore
46
+ }), j(e.eventBus, "modal");
47
+ const f = w(null), v = N(), { activate: y, deactivate: p } = H(f, {
49
48
  allowOutsideClick: !0,
50
49
  fallbackFocus: `#${v}`
51
50
  }), S = () => {
52
51
  p(), e.eventBus.emit("operation:cancel:request");
53
- }, C = j(() => typeof window < "u" ? window.document.body : null);
52
+ }, g = q(() => typeof window < "u" ? window.document.body : null);
54
53
  D(
55
54
  () => e.modalState.open,
56
55
  (a) => {
57
- C.value = a, a ? y({ checkCanFocusTrap: () => E() }) : S();
56
+ g.value = a, a ? y({ checkCanFocusTrap: () => E() }) : S();
58
57
  }
59
58
  ), F(() => A()), U(() => S());
60
- const g = 288, c = d(
61
- () => e.workspaceStore?.workspace?.["x-scalar-sidebar-width"] ?? g
59
+ const C = 288, c = d(
60
+ () => e.workspaceStore?.workspace?.["x-scalar-sidebar-width"] ?? C
62
61
  ), T = (a) => e.workspaceStore?.update("x-scalar-sidebar-width", a), h = d(
63
- () => O(e.workspaceStore, e.document.value)
62
+ () => R(e.workspaceStore, e.document.value)
64
63
  ), W = d(
65
- () => M(
64
+ () => L(
66
65
  e.document.value?.components?.securitySchemes,
67
66
  k(e.options)?.authentication?.securitySchemes
68
67
  )
@@ -84,7 +83,7 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
84
83
  }, [
85
84
  l(o($), null, {
86
85
  default: V(() => [
87
- l(o(H)),
86
+ l(o(z)),
88
87
  e.document.value && e.path?.value && e.method?.value ? (m(), u("main", X, [
89
88
  l(o(G), {
90
89
  modelValue: n.value,
@@ -109,7 +108,7 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
109
108
  }, null, 8, ["sidebarWidth", "documents", "eventBus", "sidebarState", "onSelectItem"]), [
110
109
  [x, n.value]
111
110
  ]),
112
- l(z, {
111
+ l(O, {
113
112
  activeWorkspace: r,
114
113
  class: "flex-1",
115
114
  document: e.document.value,
@@ -1,3 +1,3 @@
1
1
  export { type ApiClientModal, createApiClientModal } from './helpers/create-api-client-modal.js';
2
- export { useWorkspaceClientModalEvents } from './hooks/use-workspace-client-modal-events.js';
2
+ export { initializeModalEvents } from './modal-events.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA"}
@@ -1,6 +1,6 @@
1
- import { createApiClientModal as r } from "./helpers/create-api-client-modal.js";
2
- import { useWorkspaceClientModalEvents as a } from "./hooks/use-workspace-client-modal-events.js";
1
+ import { createApiClientModal as o } from "./helpers/create-api-client-modal.js";
2
+ import { initializeModalEvents as r } from "./modal-events.js";
3
3
  export {
4
- r as createApiClientModal,
5
- a as useWorkspaceClientModalEvents
4
+ o as createApiClientModal,
5
+ r as initializeModalEvents
6
6
  };
@@ -0,0 +1,13 @@
1
+ import type { ModalState } from '@scalar/components';
2
+ import type { WorkspaceStore } from '@scalar/workspace-store/client';
3
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
4
+ import { type Ref } from 'vue';
5
+ import type { UseModalSidebarReturn } from '../../../v2/features/modal/hooks/use-modal-sidebar.js';
6
+ export declare function initializeModalEvents({ eventBus, isSidebarOpen, sidebarState, modalState, store, }: {
7
+ eventBus: WorkspaceEventBus;
8
+ isSidebarOpen: Ref<boolean>;
9
+ sidebarState: UseModalSidebarReturn;
10
+ modalState: ModalState;
11
+ store: WorkspaceStore;
12
+ }): void;
13
+ //# sourceMappingURL=modal-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal-events.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/modal-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,EAAE,KAAK,GAAG,EAAO,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAGxF,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,UAAU,EACV,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAC3B,YAAY,EAAE,qBAAqB,CAAA;IACnC,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,cAAc,CAAA;CACtB,QA2CA"}
@@ -0,0 +1,31 @@
1
+ import { ref as c } from "vue";
2
+ import { initializeWorkspaceEventHandlers as l } from "../../workspace-events.js";
3
+ function f({
4
+ eventBus: e,
5
+ isSidebarOpen: t,
6
+ sidebarState: n,
7
+ modalState: o,
8
+ store: m
9
+ }) {
10
+ l({
11
+ eventBus: e,
12
+ store: c(m),
13
+ hooks: {}
14
+ }), e.on("scroll-to:nav-item", ({ id: i }) => n.handleSelectItem(i)), e.on("ui:toggle:sidebar", () => t.value = !t.value), e.on("ui:close:client-modal", () => o.hide()), e.on("ui:open:client-modal", (i) => {
15
+ if (!i) {
16
+ o.show();
17
+ return;
18
+ }
19
+ "id" in i && i.id ? n.handleSelectItem(i.id) : "method" in i && "path" in i && n.handleSelectItem(
20
+ n.getEntryByLocation({
21
+ document: m.workspace.activeDocument?.["x-scalar-navigation"]?.id ?? "",
22
+ path: i.path,
23
+ method: i.method,
24
+ example: i.exampleName
25
+ })?.id ?? ""
26
+ ), o.show();
27
+ });
28
+ }
29
+ export {
30
+ f as initializeModalEvents
31
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AAmLA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE;;;;;;;GAOG;;uBAGoB,OAAO;;uBAAP,OAAO;;AAF9B,wBA8OC"}
1
+ {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AA8JA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAKlE;;;;;;;GAOG;;uBAGoB,OAAO;;uBAAP,OAAO;;AAF9B,wBAwNC"}