@scalar/api-client 2.34.0 → 2.36.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 (52) hide show
  1. package/CHANGELOG.md +82 -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/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 +88 -80
  7. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +6 -4
  8. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts +16 -0
  9. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts.map +1 -0
  10. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +17 -0
  11. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  12. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +90 -84
  13. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  14. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  15. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +76 -50
  16. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  17. package/dist/v2/components/sidebar/Sidebar.vue.js +25 -23
  18. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  19. package/dist/v2/features/app/App.vue.js +41 -35
  20. package/dist/v2/features/app/app-events.d.ts +5 -2
  21. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  22. package/dist/v2/features/app/app-events.js +58 -44
  23. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  24. package/dist/v2/features/app/app-state.js +82 -80
  25. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  26. package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
  27. package/dist/v2/features/app/components/AppSidebar.vue2.js +78 -76
  28. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
  29. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +73 -45
  30. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  31. package/dist/v2/features/collection/DocumentCollection.vue.js +20 -20
  32. package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +1 -1
  33. package/dist/v2/features/collection/OperationCollection.vue.js +7 -7
  34. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
  35. package/dist/v2/features/collection/WorkspaceCollection.vue.js +5 -4
  36. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  37. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  38. package/dist/v2/features/collection/components/Authentication.vue2.js +84 -66
  39. package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
  40. package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
  41. package/dist/v2/features/collection/components/LabelInput.vue2.js +1 -1
  42. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +5 -0
  43. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
  44. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +131 -96
  45. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +25 -0
  46. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  47. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +42 -36
  48. package/dist/v2/features/operation/Operation.vue.js +1 -1
  49. package/dist/v2/workspace-events.d.ts.map +1 -1
  50. package/dist/v2/workspace-events.js +8 -5
  51. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  52. package/package.json +17 -17
@@ -1,102 +1,137 @@
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 = {
1
+ import { defineComponent as U, computed as p, ref as S, watch as L, createBlock as f, openBlock as i, withCtx as m, createVNode as u, createTextVNode as V, toDisplayString as h, createElementBlock as b, unref as s, createElementVNode as k, normalizeClass as T, createCommentVNode as A, Fragment as F, renderList as K } from "vue";
2
+ import { ScalarListbox as M, ScalarButton as C, ScalarIcon as B, ScalarDropdown as P, ScalarDropdownItem as q } from "@scalar/components";
3
+ import E from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
4
+ import G from "./CommandActionForm.vue.js";
5
+ import H from "./CommandActionInput.vue.js";
6
+ const J = {
7
+ key: 0,
8
+ class: "flex flex-1 gap-1"
9
+ }, Q = {
7
10
  key: 0,
8
11
  class: "text-c-1 truncate"
9
- }, J = {
12
+ }, R = {
10
13
  key: 1,
11
14
  class: "text-c-3"
12
- }, K = { class: "flex items-center gap-2" }, M = { class: "custom-scroll max-h-40" }, Q = { class: "truncate" }, R = {
15
+ }, W = { class: "flex items-center gap-2" }, X = { class: "custom-scroll max-h-40" }, Y = { class: "truncate" }, Z = {
13
16
  name: "CommandPaletteExample"
14
- }, te = /* @__PURE__ */ I({
15
- ...R,
17
+ }, ne = /* @__PURE__ */ U({
18
+ ...Z,
16
19
  props: {
17
20
  workspaceStore: {},
18
21
  eventBus: {},
19
22
  documentName: {},
20
- operationId: {}
23
+ operationId: {},
24
+ example: {}
21
25
  },
22
26
  emits: ["close", "back"],
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
- ([e, a]) => ({
27
+ setup(a, { emit: I }) {
28
+ const x = I, d = p(() => a.example !== void 0), w = S(a.example?.name ?? ""), r = p(() => w.value.trim()), N = p(
29
+ () => Object.entries(a.workspaceStore.workspace.documents).map(
30
+ ([e, l]) => ({
27
31
  id: e,
28
- label: a.info.title || e
32
+ label: l.info.title || e
29
33
  })
30
34
  )
31
- ), l = h(
32
- n.documentName ? f.value.find((e) => e.id === n.documentName) : f.value[0] ?? void 0
33
- ), N = (e) => {
34
- const a = [];
35
+ ), o = S(
36
+ a.documentName ? N.value.find((e) => e.id === a.documentName) : N.value[0] ?? void 0
37
+ ), g = (e) => {
38
+ const l = [];
35
39
  for (const t of e)
36
- t.type === "operation" && a.push(t), "children" in t && t.children && a.push(...N(t.children));
37
- return a;
38
- }, m = p(() => {
39
- if (!l.value)
40
+ t.type === "operation" && l.push(t), "children" in t && t.children && l.push(...g(t.children));
41
+ return l;
42
+ }, v = p(() => {
43
+ if (!o.value)
40
44
  return [];
41
- const e = n.workspaceStore.workspace.documents[l.value.id];
45
+ const e = a.workspaceStore.workspace.documents[o.value.id];
42
46
  if (!e || !e["x-scalar-navigation"])
43
47
  return [];
44
- const a = e["x-scalar-navigation"];
45
- return N(a.children ?? []).map((d) => ({
46
- id: d.id,
47
- label: `${d.method.toUpperCase()} ${d.path}`,
48
- path: d.path,
49
- method: d.method
48
+ const l = e["x-scalar-navigation"];
49
+ return g(l.children ?? []).map((c) => ({
50
+ id: c.id,
51
+ label: `${c.method.toUpperCase()} ${c.path}`,
52
+ path: c.path,
53
+ method: c.method,
54
+ exampleNames: c.children?.filter((y) => y.type === "example").map((y) => y.name) ?? []
50
55
  }));
51
- }), o = h(
52
- n.operationId ? m.value.find(
53
- (e) => e.id === n.operationId
56
+ }), n = S(
57
+ a.operationId ? v.value.find(
58
+ (e) => e.id === a.operationId
54
59
  ) : void 0
55
60
  );
56
- $(
57
- l,
61
+ L(
62
+ o,
58
63
  () => {
59
- o.value = n.operationId ? m.value.find(
60
- (e) => e.id === n.operationId
61
- ) : m.value[0] ?? void 0;
64
+ n.value = a.operationId ? v.value.find(
65
+ (e) => e.id === a.operationId
66
+ ) : v.value[0] ?? void 0;
62
67
  },
63
68
  { immediate: !0 }
64
69
  );
65
- const _ = (e) => {
66
- e && (o.value = e);
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
75
- }), k("close"));
76
- }, E = (e) => {
77
- k("back", e);
70
+ const $ = (e) => {
71
+ e && (n.value = e);
72
+ }, D = p(() => !!(!r.value || !o.value || !n.value || d.value && a.example && r.value === a.example.name || n.value.exampleNames.some(
73
+ (e) => e === r.value && e !== a.example?.name
74
+ ))), O = () => {
75
+ if (!(D.value || !o.value || !n.value)) {
76
+ if (d.value && a.example) {
77
+ a.eventBus.emit("operation:rename:example", {
78
+ documentName: o.value.id,
79
+ meta: {
80
+ path: n.value.path,
81
+ method: n.value.method,
82
+ exampleKey: a.example.name
83
+ },
84
+ payload: {
85
+ name: r.value
86
+ }
87
+ }), x("close");
88
+ return;
89
+ }
90
+ a.eventBus.emit("operation:create:draft-example", {
91
+ documentName: o.value.id,
92
+ meta: {
93
+ path: n.value.path,
94
+ method: n.value.method
95
+ },
96
+ exampleName: r.value
97
+ }), x("close");
98
+ }
99
+ }, j = (e) => {
100
+ d.value || x("back", e);
101
+ }, z = () => {
102
+ x("close");
78
103
  };
79
- return (e, a) => (u(), x(P, {
80
- disabled: S.value,
81
- onSubmit: B
104
+ return (e, l) => (i(), f(G, {
105
+ disabled: D.value,
106
+ onSubmit: O
82
107
  }, {
83
- options: s(() => [
84
- r("div", G, [
85
- i(c(T), {
86
- modelValue: l.value,
87
- "onUpdate:modelValue": a[1] || (a[1] = (t) => l.value = t),
88
- options: f.value
108
+ options: m(() => [
109
+ d.value ? (i(), f(s(C), {
110
+ key: 1,
111
+ class: "max-h-8 px-3 text-xs",
112
+ variant: "outlined",
113
+ onClick: z
114
+ }, {
115
+ default: m(() => [...l[2] || (l[2] = [
116
+ V(" Cancel ", -1)
117
+ ])]),
118
+ _: 1
119
+ })) : (i(), b("div", J, [
120
+ u(s(M), {
121
+ modelValue: o.value,
122
+ "onUpdate:modelValue": l[1] || (l[1] = (t) => o.value = t),
123
+ options: N.value
89
124
  }, {
90
- default: s(() => [
91
- i(c(C), {
125
+ default: m(() => [
126
+ u(s(C), {
92
127
  class: "hover:bg-b-2 max-h-8 w-[150px] min-w-[150px] justify-between gap-1 p-2 text-xs",
93
128
  variant: "outlined"
94
129
  }, {
95
- default: s(() => [
96
- r("span", {
97
- class: j(l.value ? "text-c-1 truncate" : "text-c-3")
98
- }, b(l.value ? l.value.label : "Select Document"), 3),
99
- i(c(y), {
130
+ default: m(() => [
131
+ k("span", {
132
+ class: T(o.value ? "text-c-1 truncate" : "text-c-3")
133
+ }, h(o.value ? o.value.label : "Select Document"), 3),
134
+ u(s(B), {
100
135
  class: "text-c-3",
101
136
  icon: "ChevronDown",
102
137
  size: "md"
@@ -107,20 +142,20 @@ const G = { class: "flex flex-1 gap-1" }, H = {
107
142
  ]),
108
143
  _: 1
109
144
  }, 8, ["modelValue", "options"]),
110
- i(c(A), {
145
+ u(s(P), {
111
146
  placement: "bottom",
112
147
  resize: ""
113
148
  }, {
114
- items: s(() => [
115
- r("div", M, [
116
- (u(!0), w(U, null, L(m.value, (t) => (u(), x(c(F), {
149
+ items: m(() => [
150
+ k("div", X, [
151
+ (i(!0), b(F, null, K(v.value, (t) => (i(), f(s(q), {
117
152
  key: t.id,
118
153
  class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
119
- onClick: (d) => _(t)
154
+ onClick: (c) => $(t)
120
155
  }, {
121
- default: s(() => [
122
- r("span", Q, b(t.path), 1),
123
- i(D, {
156
+ default: m(() => [
157
+ k("span", Y, h(t.path), 1),
158
+ u(E, {
124
159
  method: t.method
125
160
  }, null, 8, ["method"])
126
161
  ]),
@@ -128,20 +163,20 @@ const G = { class: "flex flex-1 gap-1" }, H = {
128
163
  }, 1032, ["onClick"]))), 128))
129
164
  ])
130
165
  ]),
131
- default: s(() => [
132
- i(c(C), {
166
+ default: m(() => [
167
+ u(s(C), {
133
168
  class: "hover:bg-b-2 max-h-8 w-full justify-between gap-1 p-2 text-xs",
134
- disabled: !m.value.length,
169
+ disabled: !v.value.length,
135
170
  variant: "outlined"
136
171
  }, {
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, {
172
+ default: m(() => [
173
+ n.value ? (i(), b("span", Q, h(n.value.path), 1)) : (i(), b("span", R, " Select Operation ")),
174
+ k("div", W, [
175
+ n.value ? (i(), f(E, {
141
176
  key: 0,
142
- method: o.value.method
143
- }, null, 8, ["method"])) : z("", !0),
144
- i(c(y), {
177
+ method: n.value.method
178
+ }, null, 8, ["method"])) : A("", !0),
179
+ u(s(B), {
145
180
  class: "text-c-3",
146
181
  icon: "ChevronDown",
147
182
  size: "md"
@@ -153,18 +188,18 @@ const G = { class: "flex flex-1 gap-1" }, H = {
153
188
  ]),
154
189
  _: 1
155
190
  })
156
- ])
191
+ ]))
192
+ ]),
193
+ submit: m(() => [
194
+ V(h(d.value ? "Save" : "Create Example"), 1)
157
195
  ]),
158
- submit: s(() => [...a[2] || (a[2] = [
159
- O("Create Example", -1)
160
- ])]),
161
- default: s(() => [
162
- i(q, {
163
- modelValue: v.value,
164
- "onUpdate:modelValue": a[0] || (a[0] = (t) => v.value = t),
196
+ default: m(() => [
197
+ u(H, {
198
+ modelValue: w.value,
199
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => w.value = t),
165
200
  label: "Example Name",
166
201
  placeholder: "Example Name",
167
- onDelete: E
202
+ onDelete: j
168
203
  }, null, 8, ["modelValue"])
169
204
  ]),
170
205
  _: 1
@@ -172,5 +207,5 @@ const G = { class: "flex flex-1 gap-1" }, H = {
172
207
  }
173
208
  });
174
209
  export {
175
- te as default
210
+ ne as default
176
211
  };
@@ -291,6 +291,7 @@ export declare const baseClientActions: [{
291
291
  eventBus: import("@scalar/workspace-store/events").WorkspaceEventBus;
292
292
  documentName?: string;
293
293
  operationId?: string;
294
+ example?: import("@scalar/workspace-store/schemas/navigation").TraversedExample;
294
295
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
295
296
  close: () => any;
296
297
  back: (keyboardEvent: KeyboardEvent) => any;
@@ -299,6 +300,7 @@ export declare const baseClientActions: [{
299
300
  eventBus: import("@scalar/workspace-store/events").WorkspaceEventBus;
300
301
  documentName?: string;
301
302
  operationId?: string;
303
+ example?: import("@scalar/workspace-store/schemas/navigation").TraversedExample;
302
304
  }> & Readonly<{
303
305
  onClose?: (() => any) | undefined;
304
306
  onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
@@ -360,6 +362,29 @@ export declare const baseClientActions: [{
360
362
  onClose?: (() => any) | undefined;
361
363
  onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
362
364
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
365
+ }, {
366
+ readonly id: "edit-example";
367
+ readonly name: "Edit Example";
368
+ readonly hidden: true;
369
+ readonly component: import("vue").DefineComponent<{
370
+ workspaceStore: import("@scalar/workspace-store/client").WorkspaceStore;
371
+ eventBus: import("@scalar/workspace-store/events").WorkspaceEventBus;
372
+ documentName?: string;
373
+ operationId?: string;
374
+ example?: import("@scalar/workspace-store/schemas/navigation").TraversedExample;
375
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
376
+ close: () => any;
377
+ back: (keyboardEvent: KeyboardEvent) => any;
378
+ }, string, import("vue").PublicProps, Readonly<{
379
+ workspaceStore: import("@scalar/workspace-store/client").WorkspaceStore;
380
+ eventBus: import("@scalar/workspace-store/events").WorkspaceEventBus;
381
+ documentName?: string;
382
+ operationId?: string;
383
+ example?: import("@scalar/workspace-store/schemas/navigation").TraversedExample;
384
+ }> & Readonly<{
385
+ onClose?: (() => any) | undefined;
386
+ onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
387
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
363
388
  }];
364
389
  export {};
365
390
  //# sourceMappingURL=use-command-palette-state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-command-palette-state.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/hooks/use-command-palette-state.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAE3E,OAAO,EACL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,GAAG,EACR,KAAK,UAAU,EAKhB,MAAM,KAAK,CAAA;AACZ,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AASlD;;;;GAIG;AACH,KAAK,YAAY,GAAG,MAAM,qBAAqB,CAAA;AAE/C,oDAAoD;AACpD,KAAK,yBAAyB,CAAC,CAAC,SAAS,YAAY,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAA;AAEjF;;;;;;GAMG;AACH,KAAK,WAAW,GAAG;IACjB,IAAI,IAAI,CAAA;IACR,CAAC,CAAC,SAAS,YAAY,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;CAClF,CAAA;AAED,wCAAwC;AACxC,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,CAAA;IACb,IA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MAAM,IAAI,CAAA;CAClB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAS,gBAAgB,CAAC,oBAAoB,EAAE,CAAqB,EACrE,SAAQ,gBAAgB,CAAC,mBAAmB,EAAE,CAAc,KAC3D,mBAmGF,CAAA;AAKD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,mBAAmB,EA4B3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CiB,CAAA"}
1
+ {"version":3,"file":"use-command-palette-state.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/hooks/use-command-palette-state.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAE3E,OAAO,EACL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,GAAG,EACR,KAAK,UAAU,EAKhB,MAAM,KAAK,CAAA;AACZ,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AASlD;;;;GAIG;AACH,KAAK,YAAY,GAAG,MAAM,qBAAqB,CAAA;AAE/C,oDAAoD;AACpD,KAAK,yBAAyB,CAAC,CAAC,SAAS,YAAY,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAA;AAEjF;;;;;;GAMG;AACH,KAAK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EAAE,CAAC,oBAAoB,GAAG,mBAAmB,CAAC,EAAE,CAAA;KACzD,EAAE,CACJ,CAAA;IACD;;;OAGG;IACH,IAAI,EAAE,WAAW,CAAA;IACjB,kDAAkD;IAClD,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,sDAAsD;IACtD,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,yCAAyC;IACzC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAS,gBAAgB,CAAC,oBAAoB,EAAE,CAAqB,EACrE,SAAQ,gBAAgB,CAAC,mBAAmB,EAAE,CAAc,KAC3D,mBAmGF,CAAA;AAKD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,mBAAmB,EA4B3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiDiB,CAAA"}
@@ -1,41 +1,41 @@
1
- import { useModal as y } from "@scalar/components";
2
- import { ScalarIconArrowSquareIn as P, ScalarIconPackage as _, ScalarIconFolder as A, ScalarIconArrowUpRight as R, ScalarIconPuzzlePiece as b, ScalarIconBracketsCurly as q, ScalarIconCookie as L, ScalarIconSlidersHorizontal as $ } from "@scalar/icons";
3
- import d from "fuse.js";
4
- import { ref as p, shallowRef as x, computed as o, toValue as a } from "vue";
5
- import z from "../components/CommandPaletteExample.vue.js";
6
- import E from "../components/CommandPaletteImport.vue.js";
1
+ import { useModal as P } from "@scalar/components";
2
+ import { ScalarIconArrowSquareIn as _, ScalarIconPackage as A, ScalarIconFolder as R, ScalarIconArrowUpRight as b, ScalarIconPuzzlePiece as q, ScalarIconBracketsCurly as x, ScalarIconCookie as E, ScalarIconSlidersHorizontal as L } from "@scalar/icons";
3
+ import u from "fuse.js";
4
+ import { ref as p, shallowRef as $, computed as o, toValue as a } from "vue";
5
+ import f from "../components/CommandPaletteExample.vue.js";
6
+ import z from "../components/CommandPaletteImport.vue.js";
7
7
  import F from "../components/CommandPaletteImportCurl.vue.js";
8
8
  import O from "../components/CommandPaletteOpenApiDocument.vue.js";
9
9
  import U from "../components/CommandPaletteRequest.vue.js";
10
- import f from "../components/CommandPaletteTag.vue.js";
10
+ import v from "../components/CommandPaletteTag.vue.js";
11
11
  const W = (m = T, l = Q) => {
12
- const c = y(), n = p(""), i = x(null), s = p(null), v = o(() => c.open), C = o(
13
- () => new d(a(m), {
12
+ const c = P(), n = p(""), i = $(null), s = p(null), C = o(() => c.open), g = o(
13
+ () => new u(a(m), {
14
14
  keys: ["name"],
15
15
  threshold: 0.2
16
16
  })
17
- ), g = o(
18
- () => new d(a(l), {
17
+ ), h = o(
18
+ () => new u(a(l), {
19
19
  keys: ["name"],
20
20
  threshold: 0.2
21
21
  })
22
22
  ), S = o(() => {
23
23
  const e = n.value.toLowerCase().trim();
24
- return (e ? C.value.search(e).map((t) => t.item) : a(m)).filter((t) => !t.hidden);
25
- }), h = o(() => {
24
+ return (e ? g.value.search(e).map((t) => t.item) : a(m)).filter((t) => !t.hidden);
25
+ }), w = o(() => {
26
26
  const e = n.value.toLowerCase().trim();
27
- return e ? g.value.search(e).map((r) => r.item) : a(l);
28
- }), w = (e, ...r) => {
27
+ return e ? h.value.search(e).map((r) => r.item) : a(l);
28
+ }), I = (e, ...r) => {
29
29
  e && (i.value = a(m).find((t) => t.id === e) ?? null, s.value = r[0] ?? null), c.show();
30
- }, I = () => {
31
- c.hide(), u();
32
- }, k = (e) => {
30
+ }, k = () => {
31
+ c.hide(), d();
32
+ }, y = (e) => {
33
33
  n.value = e;
34
- }, u = () => {
34
+ }, d = () => {
35
35
  n.value = "", i.value = null, s.value = null;
36
36
  };
37
37
  return {
38
- isOpen: v,
38
+ isOpen: C,
39
39
  activeCommand: i,
40
40
  activeCommandProps: s,
41
41
  filterQuery: n,
@@ -46,20 +46,20 @@ const W = (m = T, l = Q) => {
46
46
  },
47
47
  {
48
48
  label: "Pages",
49
- commands: h.value
49
+ commands: w.value
50
50
  }
51
51
  ]),
52
- open: w,
53
- close: I,
54
- setFilterQuery: k,
55
- reset: u
52
+ open: I,
53
+ close: k,
54
+ setFilterQuery: y,
55
+ reset: d
56
56
  };
57
57
  }, Q = [
58
58
  {
59
59
  type: "route",
60
60
  id: "environment",
61
61
  name: "Environment",
62
- icon: q,
62
+ icon: x,
63
63
  to: {
64
64
  name: "workspace.environment"
65
65
  }
@@ -68,7 +68,7 @@ const W = (m = T, l = Q) => {
68
68
  type: "route",
69
69
  id: "cookies",
70
70
  name: "Cookies",
71
- icon: L,
71
+ icon: E,
72
72
  to: {
73
73
  name: "workspace.cookies"
74
74
  }
@@ -77,7 +77,7 @@ const W = (m = T, l = Q) => {
77
77
  type: "route",
78
78
  id: "settings",
79
79
  name: "Settings",
80
- icon: $,
80
+ icon: L,
81
81
  to: {
82
82
  name: "workspace.settings"
83
83
  }
@@ -86,32 +86,32 @@ const W = (m = T, l = Q) => {
86
86
  {
87
87
  id: "import-from-openapi-swagger-postman-curl",
88
88
  name: "Import from OpenAPI/Swagger/Postman/cURL",
89
- component: E,
90
- icon: P
89
+ component: z,
90
+ icon: _
91
91
  },
92
92
  {
93
93
  id: "create-openapi-document",
94
94
  name: "Create OpenAPI Document",
95
95
  component: O,
96
- icon: _
96
+ icon: A
97
97
  },
98
98
  {
99
99
  id: "add-tag",
100
100
  name: "Add Tag",
101
- component: f,
102
- icon: A
101
+ component: v,
102
+ icon: R
103
103
  },
104
104
  {
105
105
  id: "create-request",
106
106
  name: "Create Request",
107
107
  component: U,
108
- icon: R
108
+ icon: b
109
109
  },
110
110
  {
111
111
  id: "add-example",
112
112
  name: "Add Example",
113
- component: z,
114
- icon: b
113
+ component: f,
114
+ icon: q
115
115
  },
116
116
  {
117
117
  id: "import-curl-command",
@@ -123,6 +123,12 @@ const W = (m = T, l = Q) => {
123
123
  id: "edit-tag",
124
124
  name: "Edit Tag",
125
125
  hidden: !0,
126
+ component: v
127
+ },
128
+ {
129
+ id: "edit-example",
130
+ name: "Edit Example",
131
+ hidden: !0,
126
132
  component: f
127
133
  }
128
134
  ];
@@ -83,7 +83,7 @@ const P = {
83
83
  )
84
84
  )), x = t(
85
85
  () => b(a(e.options)?.hiddenClients)
86
- ), g = "2.34.0";
86
+ ), g = "2.36.0";
87
87
  return (n, o) => e.path && e.method && e.exampleName && r.value ? (m(), C(c(V), {
88
88
  key: 0,
89
89
  activeEnvironment: e.workspaceStore.workspace["x-scalar-active-environment"],
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-events.d.ts","sourceRoot":"","sources":["../../src/v2/workspace-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE3G,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAA;AAExC,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,kBAAkB,IAAI,OAAO,CAAC;IACtD,eAAe,EAAE,CACf,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClF,cAAc,EAAE,CAAC,OAAO,EAAE,kBAAkB,CA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gC,CAAC,EAC/C,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACjC,KAAK,EAAE,KAAK,CAAA;CACb,QAwSA"}
@@ -1,15 +1,15 @@
1
- import { generateClientMutators as n } from "@scalar/workspace-store/mutators";
1
+ import { generateClientMutators as c } from "@scalar/workspace-store/mutators";
2
2
  import { computed as p } from "vue";
3
- const r = (a, c, t) => async (o) => {
3
+ const r = (a, n, t) => async (o) => {
4
4
  const i = await t[a]?.onBeforeExecute?.(o) ?? o;
5
- return await c(i), await t[a]?.onAfterExecute?.(i), i;
5
+ return await n(i), await t[a]?.onAfterExecute?.(i), i;
6
6
  };
7
7
  function l({
8
8
  eventBus: a,
9
- store: c,
9
+ store: n,
10
10
  hooks: t
11
11
  }) {
12
- const o = p(() => n(c.value)), i = ({ collectionType: e }) => e === "document" ? o.value.active() : o.value.workspace();
12
+ const o = p(() => c(n.value)), i = ({ collectionType: e }) => e === "document" ? o.value.active() : o.value.workspace();
13
13
  a.on(
14
14
  "workspace:update:active-proxy",
15
15
  (e) => r("workspace:update:active-proxy", o.value.workspace().workspace.updateActiveProxy, t)(e)
@@ -159,6 +159,9 @@ function l({
159
159
  ), a.on(
160
160
  "operation:delete:example",
161
161
  (e) => r("operation:delete:example", o.value.active().operation.deleteOperationExample, t)(e)
162
+ ), a.on(
163
+ "operation:rename:example",
164
+ (e) => r("operation:rename:example", o.value.active().operation.renameOperationExample, t)(e)
162
165
  ), a.on(
163
166
  "operation:upsert:parameter",
164
167
  (e) => r("operation:upsert:parameter", o.value.active().operation.upsertOperationParameter, t)(e)
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
33
33
  }));
34
34
  }, f = (u) => {
35
35
  u?.createNew && g.name === "request" && p();
36
- }, v = "2.34.0";
36
+ }, v = "2.36.0";
37
37
  return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (u, e) => (l(), n("div", W, [
38
38
  s("div", {
39
39
  class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.34.0",
21
+ "version": "2.36.0",
22
22
  "engines": {
23
23
  "node": ">=22"
24
24
  },
@@ -335,25 +335,25 @@
335
335
  "yaml": "^2.8.0",
336
336
  "zod": "^4.3.5",
337
337
  "@scalar/analytics-client": "1.1.0",
338
- "@scalar/components": "0.20.2",
339
338
  "@scalar/draggable": "0.4.0",
340
- "@scalar/helpers": "0.3.0",
339
+ "@scalar/helpers": "0.4.0",
340
+ "@scalar/components": "0.20.4",
341
+ "@scalar/import": "0.5.1",
342
+ "@scalar/json-magic": "0.12.2",
341
343
  "@scalar/icons": "0.6.0",
342
- "@scalar/oas-utils": "0.10.1",
343
- "@scalar/object-utils": "1.3.0",
344
- "@scalar/openapi-parser": "0.25.1",
344
+ "@scalar/oas-utils": "0.10.3",
345
+ "@scalar/object-utils": "1.3.1",
346
+ "@scalar/openapi-parser": "0.25.2",
347
+ "@scalar/postman-to-openapi": "0.5.1",
345
348
  "@scalar/openapi-types": "0.6.0",
346
- "@scalar/postman-to-openapi": "0.5.0",
347
- "@scalar/snippetz": "0.7.0",
348
- "@scalar/sidebar": "0.8.2",
349
+ "@scalar/sidebar": "0.8.4",
349
350
  "@scalar/themes": "0.15.0",
350
- "@scalar/types": "0.7.0",
351
- "@scalar/use-codemirror": "0.14.2",
352
- "@scalar/use-hooks": "0.4.0",
351
+ "@scalar/snippetz": "0.7.2",
352
+ "@scalar/types": "0.7.2",
353
+ "@scalar/use-codemirror": "0.14.4",
353
354
  "@scalar/use-toasts": "0.10.0",
354
- "@scalar/workspace-store": "0.38.0",
355
- "@scalar/json-magic": "0.12.1",
356
- "@scalar/import": "0.5.0"
355
+ "@scalar/workspace-store": "0.39.0",
356
+ "@scalar/use-hooks": "0.4.0"
357
357
  },
358
358
  "devDependencies": {
359
359
  "@tailwindcss/vite": "^4.1.18",
@@ -368,9 +368,9 @@
368
368
  "vite": "^7.3.1",
369
369
  "vite-svg-loader": "5.1.0",
370
370
  "vitest": "4.0.16",
371
- "@scalar/galaxy": "0.6.0",
372
371
  "@scalar/build-tooling": "0.5.0",
373
- "@scalar/pre-post-request-scripts": "0.3.2"
372
+ "@scalar/pre-post-request-scripts": "0.3.4",
373
+ "@scalar/galaxy": "0.6.0"
374
374
  },
375
375
  "scripts": {
376
376
  "build": "scalar-build-vite",