@scalar/api-client 2.24.0 → 2.26.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 (81) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  3. package/dist/components/DataTable/DataTableCheckbox.vue.js +8 -8
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +28 -19
  7. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  8. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  9. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +1 -1
  10. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  11. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +18 -18
  12. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  13. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.d.ts.map +1 -1
  14. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +2 -2
  15. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue2.js +19 -19
  16. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  17. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +26 -26
  18. package/dist/v2/components/callout/Callout.vue.d.ts +17 -0
  19. package/dist/v2/components/callout/Callout.vue.d.ts.map +1 -0
  20. package/dist/v2/components/callout/Callout.vue.js +7 -0
  21. package/dist/v2/components/callout/Callout.vue2.js +43 -0
  22. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
  23. package/dist/v2/components/data-table/DataTableCheckbox.vue.js +8 -8
  24. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -2
  25. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  26. package/dist/v2/components/sidebar/Sidebar.vue.js +40 -41
  27. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -2
  28. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  29. package/dist/v2/components/sidebar/SidebarMenu.vue.js +6 -6
  30. package/dist/v2/features/app/App.vue.d.ts +6 -3
  31. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  32. package/dist/v2/features/app/App.vue.js +87 -86
  33. package/dist/v2/features/app/app-events.d.ts +1 -1
  34. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  35. package/dist/v2/features/app/app-events.js +10 -10
  36. package/dist/v2/features/app/app-state.d.ts +77 -96
  37. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  38. package/dist/v2/features/app/app-state.js +339 -322
  39. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +2 -2
  40. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  41. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  42. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  43. package/dist/v2/features/app/components/DesktopTabs.vue.js +1 -1
  44. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
  45. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  46. package/dist/v2/features/app/helpers/create-api-client-app.js +9 -9
  47. package/dist/v2/features/app/helpers/filter-workspaces.d.ts +49 -0
  48. package/dist/v2/features/app/helpers/filter-workspaces.d.ts.map +1 -0
  49. package/dist/v2/features/app/helpers/filter-workspaces.js +5 -0
  50. package/dist/v2/features/app/helpers/get-route-param.d.ts +7 -0
  51. package/dist/v2/features/app/helpers/get-route-param.d.ts.map +1 -0
  52. package/dist/v2/features/app/helpers/get-route-param.js +9 -0
  53. package/dist/v2/features/app/helpers/group-workspaces.d.ts +24 -0
  54. package/dist/v2/features/app/helpers/group-workspaces.d.ts.map +1 -0
  55. package/dist/v2/features/app/helpers/group-workspaces.js +23 -0
  56. package/dist/v2/features/app/index.d.ts +1 -1
  57. package/dist/v2/features/app/index.d.ts.map +1 -1
  58. package/dist/v2/features/app/index.js +12 -12
  59. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  60. package/dist/v2/features/collection/DocumentCollection.vue.js +72 -65
  61. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +29 -2
  62. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
  63. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +110 -106
  64. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts +5 -1
  65. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +1 -1
  66. package/dist/v2/features/command-palette/helpers/load-document-from-source.js +41 -23
  67. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +41 -8
  68. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  69. package/dist/v2/features/command-palette/index.d.ts +1 -2
  70. package/dist/v2/features/command-palette/index.d.ts.map +1 -1
  71. package/dist/v2/features/command-palette/index.js +4 -6
  72. package/dist/v2/features/operation/Operation.vue.js +1 -1
  73. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts.map +1 -1
  74. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +2 -2
  75. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +24 -23
  76. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  77. package/package.json +10 -10
  78. package/dist/v2/features/app/components/WebTopNav.vue.d.ts +0 -41
  79. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +0 -1
  80. package/dist/v2/features/app/components/WebTopNav.vue.js +0 -27
  81. package/dist/v2/features/app/components/WebTopNav.vue2.js +0 -4
@@ -1,13 +1,13 @@
1
- import { defineComponent as h, mergeModels as y, useSlots as D, ref as V, useModel as B, computed as M, createBlock as d, openBlock as l, unref as r, withCtx as s, createVNode as C, createSlots as E, renderSlot as i, createElementBlock as v, createCommentVNode as n, Fragment as R, normalizeProps as f, guardReactiveProps as b, createElementVNode as w, isRef as z } from "vue";
1
+ import { defineComponent as D, mergeModels as v, useSlots as V, ref as B, useModel as M, computed as C, createBlock as u, openBlock as l, unref as r, withCtx as s, createVNode as y, createSlots as E, renderSlot as i, createElementBlock as w, createCommentVNode as m, Fragment as R, normalizeProps as f, guardReactiveProps as p, createElementVNode as g, isRef as z } from "vue";
2
2
  import { ScalarIconButton as F, ScalarSidebarSearchInput as N } from "@scalar/components";
3
3
  import { ScalarIconFileDashed as q, ScalarIconMagnifyingGlass as A } from "@scalar/icons";
4
4
  import { ScalarSidebar as U } from "@scalar/sidebar";
5
5
  import j from "./SidebarMenu.vue.js";
6
6
  import { useSearchIndex as G } from "../../features/search/hooks/use-search-index.js";
7
7
  import H from "../resize/Resize.vue.js";
8
- const J = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, K = { class: "flex items-center justify-between" }, L = { key: 1 }, _ = /* @__PURE__ */ h({
8
+ const J = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, K = { class: "flex items-center justify-between" }, L = { key: 1 }, _ = /* @__PURE__ */ D({
9
9
  __name: "Sidebar",
10
- props: /* @__PURE__ */ y({
10
+ props: /* @__PURE__ */ v({
11
11
  sidebarState: {},
12
12
  layout: {},
13
13
  activeWorkspace: {},
@@ -21,67 +21,66 @@ const J = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, K =
21
21
  },
22
22
  sidebarWidthModifiers: {}
23
23
  }),
24
- emits: /* @__PURE__ */ y(["selectItem", "select:workspace", "create:workspace", "reorder"], ["update:sidebarWidth"]),
25
- setup(t, { emit: g }) {
26
- const c = g, p = D(), u = V(!1), k = B(t, "sidebarWidth"), S = (o) => o.type === "example" && o.title === "draft", { query: m, results: x } = G(() => t.documents), I = M(() => x.value ?? t.sidebarState.items.value), W = (o) => {
27
- c("selectItem", o), m.value = "", u.value = !1;
24
+ emits: /* @__PURE__ */ v(["selectItem", "select:workspace", "create:workspace", "reorder"], ["update:sidebarWidth"]),
25
+ setup(a, { emit: x }) {
26
+ const d = x, b = V(), n = B(!1), k = M(a, "sidebarWidth"), S = (o) => o.type === "example" && o.title === "draft", { query: c, results: I } = G(() => a.documents), W = C(() => I.value ?? a.sidebarState.items.value), $ = (o) => {
27
+ d("selectItem", o), c.value = "", n.value = !1;
28
28
  };
29
- return (o, a) => (l(), d(r(H), {
29
+ return (o, t) => (l(), u(r(H), {
30
30
  width: k.value,
31
- "onUpdate:width": a[5] || (a[5] = (e) => k.value = e),
31
+ "onUpdate:width": t[5] || (t[5] = (e) => k.value = e),
32
32
  class: "flex flex-col"
33
33
  }, {
34
34
  default: s(() => [
35
- C(r(U), {
35
+ y(r(U), {
36
36
  class: "flex w-auto flex-1 pt-2",
37
37
  indent: 15,
38
- isDraggable: t.layout !== "modal",
39
- isDroppable: t.isDroppable,
40
- isExpanded: t.sidebarState.isExpanded,
41
- isSelected: t.sidebarState.isSelected,
42
- items: I.value,
38
+ isDraggable: a.layout !== "modal",
39
+ isDroppable: a.isDroppable,
40
+ isExpanded: a.sidebarState.isExpanded,
41
+ isSelected: a.sidebarState.isSelected,
42
+ items: W.value,
43
43
  layout: "client",
44
- onReorder: a[4] || (a[4] = (e, $) => c("reorder", e, $)),
45
- onSelectItem: W
44
+ onReorder: t[4] || (t[4] = (e, h) => d("reorder", e, h)),
45
+ onSelectItem: $
46
46
  }, E({
47
47
  header: s(() => [
48
- w("div", J, [
49
- w("div", K, [
50
- t.layout === "desktop" ? (l(), d(j, {
48
+ g("div", J, [
49
+ g("div", K, [
50
+ a.layout !== "modal" ? (l(), u(j, {
51
51
  key: 0,
52
- activeWorkspace: t.activeWorkspace,
53
- workspaces: t.workspaces,
54
- "onCreate:workspace": a[0] || (a[0] = (e) => c("create:workspace")),
55
- "onSelect:workspace": a[1] || (a[1] = (e) => c("select:workspace", e))
52
+ activeWorkspace: a.activeWorkspace,
53
+ workspaces: a.workspaces,
54
+ "onCreate:workspace": t[0] || (t[0] = (e) => d("create:workspace")),
55
+ "onSelect:workspace": t[1] || (t[1] = (e) => d("select:workspace", e))
56
56
  }, {
57
57
  sidebarMenuActions: s(() => [
58
58
  i(o.$slots, "sidebarMenuActions")
59
59
  ]),
60
60
  _: 3
61
- }, 8, ["activeWorkspace", "workspaces"])) : t.layout === "modal" ? (l(), v("div", L)) : n("", !0),
62
- t.layout !== "web" ? (l(), d(r(F), {
63
- key: 2,
61
+ }, 8, ["activeWorkspace", "workspaces"])) : a.layout === "modal" ? (l(), w("div", L)) : m("", !0),
62
+ y(r(F), {
64
63
  icon: r(A),
65
64
  label: "Search",
66
- onClick: a[2] || (a[2] = (e) => u.value = !u.value)
67
- }, null, 8, ["icon"])) : n("", !0)
65
+ onClick: t[2] || (t[2] = (e) => n.value = !n.value)
66
+ }, null, 8, ["icon"])
68
67
  ]),
69
- u.value || t.layout === "web" ? (l(), d(r(N), {
68
+ n.value ? (l(), u(r(N), {
70
69
  key: 0,
71
- modelValue: r(m),
72
- "onUpdate:modelValue": a[3] || (a[3] = (e) => z(m) ? m.value = e : null),
73
- autofocus: t.layout !== "web"
74
- }, null, 8, ["modelValue", "autofocus"])) : n("", !0)
70
+ modelValue: r(c),
71
+ "onUpdate:modelValue": t[3] || (t[3] = (e) => z(c) ? c.value = e : null),
72
+ autofocus: ""
73
+ }, null, 8, ["modelValue"])) : m("", !0)
75
74
  ])
76
75
  ]),
77
76
  decorator: s((e) => [
78
- i(o.$slots, "decorator", f(b(e)))
77
+ i(o.$slots, "decorator", f(p(e)))
79
78
  ]),
80
79
  icon: s((e) => [
81
- p.icon || S(e.item) ? (l(), v(R, { key: 0 }, [
82
- S(e.item) ? (l(), d(r(q), { key: 0 })) : n("", !0),
83
- i(o.$slots, "icon", f(b(e)))
84
- ], 64)) : n("", !0)
80
+ b.icon || S(e.item) ? (l(), w(R, { key: 0 }, [
81
+ S(e.item) ? (l(), u(r(q), { key: 0 })) : m("", !0),
82
+ i(o.$slots, "icon", f(p(e)))
83
+ ], 64)) : m("", !0)
85
84
  ]),
86
85
  before: s(() => [
87
86
  i(o.$slots, "workspaceButton")
@@ -91,10 +90,10 @@ const J = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, K =
91
90
  ]),
92
91
  _: 2
93
92
  }, [
94
- p.empty ? {
93
+ b.empty ? {
95
94
  name: "empty",
96
95
  fn: s((e) => [
97
- i(o.$slots, "empty", f(b(e)))
96
+ i(o.$slots, "empty", f(p(e)))
98
97
  ]),
99
98
  key: "0"
100
99
  } : void 0
@@ -1,4 +1,4 @@
1
- import { type ScalarListboxOption } from '@scalar/components';
1
+ import { type WorkspaceGroup } from '@scalar/components';
2
2
  type __VLS_Props = {
3
3
  /**
4
4
  * The currently active workspace.
@@ -11,7 +11,7 @@ type __VLS_Props = {
11
11
  * The list of all available workspaces.
12
12
  * Used to render options for workspace switching and selection.
13
13
  */
14
- workspaces: ScalarListboxOption[];
14
+ workspaces: WorkspaceGroup[];
15
15
  };
16
16
  type __VLS_Slots = {
17
17
  /** Slot for customizing the actions section of the sidebar menu. */
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarMenu.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"names":[],"mappings":"AAoEA,OAAO,EAOL,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAA;AAI3B,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/B;;;OAGG;IACH,UAAU,EAAE,mBAAmB,EAAE,CAAA;CAClC,CAAC;AAWF,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AA8HF,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SidebarMenu.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"names":[],"mappings":"AAoEA,OAAO,EAOL,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAA;AAI3B,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/B;;;OAGG;IACH,UAAU,EAAE,cAAc,EAAE,CAAA;CAC7B,CAAC;AAWF,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AA8HF,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -9,8 +9,8 @@ const L = /* @__PURE__ */ p({
9
9
  workspaces: {}
10
10
  },
11
11
  emits: ["create:workspace", "select:workspace"],
12
- setup(n, { emit: i }) {
13
- const a = i;
12
+ setup(a, { emit: i }) {
13
+ const n = i;
14
14
  return (c, e) => (k(), u(o(S), null, {
15
15
  products: t(() => [...e[2] || (e[2] = [])]),
16
16
  sections: t(({ close: l }) => [
@@ -18,10 +18,10 @@ const L = /* @__PURE__ */ p({
18
18
  default: t(() => [
19
19
  m(c.$slots, "sidebarMenuActions", {}, () => [
20
20
  r(o(w), {
21
- modelValue: n.activeWorkspace.id,
22
- workspaceOptions: [{ options: n.workspaces }],
23
- onCreateWorkspace: e[0] || (e[0] = (s) => a("create:workspace")),
24
- "onUpdate:modelValue": e[1] || (e[1] = (s) => a("select:workspace", s))
21
+ modelValue: a.activeWorkspace.id,
22
+ workspaceOptions: a.workspaces,
23
+ onCreateWorkspace: e[0] || (e[0] = (s) => n("create:workspace")),
24
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => n("select:workspace", s))
25
25
  }, null, 8, ["modelValue", "workspaceOptions"]),
26
26
  r(o(M), {
27
27
  is: o(v),
@@ -1,6 +1,7 @@
1
+ import { type ModalState } from '@scalar/components';
2
+ import type { CommandPaletteState } from '../../../v2/features/command-palette/hooks/use-command-palette-state.js';
1
3
  import type { ClientPlugin } from '../../../v2/helpers/plugins.js';
2
4
  import type { ClientLayout } from '../../../v2/types/layout';
3
- import type { CommandPaletteState } from '../command-palette/hooks/use-command-palette-state.js';
4
5
  import { type AppState } from './app-state.js';
5
6
  /**
6
7
  * Main entry point for the API client for electron and web.
@@ -24,12 +25,14 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
24
25
  * Slot for customizing the actions section of the sidebar menu.
25
26
  * This slot is used to render custom actions or components within the actions section.
26
27
  */
27
- 'sidebar-menu-actions': [];
28
+ 'sidebar-menu-actions': () => unknown;
28
29
  /**
29
30
  * Slot for customizing the create workspace modal.
30
31
  * This slot is used to render custom actions or components within the create workspace modal.
31
32
  */
32
- 'create-workspace'?: () => unknown;
33
+ 'create-workspace'?: (payload: {
34
+ state: ModalState;
35
+ }) => unknown;
33
36
  }>;
34
37
  export default _default;
35
38
  type __VLS_WithSlots<T, S> = T & {
@@ -1 +1 @@
1
- {"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"AA8PA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD,OAAO,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OAGG;yBACkB,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,UAAU,CAAA;KAAE,KAAK,OAAO;;AAxBlE,wBA6WC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,24 +1,24 @@
1
- import { defineComponent as h, computed as m, createBlock as c, openBlock as i, unref as t, withCtx as d, createElementVNode as u, createVNode as n, createElementBlock as v, renderSlot as k, normalizeProps as W, guardReactiveProps as y } from "vue";
2
- import { useModal as T, ScalarTeleportRoot as g } from "@scalar/components";
3
- import { getThemeStyles as C } from "@scalar/themes";
4
- import { ScalarToasts as x } from "@scalar/use-toasts";
5
- import { extensions as B } from "@scalar/workspace-store/schemas/extensions";
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";
6
6
  import { RouterView as E } from "vue-router";
7
- import O from "./components/CreateWorkspaceModal.vue.js";
8
- import _ 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";
7
+ import A from "./components/CreateWorkspaceModal.vue.js";
8
+ import O from "./components/SplashScreen.vue.js";
9
+ import { useDocumentWatcher as M } from "./hooks/use-document-watcher.js";
10
+ import U from "../command-palette/TheCommandPalette.vue.js";
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
- import D from "./components/AppSidebar.vue.js";
14
- import $ from "./components/DesktopTabs.vue.js";
15
- import L from "./components/WebTopNav.vue.js";
16
- import { mergeSecurity as N } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
17
- const P = ["innerHTML"], H = {
13
+ import N from "./components/AppSidebar.vue.js";
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 = {
18
18
  key: 0,
19
- class: "flex flex-1 flex-col"
20
- }, F = { class: "flex min-h-0 flex-1" }, V = { class: "bg-b-1 flex-1" }, R = { key: 1 }, z = {}, le = /* @__PURE__ */ h({
21
- ...z,
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({
21
+ ...q,
22
22
  __name: "App",
23
23
  props: {
24
24
  layout: {},
@@ -26,30 +26,30 @@ const P = ["innerHTML"], H = {
26
26
  getAppState: { type: Function },
27
27
  getCommandPaletteState: { type: Function }
28
28
  },
29
- setup(s, { expose: w }) {
30
- w({
31
- openCreateWorkspace: () => l.show()
29
+ setup(s, { expose: f }) {
30
+ f({
31
+ openCreateWorkspace: () => c.show()
32
32
  });
33
- const e = s.getAppState(), f = s.getCommandPaletteState();
34
- typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), U({ workspaceStore: e.store }), I(e.eventBus, s.layout), A({
35
- documentName: () => e.store.value?.workspace[B.workspace.activeDocument],
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],
36
36
  store: e.store,
37
37
  initialTimeout: 5e3
38
- });
39
- const S = m(() => {
38
+ }), D({ workspaceStore: e.store });
39
+ const S = p(() => {
40
40
  if (e.store.value === null)
41
41
  return "";
42
- const o = e.store.value.workspace["x-scalar-theme"];
43
- return o ? `<style>${C(o)}</style>` : "";
44
- }), p = (o) => {
45
- if (!o)
42
+ const a = e.store.value.workspace["x-scalar-theme"];
43
+ return a ? `<style>${B(a)}</style>` : "";
44
+ }), h = (a) => {
45
+ if (!a)
46
46
  return;
47
- const a = e.workspace.workspaceList.value?.find(
48
- (r) => r.id === o
47
+ const o = e.workspace.workspaceList.value?.find(
48
+ (n) => n.id === a
49
49
  );
50
- a && e.workspace.navigateToWorkspace(a.namespace, a.slug);
51
- }, l = T(), b = m(() => {
52
- const o = e.store.value?.auth ? N(
50
+ o && e.workspace.navigateToWorkspace(o.namespace, o.slug);
51
+ }, c = x(), b = p(() => {
52
+ const a = e.store.value?.auth ? H(
53
53
  e.document.value?.components?.securitySchemes ?? {},
54
54
  {},
55
55
  e.store.value.auth,
@@ -67,66 +67,67 @@ const P = ["innerHTML"], H = {
67
67
  workspaceStore: e.store.value,
68
68
  activeWorkspace: e.workspace.activeWorkspace.value,
69
69
  plugins: s.plugins,
70
- securitySchemes: o
70
+ securitySchemes: a
71
71
  };
72
72
  });
73
- return (o, a) => (i(), c(t(g), null, {
74
- default: d(() => [
75
- u("div", { innerHTML: S.value }, null, 8, P),
76
- n(t(x)),
77
- t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), v("main", H, [
78
- s.layout === "desktop" ? (i(), c($, {
79
- key: 0,
80
- activeTabIndex: t(e).tabs.activeTabIndex.value,
81
- eventBus: t(e).eventBus,
82
- tabs: t(e).tabs.state.value
83
- }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : (i(), c(L, {
84
- key: 1,
85
- activeWorkspace: t(e).workspace.activeWorkspace.value,
86
- workspaces: t(e).workspace.workspaceList.value,
87
- "onCreate:workspace": a[0] || (a[0] = (r) => t(l).show()),
88
- "onSelect:workspace": p
89
- }, null, 8, ["activeWorkspace", "workspaces"])),
90
- u("div", F, [
91
- n(D, {
92
- isSidebarOpen: t(e).sidebar.isOpen.value,
93
- "onUpdate:isSidebarOpen": a[1] || (a[1] = (r) => t(e).sidebar.isOpen.value = r),
94
- activeWorkspace: t(e).workspace.activeWorkspace.value,
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, [
78
+ l("div", F, [
79
+ s.layout === "desktop" ? (i(), d(P, {
80
+ key: 0,
81
+ activeTabIndex: t(e).tabs.activeTabIndex.value,
95
82
  eventBus: t(e).eventBus,
96
- isWorkspaceOpen: t(e).workspace.isOpen.value,
97
- layout: s.layout,
98
- sidebarState: t(e).sidebar.state,
99
- sidebarWidth: t(e).sidebar.width.value,
100
- store: t(e).store.value,
101
- workspaces: t(e).workspace.workspaceList.value,
102
- "onClick:workspace": t(e).workspace.navigateToWorkspace,
103
- "onCreate:workspace": a[2] || (a[2] = (r) => t(l).show()),
104
- "onSelect:workspace": p,
105
- onSelectItem: t(e).sidebar.handleSelectItem,
106
- "onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
107
- }, {
108
- sidebarMenuActions: d(() => [
109
- k(o.$slots, "sidebar-menu-actions")
110
- ]),
111
- _: 3
112
- }, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onClick:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
113
- u("div", V, [
114
- n(t(E), W(y(b.value)), null, 16)
83
+ tabs: t(e).tabs.state.value
84
+ }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : k("", !0),
85
+ l("div", R, [
86
+ r(N, {
87
+ isSidebarOpen: t(e).sidebar.isOpen.value,
88
+ "onUpdate:isSidebarOpen": o[0] || (o[0] = (n) => t(e).sidebar.isOpen.value = n),
89
+ activeWorkspace: t(e).workspace.activeWorkspace.value,
90
+ eventBus: t(e).eventBus,
91
+ isWorkspaceOpen: t(e).workspace.isOpen.value,
92
+ layout: s.layout,
93
+ sidebarState: t(e).sidebar.state,
94
+ sidebarWidth: t(e).sidebar.width.value,
95
+ store: t(e).store.value,
96
+ workspaces: t(e).workspace.workspaceGroups.value,
97
+ "onClick:workspace": t(e).workspace.navigateToWorkspace,
98
+ "onCreate:workspace": o[1] || (o[1] = (n) => t(c).show()),
99
+ "onSelect:workspace": h,
100
+ onSelectItem: t(e).sidebar.handleSelectItem,
101
+ "onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
102
+ }, {
103
+ sidebarMenuActions: m(() => [
104
+ v(a.$slots, "sidebar-menu-actions")
105
+ ]),
106
+ _: 3
107
+ }, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onClick:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
108
+ l("div", G, [
109
+ s.layout === "web" ? (i(), u("nav", j, [
110
+ r($)
111
+ ])) : k("", !0),
112
+ l("div", z, [
113
+ r(t(E), T(W(b.value)), null, 16)
114
+ ])
115
+ ])
115
116
  ])
116
117
  ]),
117
- k(o.$slots, "create-workspace", {}, () => [
118
- n(O, {
119
- state: t(l),
120
- "onCreate:workspace": a[3] || (a[3] = (r) => t(e).workspace.create(r))
118
+ v(a.$slots, "create-workspace", { state: t(c) }, () => [
119
+ r(A, {
120
+ state: t(c),
121
+ "onCreate:workspace": o[2] || (o[2] = (n) => t(e).workspace.create(n))
121
122
  }, null, 8, ["state"])
122
123
  ]),
123
- n(M, {
124
+ r(U, {
124
125
  eventBus: t(e).eventBus,
125
- paletteState: t(f),
126
+ paletteState: t(w),
126
127
  workspaceStore: t(e).store.value
127
128
  }, null, 8, ["eventBus", "paletteState", "workspaceStore"])
128
- ])) : (i(), v("main", R, [
129
- n(_)
129
+ ])) : (i(), u("main", K, [
130
+ r(O)
130
131
  ]))
131
132
  ]),
132
133
  _: 3
@@ -134,5 +135,5 @@ const P = ["innerHTML"], H = {
134
135
  }
135
136
  });
136
137
  export {
137
- le as default
138
+ de as default
138
139
  };
@@ -5,7 +5,7 @@ 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>;
8
- router: ShallowRef<Router | null>;
8
+ router: Router;
9
9
  rebuildSidebar: (documentName?: string) => void;
10
10
  navigateToCurrentTab: () => Promise<void>;
11
11
  onSelectSidebarItem: (id: string) => 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,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,MAA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AI,CAAA;IACzD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,eAAe,EAAE,MAAM,IAAI,CAAA;CAC5B,QAmNA"}
@@ -1,5 +1,5 @@
1
- import { computed as v } from "vue";
2
- import { initializeWorkspaceEventHandlers as E } from "../../workspace-events.js";
1
+ import { computed as E } from "vue";
2
+ import { initializeWorkspaceEventHandlers as h } from "../../workspace-events.js";
3
3
  function N({
4
4
  eventBus: m,
5
5
  store: r,
@@ -11,13 +11,13 @@ function N({
11
11
  onCopyTabUrl: i,
12
12
  onToggleSidebar: f
13
13
  }) {
14
- const u = v(() => o.value?.currentRoute?.value), l = ({
14
+ const u = E(() => o.currentRoute?.value), l = ({
15
15
  documentName: e,
16
16
  path: a,
17
17
  method: t,
18
18
  exampleName: n
19
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({
20
+ h({
21
21
  eventBus: m,
22
22
  store: r,
23
23
  hooks: {
@@ -26,7 +26,7 @@ function N({
26
26
  //------------------------------------------------------------------------------------
27
27
  "document:delete:document": {
28
28
  onAfterExecute: async (e) => {
29
- u?.value?.params.documentSlug === e.name && await o.value?.push({
29
+ u?.value?.params.documentSlug === e.name && await o.push({
30
30
  name: "workspace.environment"
31
31
  });
32
32
  }
@@ -38,7 +38,7 @@ function N({
38
38
  onBeforeExecute: (e) => ({
39
39
  ...e,
40
40
  callback: async (a) => {
41
- a === "success" && (await o.value?.replace({
41
+ a === "success" && (await o.replace({
42
42
  name: "example",
43
43
  params: {
44
44
  method: e.payload.method,
@@ -69,7 +69,7 @@ function N({
69
69
  documentName: a,
70
70
  path: t,
71
71
  method: n
72
- }) && await o.value?.replace({
72
+ }) && await o.replace({
73
73
  name: "document.overview",
74
74
  params: {
75
75
  documentSlug: a
@@ -89,7 +89,7 @@ function N({
89
89
  path: t,
90
90
  method: n,
91
91
  exampleName: x
92
- }) && await o.value?.replace({
92
+ }) && await o.replace({
93
93
  name: "example",
94
94
  params: {
95
95
  pathEncoded: encodeURIComponent(t),
@@ -143,8 +143,8 @@ function N({
143
143
  onAfterExecute: c
144
144
  }
145
145
  }
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({
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
148
  name: "example",
149
149
  params: {
150
150
  exampleName: e