@scalar/api-client 2.27.1 → 2.29.2

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 (87) hide show
  1. package/CHANGELOG.md +166 -0
  2. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  3. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
  4. package/dist/libs/local-storage.js +3 -3
  5. package/dist/style.css +1 -1
  6. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  7. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +21 -21
  8. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  9. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  10. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +67 -75
  11. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -0
  12. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  13. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +2 -0
  14. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  15. package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts +1 -1
  16. package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -1
  17. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +20 -19
  18. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +2 -0
  19. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  20. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +42 -40
  21. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  22. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +5 -5
  23. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +3 -1
  24. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  25. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +35 -35
  26. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  27. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  28. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  29. package/dist/v2/components/sidebar/Sidebar.vue.js +1 -1
  30. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  31. package/dist/v2/features/app/App.vue.js +70 -70
  32. package/dist/v2/features/app/app-events.d.ts +2 -1
  33. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  34. package/dist/v2/features/app/app-events.js +89 -64
  35. package/dist/v2/features/app/app-state.d.ts +4 -2
  36. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  37. package/dist/v2/features/app/app-state.js +185 -156
  38. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  39. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  40. package/dist/v2/features/app/components/AppSidebar.vue2.js +48 -47
  41. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  42. package/dist/v2/features/app/components/DesktopTabs.vue.js +4 -4
  43. package/dist/v2/features/app/components/DownloadAppButton.vue.d.ts.map +1 -1
  44. package/dist/v2/features/app/components/DownloadAppButton.vue.js +1 -1
  45. package/dist/v2/features/app/components/DownloadAppButton.vue2.js +9 -9
  46. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
  47. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +71 -43
  48. package/dist/v2/features/app/helpers/routes.js +11 -11
  49. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts +1 -6
  50. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
  51. package/dist/v2/features/collection/WorkspaceCollection.vue.js +38 -20
  52. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  53. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  54. package/dist/v2/features/collection/components/Authentication.vue2.js +20 -16
  55. package/dist/v2/features/collection/components/LabelInput.vue.d.ts +3 -0
  56. package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
  57. package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
  58. package/dist/v2/features/collection/components/LabelInput.vue2.js +20 -16
  59. package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
  60. package/dist/v2/features/collection/components/Settings.vue.js +18 -14
  61. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +7 -2
  62. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
  63. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +70 -71
  64. package/dist/v2/features/command-palette/components/{CommandPaletteDocument.vue.d.ts → CommandPaletteOpenApiDocument.vue.d.ts} +3 -3
  65. package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.d.ts.map +1 -0
  66. package/dist/v2/features/command-palette/components/{CommandPaletteDocument.vue.js → CommandPaletteOpenApiDocument.vue.js} +15 -15
  67. package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue2.js +4 -0
  68. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +2 -2
  69. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -1
  70. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +10 -10
  71. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +27 -5
  72. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -1
  73. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +80 -53
  74. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +34 -9
  75. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  76. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +50 -44
  77. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  78. package/dist/v2/features/operation/Operation.vue.js +19 -15
  79. package/dist/v2/helpers/get-active-proxy-url.d.ts +18 -0
  80. package/dist/v2/helpers/get-active-proxy-url.d.ts.map +1 -0
  81. package/dist/v2/helpers/get-active-proxy-url.js +5 -0
  82. package/dist/v2/workspace-events.d.ts.map +1 -1
  83. package/dist/v2/workspace-events.js +123 -113
  84. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  85. package/package.json +18 -18
  86. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.d.ts.map +0 -1
  87. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue2.js +0 -4
@@ -1,9 +1,9 @@
1
- import { defineComponent as a, createElementBlock as l, openBlock as r, createElementVNode as e, createVNode as o, unref as s, toDisplayString as i, mergeProps as n } from "vue";
2
- import { ScalarIconGlobe as m } from "@scalar/icons";
3
- import { RouterView as p } from "vue-router";
4
- import u from "./components/Tabs.vue.js";
5
- const d = { class: "custom-scroll h-full" }, _ = { class: "w-full md:mx-auto md:max-w-180" }, f = ["aria-label"], h = { class: "group relative ml-1.25" }, x = { class: "text-c-1 flex h-8 items-center" }, v = { class: "px-1.5 py-8" }, k = {}, B = /* @__PURE__ */ a({
6
- ...k,
1
+ import { defineComponent as m, ref as p, watch as i, createElementBlock as u, openBlock as d, createElementVNode as a, createVNode as l, unref as f, mergeProps as v } from "vue";
2
+ import { RouterView as _ } from "vue-router";
3
+ import k from "./components/LabelInput.vue.js";
4
+ import w from "./components/Tabs.vue.js";
5
+ const h = { class: "custom-scroll h-full" }, x = { class: "w-full md:mx-auto md:max-w-180" }, b = ["aria-label"], W = { class: "group relative ml-1.25" }, V = { class: "px-1.5 py-8" }, g = {}, S = /* @__PURE__ */ m({
6
+ ...g,
7
7
  __name: "WorkspaceCollection",
8
8
  props: {
9
9
  documentSlug: {},
@@ -20,27 +20,45 @@ const d = { class: "custom-scroll h-full" }, _ = { class: "w-full md:mx-auto md:
20
20
  plugins: {},
21
21
  customThemes: {}
22
22
  },
23
- setup(t) {
24
- const c = t;
25
- return (w, b) => (r(), l("div", d, [
26
- e("div", _, [
27
- e("div", {
28
- "aria-label": `title: ${t.activeWorkspace.label}`,
23
+ setup(s) {
24
+ const e = s, o = p(e.activeWorkspace.label);
25
+ i(
26
+ () => e.activeWorkspace.label,
27
+ (t) => {
28
+ o.value = t;
29
+ }
30
+ );
31
+ const r = (t) => {
32
+ if (t.trim() === "") {
33
+ o.value = e.activeWorkspace.label;
34
+ return;
35
+ }
36
+ e.eventBus.emit("workspace:update:name", t);
37
+ };
38
+ return (t, c) => (d(), u("div", h, [
39
+ a("div", x, [
40
+ a("div", {
41
+ "aria-label": `title: ${s.activeWorkspace.label}`,
29
42
  class: "mx-auto flex h-fit w-full flex-row items-center gap-2 pt-8 pb-3 md:max-w-180"
30
43
  }, [
31
- o(s(m), { class: "text-c-2 size-6" }),
32
- e("div", h, [
33
- e("span", x, i(t.activeWorkspace.label), 1)
44
+ a("div", W, [
45
+ l(k, {
46
+ modelValue: o.value,
47
+ "onUpdate:modelValue": c[0] || (c[0] = (n) => o.value = n),
48
+ class: "text-xl font-bold",
49
+ inputId: "workspaceName",
50
+ onBlur: r
51
+ }, null, 8, ["modelValue"])
34
52
  ])
35
- ], 8, f),
36
- o(u, { type: "workspace" }),
37
- e("div", v, [
38
- o(s(p), n(c, { collectionType: "workspace" }), null, 16)
53
+ ], 8, b),
54
+ l(w, { type: "workspace" }),
55
+ a("div", V, [
56
+ l(f(_), v(e, { collectionType: "workspace" }), null, 16)
39
57
  ])
40
58
  ])
41
59
  ]));
42
60
  }
43
61
  });
44
62
  export {
45
- B as default
63
+ S as default
46
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":"AA2OA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":"AA6PA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
1
  import t from "./Authentication.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-9d8e1c09"]]);
4
+ const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-ac90d255"]]);
5
5
  export {
6
- e as default
6
+ i as default
7
7
  };
@@ -1,8 +1,9 @@
1
- import { defineComponent as d, computed as c, createBlock as v, openBlock as y, withCtx as n, createElementVNode as i, normalizeClass as a, createVNode as s, unref as r, createTextVNode as u } from "vue";
1
+ import { defineComponent as d, computed as i, createBlock as v, openBlock as y, withCtx as n, createElementVNode as a, normalizeClass as r, createVNode as s, unref as l, createTextVNode as u } from "vue";
2
2
  import { ScalarToggle as h } from "@scalar/components";
3
- import p from "../../settings/components/Section.vue.js";
4
- import S from "../../../blocks/scalar-auth-selector-block/components/AuthSelector.vue.js";
5
- const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
3
+ import f from "../../settings/components/Section.vue.js";
4
+ import { getActiveProxyUrl as S } from "../../../helpers/get-active-proxy-url.js";
5
+ import p from "../../../blocks/scalar-auth-selector-block/components/AuthSelector.vue.js";
6
+ const x = { class: "flex h-8 items-center" }, V = /* @__PURE__ */ d({
6
7
  __name: "Authentication",
7
8
  props: {
8
9
  documentSlug: {},
@@ -21,14 +22,14 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
21
22
  collectionType: {}
22
23
  },
23
24
  setup(e) {
24
- const o = c(
25
+ const o = i(
25
26
  () => e.document?.["x-scalar-set-operation-security"] ?? !1
26
- ), m = c(
27
+ ), m = i(
27
28
  () => e.document?.servers?.find(
28
- ({ url: l }) => l === e.document?.["x-scalar-selected-server"]
29
+ ({ url: c }) => c === e.document?.["x-scalar-selected-server"]
29
30
  ) ?? null
30
31
  );
31
- return (l, t) => (y(), v(p, null, {
32
+ return (c, t) => (y(), v(f, null, {
32
33
  title: n(() => [...t[1] || (t[1] = [
33
34
  u("Authentication", -1)
34
35
  ])]),
@@ -36,8 +37,8 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
36
37
  u(" If enabled, all selected authentication will apply to all operations in this document. You can override this by disabling the toggle and authentication will then be applied at the operation level. ", -1)
37
38
  ])]),
38
39
  actions: n(() => [
39
- i("div", f, [
40
- s(r(h), {
40
+ a("div", x, [
41
+ s(l(h), {
41
42
  class: "w-4",
42
43
  modelValue: o.value,
43
44
  "onUpdate:modelValue": t[0] || (t[0] = () => e.eventBus.emit("document:toggle:security"))
@@ -45,11 +46,11 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
45
46
  ])
46
47
  ]),
47
48
  default: n(() => [
48
- i("div", {
49
- class: a(!o.value && "cursor-not-allowed")
49
+ a("div", {
50
+ class: r(!o.value && "cursor-not-allowed")
50
51
  }, [
51
- s(r(S), {
52
- class: a([
52
+ s(l(p), {
53
+ class: r([
53
54
  "scalar-collection-auth border-none!",
54
55
  !o.value && "pointer-events-none opacity-50 mix-blend-luminosity"
55
56
  ]),
@@ -57,7 +58,10 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
57
58
  eventBus: e.eventBus,
58
59
  isStatic: "",
59
60
  meta: { type: "document" },
60
- proxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"] ?? "",
61
+ proxyUrl: l(S)(
62
+ e.workspaceStore.workspace["x-scalar-active-proxy"],
63
+ e.layout
64
+ ) ?? "",
61
65
  securityRequirements: e.document?.security ?? [],
62
66
  securitySchemes: e.securitySchemes,
63
67
  selectedSecurity: e.workspaceStore.auth.getAuthSelectedSchemas({
@@ -74,5 +78,5 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
74
78
  }
75
79
  });
76
80
  export {
77
- B as default
81
+ V as default
78
82
  };
@@ -3,8 +3,11 @@ type __VLS_ModelProps = {
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
5
  "update:modelValue": (value: string) => any;
6
+ } & {
7
+ blur: (value: string) => any;
6
8
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
7
9
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
10
+ onBlur?: ((value: string) => any) | undefined;
8
11
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
12
  declare const _default: typeof __VLS_export;
10
13
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"LabelInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/LabelInput.vue"],"names":[],"mappings":"AA+CA,KAAK,gBAAgB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;CAClB,CAAC;AAyEF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"LabelInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/LabelInput.vue"],"names":[],"mappings":"AAgEA,KAAK,gBAAgB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;CAClB,CAAC;AAgFF,QAAA,MAAM,YAAY;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./LabelInput.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5a23cb87"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9a6458fc"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -1,29 +1,33 @@
1
- import { defineComponent as r, useModel as i, useId as d, createElementBlock as a, openBlock as p, createElementVNode as o, withDirectives as c, unref as n, vModelText as m } from "vue";
2
- const f = { class: "group pointer-events-none flex flex-1 items-center gap-1" }, v = ["for"], _ = ["id"], V = /* @__PURE__ */ r({
1
+ import { defineComponent as a, mergeModels as m, useModel as p, useId as c, createElementBlock as f, openBlock as v, createElementVNode as n, withDirectives as h, unref as u, withKeys as x, vModelText as _ } from "vue";
2
+ const b = { class: "group pointer-events-none flex flex-1 items-center gap-1" }, g = ["for"], w = ["id"], M = /* @__PURE__ */ a({
3
3
  __name: "LabelInput",
4
4
  props: {
5
5
  modelValue: { required: !0 },
6
6
  modelModifiers: {}
7
7
  },
8
- emits: ["update:modelValue"],
9
- setup(u) {
10
- const e = i(u, "modelValue"), t = d();
11
- return (h, l) => (p(), a("div", f, [
12
- o("label", {
8
+ emits: /* @__PURE__ */ m(["blur"], ["update:modelValue"]),
9
+ setup(r, { emit: s }) {
10
+ const i = s, t = p(r, "modelValue"), o = c(), d = () => {
11
+ i("blur", t.value);
12
+ };
13
+ return (V, e) => (v(), f("div", b, [
14
+ n("label", {
13
15
  class: "pointer-events-auto absolute top-0 left-0 h-full w-full cursor-text opacity-0",
14
- for: n(t)
15
- }, null, 8, v),
16
- c(o("input", {
17
- id: n(t),
18
- "onUpdate:modelValue": l[0] || (l[0] = (s) => e.value = s),
16
+ for: u(o)
17
+ }, null, 8, g),
18
+ h(n("input", {
19
+ id: u(o),
20
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => t.value = l),
19
21
  class: "text-c-1 group-hover-input pointer-events-auto relative z-10 -ml-0.5 h-8 w-full flex-1 rounded pl-1.25 has-[:focus-visible]:outline md:-ml-1.25",
20
- placeholder: "Untitled Document"
21
- }, null, 8, _), [
22
- [m, e.value]
22
+ placeholder: "Untitled Document",
23
+ onBlur: d,
24
+ onKeydown: e[1] || (e[1] = x((l) => l.target?.blur(), ["enter"]))
25
+ }, null, 40, w), [
26
+ [_, t.value]
23
27
  ])
24
28
  ]));
25
29
  }
26
30
  });
27
31
  export {
28
- V as default
32
+ M as default
29
33
  };
@@ -1 +1 @@
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
+ {"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Settings.vue"],"names":[],"mappings":"AA8MA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,8 @@
1
- import { defineComponent as r, createBlock as c, openBlock as a, unref as n } from "vue";
1
+ import { defineComponent as d, createBlock as a, openBlock as n, unref as o } from "vue";
2
+ import { getActiveProxyUrl as i } from "../../../helpers/get-active-proxy-url.js";
2
3
  import s from "../../settings/DocumentSettings.vue.js";
3
- import i from "../../settings/CollectionSettings.vue.js";
4
- const x = /* @__PURE__ */ r({
4
+ import h from "../../settings/CollectionSettings.vue.js";
5
+ const f = /* @__PURE__ */ d({
5
6
  __name: "Settings",
6
7
  props: {
7
8
  documentSlug: {},
@@ -22,33 +23,36 @@ const x = /* @__PURE__ */ r({
22
23
  setup(e) {
23
24
  const m = (t) => {
24
25
  e.eventBus.emit("document:update:watch-mode", t);
25
- }, u = (t) => {
26
- e.eventBus.emit("workspace:update:theme", t);
27
26
  }, l = (t) => {
27
+ e.eventBus.emit("workspace:update:theme", t);
28
+ }, u = (t) => {
28
29
  e.eventBus.emit("workspace:update:active-proxy", t);
29
- }, d = (t) => {
30
+ }, r = (t) => {
30
31
  e.eventBus.emit("workspace:update:color-mode", t);
31
32
  };
32
- return (t, o) => e.collectionType === "document" ? (a(), c(n(s), {
33
+ return (t, c) => e.collectionType === "document" ? (n(), a(o(s), {
33
34
  key: 0,
34
35
  documentUrl: e.document?.["x-scalar-original-source-url"],
35
36
  isDraftDocument: e.documentSlug === "drafts",
36
37
  title: e.document?.info.title ?? "",
37
38
  watchMode: e.document?.["x-scalar-watch-mode"],
38
- "onDelete:document": o[0] || (o[0] = (h) => e.eventBus.emit("document:delete:document", { name: e.documentSlug })),
39
+ "onDelete:document": c[0] || (c[0] = (v) => e.eventBus.emit("document:delete:document", { name: e.documentSlug })),
39
40
  "onUpdate:watchMode": m
40
- }, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (a(), c(n(i), {
41
+ }, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (n(), a(o(h), {
41
42
  key: 1,
42
- activeProxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"],
43
+ activeProxyUrl: o(i)(
44
+ e.workspaceStore.workspace["x-scalar-active-proxy"],
45
+ e.layout
46
+ ),
43
47
  activeThemeSlug: e.workspaceStore.workspace["x-scalar-theme"] ?? "none",
44
48
  colorMode: e.workspaceStore.workspace["x-scalar-color-mode"] ?? "system",
45
49
  customThemes: e.customThemes,
46
- "onUpdate:colorMode": d,
47
- "onUpdate:proxyUrl": l,
48
- "onUpdate:themeSlug": u
50
+ "onUpdate:colorMode": r,
51
+ "onUpdate:proxyUrl": u,
52
+ "onUpdate:themeSlug": l
49
53
  }, null, 8, ["activeProxyUrl", "activeThemeSlug", "colorMode", "customThemes"]));
50
54
  }
51
55
  });
52
56
  export {
53
- x as default
57
+ f as default
54
58
  };
@@ -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"}