@scalar/api-client 2.26.1 → 2.27.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 (158) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/dist/components/Server/ServerSelector.vue.js +6 -6
  3. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +6 -6
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +1 -1
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  7. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +48 -43
  8. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  9. package/dist/v2/blocks/operation-block/components/Header.vue2.js +10 -10
  10. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +29 -25
  12. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  13. package/dist/v2/blocks/operation-block/helpers/get-example.js +15 -15
  14. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +10 -0
  15. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +1 -0
  16. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +4 -0
  17. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -1
  18. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  19. package/dist/v2/blocks/operation-block/helpers/send-request.js +1 -1
  20. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +1 -1
  21. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  22. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  23. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +101 -100
  24. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  25. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  26. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +62 -69
  27. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +6 -6
  28. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +36 -2
  29. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  31. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +38 -3
  32. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  33. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  34. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +1 -1
  35. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  36. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  37. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +68 -69
  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 +1 -1
  40. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -40
  41. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  42. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +35 -41
  43. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  44. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +37 -41
  45. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +3 -2
  46. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  47. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +107 -87
  48. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts +21 -0
  49. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -0
  50. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js +91 -0
  51. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue2.js +4 -0
  52. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  53. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +107 -93
  54. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  55. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +87 -65
  56. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +36 -0
  57. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -0
  58. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +35 -0
  59. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +1 -1
  60. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -1
  61. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +18 -10
  62. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts +5 -0
  63. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -0
  64. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +27 -0
  65. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +3 -1
  66. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
  67. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +1 -2
  68. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  69. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +29 -37
  70. package/dist/v2/components/layout/CollapsibleSection.vue.js +1 -1
  71. package/dist/v2/components/modals/ModalClientContainer.vue.d.ts +2 -2
  72. package/dist/v2/components/modals/ModalClientContainer.vue.d.ts.map +1 -1
  73. package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
  74. package/dist/v2/components/modals/ModalClientContainer.vue2.js +45 -42
  75. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -0
  76. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  77. package/dist/v2/components/sidebar/Sidebar.vue.js +25 -24
  78. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -0
  79. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  80. package/dist/v2/components/sidebar/SidebarMenu.vue.js +30 -30
  81. package/dist/v2/features/app/App.vue.d.ts +6 -1
  82. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  83. package/dist/v2/features/app/App.vue.js +48 -46
  84. package/dist/v2/features/app/app-events.d.ts +1 -1
  85. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  86. package/dist/v2/features/app/app-events.js +95 -56
  87. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  88. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  89. package/dist/v2/features/app/components/AppSidebar.vue2.js +111 -105
  90. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +12 -2
  91. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  92. package/dist/v2/features/app/helpers/create-api-client-app.js +12 -10
  93. package/dist/v2/features/app/helpers/routes.d.ts +3 -1
  94. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  95. package/dist/v2/features/app/hooks/use-theme.d.ts +42 -0
  96. package/dist/v2/features/app/hooks/use-theme.d.ts.map +1 -0
  97. package/dist/v2/features/app/hooks/use-theme.js +34 -0
  98. package/dist/v2/features/app/index.d.ts +0 -1
  99. package/dist/v2/features/app/index.d.ts.map +1 -1
  100. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  101. package/dist/v2/features/collection/DocumentCollection.vue.js +27 -26
  102. package/dist/v2/features/collection/WorkspaceCollection.vue.js +13 -12
  103. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  104. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  105. package/dist/v2/features/collection/components/Authentication.vue2.js +49 -40
  106. package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +1 -1
  107. package/dist/v2/features/collection/components/Cookies.vue.js +26 -13
  108. package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
  109. package/dist/v2/features/collection/components/Environment.vue.js +27 -15
  110. package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
  111. package/dist/v2/features/collection/components/Overview.vue.js +2 -2
  112. package/dist/v2/features/collection/components/Overview.vue2.js +68 -61
  113. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  114. package/dist/v2/features/collection/components/Servers.vue.js +93 -88
  115. package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
  116. package/dist/v2/features/collection/components/Settings.vue.js +19 -17
  117. package/dist/v2/features/environments/EnvironmentsList.vue.js +1 -1
  118. package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts.map +1 -1
  119. package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +2 -2
  120. package/dist/v2/features/global-cookies/components/CookiesTable.vue2.js +8 -8
  121. package/dist/v2/features/modal/Modal.vue.d.ts +1 -1
  122. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  123. package/dist/v2/features/modal/Modal.vue.js +15 -15
  124. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +1 -1
  125. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  126. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  127. package/dist/v2/features/operation/Operation.vue.js +31 -34
  128. package/dist/v2/features/settings/CollectionSettings.vue.d.ts +10 -7
  129. package/dist/v2/features/settings/CollectionSettings.vue.d.ts.map +1 -1
  130. package/dist/v2/features/settings/CollectionSettings.vue.js +183 -149
  131. package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +1 -1
  132. package/dist/v2/features/settings/DocumentSettings.vue.js +88 -79
  133. package/dist/v2/features/settings/components/Section.vue.d.ts +2 -1
  134. package/dist/v2/features/settings/components/Section.vue.d.ts.map +1 -1
  135. package/dist/v2/features/settings/components/Section.vue.js +26 -15
  136. package/dist/v2/features/settings/helpers/get-theme-colors.d.ts +4 -3
  137. package/dist/v2/features/settings/helpers/get-theme-colors.d.ts.map +1 -1
  138. package/dist/v2/features/settings/helpers/get-theme-colors.js +6 -7
  139. package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
  140. package/dist/v2/helpers/handle-hotkeys.js +2 -2
  141. package/dist/v2/helpers/index.d.ts +0 -1
  142. package/dist/v2/helpers/index.d.ts.map +1 -1
  143. package/dist/v2/hooks/use-global-hot-keys.d.ts +3 -1
  144. package/dist/v2/hooks/use-global-hot-keys.d.ts.map +1 -1
  145. package/dist/v2/hooks/use-global-hot-keys.js +8 -6
  146. package/dist/v2/workspace-events.d.ts.map +1 -1
  147. package/dist/v2/workspace-events.js +10 -0
  148. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  149. package/dist/views/Request/RequestSidebar.vue.js +2 -2
  150. package/dist/views/Request/RequestSidebar.vue2.js +139 -155
  151. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  152. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  153. package/dist/views/Request/RequestSidebarItem.vue2.js +104 -101
  154. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  155. package/package.json +20 -18
  156. package/dist/v2/helpers/plugins.d.ts +0 -65
  157. package/dist/v2/helpers/plugins.d.ts.map +0 -1
  158. package/dist/v2/helpers/plugins.js +0 -11
@@ -1,55 +1,56 @@
1
- import { defineComponent as y, computed as p, createBlock as d, openBlock as i, unref as t, withCtx as m, createElementVNode as l, createVNode as r, createElementBlock as u, renderSlot as v, createCommentVNode as k, normalizeProps as T, guardReactiveProps as W } from "vue";
2
- import { useModal as x, 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 _ } from "@scalar/workspace-store/schemas/extensions";
1
+ import { defineComponent as b, computed as T, createBlock as m, openBlock as i, unref as t, withCtx as p, createElementVNode as l, createVNode as r, createElementBlock as u, renderSlot as d, createCommentVNode as v, normalizeProps as y, guardReactiveProps as W } from "vue";
2
+ import { useModal as g, ScalarTeleportRoot as x } from "@scalar/components";
3
+ import { ScalarToasts as B } from "@scalar/use-toasts";
4
+ import { extensions as C } from "@scalar/workspace-store/schemas/extensions";
6
5
  import { RouterView as E } from "vue-router";
7
6
  import A from "./components/CreateWorkspaceModal.vue.js";
8
7
  import O from "./components/SplashScreen.vue.js";
9
8
  import { useDocumentWatcher as M } from "./hooks/use-document-watcher.js";
10
- import U from "../command-palette/TheCommandPalette.vue.js";
9
+ import { useTheme as U } from "./hooks/use-theme.js";
10
+ import _ from "../command-palette/TheCommandPalette.vue.js";
11
11
  import { useColorMode as D } from "../../hooks/use-color-mode.js";
12
12
  import { useGlobalHotKeys as I } from "../../hooks/use-global-hot-keys.js";
13
13
  import N from "./components/AppSidebar.vue.js";
14
14
  import P from "./components/DesktopTabs.vue.js";
15
- import $ from "./components/DownloadAppButton.vue.js";
16
- import { mergeSecurity as H } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
17
- const L = ["innerHTML"], V = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 flex-col" }, R = { class: "flex min-h-0 flex-1 flex-row" }, G = { class: "flex flex-1 flex-col" }, j = {
15
+ import H from "./components/DownloadAppButton.vue.js";
16
+ import { mergeSecurity as L } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
17
+ const V = ["innerHTML"], $ = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 flex-col" }, R = { class: "flex min-h-0 flex-1 flex-row" }, G = { class: "flex flex-1 flex-col" }, j = {
18
18
  key: 0,
19
19
  class: "flex h-12 items-center justify-end border-b p-2"
20
- }, z = { class: "bg-b-1 min-h-0 flex-1" }, K = { key: 1 }, q = {}, de = /* @__PURE__ */ y({
20
+ }, z = { class: "bg-b-1 min-h-0 flex-1" }, K = { key: 1 }, q = {}, pe = /* @__PURE__ */ b({
21
21
  ...q,
22
22
  __name: "App",
23
23
  props: {
24
24
  layout: {},
25
25
  plugins: { default: () => [] },
26
+ customThemes: { default: () => [] },
27
+ fallbackThemeSlug: { default: "default" },
26
28
  getAppState: { type: Function },
27
29
  getCommandPaletteState: { type: Function }
28
30
  },
29
- setup(s, { expose: f }) {
30
- f({
31
+ setup(a, { expose: k }) {
32
+ k({
31
33
  openCreateWorkspace: () => c.show()
32
34
  });
33
- const e = s.getAppState(), w = s.getCommandPaletteState();
34
- typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), I(e.eventBus, s.layout), M({
35
- documentName: () => e.store.value?.workspace[_.workspace.activeDocument],
35
+ const e = a.getAppState(), f = a.getCommandPaletteState();
36
+ typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), I(e.eventBus, a.layout), M({
37
+ documentName: () => e.store.value?.workspace[C.workspace.activeDocument],
36
38
  store: e.store,
37
39
  initialTimeout: 5e3
38
40
  }), D({ workspaceStore: e.store });
39
- const S = p(() => {
40
- if (e.store.value === null)
41
- return "";
42
- const a = e.store.value.workspace["x-scalar-theme"];
43
- return a ? `<style>${B(a)}</style>` : "";
44
- }), h = (a) => {
45
- if (!a)
41
+ const { themeStyleTag: w } = U({
42
+ fallbackThemeSlug: () => a.fallbackThemeSlug,
43
+ customThemes: () => a.customThemes,
44
+ store: e.store
45
+ }), h = (s) => {
46
+ if (!s)
46
47
  return;
47
48
  const o = e.workspace.workspaceList.value?.find(
48
- (n) => n.id === a
49
+ (n) => n.id === s
49
50
  );
50
51
  o && e.workspace.navigateToWorkspace(o.namespace, o.slug);
51
- }, c = x(), b = p(() => {
52
- const a = e.store.value?.auth ? H(
52
+ }, c = g(), S = T(() => {
53
+ const s = e.store.value?.auth ? L(
53
54
  e.document.value?.components?.securitySchemes ?? {},
54
55
  {},
55
56
  e.store.value.auth,
@@ -61,27 +62,28 @@ const L = ["innerHTML"], V = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 f
61
62
  environment: e.environment.value,
62
63
  eventBus: e.eventBus,
63
64
  exampleName: e.activeEntities.exampleName.value,
64
- layout: s.layout,
65
+ layout: a.layout,
65
66
  method: e.activeEntities.method.value,
66
67
  path: e.activeEntities.path.value,
67
68
  workspaceStore: e.store.value,
68
69
  activeWorkspace: e.workspace.activeWorkspace.value,
69
- plugins: s.plugins,
70
- securitySchemes: a
70
+ plugins: a.plugins,
71
+ securitySchemes: s,
72
+ customThemes: a.customThemes
71
73
  };
72
74
  });
73
- return (a, o) => (i(), d(t(g), null, {
74
- default: m(() => [
75
- l("div", { innerHTML: S.value }, null, 8, L),
76
- r(t(C)),
77
- t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), u("main", V, [
75
+ return (s, o) => (i(), m(t(x), null, {
76
+ default: p(() => [
77
+ l("div", { innerHTML: t(w) }, null, 8, V),
78
+ r(t(B)),
79
+ t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), u("main", $, [
78
80
  l("div", F, [
79
- s.layout === "desktop" ? (i(), d(P, {
81
+ a.layout === "desktop" ? (i(), m(P, {
80
82
  key: 0,
81
83
  activeTabIndex: t(e).tabs.activeTabIndex.value,
82
84
  eventBus: t(e).eventBus,
83
85
  tabs: t(e).tabs.state.value
84
- }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : k("", !0),
86
+ }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : v("", !0),
85
87
  l("div", R, [
86
88
  r(N, {
87
89
  isSidebarOpen: t(e).sidebar.isOpen.value,
@@ -89,7 +91,7 @@ const L = ["innerHTML"], V = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 f
89
91
  activeWorkspace: t(e).workspace.activeWorkspace.value,
90
92
  eventBus: t(e).eventBus,
91
93
  isWorkspaceOpen: t(e).workspace.isOpen.value,
92
- layout: s.layout,
94
+ layout: a.layout,
93
95
  sidebarState: t(e).sidebar.state,
94
96
  sidebarWidth: t(e).sidebar.width.value,
95
97
  store: t(e).store.value,
@@ -100,30 +102,30 @@ const L = ["innerHTML"], V = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 f
100
102
  onSelectItem: t(e).sidebar.handleSelectItem,
101
103
  "onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
102
104
  }, {
103
- sidebarMenuActions: m(() => [
104
- v(a.$slots, "sidebar-menu-actions")
105
+ sidebarMenuActions: p(() => [
106
+ d(s.$slots, "sidebar-menu-actions")
105
107
  ]),
106
108
  _: 3
107
109
  }, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onClick:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
108
110
  l("div", G, [
109
- s.layout === "web" ? (i(), u("nav", j, [
110
- r($)
111
- ])) : k("", !0),
111
+ a.layout === "web" ? (i(), u("nav", j, [
112
+ r(H)
113
+ ])) : v("", !0),
112
114
  l("div", z, [
113
- r(t(E), T(W(b.value)), null, 16)
115
+ r(t(E), y(W(S.value)), null, 16)
114
116
  ])
115
117
  ])
116
118
  ])
117
119
  ]),
118
- v(a.$slots, "create-workspace", { state: t(c) }, () => [
120
+ d(s.$slots, "create-workspace", { state: t(c) }, () => [
119
121
  r(A, {
120
122
  state: t(c),
121
123
  "onCreate:workspace": o[2] || (o[2] = (n) => t(e).workspace.create(n))
122
124
  }, null, 8, ["state"])
123
125
  ]),
124
- r(U, {
126
+ r(_, {
125
127
  eventBus: t(e).eventBus,
126
- paletteState: t(w),
128
+ paletteState: t(f),
127
129
  workspaceStore: t(e).store.value
128
130
  }, null, 8, ["eventBus", "paletteState", "workspaceStore"])
129
131
  ])) : (i(), u("main", K, [
@@ -135,5 +137,5 @@ const L = ["innerHTML"], V = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 f
135
137
  }
136
138
  });
137
139
  export {
138
- de as default
140
+ pe as default
139
141
  };
@@ -1,7 +1,7 @@
1
1
  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
- import type { Router } from 'vue-router';
4
+ import { type Router } from 'vue-router';
5
5
  export declare function initializeAppEventHandlers({ eventBus, store, router, rebuildSidebar, navigateToCurrentTab, onSelectSidebarItem, onAfterExampleCreation, onCopyTabUrl, onToggleSidebar, }: {
6
6
  eventBus: WorkspaceEventBus;
7
7
  store: ShallowRef<WorkspaceStore | null>;
@@ -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,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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oBAAoB,KAAK,IAAI,CAAA;IACzD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,eAAe,EAAE,MAAM,IAAI,CAAA;CAC5B,QAkRA"}
@@ -1,24 +1,25 @@
1
- import { computed as E } from "vue";
2
- import { initializeWorkspaceEventHandlers as h } from "../../workspace-events.js";
3
- function N({
4
- eventBus: m,
1
+ import { computed as x } from "vue";
2
+ import { NavigationFailureType as w } from "vue-router";
3
+ import { initializeWorkspaceEventHandlers as g } from "../../workspace-events.js";
4
+ function A({
5
+ eventBus: s,
5
6
  store: r,
6
- router: o,
7
- rebuildSidebar: p,
8
- navigateToCurrentTab: c,
9
- onSelectSidebarItem: d,
10
- onAfterExampleCreation: s,
11
- onCopyTabUrl: i,
12
- onToggleSidebar: f
7
+ router: n,
8
+ rebuildSidebar: u,
9
+ navigateToCurrentTab: m,
10
+ onSelectSidebarItem: f,
11
+ onAfterExampleCreation: i,
12
+ onCopyTabUrl: h,
13
+ onToggleSidebar: l
13
14
  }) {
14
- const u = E(() => o.currentRoute?.value), l = ({
15
+ const o = x(() => n.currentRoute?.value), p = ({
15
16
  documentName: e,
16
17
  path: a,
17
18
  method: t,
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
- h({
21
- eventBus: m,
19
+ exampleName: c
20
+ }) => !(e !== void 0 && e !== o.value?.params.documentSlug || a !== void 0 && encodeURIComponent(a) !== o.value?.params.pathEncoded || t !== void 0 && t !== o.value?.params.method || c !== void 0 && c !== o.value?.params.exampleName);
21
+ g({
22
+ eventBus: s,
22
23
  store: r,
23
24
  hooks: {
24
25
  //------------------------------------------------------------------------------------
@@ -26,7 +27,7 @@ function N({
26
27
  //------------------------------------------------------------------------------------
27
28
  "document:delete:document": {
28
29
  onAfterExecute: async (e) => {
29
- u?.value?.params.documentSlug === e.name && await o.push({
30
+ o?.value?.params.documentSlug === e.name && await n.push({
30
31
  name: "workspace.environment"
31
32
  });
32
33
  }
@@ -38,38 +39,38 @@ function N({
38
39
  onBeforeExecute: (e) => ({
39
40
  ...e,
40
41
  callback: async (a) => {
41
- a === "success" && (await o.replace({
42
+ a === "success" && (await n.replace({
42
43
  name: "example",
43
44
  params: {
44
45
  method: e.payload.method,
45
46
  pathEncoded: encodeURIComponent(e.payload.path),
46
- exampleName: u.value?.params.exampleName
47
+ exampleName: o.value?.params.exampleName
47
48
  }
48
- }), p(r.value?.workspace.activeDocument?.["x-scalar-navigation"]?.name)), e.callback(a);
49
+ }), u(r.value?.workspace.activeDocument?.["x-scalar-navigation"]?.name)), e.callback(a);
49
50
  }
50
51
  })
51
52
  },
52
53
  "operation:upsert:parameter": {
53
- onAfterExecute: (e) => s(e.meta)
54
+ onAfterExecute: (e) => i(e.meta)
54
55
  },
55
56
  "operation:update:extra-parameters": {
56
- onAfterExecute: (e) => s(e.meta)
57
+ onAfterExecute: (e) => i(e.meta)
57
58
  },
58
59
  "operation:reload:history": {
59
- onAfterExecute: (e) => s({ ...e.meta, exampleKey: "draft" })
60
+ onAfterExecute: (e) => i({ ...e.meta, exampleKey: "draft" })
60
61
  },
61
62
  "operation:delete:operation": {
62
63
  onAfterExecute: async (e) => {
63
- p(e.documentName);
64
+ u(e.documentName);
64
65
  const {
65
66
  documentName: a,
66
- meta: { path: t, method: n }
67
+ meta: { path: t, method: c }
67
68
  } = e;
68
- l({
69
+ p({
69
70
  documentName: a,
70
71
  path: t,
71
- method: n
72
- }) && await o.replace({
72
+ method: c
73
+ }) && await n.replace({
73
74
  name: "document.overview",
74
75
  params: {
75
76
  documentSlug: a
@@ -79,21 +80,21 @@ function N({
79
80
  },
80
81
  "operation:delete:example": {
81
82
  onAfterExecute: async (e) => {
82
- p(e.documentName);
83
+ u(e.documentName);
83
84
  const {
84
85
  documentName: a,
85
- meta: { path: t, method: n, exampleKey: x }
86
+ meta: { path: t, method: c, exampleKey: d }
86
87
  } = e;
87
- l({
88
+ p({
88
89
  documentName: a,
89
90
  path: t,
90
- method: n,
91
- exampleName: x
92
- }) && await o.replace({
91
+ method: c,
92
+ exampleName: d
93
+ }) && await n.replace({
93
94
  name: "example",
94
95
  params: {
95
96
  pathEncoded: encodeURIComponent(t),
96
- method: n,
97
+ method: c,
97
98
  documentSlug: a,
98
99
  exampleName: "default"
99
100
  }
@@ -104,55 +105,93 @@ function N({
104
105
  // Operation Request Body Related Hooks
105
106
  //------------------------------------------------------------------------------------
106
107
  "operation:update:requestBody:value": {
107
- onAfterExecute: (e) => s(e.meta)
108
+ onAfterExecute: (e) => i(e.meta)
108
109
  },
109
110
  "operation:update:requestBody:formValue": {
110
- onAfterExecute: (e) => s(e.meta)
111
+ onAfterExecute: (e) => i(e.meta)
111
112
  },
112
113
  //------------------------------------------------------------------------------------
113
114
  // Tag Related Event Hooks
114
115
  //------------------------------------------------------------------------------------
115
116
  "tag:create:tag": {
116
- onAfterExecute: (e) => p(e.documentName)
117
+ onAfterExecute: (e) => u(e.documentName)
117
118
  },
118
119
  "tag:delete:tag": {
119
- onAfterExecute: (e) => p(e.documentName)
120
+ onAfterExecute: (e) => u(e.documentName)
120
121
  },
121
122
  //------------------------------------------------------------------------------------
122
123
  // Tabs Related Event Hooks
123
124
  //------------------------------------------------------------------------------------
124
125
  "tabs:add:tab": {
125
- onAfterExecute: c
126
+ onAfterExecute: m
126
127
  },
127
128
  "tabs:close:tab": {
128
- onAfterExecute: c
129
+ onAfterExecute: m
129
130
  },
130
131
  "tabs:focus:tab": {
131
- onAfterExecute: c
132
+ onAfterExecute: m
132
133
  },
133
134
  "tabs:focus:tab-last": {
134
- onAfterExecute: c
135
+ onAfterExecute: m
135
136
  },
136
137
  "tabs:navigate:previous": {
137
- onAfterExecute: c
138
+ onAfterExecute: m
138
139
  },
139
140
  "tabs:navigate:next": {
140
- onAfterExecute: c
141
+ onAfterExecute: m
141
142
  },
142
143
  "tabs:update:tabs": {
143
- onAfterExecute: c
144
+ onAfterExecute: m
144
145
  }
145
146
  }
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.push({ name: e })), m.on("ui:route:example", async ({ exampleName: e, callback: a }) => {
147
- const t = await o.replace({
148
- name: "example",
149
- params: {
150
- exampleName: e
151
- }
152
- });
153
- a(t ? "error" : "success");
154
- }), m.on("tabs:copy:url", (e) => i(e.index));
147
+ }), s.on("scroll-to:nav-item", ({ id: e }) => f(e)), s.on("ui:toggle:sidebar", l), s.on("ui:navigate", async (e) => {
148
+ const a = (t) => {
149
+ if (!t)
150
+ return e.callback?.("success");
151
+ const c = w.duplicated;
152
+ return t.type !== c ? e.callback?.("error") : e.callback?.("success");
153
+ };
154
+ if (e.page === "document") {
155
+ const t = {
156
+ documentSlug: e.documentSlug,
157
+ workspaceSlug: e.workspaceSlug,
158
+ namespace: e.namespace
159
+ };
160
+ if (e.path === "overview")
161
+ return a(await n.push({ name: "document.overview", params: t }));
162
+ if (e.path === "servers")
163
+ return a(await n.push({ name: "document.servers", params: t }));
164
+ if (e.path === "environment")
165
+ return a(await n.push({ name: "document.environment", params: t }));
166
+ if (e.path === "authentication")
167
+ return a(await n.push({ name: "document.authentication", params: t }));
168
+ if (e.path === "cookies")
169
+ return a(await n.push({ name: "document.cookies", params: t }));
170
+ if (e.path === "settings")
171
+ return a(await n.push({ name: "document.settings", params: t }));
172
+ }
173
+ if (e.page === "workspace") {
174
+ const t = { workspaceSlug: e.workspaceSlug, namespace: e.namespace };
175
+ if (e.path === "environment")
176
+ return a(await n.push({ name: "workspace.environment", params: t }));
177
+ if (e.path === "cookies")
178
+ return a(await n.push({ name: "workspace.cookies", params: t }));
179
+ if (e.path === "settings")
180
+ return a(await n.push({ name: "workspace.settings", params: t }));
181
+ }
182
+ if (e.page === "example") {
183
+ const t = {
184
+ namespace: e.namespace,
185
+ workspaceSlug: e.workspaceSlug,
186
+ documentSlug: e.documentSlug,
187
+ pathEncoded: encodeURIComponent(e.path),
188
+ method: e.method,
189
+ exampleName: e.exampleName
190
+ };
191
+ return a(await n.push({ name: "example", params: t }));
192
+ }
193
+ }), s.on("tabs:copy:url", (e) => h(e.index));
155
194
  }
156
195
  export {
157
- N as initializeAppEventHandlers
196
+ A as initializeAppEventHandlers
158
197
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"AAmeA,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAA;AAO3B,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAUhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,WAAW,GAAG;IACf;;OAEG;IACH,MAAM,EAAE,YAAY,CAAA;IAEpB;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAE1C;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C;;;OAGG;IACH,UAAU,EAAE,cAAc,EAAE,CAAA;IAC5B;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AAiBJ,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AAkL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Ac,EAAE,CAAA;IAC5B;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AAiBJ,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AAkLF,KAAK,gBAAgB,GAAG;IACxB,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;AAMF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AA2kBxD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./AppSidebar.vue2.js";
2
2
  /* empty css */
3
- import a from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-6a79a4d6"]]);
3
+ import p from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-658f060e"]]);
5
5
  export {
6
- m as default
6
+ e as default
7
7
  };