@scalar/api-client 2.23.3 → 2.24.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 (97) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  3. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +8 -0
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  7. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +33 -29
  8. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +6 -0
  9. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  10. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  11. package/dist/v2/blocks/operation-block/components/Header.vue2.js +46 -29
  12. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  13. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts +15 -0
  14. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -0
  15. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +125 -0
  16. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue2.js +4 -0
  17. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +5 -1
  18. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  19. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +61 -61
  20. package/dist/v2/components/sidebar/SidebarMenu.vue.js +6 -6
  21. package/dist/v2/features/app/App.vue.d.ts +5 -0
  22. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  23. package/dist/v2/features/app/App.vue.js +89 -108
  24. package/dist/v2/features/app/app-state.d.ts +5 -7
  25. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  26. package/dist/v2/features/app/app-state.js +210 -205
  27. package/dist/v2/features/app/hooks/use-document-watcher.js +8 -8
  28. package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
  29. package/dist/v2/features/collection/components/Environment.vue.js +12 -11
  30. package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
  31. package/dist/v2/features/collection/components/Settings.vue.js +17 -25
  32. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +1 -1
  33. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
  34. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +115 -118
  35. package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.d.ts.map +1 -1
  36. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts +14 -4
  37. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts.map +1 -1
  38. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.js +5 -6
  39. package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.d.ts.map +1 -1
  40. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts +16 -0
  41. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +1 -0
  42. package/dist/v2/features/command-palette/helpers/load-document-from-source.js +34 -0
  43. package/dist/v2/features/command-palette/index.d.ts +4 -0
  44. package/dist/v2/features/command-palette/index.d.ts.map +1 -0
  45. package/dist/v2/features/command-palette/index.js +8 -0
  46. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts +4 -0
  47. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
  48. package/dist/v2/features/environments/EnvironmentsList.vue.js +29 -27
  49. package/dist/v2/features/environments/components/Environment.vue.d.ts +1 -0
  50. package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
  51. package/dist/v2/features/environments/components/Environment.vue.js +37 -24
  52. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  53. package/dist/v2/features/modal/Modal.vue.js +1 -1
  54. package/dist/v2/features/modal/Modal.vue2.js +35 -36
  55. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  56. package/dist/v2/features/modal/helpers/create-api-client-modal.js +58 -41
  57. package/dist/v2/features/modal/helpers/restore-workspace-state.d.ts +18 -0
  58. package/dist/v2/features/modal/helpers/restore-workspace-state.d.ts.map +1 -0
  59. package/dist/v2/features/modal/helpers/restore-workspace-state.js +36 -0
  60. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  61. package/dist/v2/features/operation/Operation.vue.js +35 -26
  62. package/dist/v2/workspace-events.d.ts.map +1 -1
  63. package/dist/v2/workspace-events.js +7 -0
  64. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  65. package/package.json +20 -20
  66. package/dist/v2/features/import-listener/ImportListener.vue.d.ts +0 -52
  67. package/dist/v2/features/import-listener/ImportListener.vue.d.ts.map +0 -1
  68. package/dist/v2/features/import-listener/ImportListener.vue.js +0 -91
  69. package/dist/v2/features/import-listener/ImportListener.vue2.js +0 -4
  70. package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts +0 -7
  71. package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts.map +0 -1
  72. package/dist/v2/features/import-listener/components/DropEventListener.vue.js +0 -81
  73. package/dist/v2/features/import-listener/components/DropEventListener.vue2.js +0 -4
  74. package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts +0 -40
  75. package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts.map +0 -1
  76. package/dist/v2/features/import-listener/components/ImportModal.vue.js +0 -170
  77. package/dist/v2/features/import-listener/components/ImportModal.vue3.js +0 -5
  78. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts +0 -29
  79. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts.map +0 -1
  80. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.js +0 -83
  81. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue2.js +0 -4
  82. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts +0 -8
  83. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts.map +0 -1
  84. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.js +0 -4
  85. package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts +0 -15
  86. package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts.map +0 -1
  87. package/dist/v2/features/import-listener/helpers/load-document-from-source.js +0 -28
  88. package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts +0 -15
  89. package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts.map +0 -1
  90. package/dist/v2/features/import-listener/helpers/wait-for-condition.js +0 -16
  91. package/dist/v2/features/import-listener/index.d.ts +0 -2
  92. package/dist/v2/features/import-listener/index.d.ts.map +0 -1
  93. package/dist/v2/features/import-listener/index.js +0 -4
  94. /package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.d.ts +0 -0
  95. /package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.js +0 -0
  96. /package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.d.ts +0 -0
  97. /package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.js +0 -0
@@ -1,81 +1,81 @@
1
- import { objectEntries as d } from "@scalar/helpers/object/object-entries";
2
- const o = ({
3
- schemeName: e,
4
- authStore: s,
5
- documentSlug: c,
6
- type: a
7
- }) => {
8
- const r = s.getAuthSecrets(c, e);
9
- if (r?.type === a)
10
- return r;
11
- }, u = {
12
- clientSecret: "x-scalar-secret-client-secret",
13
- password: "x-scalar-secret-password",
14
- token: "x-scalar-secret-token",
15
- username: "x-scalar-secret-username",
16
- value: "x-scalar-secret-token",
17
- "x-scalar-client-id": "x-scalar-secret-client-id",
18
- "x-scalar-redirect-uri": "x-scalar-secret-redirect-uri"
19
- }, l = (e) => d(u).reduce((s, [c, a]) => {
20
- const r = e[c];
21
- return r !== void 0 && typeof r == "string" && (s[a] = r), s;
22
- }, {}), f = (e, s, c, a) => {
1
+ import { objectEntries as p } from "@scalar/helpers/object/object-entries";
2
+ const u = {
3
+ "x-scalar-secret-client-id": "x-scalar-client-id",
4
+ "x-scalar-secret-client-secret": "clientSecret",
5
+ "x-scalar-secret-password": "password",
6
+ "x-scalar-secret-redirect-uri": "x-scalar-redirect-uri",
7
+ "x-scalar-secret-token": "token",
8
+ "x-scalar-secret-username": "username"
9
+ }, o = (e, l, d = {}) => {
10
+ const i = {};
11
+ for (const s of e) {
12
+ const r = d[s], n = l[u[s]];
13
+ i[s] = r || n || "";
14
+ }
15
+ return i;
16
+ }, f = (e, l, d, i) => {
17
+ const s = l.getAuthSecrets(i, d);
23
18
  if (e.type === "apiKey") {
24
- const r = o({ schemeName: c, type: "apiKey", authStore: s, documentSlug: a });
19
+ const r = s?.type === "apiKey" ? s : void 0;
25
20
  return {
26
21
  ...e,
27
- "x-scalar-secret-token": "",
28
- ...l(e),
29
- ...r
22
+ "x-scalar-secret-token": r?.["x-scalar-secret-token"] || e.value || ""
30
23
  };
31
24
  }
32
25
  if (e.type === "http") {
33
- const r = o({ schemeName: c, type: "http", authStore: s, documentSlug: a });
26
+ const r = s?.type === "http" ? s : void 0;
34
27
  return {
35
28
  ...e,
36
- "x-scalar-secret-password": "",
37
- "x-scalar-secret-token": "",
38
- "x-scalar-secret-username": "",
39
- ...l(e),
40
- ...r
29
+ "x-scalar-secret-token": r?.["x-scalar-secret-token"] || e.token || "",
30
+ "x-scalar-secret-username": r?.["x-scalar-secret-username"] || e.username || "",
31
+ "x-scalar-secret-password": r?.["x-scalar-secret-password"] || e.password || ""
41
32
  };
42
33
  }
43
34
  if (e.type === "oauth2") {
44
- const r = o({ schemeName: c, type: "oauth2", authStore: s, documentSlug: a }), x = /* @__PURE__ */ new Set();
35
+ const r = s?.type === "oauth2" ? s : void 0, n = /* @__PURE__ */ new Set();
45
36
  return {
46
37
  ...e,
47
- flows: d(e?.flows ?? {}).reduce((n, [i, t]) => (t && ("selectedScopes" in t && Array.isArray(t.selectedScopes) && t.selectedScopes?.forEach((p) => x.add(p)), i === "implicit" && (n.implicit = {
38
+ flows: p(e?.flows ?? {}).reduce((a, [c, t]) => (t && ("selectedScopes" in t && Array.isArray(t.selectedScopes) && t.selectedScopes?.forEach((x) => x && n.add(x)), c === "implicit" && (a.implicit = {
48
39
  ...t,
49
- "x-scalar-secret-client-id": "",
50
- "x-scalar-secret-redirect-uri": "",
51
- "x-scalar-secret-token": "",
52
- ...l(t),
53
- ...r?.implicit
54
- }), i === "password" && (n[i] = {
40
+ ...o(
41
+ ["x-scalar-secret-client-id", "x-scalar-secret-redirect-uri", "x-scalar-secret-token"],
42
+ t,
43
+ r?.implicit
44
+ )
45
+ }), c === "password" && (a[c] = {
55
46
  ...t,
56
- "x-scalar-secret-client-id": "",
57
- "x-scalar-secret-client-secret": "",
58
- "x-scalar-secret-username": "",
59
- "x-scalar-secret-password": "",
60
- "x-scalar-secret-token": "",
61
- ...l(t),
62
- ...r?.password
63
- }), i === "clientCredentials" && (n[i] = {
47
+ ...o(
48
+ [
49
+ "x-scalar-secret-client-id",
50
+ "x-scalar-secret-client-secret",
51
+ "x-scalar-secret-username",
52
+ "x-scalar-secret-password",
53
+ "x-scalar-secret-token"
54
+ ],
55
+ t,
56
+ r?.password
57
+ )
58
+ }), c === "clientCredentials" && (a[c] = {
64
59
  ...t,
65
- "x-scalar-secret-client-id": "",
66
- "x-scalar-secret-client-secret": "",
67
- "x-scalar-secret-token": "",
68
- ...l(t),
69
- ...r?.clientCredentials
70
- }), i === "authorizationCode" && (n[i] = {
60
+ ...o(
61
+ ["x-scalar-secret-client-id", "x-scalar-secret-client-secret", "x-scalar-secret-token"],
62
+ t,
63
+ r?.clientCredentials
64
+ )
65
+ }), c === "authorizationCode" && (a[c] = {
71
66
  ...t,
72
- "x-scalar-secret-client-id": "",
73
- "x-scalar-secret-client-secret": "",
74
- "x-scalar-secret-redirect-uri": "",
75
- "x-scalar-secret-token": "",
76
- ...r?.authorizationCode
77
- })), n), {}),
78
- "x-default-scopes": Array.from(x)
67
+ ...o(
68
+ [
69
+ "x-scalar-secret-client-id",
70
+ "x-scalar-secret-client-secret",
71
+ "x-scalar-secret-redirect-uri",
72
+ "x-scalar-secret-token"
73
+ ],
74
+ t,
75
+ r?.authorizationCode
76
+ )
77
+ })), a), {}),
78
+ "x-default-scopes": Array.from(n)
79
79
  };
80
80
  }
81
81
  return e.type === "openIdConnect", e;
@@ -9,8 +9,8 @@ const L = /* @__PURE__ */ p({
9
9
  workspaces: {}
10
10
  },
11
11
  emits: ["create:workspace", "select:workspace"],
12
- setup(a, { emit: i }) {
13
- const n = i;
12
+ setup(n, { emit: i }) {
13
+ const a = 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: 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))
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))
25
25
  }, null, 8, ["modelValue", "workspaceOptions"]),
26
26
  r(o(M), {
27
27
  is: o(v),
@@ -25,6 +25,11 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
25
25
  * This slot is used to render custom actions or components within the actions section.
26
26
  */
27
27
  'sidebar-menu-actions': [];
28
+ /**
29
+ * Slot for customizing the create workspace modal.
30
+ * This slot is used to render custom actions or components within the create workspace modal.
31
+ */
32
+ 'create-workspace'?: () => unknown;
28
33
  }>;
29
34
  export default _default;
30
35
  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":"AA2QA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAM3C;;;;GAIG;;YAGO,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;;IAUjD;;;OAGG;4BACqB,EAAE;;AAnB5B,wBAkZC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
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,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAM3C;;;;GAIG;;YAGO,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;;IAUjD;;;OAGG;4BACqB,EAAE;IAC1B;;;OAGG;yBACkB,MAAM,OAAO;;AAxBpC,wBA+WC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,25 +1,24 @@
1
- import { defineComponent as W, computed as d, createBlock as p, openBlock as i, unref as t, withCtx as u, createElementVNode as m, createVNode as n, createElementBlock as v, renderSlot as T, normalizeProps as h, guardReactiveProps as y } from "vue";
2
- import { useModal as g, ScalarTeleportRoot as C } from "@scalar/components";
3
- import { getThemeStyles as x } from "@scalar/themes";
4
- import { ScalarToasts as B } from "@scalar/use-toasts";
5
- import { extensions as E } from "@scalar/workspace-store/schemas/extensions";
6
- import { RouterView as M } from "vue-router";
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";
6
+ import { RouterView as E } from "vue-router";
7
7
  import O from "./components/CreateWorkspaceModal.vue.js";
8
8
  import _ from "./components/SplashScreen.vue.js";
9
9
  import { useDocumentWatcher as A } 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";
10
+ import M from "../command-palette/TheCommandPalette.vue.js";
11
+ import { useColorMode as U } from "../../hooks/use-color-mode.js";
12
12
  import { useGlobalHotKeys as I } from "../../hooks/use-global-hot-keys.js";
13
- import L from "./components/AppSidebar.vue.js";
14
- import N from "./components/DesktopTabs.vue.js";
15
- import $ from "./components/WebTopNav.vue.js";
16
- import { mergeSecurity as P } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
17
- import H from "../import-listener/ImportListener.vue.js";
18
- const F = ["innerHTML"], V = {
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 = {
19
18
  key: 0,
20
19
  class: "flex flex-1 flex-col"
21
- }, R = { class: "flex min-h-0 flex-1" }, z = { class: "bg-b-1 flex-1" }, G = { key: 1 }, K = {}, ue = /* @__PURE__ */ W({
22
- ...K,
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,
23
22
  __name: "App",
24
23
  props: {
25
24
  layout: {},
@@ -27,32 +26,30 @@ const F = ["innerHTML"], V = {
27
26
  getAppState: { type: Function },
28
27
  getCommandPaletteState: { type: Function }
29
28
  },
30
- setup(r, { expose: k }) {
31
- k({
32
- openCreateWorkspace: () => c.show()
29
+ setup(s, { expose: w }) {
30
+ w({
31
+ openCreateWorkspace: () => l.show()
33
32
  });
34
- const e = r.getAppState(), w = r.getCommandPaletteState();
35
- typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e);
36
- const { isDarkMode: f } = D({ workspaceStore: e.store });
37
- I(e.eventBus, r.layout), A({
38
- documentName: () => e.store.value?.workspace[E.workspace.activeDocument],
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],
39
36
  store: e.store,
40
37
  initialTimeout: 5e3
41
38
  });
42
- const S = d(() => {
39
+ const S = m(() => {
43
40
  if (e.store.value === null)
44
41
  return "";
45
- const s = e.store.value.workspace["x-scalar-theme"];
46
- return s ? `<style>${x(s)}</style>` : "";
47
- }), l = (s) => {
48
- if (!s)
42
+ const o = e.store.value.workspace["x-scalar-theme"];
43
+ return o ? `<style>${C(o)}</style>` : "";
44
+ }), p = (o) => {
45
+ if (!o)
49
46
  return;
50
47
  const a = e.workspace.workspaceList.value?.find(
51
- (o) => o.id === s
48
+ (r) => r.id === o
52
49
  );
53
50
  a && e.workspace.navigateToWorkspace(a.namespace, a.slug);
54
- }, c = g(), b = d(() => {
55
- const s = e.store.value?.auth ? P(
51
+ }, l = T(), b = m(() => {
52
+ const o = e.store.value?.auth ? N(
56
53
  e.document.value?.components?.securitySchemes ?? {},
57
54
  {},
58
55
  e.store.value.auth,
@@ -64,94 +61,78 @@ const F = ["innerHTML"], V = {
64
61
  environment: e.environment.value,
65
62
  eventBus: e.eventBus,
66
63
  exampleName: e.activeEntities.exampleName.value,
67
- layout: r.layout,
64
+ layout: s.layout,
68
65
  method: e.activeEntities.method.value,
69
66
  path: e.activeEntities.path.value,
70
67
  workspaceStore: e.store.value,
71
68
  activeWorkspace: e.workspace.activeWorkspace.value,
72
- plugins: r.plugins,
73
- securitySchemes: s
69
+ plugins: s.plugins,
70
+ securitySchemes: o
74
71
  };
75
72
  });
76
- return (s, a) => (i(), p(t(C), null, {
77
- default: u(() => [
78
- m("div", { innerHTML: S.value }, null, 8, F),
79
- n(t(B)),
80
- n(t(H), {
81
- activeWorkspace: t(e).workspace.activeWorkspace.value,
82
- darkMode: t(f),
83
- workspaceStore: t(e).store.value,
84
- workspaces: t(e).workspace.workspaceList.value,
85
- "onCreate:workspace": a[4] || (a[4] = (o) => t(e).workspace.create(o)),
86
- "onNavigateTo:document": a[5] || (a[5] = (o) => t(e).router.value?.push({
87
- name: "document.overview",
88
- params: {
89
- documentSlug: o
90
- }
91
- })),
92
- "onSelect:workspace": l
93
- }, {
94
- default: u(() => [
95
- t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), v("main", V, [
96
- r.layout === "desktop" ? (i(), p(N, {
97
- key: 0,
98
- activeTabIndex: t(e).tabs.activeTabIndex.value,
99
- eventBus: t(e).eventBus,
100
- tabs: t(e).tabs.state.value
101
- }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : (i(), p($, {
102
- key: 1,
103
- activeWorkspace: t(e).workspace.activeWorkspace.value,
104
- workspaces: t(e).workspace.workspaceList.value,
105
- "onCreate:workspace": a[0] || (a[0] = (o) => t(c).show()),
106
- "onSelect:workspace": l
107
- }, null, 8, ["activeWorkspace", "workspaces"])),
108
- m("div", R, [
109
- n(L, {
110
- isSidebarOpen: t(e).sidebar.isOpen.value,
111
- "onUpdate:isSidebarOpen": a[1] || (a[1] = (o) => t(e).sidebar.isOpen.value = o),
112
- activeWorkspace: t(e).workspace.activeWorkspace.value,
113
- eventBus: t(e).eventBus,
114
- isWorkspaceOpen: t(e).workspace.isOpen.value,
115
- layout: r.layout,
116
- sidebarState: t(e).sidebar.state,
117
- sidebarWidth: t(e).sidebar.width.value,
118
- store: t(e).store.value,
119
- workspaces: t(e).workspace.workspaceList.value,
120
- "onClick:workspace": t(e).workspace.navigateToWorkspace,
121
- "onCreate:workspace": a[2] || (a[2] = (o) => t(c).show()),
122
- "onSelect:workspace": l,
123
- onSelectItem: t(e).sidebar.handleSelectItem,
124
- "onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
125
- }, {
126
- sidebarMenuActions: u(() => [
127
- T(s.$slots, "sidebar-menu-actions")
128
- ]),
129
- _: 3
130
- }, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onClick:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
131
- m("div", z, [
132
- n(t(M), h(y(b.value)), null, 16)
133
- ])
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,
95
+ 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")
134
110
  ]),
135
- n(O, {
136
- state: t(c),
137
- "onCreate:workspace": a[3] || (a[3] = (o) => t(e).workspace.create(o))
138
- }, null, 8, ["state"]),
139
- n(U, {
140
- eventBus: t(e).eventBus,
141
- paletteState: t(w),
142
- workspaceStore: t(e).store.value
143
- }, null, 8, ["eventBus", "paletteState", "workspaceStore"])
144
- ])) : (i(), v("main", G, [
145
- n(_)
146
- ]))
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)
115
+ ])
147
116
  ]),
148
- _: 3
149
- }, 8, ["activeWorkspace", "darkMode", "workspaceStore", "workspaces"])
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))
121
+ }, null, 8, ["state"])
122
+ ]),
123
+ n(M, {
124
+ eventBus: t(e).eventBus,
125
+ paletteState: t(f),
126
+ workspaceStore: t(e).store.value
127
+ }, null, 8, ["eventBus", "paletteState", "workspaceStore"])
128
+ ])) : (i(), v("main", R, [
129
+ n(_)
130
+ ]))
150
131
  ]),
151
132
  _: 3
152
133
  }));
153
134
  }
154
135
  });
155
136
  export {
156
- ue as default
137
+ le as default
157
138
  };
@@ -23,7 +23,7 @@ type WorkspaceOption = ScalarListboxOption & {
23
23
  declare const navigateToWorkspace: (namespace?: string, slug?: string) => Promise<void>;
24
24
  /**
25
25
  * Creates a new workspace with the provided name.
26
- * - Generates a unique slug for the workspace (sluggified from the name and guaranteed unique).
26
+ * - Generates a unique slug for the workspace (uses the provided slug if it is unique, otherwise generates a unique slug).
27
27
  * - Adds a default blank document ("drafts") to the workspace.
28
28
  * - Persists the workspace and navigates to it.
29
29
  *
@@ -31,12 +31,10 @@ declare const navigateToWorkspace: (namespace?: string, slug?: string) => Promis
31
31
  * await createWorkspace({ name: 'My Awesome API' })
32
32
  * // -> Navigates to /workspace/my-awesome-api (if available)
33
33
  */
34
- declare const createWorkspace: ({ key, name, }: {
35
- key?: {
36
- teamUid?: string;
37
- namespace?: string;
38
- slug: string;
39
- };
34
+ declare const createWorkspace: ({ teamUid, namespace, slug, name, }: {
35
+ teamUid?: string;
36
+ namespace?: string;
37
+ slug?: string;
40
38
  name: string;
41
39
  }) => Promise<{
42
40
  name: string;
@@ -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;AAoExE,KAAK,eAAe,GAAG,mBAAmB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AA8HjG;;;;;;GAMG;AACH,QAAA,MAAM,mBAAmB,GAAU,YAAY,MAAM,EAAE,OAAO,MAAM,KAAG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