@scalar/api-client 2.20.2 → 2.21.1

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 (80) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +56 -59
  5. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +52 -51
  7. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts +4 -0
  8. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts.map +1 -0
  9. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +23 -0
  10. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +24 -23
  12. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  13. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +2 -8
  14. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  15. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +2 -2
  16. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +57 -60
  17. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
  18. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +61 -41
  19. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +0 -3
  20. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
  21. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
  22. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -34
  23. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts +3 -3
  24. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  25. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +2 -2
  26. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue2.js +26 -20
  27. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts +4 -2
  28. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts.map +1 -1
  29. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js +39 -33
  30. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  31. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  32. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +64 -64
  33. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +1 -0
  34. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -1
  35. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +12 -11
  36. package/dist/v2/components/code-input/CodeInput.vue.d.ts +152 -95
  37. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  38. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  39. package/dist/v2/components/code-input/CodeInput.vue2.js +87 -99
  40. package/dist/v2/features/app/App.vue.d.ts +3 -0
  41. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  42. package/dist/v2/features/app/App.vue.js +43 -42
  43. package/dist/v2/features/app/app-events.d.ts +1 -3
  44. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  45. package/dist/v2/features/app/app-events.js +37 -43
  46. package/dist/v2/features/app/app-state.d.ts +0 -2
  47. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  48. package/dist/v2/features/app/app-state.js +87 -90
  49. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  50. package/dist/v2/features/app/helpers/create-api-client-app.js +14 -8
  51. package/dist/v2/features/app/index.d.ts +1 -0
  52. package/dist/v2/features/app/index.d.ts.map +1 -1
  53. package/dist/v2/features/app/index.js +11 -7
  54. package/dist/v2/features/command-palette/{components/TheCommandPalette.vue.d.ts → TheCommandPalette.vue.d.ts} +3 -3
  55. package/dist/v2/features/command-palette/TheCommandPalette.vue.d.ts.map +1 -0
  56. package/dist/v2/features/command-palette/TheCommandPalette.vue.js +7 -0
  57. package/dist/v2/features/command-palette/TheCommandPalette.vue2.js +152 -0
  58. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +9 -2
  59. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
  60. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +61 -55
  61. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts +2 -2
  62. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts.map +1 -1
  63. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.js +1 -1
  64. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue2.js +26 -26
  65. package/dist/v2/features/command-palette/helpers/get-operation-from-curl.d.ts.map +1 -1
  66. package/dist/v2/features/command-palette/helpers/get-operation-from-curl.js +30 -24
  67. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +240 -151
  68. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  69. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +114 -102
  70. package/dist/v2/features/operation/Operation.vue.js +1 -1
  71. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  72. package/package.json +11 -16
  73. package/dist/v2/features/command-palette/components/TheCommandPalette.vue.d.ts.map +0 -1
  74. package/dist/v2/features/command-palette/components/TheCommandPalette.vue.js +0 -7
  75. package/dist/v2/features/command-palette/components/TheCommandPalette.vue2.js +0 -172
  76. package/dist/v2/features/command-palette/components/index.d.ts +0 -2
  77. package/dist/v2/features/command-palette/components/index.d.ts.map +0 -1
  78. package/dist/v2/features/command-palette/components/index.js +0 -4
  79. package/dist/v2/features/command-palette/types.d.ts +0 -83
  80. package/dist/v2/features/command-palette/types.d.ts.map +0 -1
@@ -1,44 +1,45 @@
1
- import { defineComponent as w, computed as p, createElementBlock as S, createBlock as c, unref as t, openBlock as i, Fragment as f, createElementVNode as u, createVNode as s, withCtx as m, renderSlot as b, normalizeProps as h, guardReactiveProps as W } from "vue";
2
- import { useModal as y, ScalarTeleportRoot as T } from "@scalar/components";
3
- import { getThemeStyles as g } from "@scalar/themes";
4
- import { ScalarToasts as B } from "@scalar/use-toasts";
5
- import { extensions as C } from "@scalar/workspace-store/schemas/extensions";
6
- import { RouterView as E } from "vue-router";
7
- import x from "./components/CreateWorkspaceModal.vue.js";
8
- import O from "./components/SplashScreen.vue.js";
9
- import { useDocumentWatcher as I } from "./hooks/use-document-watcher.js";
10
- import _ from "../command-palette/components/TheCommandPalette.vue.js";
11
- import { useColorMode as A } from "../../hooks/use-color-mode.js";
12
- import { useGlobalHotKeys as M } from "../../hooks/use-global-hot-keys.js";
13
- import U from "./components/AppSidebar.vue.js";
14
- import D from "./components/DesktopTabs.vue.js";
15
- import N from "./components/WebTopNav.vue.js";
16
- const $ = ["innerHTML"], L = { class: "flex min-h-0 flex-1" }, H = { class: "bg-b-1 flex-1" }, P = {}, oe = /* @__PURE__ */ w({
17
- ...P,
1
+ import { defineComponent as S, computed as p, createElementBlock as f, createBlock as c, unref as t, openBlock as i, Fragment as b, createElementVNode as u, createVNode as s, withCtx as m, renderSlot as h, normalizeProps as y, guardReactiveProps as W } from "vue";
2
+ import { useModal as T, ScalarTeleportRoot as g } from "@scalar/components";
3
+ import { getThemeStyles as B } from "@scalar/themes";
4
+ import { ScalarToasts as C } from "@scalar/use-toasts";
5
+ import { extensions as E } from "@scalar/workspace-store/schemas/extensions";
6
+ import { RouterView as x } from "vue-router";
7
+ import O from "./components/CreateWorkspaceModal.vue.js";
8
+ import I from "./components/SplashScreen.vue.js";
9
+ import { useDocumentWatcher as A } from "./hooks/use-document-watcher.js";
10
+ import M from "../command-palette/TheCommandPalette.vue.js";
11
+ import { useColorMode as U } from "../../hooks/use-color-mode.js";
12
+ import { useGlobalHotKeys as _ } from "../../hooks/use-global-hot-keys.js";
13
+ import D from "./components/AppSidebar.vue.js";
14
+ import N from "./components/DesktopTabs.vue.js";
15
+ import $ from "./components/WebTopNav.vue.js";
16
+ const L = ["innerHTML"], P = { class: "flex min-h-0 flex-1" }, F = { class: "bg-b-1 flex-1" }, H = {}, se = /* @__PURE__ */ S({
17
+ ...H,
18
18
  __name: "App",
19
19
  props: {
20
20
  layout: {},
21
21
  plugins: { default: () => [] },
22
- getAppState: { type: Function }
22
+ getAppState: { type: Function },
23
+ getCommandPaletteState: { type: Function }
23
24
  },
24
25
  setup(o) {
25
- const e = o.getAppState();
26
- typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), A({ workspaceStore: e.store }), M(e.eventBus, o.layout), I({
27
- documentName: () => e.store.value?.workspace[C.workspace.activeDocument],
26
+ const e = o.getAppState(), d = o.getCommandPaletteState();
27
+ typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), U({ workspaceStore: e.store }), _(e.eventBus, o.layout), A({
28
+ documentName: () => e.store.value?.workspace[E.workspace.activeDocument],
28
29
  store: e.store,
29
30
  initialTimeout: 5e3
30
31
  });
31
- const d = p(() => {
32
+ const v = p(() => {
32
33
  if (e.store.value === null)
33
34
  return "";
34
35
  const n = e.store.value.workspace["x-scalar-theme"];
35
- return n ? `<style>${g(n)}</style>` : "";
36
- }), v = () => e.router.value?.push({
36
+ return n ? `<style>${B(n)}</style>` : "";
37
+ }), k = () => e.router.value?.push({
37
38
  name: "workspace.environment",
38
39
  params: {
39
40
  workspaceSlug: e.activeEntities.workspaceSlug.value
40
41
  }
41
- }), l = y(), k = p(() => ({
42
+ }), l = T(), w = p(() => ({
42
43
  documentSlug: e.activeEntities.documentSlug.value ?? "",
43
44
  document: e.store.value?.workspace.activeDocument ?? null,
44
45
  environment: e.environment.value,
@@ -52,25 +53,25 @@ const $ = ["innerHTML"], L = { class: "flex min-h-0 flex-1" }, H = { class: "bg-
52
53
  plugins: o.plugins,
53
54
  securitySchemes: e.document.value?.components?.securitySchemes ?? {}
54
55
  }));
55
- return (n, a) => t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), S(f, { key: 0 }, [
56
- u("div", { innerHTML: d.value }, null, 8, $),
57
- s(t(T), null, {
56
+ return (n, a) => t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), f(b, { key: 0 }, [
57
+ u("div", { innerHTML: v.value }, null, 8, L),
58
+ s(t(g), null, {
58
59
  default: m(() => [
59
- s(t(B)),
60
- o.layout === "desktop" ? (i(), c(D, {
60
+ s(t(C)),
61
+ o.layout === "desktop" ? (i(), c(N, {
61
62
  key: 0,
62
63
  activeTabIndex: t(e).tabs.activeTabIndex.value,
63
64
  eventBus: t(e).eventBus,
64
65
  tabs: t(e).tabs.state.value
65
- }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : (i(), c(N, {
66
+ }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : (i(), c($, {
66
67
  key: 1,
67
68
  activeWorkspace: t(e).workspace.activeWorkspace.value,
68
69
  workspaces: t(e).workspace.workspaceList.value,
69
70
  "onCreate:workspace": a[0] || (a[0] = (r) => t(l).show()),
70
71
  "onSelect:workspace": t(e).workspace.setId
71
72
  }, null, 8, ["activeWorkspace", "workspaces", "onSelect:workspace"])),
72
- u("main", L, [
73
- s(U, {
73
+ u("main", P, [
74
+ s(D, {
74
75
  isSidebarOpen: t(e).sidebar.isOpen.value,
75
76
  "onUpdate:isSidebarOpen": a[1] || (a[1] = (r) => t(e).sidebar.isOpen.value = r),
76
77
  activeWorkspace: t(e).workspace.activeWorkspace.value,
@@ -81,36 +82,36 @@ const $ = ["innerHTML"], L = { class: "flex min-h-0 flex-1" }, H = { class: "bg-
81
82
  sidebarWidth: t(e).sidebar.width.value,
82
83
  store: t(e).store.value,
83
84
  workspaces: t(e).workspace.workspaceList.value,
84
- "onClick:workspace": v,
85
+ "onClick:workspace": k,
85
86
  "onCreate:workspace": a[2] || (a[2] = (r) => t(l).show()),
86
87
  "onSelect:workspace": t(e).workspace.setId,
87
88
  onSelectItem: t(e).sidebar.handleSelectItem,
88
89
  "onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
89
90
  }, {
90
91
  sidebarMenuActions: m(() => [
91
- b(n.$slots, "sidebar-menu-actions")
92
+ h(n.$slots, "sidebar-menu-actions")
92
93
  ]),
93
94
  _: 3
94
95
  }, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onSelect:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
95
- s(x, {
96
+ s(O, {
96
97
  state: t(l),
97
98
  "onCreate:workspace": a[3] || (a[3] = (r) => t(e).workspace.create(r))
98
99
  }, null, 8, ["state"]),
99
- s(_, {
100
+ s(M, {
100
101
  eventBus: t(e).eventBus,
101
- paletteState: t(e).commandPalette,
102
+ paletteState: t(d),
102
103
  workspaceStore: t(e).store.value
103
104
  }, null, 8, ["eventBus", "paletteState", "workspaceStore"]),
104
- u("div", H, [
105
- s(t(E), h(W(k.value)), null, 16)
105
+ u("div", F, [
106
+ s(t(x), y(W(w.value)), null, 16)
106
107
  ])
107
108
  ])
108
109
  ]),
109
110
  _: 3
110
111
  })
111
- ], 64)) : (i(), c(O, { key: 1 }));
112
+ ], 64)) : (i(), c(I, { key: 1 }));
112
113
  }
113
114
  });
114
115
  export {
115
- oe as default
116
+ se as default
116
117
  };
@@ -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,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AAI,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,mCAAmC,CAAA;AAGnE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gCAAgC,CAAA;AAC1F,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AAKvC,OAAO,KAAK,EAAa,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAEnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oEAAoE,CAAA;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,GAAG,EAAE,KAAK,UAAU,EAAoC,MAAM,KAAK,CAAA;AACnG,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAOxE,OAAO,EACL,KAAK,4BAA4B,EAElC,MAAM,oDAAoD,CAAA;AAmJ3D;;;;;;;GAOG;AACH,QAAA,MAAM,cAAc,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,IAAI,CASvD,CAAA;AAED;;;;;;;;;GASG;AACH,QAAA,MAAM,eAAe,GAAU,eAG5B;IACD,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE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