@scalar/api-client 2.21.0 → 2.22.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 (71) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
  3. package/dist/components/OpenApiClientButton.vue.js +2 -2
  4. package/dist/components/OpenApiClientButton.vue2.js +1 -1
  5. package/dist/hooks/useClientConfig.d.ts +9 -0
  6. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  7. package/dist/layouts/App/create-api-client-app.d.ts +2 -2
  8. package/dist/layouts/Web/create-api-client-web.d.ts +2 -2
  9. package/dist/libs/create-client.d.ts +2 -2
  10. package/dist/store/request-example.d.ts +2 -2
  11. package/dist/store/store.d.ts +2 -2
  12. package/dist/style.css +1 -1
  13. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +2 -2
  14. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  15. package/dist/v2/blocks/operation-block/helpers/get-example.js +29 -22
  16. package/dist/v2/blocks/operation-block/index.d.ts +1 -0
  17. package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
  18. package/dist/v2/blocks/operation-block/index.js +2 -0
  19. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  20. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  21. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +4 -4
  22. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +3 -2
  23. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  24. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +96 -78
  25. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue3.js +5 -0
  26. package/dist/v2/features/app/App.vue.d.ts +3 -0
  27. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  28. package/dist/v2/features/app/App.vue.js +43 -42
  29. package/dist/v2/features/app/app-events.d.ts +1 -3
  30. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  31. package/dist/v2/features/app/app-events.js +37 -43
  32. package/dist/v2/features/app/app-state.d.ts +0 -2
  33. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  34. package/dist/v2/features/app/app-state.js +87 -90
  35. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  36. package/dist/v2/features/app/helpers/create-api-client-app.js +14 -8
  37. package/dist/v2/features/app/index.d.ts +1 -0
  38. package/dist/v2/features/app/index.d.ts.map +1 -1
  39. package/dist/v2/features/app/index.js +11 -7
  40. package/dist/v2/features/command-palette/{components/TheCommandPalette.vue.d.ts → TheCommandPalette.vue.d.ts} +3 -3
  41. package/dist/v2/features/command-palette/TheCommandPalette.vue.d.ts.map +1 -0
  42. package/dist/v2/features/command-palette/TheCommandPalette.vue.js +7 -0
  43. package/dist/v2/features/command-palette/TheCommandPalette.vue2.js +152 -0
  44. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +9 -2
  45. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
  46. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +61 -55
  47. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts +2 -2
  48. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts.map +1 -1
  49. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.js +1 -1
  50. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue2.js +26 -26
  51. package/dist/v2/features/command-palette/helpers/get-operation-from-curl.d.ts.map +1 -1
  52. package/dist/v2/features/command-palette/helpers/get-operation-from-curl.js +30 -24
  53. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +240 -151
  54. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  55. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +114 -102
  56. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  57. package/dist/v2/features/modal/Modal.vue.js +2 -2
  58. package/dist/v2/features/modal/Modal.vue2.js +17 -15
  59. package/dist/v2/features/operation/Operation.vue.js +1 -1
  60. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +2 -2
  61. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  62. package/package.json +17 -22
  63. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue2.js +0 -4
  64. package/dist/v2/features/command-palette/components/TheCommandPalette.vue.d.ts.map +0 -1
  65. package/dist/v2/features/command-palette/components/TheCommandPalette.vue.js +0 -7
  66. package/dist/v2/features/command-palette/components/TheCommandPalette.vue2.js +0 -172
  67. package/dist/v2/features/command-palette/components/index.d.ts +0 -2
  68. package/dist/v2/features/command-palette/components/index.d.ts.map +0 -1
  69. package/dist/v2/features/command-palette/components/index.js +0 -4
  70. package/dist/v2/features/command-palette/types.d.ts +0 -83
  71. package/dist/v2/features/command-palette/types.d.ts.map +0 -1
@@ -1,111 +1,123 @@
1
- import { useModal as g } from "@scalar/components";
2
- import { ref as s, computed as c } from "vue";
3
- const n = () => null, v = [
4
- {
5
- label: "",
6
- commands: [
7
- {
8
- type: "folder",
9
- id: "import-from-openapi-swagger-postman-curl",
10
- name: "Import from OpenAPI/Swagger/Postman/cURL",
11
- icon: "Import"
12
- },
13
- {
14
- type: "folder",
15
- id: "create-document",
16
- name: "Create Document",
17
- icon: "Collection"
18
- },
19
- {
20
- type: "folder",
21
- id: "add-tag",
22
- name: "Add Tag",
23
- icon: "Folder",
24
- props: n()
25
- },
26
- {
27
- type: "folder",
28
- id: "create-request",
29
- name: "Create Request",
30
- icon: "ExternalLink",
31
- props: n()
32
- },
1
+ import { useModal as I } from "@scalar/components";
2
+ import { ScalarIconArrowSquareIn as k, ScalarIconPackage as y, ScalarIconFolder as _, ScalarIconArrowUpRight as P, ScalarIconPuzzlePiece as A, ScalarIconBracketsCurly as R, ScalarIconCookie as q, ScalarIconSlidersHorizontal as b } from "@scalar/icons";
3
+ import l from "fuse.js";
4
+ import { ref as u, shallowRef as L, computed as t } from "vue";
5
+ import $ from "../components/CommandPaletteDocument.vue.js";
6
+ import x from "../components/CommandPaletteExample.vue.js";
7
+ import z from "../components/CommandPaletteImport.vue.js";
8
+ import F from "../components/CommandPaletteImportCurl.vue.js";
9
+ import U from "../components/CommandPaletteRequest.vue.js";
10
+ import E from "../components/CommandPaletteTag.vue.js";
11
+ const V = (a = Q, i = O) => {
12
+ const r = I(), n = u(""), m = L(null), c = u(null), d = t(() => r.open), p = new l(a, {
13
+ keys: ["name"],
14
+ threshold: 0.1
15
+ }), f = new l(i, {
16
+ keys: ["name"],
17
+ threshold: 0.1
18
+ }), v = t(() => {
19
+ const e = n.value.toLowerCase().trim();
20
+ return (e ? p.search(e).map((o) => o.item) : a).filter((o) => !o.hidden);
21
+ }), C = t(() => {
22
+ const e = n.value.toLowerCase().trim();
23
+ return e ? f.search(e).map((o) => o.item) : i;
24
+ }), S = (e, ...o) => {
25
+ e && (m.value = a.find((h) => h.id === e) ?? null, c.value = o[0] ?? null), r.show();
26
+ }, w = () => {
27
+ r.hide(), s();
28
+ }, g = (e) => {
29
+ n.value = e;
30
+ }, s = () => {
31
+ n.value = "", m.value = null, c.value = null;
32
+ };
33
+ return {
34
+ isOpen: d,
35
+ activeCommand: m,
36
+ activeCommandProps: c,
37
+ filterQuery: n,
38
+ filteredCommands: t(() => [
33
39
  {
34
- type: "folder",
35
- id: "add-example",
36
- name: "Add Example",
37
- icon: "Example",
38
- props: n()
40
+ label: "",
41
+ commands: v.value
39
42
  },
40
- /** Hidden commands accessible programmatically but not shown in UI */
41
43
  {
42
- type: "hidden-folder",
43
- id: "import-curl-command",
44
- name: "Import cURL Command",
45
- props: n()
44
+ label: "Pages",
45
+ commands: C.value
46
46
  }
47
- ]
47
+ ]),
48
+ open: S,
49
+ close: w,
50
+ setFilterQuery: g,
51
+ reset: s
52
+ };
53
+ }, O = [
54
+ {
55
+ type: "route",
56
+ id: "environment",
57
+ name: "Environment",
58
+ icon: R,
59
+ to: {
60
+ name: "workspace.environment"
61
+ }
48
62
  },
49
63
  {
50
- label: "Pages",
51
- commands: [
52
- {
53
- type: "route",
54
- id: "environment",
55
- name: "Environment",
56
- icon: "Brackets",
57
- to: {
58
- name: "workspace.environment"
59
- }
60
- },
61
- {
62
- type: "route",
63
- id: "cookies",
64
- name: "Cookies",
65
- icon: "Cookie",
66
- to: {
67
- name: "workspace.cookies"
68
- }
69
- },
70
- {
71
- type: "route",
72
- id: "settings",
73
- name: "Settings",
74
- icon: "Settings",
75
- to: {
76
- name: "workspace.settings"
77
- }
78
- }
79
- ]
64
+ type: "route",
65
+ id: "cookies",
66
+ name: "Cookies",
67
+ icon: q,
68
+ to: {
69
+ name: "workspace.cookies"
70
+ }
71
+ },
72
+ {
73
+ type: "route",
74
+ id: "settings",
75
+ name: "Settings",
76
+ icon: b,
77
+ to: {
78
+ name: "workspace.settings"
79
+ }
80
80
  }
81
- ], w = () => {
82
- const r = g(), t = s(""), a = s(null), m = s(null), d = c(() => r.open), p = c(() => {
83
- const e = t.value.toLowerCase().trim();
84
- return v.map((o) => ({
85
- label: o.label,
86
- commands: o.commands.filter((i) => i.type === "hidden-folder" ? !1 : e ? i.name.toLowerCase().includes(e) : !0)
87
- })).filter((o) => o.commands.length > 0);
88
- }), u = (e, ...o) => {
89
- e && (a.value = e, m.value = o[0] ?? null), r.show();
90
- }, f = () => {
91
- r.hide(), l();
92
- }, y = (e) => {
93
- t.value = e;
94
- }, l = () => {
95
- t.value = "", a.value = null, m.value = null;
96
- };
97
- return {
98
- isOpen: d,
99
- activeCommand: a,
100
- activeCommandProps: m,
101
- filterQuery: t,
102
- filteredCommands: p,
103
- open: u,
104
- close: f,
105
- setFilterQuery: y,
106
- reset: l
107
- };
108
- };
81
+ ], Q = [
82
+ {
83
+ id: "import-from-openapi-swagger-postman-curl",
84
+ name: "Import from OpenAPI/Swagger/Postman/cURL",
85
+ component: z,
86
+ icon: k
87
+ },
88
+ {
89
+ id: "create-document",
90
+ name: "Create Document",
91
+ component: $,
92
+ icon: y
93
+ },
94
+ {
95
+ id: "add-tag",
96
+ name: "Add Tag",
97
+ component: E,
98
+ icon: _
99
+ },
100
+ {
101
+ id: "create-request",
102
+ name: "Create Request",
103
+ component: U,
104
+ icon: P
105
+ },
106
+ {
107
+ id: "add-example",
108
+ name: "Add Example",
109
+ component: x,
110
+ icon: A
111
+ },
112
+ {
113
+ id: "import-curl-command",
114
+ name: "Import cURL Command",
115
+ hidden: !0,
116
+ component: F
117
+ }
118
+ ];
109
119
  export {
110
- w as useCommandPaletteState
120
+ Q as baseClientActions,
121
+ O as baseRoutes,
122
+ V as useCommandPaletteState
111
123
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"AA6YA,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;AAIZ,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAIxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKxD,MAAM,MAAM,UAAU,GAAG;IACvB,4DAA4D;IAC5D,cAAc,EAAE,cAAc,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACrC,4CAA4C;IAC5C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,mDAAmD;IACnD,MAAM,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC3C,yDAAyD;IACzD,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAA;IACtB,0DAA0D;IAC1D,YAAY,EAAE,qBAAqB,CAAA;IACnC,iDAAiD;IACjD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,CACvB,OAAO,CACL,IAAI,CACF,4BAA4B,EAC1B,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,SAAS,CACZ,CACF,CACF,CAAA;CACF,CAAA;AAED;;;;GAIG;;;;;AACH,wBAqWC"}
1
+ {"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"AAkZA,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;AAIZ,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAIxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKxD,MAAM,MAAM,UAAU,GAAG;IACvB,4DAA4D;IAC5D,cAAc,EAAE,cAAc,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACrC,4CAA4C;IAC5C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,mDAAmD;IACnD,MAAM,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC3C,yDAAyD;IACzD,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAA;IACtB,0DAA0D;IAC1D,YAAY,EAAE,qBAAqB,CAAA;IACnC,iDAAiD;IACjD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,CACvB,OAAO,CACL,IAAI,CACF,4BAA4B,EAC1B,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,SAAS,CACZ,CACF,CACF,CAAA;CACF,CAAA;AAED;;;;GAIG;;;;;AACH,wBA0WC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Modal.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-9f4696a7"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b54530a3"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as W, ref as w, useId as I, watch as N, nextTick as D, onBeforeMount as E, onBeforeUnmount as F, computed as d, toValue as U, withDirectives as k, createElementBlock as u, openBlock as m, createElementVNode as i, unref as o, createVNode as l, withCtx as V, vShow as b } from "vue";
1
+ import { defineComponent as W, ref as w, useId as D, watch as I, nextTick as N, onBeforeMount as E, onBeforeUnmount as F, computed as d, toValue as U, withDirectives as k, createElementBlock as u, openBlock as m, createElementVNode as s, unref as o, createVNode as l, withCtx as V, vShow as b } from "vue";
2
2
  import { addScalarClassesToHeadless as A, ScalarTeleportRoot as $ } from "@scalar/components";
3
3
  import { ScalarToasts as z } from "@scalar/use-toasts";
4
4
  import { useFocusTrap as H } from "@vueuse/integrations/useFocusTrap";
@@ -44,20 +44,22 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
44
44
  modalState: e.modalState,
45
45
  store: e.workspaceStore
46
46
  }), j(e.eventBus, "modal");
47
- const v = w(null), f = I(), { activate: p, deactivate: y } = H(v, {
47
+ const v = w(null), f = D(), { activate: y, deactivate: B } = H(v, {
48
48
  allowOutsideClick: !0,
49
49
  fallbackFocus: `#${f}`
50
50
  }), S = () => {
51
- y(), e.eventBus.emit("operation:cancel:request");
52
- }, B = q(() => typeof window < "u" ? window.document.body : null);
53
- N(
51
+ B(), e.eventBus.emit("operation:cancel:request"), e.workspaceStore.revertDocumentChanges(
52
+ e.document.value?.["x-scalar-navigation"]?.name ?? ""
53
+ );
54
+ }, g = q(() => typeof window < "u" ? window.document.body : null);
55
+ I(
54
56
  () => e.modalState.open,
55
57
  (a) => {
56
- B.value = a, a ? p({ checkCanFocusTrap: () => D() }) : S();
58
+ g.value = a, a ? y({ checkCanFocusTrap: () => N() }) : S();
57
59
  }
58
60
  ), E(() => A()), F(() => S());
59
- const g = 288, c = d(
60
- () => e.workspaceStore?.workspace?.["x-scalar-sidebar-width"] ?? g
61
+ const p = 288, c = d(
62
+ () => e.workspaceStore?.workspace?.["x-scalar-sidebar-width"] ?? p
61
63
  ), T = (a) => e.workspaceStore?.update("x-scalar-sidebar-width", a), h = d(
62
64
  () => R(e.workspaceStore, e.document.value)
63
65
  ), C = d(
@@ -70,8 +72,8 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
70
72
  sidebarWidth: c,
71
73
  environment: h
72
74
  }), (a, t) => k((m(), u("div", P, [
73
- i("div", J, [
74
- i("div", {
75
+ s("div", J, [
76
+ s("div", {
75
77
  id: o(f),
76
78
  ref_key: "client",
77
79
  ref: v,
@@ -87,13 +89,13 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
87
89
  e.document.value && e.path?.value && e.method?.value ? (m(), u("main", X, [
88
90
  l(o(G), {
89
91
  modelValue: n.value,
90
- "onUpdate:modelValue": t[0] || (t[0] = (s) => n.value = s),
92
+ "onUpdate:modelValue": t[0] || (t[0] = (i) => n.value = i),
91
93
  class: "absolute top-2 left-3 z-[10001]"
92
94
  }, null, 8, ["modelValue"]),
93
95
  k(l(o(K), {
94
96
  sidebarWidth: c.value,
95
97
  "onUpdate:sidebarWidth": [
96
- t[1] || (t[1] = (s) => c.value = s),
98
+ t[1] || (t[1] = (i) => c.value = i),
97
99
  T
98
100
  ],
99
101
  activeWorkspace: r,
@@ -125,15 +127,15 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
125
127
  workspaceStore: e.workspaceStore
126
128
  }, null, 8, ["document", "documentSlug", "environment", "eventBus", "exampleName", "method", "options", "path", "plugins", "securitySchemes", "workspaceStore"])
127
129
  ])) : (m(), u("div", Y, [...t[3] || (t[3] = [
128
- i("span", { class: "text-c-3" }, "No document selected", -1)
130
+ s("span", { class: "text-c-3" }, "No document selected", -1)
129
131
  ])]))
130
132
  ]),
131
133
  _: 1
132
134
  })
133
135
  ], 8, Q),
134
- i("div", {
136
+ s("div", {
135
137
  class: "scalar-app-exit",
136
- onClick: t[2] || (t[2] = (s) => e.modalState.hide())
138
+ onClick: t[2] || (t[2] = (i) => e.modalState.hide())
137
139
  })
138
140
  ])
139
141
  ], 512)), [
@@ -69,7 +69,7 @@ const b = {
69
69
  type: "document"
70
70
  }), h = n(
71
71
  () => C(o(e.options)?.hiddenClients)
72
- ), f = "2.21.0";
72
+ ), f = "2.22.0";
73
73
  return (t, a) => e.path && e.method && e.exampleName && l.value ? (c(), x(i(p), {
74
74
  key: 0,
75
75
  appVersion: i(f),
@@ -19,7 +19,7 @@ type __VLS_Props = {
19
19
  label?: string;
20
20
  };
21
21
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
22
- updateRow: (idx: number, field: "value" | "key", value: string) => any;
22
+ updateRow: (idx: number, field: "key" | "value", value: string) => any;
23
23
  toggleRow: (idx: number, enabled: boolean) => any;
24
24
  addRow: () => any;
25
25
  deleteRow: (idx: number) => any;
@@ -28,7 +28,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
28
28
  uploadFile: (idx: number) => any;
29
29
  removeFile: (idx: number) => any;
30
30
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
31
- onUpdateRow?: ((idx: number, field: "value" | "key", value: string) => any) | undefined;
31
+ onUpdateRow?: ((idx: number, field: "key" | "value", value: string) => any) | undefined;
32
32
  onToggleRow?: ((idx: number, enabled: boolean) => any) | undefined;
33
33
  onAddRow?: (() => any) | undefined;
34
34
  onDeleteRow?: ((idx: number) => any) | undefined;
@@ -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.21.0";
36
+ }, v = "2.22.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.21.0",
21
+ "version": "2.22.0",
22
22
  "engines": {
23
23
  "node": ">=20"
24
24
  },
@@ -221,11 +221,6 @@
221
221
  "types": "./dist/v2/features/app/components/index.d.ts",
222
222
  "default": "./dist/v2/features/app/components/index.js"
223
223
  },
224
- "./v2/features/command-palette/components": {
225
- "import": "./dist/v2/features/command-palette/components/index.js",
226
- "types": "./dist/v2/features/command-palette/components/index.d.ts",
227
- "default": "./dist/v2/features/command-palette/components/index.js"
228
- },
229
224
  "./v2/features/environments": {
230
225
  "import": "./dist/v2/features/environments/index.js",
231
226
  "types": "./dist/v2/features/environments/index.d.ts",
@@ -323,34 +318,34 @@
323
318
  "type-fest": "^5.3.1",
324
319
  "vue": "^3.5.26",
325
320
  "vue-router": "4.6.2",
326
- "whatwg-mimetype": "^4.0.0",
321
+ "whatwg-mimetype": "4.0.0",
327
322
  "yaml": "^2.8.0",
328
323
  "zod": "^4.3.5",
329
- "@scalar/components": "0.16.31",
324
+ "@scalar/draggable": "0.3.0",
330
325
  "@scalar/analytics-client": "1.0.1",
326
+ "@scalar/components": "0.17.0",
331
327
  "@scalar/helpers": "0.2.9",
332
- "@scalar/draggable": "0.3.0",
333
- "@scalar/import": "0.4.46",
334
328
  "@scalar/icons": "0.5.2",
329
+ "@scalar/import": "0.4.46",
335
330
  "@scalar/json-magic": "0.9.4",
336
- "@scalar/oas-utils": "0.6.28",
337
- "@scalar/object-utils": "1.2.23",
331
+ "@scalar/oas-utils": "0.6.30",
338
332
  "@scalar/openapi-parser": "0.24.5",
339
333
  "@scalar/openapi-types": "0.5.3",
340
- "@scalar/sidebar": "0.7.21",
341
334
  "@scalar/postman-to-openapi": "0.4.1",
342
- "@scalar/themes": "0.13.26",
343
- "@scalar/types": "0.5.10",
344
- "@scalar/snippetz": "0.6.8",
345
- "@scalar/use-codemirror": "0.13.25",
346
- "@scalar/use-hooks": "0.3.6",
335
+ "@scalar/object-utils": "1.2.23",
336
+ "@scalar/sidebar": "0.7.23",
337
+ "@scalar/types": "0.6.0",
338
+ "@scalar/snippetz": "0.6.9",
347
339
  "@scalar/use-toasts": "0.9.1",
348
- "@scalar/workspace-store": "0.27.0"
340
+ "@scalar/themes": "0.14.0",
341
+ "@scalar/use-codemirror": "0.13.27",
342
+ "@scalar/workspace-store": "0.27.2",
343
+ "@scalar/use-hooks": "0.3.6"
349
344
  },
350
345
  "devDependencies": {
351
346
  "@tailwindcss/vite": "^4.1.18",
352
347
  "@types/shell-quote": "^1.7.5",
353
- "@types/whatwg-mimetype": "^3.0.2",
348
+ "@types/whatwg-mimetype": "3.0.2",
354
349
  "@vitejs/plugin-vue": "^6.0.3",
355
350
  "@vue/test-utils": "2.4.6",
356
351
  "fake-indexeddb": "6.2.3",
@@ -360,8 +355,8 @@
360
355
  "vite": "^7.3.1",
361
356
  "vite-svg-loader": "5.1.0",
362
357
  "vitest": "4.0.16",
363
- "@scalar/build-tooling": "0.4.1",
364
- "@scalar/galaxy": "0.5.12"
358
+ "@scalar/galaxy": "0.5.12",
359
+ "@scalar/build-tooling": "0.4.1"
365
360
  },
366
361
  "scripts": {
367
362
  "build": "scalar-build-vite",
@@ -1,4 +0,0 @@
1
- import f from "./OAuthScopesInput.vue.js";
2
- export {
3
- f as default
4
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/TheCommandPalette.vue"],"names":[],"mappings":"AAoXA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAUvE,OAAO,KAAK,EAKV,4BAA4B,EAC7B,MAAM,+DAA+D,CAAA;AAItE;;;;;;;;;;;;;;;;;;;;GAoBG;;IAGD,gDAAgD;kBAClC,4BAA4B;IAC1C,iEAAiE;oBACjD,cAAc;IAC9B,8CAA8C;cACpC,iBAAiB;;IAL3B,gDAAgD;kBAClC,4BAA4B;IAC1C,iEAAiE;oBACjD,cAAc;IAC9B,8CAA8C;cACpC,iBAAiB;;AAP7B,wBA6dC"}
@@ -1,7 +0,0 @@
1
- import o from "./TheCommandPalette.vue2.js";
2
- /* empty css */
3
- import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7f3e459b"]]);
5
- export {
6
- r as default
7
- };
@@ -1,172 +0,0 @@
1
- import { defineComponent as $, ref as N, computed as E, watch as _, createBlock as f, openBlock as l, unref as s, withCtx as p, createElementVNode as c, createVNode as i, createElementBlock as r, createTextVNode as I, createCommentVNode as v, withKeys as C, withModifiers as h, Fragment as S, renderList as O, withDirectives as K, toDisplayString as D, vShow as R, normalizeClass as V, resolveDynamicComponent as X, mergeProps as A, nextTick as Q } from "vue";
2
- import { Dialog as F, DialogPanel as q, DialogTitle as H } from "@headlessui/vue";
3
- import { ScalarIcon as x } from "@scalar/components";
4
- import { useRouter as W } from "vue-router";
5
- import j from "./CommandPaletteDocument.vue.js";
6
- import G from "./CommandPaletteExample.vue.js";
7
- import J from "./CommandPaletteImport.vue.js";
8
- import U from "./CommandPaletteImportCurl.vue.js";
9
- import Y from "./CommandPaletteRequest.vue.js";
10
- import Z from "./CommandPaletteTag.vue.js";
11
- const ee = {
12
- key: 0,
13
- class: "custom-scroll max-h-[50dvh] min-h-0 flex-1 rounded-lg p-1.5"
14
- }, te = { class: "bg-b-2 focus-within:bg-b-1 sticky top-0 flex items-center rounded-md border border-transparent pl-2 shadow-[0_-8px_0_8px_var(--scalar-background-1),0_0_8px_8px_var(--scalar-background-1)] focus-within:border-(--scalar-background-3)" }, ae = { for: "commandmenu" }, ne = ["value", "onKeydown"], oe = ["id", "onClick"], le = {
15
- key: 0,
16
- class: "text-c-3 p-2 pt-3 text-center text-sm"
17
- }, re = {
18
- key: 1,
19
- class: "flex-1 p-1.5"
20
- }, se = {}, ye = /* @__PURE__ */ $({
21
- ...se,
22
- __name: "TheCommandPalette",
23
- props: {
24
- paletteState: {},
25
- workspaceStore: {},
26
- eventBus: {}
27
- },
28
- setup(e) {
29
- const T = {
30
- "import-from-openapi-swagger-postman-curl": J,
31
- "create-document": j,
32
- "create-request": Y,
33
- "add-tag": Z,
34
- "add-example": G,
35
- "import-curl-command": U
36
- }, B = W(), m = N(-1), y = N(null), u = E(
37
- () => e.paletteState.filteredCommands.value.flatMap((t) => t.commands)
38
- ), d = E(
39
- () => u.value[m.value]
40
- );
41
- _(
42
- () => e.paletteState.filterQuery.value,
43
- (t) => {
44
- m.value = t && u.value.length > 0 ? 0 : -1;
45
- }
46
- );
47
- const P = (t) => {
48
- e.paletteState.setFilterQuery(t), t.trim().toLowerCase().startsWith("curl") && e.paletteState.open("import-curl-command", { curl: t });
49
- }, k = (t, a) => {
50
- if (!e.paletteState.isOpen.value)
51
- return;
52
- a.preventDefault();
53
- const n = t === "up" ? -1 : 1, o = u.value.length;
54
- m.value = (m.value + n + o) % o;
55
- }, z = (t) => {
56
- !d.value || e.paletteState.activeCommand.value || (t.preventDefault(), t.stopPropagation(), b(d.value));
57
- }, b = (t) => {
58
- if (t.type === "route") {
59
- B.push(t.to), w();
60
- return;
61
- }
62
- t.type === "folder" && e.paletteState.open(t.id, void 0);
63
- }, g = () => {
64
- e.paletteState.reset(), Q(() => y.value?.focus());
65
- }, L = () => {
66
- e.paletteState.close();
67
- }, M = (...t) => {
68
- e.paletteState.open(...t);
69
- }, w = () => {
70
- e.paletteState.close(), m.value = -1;
71
- };
72
- return (t, a) => (l(), f(s(F), {
73
- open: e.paletteState.isOpen.value,
74
- onClose: w
75
- }, {
76
- default: p(() => [
77
- a[4] || (a[4] = c("div", { class: "commandmenu-overlay z-overlay" }, null, -1)),
78
- i(s(q), { class: "commandmenu z-overlay flex flex-col" }, {
79
- default: p(() => [
80
- i(s(H), { class: "sr-only" }, {
81
- default: p(() => [...a[3] || (a[3] = [
82
- I("API Client Command Menu", -1)
83
- ])]),
84
- _: 1
85
- }),
86
- e.paletteState.activeCommand.value ? (l(), r("div", re, [
87
- c("button", {
88
- class: "hover:bg-b-3 text-c-3 active:text-c-1 absolute z-1 mt-[0.5px] rounded p-1.5",
89
- type: "button",
90
- onClick: g
91
- }, [
92
- i(s(x), {
93
- icon: "ChevronLeft",
94
- size: "md",
95
- thickness: "1.5"
96
- })
97
- ]),
98
- e.paletteState.activeCommand.value ? (l(), f(X(T[e.paletteState.activeCommand.value]), A({ key: 0 }, {
99
- workspaceStore: e.workspaceStore,
100
- eventBus: e.eventBus,
101
- ...e.paletteState.activeCommandProps.value
102
- }, {
103
- onBack: g,
104
- onClose: L,
105
- onOpenCommand: M
106
- }), null, 16)) : v("", !0)
107
- ])) : (l(), r("div", ee, [
108
- c("div", te, [
109
- c("label", ae, [
110
- i(s(x), {
111
- class: "text-c-2 mr-2.5",
112
- icon: "Search",
113
- size: "md",
114
- thickness: "1.5"
115
- })
116
- ]),
117
- c("input", {
118
- id: "commandmenu",
119
- ref_key: "commandInputRef",
120
- ref: y,
121
- autocomplete: "off",
122
- autofocus: "",
123
- class: "w-full rounded border-none bg-none py-1.5 text-sm focus:outline-none",
124
- placeholder: "Search commands...",
125
- type: "text",
126
- value: e.paletteState.filterQuery.value,
127
- onInput: a[0] || (a[0] = (n) => P(n.target.value)),
128
- onKeydown: [
129
- a[1] || (a[1] = C(h((n) => k("down", n), ["stop"]), ["down"])),
130
- C(h(z, ["stop"]), ["enter"]),
131
- a[2] || (a[2] = C(h((n) => k("up", n), ["stop"]), ["up"]))
132
- ]
133
- }, null, 40, ne)
134
- ]),
135
- (l(!0), r(S, null, O(e.paletteState.filteredCommands.value, (n) => (l(), r(S, {
136
- key: n.label
137
- }, [
138
- K(c("div", { class: "text-c-3 mt-2 mb-1 px-2 text-xs font-medium" }, D(n.label), 513), [
139
- [R, n.commands.length > 0]
140
- ]),
141
- (l(!0), r(S, null, O(n.commands, (o) => (l(), r("button", {
142
- id: o.id,
143
- key: o.id,
144
- class: V(["commandmenu-item hover:bg-b-2 flex w-full cursor-pointer items-center rounded px-2 py-1.5 text-left text-sm", {
145
- "bg-b-2": o.id === d.value?.id
146
- }]),
147
- type: "button",
148
- onClick: (me) => b(o)
149
- }, [
150
- "icon" in o ? (l(), f(s(x), {
151
- key: 0,
152
- class: "text-c-2 mr-2.5",
153
- icon: o.icon,
154
- size: "md",
155
- thickness: "1.5"
156
- }, null, 8, ["icon"])) : v("", !0),
157
- I(" " + D(o.name), 1)
158
- ], 10, oe))), 128))
159
- ], 64))), 128)),
160
- e.paletteState.filteredCommands.value.length ? v("", !0) : (l(), r("div", le, " No commands found "))
161
- ]))
162
- ]),
163
- _: 1
164
- })
165
- ]),
166
- _: 1
167
- }, 8, ["open"]));
168
- }
169
- });
170
- export {
171
- ye as default
172
- };
@@ -1,2 +0,0 @@
1
- export { default as TheCommandPalette } from './TheCommandPalette.vue.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
@@ -1,4 +0,0 @@
1
- import { default as t } from "./TheCommandPalette.vue.js";
2
- export {
3
- t as TheCommandPalette
4
- };