@scalar/api-client 2.21.0 → 2.22.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 (71) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
  3. package/dist/components/OpenApiClientButton.vue.js +2 -2
  4. package/dist/components/OpenApiClientButton.vue2.js +1 -1
  5. package/dist/hooks/useClientConfig.d.ts +9 -0
  6. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  7. package/dist/layouts/App/create-api-client-app.d.ts +2 -2
  8. package/dist/layouts/Web/create-api-client-web.d.ts +2 -2
  9. package/dist/libs/create-client.d.ts +2 -2
  10. package/dist/store/request-example.d.ts +2 -2
  11. package/dist/store/store.d.ts +2 -2
  12. package/dist/style.css +1 -1
  13. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +2 -2
  14. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  15. package/dist/v2/blocks/operation-block/helpers/get-example.js +29 -22
  16. package/dist/v2/blocks/operation-block/index.d.ts +1 -0
  17. package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
  18. package/dist/v2/blocks/operation-block/index.js +2 -0
  19. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  20. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  21. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +4 -4
  22. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +3 -2
  23. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  24. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +96 -78
  25. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue3.js +5 -0
  26. package/dist/v2/features/app/App.vue.d.ts +3 -0
  27. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  28. package/dist/v2/features/app/App.vue.js +43 -42
  29. package/dist/v2/features/app/app-events.d.ts +1 -3
  30. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  31. package/dist/v2/features/app/app-events.js +37 -43
  32. package/dist/v2/features/app/app-state.d.ts +0 -2
  33. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  34. package/dist/v2/features/app/app-state.js +87 -90
  35. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  36. package/dist/v2/features/app/helpers/create-api-client-app.js +14 -8
  37. package/dist/v2/features/app/index.d.ts +1 -0
  38. package/dist/v2/features/app/index.d.ts.map +1 -1
  39. package/dist/v2/features/app/index.js +11 -7
  40. package/dist/v2/features/command-palette/{components/TheCommandPalette.vue.d.ts → TheCommandPalette.vue.d.ts} +3 -3
  41. package/dist/v2/features/command-palette/TheCommandPalette.vue.d.ts.map +1 -0
  42. package/dist/v2/features/command-palette/TheCommandPalette.vue.js +7 -0
  43. package/dist/v2/features/command-palette/TheCommandPalette.vue2.js +152 -0
  44. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +9 -2
  45. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
  46. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +61 -55
  47. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts +2 -2
  48. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts.map +1 -1
  49. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.js +1 -1
  50. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue2.js +26 -26
  51. package/dist/v2/features/command-palette/helpers/get-operation-from-curl.d.ts.map +1 -1
  52. package/dist/v2/features/command-palette/helpers/get-operation-from-curl.js +30 -24
  53. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +240 -151
  54. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  55. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +114 -102
  56. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  57. package/dist/v2/features/modal/Modal.vue.js +2 -2
  58. package/dist/v2/features/modal/Modal.vue2.js +17 -15
  59. package/dist/v2/features/operation/Operation.vue.js +1 -1
  60. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +2 -2
  61. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  62. package/package.json +17 -22
  63. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue2.js +0 -4
  64. package/dist/v2/features/command-palette/components/TheCommandPalette.vue.d.ts.map +0 -1
  65. package/dist/v2/features/command-palette/components/TheCommandPalette.vue.js +0 -7
  66. package/dist/v2/features/command-palette/components/TheCommandPalette.vue2.js +0 -172
  67. package/dist/v2/features/command-palette/components/index.d.ts +0 -2
  68. package/dist/v2/features/command-palette/components/index.d.ts.map +0 -1
  69. package/dist/v2/features/command-palette/components/index.js +0 -4
  70. package/dist/v2/features/command-palette/types.d.ts +0 -83
  71. package/dist/v2/features/command-palette/types.d.ts.map +0 -1
@@ -2,8 +2,7 @@ import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
2
  import type { OperationExampleMeta, WorkspaceEventBus } from '@scalar/workspace-store/events';
3
3
  import { type ShallowRef } from 'vue';
4
4
  import type { Router } from 'vue-router';
5
- import type { OpenCommand } from '../command-palette/hooks/use-command-palette-state.js';
6
- export declare function initializeAppEventHandlers({ eventBus, store, router, rebuildSidebar, navigateToCurrentTab, onSelectSidebarItem, onAfterExampleCreation, onOpenCommandPalette, onCopyTabUrl, onToggleSidebar, }: {
5
+ export declare function initializeAppEventHandlers({ eventBus, store, router, rebuildSidebar, navigateToCurrentTab, onSelectSidebarItem, onAfterExampleCreation, onCopyTabUrl, onToggleSidebar, }: {
7
6
  eventBus: WorkspaceEventBus;
8
7
  store: ShallowRef<WorkspaceStore | null>;
9
8
  router: ShallowRef<Router | null>;
@@ -11,7 +10,6 @@ export declare function initializeAppEventHandlers({ eventBus, store, router, re
11
10
  navigateToCurrentTab: () => Promise<void>;
12
11
  onSelectSidebarItem: (id: string) => void;
13
12
  onAfterExampleCreation: (o: OperationExampleMeta) => void;
14
- onOpenCommandPalette: OpenCommand;
15
13
  onCopyTabUrl: (tabIndex: number) => void;
16
14
  onToggleSidebar: () => void;
17
15
  }): void;
@@ -1 +1 @@
1
- {"version":3,"file":"app-events.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAwB,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACnH,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,KAAK,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAIxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAA;AAErF,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,KAAK,EACL,MAAM,EACN,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,YAAY,EACZ,eAAe,GAChB,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,UAAU,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACxC,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IACjC,cAAc,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,sBAAsB,EAAE,CAAC,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAA;IACzD,oBAAoB,EAAE,WAAW,CAAA;IACjC,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,eAAe,EAAE,MAAM,IAAI,CAAA;CAC5B,QA2NA"}
1
+ {"version":3,"file":"app-events.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAC7F,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,KAAK,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAIxC,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,KAAK,EACL,MAAM,EACN,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,eAAe,GAChB,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,UAAU,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACxC,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IACjC,cAAc,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,sBAAsB,EAAE,CAAC,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAA;IACzD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,eAAe,EAAE,MAAM,IAAI,CAAA;CAC5B,QAmNA"}
@@ -1,25 +1,24 @@
1
- import { computed as E } from "vue";
2
- import { initializeWorkspaceEventHandlers as h } from "../../workspace-events.js";
3
- function g({
4
- eventBus: o,
1
+ import { computed as v } from "vue";
2
+ import { initializeWorkspaceEventHandlers as E } from "../../workspace-events.js";
3
+ function N({
4
+ eventBus: m,
5
5
  store: r,
6
- router: c,
6
+ router: o,
7
7
  rebuildSidebar: p,
8
- navigateToCurrentTab: n,
9
- onSelectSidebarItem: i,
8
+ navigateToCurrentTab: c,
9
+ onSelectSidebarItem: d,
10
10
  onAfterExampleCreation: s,
11
- onOpenCommandPalette: l,
12
- onCopyTabUrl: f,
13
- onToggleSidebar: x
11
+ onCopyTabUrl: i,
12
+ onToggleSidebar: f
14
13
  }) {
15
- const u = E(() => c.value?.currentRoute?.value), d = ({
14
+ const u = v(() => o.value?.currentRoute?.value), l = ({
16
15
  documentName: e,
17
16
  path: a,
18
17
  method: t,
19
- exampleName: m
20
- }) => !(e !== void 0 && e !== u.value?.params.documentSlug || a !== void 0 && encodeURIComponent(a) !== u.value?.params.pathEncoded || t !== void 0 && t !== u.value?.params.method || m !== void 0 && m !== u.value?.params.exampleName);
21
- h({
22
- eventBus: o,
18
+ exampleName: n
19
+ }) => !(e !== void 0 && e !== u.value?.params.documentSlug || a !== void 0 && encodeURIComponent(a) !== u.value?.params.pathEncoded || t !== void 0 && t !== u.value?.params.method || n !== void 0 && n !== u.value?.params.exampleName);
20
+ E({
21
+ eventBus: m,
23
22
  store: r,
24
23
  hooks: {
25
24
  //------------------------------------------------------------------------------------
@@ -27,7 +26,7 @@ function g({
27
26
  //------------------------------------------------------------------------------------
28
27
  "document:delete:document": {
29
28
  onAfterExecute: async (e) => {
30
- u?.value?.params.documentSlug === e.name && await c.value?.push({
29
+ u?.value?.params.documentSlug === e.name && await o.value?.push({
31
30
  name: "workspace.environment"
32
31
  });
33
32
  }
@@ -39,7 +38,7 @@ function g({
39
38
  onBeforeExecute: (e) => ({
40
39
  ...e,
41
40
  callback: async (a) => {
42
- a === "success" && (await c.value?.replace({
41
+ a === "success" && (await o.value?.replace({
43
42
  name: "example",
44
43
  params: {
45
44
  method: e.payload.method,
@@ -64,13 +63,13 @@ function g({
64
63
  p(e.documentName);
65
64
  const {
66
65
  documentName: a,
67
- meta: { path: t, method: m }
66
+ meta: { path: t, method: n }
68
67
  } = e;
69
- d({
68
+ l({
70
69
  documentName: a,
71
70
  path: t,
72
- method: m
73
- }) && await c.value?.replace({
71
+ method: n
72
+ }) && await o.value?.replace({
74
73
  name: "document.overview",
75
74
  params: {
76
75
  documentSlug: a
@@ -83,18 +82,18 @@ function g({
83
82
  p(e.documentName);
84
83
  const {
85
84
  documentName: a,
86
- meta: { path: t, method: m, exampleKey: v }
85
+ meta: { path: t, method: n, exampleKey: x }
87
86
  } = e;
88
- d({
87
+ l({
89
88
  documentName: a,
90
89
  path: t,
91
- method: m,
92
- exampleName: v
93
- }) && await c.value?.replace({
90
+ method: n,
91
+ exampleName: x
92
+ }) && await o.value?.replace({
94
93
  name: "example",
95
94
  params: {
96
95
  pathEncoded: encodeURIComponent(t),
97
- method: m,
96
+ method: n,
98
97
  documentSlug: a,
99
98
  exampleName: "default"
100
99
  }
@@ -123,42 +122,37 @@ function g({
123
122
  // Tabs Related Event Hooks
124
123
  //------------------------------------------------------------------------------------
125
124
  "tabs:add:tab": {
126
- onAfterExecute: n
125
+ onAfterExecute: c
127
126
  },
128
127
  "tabs:close:tab": {
129
- onAfterExecute: n
128
+ onAfterExecute: c
130
129
  },
131
130
  "tabs:focus:tab": {
132
- onAfterExecute: n
131
+ onAfterExecute: c
133
132
  },
134
133
  "tabs:focus:tab-last": {
135
- onAfterExecute: n
134
+ onAfterExecute: c
136
135
  },
137
136
  "tabs:navigate:previous": {
138
- onAfterExecute: n
137
+ onAfterExecute: c
139
138
  },
140
139
  "tabs:navigate:next": {
141
- onAfterExecute: n
140
+ onAfterExecute: c
142
141
  },
143
142
  "tabs:update:tabs": {
144
- onAfterExecute: n
143
+ onAfterExecute: c
145
144
  }
146
145
  }
147
- }), o.on("scroll-to:nav-item", ({ id: e }) => i(e)), o.on("ui:toggle:sidebar", x), o.on(
148
- "ui:open:command-palette",
149
- (e) => {
150
- e ? l(e.action, e.payload) : l();
151
- }
152
- ), o.on("ui:route:page", ({ name: e }) => c.value?.push({ name: e })), o.on("ui:route:example", async ({ exampleName: e, callback: a }) => {
153
- const t = await c.value?.replace({
146
+ }), m.on("scroll-to:nav-item", ({ id: e }) => d(e)), m.on("ui:toggle:sidebar", f), m.on("ui:route:page", ({ name: e }) => o.value?.push({ name: e })), m.on("ui:route:example", async ({ exampleName: e, callback: a }) => {
147
+ const t = await o.value?.replace({
154
148
  name: "example",
155
149
  params: {
156
150
  exampleName: e
157
151
  }
158
152
  });
159
153
  a(t ? "error" : "success");
160
- }), o.on("tabs:copy:url", (e) => f(e.index));
154
+ }), m.on("tabs:copy:url", (e) => i(e.index));
161
155
  }
162
156
  export {
163
- g as initializeAppEventHandlers
157
+ N as initializeAppEventHandlers
164
158
  };
@@ -8,7 +8,6 @@ import type { Tab } from '@scalar/workspace-store/schemas/extensions/workspace/x
8
8
  import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
9
9
  import { type ComputedRef, type Ref, type ShallowRef } from 'vue';
10
10
  import type { RouteLocationNormalizedGeneric, Router } from 'vue-router';
11
- import { type UseCommandPaletteStateReturn } from '../command-palette/hooks/use-command-palette-state.js';
12
11
  /**
13
12
  * Updates the route to reflect the currently selected workspace.
14
13
  * Navigates to the workspace's main environment view, with an option to control
@@ -116,7 +115,6 @@ export type AppState = {
116
115
  setId: typeof setWorkspaceId;
117
116
  isOpen: ComputedRef<boolean>;
118
117
  };
119
- commandPalette: UseCommandPaletteStateReturn;
120
118
  eventBus: WorkspaceEventBus;
121
119
  router: ShallowRef<Router | null>;
122
120
  currentRoute: Ref<RouteLocationNormalizedGeneric | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"app-state.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAG7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,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AC,UAAU,GAAG,SAAS,CAAC,CAAA;QACnC,WAAW,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;KACrC,CAAA;IACD,WAAW,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAA;IAC5C,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;CAChD,CAAA;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAyCrD"}
@@ -1,50 +1,49 @@
1
- import { isDefined as C } from "@scalar/helpers/array/is-defined";
2
- import { sortByOrder as H } from "@scalar/helpers/array/sort-by-order";
3
- import { isHttpMethod as V } from "@scalar/helpers/http/is-http-method";
4
- import { createSidebarState as Y, generateReverseIndex as j } from "@scalar/sidebar";
5
- import { createWorkspaceStore as D } from "@scalar/workspace-store/client";
6
- import { createWorkspaceEventBus as q } from "@scalar/workspace-store/events";
7
- import { generateUniqueValue as z } from "@scalar/workspace-store/helpers/generate-unique-value";
1
+ import { isDefined as D } from "@scalar/helpers/array/is-defined";
2
+ import { sortByOrder as $ } from "@scalar/helpers/array/sort-by-order";
3
+ import { isHttpMethod as H } from "@scalar/helpers/http/is-http-method";
4
+ import { createSidebarState as V, generateReverseIndex as Y } from "@scalar/sidebar";
5
+ import { createWorkspaceStore as R } from "@scalar/workspace-store/client";
6
+ import { createWorkspaceEventBus as j } from "@scalar/workspace-store/events";
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
- import { createWorkspaceStorePersistence as J } from "@scalar/workspace-store/persistence";
10
- import { persistencePlugin as M } from "@scalar/workspace-store/plugins/client";
11
- import { extensions as G } from "@scalar/workspace-store/schemas/extensions";
12
- import { shallowRef as g, computed as i, ref as u, watch as Q } from "vue";
13
- import { getActiveEnvironment as X } from "../../helpers/get-active-environment.js";
14
- import { getTabDetails as Z } from "../../helpers/get-tab-details.js";
15
- import { slugify as ee } from "../../helpers/slugify.js";
16
- import { workspaceStorage as te } from "../../helpers/storage.js";
17
- import { useCommandPaletteState as ae } from "../command-palette/hooks/use-command-palette-state.js";
18
- import { initializeAppEventHandlers as ne } from "./app-events.js";
19
- const re = 1e3, v = q({
9
+ import { createWorkspaceStorePersistence as z } from "@scalar/workspace-store/persistence";
10
+ import { persistencePlugin as J } from "@scalar/workspace-store/plugins/client";
11
+ import { extensions as M } from "@scalar/workspace-store/schemas/extensions";
12
+ import { shallowRef as g, computed as i, ref as l, watch as G } from "vue";
13
+ import { getActiveEnvironment as Q } from "../../helpers/get-active-environment.js";
14
+ import { getTabDetails as X } from "../../helpers/get-tab-details.js";
15
+ import { slugify as Z } from "../../helpers/slugify.js";
16
+ import { workspaceStorage as ee } from "../../helpers/storage.js";
17
+ import { initializeAppEventHandlers as te } from "./app-events.js";
18
+ const ae = 1e3, v = j({
20
19
  debug: !1
21
- }), x = u(void 0), f = u(void 0), R = u(void 0), A = u(void 0), U = u(void 0), m = u(!1), c = g(null);
22
- Q(c, (e) => {
23
- e && e.afterEach((t) => xe(t));
20
+ }), x = l(void 0), f = l(void 0), A = l(void 0), C = l(void 0), U = l(void 0), m = l(!1), c = g(null);
21
+ G(c, (e) => {
22
+ e && e.afterEach((t) => he(t));
24
23
  });
25
24
  const d = i(() => c.value?.currentRoute.value ?? null);
26
25
  function s(e, t) {
27
26
  const a = t?.params[e];
28
27
  if (typeof a == "string")
29
- return e === "method" ? a && V(a) ? a : void 0 : decodeURIComponent(a);
28
+ return e === "method" ? a && H(a) ? a : void 0 : decodeURIComponent(a);
30
29
  }
31
- const S = g(null), y = u([]), n = g(null), E = i(() => n.value?.workspace.documents[f.value ?? ""] || null), oe = i(() => X(n.value, E.value)), { workspace: h } = await J();
32
- y.value = await h.getAll().then((e) => e.map(({ id: t, name: a }) => ({ id: t, label: a })));
33
- const se = async ({ workspaceId: e }) => D({
34
- plugins: [await M({ workspaceId: e, debounceDelay: re })]
35
- }), ce = async (e) => {
30
+ const y = g(null), S = l([]), n = g(null), E = i(() => n.value?.workspace.documents[f.value ?? ""] || null), ne = i(() => Q(n.value, E.value)), { workspace: h } = await z();
31
+ S.value = await h.getAll().then((e) => e.map(({ id: t, name: a }) => ({ id: t, label: a })));
32
+ const re = async ({ workspaceId: e }) => R({
33
+ plugins: [await J({ workspaceId: e, debounceDelay: ae })]
34
+ }), oe = async (e) => {
36
35
  const t = await h.getItem(e);
37
36
  if (!t)
38
37
  return {
39
38
  success: !1
40
39
  };
41
- const a = await se({ workspaceId: e });
42
- return a.loadWorkspace(t.workspace), S.value = { id: e, label: t.name }, n.value = a, {
40
+ const a = await re({ workspaceId: e });
41
+ return a.loadWorkspace(t.workspace), y.value = { id: e, label: t.name }, n.value = a, {
43
42
  success: !0,
44
43
  workspace: a.workspace
45
44
  };
46
- }, ie = async ({ id: e, name: t }) => {
47
- const a = D();
45
+ }, se = async ({ id: e, name: t }) => {
46
+ const a = R();
48
47
  await a.addDocument({
49
48
  name: "drafts",
50
49
  document: {
@@ -64,62 +63,62 @@ const se = async ({ workspaceId: e }) => D({
64
63
  }), await h.setItem(e, {
65
64
  name: t,
66
65
  workspace: a.exportWorkspace()
67
- }), y.value.push({ id: e, label: t });
66
+ }), S.value.push({ id: e, label: t });
68
67
  }, B = async (e) => {
69
68
  e && await c.value?.push({
70
69
  name: "workspace.environment",
71
70
  params: { workspaceSlug: e }
72
71
  });
73
- }, P = async ({
72
+ }, O = async ({
74
73
  id: e,
75
74
  name: t
76
75
  }) => {
77
76
  n.value = null;
78
- const a = await z({
77
+ const a = await q({
79
78
  defaultValue: e ?? t,
80
79
  // Use the provided id if it exists, otherwise use the name
81
- validation: async (l) => !await h.has(l),
80
+ validation: async (u) => !await h.has(u),
82
81
  maxRetries: 100,
83
- transformation: ee
82
+ transformation: Z
84
83
  });
85
84
  if (!a)
86
85
  return;
87
86
  const o = { id: a, name: t };
88
- return await ie(o), await B(a), o;
89
- }, le = async (e) => {
87
+ return await se(o), await B(a), o;
88
+ }, ce = async (e) => {
90
89
  n.value = null, m.value = !0;
91
- const t = await ce(e);
90
+ const t = await oe(e);
92
91
  if (t.success) {
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 && v.emit("tabs:update:tabs", {
92
+ const o = t.workspace["x-scalar-active-tab"] ?? 0, u = t.workspace["x-scalar-tabs"], W = u?.[o];
93
+ W && await c.value?.replace(W.path), u && o >= u.length && v.emit("tabs:update:tabs", {
95
94
  "x-scalar-active-tab": 0
96
- }), l || v.emit("tabs:update:tabs", {
95
+ }), u || v.emit("tabs:update:tabs", {
97
96
  "x-scalar-tabs": [I(d.value)],
98
97
  "x-scalar-active-tab": 0
99
98
  }), m.value = !1;
100
99
  return;
101
100
  }
102
- const a = await P({
101
+ const a = await O({
103
102
  name: "Default Workspace",
104
103
  id: "default"
105
104
  });
106
105
  if (m.value = !1, !a)
107
106
  return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
108
107
  r.reset();
109
- }, O = i(() => {
108
+ }, L = i(() => {
110
109
  const e = n.value;
111
110
  if (!e)
112
111
  return [];
113
112
  const t = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
114
- return H(Object.keys(e.workspace.documents), t, (a) => a).map((a) => e.workspace.documents[a]?.["x-scalar-navigation"]).filter(C);
115
- }), r = Y(O), b = ({
113
+ return $(Object.keys(e.workspace.documents), t, (a) => a).map((a) => e.workspace.documents[a]?.["x-scalar-navigation"]).filter(D);
114
+ }), r = V(L), b = ({
116
115
  document: e,
117
116
  path: t,
118
117
  method: a,
119
118
  example: o
120
- }) => JSON.stringify([e, t, a, o].filter(C)), T = i(
121
- () => j({
122
- items: O.value,
119
+ }) => JSON.stringify([e, t, a, o].filter(D)), T = i(
120
+ () => Y({
121
+ items: L.value,
123
122
  nestedKey: "children",
124
123
  filter: (e) => e.type === "document" || e.type === "operation" || e.type === "example",
125
124
  getId: (e) => {
@@ -141,22 +140,22 @@ const se = async ({ workspaceId: e }) => D({
141
140
  method: e.method
142
141
  })
143
142
  );
144
- }, L = (e) => {
143
+ }, N = (e) => {
145
144
  const t = r.getEntryById(e);
146
145
  if (!t) {
147
146
  console.warn(`Could not find sidebar entry with id ${e} to select`);
148
147
  return;
149
148
  }
149
+ if (r.isSelected(e)) {
150
+ r.setExpanded(e, !r.isExpanded(e));
151
+ return;
152
+ }
150
153
  if (t.type === "document")
151
154
  return r.setSelected(e), r.setExpanded(e, !r.isExpanded(e)), c.value?.push({
152
155
  name: "document.overview",
153
156
  params: { documentSlug: t.name }
154
157
  });
155
158
  if (t.type === "operation") {
156
- if (r.isSelected(e)) {
157
- r.setExpanded(e, !r.isExpanded(e));
158
- return;
159
- }
160
159
  const a = t.children?.find((o) => o.type === "example");
161
160
  return a ? (r.setSelected(a.id), r.setExpanded(a.id, !0)) : r.setSelected(e), c.value?.push({
162
161
  name: "example",
@@ -189,14 +188,14 @@ const se = async ({ workspaceId: e }) => D({
189
188
  }
190
189
  });
191
190
  r.setExpanded(e, !r.isExpanded(e));
192
- }, ue = async () => {
191
+ }, ie = async () => {
193
192
  if (!n.value)
194
193
  return;
195
194
  const e = n.value.workspace["x-scalar-active-tab"] ?? 0, t = n.value.workspace["x-scalar-tabs"]?.[e];
196
195
  t && await c.value?.replace(t.path);
197
- }, N = (e) => {
196
+ }, P = (e) => {
198
197
  e && n.value?.buildSidebar(e);
199
- }, pe = (e) => {
198
+ }, ue = (e) => {
200
199
  const t = E.value?.["x-scalar-navigation"]?.name;
201
200
  if (!t)
202
201
  return;
@@ -206,12 +205,12 @@ const se = async ({ workspaceId: e }) => D({
206
205
  method: e.method,
207
206
  example: e.exampleKey
208
207
  });
209
- (!a || a.type !== "example") && (N(t), d.value && K(d.value));
210
- }, de = 288, me = i(() => n.value?.workspace?.["x-scalar-sidebar-width"] ?? de), ve = (e) => n.value?.update("x-scalar-sidebar-width", e), k = u(!0), fe = "x-scalar-tabs", he = "x-scalar-active-tab", I = (e) => {
211
- const t = s("method", e), a = s("pathEncoded", e), o = s("documentSlug", e), l = s("workspaceSlug", e);
208
+ (!a || a.type !== "example") && (P(t), d.value && K(d.value));
209
+ }, le = 288, pe = i(() => n.value?.workspace?.["x-scalar-sidebar-width"] ?? le), de = (e) => n.value?.update("x-scalar-sidebar-width", e), k = l(!0), me = "x-scalar-tabs", ve = "x-scalar-active-tab", I = (e) => {
210
+ const t = s("method", e), a = s("pathEncoded", e), o = s("documentSlug", e), u = s("workspaceSlug", e);
212
211
  return {
213
- ...Z({
214
- workspace: l,
212
+ ...X({
213
+ workspace: u,
215
214
  document: o,
216
215
  path: a,
217
216
  method: t,
@@ -219,7 +218,7 @@ const se = async ({ workspaceId: e }) => D({
219
218
  }),
220
219
  path: d.value?.path ?? ""
221
220
  };
222
- }, _ = i(() => n.value?.workspace[fe] ?? [I(d.value)]), we = i(() => n.value?.workspace[he] ?? 0), F = async (e) => {
221
+ }, _ = i(() => n.value?.workspace[me] ?? [I(d.value)]), fe = i(() => n.value?.workspace[ve] ?? 0), F = async (e) => {
223
222
  const t = _.value[e];
224
223
  if (!t) {
225
224
  console.warn(`Cannot copy URL: tab at index ${e} does not exist`);
@@ -231,16 +230,16 @@ const se = async ({ workspaceId: e }) => D({
231
230
  } catch (o) {
232
231
  console.error("Failed to copy URL to clipboard:", o);
233
232
  }
234
- }, xe = (e) => {
233
+ }, he = (e) => {
235
234
  const t = s("workspaceSlug", e), a = s("documentSlug", e);
236
- if (x.value = t, f.value = a, R.value = s("method", e), A.value = s("pathEncoded", e), U.value = s("exampleName", e), !!t) {
237
- if (e.path !== "" && te.setCurrentPath(e.path), t !== S.value?.id)
238
- return le(t);
239
- if (a && a !== n.value?.workspace[G.workspace.activeDocument])
235
+ if (x.value = t, f.value = a, A.value = s("method", e), C.value = s("pathEncoded", e), U.value = s("exampleName", e), !!t) {
236
+ if (e.path !== "" && ee.setCurrentPath(e.path), t !== y.value?.id)
237
+ return ce(t);
238
+ if (a && a !== n.value?.workspace[M.workspace.activeDocument])
240
239
  return n?.value?.update("x-scalar-active-document", a);
241
- be(e), K(e);
240
+ we(e), K(e);
242
241
  }
243
- }, be = (e) => {
242
+ }, we = (e) => {
244
243
  const t = n.value?.workspace["x-scalar-tabs"] ?? [], a = n.value?.workspace["x-scalar-active-tab"] ?? 0, o = t[a];
245
244
  !o || o.path === e.path || (t[a] = I(e));
246
245
  }, K = (e) => {
@@ -256,44 +255,42 @@ const se = async ({ workspaceId: e }) => D({
256
255
  example: s("exampleName", e)
257
256
  });
258
257
  a && (r.setSelected(a.id), r.setExpanded(a.id, !0));
259
- }, $ = ae();
260
- ne({
258
+ };
259
+ te({
261
260
  eventBus: v,
262
261
  router: c,
263
262
  store: n,
264
- navigateToCurrentTab: ue,
265
- rebuildSidebar: N,
266
- onAfterExampleCreation: pe,
267
- onOpenCommandPalette: $.open,
268
- onSelectSidebarItem: L,
263
+ navigateToCurrentTab: ie,
264
+ rebuildSidebar: P,
265
+ onAfterExampleCreation: ue,
266
+ onSelectSidebarItem: N,
269
267
  onCopyTabUrl: (e) => F(e),
270
268
  onToggleSidebar: () => k.value = !k.value
271
269
  });
272
- function _e(e) {
270
+ function Le(e) {
273
271
  return e && (c.value = e), {
274
272
  /** Active workspace store */
275
273
  store: n,
276
274
  sidebar: {
277
275
  state: r,
278
- width: me,
276
+ width: pe,
279
277
  isOpen: k,
280
- handleSelectItem: L,
281
- handleSidebarWidthUpdate: ve,
278
+ handleSelectItem: N,
279
+ handleSidebarWidthUpdate: de,
282
280
  getEntryByLocation: w
283
281
  },
284
282
  tabs: {
285
283
  state: _,
286
- activeTabIndex: we,
284
+ activeTabIndex: fe,
287
285
  copyTabUrl: F
288
286
  },
289
287
  workspace: {
290
- create: P,
291
- workspaceList: y,
292
- activeWorkspace: S,
288
+ create: O,
289
+ workspaceList: S,
290
+ activeWorkspace: y,
293
291
  setId: B,
294
292
  isOpen: i(() => !!(x.value && !f.value))
295
293
  },
296
- commandPalette: $,
297
294
  eventBus: v,
298
295
  router: c,
299
296
  currentRoute: d,
@@ -301,14 +298,14 @@ function _e(e) {
301
298
  activeEntities: {
302
299
  workspaceSlug: x,
303
300
  documentSlug: f,
304
- path: A,
305
- method: R,
301
+ path: C,
302
+ method: A,
306
303
  exampleName: U
307
304
  },
308
- environment: oe,
305
+ environment: ne,
309
306
  document: E
310
307
  };
311
308
  }
312
309
  export {
313
- _e as useAppState
310
+ Le as useAppState
314
311
  };
@@ -1 +1 @@
1
- {"version":3,"file":"create-api-client-app.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/create-api-client-app.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,sBAAsB,GAAG;IAC5B;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;CACzB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,sBAAsB,CAAC,QAAQ,CAAC,gCAQvE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,WAAW,GAAG,IAAI,EAAE,qBAAiC,sBAAsB;;;aAyBjH,CAAA"}
1
+ {"version":3,"file":"create-api-client-app.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/create-api-client-app.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIrD,KAAK,sBAAsB,GAAG;IAC5B;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;CACzB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,sBAAsB,CAAC,QAAQ,CAAC,gCAQvE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,WAAW,GAAG,IAAI,EAAE,qBAAiC,sBAAsB;;;aA+BjH,CAAA"}
@@ -1,11 +1,17 @@
1
1
  import { createApp as c } from "vue";
2
- import { createRouter as p, createWebHistory as n, createWebHashHistory as m } from "vue-router";
3
- import u from "../App.vue.js";
2
+ import { createRouter as p, createWebHistory as n, createWebHashHistory as u } from "vue-router";
3
+ import l from "../App.vue.js";
4
4
  /* empty css */
5
- import { useAppState as l } from "../app-state.js";
6
- import { ROUTES as i } from "./routes.js";
7
- const f = (t) => t === "web" ? p({ history: n(), routes: i }) : p({ history: m(), routes: i }), g = (t, { layout: r = "desktop", plugins: s }) => {
8
- const o = f(r), a = l(o), e = c(u, { layout: r, plugins: s, getAppState: () => a });
5
+ import { useAppState as d } from "../app-state.js";
6
+ import { ROUTES as m } from "./routes.js";
7
+ import { useCommandPaletteState as f } from "../../command-palette/hooks/use-command-palette-state.js";
8
+ const A = (t) => t === "web" ? p({ history: n(), routes: m }) : p({ history: u(), routes: m }), R = (t, { layout: r = "desktop", plugins: i }) => {
9
+ const o = A(r), a = d(o), s = f(), e = c(l, {
10
+ layout: r,
11
+ plugins: i,
12
+ getAppState: () => a,
13
+ getCommandPaletteState: () => s
14
+ });
9
15
  if (e.use(o), !t) {
10
16
  console.error(
11
17
  "[@scalar/api-client-modal] Could not create the API client.",
@@ -20,6 +26,6 @@ const f = (t) => t === "web" ? p({ history: n(), routes: i }) : p({ history: m()
20
26
  };
21
27
  };
22
28
  export {
23
- g as createApiClientApp,
24
- f as createAppRouter
29
+ R as createApiClientApp,
30
+ A as createAppRouter
25
31
  };
@@ -1,6 +1,7 @@
1
1
  export { type AppState, useAppState } from '../../../v2/features/app/app-state.js';
2
2
  export type { ClientPlugin } from '../../../v2/helpers/plugins.js';
3
3
  export type { ClientLayout } from '../../../v2/types/layout';
4
+ export { type CommandPaletteAction, type CommandPaletteRoute, baseClientActions, baseRoutes, useCommandPaletteState, } from '../command-palette/hooks/use-command-palette-state.js';
4
5
  export { default as ClientApp } from './App.vue.js';
5
6
  export { createApiClientApp, createAppRouter } from './helpers/create-api-client-app.js';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACxE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACxE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,UAAU,EACV,sBAAsB,GACvB,MAAM,oDAAoD,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA"}
@@ -1,10 +1,14 @@
1
- import { useAppState as r } from "./app-state.js";
2
- import { default as a } from "./App.vue.js";
1
+ import { useAppState as o } from "./app-state.js";
2
+ import { baseClientActions as a, baseRoutes as m, useCommandPaletteState as s } from "../command-palette/hooks/use-command-palette-state.js";
3
+ import { default as A } from "./App.vue.js";
3
4
  /* empty css */
4
- import { createApiClientApp as f, createAppRouter as i } from "./helpers/create-api-client-app.js";
5
+ import { createApiClientApp as l, createAppRouter as n } from "./helpers/create-api-client-app.js";
5
6
  export {
6
- a as ClientApp,
7
- f as createApiClientApp,
8
- i as createAppRouter,
9
- r as useAppState
7
+ A as ClientApp,
8
+ a as baseClientActions,
9
+ m as baseRoutes,
10
+ l as createApiClientApp,
11
+ n as createAppRouter,
12
+ o as useAppState,
13
+ s as useCommandPaletteState
10
14
  };