@scalar/api-client 2.10.0 → 2.11.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 (156) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -1
  3. package/dist/components/ImportCollection/IntegrationLogo.vue.js +1 -0
  4. package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -1
  5. package/dist/components/Server/ServerVariablesForm.vue.js +6 -6
  6. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  7. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
  8. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +14 -13
  9. package/dist/hooks/useClientConfig.d.ts +3 -3
  10. package/dist/layouts/App/create-api-client-app.d.ts +1 -1
  11. package/dist/layouts/Web/create-api-client-web.d.ts +1 -1
  12. package/dist/libs/create-client.d.ts +1 -1
  13. package/dist/store/store.d.ts +1 -1
  14. package/dist/style.css +1 -1
  15. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +4 -6
  16. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  17. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +24 -27
  18. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +3 -6
  19. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  20. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  21. package/dist/v2/blocks/operation-block/components/Header.vue2.js +10 -12
  22. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
  23. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.js +11 -10
  24. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +2 -5
  25. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  26. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  27. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +45 -47
  28. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +11 -9
  29. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +179 -5
  31. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +2 -179
  32. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +201 -198
  33. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +11 -6
  34. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  35. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +82 -5
  36. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue2.js +2 -85
  37. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +3 -13
  38. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  39. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +16 -18
  40. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +133 -142
  41. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +1 -1
  42. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  43. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +1 -1
  44. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.d.ts +2 -16
  45. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.d.ts.map +1 -1
  46. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.js +2 -2
  47. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue2.js +202 -229
  48. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.d.ts +3 -5
  49. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.d.ts.map +1 -1
  50. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.js +2 -2
  51. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue2.js +81 -85
  52. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.d.ts +2 -5
  53. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.d.ts.map +1 -1
  54. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.js +32 -34
  55. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.d.ts +2 -5
  56. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.d.ts.map +1 -1
  57. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.js +2 -2
  58. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue2.js +31 -33
  59. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.d.ts +2 -5
  60. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.d.ts.map +1 -1
  61. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.js +42 -45
  62. package/dist/v2/blocks/scalar-response-block/components/Headers.vue.d.ts +2 -2
  63. package/dist/v2/blocks/scalar-response-block/components/Headers.vue.d.ts.map +1 -1
  64. package/dist/v2/blocks/scalar-response-block/components/Headers.vue.js +9 -9
  65. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue.d.ts.map +1 -1
  66. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue.js +2 -2
  67. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue2.js +18 -18
  68. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
  69. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.vue.js +14 -14
  70. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyVirtual.vue.d.ts.map +1 -1
  71. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyVirtual.vue.js +12 -12
  72. package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.vue.d.ts.map +1 -1
  73. package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.vue.js +13 -13
  74. package/dist/v2/components/data-table/DataTable.vue.d.ts.map +1 -1
  75. package/dist/v2/components/data-table/DataTable.vue.js +4 -4
  76. package/dist/v2/components/data-table/DataTableInput.vue.d.ts +5 -7
  77. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  78. package/dist/v2/components/data-table/DataTableInput.vue.js +2 -2
  79. package/dist/v2/components/data-table/DataTableInput.vue2.js +32 -36
  80. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts +25 -0
  81. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -0
  82. package/dist/v2/components/forms/ConfirmationForm.vue.js +7 -0
  83. package/dist/v2/components/forms/ConfirmationForm.vue2.js +45 -0
  84. package/dist/v2/components/forms/index.d.ts +2 -0
  85. package/dist/v2/components/forms/index.d.ts.map +1 -0
  86. package/dist/v2/components/forms/index.js +4 -0
  87. package/dist/v2/components/layout/CollapsibleSection.vue.d.ts +43 -0
  88. package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -0
  89. package/dist/v2/components/layout/CollapsibleSection.vue.js +89 -0
  90. package/dist/v2/components/layout/CollapsibleSection.vue2.js +4 -0
  91. package/dist/v2/components/layout/ValueEmitter.vue.d.ts +23 -0
  92. package/dist/v2/components/layout/ValueEmitter.vue.d.ts.map +1 -0
  93. package/dist/v2/components/layout/ValueEmitter.vue.js +21 -0
  94. package/dist/v2/components/layout/ValueEmitter.vue2.js +4 -0
  95. package/dist/v2/components/layout/index.d.ts +2 -0
  96. package/dist/v2/components/layout/index.d.ts.map +1 -0
  97. package/dist/v2/components/layout/index.js +4 -0
  98. package/dist/v2/components/modals/DeleteModal.vue.d.ts +15 -0
  99. package/dist/v2/components/modals/DeleteModal.vue.d.ts.map +1 -0
  100. package/dist/v2/components/modals/DeleteModal.vue.js +31 -0
  101. package/dist/v2/components/modals/DeleteModal.vue2.js +4 -0
  102. package/dist/v2/components/modals/index.d.ts +2 -0
  103. package/dist/v2/components/modals/index.d.ts.map +1 -0
  104. package/dist/v2/components/modals/index.js +4 -0
  105. package/dist/v2/components/server/ServerDropdown.vue.d.ts +4 -2
  106. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  107. package/dist/v2/components/server/ServerDropdown.vue.js +31 -31
  108. package/dist/v2/components/server/ServerDropdownItem.vue.d.ts +2 -6
  109. package/dist/v2/components/server/ServerDropdownItem.vue.d.ts.map +1 -1
  110. package/dist/v2/components/server/ServerDropdownItem.vue.js +1 -1
  111. package/dist/v2/components/server/ServerDropdownItem.vue2.js +16 -16
  112. package/dist/v2/components/server/index.d.ts.map +1 -1
  113. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +6 -2
  114. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  115. package/dist/v2/components/sidebar/Sidebar.vue.js +45 -55
  116. package/dist/v2/features/app/App.vue.d.ts +2 -2
  117. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  118. package/dist/v2/features/app/App.vue.js +89 -74
  119. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +6 -2
  120. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  121. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  122. package/dist/v2/features/app/components/AppSidebar.vue2.js +50 -47
  123. package/dist/v2/features/app/helpers/routes.d.ts +0 -10
  124. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  125. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  126. package/dist/v2/features/collection/DocumentCollection.vue2.js +75 -73
  127. package/dist/v2/features/collection/components/Authentication.vue.d.ts +13 -25
  128. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  129. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  130. package/dist/v2/features/collection/components/Authentication.vue2.js +47 -35
  131. package/dist/v2/features/collection/components/Form.vue.d.ts +3 -7
  132. package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
  133. package/dist/v2/features/collection/components/Form.vue.js +28 -33
  134. package/dist/v2/features/collection/components/Servers.vue.d.ts +13 -31
  135. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  136. package/dist/v2/features/collection/components/Servers.vue2.js +103 -82
  137. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
  138. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +3 -3
  139. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  140. package/dist/v2/features/modal/Modal.vue.js +3 -3
  141. package/dist/v2/features/modal/Modal.vue2.js +40 -32
  142. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  143. package/dist/v2/features/operation/Operation.vue.js +22 -28
  144. package/dist/v2/hooks/use-sidebar-state.d.ts +47 -0
  145. package/dist/v2/hooks/use-sidebar-state.d.ts.map +1 -0
  146. package/dist/v2/hooks/use-sidebar-state.js +112 -0
  147. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +1 -1
  148. package/dist/v2/hooks/use-workspace-client-events.js +75 -107
  149. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  150. package/package.json +17 -17
  151. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +0 -45
  152. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +0 -1
  153. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +0 -29
  154. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +0 -1
  155. package/dist/v2/blocks/scalar-auth-selector-block/event-types.d.ts +0 -29
  156. package/dist/v2/blocks/scalar-auth-selector-block/event-types.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
- import { defineComponent as y, computed as m, createBlock as c, openBlock as t, unref as o, withCtx as l, createVNode as n, createElementBlock as d, Fragment as v, createElementVNode as s, createTextVNode as h, toDisplayString as w, createCommentVNode as C, renderList as B } from "vue";
2
- import { ScalarPopover as z, ScalarButton as A, ScalarIcon as f, ScalarFloatingBackdrop as N } from "@scalar/components";
3
- import U from "./ServerDropdownItem.vue.js";
4
- const V = ["onClick"], D = { class: "flex h-4 w-4 items-center justify-center" }, I = /* @__PURE__ */ y({
1
+ import { defineComponent as h, computed as m, createBlock as f, openBlock as t, unref as o, withCtx as l, createVNode as n, createElementBlock as d, Fragment as p, createElementVNode as s, createTextVNode as w, toDisplayString as C, createCommentVNode as U, renderList as B } from "vue";
2
+ import { ScalarPopover as z, ScalarButton as A, ScalarIcon as b, ScalarFloatingBackdrop as N } from "@scalar/components";
3
+ import V from "./ServerDropdownItem.vue.js";
4
+ const D = ["onClick"], $ = { class: "flex h-4 w-4 items-center justify-center" }, I = /* @__PURE__ */ h({
5
5
  __name: "ServerDropdown",
6
6
  props: {
7
7
  servers: {},
@@ -10,50 +10,50 @@ const V = ["onClick"], D = { class: "flex h-4 w-4 items-center justify-center" }
10
10
  layout: {}
11
11
  },
12
12
  emits: ["update:selectedServer", "update:variable", "addServer"],
13
- setup(a, { emit: b }) {
14
- const i = b, g = m(
15
- () => a.servers.map((r) => ({
16
- id: r.url,
17
- label: r.url ?? "Unknown server"
13
+ setup(a, { emit: S }) {
14
+ const i = S, g = m(
15
+ () => a.servers.map((e) => ({
16
+ id: e.url,
17
+ label: e.url ?? "Unknown server"
18
18
  }))
19
- ), S = m(() => a.server?.url?.endsWith("/") ? a.server.url.slice(0, -1) : a.server?.url || "");
20
- return (r, e) => (t(), c(o(z), {
19
+ ), k = m(() => a.server?.url?.endsWith("/") ? a.server.url.slice(0, -1) : a.server?.url || "");
20
+ return (e, r) => (t(), f(o(z), {
21
21
  class: "max-h-[inherit] p-0 text-base",
22
22
  focus: "",
23
23
  offset: 0,
24
24
  placement: "bottom-start",
25
25
  resize: "",
26
- target: r.target,
27
- teleport: `#${r.target}`
26
+ target: e.target,
27
+ teleport: `#${e.target}`
28
28
  }, {
29
29
  popover: l(({ close: x }) => [
30
30
  s("div", {
31
31
  class: "custom-scroll flex max-h-[inherit] flex-col gap-1 border-t p-1",
32
32
  onClick: x
33
33
  }, [
34
- (t(!0), d(v, null, B(g.value, (u) => (t(), c(U, {
34
+ (t(!0), d(p, null, B(g.value, (u, v) => (t(), f(V, {
35
35
  key: u.id,
36
- server: r.server,
36
+ server: e.server,
37
37
  serverOption: u,
38
38
  type: "request",
39
- "onUpdate:selectedServer": e[0] || (e[0] = (p) => i("update:selectedServer", p)),
40
- "onUpdate:variable": e[1] || (e[1] = (p, k) => i("update:variable", { key: p, value: k }))
41
- }, null, 8, ["server", "serverOption"]))), 128)),
42
- r.layout !== "modal" ? (t(), d("button", {
39
+ "onUpdate:selectedServer": (c) => i("update:selectedServer", { index: v }),
40
+ "onUpdate:variable": (c, y) => i("update:variable", { index: v, key: c, value: y })
41
+ }, null, 8, ["server", "serverOption", "onUpdate:selectedServer", "onUpdate:variable"]))), 128)),
42
+ e.layout !== "modal" ? (t(), d("button", {
43
43
  key: 0,
44
44
  class: "text-xxs hover:bg-b-2 flex cursor-pointer items-center gap-1.5 rounded p-1.75",
45
45
  type: "button",
46
- onClick: e[2] || (e[2] = (u) => i("addServer"))
46
+ onClick: r[0] || (r[0] = (u) => i("addServer"))
47
47
  }, [
48
- s("div", D, [
49
- n(o(f), {
48
+ s("div", $, [
49
+ n(o(b), {
50
50
  icon: "Add",
51
51
  size: "sm"
52
52
  })
53
53
  ]),
54
- e[5] || (e[5] = s("span", null, "Add Server", -1))
55
- ])) : C("", !0)
56
- ], 8, V)
54
+ r[3] || (r[3] = s("span", null, "Add Server", -1))
55
+ ])) : U("", !0)
56
+ ], 8, D)
57
57
  ]),
58
58
  backdrop: l(() => [
59
59
  n(o(N), { class: "-top-(--scalar-address-bar-height) rounded-lg" })
@@ -64,12 +64,12 @@ const V = ["onClick"], D = { class: "flex h-4 w-4 items-center justify-center" }
64
64
  variant: "ghost"
65
65
  }, {
66
66
  default: l(() => [
67
- r.server ? (t(), d(v, { key: 0 }, [
68
- e[3] || (e[3] = s("span", { class: "sr-only" }, "Server:", -1)),
69
- h(" " + w(S.value), 1)
70
- ], 64)) : (t(), d(v, { key: 1 }, [
71
- e[4] || (e[4] = s("span", { class: "sr-only" }, "Add Server", -1)),
72
- n(o(f), {
67
+ e.server ? (t(), d(p, { key: 0 }, [
68
+ r[1] || (r[1] = s("span", { class: "sr-only" }, "Server:", -1)),
69
+ w(" " + C(k.value), 1)
70
+ ], 64)) : (t(), d(p, { key: 1 }, [
71
+ r[2] || (r[2] = s("span", { class: "sr-only" }, "Add Server", -1)),
72
+ n(o(b), {
73
73
  icon: "Add",
74
74
  size: "xs"
75
75
  })
@@ -8,14 +8,10 @@ type __VLS_Props = {
8
8
  };
9
9
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
10
10
  "update:variable": (key: string, value: string) => any;
11
- "update:selectedServer": (payload: {
12
- id: string;
13
- }) => any;
11
+ "update:selectedServer": () => any;
14
12
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
13
  "onUpdate:variable"?: ((key: string, value: string) => any) | undefined;
16
- "onUpdate:selectedServer"?: ((payload: {
17
- id: string;
18
- }) => any) | undefined;
14
+ "onUpdate:selectedServer"?: (() => any) | undefined;
19
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
16
  export default _default;
21
17
  //# sourceMappingURL=ServerDropdownItem.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ServerDropdownItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/server/ServerDropdownItem.vue"],"names":[],"mappings":"AAoFA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAKhG,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;CACF,CAAC;;;;YAO4C,MAAM;;;;;YAAN,MAAM;;;AA0JpD,wBAOG"}
1
+ {"version":3,"file":"ServerDropdownItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/server/ServerDropdownItem.vue"],"names":[],"mappings":"AAoFA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAKhG,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;CACF,CAAC;;;;;;;;AAiKF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ServerDropdownItem.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-96792a7f"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b503e183"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as h, useId as x, computed as c, createElementBlock as a, openBlock as n, normalizeClass as k, createElementVNode as d, createCommentVNode as u, mergeProps as S, unref as s, createVNode as l, toDisplayString as g, withModifiers as y } from "vue";
1
+ import { defineComponent as h, useId as x, computed as p, createElementBlock as i, openBlock as n, normalizeClass as k, createElementVNode as l, createCommentVNode as u, mergeProps as S, unref as s, createVNode as d, toDisplayString as g, withModifiers as y } from "vue";
2
2
  import { ScalarListboxCheckbox as w, ScalarMarkdown as C } from "@scalar/components";
3
- import O from "../../../components/Server/ServerVariablesForm.vue.js";
4
- const V = ["aria-expanded"], _ = { class: "overflow-hidden text-ellipsis whitespace-nowrap" }, E = ["id"], I = { key: 0 }, N = { class: "description text-c-3 px-3 py-1.5" }, j = /* @__PURE__ */ h({
3
+ import _ from "../../../components/Server/ServerVariablesForm.vue.js";
4
+ const V = ["aria-expanded"], O = { class: "overflow-hidden text-ellipsis whitespace-nowrap" }, E = ["id"], I = { key: 0 }, N = { class: "description text-c-3 px-3 py-1.5" }, j = /* @__PURE__ */ h({
5
5
  __name: "ServerDropdownItem",
6
6
  props: {
7
7
  server: {},
@@ -9,35 +9,35 @@ const V = ["aria-expanded"], _ = { class: "overflow-hidden text-ellipsis whitesp
9
9
  },
10
10
  emits: ["update:variable", "update:selectedServer"],
11
11
  setup(o, { emit: m }) {
12
- const v = m, p = x(), b = () => Object.keys(o.server?.variables ?? {}).length > 0, t = c(() => o.serverOption.id === o.server?.url), i = c(() => t.value && b()), f = (e, r) => {
12
+ const v = m, c = x(), b = () => Object.keys(o.server?.variables ?? {}).length > 0, t = p(() => o.serverOption.id === o.server?.url), a = p(() => t.value && b()), f = (e, r) => {
13
13
  v("update:variable", e, r);
14
14
  };
15
- return (e, r) => (n(), a("div", {
15
+ return (e, r) => (n(), i("div", {
16
16
  class: k(["group/item flex min-h-fit flex-col rounded border", { "border-transparent": !t.value }])
17
17
  }, [
18
- d("button", S(i.value ? { "aria-controls": s(p) } : {}, {
19
- "aria-expanded": i.value,
18
+ l("button", S(a.value ? { "aria-controls": s(c) } : {}, {
19
+ "aria-expanded": a.value,
20
20
  class: ["flex min-h-8 cursor-pointer items-center gap-1.5 rounded px-1.5", t.value ? "text-c-1 bg-b-2" : "hover:bg-b-2"],
21
21
  type: "button",
22
- onClick: r[0] || (r[0] = (B) => v("update:selectedServer", { id: e.serverOption.id }))
22
+ onClick: r[0] || (r[0] = (B) => v("update:selectedServer"))
23
23
  }), [
24
- l(s(w), { selected: t.value }, null, 8, ["selected"]),
25
- d("span", _, g(e.serverOption.label), 1)
24
+ d(s(w), { selected: t.value }, null, 8, ["selected"]),
25
+ l("span", O, g(e.serverOption.label), 1)
26
26
  ], 16, V),
27
- i.value ? (n(), a("div", {
27
+ a.value ? (n(), i("div", {
28
28
  key: 0,
29
- id: s(p),
29
+ id: s(c),
30
30
  class: "bg-b-2 divide divide-y rounded-b border-t *:pl-4",
31
31
  onClick: r[1] || (r[1] = y(() => {
32
32
  }, ["stop"]))
33
33
  }, [
34
- l(O, {
34
+ d(_, {
35
35
  variables: e.server?.variables,
36
36
  "onUpdate:variable": f
37
37
  }, null, 8, ["variables"]),
38
- e.server?.description ? (n(), a("div", I, [
39
- d("div", N, [
40
- l(s(C), {
38
+ e.server?.description ? (n(), i("div", I, [
39
+ l("div", N, [
40
+ d(s(C), {
41
41
  value: e.server.description
42
42
  }, null, 8, ["value"])
43
43
  ])
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/server/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
@@ -1,8 +1,9 @@
1
- import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
1
+ import { type SidebarState } from '@scalar/sidebar';
2
+ import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
2
3
  import type { ClientLayout } from '../../../v2/types/layout';
3
4
  type __VLS_Props = {
4
5
  /** All documents to display sidebar items for */
5
- documents: Record<string, WorkspaceDocument>;
6
+ sidebarState: SidebarState<TraversedEntry>;
6
7
  /** Layout for the client */
7
8
  layout: ClientLayout;
8
9
  };
@@ -24,8 +25,11 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
24
25
  "update:workspace": (value: string) => any;
25
26
  "update:isSidebarOpen": (value: boolean) => any;
26
27
  "update:sidebarWidth": (value: number) => any;
28
+ } & {
29
+ selectItem: (id: string) => any;
27
30
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
28
31
  "onUpdate:workspace"?: ((value: string) => any) | undefined;
32
+ onSelectItem?: ((id: string) => any) | undefined;
29
33
  "onUpdate:isSidebarOpen"?: ((value: boolean) => any) | undefined;
30
34
  "onUpdate:sidebarWidth"?: ((value: number) => any) | undefined;
31
35
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"names":[],"mappings":"AA2HA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAIlF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKrD,KAAK,WAAW,GAAG;IACjB,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IAC5C,4BAA4B;IAC5B,MAAM,EAAE,YAAY,CAAA;CACrB,CAAC;AAGF,KAAK,WAAW,GAAG;IACjB,uCAAuC;IACvC,eAAe,CAAC,IAAI,OAAO,CAAA;IAC3B,mDAAmD;IACnD,MAAM,CAAC,IAAI,OAAO,CAAA;CACnB,CAAC;AA+CF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;AAsLF,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":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"names":[],"mappings":"AAiHA,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAIhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKrD,KAAK,WAAW,GAAG;IACjB,iDAAiD;IACjD,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,4BAA4B;IAC5B,MAAM,EAAE,YAAY,CAAA;CACrB,CAAC;AASF,KAAK,WAAW,GAAG;IACjB,uCAAuC;IACvC,eAAe,CAAC,IAAI,OAAO,CAAA;IAC3B,mDAAmD;IACnD,MAAM,CAAC,IAAI,OAAO,CAAA;CACnB,CAAC;AAiCF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;AAuLF,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,14 +1,14 @@
1
- import { defineComponent as k, mergeModels as w, computed as y, useModel as u, ref as g, createBlock as a, openBlock as l, unref as r, withCtx as d, createVNode as x, renderSlot as b, createElementVNode as S, createCommentVNode as p } from "vue";
2
- import { ScalarIconButton as O, ScalarSidebarSearchInput as M } from "@scalar/components";
3
- import { ScalarIconMagnifyingGlass as V } from "@scalar/icons";
4
- import { createSidebarState as h, ScalarSidebar as E } from "@scalar/sidebar";
5
- import B from "./SidebarMenu.vue.js";
6
- import W from "./SidebarToggle.vue.js";
7
- import $ from "../resize/Resize.vue.js";
8
- const C = { class: "bg-sidebar-b-1 sticky top-0 z-1 flex flex-col gap-3 px-3 pt-3" }, I = { class: "flex items-center justify-between" }, R = /* @__PURE__ */ k({
1
+ import { defineComponent as v, mergeModels as c, useModel as n, ref as g, createBlock as a, openBlock as r, unref as s, withCtx as l, createVNode as M, renderSlot as b, createElementVNode as S, createCommentVNode as u } from "vue";
2
+ import { ScalarIconButton as O, ScalarSidebarSearchInput as V } from "@scalar/components";
3
+ import { ScalarIconMagnifyingGlass as I } from "@scalar/icons";
4
+ import { ScalarSidebar as B } from "@scalar/sidebar";
5
+ import W from "./SidebarMenu.vue.js";
6
+ import $ from "./SidebarToggle.vue.js";
7
+ import h from "../resize/Resize.vue.js";
8
+ const x = { class: "bg-sidebar-b-1 sticky top-0 z-1 flex flex-col gap-3 px-3 pt-3" }, C = { class: "flex items-center justify-between" }, R = /* @__PURE__ */ v({
9
9
  __name: "Sidebar",
10
- props: /* @__PURE__ */ w({
11
- documents: {},
10
+ props: /* @__PURE__ */ c({
11
+ sidebarState: {},
12
12
  layout: {}
13
13
  }, {
14
14
  workspace: {
@@ -23,66 +23,56 @@ const C = { class: "bg-sidebar-b-1 sticky top-0 z-1 flex flex-col gap-3 px-3 pt-
23
23
  },
24
24
  sidebarWidthModifiers: {}
25
25
  }),
26
- emits: ["update:workspace", "update:isSidebarOpen", "update:sidebarWidth"],
27
- setup(i) {
28
- const s = y(() => {
29
- const o = Object.entries(i.documents).map(
30
- ([e, t]) => ({
31
- id: e,
32
- type: "document",
33
- title: t.info.title ?? e,
34
- children: t["x-scalar-navigation"]?.children ?? []
35
- })
36
- );
37
- return h(o);
38
- }), v = (o, ...e) => {
39
- console.log("[LOG] event name: ", o), console.log("[LOG]", ...e);
40
- }, c = u(i, "workspace"), m = u(i, "isSidebarOpen"), n = g(!1), f = u(i, "sidebarWidth");
41
- return (o, e) => (l(), a(r($), {
26
+ emits: /* @__PURE__ */ c(["selectItem"], ["update:workspace", "update:isSidebarOpen", "update:sidebarWidth"]),
27
+ setup(i, { emit: k }) {
28
+ const w = k, y = (t, ...e) => {
29
+ console.log("[LOG] event name: ", t), console.log("[LOG]", ...e);
30
+ }, p = n(i, "workspace"), m = n(i, "isSidebarOpen"), d = g(!1), f = n(i, "sidebarWidth");
31
+ return (t, e) => (r(), a(s(h), {
42
32
  width: f.value,
43
- "onUpdate:width": e[5] || (e[5] = (t) => f.value = t),
33
+ "onUpdate:width": e[5] || (e[5] = (o) => f.value = o),
44
34
  class: "flex flex-col"
45
35
  }, {
46
- default: d(() => [
47
- x(r(E), {
48
- class: "flex w-auto flex-1",
49
- isExpanded: s.value.isExpanded,
50
- isSelected: s.value.isSelected,
51
- items: s.value.items.value,
36
+ default: l(() => [
37
+ M(s(B), {
38
+ class: "flex w-auto flex-1 pt-2",
39
+ isExpanded: t.sidebarState.isExpanded,
40
+ isSelected: t.sidebarState.isSelected,
41
+ items: t.sidebarState.items.value,
52
42
  layout: "client",
53
- onSelectItem: e[3] || (e[3] = (t) => s.value.setExpanded(t, !0)),
54
- onReorder: e[4] || (e[4] = (...t) => v("reorder", ...t))
43
+ onSelectItem: e[3] || (e[3] = (o) => w("selectItem", o)),
44
+ onReorder: e[4] || (e[4] = (...o) => y("reorder", ...o))
55
45
  }, {
56
- search: d(() => [
57
- S("div", C, [
58
- S("div", I, [
59
- o.layout === "desktop" ? (l(), a(B, {
46
+ search: l(() => [
47
+ S("div", x, [
48
+ S("div", C, [
49
+ t.layout === "desktop" ? (r(), a(W, {
60
50
  key: 0,
61
- workspace: c.value,
62
- "onUpdate:workspace": e[0] || (e[0] = (t) => c.value = t)
63
- }, null, 8, ["workspace"])) : o.layout === "modal" ? (l(), a(W, {
51
+ workspace: p.value,
52
+ "onUpdate:workspace": e[0] || (e[0] = (o) => p.value = o)
53
+ }, null, 8, ["workspace"])) : t.layout === "modal" ? (r(), a($, {
64
54
  key: 1,
65
55
  modelValue: m.value,
66
- "onUpdate:modelValue": e[1] || (e[1] = (t) => m.value = t)
67
- }, null, 8, ["modelValue"])) : p("", !0),
68
- o.layout !== "web" ? (l(), a(r(O), {
56
+ "onUpdate:modelValue": e[1] || (e[1] = (o) => m.value = o)
57
+ }, null, 8, ["modelValue"])) : u("", !0),
58
+ t.layout !== "web" ? (r(), a(s(O), {
69
59
  key: 2,
70
- icon: r(V),
60
+ icon: s(I),
71
61
  label: "Search",
72
- onClick: e[2] || (e[2] = (t) => n.value = !n.value)
73
- }, null, 8, ["icon"])) : p("", !0)
62
+ onClick: e[2] || (e[2] = (o) => d.value = !d.value)
63
+ }, null, 8, ["icon"])) : u("", !0)
74
64
  ]),
75
- n.value || o.layout === "web" ? (l(), a(r(M), {
65
+ d.value || t.layout === "web" ? (r(), a(s(V), {
76
66
  key: 0,
77
- autofocus: o.layout !== "web"
78
- }, null, 8, ["autofocus"])) : p("", !0)
67
+ autofocus: t.layout !== "web"
68
+ }, null, 8, ["autofocus"])) : u("", !0)
79
69
  ])
80
70
  ]),
81
- before: d(() => [
82
- b(o.$slots, "workspaceButton")
71
+ before: l(() => [
72
+ b(t.$slots, "workspaceButton")
83
73
  ]),
84
- footer: d(() => [
85
- b(o.$slots, "footer")
74
+ footer: l(() => [
75
+ b(t.$slots, "footer")
86
76
  ]),
87
77
  _: 3
88
78
  }, 8, ["isExpanded", "isSelected", "items"])
@@ -1,9 +1,9 @@
1
1
  import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
2
  import type { ClientLayout } from '../../../v2/types/layout';
3
3
  /**
4
- * Main entry point for the API client for electron and web
4
+ * Main entry point for the API client for electron and web.
5
5
  *
6
- * This will be the brains of the client, should handle all events and store business logic
6
+ * This component handles all events and store business logic for the application.
7
7
  */
8
8
  declare const _default: import("vue").DefineComponent<{
9
9
  layout: Exclude<ClientLayout, "modal">;
@@ -1 +1 @@
1
- {"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"AAkMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAWpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAOrD;;;;GAIG;;YAGO,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;oBACtB,cAAc;;YADtB,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;oBACtB,cAAc;;AAHhC,wBAuQC"}
1
+ {"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"AAmPA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAYpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAOrD;;;;GAIG;;YAGO,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;oBACtB,cAAc;;YADtB,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;oBACtB,cAAc;;AAHhC,wBAmSC"}
@@ -1,92 +1,107 @@
1
- import { defineComponent as g, computed as r, ref as f, createElementBlock as B, openBlock as n, Fragment as N, createElementVNode as p, createVNode as c, unref as d, withCtx as k, createBlock as m, withDirectives as V, vShow as C, KeepAlive as T, resolveDynamicComponent as W } from "vue";
2
- import { ScalarTeleportRoot as M } from "@scalar/components";
3
- import { isHttpMethod as O } from "@scalar/helpers/http/is-http-method";
4
- import { getThemeStyles as U } from "@scalar/themes";
5
- import { useColorMode as D } from "@scalar/use-hooks/useColorMode";
6
- import { createWorkspaceEventBus as R } from "@scalar/workspace-store/events";
7
- import { xScalarEnvironmentSchema as w } from "@scalar/workspace-store/schemas/extensions/document/x-scalar-environments";
8
- import { coerceValue as S } from "@scalar/workspace-store/schemas/typebox-coerce";
9
- import { useRoute as A, RouterView as H } from "vue-router";
10
- import { useWorkspaceClientEvents as I } from "../../hooks/use-workspace-client-events.js";
11
- import L from "./components/AppSidebar.vue.js";
12
- import P from "./components/DesktopTabs.vue.js";
13
- import $ from "./components/WebTopNav.vue.js";
14
- const j = ["innerHTML"], F = { class: "flex flex-1" }, K = { class: "bg-b-1 flex flex-1 flex-col" }, q = {}, ne = /* @__PURE__ */ g({
15
- ...q,
1
+ import { defineComponent as O, ref as h, computed as a, createElementBlock as A, openBlock as d, Fragment as H, createElementVNode as p, createVNode as v, unref as c, withCtx as M, createBlock as b, withDirectives as N, vShow as P, normalizeProps as L, guardReactiveProps as F } from "vue";
2
+ import { ScalarTeleportRoot as $ } from "@scalar/components";
3
+ import { isHttpMethod as z } from "@scalar/helpers/http/is-http-method";
4
+ import { getThemeStyles as j } from "@scalar/themes";
5
+ import { useColorMode as q } from "@scalar/use-hooks/useColorMode";
6
+ import { createWorkspaceEventBus as G } from "@scalar/workspace-store/events";
7
+ import { xScalarEnvironmentSchema as y } from "@scalar/workspace-store/schemas/extensions/document/x-scalar-environments";
8
+ import { coerceValue as x } from "@scalar/workspace-store/schemas/typebox-coerce";
9
+ import { useRoute as J, useRouter as K, RouterView as Q } from "vue-router";
10
+ import { useSidebarState as X } from "../../hooks/use-sidebar-state.js";
11
+ import { useWorkspaceClientEvents as Y } from "../../hooks/use-workspace-client-events.js";
12
+ import Z from "./components/AppSidebar.vue.js";
13
+ import _ from "./components/DesktopTabs.vue.js";
14
+ import ee from "./components/WebTopNav.vue.js";
15
+ const te = ["innerHTML"], oe = { class: "flex min-h-0 flex-1" }, ae = { class: "bg-b-1 flex-1" }, re = {}, be = /* @__PURE__ */ O({
16
+ ...re,
16
17
  __name: "App",
17
18
  props: {
18
19
  layout: {},
19
20
  workspaceStore: {}
20
21
  },
21
- setup(a) {
22
- D(), typeof window < "u" && (window.dataDumpWorkspace = () => a.workspaceStore);
23
- const h = r(() => {
24
- const e = a.workspaceStore.workspace["x-scalar-theme"];
25
- return e ? `<style>${U(e)}</style>` : "";
26
- }), s = f("default"), i = f(!0), v = R(), l = A(), u = r(
27
- () => a.workspaceStore.workspace.documents[l.params.documentSlug] ?? Object.values(a.workspaceStore.workspace.documents)[0] ?? null
28
- ), b = r(() => {
29
- const e = l.params.pathEncoded;
30
- return e && typeof e == "string" ? decodeURIComponent(e) : void 0;
31
- }), y = r(() => {
32
- const e = l.params.method;
33
- return e && typeof e == "string" && O(e) ? e : void 0;
34
- }), x = r(() => {
35
- const e = l.params.exampleName;
36
- return e && typeof e == "string" ? e : void 0;
22
+ setup(o) {
23
+ q(), typeof window < "u" && (window.dataDumpWorkspace = () => o.workspaceStore);
24
+ const n = (e) => {
25
+ const t = E.params[e];
26
+ return typeof t == "string" ? t : void 0;
27
+ }, E = J(), W = K(), k = G(), s = h("default"), i = h(!0), u = a(
28
+ () => n("workspaceSlug") ?? "default"
29
+ ), l = a(() => n("documentSlug")), m = a(() => l.value ? o.workspaceStore.workspace.documents[l.value] ?? null : null), S = a(() => {
30
+ const e = n("pathEncoded");
31
+ return e ? decodeURIComponent(e) : void 0;
32
+ }), w = a(() => {
33
+ const e = n("method");
34
+ return e && z(e) ? e : void 0;
35
+ }), f = a(() => n("exampleName")), { handleSelectItem: g, sidebarState: T } = X({
36
+ workspaceStore: o.workspaceStore,
37
+ workspaceSlug: u,
38
+ documentSlug: l,
39
+ path: S,
40
+ method: w,
41
+ exampleName: f
37
42
  });
38
- I(v, u, a.workspaceStore);
39
- const E = r(() => {
40
- const e = a.workspaceStore.workspace["x-scalar-active-environment"];
43
+ Y(k, m, o.workspaceStore);
44
+ const D = a(() => {
45
+ const e = o.workspaceStore.workspace["x-scalar-active-environment"];
41
46
  if (!e)
42
- return S(w, {});
43
- const t = a.workspaceStore.workspace["x-scalar-environments"]?.[e] ?? { variables: [] }, o = u.value?.["x-scalar-environments"]?.[e] ?? { variables: [] };
44
- return S(w, {
47
+ return x(y, {});
48
+ const t = o.workspaceStore.workspace["x-scalar-environments"]?.[e] ?? {
49
+ variables: []
50
+ }, r = m.value?.["x-scalar-environments"]?.[e] ?? {
51
+ variables: []
52
+ };
53
+ return x(y, {
45
54
  ...t,
46
- ...o,
47
- variables: [...t.variables, ...o.variables]
55
+ ...r,
56
+ variables: [...t.variables, ...r.variables]
48
57
  });
49
- });
50
- return (e, t) => (n(), B(N, null, [
51
- p("div", { innerHTML: h.value }, null, 8, j),
52
- c(d(M), null, {
53
- default: k(() => [
54
- e.layout === "desktop" ? (n(), m(P, { key: 0 })) : (n(), m($, {
58
+ }), I = a(() => {
59
+ const e = o.workspaceStore.workspace["x-scalar-theme"];
60
+ return e ? `<style>${j(e)}</style>` : "";
61
+ }), R = a(
62
+ () => o.workspaceStore.workspace["x-scalar-sidebar-width"] ?? 288
63
+ ), B = a(
64
+ () => !!(u.value && !l.value)
65
+ ), U = (e) => o.workspaceStore.update("x-scalar-sidebar-width", e), V = () => W.push({
66
+ name: "workspace",
67
+ params: { workspaceSlug: u.value }
68
+ }), C = a(() => ({
69
+ document: m.value,
70
+ environment: D.value,
71
+ eventBus: k,
72
+ exampleName: f.value,
73
+ layout: o.layout,
74
+ method: w.value,
75
+ path: S.value,
76
+ workspaceStore: o.workspaceStore
77
+ }));
78
+ return (e, t) => (d(), A(H, null, [
79
+ p("div", { innerHTML: I.value }, null, 8, te),
80
+ v(c($), null, {
81
+ default: M(() => [
82
+ e.layout === "desktop" ? (d(), b(_, { key: 0 })) : (d(), b(ee, {
55
83
  key: 1,
56
84
  modelValue: s.value,
57
- "onUpdate:modelValue": t[0] || (t[0] = (o) => s.value = o)
85
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => s.value = r)
58
86
  }, null, 8, ["modelValue"])),
59
- p("main", F, [
60
- V(c(L, {
87
+ p("main", oe, [
88
+ N(v(Z, {
61
89
  isSidebarOpen: i.value,
62
- "onUpdate:isSidebarOpen": t[1] || (t[1] = (o) => i.value = o),
90
+ "onUpdate:isSidebarOpen": t[1] || (t[1] = (r) => i.value = r),
63
91
  workspace: s.value,
64
- "onUpdate:workspace": t[2] || (t[2] = (o) => s.value = o),
65
- documents: e.workspaceStore.workspace.documents,
92
+ "onUpdate:workspace": t[2] || (t[2] = (r) => s.value = r),
93
+ isWorkspaceOpen: B.value,
66
94
  layout: e.layout,
67
- sidebarWidth: e.workspaceStore.workspace["x-scalar-sidebar-width"] ?? 288,
68
- "onUpdate:sidebarWidth": t[3] || (t[3] = (o) => e.workspaceStore.update("x-scalar-sidebar-width", o))
69
- }, null, 8, ["isSidebarOpen", "workspace", "documents", "layout", "sidebarWidth"]), [
70
- [C, i.value]
95
+ sidebarState: c(T),
96
+ sidebarWidth: R.value,
97
+ "onClick:workspace": V,
98
+ onSelectItem: c(g),
99
+ "onUpdate:sidebarWidth": U
100
+ }, null, 8, ["isSidebarOpen", "workspace", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "onSelectItem"]), [
101
+ [P, i.value]
71
102
  ]),
72
- p("div", K, [
73
- c(d(H), null, {
74
- default: k(({ Component: o }) => [
75
- (n(), m(T, null, [
76
- (n(), m(W(o), {
77
- document: u.value,
78
- environment: E.value,
79
- eventBus: d(v),
80
- layout: e.layout,
81
- workspaceStore: e.workspaceStore,
82
- path: b.value,
83
- method: y.value,
84
- exampleName: x.value
85
- }, null, 8, ["document", "environment", "eventBus", "layout", "workspaceStore", "path", "method", "exampleName"]))
86
- ], 1024))
87
- ]),
88
- _: 1
89
- })
103
+ p("div", ae, [
104
+ v(c(Q), L(F(C.value)), null, 16)
90
105
  ])
91
106
  ])
92
107
  ]),
@@ -96,5 +111,5 @@ const j = ["innerHTML"], F = { class: "flex flex-1" }, K = { class: "bg-b-1 flex
96
111
  }
97
112
  });
98
113
  export {
99
- ne as default
114
+ be as default
100
115
  };
@@ -1,8 +1,10 @@
1
- import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
1
+ import type { SidebarState } from '@scalar/sidebar';
2
+ import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
2
3
  import type { ClientLayout } from '../../../../v2/types/layout';
3
4
  type __VLS_Props = {
4
5
  layout: ClientLayout;
5
- documents: Record<string, WorkspaceDocument>;
6
+ sidebarState: SidebarState<TraversedEntry>;
7
+ isWorkspaceOpen?: boolean;
6
8
  };
7
9
  type __VLS_PublicProps = __VLS_Props & {
8
10
  /** Propagate up the workspace model to the parent */
@@ -17,10 +19,12 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {},
17
19
  "update:isSidebarOpen": (value: boolean) => any;
18
20
  "update:sidebarWidth": (value: number) => any;
19
21
  } & {
22
+ selectItem: (id: string) => any;
20
23
  "open:commandPalette": (action?: "import" | undefined) => any;
21
24
  "click:workspace": () => any;
22
25
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
23
26
  "onUpdate:workspace"?: ((value: string) => any) | undefined;
27
+ onSelectItem?: ((id: string) => any) | undefined;
24
28
  "onUpdate:isSidebarOpen"?: ((value: boolean) => any) | undefined;
25
29
  "onUpdate:sidebarWidth"?: ((value: number) => any) | undefined;
26
30
  "onOpen:commandPalette"?: ((action?: "import" | undefined) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"AAoLA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAOlF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;CAC7C,CAAC;AAwCF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;;;;;;;;;;;;;;;AA8OF,wBAOG"}
1
+ {"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"AAyLA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAOhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;AAyCF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;;;;;;;;;;;;;;;;;AAuPF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./AppSidebar.vue2.js";
2
2
  /* empty css */
3
3
  import p from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ p(o, [["__scopeId", "data-v-0a390d33"]]);
4
+ const m = /* @__PURE__ */ p(o, [["__scopeId", "data-v-87ac8466"]]);
5
5
  export {
6
6
  m as default
7
7
  };