@scalar/api-client 2.14.0 → 2.15.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 (79) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/libs/string-template.d.ts +2 -0
  3. package/dist/libs/string-template.d.ts.map +1 -1
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +28 -51
  7. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +0 -12
  8. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  9. package/dist/v2/blocks/operation-block/components/Header.vue.js +3 -3
  10. package/dist/v2/blocks/operation-block/components/Header.vue2.js +26 -28
  11. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +33 -0
  12. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -0
  13. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +18 -0
  14. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -0
  15. package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts +7 -0
  16. package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts.map +1 -0
  17. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts +8 -0
  18. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts.map +1 -0
  19. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +4 -0
  20. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -0
  21. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  22. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  23. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +134 -125
  24. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +2 -0
  25. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  26. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  27. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +11 -10
  28. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +2 -2
  29. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -4
  31. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  32. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  33. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +2 -2
  34. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  35. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +10 -10
  36. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +1 -1
  37. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
  38. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +21 -15
  39. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +4 -13
  40. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  41. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  42. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +106 -70
  43. package/dist/v2/components/code-input/CodeInput.vue.d.ts +10 -1
  44. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  45. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  46. package/dist/v2/components/code-input/CodeInput.vue2.js +65 -51
  47. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +4 -0
  48. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  49. package/dist/v2/components/sidebar/Sidebar.vue.js +42 -39
  50. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  51. package/dist/v2/features/app/App.vue.js +64 -66
  52. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  53. package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
  54. package/dist/v2/features/app/components/AppSidebar.vue2.js +193 -106
  55. package/dist/v2/features/app/components/ItemDecorator.vue.d.ts +22 -0
  56. package/dist/v2/features/app/components/ItemDecorator.vue.d.ts.map +1 -0
  57. package/dist/v2/features/app/components/ItemDecorator.vue.js +138 -0
  58. package/dist/v2/features/app/components/ItemDecorator.vue2.js +4 -0
  59. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +8 -0
  60. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
  61. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +76 -68
  62. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +8 -0
  63. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -1
  64. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +83 -75
  65. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +4 -0
  66. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -1
  67. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +32 -34
  68. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +16 -0
  69. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  70. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +24 -21
  71. package/dist/v2/features/operation/Operation.vue.js +1 -1
  72. package/dist/v2/features/settings/DocumentSettings.vue.js +2 -2
  73. package/dist/v2/features/settings/DocumentSettings.vue2.js +1 -1
  74. package/dist/v2/helpers/storage.d.ts.map +1 -1
  75. package/dist/v2/helpers/storage.js +5 -5
  76. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +1 -1
  77. package/dist/v2/hooks/use-workspace-client-events.js +102 -61
  78. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  79. package/package.json +21 -21
@@ -1,7 +1,7 @@
1
- import { defineComponent as O, ref as v, computed as m, watch as j, createBlock as f, openBlock as u, withCtx as n, createVNode as s, createTextVNode as z, createElementVNode as i, unref as c, normalizeClass as U, toDisplayString as h, createElementBlock as x, createCommentVNode as I, Fragment as L, renderList as R } from "vue";
2
- import { ScalarListbox as T, ScalarButton as C, ScalarIcon as y, ScalarDropdown as A, ScalarDropdownItem as F } from "@scalar/components";
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
3
  import { useRouter as P } from "vue-router";
4
- import D from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
4
+ import y from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
5
5
  import q from "./CommandActionForm.vue.js";
6
6
  import G from "./CommandActionInput.vue.js";
7
7
  const H = { class: "flex flex-1 gap-1" }, J = {
@@ -12,84 +12,92 @@ const H = { class: "flex flex-1 gap-1" }, J = {
12
12
  class: "text-c-3"
13
13
  }, M = { class: "flex items-center gap-2" }, Q = { class: "custom-scroll max-h-40" }, W = { class: "truncate" }, X = {
14
14
  name: "CommandPaletteExample"
15
- }, oe = /* @__PURE__ */ O({
15
+ }, oe = /* @__PURE__ */ B({
16
16
  ...X,
17
17
  props: {
18
- workspaceStore: {}
18
+ workspaceStore: {},
19
+ documentId: {},
20
+ operationId: {}
19
21
  },
20
22
  emits: ["close", "back"],
21
- setup(b, { emit: V }) {
22
- const _ = V, N = P(), d = v(""), w = m(() => d.value.trim()), k = m(
23
- () => Object.entries(b.workspaceStore.workspace.documents).map(
24
- ([t, a]) => ({
25
- id: t,
26
- label: a.info.title || t
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(
26
+ ([e, a]) => ({
27
+ id: e,
28
+ label: a.info.title || e
27
29
  })
28
30
  )
29
- ), l = v(
30
- k.value[0] ?? void 0
31
- ), o = v(void 0), g = (t) => {
31
+ ), l = h(
32
+ s.documentId ? f.value.find((e) => e.id === s.documentId) : f.value[0] ?? void 0
33
+ ), S = (e) => {
32
34
  const a = [];
33
- for (const e of t)
34
- e.type === "operation" && a.push(e), "children" in e && e.children && a.push(...g(e.children));
35
+ for (const t of e)
36
+ t.type === "operation" && a.push(t), "children" in t && t.children && a.push(...S(t.children));
35
37
  return a;
36
- }, p = m(() => {
38
+ }, r = p(() => {
37
39
  if (!l.value)
38
40
  return [];
39
- const t = b.workspaceStore.workspace.documents[l.value.id];
40
- if (!t || !t["x-scalar-navigation"])
41
+ const e = s.workspaceStore.workspace.documents[l.value.id];
42
+ if (!e || !e["x-scalar-navigation"])
41
43
  return [];
42
- const a = t["x-scalar-navigation"];
43
- return g(a.children ?? []).map((r) => ({
44
- id: r.id,
45
- label: `${r.method.toUpperCase()} ${r.path}`,
46
- path: r.path,
47
- method: r.method
44
+ const a = e["x-scalar-navigation"];
45
+ return S(a.children ?? []).map((d) => ({
46
+ id: d.id,
47
+ label: `${d.method.toUpperCase()} ${d.path}`,
48
+ path: d.path,
49
+ method: d.method
48
50
  }));
49
- });
50
- j(
51
+ }), o = h(
52
+ s.operationId ? r.value.find(
53
+ (e) => e.id === s.operationId
54
+ ) : void 0
55
+ );
56
+ O(
51
57
  l,
52
58
  () => {
53
- o.value = p.value[0] ?? void 0;
59
+ o.value = s.operationId ? r.value.find(
60
+ (e) => e.id === s.operationId
61
+ ) : r.value[0] ?? void 0;
54
62
  },
55
63
  { immediate: !0 }
56
64
  );
57
- const E = (t) => {
58
- t && (o.value = t);
59
- }, S = m(() => !w.value || !l.value || !o.value), $ = () => {
60
- S.value || !l.value || !o.value || (N.push({
65
+ const N = (e) => {
66
+ e && (o.value = e);
67
+ }, C = p(() => !g.value || !l.value || !o.value), E = () => {
68
+ C.value || !l.value || !o.value || (V.push({
61
69
  name: "example",
62
70
  params: {
63
71
  documentSlug: l.value.id,
64
72
  pathEncoded: encodeURIComponent(o.value.path),
65
73
  method: o.value.method,
66
- exampleName: w.value
74
+ exampleName: g.value
67
75
  }
68
- }), _("close"));
69
- }, B = (t) => {
70
- _("back", t);
76
+ }), k("close"));
77
+ }, $ = (e) => {
78
+ k("back", e);
71
79
  };
72
- return (t, a) => (u(), f(q, {
73
- disabled: S.value,
74
- onSubmit: $
80
+ return (e, a) => (u(), x(q, {
81
+ disabled: C.value,
82
+ onSubmit: E
75
83
  }, {
76
84
  options: n(() => [
77
- i("div", H, [
78
- s(c(T), {
85
+ m("div", H, [
86
+ i(c(T), {
79
87
  modelValue: l.value,
80
- "onUpdate:modelValue": a[1] || (a[1] = (e) => l.value = e),
81
- options: k.value
88
+ "onUpdate:modelValue": a[1] || (a[1] = (t) => l.value = t),
89
+ options: f.value
82
90
  }, {
83
91
  default: n(() => [
84
- s(c(C), {
92
+ i(c(_), {
85
93
  class: "hover:bg-b-2 max-h-8 w-[150px] min-w-[150px] justify-between gap-1 p-2 text-xs",
86
94
  variant: "outlined"
87
95
  }, {
88
96
  default: n(() => [
89
- i("span", {
90
- class: U(l.value ? "text-c-1 truncate" : "text-c-3")
91
- }, h(l.value ? l.value.label : "Select Document"), 3),
92
- s(c(y), {
97
+ m("span", {
98
+ class: z(l.value ? "text-c-1 truncate" : "text-c-3")
99
+ }, b(l.value ? l.value.label : "Select Document"), 3),
100
+ i(c(I), {
93
101
  class: "text-c-3",
94
102
  icon: "ChevronDown",
95
103
  size: "md"
@@ -100,21 +108,21 @@ const H = { class: "flex flex-1 gap-1" }, J = {
100
108
  ]),
101
109
  _: 1
102
110
  }, 8, ["modelValue", "options"]),
103
- s(c(A), {
111
+ i(c(A), {
104
112
  placement: "bottom",
105
113
  resize: ""
106
114
  }, {
107
115
  items: n(() => [
108
- i("div", Q, [
109
- (u(!0), x(L, null, R(p.value, (e) => (u(), f(c(F), {
110
- key: e.id,
116
+ m("div", Q, [
117
+ (u(!0), w(L, null, R(r.value, (t) => (u(), x(c(F), {
118
+ key: t.id,
111
119
  class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
112
- onClick: (r) => E(e)
120
+ onClick: (d) => N(t)
113
121
  }, {
114
122
  default: n(() => [
115
- i("span", W, h(e.path), 1),
116
- s(D, {
117
- method: e.method
123
+ m("span", W, b(t.path), 1),
124
+ i(y, {
125
+ method: t.method
118
126
  }, null, 8, ["method"])
119
127
  ]),
120
128
  _: 2
@@ -122,19 +130,19 @@ const H = { class: "flex flex-1 gap-1" }, J = {
122
130
  ])
123
131
  ]),
124
132
  default: n(() => [
125
- s(c(C), {
133
+ i(c(_), {
126
134
  class: "hover:bg-b-2 max-h-8 w-full justify-between gap-1 p-2 text-xs",
127
- disabled: !p.value.length,
135
+ disabled: !r.value.length,
128
136
  variant: "outlined"
129
137
  }, {
130
138
  default: n(() => [
131
- o.value ? (u(), x("span", J, h(o.value.path), 1)) : (u(), x("span", K, " Select Operation ")),
132
- i("div", M, [
133
- o.value ? (u(), f(D, {
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, {
134
142
  key: 0,
135
143
  method: o.value.method
136
- }, null, 8, ["method"])) : I("", !0),
137
- s(c(y), {
144
+ }, null, 8, ["method"])) : U("", !0),
145
+ i(c(I), {
138
146
  class: "text-c-3",
139
147
  icon: "ChevronDown",
140
148
  size: "md"
@@ -149,15 +157,15 @@ const H = { class: "flex flex-1 gap-1" }, J = {
149
157
  ])
150
158
  ]),
151
159
  submit: n(() => [...a[2] || (a[2] = [
152
- z("Create Example", -1)
160
+ j("Create Example", -1)
153
161
  ])]),
154
162
  default: n(() => [
155
- s(G, {
156
- modelValue: d.value,
157
- "onUpdate:modelValue": a[0] || (a[0] = (e) => d.value = e),
163
+ i(G, {
164
+ modelValue: v.value,
165
+ "onUpdate:modelValue": a[0] || (a[0] = (t) => v.value = t),
158
166
  label: "Example Name",
159
167
  placeholder: "Example Name",
160
- onDelete: B
168
+ onDelete: $
161
169
  }, null, 8, ["modelValue"])
162
170
  ]),
163
171
  _: 1
@@ -23,6 +23,10 @@ declare const _default: import("vue").DefineComponent<{
23
23
  workspaceStore: WorkspaceStore;
24
24
  /** Event bus for emitting operation creation events */
25
25
  eventBus: WorkspaceEventBus;
26
+ /** Preselected document id to create the request in */
27
+ documentId?: string;
28
+ /** Preselected tag id to add the request to (optional) */
29
+ tagId?: string;
26
30
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
27
31
  close: () => any;
28
32
  back: (keyboardEvent: KeyboardEvent) => any;
@@ -31,6 +35,10 @@ declare const _default: import("vue").DefineComponent<{
31
35
  workspaceStore: WorkspaceStore;
32
36
  /** Event bus for emitting operation creation events */
33
37
  eventBus: WorkspaceEventBus;
38
+ /** Preselected document id to create the request in */
39
+ documentId?: string;
40
+ /** Preselected tag id to add the request to (optional) */
41
+ tagId?: string;
34
42
  }> & Readonly<{
35
43
  onClose?: (() => any) | undefined;
36
44
  onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteRequest.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteRequest.vue"],"names":[],"mappings":"AAiWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAUvE;;;;;;;;;;;;;;;;;GAiBG;;IAGD,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;;;;;IAH3B,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;;;;;AAL7B,wBAsjBC"}
1
+ {"version":3,"file":"CommandPaletteRequest.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteRequest.vue"],"names":[],"mappings":"AA8WA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAUvE;;;;;;;;;;;;;;;;;GAiBG;;IAGD,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,uDAAuD;iBAC1C,MAAM;IACnB,0DAA0D;YAClD,MAAM;;;;;IAPd,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,uDAAuD;iBAC1C,MAAM;IACnB,0DAA0D;YAClD,MAAM;;;;;AAThB,wBAmkBC"}
@@ -1,39 +1,41 @@
1
- import { defineComponent as I, ref as p, computed as v, createBlock as f, openBlock as m, withCtx as o, createVNode as n, createTextVNode as O, createElementVNode as r, unref as s, normalizeClass as D, toDisplayString as b, createCommentVNode as H, createElementBlock as T, Fragment as V, renderList as y } from "vue";
2
- import { ScalarListbox as L, ScalarButton as x, ScalarIcon as w, ScalarDropdown as z, ScalarDropdownItem as B } from "@scalar/components";
3
- import { HTTP_METHODS as W } from "@scalar/helpers/http/http-methods";
4
- import { useRouter as F } from "vue-router";
5
- import N from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
6
- import A from "./CommandActionForm.vue.js";
7
- import G from "./CommandActionInput.vue.js";
8
- const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2" }, Q = { class: "custom-scroll max-h-40" }, X = { class: "custom-scroll max-h-40" }, Y = { class: "truncate" }, Z = {
1
+ import { defineComponent as U, ref as p, computed as v, watch as O, createBlock as h, openBlock as m, withCtx as o, createVNode as s, createTextVNode as H, createElementVNode as r, unref as n, normalizeClass as T, toDisplayString as w, createCommentVNode as L, createElementBlock as V, Fragment as _, renderList as I } from "vue";
2
+ import { ScalarListbox as W, ScalarButton as k, ScalarIcon as S, ScalarDropdown as y, ScalarDropdownItem as z } from "@scalar/components";
3
+ import { HTTP_METHODS as F } from "@scalar/helpers/http/http-methods";
4
+ import { useRouter as A } from "vue-router";
5
+ import B from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
6
+ import G from "./CommandActionForm.vue.js";
7
+ import J from "./CommandActionInput.vue.js";
8
+ const K = { class: "flex flex-1 gap-1" }, Q = { class: "flex items-center gap-2" }, X = { class: "custom-scroll max-h-40" }, Y = { class: "custom-scroll max-h-40" }, Z = { class: "truncate" }, ee = {
9
9
  name: "CommandPaletteRequest"
10
- }, ue = /* @__PURE__ */ I({
11
- ...Z,
10
+ }, ce = /* @__PURE__ */ U({
11
+ ...ee,
12
12
  props: {
13
13
  workspaceStore: {},
14
- eventBus: {}
14
+ eventBus: {},
15
+ documentId: {},
16
+ tagId: {}
15
17
  },
16
18
  emits: ["close", "back"],
17
- setup(i, { emit: $ }) {
18
- const k = $, P = F(), h = p("/"), u = v(() => h.value.trim()), S = v(
19
- () => Object.entries(i.workspaceStore.workspace.documents).map(
19
+ setup(u, { emit: N }) {
20
+ const g = N, $ = A(), b = p("/"), c = v(() => b.value.trim()), x = v(
21
+ () => Object.entries(u.workspaceStore.workspace.documents).map(
20
22
  ([e, a]) => ({
21
23
  id: e,
22
24
  label: a.info.title || e
23
25
  })
24
26
  )
25
- ), _ = W.map((e) => ({
27
+ ), C = F.map((e) => ({
26
28
  id: e,
27
29
  label: e.toUpperCase(),
28
30
  method: e
29
31
  })), t = p(
30
- S.value[0] ?? void 0
31
- ), c = p(
32
- _.find((e) => e.method === "get")
33
- ), d = p(void 0), g = v(() => {
32
+ u.documentId ? x.value.find((e) => e.id === u.documentId) : x.value[0] ?? void 0
33
+ ), i = p(
34
+ C.find((e) => e.method === "get")
35
+ ), f = v(() => {
34
36
  if (!t.value)
35
37
  return [];
36
- const e = i.workspaceStore.workspace.documents[t.value.id];
38
+ const e = u.workspaceStore.workspace.documents[t.value.id];
37
39
  return e ? [
38
40
  { id: "", label: "No Tag" },
39
41
  ...e.tags?.map((a) => ({
@@ -41,63 +43,69 @@ const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2"
41
43
  label: a.name
42
44
  })) ?? []
43
45
  ] : [];
44
- }), j = v(() => {
45
- if (!t.value || !c.value || !u.value)
46
+ }), d = p(
47
+ u.tagId ? f.value.find((e) => e.id === u.tagId) : void 0
48
+ );
49
+ O(t, () => {
50
+ d.value = f.value.find((e) => e.id === "");
51
+ });
52
+ const P = v(() => {
53
+ if (!t.value || !i.value || !c.value)
46
54
  return !1;
47
- const e = i.workspaceStore.workspace.documents[t.value.id], a = u.value.startsWith("/") ? u.value : `/${u.value}`;
48
- return !!e?.paths?.[a]?.[c.value.method];
49
- }), C = v(() => !!(!u.value || !t.value || !c.value || j.value)), q = (e) => {
50
- e && (c.value = e);
51
- }, E = (e) => {
55
+ const e = u.workspaceStore.workspace.documents[t.value.id], a = c.value.startsWith("/") ? c.value : `/${c.value}`;
56
+ return !!e?.paths?.[a]?.[i.value.method];
57
+ }), D = v(() => !!(!c.value || !t.value || !i.value || P.value)), j = (e) => {
58
+ e && (i.value = e);
59
+ }, q = (e) => {
52
60
  e && (d.value = e);
53
- }, R = () => {
54
- C.value || !t.value || !c.value || !i.workspaceStore.workspace.documents[t.value.id] || (i.eventBus.emit("operation:create:operation", {
61
+ }, E = () => {
62
+ D.value || !t.value || !i.value || !u.workspaceStore.workspace.documents[t.value.id] || (u.eventBus.emit("operation:create:operation", {
55
63
  documentName: t.value.id,
56
- path: u.value,
57
- method: c.value.method,
64
+ path: c.value,
65
+ method: i.value.method,
58
66
  operation: {
59
67
  tags: d.value?.id ? [d.value.id] : void 0
60
68
  },
61
69
  callback: (a) => {
62
70
  if (a) {
63
- i.workspaceStore.buildSidebar(t.value?.id ?? "");
64
- const l = u.value.startsWith("/") ? u.value : `/${u.value}`;
65
- P.push({
71
+ u.workspaceStore.buildSidebar(t.value?.id ?? "");
72
+ const l = c.value.startsWith("/") ? c.value : `/${c.value}`;
73
+ $.push({
66
74
  name: "example",
67
75
  params: {
68
76
  documentSlug: t.value?.id,
69
77
  pathEncoded: encodeURIComponent(l),
70
- method: c.value?.method,
78
+ method: i.value?.method,
71
79
  exampleName: "default"
72
80
  }
73
81
  });
74
82
  }
75
83
  }
76
- }), k("close"));
77
- }, M = (e) => {
78
- k("back", e);
84
+ }), g("close"));
85
+ }, R = (e) => {
86
+ g("back", e);
79
87
  };
80
- return (e, a) => (m(), f(A, {
81
- disabled: C.value,
82
- onSubmit: R
88
+ return (e, a) => (m(), h(G, {
89
+ disabled: D.value,
90
+ onSubmit: E
83
91
  }, {
84
92
  options: o(() => [
85
- r("div", J, [
86
- n(s(L), {
93
+ r("div", K, [
94
+ s(n(W), {
87
95
  modelValue: t.value,
88
96
  "onUpdate:modelValue": a[1] || (a[1] = (l) => t.value = l),
89
- options: S.value
97
+ options: x.value
90
98
  }, {
91
99
  default: o(() => [
92
- n(s(x), {
100
+ s(n(k), {
93
101
  class: "hover:bg-b-2 max-h-8 w-[150px] min-w-[150px] justify-between gap-1 p-2 text-xs",
94
102
  variant: "outlined"
95
103
  }, {
96
104
  default: o(() => [
97
105
  r("span", {
98
- class: D(t.value ? "text-c-1 truncate" : "text-c-3")
99
- }, b(t.value ? t.value.label : "Select Document"), 3),
100
- n(s(w), {
106
+ class: T(t.value ? "text-c-1 truncate" : "text-c-3")
107
+ }, w(t.value ? t.value.label : "Select Document"), 3),
108
+ s(n(S), {
101
109
  class: "text-c-3",
102
110
  icon: "ChevronDown",
103
111
  size: "md"
@@ -108,19 +116,19 @@ const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2"
108
116
  ]),
109
117
  _: 1
110
118
  }, 8, ["modelValue", "options"]),
111
- n(s(z), {
119
+ s(n(y), {
112
120
  placement: "bottom",
113
121
  resize: ""
114
122
  }, {
115
123
  items: o(() => [
116
- r("div", Q, [
117
- (m(!0), T(V, null, y(s(_), (l) => (m(), f(s(B), {
124
+ r("div", X, [
125
+ (m(!0), V(_, null, I(n(C), (l) => (m(), h(n(z), {
118
126
  key: l.id,
119
127
  class: "flex h-7 w-full items-center justify-center px-1",
120
- onClick: (U) => q(l)
128
+ onClick: (M) => j(l)
121
129
  }, {
122
130
  default: o(() => [
123
- n(N, {
131
+ s(B, {
124
132
  method: l.method
125
133
  }, null, 8, ["method"])
126
134
  ]),
@@ -129,17 +137,17 @@ const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2"
129
137
  ])
130
138
  ]),
131
139
  default: o(() => [
132
- n(s(x), {
140
+ s(n(k), {
133
141
  class: "hover:bg-b-2 max-h-8 w-[100px] min-w-[100px] justify-between gap-1 p-2 text-xs",
134
142
  variant: "outlined"
135
143
  }, {
136
144
  default: o(() => [
137
- r("div", K, [
138
- c.value ? (m(), f(N, {
145
+ r("div", Q, [
146
+ i.value ? (m(), h(B, {
139
147
  key: 0,
140
- method: c.value.method
141
- }, null, 8, ["method"])) : H("", !0),
142
- n(s(w), {
148
+ method: i.value.method
149
+ }, null, 8, ["method"])) : L("", !0),
150
+ s(n(S), {
143
151
  class: "text-c-3",
144
152
  icon: "ChevronDown",
145
153
  size: "md"
@@ -151,35 +159,35 @@ const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2"
151
159
  ]),
152
160
  _: 1
153
161
  }),
154
- n(s(z), {
162
+ s(n(y), {
155
163
  placement: "bottom",
156
164
  resize: ""
157
165
  }, {
158
166
  items: o(() => [
159
- r("div", X, [
160
- (m(!0), T(V, null, y(g.value, (l) => (m(), f(s(B), {
167
+ r("div", Y, [
168
+ (m(!0), V(_, null, I(f.value, (l) => (m(), h(n(z), {
161
169
  key: l.id,
162
170
  class: "flex h-7 w-full items-center px-1",
163
- onClick: (U) => E(l)
171
+ onClick: (M) => q(l)
164
172
  }, {
165
173
  default: o(() => [
166
- r("span", Y, b(l.label), 1)
174
+ r("span", Z, w(l.label), 1)
167
175
  ]),
168
176
  _: 2
169
177
  }, 1032, ["onClick"]))), 128))
170
178
  ])
171
179
  ]),
172
180
  default: o(() => [
173
- n(s(x), {
181
+ s(n(k), {
174
182
  class: "hover:bg-b-2 max-h-8 w-full justify-between gap-1 p-2 text-xs",
175
- disabled: !g.value.length,
183
+ disabled: !f.value.length,
176
184
  variant: "outlined"
177
185
  }, {
178
186
  default: o(() => [
179
187
  r("span", {
180
- class: D(d.value ? "text-c-1 truncate" : "text-c-3")
181
- }, b(d.value ? d.value.label : "Select Tag (Optional)"), 3),
182
- n(s(w), {
188
+ class: T(d.value ? "text-c-1 truncate" : "text-c-3")
189
+ }, w(d.value ? d.value.label : "Select Tag (Optional)"), 3),
190
+ s(n(S), {
183
191
  class: "text-c-3",
184
192
  icon: "ChevronDown",
185
193
  size: "md"
@@ -193,15 +201,15 @@ const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2"
193
201
  ])
194
202
  ]),
195
203
  submit: o(() => [...a[2] || (a[2] = [
196
- O("Create Request", -1)
204
+ H("Create Request", -1)
197
205
  ])]),
198
206
  default: o(() => [
199
- n(G, {
200
- modelValue: h.value,
201
- "onUpdate:modelValue": a[0] || (a[0] = (l) => h.value = l),
207
+ s(J, {
208
+ modelValue: b.value,
209
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => b.value = l),
202
210
  label: "Request Path",
203
211
  placeholder: "/users",
204
- onDelete: M
212
+ onDelete: R
205
213
  }, null, 8, ["modelValue"])
206
214
  ]),
207
215
  _: 1
@@ -209,5 +217,5 @@ const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2"
209
217
  }
210
218
  });
211
219
  export {
212
- ue as default
220
+ ce as default
213
221
  };
@@ -22,6 +22,8 @@ declare const _default: import("vue").DefineComponent<{
22
22
  workspaceStore: WorkspaceStore;
23
23
  /** Event bus for emitting tag creation events */
24
24
  eventBus: WorkspaceEventBus;
25
+ /** Preselected document id to create the tag in */
26
+ documentId?: string;
25
27
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
26
28
  close: () => any;
27
29
  back: (keyboardEvent: KeyboardEvent) => any;
@@ -30,6 +32,8 @@ declare const _default: import("vue").DefineComponent<{
30
32
  workspaceStore: WorkspaceStore;
31
33
  /** Event bus for emitting tag creation events */
32
34
  eventBus: WorkspaceEventBus;
35
+ /** Preselected document id to create the tag in */
36
+ documentId?: string;
33
37
  }> & Readonly<{
34
38
  onClose?: (() => any) | undefined;
35
39
  onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteTag.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteTag.vue"],"names":[],"mappings":"AA4JA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAOvE;;;;;;;;;;;;;;;;GAgBG;;IAGD,2DAA2D;oBAC3C,cAAc;IAC9B,iDAAiD;cACvC,iBAAiB;;;;;IAH3B,2DAA2D;oBAC3C,cAAc;IAC9B,iDAAiD;cACvC,iBAAiB;;;;;AAL7B,wBA8OC"}
1
+ {"version":3,"file":"CommandPaletteTag.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteTag.vue"],"names":[],"mappings":"AA2JA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAOvE;;;;;;;;;;;;;;;;GAgBG;;IAGD,2DAA2D;oBAC3C,cAAc;IAC9B,iDAAiD;cACvC,iBAAiB;IAC3B,mDAAmD;iBACtC,MAAM;;;;;IALnB,2DAA2D;oBAC3C,cAAc;IAC9B,iDAAiD;cACvC,iBAAiB;IAC3B,mDAAmD;iBACtC,MAAM;;;;;AAPrB,wBA6OC"}