@scalar/api-client 2.31.3 → 2.33.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 (102) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/dist/assets/yaml.worker-CcQnAKCg.js +490 -0
  3. package/dist/style.css +1 -1
  4. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  5. package/dist/v2/features/app/App.vue.d.ts +0 -5
  6. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  7. package/dist/v2/features/app/App.vue.js +57 -60
  8. package/dist/v2/features/app/app-state.d.ts +17 -2
  9. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  10. package/dist/v2/features/app/app-state.js +117 -105
  11. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  12. package/dist/v2/features/app/helpers/create-api-client-app.js +1 -3
  13. package/dist/v2/features/app/helpers/routes.d.ts +17 -0
  14. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  15. package/dist/v2/features/app/helpers/routes.js +8 -2
  16. package/dist/v2/features/app/hooks/use-theme.d.ts +14 -0
  17. package/dist/v2/features/app/hooks/use-theme.d.ts.map +1 -1
  18. package/dist/v2/features/app/hooks/use-theme.js +42 -28
  19. package/dist/v2/features/collection/DocumentCollection.vue.js +8 -6
  20. package/dist/v2/features/collection/OperationCollection.vue.js +14 -12
  21. package/dist/v2/features/collection/WorkspaceCollection.vue.js +9 -7
  22. package/dist/v2/features/collection/components/Authentication.vue2.js +19 -17
  23. package/dist/v2/features/collection/components/Cookies.vue.js +10 -8
  24. package/dist/v2/features/collection/components/Editor/Editor.vue.d.ts +16 -0
  25. package/dist/v2/features/collection/components/Editor/Editor.vue.d.ts.map +1 -0
  26. package/dist/v2/features/collection/components/Editor/Editor.vue.js +7 -0
  27. package/dist/v2/features/collection/components/Editor/Editor.vue2.js +333 -0
  28. package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue.d.ts +19 -0
  29. package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue.d.ts.map +1 -0
  30. package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue.js +78 -0
  31. package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue2.js +4 -0
  32. package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue.d.ts +16 -0
  33. package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue.d.ts.map +1 -0
  34. package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue.js +83 -0
  35. package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue2.js +4 -0
  36. package/dist/v2/features/collection/components/Editor/helpers/apply-scalar-theme.d.ts +16 -0
  37. package/dist/v2/features/collection/components/Editor/helpers/apply-scalar-theme.d.ts.map +1 -0
  38. package/dist/v2/features/collection/components/Editor/helpers/apply-scalar-theme.js +56 -0
  39. package/dist/v2/features/collection/components/Editor/helpers/configure-language-support.d.ts +7 -0
  40. package/dist/v2/features/collection/components/Editor/helpers/configure-language-support.d.ts.map +1 -0
  41. package/dist/v2/features/collection/components/Editor/helpers/configure-language-support.js +40 -0
  42. package/dist/v2/features/collection/components/Editor/helpers/ensure-monaco-environment.d.ts +6 -0
  43. package/dist/v2/features/collection/components/Editor/helpers/ensure-monaco-environment.d.ts.map +1 -0
  44. package/dist/v2/features/collection/components/Editor/helpers/ensure-monaco-environment.js +23 -0
  45. package/dist/v2/features/collection/components/Editor/helpers/get-diagnostic-counts.d.ts +12 -0
  46. package/dist/v2/features/collection/components/Editor/helpers/get-diagnostic-counts.d.ts.map +1 -0
  47. package/dist/v2/features/collection/components/Editor/helpers/get-diagnostic-counts.js +10 -0
  48. package/dist/v2/features/collection/components/Editor/helpers/get-json-ast-node-from-path.d.ts +14 -0
  49. package/dist/v2/features/collection/components/Editor/helpers/get-json-ast-node-from-path.d.ts.map +1 -0
  50. package/dist/v2/features/collection/components/Editor/helpers/get-json-ast-node-from-path.js +9 -0
  51. package/dist/v2/features/collection/components/Editor/helpers/get-operation-context.d.ts +11 -0
  52. package/dist/v2/features/collection/components/Editor/helpers/get-operation-context.d.ts.map +1 -0
  53. package/dist/v2/features/collection/components/Editor/helpers/get-operation-context.js +5 -0
  54. package/dist/v2/features/collection/components/Editor/helpers/get-visible-diagnostics.d.ts +7 -0
  55. package/dist/v2/features/collection/components/Editor/helpers/get-visible-diagnostics.d.ts.map +1 -0
  56. package/dist/v2/features/collection/components/Editor/helpers/get-visible-diagnostics.js +5 -0
  57. package/dist/v2/features/collection/components/Editor/helpers/get-yaml-node-range-from-path.d.ts +19 -0
  58. package/dist/v2/features/collection/components/Editor/helpers/get-yaml-node-range-from-path.d.ts.map +1 -0
  59. package/dist/v2/features/collection/components/Editor/helpers/get-yaml-node-range-from-path.js +50 -0
  60. package/dist/v2/features/collection/components/Editor/helpers/json-ast.d.ts +12 -0
  61. package/dist/v2/features/collection/components/Editor/helpers/json-ast.d.ts.map +1 -0
  62. package/dist/v2/features/collection/components/Editor/helpers/json-ast.js +24 -0
  63. package/dist/v2/features/collection/components/Editor/helpers/json-pointer-links.d.ts +15 -0
  64. package/dist/v2/features/collection/components/Editor/helpers/json-pointer-links.d.ts.map +1 -0
  65. package/dist/v2/features/collection/components/Editor/helpers/json-pointer-links.js +72 -0
  66. package/dist/v2/features/collection/components/Editor/helpers/json-pointer-path.d.ts +7 -0
  67. package/dist/v2/features/collection/components/Editor/helpers/json-pointer-path.d.ts.map +1 -0
  68. package/dist/v2/features/collection/components/Editor/helpers/json-pointer-path.js +20 -0
  69. package/dist/v2/features/collection/components/Editor/helpers/load-css-variables.d.ts +14 -0
  70. package/dist/v2/features/collection/components/Editor/helpers/load-css-variables.d.ts.map +1 -0
  71. package/dist/v2/features/collection/components/Editor/helpers/load-css-variables.js +21 -0
  72. package/dist/v2/features/collection/components/Editor/helpers/parse-editor-object.d.ts +10 -0
  73. package/dist/v2/features/collection/components/Editor/helpers/parse-editor-object.d.ts.map +1 -0
  74. package/dist/v2/features/collection/components/Editor/helpers/parse-editor-object.js +21 -0
  75. package/dist/v2/features/collection/components/Editor/helpers/stringify-document.d.ts +10 -0
  76. package/dist/v2/features/collection/components/Editor/helpers/stringify-document.d.ts.map +1 -0
  77. package/dist/v2/features/collection/components/Editor/helpers/stringify-document.js +5 -0
  78. package/dist/v2/features/collection/components/Editor/helpers/yaml.worker.d.ts +2 -0
  79. package/dist/v2/features/collection/components/Editor/helpers/yaml.worker.d.ts.map +1 -0
  80. package/dist/v2/features/collection/components/Editor/helpers/yaml.worker.js +11 -0
  81. package/dist/v2/features/collection/components/Editor/hooks/use-editor-markers.d.ts +152 -0
  82. package/dist/v2/features/collection/components/Editor/hooks/use-editor-markers.d.ts.map +1 -0
  83. package/dist/v2/features/collection/components/Editor/hooks/use-editor-markers.js +34 -0
  84. package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.d.ts +14 -0
  85. package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.d.ts.map +1 -0
  86. package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.js +25 -0
  87. package/dist/v2/features/collection/components/Editor/hooks/use-editor.d.ts +39 -0
  88. package/dist/v2/features/collection/components/Editor/hooks/use-editor.d.ts.map +1 -0
  89. package/dist/v2/features/collection/components/Editor/hooks/use-editor.js +153 -0
  90. package/dist/v2/features/collection/components/Editor/index.d.ts +2 -0
  91. package/dist/v2/features/collection/components/Editor/index.d.ts.map +1 -0
  92. package/dist/v2/features/collection/components/Editor/index.js +4 -0
  93. package/dist/v2/features/collection/components/Editor/schemas/openapi-3.1-schema.json.js +25 -0
  94. package/dist/v2/features/collection/components/Environment.vue.js +8 -6
  95. package/dist/v2/features/collection/components/Overview.vue2.js +16 -14
  96. package/dist/v2/features/collection/components/Servers.vue.js +18 -16
  97. package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
  98. package/dist/v2/features/collection/components/Settings.vue.js +6 -4
  99. package/dist/v2/features/collection/components/Tabs.vue.js +4 -4
  100. package/dist/v2/features/operation/Operation.vue.js +9 -7
  101. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  102. package/package.json +32 -25
@@ -1,7 +1,7 @@
1
1
  import { canMethodHaveBody as m } from "@scalar/helpers/http/can-method-have-body";
2
2
  import { getResolvedRef as r } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
3
  import { isElectron as y } from "../../../../libs/electron.js";
4
- const l = "2.31.3", T = "application/json", C = "*/*", a = (n, s, o) => ({
4
+ const l = "2.33.0", T = "application/json", C = "*/*", a = (n, s, o) => ({
5
5
  name: n,
6
6
  defaultValue: s,
7
7
  isOverridden: o.has(n.toLowerCase())
@@ -1,6 +1,5 @@
1
1
  import { type ModalState } from '@scalar/components';
2
2
  import type { ClientPlugin } from '@scalar/oas-utils/helpers';
3
- import { type Theme } from '@scalar/themes';
4
3
  import type { CommandPaletteState } from '../../../v2/features/command-palette/hooks/use-command-palette-state.js';
5
4
  import type { ClientLayout } from '../../../v2/types/layout';
6
5
  import { type AppState } from './app-state.js';
@@ -14,8 +13,6 @@ export default _default;
14
13
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
15
14
  layout: Exclude<ClientLayout, "modal">;
16
15
  plugins?: ClientPlugin[];
17
- customThemes?: Theme[];
18
- fallbackThemeSlug?: string;
19
16
  getAppState: () => AppState;
20
17
  getCommandPaletteState: () => CommandPaletteState;
21
18
  }, {
@@ -23,8 +20,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
23
20
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
24
21
  layout: Exclude<ClientLayout, "modal">;
25
22
  plugins?: ClientPlugin[];
26
- customThemes?: Theme[];
27
- fallbackThemeSlug?: string;
28
23
  getAppState: () => AppState;
29
24
  getCommandPaletteState: () => CommandPaletteState;
30
25
  }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
@@ -1 +1 @@
1
- {"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"AAsPA,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAY3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+DAA+D,CAAA;AAIxG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAK3C;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;YAER,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;mBACT,KAAK,EAAE;wBACF,MAAM;iBACb,MAAM,QAAQ;4BACH,MAAM,mBAAmB;;;;YALzC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;mBACT,KAAK,EAAE;wBACF,MAAM;iBACb,MAAM,QAAQ;4BACH,MAAM,mBAAmB;;IAajD;;;OAGG;4BACqB,MAAM,OAAO;IACrC;;;OAGG;yBACkB,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,UAAU,CAAA;KAAE,KAAK,OAAO;EAqU9D,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"AA4OA,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAW7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+DAA+D,CAAA;AAIxG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAK3C;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;YAER,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;iBACX,MAAM,QAAQ;4BACH,MAAM,mBAAmB;;;;YAHzC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;iBACX,MAAM,QAAQ;4BACH,MAAM,mBAAmB;;IAWjD;;;OAGG;4BACqB,MAAM,OAAO;IACrC;;;OAGG;yBACkB,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,UAAU,CAAA;KAAE,KAAK,OAAO;EAgU9D,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1,59 +1,52 @@
1
- import { defineComponent as b, computed as T, createBlock as m, openBlock as c, unref as t, withCtx as p, createElementVNode as i, createVNode as n, createElementBlock as d, renderSlot as v, createCommentVNode as g, normalizeProps as W, guardReactiveProps as y } from "vue";
1
+ import { defineComponent as h, computed as b, toValue as T, createBlock as p, openBlock as u, unref as t, withCtx as m, createElementVNode as i, createVNode as n, createElementBlock as d, renderSlot as v, createCommentVNode as y, normalizeProps as W, guardReactiveProps as g } from "vue";
2
2
  import { useModal as x, ScalarTeleportRoot as B } from "@scalar/components";
3
- import { ScalarToasts as C } from "@scalar/use-toasts";
4
- import { extensions as E } from "@scalar/workspace-store/schemas/extensions";
5
- import { RouterView as O } from "vue-router";
6
- import A from "./components/CreateWorkspaceModal.vue.js";
3
+ import { ScalarToasts as _ } from "@scalar/use-toasts";
4
+ import { extensions as C } from "@scalar/workspace-store/schemas/extensions";
5
+ import { RouterView as E } from "vue-router";
6
+ import O from "./components/CreateWorkspaceModal.vue.js";
7
7
  import M from "./components/SplashScreen.vue.js";
8
- import { useDocumentWatcher as U } from "./hooks/use-document-watcher.js";
9
- import { useTheme as _ } from "./hooks/use-theme.js";
8
+ import { useDocumentWatcher as A } from "./hooks/use-document-watcher.js";
10
9
  import D from "../command-palette/TheCommandPalette.vue.js";
11
- import { useColorMode as I } from "../../hooks/use-color-mode.js";
12
- import { useGlobalHotKeys as N } from "../../hooks/use-global-hot-keys.js";
13
- import P from "./components/AppSidebar.vue.js";
14
- import H from "./components/DesktopTabs.vue.js";
15
- import { mergeSecurity as L } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
16
- 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" }, z = { class: "bg-b-1 min-h-0 flex-1" }, K = { key: 1 }, j = {}, ue = /* @__PURE__ */ b({
17
- ...j,
10
+ import { useColorMode as U } from "../../hooks/use-color-mode.js";
11
+ import { useGlobalHotKeys as I } from "../../hooks/use-global-hot-keys.js";
12
+ import N from "./components/AppSidebar.vue.js";
13
+ import P from "./components/DesktopTabs.vue.js";
14
+ import { mergeSecurity as V } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
15
+ const H = ["innerHTML"], L = { key: 0 }, $ = { class: "flex h-dvh w-dvw flex-1 flex-col" }, F = { class: "flex min-h-0 flex-1 flex-row" }, R = { class: "flex flex-1 flex-col" }, G = { class: "bg-b-1 min-h-0 flex-1" }, z = { key: 1 }, K = {}, le = /* @__PURE__ */ h({
16
+ ...K,
18
17
  __name: "App",
19
18
  props: {
20
19
  layout: {},
21
20
  plugins: { default: () => [] },
22
- customThemes: { default: () => [] },
23
- fallbackThemeSlug: { default: "default" },
24
21
  getAppState: { type: Function },
25
22
  getCommandPaletteState: { type: Function }
26
23
  },
27
- setup(o, { expose: k }) {
24
+ setup(s, { expose: k }) {
28
25
  k({
29
26
  openCreateWorkspace: () => l.show()
30
27
  });
31
- const e = o.getAppState(), f = o.getCommandPaletteState();
32
- typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), N(e.eventBus, o.layout), U({
33
- documentName: () => e.store.value?.workspace[E.workspace.activeDocument],
28
+ const e = s.getAppState(), w = s.getCommandPaletteState();
29
+ typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), I(e.eventBus, s.layout), A({
30
+ documentName: () => e.store.value?.workspace[C.workspace.activeDocument],
34
31
  store: e.store,
35
32
  initialTimeout: 5e3
36
- }), I({ workspaceStore: e.store });
37
- const { themeStyleTag: w } = _({
38
- fallbackThemeSlug: () => o.fallbackThemeSlug,
39
- customThemes: () => o.customThemes,
40
- store: e.store
41
- }), u = (s, a) => {
33
+ }), U({ workspaceStore: e.store });
34
+ const c = (o, a) => {
42
35
  e.eventBus.emit("ui:navigate", {
43
36
  page: "workspace",
44
37
  path: "environment",
45
- namespace: s,
38
+ namespace: o,
46
39
  workspaceSlug: a
47
40
  });
48
- }, S = (s) => {
49
- if (!s)
41
+ }, f = (o) => {
42
+ if (!o)
50
43
  return;
51
44
  const a = e.workspace.workspaceList.value?.find(
52
- (r) => r.id === s
45
+ (r) => r.id === o
53
46
  );
54
- a && u(a.namespace, a.slug);
55
- }, l = x(), h = T(() => {
56
- const s = e.store.value?.auth ? L(
47
+ a && c(a.namespace, a.slug);
48
+ }, l = x(), S = b(() => {
49
+ const o = e.store.value?.auth ? V(
57
50
  e.document.value?.components?.securitySchemes ?? {},
58
51
  {},
59
52
  e.store.value.auth,
@@ -65,70 +58,74 @@ const V = ["innerHTML"], $ = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 f
65
58
  environment: e.environment.value,
66
59
  eventBus: e.eventBus,
67
60
  exampleName: e.activeEntities.exampleName.value,
68
- layout: o.layout,
61
+ layout: s.layout,
69
62
  method: e.activeEntities.method.value,
70
63
  path: e.activeEntities.path.value,
71
64
  workspaceStore: e.store.value,
72
65
  activeWorkspace: e.workspace.activeWorkspace.value,
73
- plugins: o.plugins,
74
- securitySchemes: s,
75
- customThemes: o.customThemes
66
+ plugins: s.plugins,
67
+ securitySchemes: o,
68
+ isDarkMode: e.isDarkMode.value,
69
+ currentTheme: e.theme.styles.value.themeStyles,
70
+ customThemes: T(e.theme.customThemes)
76
71
  };
77
72
  });
78
- return (s, a) => (c(), m(t(B), null, {
79
- default: p(() => [
80
- i("div", { innerHTML: t(w) }, null, 8, V),
81
- n(t(C)),
82
- t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (c(), d("main", $, [
83
- i("div", F, [
84
- i("div", R, [
85
- n(P, {
73
+ return (o, a) => (u(), p(t(B), null, {
74
+ default: m(() => [
75
+ i("div", {
76
+ innerHTML: t(e).theme.themeStyleTag.value
77
+ }, null, 8, H),
78
+ n(t(_)),
79
+ t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (u(), d("main", L, [
80
+ i("div", $, [
81
+ i("div", F, [
82
+ n(N, {
86
83
  isSidebarOpen: t(e).sidebar.isOpen.value,
87
84
  "onUpdate:isSidebarOpen": a[0] || (a[0] = (r) => t(e).sidebar.isOpen.value = r),
88
85
  activeWorkspace: t(e).workspace.activeWorkspace.value,
89
86
  eventBus: t(e).eventBus,
90
87
  isWorkspaceOpen: t(e).workspace.isOpen.value,
91
- layout: o.layout,
88
+ layout: s.layout,
92
89
  sidebarState: t(e).sidebar.state,
93
90
  sidebarWidth: t(e).sidebar.width.value,
94
91
  store: t(e).store.value,
95
92
  workspaces: t(e).workspace.workspaceGroups.value,
96
- "onClick:workspace": u,
93
+ "onClick:workspace": c,
97
94
  "onCreate:workspace": a[1] || (a[1] = (r) => t(l).show()),
98
- "onSelect:workspace": S,
95
+ "onSelect:workspace": f,
99
96
  onSelectItem: t(e).sidebar.handleSelectItem,
100
97
  "onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
101
98
  }, {
102
- sidebarMenuActions: p(() => [
103
- v(s.$slots, "sidebar-menu-actions")
99
+ sidebarMenuActions: m(() => [
100
+ v(o.$slots, "sidebar-menu-actions")
104
101
  ]),
105
102
  _: 3
106
103
  }, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onSelectItem", "onUpdate:sidebarWidth"]),
107
- i("div", G, [
108
- o.layout === "desktop" ? (c(), m(H, {
104
+ i("div", R, [
105
+ s.layout === "desktop" ? (u(), p(P, {
109
106
  key: 0,
110
107
  activeTabIndex: t(e).tabs.activeTabIndex.value,
111
108
  eventBus: t(e).eventBus,
112
109
  tabs: t(e).tabs.state.value
113
- }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : g("", !0),
114
- i("div", z, [
115
- n(t(O), W(y(h.value)), null, 16)
110
+ }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : y("", !0),
111
+ i("div", G, [
112
+ n(t(E), W(g(S.value)), null, 16)
116
113
  ])
117
114
  ])
118
115
  ])
119
116
  ]),
120
- v(s.$slots, "create-workspace", { state: t(l) }, () => [
121
- n(A, {
117
+ v(o.$slots, "create-workspace", { state: t(l) }, () => [
118
+ n(O, {
122
119
  state: t(l),
123
120
  "onCreate:workspace": a[2] || (a[2] = (r) => t(e).workspace.create(r))
124
121
  }, null, 8, ["state"])
125
122
  ]),
126
123
  n(D, {
127
124
  eventBus: t(e).eventBus,
128
- paletteState: t(f),
125
+ paletteState: t(w),
129
126
  workspaceStore: t(e).store.value
130
127
  }, null, 8, ["eventBus", "paletteState", "workspaceStore"])
131
- ])) : (c(), d("main", K, [
128
+ ])) : (u(), d("main", z, [
132
129
  n(M)
133
130
  ]))
134
131
  ]),
@@ -137,5 +134,5 @@ const V = ["innerHTML"], $ = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 f
137
134
  }
138
135
  });
139
136
  export {
140
- ue as default
137
+ le as default
141
138
  };
@@ -2,13 +2,14 @@ import type { ScalarListboxOption, WorkspaceGroup } from '@scalar/components';
2
2
  import type { HttpMethod } from '@scalar/helpers/http/http-methods';
3
3
  import type { LoaderPlugin } from '@scalar/json-magic/bundle';
4
4
  import { createSidebarState } from '@scalar/sidebar';
5
+ import type { Theme } from '@scalar/themes';
5
6
  import { type WorkspaceStore } from '@scalar/workspace-store/client';
6
7
  import { type WorkspaceEventBus } from '@scalar/workspace-store/events';
7
8
  import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
8
9
  import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
9
10
  import type { Tab } from '@scalar/workspace-store/schemas/extensions/workspace/x-scalar-tabs';
10
11
  import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
11
- import { type ComputedRef, type Ref, type ShallowRef } from 'vue';
12
+ import { type ComputedRef, type MaybeRefOrGetter, type Ref, type ShallowRef } from 'vue';
12
13
  import type { RouteLocationNormalizedGeneric, Router } from 'vue-router';
13
14
  export type GetEntryByLocation = (location: {
14
15
  document: string;
@@ -117,10 +118,24 @@ export type AppState = {
117
118
  document: ComputedRef<WorkspaceDocument | null>;
118
119
  /** Whether the current color mode is dark */
119
120
  isDarkMode: ComputedRef<boolean>;
121
+ /** The currently active theme */
122
+ theme: {
123
+ /** The computed CSS styles for the current theme, as a string */
124
+ styles: ComputedRef<{
125
+ themeStyles: string;
126
+ themeSlug: string;
127
+ }>;
128
+ /** The computed value for the <style> tag containing the current theme styles */
129
+ themeStyleTag: ComputedRef<string>;
130
+ /** The custom themes to use */
131
+ customThemes: MaybeRefOrGetter<Theme[]>;
132
+ };
120
133
  };
121
- export declare const createAppState: ({ router, fileLoader, }: {
134
+ export declare const createAppState: ({ router, fileLoader, fallbackThemeSlug, customThemes, }: {
122
135
  router: Router;
123
136
  fileLoader?: LoaderPlugin;
137
+ customThemes?: MaybeRefOrGetter<Theme[]>;
138
+ fallbackThemeSlug?: string;
124
139
  }) => Promise<AppState>;
125
140
  export {};
126
141
  //# sourceMappingURL=app-state.d.ts.map
@@ -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,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAG7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,OAAO,EAAE,kBAAkB,EAAwB,MAAM,iBAAiB,CAAA;AAC1E,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,EAAuC,MAAM,KAAK,CAAA;AACtG,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAexE,MAAM,MAAM,kBAAkB,GAAG,CAAC,QAAQ,EAAE;IAC1C,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,KACG,CAAC,cAAc,GAAG;IAChB,MAAM,CAAC,EAAE,cAAc,G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