@scalar/api-client 2.26.2 → 2.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/CHANGELOG.md +218 -0
  2. package/dist/components/Server/ServerSelector.vue.js +6 -6
  3. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +6 -6
  4. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  5. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
  6. package/dist/libs/local-storage.js +3 -3
  7. package/dist/style.css +1 -1
  8. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
  9. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +29 -25
  10. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/helpers/get-example.js +15 -15
  12. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +10 -0
  13. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +1 -0
  14. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +4 -0
  15. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  16. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +26 -26
  17. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  18. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  19. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +88 -103
  20. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -0
  21. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  22. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +2 -0
  23. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  24. package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts +1 -1
  25. package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -1
  26. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +20 -19
  27. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  28. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +7 -7
  29. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
  31. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -40
  32. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +2 -0
  33. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  34. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +52 -54
  35. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +3 -2
  36. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  37. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +106 -86
  38. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts +21 -0
  39. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -0
  40. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js +91 -0
  41. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue2.js +4 -0
  42. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  43. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +107 -93
  44. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  45. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +87 -65
  46. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +36 -0
  47. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -0
  48. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +35 -0
  49. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +1 -1
  50. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -1
  51. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +18 -10
  52. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts +5 -0
  53. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -0
  54. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +27 -0
  55. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +3 -1
  56. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
  57. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +4 -3
  58. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  59. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +32 -40
  60. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  61. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  62. package/dist/v2/components/layout/CollapsibleSection.vue.js +1 -1
  63. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -0
  64. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  65. package/dist/v2/components/sidebar/Sidebar.vue.js +25 -24
  66. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -0
  67. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  68. package/dist/v2/components/sidebar/SidebarMenu.vue.js +30 -30
  69. package/dist/v2/features/app/App.vue.d.ts +5 -0
  70. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  71. package/dist/v2/features/app/App.vue.js +80 -78
  72. package/dist/v2/features/app/app-events.d.ts +2 -1
  73. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  74. package/dist/v2/features/app/app-events.js +89 -64
  75. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  76. package/dist/v2/features/app/app-state.js +172 -151
  77. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  78. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  79. package/dist/v2/features/app/components/AppSidebar.vue2.js +99 -97
  80. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  81. package/dist/v2/features/app/components/DesktopTabs.vue.js +4 -4
  82. package/dist/v2/features/app/components/DownloadAppButton.vue.d.ts.map +1 -1
  83. package/dist/v2/features/app/components/DownloadAppButton.vue.js +1 -1
  84. package/dist/v2/features/app/components/DownloadAppButton.vue2.js +9 -9
  85. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
  86. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +71 -43
  87. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +11 -1
  88. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  89. package/dist/v2/features/app/helpers/create-api-client-app.js +12 -10
  90. package/dist/v2/features/app/helpers/routes.d.ts +2 -0
  91. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  92. package/dist/v2/features/app/helpers/routes.js +11 -11
  93. package/dist/v2/features/app/hooks/use-theme.d.ts +42 -0
  94. package/dist/v2/features/app/hooks/use-theme.d.ts.map +1 -0
  95. package/dist/v2/features/app/hooks/use-theme.js +34 -0
  96. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  97. package/dist/v2/features/collection/DocumentCollection.vue.js +27 -26
  98. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts +1 -6
  99. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
  100. package/dist/v2/features/collection/WorkspaceCollection.vue.js +41 -22
  101. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  102. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  103. package/dist/v2/features/collection/components/Authentication.vue2.js +49 -40
  104. package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +1 -1
  105. package/dist/v2/features/collection/components/Cookies.vue.js +26 -13
  106. package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
  107. package/dist/v2/features/collection/components/Environment.vue.js +27 -15
  108. package/dist/v2/features/collection/components/LabelInput.vue.d.ts +3 -0
  109. package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
  110. package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
  111. package/dist/v2/features/collection/components/LabelInput.vue2.js +20 -16
  112. package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
  113. package/dist/v2/features/collection/components/Overview.vue.js +2 -2
  114. package/dist/v2/features/collection/components/Overview.vue2.js +68 -61
  115. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  116. package/dist/v2/features/collection/components/Servers.vue.js +93 -88
  117. package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
  118. package/dist/v2/features/collection/components/Settings.vue.js +19 -17
  119. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +7 -2
  120. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
  121. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +70 -71
  122. package/dist/v2/features/command-palette/components/{CommandPaletteDocument.vue.d.ts → CommandPaletteOpenApiDocument.vue.d.ts} +3 -3
  123. package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.d.ts.map +1 -0
  124. package/dist/v2/features/command-palette/components/{CommandPaletteDocument.vue.js → CommandPaletteOpenApiDocument.vue.js} +15 -15
  125. package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue2.js +4 -0
  126. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +2 -2
  127. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -1
  128. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +10 -10
  129. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +27 -5
  130. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -1
  131. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +80 -53
  132. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +34 -9
  133. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  134. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +50 -44
  135. package/dist/v2/features/environments/EnvironmentsList.vue.js +1 -1
  136. package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts.map +1 -1
  137. package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +2 -2
  138. package/dist/v2/features/global-cookies/components/CookiesTable.vue2.js +8 -8
  139. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  140. package/dist/v2/features/modal/Modal.vue.js +15 -15
  141. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  142. package/dist/v2/features/operation/Operation.vue.js +30 -33
  143. package/dist/v2/features/settings/CollectionSettings.vue.d.ts +10 -7
  144. package/dist/v2/features/settings/CollectionSettings.vue.d.ts.map +1 -1
  145. package/dist/v2/features/settings/CollectionSettings.vue.js +183 -149
  146. package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +1 -1
  147. package/dist/v2/features/settings/DocumentSettings.vue.js +88 -79
  148. package/dist/v2/features/settings/components/Section.vue.d.ts +2 -1
  149. package/dist/v2/features/settings/components/Section.vue.d.ts.map +1 -1
  150. package/dist/v2/features/settings/components/Section.vue.js +26 -15
  151. package/dist/v2/features/settings/helpers/get-theme-colors.d.ts +4 -3
  152. package/dist/v2/features/settings/helpers/get-theme-colors.d.ts.map +1 -1
  153. package/dist/v2/features/settings/helpers/get-theme-colors.js +6 -7
  154. package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
  155. package/dist/v2/helpers/handle-hotkeys.js +2 -2
  156. package/dist/v2/hooks/use-global-hot-keys.d.ts +3 -1
  157. package/dist/v2/hooks/use-global-hot-keys.d.ts.map +1 -1
  158. package/dist/v2/hooks/use-global-hot-keys.js +8 -6
  159. package/dist/v2/workspace-events.d.ts.map +1 -1
  160. package/dist/v2/workspace-events.js +132 -115
  161. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  162. package/package.json +17 -16
  163. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.d.ts.map +0 -1
  164. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue2.js +0 -4
@@ -1,14 +1,15 @@
1
- import { defineComponent as M, ref as A, computed as x, createElementBlock as u, openBlock as c, Fragment as S, createElementVNode as s, createVNode as o, createTextVNode as g, renderList as I, createBlock as y, unref as r, toDisplayString as T, withCtx as f, createCommentVNode as V } from "vue";
1
+ import { defineComponent as M, ref as T, computed as x, createElementBlock as v, openBlock as n, Fragment as g, createVNode as a, withCtx as i, createElementVNode as c, renderList as A, createBlock as y, unref as s, toDisplayString as I, createCommentVNode as V, createTextVNode as p } from "vue";
2
2
  import { useModal as P, ScalarMarkdown as z, ScalarButton as k, ScalarModal as L } from "@scalar/components";
3
3
  import { debounce as O } from "@scalar/helpers/general/debounce";
4
4
  import { ScalarIconTrash as R, ScalarIconPlus as j } from "@scalar/icons";
5
5
  import E from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
6
- import F from "./Form.vue.js";
7
- import W from "../../../../components/Server/ServerVariablesForm.vue.js";
8
- const Y = { class: "flex flex-col gap-4" }, q = { class: "flex flex-col gap-4" }, G = { class: "bg-b-2 flex items-center justify-between rounded-t-lg px-3 py-1 text-sm" }, H = {
6
+ import F from "../../settings/components/Section.vue.js";
7
+ import W from "./Form.vue.js";
8
+ import Y from "../../../../components/Server/ServerVariablesForm.vue.js";
9
+ const q = { class: "flex flex-col gap-4" }, G = { class: "bg-b-2 flex items-center justify-between rounded-t-lg px-3 py-1 text-sm" }, H = {
9
10
  key: 1,
10
11
  class: "self-center"
11
- }, J = { class: "divide-0 flex w-full flex-col divide-y rounded-b-lg text-sm" }, K = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, re = /* @__PURE__ */ M({
12
+ }, J = { class: "divide-0 flex w-full flex-col divide-y rounded-b-lg text-sm" }, K = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, oe = /* @__PURE__ */ M({
12
13
  __name: "Servers",
13
14
  props: {
14
15
  documentSlug: {},
@@ -23,12 +24,13 @@ const Y = { class: "flex flex-col gap-4" }, q = { class: "flex flex-col gap-4" }
23
24
  workspaceStore: {},
24
25
  activeWorkspace: {},
25
26
  plugins: {},
27
+ customThemes: {},
26
28
  collectionType: {}
27
29
  },
28
- setup(l) {
29
- const v = P(), n = A(-1), _ = x(
30
- () => l.document?.servers?.[n.value]
31
- ), $ = x(() => l.document?.servers ?? []), B = [
30
+ setup(o) {
31
+ const m = P(), l = T(-1), _ = x(
32
+ () => o.document?.servers?.[l.value]
33
+ ), $ = x(() => o.document?.servers ?? []), B = [
32
34
  {
33
35
  label: "URL",
34
36
  key: "url",
@@ -40,98 +42,101 @@ const Y = { class: "flex flex-col gap-4" }, q = { class: "flex flex-col gap-4" }
40
42
  placeholder: "Production"
41
43
  }
42
44
  ], w = (t) => {
43
- n.value = t, v.show();
44
- }, p = () => {
45
- v.hide(), n.value = -1;
45
+ l.value = t, m.show();
46
+ }, b = () => {
47
+ m.hide(), l.value = -1;
46
48
  }, N = () => {
47
- n.value < 0 || (l.eventBus.emit("server:delete:server", { index: n.value }), p());
48
- }, { execute: h } = O({ delay: 328, maxWait: 1e3 }), U = (t, e, a) => h(
49
+ l.value < 0 || (o.eventBus.emit("server:delete:server", { index: l.value }), b());
50
+ }, { execute: h } = O({ delay: 328, maxWait: 1e3 }), U = (t, e, r) => h(
49
51
  `${t}-${e}`,
50
- () => l.eventBus.emit("server:update:server", {
52
+ () => o.eventBus.emit("server:update:server", {
51
53
  index: t,
52
- server: { [e]: a }
54
+ server: { [e]: r }
53
55
  })
54
- ), C = (t, e, a) => h(
56
+ ), C = (t, e, r) => h(
55
57
  `${t}-${e}`,
56
- () => l.eventBus.emit("server:update:variables", {
58
+ () => o.eventBus.emit("server:update:variables", {
57
59
  index: t,
58
60
  key: e,
59
- value: a
61
+ value: r
60
62
  })
61
- ), D = () => l.eventBus.emit("server:add:server"), b = (t, e = 0) => t?.description || `Server ${e + 1}`;
62
- return (t, e) => (c(), u(S, null, [
63
- s("div", Y, [
64
- e[1] || (e[1] = s("div", { class: "flex flex-col gap-2" }, [
65
- s("h3", { class: "font-bold" }, "Servers"),
66
- s("p", { class: "text-sm" }, [
67
- g(" Add different base URLs for your API. You can use "),
68
- s("code", { class: "font-code text-c-2" }, "{variables}"),
69
- g(" for dynamic parts. ")
63
+ ), D = () => o.eventBus.emit("server:add:server"), S = (t, e = 0) => t?.description || `Server ${e + 1}`;
64
+ return (t, e) => (n(), v(g, null, [
65
+ a(F, null, {
66
+ title: i(() => [...e[0] || (e[0] = [
67
+ p("Servers", -1)
68
+ ])]),
69
+ description: i(() => [...e[1] || (e[1] = [
70
+ p(" Add different base URLs for your API. You can use ", -1),
71
+ c("code", { class: "font-code text-c-2" }, "{variables}", -1),
72
+ p(" for dynamic parts. ", -1)
73
+ ])]),
74
+ default: i(() => [
75
+ c("div", q, [
76
+ (n(!0), v(g, null, A($.value, (r, d) => (n(), v("div", {
77
+ key: d,
78
+ class: "rounded-lg border"
79
+ }, [
80
+ c("div", G, [
81
+ r.description ? (n(), y(s(z), {
82
+ key: 0,
83
+ class: "self-center",
84
+ value: r.description
85
+ }, null, 8, ["value"])) : (n(), v("span", H, I(S(r, d)), 1)),
86
+ a(s(k), {
87
+ class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
88
+ "data-testid": "delete-server-button",
89
+ variant: "ghost",
90
+ onClick: (u) => w(d)
91
+ }, {
92
+ default: i(() => [
93
+ a(s(R), { class: "size-3.5" })
94
+ ]),
95
+ _: 1
96
+ }, 8, ["onClick"])
97
+ ]),
98
+ c("div", J, [
99
+ a(W, {
100
+ data: r,
101
+ environment: o.environment,
102
+ onUpdate: (u, f) => U(d, u, f),
103
+ options: B
104
+ }, null, 8, ["data", "environment", "onUpdate"]),
105
+ r.variables ? (n(), y(s(Y), {
106
+ key: 0,
107
+ variables: r.variables,
108
+ "onUpdate:variable": (u, f) => C(d, u, f)
109
+ }, null, 8, ["variables", "onUpdate:variable"])) : V("", !0)
110
+ ])
111
+ ]))), 128))
112
+ ]),
113
+ c("div", K, [
114
+ a(s(k), {
115
+ class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
116
+ size: "sm",
117
+ variant: "ghost",
118
+ onClick: D
119
+ }, {
120
+ default: i(() => [
121
+ a(s(j)),
122
+ e[2] || (e[2] = c("span", null, "Add Server", -1))
123
+ ]),
124
+ _: 1
125
+ })
70
126
  ])
71
- ], -1)),
72
- s("div", q, [
73
- (c(!0), u(S, null, I($.value, (a, d) => (c(), u("div", {
74
- key: d,
75
- class: "rounded-lg border"
76
- }, [
77
- s("div", G, [
78
- a.description ? (c(), y(r(z), {
79
- key: 0,
80
- class: "self-center",
81
- value: a.description
82
- }, null, 8, ["value"])) : (c(), u("span", H, T(b(a, d)), 1)),
83
- o(r(k), {
84
- class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
85
- "data-testid": "delete-server-button",
86
- variant: "ghost",
87
- onClick: (i) => w(d)
88
- }, {
89
- default: f(() => [
90
- o(r(R), { class: "size-3.5" })
91
- ]),
92
- _: 1
93
- }, 8, ["onClick"])
94
- ]),
95
- s("div", J, [
96
- o(F, {
97
- data: a,
98
- environment: l.environment,
99
- onUpdate: (i, m) => U(d, i, m),
100
- options: B
101
- }, null, 8, ["data", "environment", "onUpdate"]),
102
- a.variables ? (c(), y(r(W), {
103
- key: 0,
104
- variables: a.variables,
105
- "onUpdate:variable": (i, m) => C(d, i, m)
106
- }, null, 8, ["variables", "onUpdate:variable"])) : V("", !0)
107
- ])
108
- ]))), 128))
109
127
  ]),
110
- s("div", K, [
111
- o(r(k), {
112
- class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
113
- size: "sm",
114
- variant: "ghost",
115
- onClick: D
116
- }, {
117
- default: f(() => [
118
- o(r(j)),
119
- e[0] || (e[0] = s("span", null, "Add Server", -1))
120
- ]),
121
- _: 1
122
- })
123
- ])
124
- ]),
125
- o(r(L), {
128
+ _: 1
129
+ }),
130
+ a(s(L), {
126
131
  size: "xxs",
127
- state: r(v),
128
- title: `Delete ${b(_.value, n.value)}`
132
+ state: s(m),
133
+ title: `Delete ${S(_.value, l.value)}`
129
134
  }, {
130
- default: f(() => [
131
- o(E, {
135
+ default: i(() => [
136
+ a(E, {
132
137
  variableName: "Server",
133
138
  warningMessage: "Are you sure you want to delete this server? This action cannot be undone.",
134
- onClose: p,
139
+ onClose: b,
135
140
  onDelete: N
136
141
  })
137
142
  ]),
@@ -141,5 +146,5 @@ const Y = { class: "flex flex-col gap-4" }, q = { class: "flex flex-col gap-4" }
141
146
  }
142
147
  });
143
148
  export {
144
- re as default
149
+ oe as default
145
150
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Settings.vue"],"names":[],"mappings":"AA6KA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Settings.vue"],"names":[],"mappings":"AA0LA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
- import { defineComponent as u, createBlock as c, openBlock as a, unref as n } from "vue";
2
- import i from "../../settings/DocumentSettings.vue.js";
3
- import s from "../../settings/CollectionSettings.vue.js";
4
- const f = /* @__PURE__ */ u({
1
+ import { defineComponent as r, createBlock as c, openBlock as a, unref as n } from "vue";
2
+ import s from "../../settings/DocumentSettings.vue.js";
3
+ import i from "../../settings/CollectionSettings.vue.js";
4
+ const x = /* @__PURE__ */ r({
5
5
  __name: "Settings",
6
6
  props: {
7
7
  documentSlug: {},
@@ -16,37 +16,39 @@ const f = /* @__PURE__ */ u({
16
16
  workspaceStore: {},
17
17
  activeWorkspace: {},
18
18
  plugins: {},
19
+ customThemes: {},
19
20
  collectionType: {}
20
21
  },
21
22
  setup(e) {
22
- const d = (t) => {
23
+ const m = (t) => {
23
24
  e.eventBus.emit("document:update:watch-mode", t);
24
- }, m = (t) => {
25
+ }, u = (t) => {
25
26
  e.eventBus.emit("workspace:update:theme", t);
26
- }, r = (t) => {
27
- e.eventBus.emit("workspace:update:active-proxy", t);
28
27
  }, l = (t) => {
28
+ e.eventBus.emit("workspace:update:active-proxy", t);
29
+ }, d = (t) => {
29
30
  e.eventBus.emit("workspace:update:color-mode", t);
30
31
  };
31
- return (t, o) => e.collectionType === "document" ? (a(), c(n(i), {
32
+ return (t, o) => e.collectionType === "document" ? (a(), c(n(s), {
32
33
  key: 0,
33
34
  documentUrl: e.document?.["x-scalar-original-source-url"],
34
35
  isDraftDocument: e.documentSlug === "drafts",
35
36
  title: e.document?.info.title ?? "",
36
37
  watchMode: e.document?.["x-scalar-watch-mode"],
37
38
  "onDelete:document": o[0] || (o[0] = (h) => e.eventBus.emit("document:delete:document", { name: e.documentSlug })),
38
- "onUpdate:watchMode": d
39
- }, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (a(), c(n(s), {
39
+ "onUpdate:watchMode": m
40
+ }, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (a(), c(n(i), {
40
41
  key: 1,
41
42
  activeProxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"],
42
- activeThemeId: e.workspaceStore.workspace["x-scalar-theme"] ?? "default",
43
+ activeThemeSlug: e.workspaceStore.workspace["x-scalar-theme"] ?? "none",
43
44
  colorMode: e.workspaceStore.workspace["x-scalar-color-mode"] ?? "system",
44
- "onUpdate:colorMode": l,
45
- "onUpdate:proxyUrl": r,
46
- "onUpdate:themeId": m
47
- }, null, 8, ["activeProxyUrl", "activeThemeId", "colorMode"]));
45
+ customThemes: e.customThemes,
46
+ "onUpdate:colorMode": d,
47
+ "onUpdate:proxyUrl": l,
48
+ "onUpdate:themeSlug": u
49
+ }, null, 8, ["activeProxyUrl", "activeThemeSlug", "colorMode", "customThemes"]));
48
50
  }
49
51
  });
50
52
  export {
51
- f as default
53
+ x as default
52
54
  };
@@ -1,4 +1,5 @@
1
1
  import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
3
  /**
3
4
  * Command Palette Example Component
4
5
  *
@@ -18,8 +19,10 @@ export default _default;
18
19
  declare const __VLS_export: import("vue").DefineComponent<{
19
20
  /** The workspace store for accessing documents and operations */
20
21
  workspaceStore: WorkspaceStore;
22
+ /** Event bus for emitting operation creation events */
23
+ eventBus: WorkspaceEventBus;
21
24
  /** Document id to create the example for */
22
- documentId?: string;
25
+ documentName?: string;
23
26
  /** Preselected path and method to create the example for */
24
27
  operationId?: string;
25
28
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
@@ -28,8 +31,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
28
31
  }, string, import("vue").PublicProps, Readonly<{
29
32
  /** The workspace store for accessing documents and operations */
30
33
  workspaceStore: WorkspaceStore;
34
+ /** Event bus for emitting operation creation events */
35
+ eventBus: WorkspaceEventBus;
31
36
  /** Document id to create the example for */
32
- documentId?: string;
37
+ documentName?: string;
33
38
  /** Preselected path and method to create the example for */
34
39
  operationId?: string;
35
40
  }> & Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteExample.vue"],"names":[],"mappings":"AAqSA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAcpE;;;;;;;;;;;;;GAaG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAEhB,iEAAiE;oBACjD,cAAc;IAC9B,4CAA4C;iBAC/B,MAAM;IACnB,4DAA4D;kBAC9C,MAAM;;;;;IALpB,iEAAiE;oBACjD,cAAc;IAC9B,4CAA4C;iBAC/B,MAAM;IACnB,4DAA4D;kBAC9C,MAAM;;;;kFA4clB,CAAC"}
1
+ {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteExample.vue"],"names":[],"mappings":"AAoSA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAavE;;;;;;;;;;;;;GAaG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAEhB,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,4CAA4C;mBAC7B,MAAM;IACrB,4DAA4D;kBAC9C,MAAM;;;;;IAPpB,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,4CAA4C;mBAC7B,MAAM;IACrB,4DAA4D;kBAC9C,MAAM;;;;kFAyclB,CAAC"}
@@ -1,103 +1,102 @@
1
- import { defineComponent as B, ref as h, computed as p, watch as O, createBlock as x, openBlock as u, withCtx as n, createVNode as i, createTextVNode as j, createElementVNode as m, unref as c, normalizeClass as z, toDisplayString as b, createElementBlock as w, createCommentVNode as U, Fragment as L, renderList as R } from "vue";
2
- import { ScalarListbox as T, ScalarButton as _, ScalarIcon as I, ScalarDropdown as A, ScalarDropdownItem as F } from "@scalar/components";
3
- import { useRouter as P } from "vue-router";
4
- import y from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
5
- import q from "./CommandActionForm.vue.js";
6
- import G from "./CommandActionInput.vue.js";
7
- const H = { class: "flex flex-1 gap-1" }, J = {
1
+ import { defineComponent as I, ref as h, computed as p, watch as $, createBlock as x, openBlock as u, withCtx as s, createVNode as i, createTextVNode as O, createElementVNode as r, unref as c, normalizeClass as j, toDisplayString as b, createElementBlock as w, createCommentVNode as z, Fragment as U, renderList as L } from "vue";
2
+ import { ScalarListbox as T, ScalarButton as C, ScalarIcon as y, ScalarDropdown as A, ScalarDropdownItem as F } from "@scalar/components";
3
+ import D from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
4
+ import P from "./CommandActionForm.vue.js";
5
+ import q from "./CommandActionInput.vue.js";
6
+ const G = { class: "flex flex-1 gap-1" }, H = {
8
7
  key: 0,
9
8
  class: "text-c-1 truncate"
10
- }, K = {
9
+ }, J = {
11
10
  key: 1,
12
11
  class: "text-c-3"
13
- }, M = { class: "flex items-center gap-2" }, Q = { class: "custom-scroll max-h-40" }, W = { class: "truncate" }, X = {
12
+ }, K = { class: "flex items-center gap-2" }, M = { class: "custom-scroll max-h-40" }, Q = { class: "truncate" }, R = {
14
13
  name: "CommandPaletteExample"
15
- }, oe = /* @__PURE__ */ B({
16
- ...X,
14
+ }, te = /* @__PURE__ */ I({
15
+ ...R,
17
16
  props: {
18
17
  workspaceStore: {},
19
- documentId: {},
18
+ eventBus: {},
19
+ documentName: {},
20
20
  operationId: {}
21
21
  },
22
22
  emits: ["close", "back"],
23
- setup(s, { emit: D }) {
24
- const k = D, V = P(), v = h(""), g = p(() => v.value.trim()), f = p(
25
- () => Object.entries(s.workspaceStore.workspace.documents).map(
23
+ setup(n, { emit: V }) {
24
+ const k = V, v = h(""), g = p(() => v.value.trim()), f = p(
25
+ () => Object.entries(n.workspaceStore.workspace.documents).map(
26
26
  ([e, a]) => ({
27
27
  id: e,
28
28
  label: a.info.title || e
29
29
  })
30
30
  )
31
31
  ), l = h(
32
- s.documentId ? f.value.find((e) => e.id === s.documentId) : f.value[0] ?? void 0
33
- ), S = (e) => {
32
+ n.documentName ? f.value.find((e) => e.id === n.documentName) : f.value[0] ?? void 0
33
+ ), N = (e) => {
34
34
  const a = [];
35
35
  for (const t of e)
36
- t.type === "operation" && a.push(t), "children" in t && t.children && a.push(...S(t.children));
36
+ t.type === "operation" && a.push(t), "children" in t && t.children && a.push(...N(t.children));
37
37
  return a;
38
- }, r = p(() => {
38
+ }, m = p(() => {
39
39
  if (!l.value)
40
40
  return [];
41
- const e = s.workspaceStore.workspace.documents[l.value.id];
41
+ const e = n.workspaceStore.workspace.documents[l.value.id];
42
42
  if (!e || !e["x-scalar-navigation"])
43
43
  return [];
44
44
  const a = e["x-scalar-navigation"];
45
- return S(a.children ?? []).map((d) => ({
45
+ return N(a.children ?? []).map((d) => ({
46
46
  id: d.id,
47
47
  label: `${d.method.toUpperCase()} ${d.path}`,
48
48
  path: d.path,
49
49
  method: d.method
50
50
  }));
51
51
  }), o = h(
52
- s.operationId ? r.value.find(
53
- (e) => e.id === s.operationId
52
+ n.operationId ? m.value.find(
53
+ (e) => e.id === n.operationId
54
54
  ) : void 0
55
55
  );
56
- O(
56
+ $(
57
57
  l,
58
58
  () => {
59
- o.value = s.operationId ? r.value.find(
60
- (e) => e.id === s.operationId
61
- ) : r.value[0] ?? void 0;
59
+ o.value = n.operationId ? m.value.find(
60
+ (e) => e.id === n.operationId
61
+ ) : m.value[0] ?? void 0;
62
62
  },
63
63
  { immediate: !0 }
64
64
  );
65
- const N = (e) => {
65
+ const _ = (e) => {
66
66
  e && (o.value = e);
67
- }, C = p(() => !g.value || !l.value || !o.value), E = () => {
68
- C.value || !l.value || !o.value || (V.push({
69
- name: "example",
70
- params: {
71
- documentSlug: l.value.id,
72
- pathEncoded: encodeURIComponent(o.value.path),
73
- method: o.value.method,
74
- exampleName: g.value
75
- }
67
+ }, S = p(() => !g.value || !l.value || !o.value), B = () => {
68
+ S.value || !l.value || !o.value || (n.eventBus.emit("operation:create:draft-example", {
69
+ documentName: l.value.id,
70
+ meta: {
71
+ path: o.value.path,
72
+ method: o.value.method
73
+ },
74
+ exampleName: g.value
76
75
  }), k("close"));
77
- }, $ = (e) => {
76
+ }, E = (e) => {
78
77
  k("back", e);
79
78
  };
80
- return (e, a) => (u(), x(q, {
81
- disabled: C.value,
82
- onSubmit: E
79
+ return (e, a) => (u(), x(P, {
80
+ disabled: S.value,
81
+ onSubmit: B
83
82
  }, {
84
- options: n(() => [
85
- m("div", H, [
83
+ options: s(() => [
84
+ r("div", G, [
86
85
  i(c(T), {
87
86
  modelValue: l.value,
88
87
  "onUpdate:modelValue": a[1] || (a[1] = (t) => l.value = t),
89
88
  options: f.value
90
89
  }, {
91
- default: n(() => [
92
- i(c(_), {
90
+ default: s(() => [
91
+ i(c(C), {
93
92
  class: "hover:bg-b-2 max-h-8 w-[150px] min-w-[150px] justify-between gap-1 p-2 text-xs",
94
93
  variant: "outlined"
95
94
  }, {
96
- default: n(() => [
97
- m("span", {
98
- class: z(l.value ? "text-c-1 truncate" : "text-c-3")
95
+ default: s(() => [
96
+ r("span", {
97
+ class: j(l.value ? "text-c-1 truncate" : "text-c-3")
99
98
  }, b(l.value ? l.value.label : "Select Document"), 3),
100
- i(c(I), {
99
+ i(c(y), {
101
100
  class: "text-c-3",
102
101
  icon: "ChevronDown",
103
102
  size: "md"
@@ -112,16 +111,16 @@ const H = { class: "flex flex-1 gap-1" }, J = {
112
111
  placement: "bottom",
113
112
  resize: ""
114
113
  }, {
115
- items: n(() => [
116
- m("div", Q, [
117
- (u(!0), w(L, null, R(r.value, (t) => (u(), x(c(F), {
114
+ items: s(() => [
115
+ r("div", M, [
116
+ (u(!0), w(U, null, L(m.value, (t) => (u(), x(c(F), {
118
117
  key: t.id,
119
118
  class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
120
- onClick: (d) => N(t)
119
+ onClick: (d) => _(t)
121
120
  }, {
122
- default: n(() => [
123
- m("span", W, b(t.path), 1),
124
- i(y, {
121
+ default: s(() => [
122
+ r("span", Q, b(t.path), 1),
123
+ i(D, {
125
124
  method: t.method
126
125
  }, null, 8, ["method"])
127
126
  ]),
@@ -129,20 +128,20 @@ const H = { class: "flex flex-1 gap-1" }, J = {
129
128
  }, 1032, ["onClick"]))), 128))
130
129
  ])
131
130
  ]),
132
- default: n(() => [
133
- i(c(_), {
131
+ default: s(() => [
132
+ i(c(C), {
134
133
  class: "hover:bg-b-2 max-h-8 w-full justify-between gap-1 p-2 text-xs",
135
- disabled: !r.value.length,
134
+ disabled: !m.value.length,
136
135
  variant: "outlined"
137
136
  }, {
138
- default: n(() => [
139
- o.value ? (u(), w("span", J, b(o.value.path), 1)) : (u(), w("span", K, " Select Operation ")),
140
- m("div", M, [
141
- o.value ? (u(), x(y, {
137
+ default: s(() => [
138
+ o.value ? (u(), w("span", H, b(o.value.path), 1)) : (u(), w("span", J, " Select Operation ")),
139
+ r("div", K, [
140
+ o.value ? (u(), x(D, {
142
141
  key: 0,
143
142
  method: o.value.method
144
- }, null, 8, ["method"])) : U("", !0),
145
- i(c(I), {
143
+ }, null, 8, ["method"])) : z("", !0),
144
+ i(c(y), {
146
145
  class: "text-c-3",
147
146
  icon: "ChevronDown",
148
147
  size: "md"
@@ -156,16 +155,16 @@ const H = { class: "flex flex-1 gap-1" }, J = {
156
155
  })
157
156
  ])
158
157
  ]),
159
- submit: n(() => [...a[2] || (a[2] = [
160
- j("Create Example", -1)
158
+ submit: s(() => [...a[2] || (a[2] = [
159
+ O("Create Example", -1)
161
160
  ])]),
162
- default: n(() => [
163
- i(G, {
161
+ default: s(() => [
162
+ i(q, {
164
163
  modelValue: v.value,
165
164
  "onUpdate:modelValue": a[0] || (a[0] = (t) => v.value = t),
166
165
  label: "Example Name",
167
166
  placeholder: "Example Name",
168
- onDelete: $
167
+ onDelete: E
169
168
  }, null, 8, ["modelValue"])
170
169
  ]),
171
170
  _: 1
@@ -173,5 +172,5 @@ const H = { class: "flex flex-1 gap-1" }, J = {
173
172
  }
174
173
  });
175
174
  export {
176
- oe as default
175
+ te as default
177
176
  };
@@ -1,14 +1,14 @@
1
1
  import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
2
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
3
  /**
4
- * Command Palette Document Component
4
+ * Command Palette OpenAPI Document Component
5
5
  *
6
6
  * Provides a form for creating a new empty document in the workspace.
7
7
  * Users can name the document and select an icon before creation.
8
8
  * Validates that the name is not empty and not already in use.
9
9
  *
10
10
  * @example
11
- * <CommandPaletteDocument
11
+ * <CommandPaletteOpenApiDocument
12
12
  * :workspaceStore="workspaceStore"
13
13
  * :eventBus="eventBus"
14
14
  * @close="handleClose"
@@ -34,4 +34,4 @@ declare const __VLS_export: import("vue").DefineComponent<{
34
34
  onClose?: (() => any) | undefined;
35
35
  onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
36
36
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
- //# sourceMappingURL=CommandPaletteDocument.vue.d.ts.map
37
+ //# sourceMappingURL=CommandPaletteOpenApiDocument.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPaletteOpenApiDocument.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue"],"names":[],"mappings":"AAwIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAUvE;;;;;;;;;;;;;;GAcG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEhB,2DAA2D;oBAC3C,cAAc;IAC9B,sDAAsD;cAC5C,iBAAiB;;;;;IAH3B,2DAA2D;oBAC3C,cAAc;IAC9B,sDAAsD;cAC5C,iBAAiB;;;;kFAwMzB,CAAC"}