@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,4 +1,4 @@
1
- import type { ExampleObject, ParameterObject, RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
1
+ import type { ExampleObject, MediaTypeObject, ParameterObject, RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
2
  /**
3
3
  * Resolve an example value for a parameter or requestBody from either `examples` or `content.*.examples`.
4
4
  * Or the [deprecated] `example` field.
@@ -6,5 +6,5 @@ import type { ExampleObject, ParameterObject, RequestBodyObject } from '@scalar/
6
6
  * `example` field.
7
7
  * Used both for send-request and generating code snippets.
8
8
  */
9
- export declare const getExample: (param: ParameterObject | RequestBodyObject, exampleKey: string | undefined, contentType: string | undefined) => ExampleObject | undefined;
9
+ export declare const getExample: (param: ParameterObject | RequestBodyObject | MediaTypeObject, exampleKey: string | undefined, contentType: string | undefined) => ExampleObject | undefined;
10
10
  //# sourceMappingURL=get-example.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-example.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/get-example.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,iBAAiB,EAClB,MAAM,8DAA8D,CAAA;AAIrE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,eAAe,GAAG,iBAAiB,EAC1C,YAAY,MAAM,GAAG,SAAS,EAC9B,aAAa,MAAM,GAAG,SAAS,KAC9B,aAAa,GAAG,SA6DlB,CAAA"}
1
+ {"version":3,"file":"get-example.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/get-example.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,iBAAiB,EAClB,MAAM,8DAA8D,CAAA;AA6BrE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,eAAe,GAAG,iBAAiB,GAAG,eAAe,EAC5D,YAAY,MAAM,GAAG,SAAS,EAC9B,aAAa,MAAM,GAAG,SAAS,KAC9B,aAAa,GAAG,SA6ClB,CAAA"}
@@ -1,29 +1,36 @@
1
- import { getResolvedRef as l } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
1
  import { getResolvedRefDeep as s } from "../../operation-code-sample/helpers/get-resolved-ref-deep.js";
3
- const d = (n, c, o) => {
4
- if ("content" in n) {
5
- const t = n.content?.[o ?? Object.keys(n.content)[0] ?? ""], f = t?.examples ?? {}, m = c || Object.keys(f)[0] || "", i = s(f[m]);
6
- return typeof i < "u" ? i : !c && t?.example ? { value: s(t.example) } : void 0;
2
+ const r = (t, n, o) => {
3
+ if (!t && !n)
4
+ return;
5
+ const i = o || Object.keys(t ?? {})[0] || "", e = s(t?.[i]);
6
+ if (e !== void 0)
7
+ return e;
8
+ if (!o && n !== void 0)
9
+ return { value: s(n) };
10
+ }, c = (t, n, o) => {
11
+ if ("content" in t) {
12
+ const e = t.content?.[o ?? Object.keys(t.content)[0] ?? ""], u = r(e?.examples, e?.example, n);
13
+ if (u !== void 0)
14
+ return u;
7
15
  }
8
- if ("examples" in n || "example" in n) {
9
- const t = l(n.examples) ?? {}, f = c || Object.keys(t)[0] || "", m = s(t?.[f]);
10
- if (typeof m < "u")
11
- return m;
12
- if (!c && n.example)
13
- return { value: s(n.example) };
16
+ if ("examples" in t || "example" in t) {
17
+ const e = r(t.examples, t.example, n);
18
+ if (e !== void 0)
19
+ return e;
14
20
  }
15
- const e = s(n);
16
- if ("schema" in e && e.schema) {
17
- if ("default" in e.schema && typeof e.schema.default < "u")
18
- return { value: e.schema.default };
19
- if ("enum" in e.schema && typeof e.schema.enum?.[0] < "u")
20
- return { value: e.schema.enum[0] };
21
- if ("examples" in e.schema && typeof e.schema.examples?.[0] < "u")
22
- return { value: e.schema.examples[0] };
23
- if ("example" in e.schema && typeof e.schema.example < "u")
24
- return { value: e.schema.example };
21
+ const i = s(t);
22
+ if ("schema" in i && i.schema) {
23
+ const e = i.schema;
24
+ if ("default" in e && e.default !== void 0)
25
+ return { value: e.default };
26
+ if ("enum" in e && e.enum?.[0] !== void 0)
27
+ return { value: e.enum[0] };
28
+ if ("examples" in e && e.examples?.[0] !== void 0)
29
+ return { value: e.examples[0] };
30
+ if ("example" in e && e.example !== void 0)
31
+ return { value: e.example };
25
32
  }
26
33
  };
27
34
  export {
28
- d as getExample
35
+ c as getExample
29
36
  };
@@ -1,3 +1,4 @@
1
1
  export { getSecuritySchemes } from './helpers/build-request-security.js';
2
+ export { getExample } from './helpers/get-example.js';
2
3
  export { default as OperationBlock } from './OperationBlock.vue.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
@@ -1,6 +1,8 @@
1
1
  import { getSecuritySchemes as r } from "./helpers/build-request-security.js";
2
+ import { getExample as m } from "./helpers/get-example.js";
2
3
  import { default as a } from "./OperationBlock.vue.js";
3
4
  export {
4
5
  a as OperationBlock,
6
+ m as getExample,
5
7
  r as getSecuritySchemes
6
8
  };
@@ -1,7 +1,7 @@
1
1
  import { canMethodHaveBody as p } from "@scalar/helpers/http/can-method-have-body";
2
2
  import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
3
  import { isElectron as u } from "../../../../libs/electron.js";
4
- const i = "2.21.0", m = "application/json", h = "*/*", c = (r, t, a) => ({
4
+ const i = "2.22.0", m = "application/json", h = "*/*", c = (r, t, a) => ({
5
5
  name: r,
6
6
  defaultValue: t,
7
7
  isOverridden: a.has(r.toLowerCase())
@@ -1,7 +1,7 @@
1
1
  import o from "./AddressBar.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-cf2e36b4"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-40b876ba"]]);
5
5
  export {
6
- e as default
6
+ m as default
7
7
  };
@@ -28,8 +28,8 @@ const se = ["id"], ae = { class: "pointer-events-none absolute top-0 left-0 bloc
28
28
  environment: {}
29
29
  },
30
30
  emits: ["execute", "update:servers", "select:history:item"],
31
- setup(e, { expose: $, emit: V }) {
32
- const d = V, f = H(), { percentage: q, startLoading: b, stopLoading: v, isLoading: L } = ee(), T = k(() => ({
31
+ setup(e, { expose: V, emit: $ }) {
32
+ const d = $, f = H(), { percentage: q, startLoading: b, stopLoading: v, isLoading: L } = ee(), T = k(() => ({
33
33
  backgroundColor: `color-mix(in srgb, transparent 90%, ${J[e.method].colorVar})`,
34
34
  transform: `translate3d(-${q.value}%,0,0)`
35
35
  })), i = w(null), r = w(null), g = k(() => r.value || i.value), y = (n, t, s) => {
@@ -66,7 +66,7 @@ const se = ["id"], ae = { class: "pointer-events-none absolute top-0 left-0 bloc
66
66
  _({ environment: e.environment, server: e.server, path: e.path, pathVariables: {} })
67
67
  );
68
68
  };
69
- return $({
69
+ return V({
70
70
  methodConflict: r,
71
71
  pathConflict: i
72
72
  }), (n, t) => (h(), U("div", {
@@ -125,7 +125,7 @@ const se = ["id"], ae = { class: "pointer-events-none absolute top-0 left-0 bloc
125
125
  onCurl: t[3] || (t[3] = (s) => e.eventBus.emit("ui:open:command-palette", {
126
126
  action: "import-curl-command",
127
127
  payload: {
128
- curl: s
128
+ inputValue: s
129
129
  }
130
130
  })),
131
131
  onSubmit: t[4] || (t[4] = (s) => d("execute")),
@@ -3,10 +3,11 @@ import { useLoadingState as L, ScalarButton as S } from "@scalar/components";
3
3
  import { pkceOptions as P } from "@scalar/oas-utils/entities/spec";
4
4
  import { useToasts as R } from "@scalar/use-toasts";
5
5
  import F from "./OAuthScopesInput.vue.js";
6
+ /* empty css */
6
7
  import { authorizeOauth2 as O } from "../helpers/oauth.js";
7
8
  import m from "./RequestAuthDataTableInput.vue.js";
8
9
  import u from "../../../../components/DataTable/DataTableRow.vue.js";
9
- const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { class: "flex h-8 w-full items-center justify-end border-t" }, K = /* @__PURE__ */ b({
10
+ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { class: "flex h-8 w-full items-center justify-end border-t" }, X = /* @__PURE__ */ b({
10
11
  __name: "OAuth2",
11
12
  props: {
12
13
  environment: {},
@@ -275,5 +276,5 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
275
276
  }
276
277
  });
277
278
  export {
278
- K as default
279
+ X as default
279
280
  };
@@ -1 +1 @@
1
- {"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"names":[],"mappings":"AA2KA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EACjB,MAAM,8DAA8D,CAAA;AAWrE,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,gBAAgB,CAAA;IAChC,IAAI,EAAE,SAAS,CAAA;IACf,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;AA8XF,wBAOG"}
1
+ {"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"names":[],"mappings":"AAwNA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EACjB,MAAM,8DAA8D,CAAA;AAWrE,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,gBAAgB,CAAA;IAChC,IAAI,EAAE,SAAS,CAAA;IACf,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;AAibF,wBAOG"}
@@ -1,14 +1,14 @@
1
- import { defineComponent as T, computed as y, createBlock as r, openBlock as a, unref as s, withCtx as l, createElementVNode as i, createVNode as c, normalizeClass as j, toDisplayString as u, createCommentVNode as p, withModifiers as m, createTextVNode as f, createElementBlock as b, Fragment as z, renderList as B } from "vue";
2
- import { Disclosure as N, DisclosureButton as M, DisclosurePanel as $ } from "@headlessui/vue";
3
- import { useModal as E, ScalarButton as S, ScalarIcon as I } from "@scalar/components";
4
- import P from "./OAuthScopesAddModal.vue.js";
5
- import C from "../../../../components/DataTable/DataTableCell.vue.js";
6
- import R from "../../../../components/DataTable/DataTableRow.vue.js";
7
- import U from "../../../../components/DataTable/DataTableCheckbox.vue.js";
8
- const F = { class: "flex h-fit w-full" }, L = { class: "flex-1" }, q = { class: "flex items-center gap-1.75" }, G = {
9
- class: "grid auto-rows-auto",
1
+ import { defineComponent as T, ref as z, computed as f, createBlock as u, openBlock as r, unref as s, withCtx as o, createElementVNode as a, createVNode as c, normalizeClass as B, toDisplayString as p, createCommentVNode as m, withModifiers as S, createTextVNode as x, createElementBlock as V, Fragment as N, renderList as M } from "vue";
2
+ import { Disclosure as E, DisclosureButton as I, DisclosurePanel as R } from "@headlessui/vue";
3
+ import { useModal as U, ScalarButton as v, ScalarIcon as P, ScalarSearchInput as F } from "@scalar/components";
4
+ import L from "./OAuthScopesAddModal.vue.js";
5
+ import A from "../../../../components/DataTable/DataTableCell.vue.js";
6
+ import Q from "../../../../components/DataTable/DataTableRow.vue.js";
7
+ import q from "../../../../components/DataTable/DataTableCheckbox.vue.js";
8
+ const G = { class: "flex h-fit w-full" }, H = { class: "flex-1" }, J = { class: "flex items-center gap-1.75" }, W = {
9
+ class: "grid max-h-40 auto-rows-auto overflow-x-hidden overflow-y-scroll",
10
10
  style: { gridTemplateColumns: "1fr auto" }
11
- }, H = { class: "font-code text-xs" }, J = { key: 0 }, ee = /* @__PURE__ */ T({
11
+ }, X = { class: "font-code text-xs" }, Y = { key: 0 }, oe = /* @__PURE__ */ T({
12
12
  __name: "OAuthScopesInput",
13
13
  props: {
14
14
  flowType: {},
@@ -16,111 +16,129 @@ const F = { class: "flex h-fit w-full" }, L = { class: "flex-1" }, q = { class:
16
16
  selectedScopes: {}
17
17
  },
18
18
  emits: ["update:selectedScopes"],
19
- setup(t, { emit: A }) {
20
- const d = A, V = y(
21
- () => Object.entries(t.flow?.scopes ?? {}).map(([n, e]) => ({
19
+ setup(l, { emit: $ }) {
20
+ const i = $, d = z(""), w = f(
21
+ () => Object.entries(l.flow?.scopes ?? {}).map(([n, e]) => ({
22
22
  id: n,
23
23
  label: n,
24
24
  description: e
25
25
  }))
26
- ), x = y(
27
- () => t.selectedScopes.length === Object.keys(t.flow?.scopes ?? {}).length
26
+ ), D = f(() => {
27
+ if (!d.value)
28
+ return w.value;
29
+ const n = new RegExp(
30
+ d.value.split("").map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join(".*"),
31
+ "i"
32
+ );
33
+ return w.value.filter(
34
+ ({ label: e, description: t }) => n.test(`${e} ${t}`)
35
+ );
36
+ }), h = f(
37
+ () => l.selectedScopes.length === Object.keys(l.flow?.scopes ?? {}).length
28
38
  );
29
- function h(n, e) {
39
+ function g(n, e) {
30
40
  if (e)
31
- return d("update:selectedScopes", {
32
- scopes: Array.from(/* @__PURE__ */ new Set([...t.selectedScopes, n]))
41
+ return i("update:selectedScopes", {
42
+ scopes: Array.from(/* @__PURE__ */ new Set([...l.selectedScopes, n]))
33
43
  });
34
- d("update:selectedScopes", {
35
- scopes: t.selectedScopes.filter((o) => o !== n)
44
+ i("update:selectedScopes", {
45
+ scopes: l.selectedScopes.filter((t) => t !== n)
36
46
  });
37
47
  }
38
- const D = () => d("update:selectedScopes", { scopes: Object.keys(t.flow?.scopes ?? {}) }), O = () => d("update:selectedScopes", { scopes: [] }), w = E();
39
- return (n, e) => (a(), r(s(C), { class: "h-auto !max-h-[initial] min-h-8 items-center" }, {
40
- default: l(() => [
41
- i("div", F, [
42
- e[5] || (e[5] = i("div", { class: "text-c-1 h-full items-center" }, null, -1)),
43
- c(s(N), {
48
+ const O = () => i("update:selectedScopes", { scopes: Object.keys(l.flow?.scopes ?? {}) }), j = () => i("update:selectedScopes", { scopes: [] }), y = U();
49
+ return (n, e) => (r(), u(s(A), { class: "h-auto !max-h-[initial] min-h-8 items-center" }, {
50
+ default: o(() => [
51
+ a("div", G, [
52
+ e[7] || (e[7] = a("div", { class: "text-c-1 h-full items-center" }, null, -1)),
53
+ c(s(E), {
44
54
  as: "div",
45
55
  class: "bl flex w-full flex-col"
46
56
  }, {
47
- default: l(() => [
48
- c(s(M), {
49
- class: j([
57
+ default: o(() => [
58
+ c(s(I), {
59
+ class: B([
50
60
  "group/scopes-accordion hover:text-c-1 flex h-auto min-h-8 cursor-pointer items-center gap-1.5 pr-2.25 pl-3 text-left",
51
- (t.selectedScopes.length || 0) > 0 ? "text-c-1" : "text-c-3"
61
+ (l.selectedScopes.length || 0) > 0 ? "text-c-1" : "text-c-3"
52
62
  ])
53
63
  }, {
54
- default: l(({ open: o }) => [
55
- i("div", L, " Scopes Selected " + u(t.selectedScopes.length || 0) + " / " + u(Object.keys(t.flow?.scopes ?? {}).length || 0), 1),
56
- i("div", q, [
57
- c(s(S), {
64
+ default: o(({ open: t }) => [
65
+ a("div", H, " Scopes Selected " + p(l.selectedScopes.length || 0) + " / " + p(Object.keys(l.flow?.scopes ?? {}).length || 0), 1),
66
+ a("div", J, [
67
+ c(s(v), {
58
68
  class: "pr-0.75 pl-1 transition-none",
59
69
  size: "sm",
60
70
  variant: "ghost",
61
- onClick: e[0] || (e[0] = m((v) => s(w).show(), ["stop"]))
71
+ onClick: e[0] || (e[0] = S((k) => s(y).show(), ["stop"]))
62
72
  }, {
63
- default: l(() => [...e[2] || (e[2] = [
64
- f(" Add Scope ", -1)
73
+ default: o(() => [...e[3] || (e[3] = [
74
+ x(" Add Scope ", -1)
65
75
  ])]),
66
76
  _: 1
67
77
  }),
68
- x.value ? (a(), r(s(S), {
78
+ h.value ? (r(), u(s(v), {
69
79
  key: 0,
70
80
  class: "pr-0.75 pl-1 transition-none",
71
81
  size: "sm",
72
82
  variant: "ghost",
73
- onClick: m(O, ["stop"])
83
+ onClick: S(j, ["stop"])
74
84
  }, {
75
- default: l(() => [...e[3] || (e[3] = [
76
- f(" Deselect All ", -1)
85
+ default: o(() => [...e[4] || (e[4] = [
86
+ x(" Deselect All ", -1)
77
87
  ])]),
78
88
  _: 1
79
- })) : p("", !0),
80
- x.value ? p("", !0) : (a(), r(s(S), {
89
+ })) : m("", !0),
90
+ h.value ? m("", !0) : (r(), u(s(v), {
81
91
  key: 1,
82
92
  class: "pr-0.75 pl-1 transition-none",
83
93
  size: "sm",
84
94
  variant: "ghost",
85
- onClick: m(D, ["stop"])
95
+ onClick: S(O, ["stop"])
86
96
  }, {
87
- default: l(() => [...e[4] || (e[4] = [
88
- f(" Select All ", -1)
97
+ default: o(() => [...e[5] || (e[5] = [
98
+ x(" Select All ", -1)
89
99
  ])]),
90
100
  _: 1
91
101
  })),
92
- c(s(I), {
102
+ c(s(P), {
93
103
  class: "text-c-3 group-hover/scopes-accordion:text-c-2",
94
- icon: o ? "ChevronDown" : "ChevronRight",
104
+ icon: t ? "ChevronDown" : "ChevronRight",
95
105
  size: "md"
96
106
  }, null, 8, ["icon"])
97
107
  ])
98
108
  ]),
99
109
  _: 1
100
110
  }, 8, ["class"]),
101
- c(s($), { as: "template" }, {
102
- default: l(() => [
103
- i("table", G, [
104
- (a(!0), b(z, null, B(V.value, ({ id: o, label: v, description: g }) => (a(), r(s(R), {
105
- key: o,
106
- class: "text-c-2",
107
- onClick: (k) => h(o, !t.selectedScopes.includes(o))
108
- }, {
109
- default: l(() => [
110
- c(s(C), { class: "hover:text-c-1 box-border !max-h-[initial] w-full cursor-pointer px-3 py-1.5" }, {
111
- default: l(() => [
112
- i("span", H, u(v), 1),
113
- g ? (a(), b("span", J, "   – " + u(g), 1)) : p("", !0)
114
- ]),
115
- _: 2
116
- }, 1024),
117
- c(s(U), {
118
- modelValue: t.selectedScopes.includes(o),
119
- "onUpdate:modelValue": (k) => h(o, k)
120
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
121
- ]),
122
- _: 2
123
- }, 1032, ["onClick"]))), 128))
111
+ c(s(R), { as: "template" }, {
112
+ default: o(() => [
113
+ a("div", null, [
114
+ c(s(F), {
115
+ modelValue: d.value,
116
+ "onUpdate:modelValue": e[1] || (e[1] = (t) => d.value = t),
117
+ class: "flex items-center text-xs"
118
+ }, null, 8, ["modelValue"]),
119
+ a("table", W, [
120
+ (r(!0), V(N, null, M(D.value, ({ id: t, label: k, description: b }) => (r(), u(s(Q), {
121
+ key: t,
122
+ class: "text-c-2",
123
+ onClick: (C) => g(t, !l.selectedScopes.includes(t))
124
+ }, {
125
+ default: o(() => [
126
+ c(s(A), { class: "no-scrollbar hover:text-c-1 box-border flex !max-h-[initial] w-full cursor-pointer items-center gap-1 overflow-x-scroll px-3 py-1.5 text-nowrap" }, {
127
+ default: o(() => [
128
+ a("span", X, p(k), 1),
129
+ e[6] || (e[6] = a("span", null, "–", -1)),
130
+ b ? (r(), V("span", Y, p(b), 1)) : m("", !0)
131
+ ]),
132
+ _: 2
133
+ }, 1024),
134
+ c(s(q), {
135
+ modelValue: l.selectedScopes.includes(t),
136
+ "onUpdate:modelValue": (C) => g(t, C)
137
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
138
+ ]),
139
+ _: 2
140
+ }, 1032, ["onClick"]))), 128))
141
+ ])
124
142
  ])
125
143
  ]),
126
144
  _: 1
@@ -129,12 +147,12 @@ const F = { class: "flex h-fit w-full" }, L = { class: "flex-1" }, q = { class:
129
147
  _: 1
130
148
  })
131
149
  ]),
132
- c(P, {
133
- scopes: Object.keys(t.flow.scopes ?? {}),
134
- state: s(w),
135
- onSubmit: e[1] || (e[1] = (o) => d("update:selectedScopes", {
136
- scopes: t.selectedScopes,
137
- newScopePayload: { ...o, flowType: t.flowType }
150
+ c(L, {
151
+ scopes: Object.keys(l.flow.scopes ?? {}),
152
+ state: s(y),
153
+ onSubmit: e[2] || (e[2] = (t) => i("update:selectedScopes", {
154
+ scopes: l.selectedScopes,
155
+ newScopePayload: { ...t, flowType: l.flowType }
138
156
  }))
139
157
  }, null, 8, ["scopes", "state"])
140
158
  ]),
@@ -143,5 +161,5 @@ const F = { class: "flex h-fit w-full" }, L = { class: "flex-1" }, q = { class:
143
161
  }
144
162
  });
145
163
  export {
146
- ee as default
164
+ oe as default
147
165
  };
@@ -0,0 +1,5 @@
1
+ import o from "./OAuthScopesInput.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -1,5 +1,6 @@
1
1
  import type { ClientPlugin } from '../../../v2/helpers/plugins.js';
2
2
  import type { ClientLayout } from '../../../v2/types/layout';
3
+ import type { CommandPaletteState } from '../command-palette/hooks/use-command-palette-state.js';
3
4
  import { type AppState } from './app-state.js';
4
5
  /**
5
6
  * Main entry point for the API client for electron and web.
@@ -10,10 +11,12 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
10
11
  layout: Exclude<ClientLayout, "modal">;
11
12
  plugins?: ClientPlugin[];
12
13
  getAppState: () => AppState;
14
+ getCommandPaletteState: () => CommandPaletteState;
13
15
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
14
16
  layout: Exclude<ClientLayout, "modal">;
15
17
  plugins?: ClientPlugin[];
16
18
  getAppState: () => AppState;
19
+ getCommandPaletteState: () => CommandPaletteState;
17
20
  }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
18
21
  /**
19
22
  * Slot for customizing the actions section of the sidebar menu.
@@ -1 +1 @@
1
- {"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"AA2NA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAM3C;;;;GAIG;;YAGO,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;iBACX,MAAM,QAAQ;;YAFnB,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;iBACX,MAAM,QAAQ;;IAS3B;;;OAGG;4BACqB,EAAE;;AAjB5B,wBAuUC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"AA+NA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAM3C;;;;GAIG;;YAGO,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;iBACX,MAAM,QAAQ;4BACH,MAAM,mBAAmB;;YAHzC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;iBACX,MAAM,QAAQ;4BACH,MAAM,mBAAmB;;IAUjD;;;OAGG;4BACqB,EAAE;;AAnB5B,wBA2UC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,44 +1,45 @@
1
- import { defineComponent as w, computed as p, createElementBlock as S, createBlock as c, unref as t, openBlock as i, Fragment as f, createElementVNode as u, createVNode as s, withCtx as m, renderSlot as b, normalizeProps as h, guardReactiveProps as W } from "vue";
2
- import { useModal as y, ScalarTeleportRoot as T } from "@scalar/components";
3
- import { getThemeStyles as g } from "@scalar/themes";
4
- import { ScalarToasts as B } from "@scalar/use-toasts";
5
- import { extensions as C } from "@scalar/workspace-store/schemas/extensions";
6
- import { RouterView as E } from "vue-router";
7
- import x from "./components/CreateWorkspaceModal.vue.js";
8
- import O from "./components/SplashScreen.vue.js";
9
- import { useDocumentWatcher as I } from "./hooks/use-document-watcher.js";
10
- import _ from "../command-palette/components/TheCommandPalette.vue.js";
11
- import { useColorMode as A } from "../../hooks/use-color-mode.js";
12
- import { useGlobalHotKeys as M } from "../../hooks/use-global-hot-keys.js";
13
- import U from "./components/AppSidebar.vue.js";
14
- import D from "./components/DesktopTabs.vue.js";
15
- import N from "./components/WebTopNav.vue.js";
16
- const $ = ["innerHTML"], L = { class: "flex min-h-0 flex-1" }, H = { class: "bg-b-1 flex-1" }, P = {}, oe = /* @__PURE__ */ w({
17
- ...P,
1
+ import { defineComponent as S, computed as p, createElementBlock as f, createBlock as c, unref as t, openBlock as i, Fragment as b, createElementVNode as u, createVNode as s, withCtx as m, renderSlot as h, normalizeProps as y, guardReactiveProps as W } from "vue";
2
+ import { useModal as T, ScalarTeleportRoot as g } from "@scalar/components";
3
+ import { getThemeStyles as B } from "@scalar/themes";
4
+ import { ScalarToasts as C } from "@scalar/use-toasts";
5
+ import { extensions as E } from "@scalar/workspace-store/schemas/extensions";
6
+ import { RouterView as x } from "vue-router";
7
+ import O from "./components/CreateWorkspaceModal.vue.js";
8
+ import I from "./components/SplashScreen.vue.js";
9
+ import { useDocumentWatcher as A } from "./hooks/use-document-watcher.js";
10
+ import M from "../command-palette/TheCommandPalette.vue.js";
11
+ import { useColorMode as U } from "../../hooks/use-color-mode.js";
12
+ import { useGlobalHotKeys as _ } from "../../hooks/use-global-hot-keys.js";
13
+ import D from "./components/AppSidebar.vue.js";
14
+ import N from "./components/DesktopTabs.vue.js";
15
+ import $ from "./components/WebTopNav.vue.js";
16
+ const L = ["innerHTML"], P = { class: "flex min-h-0 flex-1" }, F = { class: "bg-b-1 flex-1" }, H = {}, se = /* @__PURE__ */ S({
17
+ ...H,
18
18
  __name: "App",
19
19
  props: {
20
20
  layout: {},
21
21
  plugins: { default: () => [] },
22
- getAppState: { type: Function }
22
+ getAppState: { type: Function },
23
+ getCommandPaletteState: { type: Function }
23
24
  },
24
25
  setup(o) {
25
- const e = o.getAppState();
26
- typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), A({ workspaceStore: e.store }), M(e.eventBus, o.layout), I({
27
- documentName: () => e.store.value?.workspace[C.workspace.activeDocument],
26
+ const e = o.getAppState(), d = o.getCommandPaletteState();
27
+ typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), U({ workspaceStore: e.store }), _(e.eventBus, o.layout), A({
28
+ documentName: () => e.store.value?.workspace[E.workspace.activeDocument],
28
29
  store: e.store,
29
30
  initialTimeout: 5e3
30
31
  });
31
- const d = p(() => {
32
+ const v = p(() => {
32
33
  if (e.store.value === null)
33
34
  return "";
34
35
  const n = e.store.value.workspace["x-scalar-theme"];
35
- return n ? `<style>${g(n)}</style>` : "";
36
- }), v = () => e.router.value?.push({
36
+ return n ? `<style>${B(n)}</style>` : "";
37
+ }), k = () => e.router.value?.push({
37
38
  name: "workspace.environment",
38
39
  params: {
39
40
  workspaceSlug: e.activeEntities.workspaceSlug.value
40
41
  }
41
- }), l = y(), k = p(() => ({
42
+ }), l = T(), w = p(() => ({
42
43
  documentSlug: e.activeEntities.documentSlug.value ?? "",
43
44
  document: e.store.value?.workspace.activeDocument ?? null,
44
45
  environment: e.environment.value,
@@ -52,25 +53,25 @@ const $ = ["innerHTML"], L = { class: "flex min-h-0 flex-1" }, H = { class: "bg-
52
53
  plugins: o.plugins,
53
54
  securitySchemes: e.document.value?.components?.securitySchemes ?? {}
54
55
  }));
55
- return (n, a) => t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), S(f, { key: 0 }, [
56
- u("div", { innerHTML: d.value }, null, 8, $),
57
- s(t(T), null, {
56
+ return (n, a) => t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), f(b, { key: 0 }, [
57
+ u("div", { innerHTML: v.value }, null, 8, L),
58
+ s(t(g), null, {
58
59
  default: m(() => [
59
- s(t(B)),
60
- o.layout === "desktop" ? (i(), c(D, {
60
+ s(t(C)),
61
+ o.layout === "desktop" ? (i(), c(N, {
61
62
  key: 0,
62
63
  activeTabIndex: t(e).tabs.activeTabIndex.value,
63
64
  eventBus: t(e).eventBus,
64
65
  tabs: t(e).tabs.state.value
65
- }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : (i(), c(N, {
66
+ }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : (i(), c($, {
66
67
  key: 1,
67
68
  activeWorkspace: t(e).workspace.activeWorkspace.value,
68
69
  workspaces: t(e).workspace.workspaceList.value,
69
70
  "onCreate:workspace": a[0] || (a[0] = (r) => t(l).show()),
70
71
  "onSelect:workspace": t(e).workspace.setId
71
72
  }, null, 8, ["activeWorkspace", "workspaces", "onSelect:workspace"])),
72
- u("main", L, [
73
- s(U, {
73
+ u("main", P, [
74
+ s(D, {
74
75
  isSidebarOpen: t(e).sidebar.isOpen.value,
75
76
  "onUpdate:isSidebarOpen": a[1] || (a[1] = (r) => t(e).sidebar.isOpen.value = r),
76
77
  activeWorkspace: t(e).workspace.activeWorkspace.value,
@@ -81,36 +82,36 @@ const $ = ["innerHTML"], L = { class: "flex min-h-0 flex-1" }, H = { class: "bg-
81
82
  sidebarWidth: t(e).sidebar.width.value,
82
83
  store: t(e).store.value,
83
84
  workspaces: t(e).workspace.workspaceList.value,
84
- "onClick:workspace": v,
85
+ "onClick:workspace": k,
85
86
  "onCreate:workspace": a[2] || (a[2] = (r) => t(l).show()),
86
87
  "onSelect:workspace": t(e).workspace.setId,
87
88
  onSelectItem: t(e).sidebar.handleSelectItem,
88
89
  "onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
89
90
  }, {
90
91
  sidebarMenuActions: m(() => [
91
- b(n.$slots, "sidebar-menu-actions")
92
+ h(n.$slots, "sidebar-menu-actions")
92
93
  ]),
93
94
  _: 3
94
95
  }, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onSelect:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
95
- s(x, {
96
+ s(O, {
96
97
  state: t(l),
97
98
  "onCreate:workspace": a[3] || (a[3] = (r) => t(e).workspace.create(r))
98
99
  }, null, 8, ["state"]),
99
- s(_, {
100
+ s(M, {
100
101
  eventBus: t(e).eventBus,
101
- paletteState: t(e).commandPalette,
102
+ paletteState: t(d),
102
103
  workspaceStore: t(e).store.value
103
104
  }, null, 8, ["eventBus", "paletteState", "workspaceStore"]),
104
- u("div", H, [
105
- s(t(E), h(W(k.value)), null, 16)
105
+ u("div", F, [
106
+ s(t(x), y(W(w.value)), null, 16)
106
107
  ])
107
108
  ])
108
109
  ]),
109
110
  _: 3
110
111
  })
111
- ], 64)) : (i(), c(O, { key: 1 }));
112
+ ], 64)) : (i(), c(I, { key: 1 }));
112
113
  }
113
114
  });
114
115
  export {
115
- oe as default
116
+ se as default
116
117
  };