@scalar/api-client 2.12.0 → 2.14.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 (184) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts +1 -1
  3. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  4. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +2 -2
  5. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/CommandActionForm.vue.js +14 -14
  7. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +38 -38
  8. package/dist/components/EmptyState.vue.d.ts.map +1 -1
  9. package/dist/components/EmptyState.vue.js +2 -2
  10. package/dist/components/EmptyState.vue2.js +27 -16
  11. package/dist/components/TopNav/TopNav.vue.js +33 -33
  12. package/dist/layouts/App/create-api-client-app.d.ts +28 -28
  13. package/dist/layouts/Web/create-api-client-web.d.ts +28 -28
  14. package/dist/libs/create-client.d.ts +28 -28
  15. package/dist/libs/hot-keys.d.ts +2 -2
  16. package/dist/libs/send-request/create-fetch-body.d.ts +2 -2
  17. package/dist/store/active-entities.d.ts +2 -2
  18. package/dist/store/collections.d.ts +4 -4
  19. package/dist/store/index.d.ts +1 -1
  20. package/dist/store/index.d.ts.map +1 -1
  21. package/dist/store/index.js +8 -8
  22. package/dist/store/request-example.d.ts +12 -12
  23. package/dist/store/store.d.ts +28 -28
  24. package/dist/store/workspace.d.ts +12 -12
  25. package/dist/style.css +1 -1
  26. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +1 -2
  27. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  28. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +9 -8
  29. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -1
  30. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  31. package/dist/v2/blocks/operation-block/components/Header.vue.js +3 -3
  32. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  33. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  34. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  35. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +14 -11
  36. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +22 -22
  37. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +2 -2
  38. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
  39. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +2 -2
  40. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +18 -15
  41. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +2 -2
  42. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue2.js +17 -17
  43. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  44. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  45. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +17 -12
  46. package/dist/v2/blocks/scalar-address-bar-block/index.d.ts.map +1 -1
  47. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +205 -0
  48. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -0
  49. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +52 -52
  50. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +1 -1
  51. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  52. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +205 -0
  53. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -0
  54. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -2
  55. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  56. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +90 -75
  57. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
  58. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +1 -2
  59. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  60. package/dist/v2/components/sidebar/Sidebar.vue.js +1 -1
  61. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  62. package/dist/v2/features/app/App.vue.js +126 -103
  63. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +0 -2
  64. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  65. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  66. package/dist/v2/features/app/components/AppSidebar.vue2.js +56 -53
  67. package/dist/v2/features/app/components/DesktopTab.vue.d.ts +26 -0
  68. package/dist/v2/features/app/components/DesktopTab.vue.d.ts.map +1 -0
  69. package/dist/v2/features/app/components/DesktopTab.vue.js +7 -0
  70. package/dist/v2/features/app/components/DesktopTab.vue2.js +134 -0
  71. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +9 -4
  72. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  73. package/dist/v2/features/app/components/DesktopTabs.vue.js +47 -13
  74. package/dist/v2/features/app/components/DesktopTabs.vue2.js +2 -4
  75. package/dist/v2/features/app/components/SplashScreen.vue.js +2 -2
  76. package/dist/v2/features/app/components/SplashScreen.vue2.js +2 -2
  77. package/dist/v2/features/app/helpers/routes.js +1 -1
  78. package/dist/v2/features/collection/components/Settings.vue2.js +3 -3
  79. package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts +61 -0
  80. package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts.map +1 -0
  81. package/dist/v2/features/command-palette/components/CommandActionForm.vue.js +48 -0
  82. package/dist/v2/features/command-palette/components/CommandActionForm.vue2.js +4 -0
  83. package/dist/v2/features/command-palette/components/CommandActionInput.vue.d.ts +39 -0
  84. package/dist/v2/features/command-palette/components/CommandActionInput.vue.d.ts.map +1 -0
  85. package/dist/v2/features/command-palette/components/CommandActionInput.vue.js +52 -0
  86. package/dist/v2/features/command-palette/components/CommandActionInput.vue2.js +4 -0
  87. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.d.ts +36 -0
  88. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.d.ts.map +1 -0
  89. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.js +78 -0
  90. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue2.js +4 -0
  91. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +30 -0
  92. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -0
  93. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +169 -0
  94. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue2.js +4 -0
  95. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +34 -0
  96. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -0
  97. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +175 -0
  98. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue2.js +4 -0
  99. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts +43 -0
  100. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts.map +1 -0
  101. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.js +7 -0
  102. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue2.js +115 -0
  103. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +39 -0
  104. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -0
  105. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +213 -0
  106. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue2.js +4 -0
  107. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +38 -0
  108. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -0
  109. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +89 -0
  110. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue2.js +4 -0
  111. package/dist/v2/features/command-palette/components/TheCommandPalette.vue.d.ts +41 -0
  112. package/dist/v2/features/command-palette/components/TheCommandPalette.vue.d.ts.map +1 -0
  113. package/dist/v2/features/command-palette/components/TheCommandPalette.vue.js +7 -0
  114. package/dist/v2/features/command-palette/components/TheCommandPalette.vue2.js +172 -0
  115. package/dist/v2/features/command-palette/components/WatchModeToggle.vue.d.ts +33 -0
  116. package/dist/v2/features/command-palette/components/WatchModeToggle.vue.d.ts.map +1 -0
  117. package/dist/v2/features/command-palette/components/WatchModeToggle.vue.js +40 -0
  118. package/dist/v2/features/command-palette/components/WatchModeToggle.vue2.js +4 -0
  119. package/dist/v2/features/command-palette/components/index.d.ts +2 -0
  120. package/dist/v2/features/command-palette/components/index.d.ts.map +1 -0
  121. package/dist/v2/features/command-palette/components/index.js +4 -0
  122. package/dist/v2/features/command-palette/helpers/get-openapi-document-details.d.ts +23 -0
  123. package/dist/v2/features/command-palette/helpers/get-openapi-document-details.d.ts.map +1 -0
  124. package/dist/v2/features/command-palette/helpers/get-openapi-document-details.js +31 -0
  125. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts +13 -0
  126. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts.map +1 -0
  127. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.js +12 -0
  128. package/dist/v2/features/command-palette/helpers/get-operation-from-curl.d.ts +26 -0
  129. package/dist/v2/features/command-palette/helpers/get-operation-from-curl.d.ts.map +1 -0
  130. package/dist/v2/features/command-palette/helpers/get-operation-from-curl.js +70 -0
  131. package/dist/v2/features/command-palette/helpers/get-postman-document-details.d.ts +23 -0
  132. package/dist/v2/features/command-palette/helpers/get-postman-document-details.d.ts.map +1 -0
  133. package/dist/v2/features/command-palette/helpers/get-postman-document-details.js +18 -0
  134. package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts +11 -0
  135. package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts.map +1 -0
  136. package/dist/v2/features/command-palette/helpers/is-postman-collection.js +11 -0
  137. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +202 -0
  138. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -0
  139. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +109 -0
  140. package/dist/v2/features/command-palette/types.d.ts +82 -0
  141. package/dist/v2/features/command-palette/types.d.ts.map +1 -0
  142. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  143. package/dist/v2/features/operation/Operation.vue.js +24 -20
  144. package/dist/v2/helpers/drag-handle-factory.d.ts +1 -2
  145. package/dist/v2/helpers/drag-handle-factory.d.ts.map +1 -1
  146. package/dist/v2/helpers/drag-handle-factory.js +84 -99
  147. package/dist/v2/helpers/get-tab-details.d.ts +43 -0
  148. package/dist/v2/helpers/get-tab-details.d.ts.map +1 -0
  149. package/dist/v2/helpers/get-tab-details.js +34 -0
  150. package/dist/v2/helpers/handle-hotkeys.js +1 -1
  151. package/dist/v2/helpers/is-url.d.ts +2 -0
  152. package/dist/v2/helpers/is-url.d.ts.map +1 -0
  153. package/dist/v2/helpers/is-url.js +5 -0
  154. package/dist/v2/helpers/remove-circular.d.ts +15 -0
  155. package/dist/v2/helpers/remove-circular.d.ts.map +1 -0
  156. package/dist/v2/helpers/remove-circular.js +18 -0
  157. package/dist/v2/helpers/storage.d.ts +4 -6
  158. package/dist/v2/helpers/storage.d.ts.map +1 -1
  159. package/dist/v2/helpers/storage.js +8 -12
  160. package/dist/v2/hooks/use-sidebar-state.d.ts +12 -19
  161. package/dist/v2/hooks/use-sidebar-state.d.ts.map +1 -1
  162. package/dist/v2/hooks/use-sidebar-state.js +36 -30
  163. package/dist/v2/hooks/use-sync-path.d.ts +11 -0
  164. package/dist/v2/hooks/use-sync-path.d.ts.map +1 -0
  165. package/dist/v2/hooks/use-sync-path.js +51 -0
  166. package/dist/v2/hooks/use-tabs.d.ts +31 -0
  167. package/dist/v2/hooks/use-tabs.d.ts.map +1 -0
  168. package/dist/v2/hooks/use-tabs.js +44 -0
  169. package/dist/v2/hooks/use-workspace-client-events.d.ts +5 -2
  170. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +1 -1
  171. package/dist/v2/hooks/use-workspace-client-events.js +91 -36
  172. package/dist/v2/hooks/use-workspace-selector.d.ts +16 -6
  173. package/dist/v2/hooks/use-workspace-selector.d.ts.map +1 -1
  174. package/dist/v2/hooks/use-workspace-selector.js +58 -64
  175. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  176. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +78 -78
  177. package/dist/views/Request/ResponseSection/ResponseBodyStreaming.vue.js +29 -29
  178. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  179. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +2 -2
  180. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +19 -19
  181. package/dist/views/Request/libs/oauth2.d.ts +2 -2
  182. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  183. package/dist/views/Request/libs/oauth2.js +66 -53
  184. package/package.json +134 -44
@@ -0,0 +1,82 @@
1
+ import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
+ import type { AllowedComponentProps, Component, VNodeProps } from 'vue';
4
+ import type { CommandPropsMap, OpenCommandEvent, UiCommandIds } from '../../../v2/features/command-palette/hooks/use-command-palette-state.js';
5
+ /**
6
+ * Default props that all command components receive.
7
+ * These are injected automatically by the command palette.
8
+ */
9
+ export type DefaultCommandProps = {
10
+ /** The workspace store for accessing documents and operations */
11
+ workspaceStore: WorkspaceStore;
12
+ /** Event bus for emitting workspace events */
13
+ eventBus: WorkspaceEventBus;
14
+ /** Function to open a command */
15
+ 'onOpen-command': OpenCommandEvent;
16
+ };
17
+ /** Helper type to make all properties writable */
18
+ export type Writable<T> = {
19
+ -readonly [K in keyof T]: T[K];
20
+ };
21
+ /**
22
+ * Extracts the props type from a Vue component.
23
+ * Strips out VNode and Vue-specific props to get only user-defined props.
24
+ */
25
+ export type ComponentProps<C extends Component> = C extends new (...args: any) => {
26
+ $props: infer P;
27
+ } ? Omit<P, keyof VNodeProps | keyof AllowedComponentProps> : never;
28
+ /**
29
+ * Maps command IDs to their actual component props.
30
+ * Used for validating that components accept the correct props.
31
+ */
32
+ export type CommandComponentPropsMap<T extends Record<string, Component>> = {
33
+ [K in keyof T]: ComponentProps<T[K]>;
34
+ };
35
+ /**
36
+ * Maps command IDs to their expected props (default props + command-specific props).
37
+ * This is what each command component should accept.
38
+ */
39
+ export type ExpectedCommandComponentPropsMap = {
40
+ [K in UiCommandIds]: DefaultCommandProps & (CommandPropsMap[K] extends undefined ? unknown : CommandPropsMap[K]);
41
+ };
42
+ /** Helper type to flatten and display complex types in IDE tooltips */
43
+ export type Prettify<T> = {
44
+ [K in keyof T]: T[K];
45
+ } & {};
46
+ /**
47
+ * Type-level assertion that compares actual component props with expected props.
48
+ * Returns 'valid' if they match, otherwise returns a detailed debug object.
49
+ *
50
+ * Using literals prevents union collapse (true | never = true, but 'valid' | object stays distinct).
51
+ */
52
+ export type AssertPropsMatch<Actual, Expected> = [Actual] extends [Expected] ? 'valid' : {
53
+ status: 'invalid';
54
+ actual: Prettify<Actual>;
55
+ expected: Prettify<Expected>;
56
+ missingProps: Prettify<Exclude<keyof Expected, keyof Actual>>;
57
+ };
58
+ /**
59
+ * Validates that all command components have the correct props.
60
+ * This type is used at the type-checking level to ensure type safety.
61
+ */
62
+ export type CommandComponentPropsCheck<T extends Record<string, Component>> = {
63
+ [K in UiCommandIds]: AssertPropsMatch<Writable<CommandComponentPropsMap<T>[K]>, Partial<ExpectedCommandComponentPropsMap[K]>>;
64
+ };
65
+ /** All validation results for command components */
66
+ export type PropsCheckResults<T extends Record<string, Component>> = CommandComponentPropsCheck<T>[keyof CommandComponentPropsCheck<T>];
67
+ /**
68
+ * Filter to show only invalid components.
69
+ * Makes error messages clearer by excluding valid components.
70
+ */
71
+ export type InvalidComponents<T extends Record<string, Component>> = {
72
+ [K in keyof CommandComponentPropsCheck<T> as CommandComponentPropsCheck<T>[K] extends 'valid' ? never : K]: CommandComponentPropsCheck<T>[K];
73
+ };
74
+ /**
75
+ * Final assertion type that shows only errors.
76
+ * If all components are valid, evaluates to 'valid'.
77
+ * If any component is invalid, shows only the invalid ones.
78
+ */
79
+ export type AssertAllValid<T extends Record<string, Component>> = PropsCheckResults<T> extends 'valid' ? PropsCheckResults<T> extends {
80
+ status: 'invalid';
81
+ } ? Prettify<InvalidComponents<T>> : PropsCheckResults<T> : Prettify<InvalidComponents<T>>;
82
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/command-palette/types.ts"],"names":[],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AAgHA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAIlE;;;;;;;GAOG;;AACH,wBAkKC"}
1
+ {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AA0HA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAIlE;;;;;;;GAOG;;AACH,wBA4KC"}
@@ -1,13 +1,13 @@
1
- import { defineComponent as v, computed as r, createBlock as h, createElementBlock as y, openBlock as s, unref as a, createElementVNode as p } from "vue";
2
- import { getResolvedRef as f } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
- import { useRouter as S } from "vue-router";
1
+ import { defineComponent as v, computed as r, onMounted as y, createBlock as h, createElementBlock as f, openBlock as s, unref as u, createElementVNode as p } from "vue";
2
+ import { getResolvedRef as S } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
+ import { useRouter as B } from "vue-router";
4
4
  import { getSecurityRequirements as k } from "./helpers/get-security-requirements.js";
5
- import B from "../../blocks/operation-block/OperationBlock.vue.js";
6
- const R = {
5
+ import R from "../../blocks/operation-block/OperationBlock.vue.js";
6
+ const g = {
7
7
  key: 1,
8
8
  class: "flex h-full w-full items-center justify-center"
9
- }, g = {}, P = /* @__PURE__ */ v({
10
- ...g,
9
+ }, N = {}, q = /* @__PURE__ */ v({
10
+ ...N,
11
11
  __name: "Operation",
12
12
  props: {
13
13
  documentSlug: {},
@@ -22,24 +22,28 @@ const R = {
22
22
  activeWorkspace: {}
23
23
  },
24
24
  setup(e) {
25
- const o = r(
26
- () => e.path && e.method ? f(e.document?.paths?.[e.path]?.[e.method]) : void 0
27
- ), u = r(
28
- () => k(e.document, o.value)
25
+ const n = r(
26
+ () => e.path && e.method ? S(e.document?.paths?.[e.path]?.[e.method]) : void 0
27
+ ), a = r(
28
+ () => k(e.document, n.value)
29
29
  ), m = r(
30
30
  () => e.document?.servers?.find(
31
31
  ({ url: t }) => t === e.document?.["x-scalar-selected-server"]
32
32
  ) ?? null
33
- ), c = r(() => e.document?.["x-scalar-set-operation-security"] ? o.value?.["x-scalar-selected-security"] : e.document?.["x-scalar-selected-security"]), l = r(() => e.document?.["x-scalar-set-operation-security"] ? {
33
+ );
34
+ y(() => {
35
+ typeof e.document?.["x-scalar-selected-server"] > "u" && e.document?.servers?.[0]?.url && e.eventBus.emit("server:update:selected", { url: e.document.servers[0].url });
36
+ });
37
+ const c = r(() => e.document?.["x-scalar-set-operation-security"] ? n.value?.["x-scalar-selected-security"] : e.document?.["x-scalar-selected-security"]), l = r(() => e.document?.["x-scalar-set-operation-security"] ? {
34
38
  type: "operation",
35
39
  path: e.path ?? "",
36
40
  method: e.method ?? "get"
37
41
  } : {
38
42
  type: "document"
39
- }), i = "2.12.0", d = S();
40
- return (t, n) => t.path && t.method && t.exampleName && o.value ? (s(), h(a(B), {
43
+ }), i = "2.14.0", d = B();
44
+ return (t, o) => t.path && t.method && t.exampleName && n.value ? (s(), h(u(R), {
41
45
  key: 0,
42
- appVersion: a(i),
46
+ appVersion: u(i),
43
47
  authMeta: l.value,
44
48
  environment: t.environment,
45
49
  eventBus: t.eventBus,
@@ -47,21 +51,21 @@ const R = {
47
51
  history: [],
48
52
  layout: t.layout,
49
53
  method: t.method,
50
- operation: o.value,
54
+ operation: n.value,
51
55
  path: t.path,
52
56
  plugins: [],
53
- security: u.value,
57
+ security: a.value,
54
58
  securitySchemes: t.document?.components?.securitySchemes ?? {},
55
59
  selectedSecurity: c.value,
56
60
  server: m.value,
57
61
  servers: t.document?.servers ?? [],
58
62
  totalPerformedRequests: 0,
59
- "onUpdate:servers": n[0] || (n[0] = (N) => a(d).push({ name: "document.servers" }))
60
- }, null, 8, ["appVersion", "authMeta", "environment", "eventBus", "exampleKey", "layout", "method", "operation", "path", "security", "securitySchemes", "selectedSecurity", "server", "servers"])) : (s(), y("div", R, [...n[1] || (n[1] = [
63
+ "onUpdate:servers": o[0] || (o[0] = (x) => u(d).push({ name: "document.servers" }))
64
+ }, null, 8, ["appVersion", "authMeta", "environment", "eventBus", "exampleKey", "layout", "method", "operation", "path", "security", "securitySchemes", "selectedSecurity", "server", "servers"])) : (s(), f("div", g, [...o[1] || (o[1] = [
61
65
  p("span", { class: "text-c-3" }, "Select an operation to view details", -1)
62
66
  ])]));
63
67
  }
64
68
  });
65
69
  export {
66
- P as default
70
+ q as default
67
71
  };
@@ -1,5 +1,4 @@
1
- import type { DraggingItem, HoveredItem } from '@scalar/draggable';
2
- import { type SidebarState } from '@scalar/sidebar';
1
+ import type { DraggingItem, HoveredItem, SidebarState } from '@scalar/sidebar';
3
2
  import type { WorkspaceStore } from '@scalar/workspace-store/client';
4
3
  import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
5
4
  import { type MaybeRefOrGetter } from 'vue';
@@ -1 +1 @@
1
- {"version":3,"file":"drag-handle-factory.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/drag-handle-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAGlE,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,iBAAiB,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAIpE,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,4CAA4C,CAAA;AAInD,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,KAAK,CAAA;AA6XpD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,kCAG/B;IACD,KAAK,EAAE,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC9C,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;CAC3C;mCAKuC,YAAY,gBAAgB,WAAW,KAAG,OAAO;iCA2DnD,YAAY,gBAAgB,WAAW,KAAG,OAAO;CAwEtF,CAAA"}
1
+ {"version":3,"file":"drag-handle-factory.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/drag-handle-factory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAc,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAIpE,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,4CAA4C,CAAA;AAGnD,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,KAAK,CAAA;AAiTpD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,kCAG/B;IACD,KAAK,EAAE,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC9C,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;CAC3C;mCAKuC,YAAY,gBAAgB,WAAW,KAAG,OAAO;iCA2DnD,YAAY,gBAAgB,WAAW,KAAG,OAAO;CAwEtF,CAAA"}
@@ -1,135 +1,120 @@
1
- import { dereference as F } from "@scalar/openapi-parser";
2
- import { getParentEntry as i } from "@scalar/sidebar";
3
- import { getResolvedRef as b } from "@scalar/workspace-store/helpers/get-resolved-ref";
1
+ import { sortByOrder as B } from "@scalar/helpers/array/sort-by-order";
2
+ import { dereference as k, escapeJsonPointer as j } from "@scalar/openapi-parser";
4
3
  import { unpackProxyObject as x } from "@scalar/workspace-store/helpers/unpack-proxy";
5
- import { toValue as w } from "vue";
6
- const l = {
7
- /** Insert before the hovered item */
8
- BEFORE: 0,
9
- /** Insert after the hovered item */
10
- AFTER: 1,
11
- /** Drop into the hovered item */
12
- INTO: 2
13
- }, B = (n, t, e, o) => {
14
- if (t === -1 || e === -1 || t === e)
4
+ import { getParentEntry as d, getOpenapiObject as h } from "@scalar/workspace-store/navigation";
5
+ import { toValue as b } from "vue";
6
+ import { removeCircular as A } from "./remove-circular.js";
7
+ const P = (r, t, n, a) => {
8
+ if (t === -1 || n === -1 || t === n)
15
9
  return null;
16
- const c = [...n], [s] = c.splice(t, 1);
17
- if (s === void 0)
10
+ const o = [...r], [e] = o.splice(t, 1);
11
+ if (e === void 0)
18
12
  return null;
19
- const u = A(t, e, o, c.length);
20
- return c.splice(u, 0, s), x(c, { depth: 1 });
21
- }, A = (n, t, e, o) => {
22
- const c = n < t;
23
- return e === l.AFTER ? c ? t : t + 1 : e === l.BEFORE ? c ? t - 1 : t : e === l.INTO ? o : t;
24
- }, h = (n, t) => t.includes(n.type), p = (n) => n.offset < l.INTO, E = (n) => n.offset === l.INTO, y = (n, t) => !n.parent || !t.parent ? !1 : n.parent.id === t.parent.id, m = ({
25
- store: n,
26
- entry: t
27
- }) => {
28
- const e = i("document", t);
29
- if (!e)
30
- return null;
31
- const o = n.workspace.documents[e.name];
32
- return o ? t.type === "document" ? o : t.type === "tag" ? o.tags?.find((c) => c.name === t.name) ?? null : t.type === "operation" ? b(o.paths?.[t.path]?.[t.method]) ?? null : null : null;
33
- }, O = ({ store: n, entry: t }) => {
34
- const e = i("document", t);
35
- e && n.buildSidebar(e.name);
36
- }, P = (n, t) => n["x-scalar-order"] ?? t.children?.map((o) => o.id) ?? [], T = (n, t, e, o) => {
37
- const c = t.parent;
38
- if (!c || !h(c, ["tag", "document"]))
13
+ const u = R(t, n, a, o.length);
14
+ return o.splice(u, 0, e), x(o, { depth: 1 });
15
+ }, R = (r, t, n, a) => {
16
+ const o = r < t;
17
+ return n === "after" ? o ? t : t + 1 : n === "before" ? o ? t - 1 : t : n === "into" ? a : t;
18
+ }, y = (r, t) => t.includes(r.type), p = (r) => r.offset === "before" || r.offset === "after", m = (r) => r.offset === "into", l = (r, t) => !r.parent || !t.parent ? !1 : r.parent.id === t.parent.id, O = ({ store: r, entry: t }) => {
19
+ const n = d("document", t);
20
+ n && r.buildSidebar(n.name);
21
+ }, M = (r, t) => r["x-scalar-order"] ?? t.children?.map((a) => a.id) ?? [], w = (r, t, n, a) => {
22
+ const o = t.parent;
23
+ if (!o || !y(o, ["tag", "document"]))
39
24
  return !1;
40
- const s = m({ store: n, entry: c });
41
- if (!s)
25
+ const e = h({ store: r, entry: o });
26
+ if (!e)
42
27
  return !1;
43
- const u = P(s, c), r = u.findIndex((d) => d === t.id), a = u.findIndex((d) => d === e.id), f = B(u, r, a, o);
44
- return f ? (s["x-scalar-order"] = f, O({ store: n, entry: c }), !0) : !1;
45
- }, k = (n, t, e) => {
46
- const o = new Set(n.tags ?? []);
47
- e && o.add(e.name), t && o.delete(t.name), n.tags = Array.from(o);
48
- }, N = (n, t, e, o) => {
49
- n.paths?.[e.path]?.[e.method] && delete n.paths[e.path][e.method], t.paths ? (t.paths[e.path] || (t.paths[e.path] = {}), t.paths[e.path][e.method] = o) : t.paths = {
50
- [e.path]: {
51
- [e.method]: o
28
+ const u = M(e, o), s = u.findIndex((f) => f === t.id), c = u.findIndex((f) => f === n.id), i = P(u, s, c, a);
29
+ return i ? (e["x-scalar-order"] = i, O({ store: r, entry: o }), !0) : !1;
30
+ }, T = (r, t, n) => {
31
+ const a = new Set(r.tags ?? []);
32
+ n && a.add(n.name), t && a.delete(t.name), r.tags = Array.from(a);
33
+ }, $ = (r, t, n, a) => {
34
+ r.paths?.[n.path]?.[n.method] && delete r.paths[n.path][n.method], t.paths ? (t.paths[n.path] || (t.paths[n.path] = {}), t.paths[n.path][n.method] = a) : t.paths = {
35
+ [n.path]: {
36
+ [n.method]: a
52
37
  }
53
38
  };
54
- }, j = (n, t, e) => {
55
- const { schema: o } = F(n);
56
- return o.paths?.[t]?.[e];
57
- }, M = (n, t, e) => {
58
- const o = i("document", t), c = i("document", e);
59
- if (!o || !c)
39
+ }, C = (r, t, n) => {
40
+ const o = k(r).schema.paths?.[t]?.[n];
41
+ return A(o, { prefix: `#/paths/${j(t)}/${n}` });
42
+ }, F = (r, t, n) => {
43
+ const a = d("document", t), o = d("document", n);
44
+ if (!a || !o)
60
45
  return !1;
61
- const s = m({ store: n, entry: o }), u = m({ store: n, entry: c });
62
- if (!s || !u)
46
+ const e = h({ store: r, entry: a }), u = h({ store: r, entry: o });
47
+ if (!e || !u)
63
48
  return !1;
64
- const r = j(
65
- x(s),
49
+ const s = C(
50
+ x(e),
66
51
  t.path,
67
52
  t.method
68
53
  );
69
- if (!r)
54
+ if (!s)
70
55
  return !1;
71
- const a = i("tag", t) ?? null, f = i("tag", e) ?? null;
72
- return k(r, a, f), N(s, u, t, r), O({ store: n, entry: t }), O({ store: n, entry: e }), !0;
73
- }, S = (n, t, e, o) => {
74
- const c = n.workspace["x-scalar-order"] ?? Object.keys(n.workspace.documents), s = c.findIndex((a) => a === t.id), u = c.findIndex((a) => a === e.id), r = B(c, s, u, o);
75
- return r ? (n.update("x-scalar-order", r), !0) : !1;
76
- }, z = ({
77
- store: n,
56
+ const c = d("tag", t) ?? null, i = d("tag", n) ?? null;
57
+ return T(s, c, i), $(e, u, t, s), O({ store: r, entry: t }), O({ store: r, entry: n }), !0;
58
+ }, H = (r, t, n, a) => {
59
+ const o = r.workspace["x-scalar-order"] ?? [], e = Object.keys(r.workspace.documents), u = B(e, o, (f) => f), s = u.findIndex((f) => f === t.id), c = u.findIndex((f) => f === n.id), i = P(u, s, c, a);
60
+ return i ? (r.update("x-scalar-order", i), !0) : !1;
61
+ }, G = ({
62
+ store: r,
78
63
  sidebarState: t
79
64
  }) => ({
80
- handleDragEnd: (c, s) => {
81
- const u = w(n);
65
+ handleDragEnd: (o, e) => {
66
+ const u = b(r);
82
67
  if (!u)
83
68
  return !1;
84
- const r = t.getEntryById(c.id), a = t.getEntryById(s.id);
85
- if (!r || !a)
69
+ const s = t.getEntryById(o.id), c = t.getEntryById(e.id);
70
+ if (!s || !c)
86
71
  return !1;
87
- if (r.type === "document")
88
- return a.type !== "document" || !p(s) ? !1 : S(u, r, a, s.offset);
89
- if (r.type === "tag")
90
- return a.type !== "tag" || !p(s) || !y(r, a) ? !1 : T(
72
+ if (s.type === "document")
73
+ return c.type !== "document" || !p(e) ? !1 : H(u, s, c, e.offset);
74
+ if (s.type === "tag")
75
+ return c.type !== "tag" || !p(e) || !l(s, c) ? !1 : w(
91
76
  u,
92
- r,
93
- a,
94
- s.offset
77
+ s,
78
+ c,
79
+ e.offset
95
80
  );
96
- if (r.type === "operation") {
97
- if (p(s) && y(r, a))
98
- return T(
81
+ if (s.type === "operation") {
82
+ if (p(e) && l(s, c))
83
+ return w(
99
84
  u,
100
- r,
101
- a,
102
- s.offset
85
+ s,
86
+ c,
87
+ e.offset
103
88
  );
104
- if (h(a, ["tag", "document"]) && E(s))
105
- return M(u, r, a);
89
+ if (y(c, ["tag", "document"]) && m(e))
90
+ return F(u, s, c);
106
91
  }
107
92
  return !1;
108
93
  },
109
- isDroppable: (c, s) => {
110
- const u = w(n);
94
+ isDroppable: (o, e) => {
95
+ const u = b(r);
111
96
  if (!u)
112
97
  return !1;
113
- const r = t.getEntryById(c.id), a = t.getEntryById(s.id);
114
- if (!r || !a || r.type === "example")
98
+ const s = t.getEntryById(o.id), c = t.getEntryById(e.id);
99
+ if (!s || !c || s.type === "example")
115
100
  return !1;
116
- if (r.type === "document")
117
- return a.type === "document" && p(s);
118
- if (r.type === "tag")
119
- return p(s) && y(r, a);
120
- if (r.type === "operation") {
121
- const f = i("document", a), d = i("document", r);
122
- if (!f || !d)
101
+ if (s.type === "document")
102
+ return c.type === "document" && p(e);
103
+ if (s.type === "tag")
104
+ return p(e) && l(s, c);
105
+ if (s.type === "operation") {
106
+ const i = d("document", c), f = d("document", s);
107
+ if (!i || !f)
123
108
  return !1;
124
- const D = m({ store: u, entry: f });
125
- if (!D)
109
+ const E = h({ store: u, entry: i });
110
+ if (!E)
126
111
  return !1;
127
- const R = y(r, a);
128
- return p(s) && !R ? !1 : R ? p(s) || E(s) && h(a, ["tag", "document"]) : E(s) && h(a, ["tag", "document"]) && (d.id === f.id || D.paths?.[r.path]?.[r.method] === void 0);
112
+ const D = l(s, c);
113
+ return p(e) && !D ? !1 : D ? p(e) || m(e) && y(c, ["tag", "document"]) : m(e) && y(c, ["tag", "document"]) && (f.id === i.id || E.paths?.[s.path]?.[s.method] === void 0);
129
114
  }
130
115
  return !1;
131
116
  }
132
117
  });
133
118
  export {
134
- z as dragHandleFactory
119
+ G as dragHandleFactory
135
120
  };
@@ -0,0 +1,43 @@
1
+ import type { HttpMethod } from '@scalar/helpers/http/http-methods';
2
+ import type { Tab } from '@scalar/workspace-store/schemas/extensions/workspace';
3
+ import type { UseSidebarStateReturn } from '../../v2/hooks/use-sidebar-state.js';
4
+ /**
5
+ * Returns display details for a tab in the API client UI.
6
+ * Determines the title and icon to use based on workspace, document, path, and method.
7
+ *
8
+ * - If no workspace is provided, returns { title: 'Untitled Tab' }.
9
+ * - If document is present, attempts to fetch an entry using getEntryByLocation, and returns:
10
+ * - { title: entry.title, icon: 'document' } for document entry types,
11
+ * - { title: entry.title, icon: 'request' } for all other types,
12
+ * - If no entry found, returns { title: 'Untitled Tab' }.
13
+ * - If neither document nor entry is available, returns { title: 'Workspace' }.
14
+ *
15
+ * Example:
16
+ * ```
17
+ * const result = getTabDetails({
18
+ * workspace: "main",
19
+ * document: "doc1",
20
+ * path: "/users",
21
+ * method: "get",
22
+ * getEntryByLocation: ({ document, path, method }) => {
23
+ * // Mock lookup:
24
+ * if (document === "doc1" && path === "/users") {
25
+ * return { type: "document", title: "Users" }
26
+ * }
27
+ * return null
28
+ * }
29
+ * })
30
+ * // result: { title: "Users", icon: "document" }
31
+ * ```
32
+ */
33
+ export declare const getTabDetails: ({ workspace, document, path, method, getEntryByLocation, }: {
34
+ workspace?: string;
35
+ document?: string;
36
+ path?: string;
37
+ method?: HttpMethod;
38
+ getEntryByLocation: UseSidebarStateReturn["getEntryByLocation"];
39
+ }) => {
40
+ title: string;
41
+ icon?: Tab["icon"];
42
+ };
43
+ //# sourceMappingURL=get-tab-details.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-tab-details.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/get-tab-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sDAAsD,CAAA;AAE/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,aAAa,GAAI,4DAM3B;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,kBAAkB,EAAE,qBAAqB,CAAC,oBAAoB,CAAC,CAAA;CAChE,KAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAoCtC,CAAA"}
@@ -0,0 +1,34 @@
1
+ const o = ({
2
+ workspace: i,
3
+ document: e,
4
+ path: r,
5
+ method: n,
6
+ getEntryByLocation: l
7
+ }) => {
8
+ if (!i)
9
+ return {
10
+ title: "Untitled Tab"
11
+ };
12
+ if (e) {
13
+ const t = l({
14
+ document: e,
15
+ path: r,
16
+ method: n
17
+ });
18
+ return t ? t.type === "document" ? {
19
+ title: t.title,
20
+ icon: "document"
21
+ } : {
22
+ title: t.title,
23
+ icon: "request"
24
+ } : {
25
+ title: "Untitled Tab"
26
+ };
27
+ }
28
+ return {
29
+ title: "Workspace"
30
+ };
31
+ };
32
+ export {
33
+ o as getTabDetails
34
+ };
@@ -2,7 +2,7 @@ import { isMacOS as f } from "@scalar/helpers/general/is-mac-os";
2
2
  const r = {
3
3
  Enter: { event: "operation:send:request", modifiers: ["default"] },
4
4
  b: { event: "ui:toggle:sidebar", modifiers: ["default"] },
5
- k: { event: "ui:open:command-palette", modifiers: ["default"] },
5
+ p: { event: "ui:open:command-palette", modifiers: ["shiftKey"] },
6
6
  l: { event: "ui:focus:address-bar", modifiers: ["default"] }
7
7
  }, n = {
8
8
  web: r,
@@ -0,0 +1,2 @@
1
+ export declare const isUrl: (input: string) => boolean;
2
+ //# sourceMappingURL=is-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-url.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/is-url.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,YAElC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { isValidUrl as r } from "@scalar/helpers/url/is-valid-url";
2
+ const h = (t) => (t.startsWith("http://") || t.startsWith("https://")) && r(t);
3
+ export {
4
+ h as isUrl
5
+ };
@@ -0,0 +1,15 @@
1
+ type RemoveCircularOptions = {
2
+ /** Prefix to add before the path in $ref values */
3
+ prefix?: string;
4
+ };
5
+ /**
6
+ * Recursively processes an object and replaces circular references with JSON Reference objects.
7
+ * When a circular reference is detected, it returns `{ $ref: "#/path/to/original" }`.
8
+ *
9
+ * @param obj - The object to process
10
+ * @param options - Configuration options
11
+ * @returns A new object with circular references replaced by $ref pointers
12
+ */
13
+ export declare const removeCircular: <T>(obj: T, options?: RemoveCircularOptions) => T;
14
+ export {};
15
+ //# sourceMappingURL=remove-circular.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-circular.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/remove-circular.ts"],"names":[],"mappings":"AAAA,KAAK,qBAAqB,GAAG;IAC3B,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,KAAK,CAAC,EAAE,UAAS,qBAA0B,KAAG,CAiC/E,CAAA"}
@@ -0,0 +1,18 @@
1
+ const n = (a, i = {}) => {
2
+ const { prefix: $ = "" } = i, e = /* @__PURE__ */ new WeakMap(), s = (r, c = "") => {
3
+ if (typeof r != "object" || r === null)
4
+ return r;
5
+ if (e.has(r))
6
+ return { $ref: `#${$}${e.get(r)}` };
7
+ if (e.set(r, c), Array.isArray(r))
8
+ return r.map((t, f) => s(t, `${c}/${f}`));
9
+ const u = {};
10
+ for (const [t, f] of Object.entries(r))
11
+ u[t] = s(f, `${c}/${t}`);
12
+ return u;
13
+ };
14
+ return s(a);
15
+ };
16
+ export {
17
+ n as removeCircular
18
+ };
@@ -12,14 +12,12 @@
12
12
  */
13
13
  export declare const workspaceStorage: {
14
14
  /**
15
- * Retrieves the active workspace ID from localStorage.
16
- * @returns {string | undefined} The currently active workspace ID, or undefined if not set.
15
+ * We keep the currently active path so we can reload it if needed
17
16
  */
18
- readonly getActiveWorkspaceId: () => string | undefined;
17
+ readonly setCurrentPath: (path: string) => void;
19
18
  /**
20
- * Stores the given workspace ID as the active workspace in localStorage.
21
- * @param {string} id - The workspace ID to set as active.
19
+ * Retrieve the last active path
22
20
  */
23
- readonly setActiveWorkspaceId: (id: string) => void;
21
+ readonly getLastPath: () => string | null;
24
22
  };
25
23
  //# sourceMappingURL=storage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/storage.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;;OAGG;yCACqB,MAAM,GAAG,SAAS;IAI1C;;;OAGG;wCACsB,MAAM,KAAG,IAAI;CAG9B,CAAA"}
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/storage.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;oCACoB,MAAM,KAAG,IAAI;IAIpC;;OAEG;gCACc,MAAM,GAAG,IAAI;CAGtB,CAAA"}
@@ -1,20 +1,16 @@
1
- import { safeLocalStorage as e } from "@scalar/helpers/object/local-storage";
2
- const t = "scalar.activeWorkspaceId", a = {
1
+ import { safeLocalStorage as t } from "@scalar/helpers/object/local-storage";
2
+ const e = "scalar.currentPath", o = {
3
3
  /**
4
- * Retrieves the active workspace ID from localStorage.
5
- * @returns {string | undefined} The currently active workspace ID, or undefined if not set.
4
+ * We keep the currently active path so we can reload it if needed
6
5
  */
7
- getActiveWorkspaceId() {
8
- return e().getItem(t) ?? void 0;
6
+ setCurrentPath: (r) => {
7
+ t().setItem(e, r);
9
8
  },
10
9
  /**
11
- * Stores the given workspace ID as the active workspace in localStorage.
12
- * @param {string} id - The workspace ID to set as active.
10
+ * Retrieve the last active path
13
11
  */
14
- setActiveWorkspaceId(o) {
15
- e().setItem(t, o);
16
- }
12
+ getLastPath: () => t().getItem(e)
17
13
  };
18
14
  export {
19
- a as workspaceStorage
15
+ o as workspaceStorage
20
16
  };