@scalar/api-client 2.0.29 → 2.0.31

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 (92) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +23 -23
  5. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  6. package/dist/components/CodeInput/CodeInput.vue.d.ts +2 -2
  7. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  8. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  9. package/dist/components/CodeInput/CodeInput.vue2.js +63 -48
  10. package/dist/components/CodeInput/codeDropdownWidget.d.ts +9 -1
  11. package/dist/components/CodeInput/codeDropdownWidget.d.ts.map +1 -1
  12. package/dist/components/CodeInput/codeDropdownWidget.js +62 -51
  13. package/dist/components/CodeInput/codeVariableWidget.d.ts +10 -1
  14. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  15. package/dist/components/CodeInput/codeVariableWidget.js +63 -56
  16. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +1 -1
  17. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +1 -1
  18. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +5 -5
  19. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  20. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  21. package/dist/components/SideNav/SideNav.vue.js +5 -43
  22. package/dist/components/SideNav/SideNav.vue2.js +44 -2
  23. package/dist/components/SideNav/SideNavLink.vue.d.ts +2 -0
  24. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  25. package/dist/components/SideNav/SideNavLink.vue.js +29 -20
  26. package/dist/components/SideNav/WorkspaceProfileIcon.vue.d.ts.map +1 -1
  27. package/dist/components/SubpageHeader.vue.d.ts.map +1 -1
  28. package/dist/components/SubpageHeader.vue.js +1 -1
  29. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  30. package/dist/components/TopNav/TopNav.vue.js +1 -1
  31. package/dist/components/TopNav/TopNav.vue2.js +65 -34
  32. package/dist/constants.d.ts +4 -0
  33. package/dist/constants.d.ts.map +1 -1
  34. package/dist/constants.js +4 -4
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +12 -11
  38. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  39. package/dist/layouts/App/ApiClientApp.vue.js +9 -9
  40. package/dist/layouts/App/create-api-client-app.d.ts +2966 -0
  41. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -0
  42. package/dist/layouts/App/create-api-client-app.js +18 -0
  43. package/dist/layouts/App/index.d.ts +1 -1
  44. package/dist/layouts/App/index.d.ts.map +1 -1
  45. package/dist/layouts/App/index.js +1 -1
  46. package/dist/layouts/Modal/ApiClientModal.vue.d.ts +1 -17
  47. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  48. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  49. package/dist/layouts/Modal/ApiClientModal.vue2.js +20 -24
  50. package/dist/layouts/Modal/api-client-modal.d.ts +5905 -57
  51. package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -1
  52. package/dist/layouts/Modal/api-client-modal.js +27 -129
  53. package/dist/libs/create-client.d.ts +3025 -0
  54. package/dist/libs/create-client.d.ts.map +1 -0
  55. package/dist/libs/create-client.js +147 -0
  56. package/dist/libs/index.d.ts +1 -0
  57. package/dist/libs/index.d.ts.map +1 -1
  58. package/dist/libs/index.js +11 -9
  59. package/dist/router.d.ts +7 -17
  60. package/dist/router.d.ts.map +1 -1
  61. package/dist/router.js +28 -40
  62. package/dist/store/index.d.ts +2 -0
  63. package/dist/store/index.d.ts.map +1 -0
  64. package/dist/store/index.js +5 -0
  65. package/dist/store/workspace.d.ts +3028 -603
  66. package/dist/store/workspace.d.ts.map +1 -1
  67. package/dist/store/workspace.js +454 -432
  68. package/dist/style.css +1 -1
  69. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +8 -0
  70. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  71. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +32 -31
  72. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  73. package/dist/views/Request/Request.vue.js +2 -2
  74. package/dist/views/Request/Request.vue2.js +11 -11
  75. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  76. package/dist/views/Request/RequestSection/RequestBody.vue.js +13 -13
  77. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +2 -2
  78. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  79. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  80. package/dist/views/Request/RequestSection/RequestTable.vue2.js +2 -2
  81. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  82. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  83. package/dist/views/Request/RequestSidebarItem.vue2.js +24 -23
  84. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  85. package/dist/views/Request/RequestSidebarItemMenu.vue.js +26 -20
  86. package/package.json +11 -7
  87. package/dist/layouts/App/createApiClientApp.d.ts +0 -16
  88. package/dist/layouts/App/createApiClientApp.d.ts.map +0 -1
  89. package/dist/layouts/App/createApiClientApp.js +0 -62
  90. package/dist/store/topNav.d.ts +0 -445
  91. package/dist/store/topNav.d.ts.map +0 -1
  92. package/dist/store/topNav.js +0 -53
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.0.31
4
+
5
+ ### Patch Changes
6
+
7
+ - 240a618: feat: allow multiple api-clients on single page
8
+ - Updated dependencies [240a618]
9
+ - @scalar/object-utils@1.1.5
10
+
11
+ ## 2.0.30
12
+
13
+ ### Patch Changes
14
+
15
+ - b4199e9: fix: api client app clean up (font sizes, spacing, etc)
16
+ - Updated dependencies [a5f3a84]
17
+ - Updated dependencies [9a08f46]
18
+ - @scalar/components@0.12.19
19
+ - @scalar/themes@0.9.16
20
+ - @scalar/oas-utils@0.2.17
21
+
3
22
  ## 2.0.29
4
23
 
5
24
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";AAwkBA,wBAKG"}
1
+ {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";AAykBA,wBAKG"}
@@ -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-231a70ec"]]);
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-48f9b777"]]);
5
5
  export {
6
- e as default
6
+ f as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as q, ref as m, watch as V, unref as l, openBlock as B, createElementBlock as I, createElementVNode as o, createVNode as r, withCtx as _, normalizeClass as b, normalizeStyle as R, createCommentVNode as z, pushScopeId as M, popScopeId as U } from "vue";
1
+ import { defineComponent as q, ref as c, watch as V, unref as l, openBlock as B, createElementBlock as I, createElementVNode as o, createVNode as s, withCtx as _, normalizeClass as b, normalizeStyle as R, createCommentVNode as z, pushScopeId as M, popScopeId as U } from "vue";
2
2
  import $ from "../CodeInput/CodeInput.vue.js";
3
3
  import { useWorkspace as O } from "../../store/workspace.js";
4
4
  import { Listbox as H } from "@headlessui/vue";
@@ -8,11 +8,11 @@ import { isMacOS as A } from "@scalar/use-tooltip";
8
8
  import { useMagicKeys as D, whenever as K } from "@vueuse/core";
9
9
  import Q from "../HttpMethod/HttpMethod.vue.js";
10
10
  import W from "./AddressBarHistory.vue.js";
11
- import { executeRequestBus as c } from "../../libs/eventBusses/executeRequestBus.js";
12
- const f = (n) => (M("data-v-231a70ec"), n = n(), U(), n), j = {
11
+ import { executeRequestBus as m } from "../../libs/eventBusses/executeRequestBus.js";
12
+ const f = (n) => (M("data-v-48f9b777"), n = n(), U(), n), j = {
13
13
  key: 0,
14
14
  class: "order-last lg:order-none lg:w-auto w-full"
15
- }, F = { class: "m-auto flex basis-1/2 flex-row items-center" }, G = { class: "pointer-events-none absolute left-0 top-0 z-10 block h-full w-full overflow-hidden" }, J = { class: "flex gap-1" }, P = { class: "scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, X = /* @__PURE__ */ f(() => /* @__PURE__ */ o("div", { class: "fade-left" }, null, -1)), Y = /* @__PURE__ */ f(() => /* @__PURE__ */ o("div", { class: "fade-right" }, null, -1)), Z = /* @__PURE__ */ f(() => /* @__PURE__ */ o("span", { class: "text-xxs relative z-10 lg:flex hidden" }, "Send", -1)), me = /* @__PURE__ */ q({
15
+ }, F = { class: "m-auto flex basis-1/2 flex-row items-center" }, G = { class: "pointer-events-none absolute left-0 top-0 z-10 block h-full w-full overflow-hidden" }, J = { class: "flex gap-1" }, P = { class: "scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, X = /* @__PURE__ */ f(() => /* @__PURE__ */ o("div", { class: "fade-left" }, null, -1)), Y = /* @__PURE__ */ f(() => /* @__PURE__ */ o("div", { class: "fade-right" }, null, -1)), Z = /* @__PURE__ */ f(() => /* @__PURE__ */ o("span", { class: "text-xxs relative z-10 lg:flex hidden" }, "Send", -1)), ce = /* @__PURE__ */ q({
16
16
  __name: "AddressBar",
17
17
  setup(n) {
18
18
  const {
@@ -22,10 +22,10 @@ const f = (n) => (M("data-v-231a70ec"), n = n(), U(), n), j = {
22
22
  requestMutators: v,
23
23
  requestExampleMutators: g,
24
24
  requestsHistory: w
25
- } = O(), x = m(w.value[0]), h = D();
25
+ } = O(), x = c(w.value[0]), h = D();
26
26
  K(
27
27
  A() ? h.meta_enter : h.ctrl_enter,
28
- () => c.emit()
28
+ () => m.emit()
29
29
  );
30
30
  const k = (e) => {
31
31
  !t.value || t.value.path === e || v.edit(t.value.uid, "path", e);
@@ -39,8 +39,8 @@ const f = (n) => (M("data-v-231a70ec"), n = n(), U(), n), j = {
39
39
  t.value && k(e);
40
40
  }
41
41
  );
42
- const d = m(100), u = m(!1);
43
- c.on(() => {
42
+ const d = c(100), u = c(!1);
43
+ m.on(() => {
44
44
  if (u.value) return;
45
45
  u.value = !0;
46
46
  const e = setInterval(() => {
@@ -58,18 +58,18 @@ const f = (n) => (M("data-v-231a70ec"), n = n(), U(), n), j = {
58
58
  const y = (e) => {
59
59
  i.value && g.edit(i.value.uid, "url", e);
60
60
  };
61
- return (e, a) => l(t) && l(i) ? (B(), I("div", j, [
61
+ return (e, r) => l(t) && l(i) ? (B(), I("div", j, [
62
62
  o("div", F, [
63
- r(l(H), {
63
+ s(l(H), {
64
64
  modelValue: x.value,
65
- "onUpdate:modelValue": a[2] || (a[2] = (s) => x.value = s)
65
+ "onUpdate:modelValue": r[2] || (r[2] = (a) => x.value = a)
66
66
  }, {
67
- default: _(({ open: s }) => [
67
+ default: _(({ open: a }) => [
68
68
  o("div", {
69
69
  class: b([
70
70
  "text-xxs bg-b-1 relative flex w-full lg:min-w-[720px] lg:max-w-[720px] order-last lg:order-none flex-1 flex-row items-stretch rounded border p-[3px]",
71
- { "rounded-b-none": s },
72
- { "border-transparent": s }
71
+ { "rounded-b-none": a },
72
+ { "border-transparent": a }
73
73
  ])
74
74
  }, [
75
75
  o("div", G, [
@@ -79,7 +79,7 @@ const f = (n) => (M("data-v-231a70ec"), n = n(), U(), n), j = {
79
79
  }, null, 6)
80
80
  ]),
81
81
  o("div", J, [
82
- r(Q, {
82
+ s(Q, {
83
83
  class: "font-code text-xxs font-medium",
84
84
  isEditable: !l(p),
85
85
  isSquare: "",
@@ -89,7 +89,7 @@ const f = (n) => (M("data-v-231a70ec"), n = n(), U(), n), j = {
89
89
  ]),
90
90
  o("div", P, [
91
91
  X,
92
- r($, {
92
+ s($, {
93
93
  disableCloseBrackets: "",
94
94
  disabled: l(p),
95
95
  disableEnter: "",
@@ -98,19 +98,19 @@ const f = (n) => (M("data-v-231a70ec"), n = n(), U(), n), j = {
98
98
  modelValue: l(i).url,
99
99
  placeholder: "Enter URL to get started",
100
100
  server: "",
101
- onSubmit: a[0] || (a[0] = (C) => l(c).emit()),
101
+ onSubmit: r[0] || (r[0] = (C) => l(m).emit()),
102
102
  "onUpdate:modelValue": y
103
103
  }, null, 8, ["disabled", "modelValue"]),
104
104
  Y
105
105
  ]),
106
- r(W, { open: s }, null, 8, ["open"]),
107
- r(l(N), {
108
- class: "relative h-auto shrink-0 gap-1 overflow-hidden pl-2 pr-2.5 py-1 z-[1]",
106
+ s(W, { open: a }, null, 8, ["open"]),
107
+ s(l(N), {
108
+ class: "relative h-auto shrink-0 gap-1 overflow-hidden pl-2 pr-2.5 py-1 z-[1] font-bold",
109
109
  disabled: u.value,
110
- onClick: a[1] || (a[1] = (C) => l(c).emit())
110
+ onClick: r[1] || (r[1] = (C) => l(m).emit())
111
111
  }, {
112
112
  default: _(() => [
113
- r(l(T), {
113
+ s(l(T), {
114
114
  class: "relative z-10 shrink-0 fill-current",
115
115
  icon: "Play",
116
116
  size: "xs"
@@ -128,5 +128,5 @@ const f = (n) => (M("data-v-231a70ec"), n = n(), U(), n), j = {
128
128
  }
129
129
  });
130
130
  export {
131
- me as default
131
+ ce as default
132
132
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarHistory.vue"],"names":[],"mappings":";UAkHQ,OAAO;;UAAP,OAAO;;AA4Of,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarHistory.vue"],"names":[],"mappings":";UA4GQ,OAAO;;UAAP,OAAO;;AAwOf,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -61,16 +61,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
61
61
  withVariables: boolean;
62
62
  withServers: boolean;
63
63
  }>>> & {
64
- onSubmit?: ((v: string) => any) | undefined;
65
64
  "onUpdate:modelValue"?: ((v: string) => any) | undefined;
65
+ onSubmit?: ((v: string) => any) | undefined;
66
66
  }, {
67
- nullable: boolean;
68
67
  withServers: boolean;
69
68
  colorPicker: boolean;
70
69
  emitOnBlur: boolean;
71
70
  disableTabIndent: boolean;
72
71
  disableEnter: boolean;
73
72
  disableCloseBrackets: boolean;
73
+ nullable: boolean;
74
74
  withVariables: boolean;
75
75
  }, {}>, {
76
76
  warning?(_: {}): any;
@@ -1 +1 @@
1
- {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OA6RO,EAGL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;;kBAeb,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;kBAlBP,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;cAFV,OAAO;iBAEJ,OAAO;iBAlBP,OAAO;gBAGR,OAAO;sBAGD,OAAO;kBAMX,OAAO;0BACC,OAAO;mBAId,OAAO;;qBA8PG,GAAG;kBACN,GAAG;;AAnR9B,wBAsTC;AAMD,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC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AA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a5840d90"]]);
5
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5c73f0cd"]]);
6
6
  export {
7
- _ as default
7
+ f as default
8
8
  };
@@ -1,20 +1,20 @@
1
- import { defineComponent as S, useAttrs as P, ref as b, toRef as o, watch as O, computed as $, openBlock as t, createElementBlock as i, Fragment as R, createBlock as h, mergeProps as q, unref as E, renderSlot as y, createCommentVNode as g } from "vue";
2
- import { useCodeMirror as I, colorPicker as M } from "@scalar/use-codemirror";
3
- import { nanoid as N } from "nanoid";
4
- import B from "../DataTable/DataTableInputSelect.vue.js";
5
- import { dropdownPlugin as T } from "./codeDropdownWidget.js";
6
- import { pillPlugin as A, backspaceCommand as U } from "./codeVariableWidget.js";
7
- import { useWorkspace as W } from "../../store/workspace.js";
8
- const j = ["id"], z = {
1
+ import { defineComponent as $, useAttrs as E, ref as y, toRef as o, watch as q, computed as I, openBlock as t, createElementBlock as s, Fragment as M, createBlock as g, mergeProps as N, unref as T, renderSlot as v, createCommentVNode as B } from "vue";
2
+ import { useCodeMirror as A, colorPicker as U } from "@scalar/use-codemirror";
3
+ import { nanoid as W } from "nanoid";
4
+ import V from "../DataTable/DataTableInputSelect.vue.js";
5
+ import { dropdownPlugin as j } from "./codeDropdownWidget.js";
6
+ import { pillPlugin as z, backspaceCommand as D } from "./codeVariableWidget.js";
7
+ import { useWorkspace as G } from "../../store/workspace.js";
8
+ const H = ["id"], J = {
9
9
  key: 3,
10
10
  class: "absolute centered-y right-7 text-orange text-xs"
11
- }, D = {
11
+ }, K = {
12
12
  key: 4,
13
- class: "required absolute centered-y right-0 pt-px pr-2 text-xxs text-c-3 bg-b-1 shadow-[-8px_0_4px_var(--scalar-background-1)] opacity-100 duration-150 transition-opacity peer-has-[.cm-focused]:opacity-0"
14
- }, G = {
13
+ class: "required absolute centered-y right-0 pt-px pr-2 text-xxs text-c-3 bg-b-1 shadow-[-8px_0_4px_var(--scalar-background-1)] opacity-100 duration-150 transition-opacity peer-has-[.cm-focused]:opacity-0 pointer-events-none"
14
+ }, L = {
15
15
  inheritAttrs: !1
16
- }, Z = /* @__PURE__ */ S({
17
- ...G,
16
+ }, te = /* @__PURE__ */ $({
17
+ ...L,
18
18
  __name: "CodeInput",
19
19
  props: {
20
20
  colorPicker: { type: Boolean, default: !1 },
@@ -38,76 +38,91 @@ const j = ["id"], z = {
38
38
  withServers: { type: Boolean, default: !1 }
39
39
  },
40
40
  emits: ["submit", "update:modelValue"],
41
- setup(v, { emit: V }) {
42
- var m;
43
- const e = v, a = V, d = P(), k = d.id || `id-${N()}`, p = b(!1), { activeWorkspace: w } = W();
44
- function C(l) {
45
- return l === e.modelValue ? null : e.handleFieldChange ? e.handleFieldChange(l) : a("update:modelValue", l);
41
+ setup(k, { emit: w }) {
42
+ var b;
43
+ const e = k, n = w, d = E(), C = d.id || `id-${W()}`, p = y(!1), {
44
+ activeWorkspace: _,
45
+ activeParsedEnvironments: c,
46
+ isReadOnly: x,
47
+ environments: m,
48
+ router: F
49
+ } = G();
50
+ function S(l) {
51
+ return l === e.modelValue ? null : e.handleFieldChange ? e.handleFieldChange(l) : n("update:modelValue", l);
46
52
  }
47
- function _(l) {
48
- return e.handleFieldSubmit ? e.handleFieldSubmit(l) : a("submit", l);
53
+ function P(l) {
54
+ return e.handleFieldSubmit ? e.handleFieldSubmit(l) : n("submit", l);
49
55
  }
50
- function x(l) {
51
- p.value = !1, e.emitOnBlur && e.modelValue && _(l);
56
+ function O(l) {
57
+ p.value = !1, e.emitOnBlur && e.modelValue && P(l);
52
58
  }
53
- const n = [];
54
- e.colorPicker && n.push(M), e.withVariables && !w.value.isReadOnly && n.push(T({ withServers: e.withServers })), n.push(A, U);
55
- const c = b(null), { codeMirror: r } = I({
59
+ const a = [];
60
+ e.colorPicker && a.push(U), e.withVariables && !_.value.isReadOnly && a.push(
61
+ j({
62
+ withServers: e.withServers,
63
+ activeParsedEnvironments: c,
64
+ environments: m,
65
+ router: F
66
+ })
67
+ ), a.push(
68
+ z({ environments: m, activeParsedEnvironments: c, isReadOnly: x })
69
+ ), a.push(D);
70
+ const f = y(null), { codeMirror: r } = A({
56
71
  content: o(
57
72
  () => e.modelValue !== void 0 ? String(e.modelValue) : ""
58
73
  ),
59
- onChange: C,
74
+ onChange: S,
60
75
  onFocus: () => p.value = !0,
61
- onBlur: (l) => x(l),
62
- codeMirrorRef: c,
76
+ onBlur: (l) => O(l),
77
+ codeMirrorRef: f,
63
78
  disableTabIndent: o(() => e.disableTabIndent),
64
79
  disableEnter: o(() => e.disableEnter),
65
80
  disableCloseBrackets: o(() => e.disableCloseBrackets),
66
81
  lineNumbers: o(() => e.lineNumbers),
67
82
  language: o(() => e.language),
68
83
  lint: o(() => e.lint),
69
- extensions: n,
84
+ extensions: a,
70
85
  placeholder: o(() => e.placeholder)
71
86
  });
72
- (m = r.value) == null || m.focus(), O(r, () => {
87
+ (b = r.value) == null || b.focus(), q(r, () => {
73
88
  r.value && Object.prototype.hasOwnProperty.call(d, "autofocus") && r.value.focus();
74
89
  });
75
- const F = $(() => {
90
+ const R = I(() => {
76
91
  var l;
77
92
  return e.type === "boolean" || (l = e.type) != null && l.includes("boolean") || e.nullable ? ["true", "false", "null"] : ["true", "false"];
78
93
  });
79
94
  return (l, u) => {
80
- var f;
81
- return t(), i(R, null, [
82
- e.enum && e.enum.length ? (t(), h(B, {
95
+ var h;
96
+ return t(), s(M, null, [
97
+ e.enum && e.enum.length ? (t(), g(V, {
83
98
  key: 0,
84
99
  modelValue: e.modelValue,
85
100
  value: e.enum,
86
- "onUpdate:modelValue": u[0] || (u[0] = (s) => a("update:modelValue", s))
87
- }, null, 8, ["modelValue", "value"])) : e.type === "boolean" || (f = e.type) != null && f.includes("boolean") ? (t(), h(B, {
101
+ "onUpdate:modelValue": u[0] || (u[0] = (i) => n("update:modelValue", i))
102
+ }, null, 8, ["modelValue", "value"])) : e.type === "boolean" || (h = e.type) != null && h.includes("boolean") ? (t(), g(V, {
88
103
  key: 1,
89
104
  modelValue: e.modelValue,
90
- value: F.value,
91
- "onUpdate:modelValue": u[1] || (u[1] = (s) => a("update:modelValue", s))
92
- }, null, 8, ["modelValue", "value"])) : (t(), i("div", q({
105
+ value: R.value,
106
+ "onUpdate:modelValue": u[1] || (u[1] = (i) => n("update:modelValue", i))
107
+ }, null, 8, ["modelValue", "value"])) : (t(), s("div", N({
93
108
  key: 2,
94
- id: E(k)
109
+ id: T(C)
95
110
  }, l.$attrs, {
96
111
  ref_key: "codeMirrorRef",
97
- ref: c,
112
+ ref: f,
98
113
  class: ["peer font-code w-full whitespace-nowrap text-xs leading-[1.44] relative", {
99
114
  "flow-code-input--error": l.error
100
115
  }]
101
- }), null, 16, j)),
102
- l.$slots.warning ? (t(), i("div", z, [
103
- y(l.$slots, "warning", {}, void 0, !0)
104
- ])) : g("", !0),
105
- y(l.$slots, "icon", {}, void 0, !0),
106
- l.required ? (t(), i("div", D, " Required ")) : g("", !0)
116
+ }), null, 16, H)),
117
+ l.$slots.warning ? (t(), s("div", J, [
118
+ v(l.$slots, "warning", {}, void 0, !0)
119
+ ])) : B("", !0),
120
+ v(l.$slots, "icon", {}, void 0, !0),
121
+ l.required ? (t(), s("div", K, " Required ")) : B("", !0)
107
122
  ], 64);
108
123
  };
109
124
  }
110
125
  });
111
126
  export {
112
- Z as default
127
+ te as default
113
128
  };
@@ -1,10 +1,15 @@
1
+ import type { WorkspaceStore } from '../../store/index.js';
1
2
  import { type DecorationSet, type EditorView, ViewPlugin, type ViewUpdate, WidgetType } from '@scalar/use-codemirror';
3
+ import type { Router } from 'vue-router';
2
4
  declare class DropdownWidget extends WidgetType {
3
5
  private queryTerm;
4
6
  private onSelect;
5
7
  private dropdown;
6
8
  private withServers?;
7
- constructor(queryTerm: string, onSelect: (item: string) => void, withServers?: boolean);
9
+ private activeParsedEnvironments;
10
+ private environments;
11
+ private router;
12
+ constructor(queryTerm: string, onSelect: (item: string) => void, activeParsedEnvironments: WorkspaceStore['activeParsedEnvironments'], environments: WorkspaceStore['environments'], router: Router, withServers?: boolean);
8
13
  updateQueryTerm(newQueryTerm: string): void;
9
14
  getQueryTerm(): string;
10
15
  toDOM(view: EditorView): HTMLSpanElement;
@@ -13,6 +18,9 @@ declare class DropdownWidget extends WidgetType {
13
18
  }
14
19
  export declare const dropdownPlugin: (props: {
15
20
  withServers?: boolean;
21
+ activeParsedEnvironments: WorkspaceStore["activeParsedEnvironments"];
22
+ environments: WorkspaceStore["environments"];
23
+ router: Router;
16
24
  }) => ViewPlugin<{
17
25
  decorations: DecorationSet;
18
26
  widget: DropdownWidget | null;
@@ -1 +1 @@
1
- {"version":3,"file":"codeDropdownWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeDropdownWidget.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,UAAU,EAEf,UAAU,EACV,KAAK,UAAU,EACf,UAAU,EACX,MAAM,wBAAwB,CAAA;AAK/B,cAAM,cAAe,SAAQ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C,wBAAwB,EAAE,cAAc,CAAC,0BAA0B,CAAC,EACpE,YAAY,EAAE,cAAc,CAAC,cAAc,CAAC,EAC5C,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,OAAO;IAWvB,eAAe,CAAC,YAAY,EAAE,MAAM;IAMpC,YAAY;IAIZ,KAAK,CAAC,IAAI,EAAE,UAAU;IAuCtB,OAAO;IAOP,EAAE,CAAC,KAAK,EAAE,UAAU;CAGrB;AAED,eAAO,MAAM,cAAc,UAAW;IACpC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,wBAAwB,EAAE,cAAc,CAAC,0BAA0B,CAAC,CAAA;IACpE,YAAY,EAAE,cAAc,CAAC,cAAc,CAAC,CAAA;IAC5C,MAAM,EAAE,MAAM,CAAA;CACf;iBAGkB,aAAa;YAClB,cAAc,GAAG,IAAI;UACvB,UAAU;+BAQW,MAAM;mBAwClB,UAAU;EAyC5B,CAAA"}
@@ -1,18 +1,20 @@
1
- var m = Object.defineProperty;
2
- var g = (d, t, e) => t in d ? m(d, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[t] = e;
3
- var n = (d, t, e) => g(d, typeof t != "symbol" ? t + "" : t, e);
4
- import { router as f } from "../../router.js";
5
- import { ViewPlugin as y, Decoration as h, StateEffect as T, WidgetType as S } from "@scalar/use-codemirror";
6
- import { createApp as q, h as p, Teleport as x } from "vue";
7
- import v from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
8
- class u extends S {
9
- constructor(e, s, o) {
1
+ var g = Object.defineProperty;
2
+ var f = (s, t, e) => t in s ? g(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var o = (s, t, e) => f(s, typeof t != "symbol" ? t + "" : t, e);
4
+ import { ViewPlugin as p, Decoration as h, StateEffect as v, WidgetType as y } from "@scalar/use-codemirror";
5
+ import { createApp as T, h as w, Teleport as S } from "vue";
6
+ import q from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
7
+ class u extends y {
8
+ constructor(e, i, d, n, c, r) {
10
9
  super();
11
- n(this, "queryTerm");
12
- n(this, "onSelect");
13
- n(this, "dropdown", null);
14
- n(this, "withServers");
15
- this.queryTerm = e, this.onSelect = s, this.withServers = o;
10
+ o(this, "queryTerm");
11
+ o(this, "onSelect");
12
+ o(this, "dropdown", null);
13
+ o(this, "withServers");
14
+ o(this, "activeParsedEnvironments");
15
+ o(this, "environments");
16
+ o(this, "router");
17
+ this.queryTerm = e, this.onSelect = i, this.withServers = r, this.activeParsedEnvironments = d, this.environments = n, this.router = c;
16
18
  }
17
19
  updateQueryTerm(e) {
18
20
  this.queryTerm !== e && (this.queryTerm = e);
@@ -21,28 +23,31 @@ class u extends S {
21
23
  return this.queryTerm;
22
24
  }
23
25
  toDOM(e) {
24
- const s = document.createElement("span");
25
- return s.style.position = "fixed", setTimeout(() => {
26
+ const i = document.createElement("span");
27
+ return i.style.position = "fixed", setTimeout(() => {
26
28
  var c;
27
- const o = e.state.selection.main.head, i = e.coordsAtPos(o - this.queryTerm.length - 2);
28
- if (i) {
29
+ const d = e.state.selection.main.head, n = e.coordsAtPos(d - this.queryTerm.length - 2);
30
+ if (n) {
29
31
  const r = (c = document.querySelector(".scalar-client")) == null ? void 0 : c.getBoundingClientRect();
30
- r && (this.dropdown = q({
31
- render: () => p(x, { to: ".scalar-client" }, [
32
- p(v, {
32
+ r && (this.dropdown = T({
33
+ render: () => w(S, { to: ".scalar-client" }, [
34
+ w(q, {
33
35
  query: this.queryTerm,
34
36
  onSelect: this.onSelect,
35
37
  withServers: this.withServers,
38
+ activeParsedEnvironments: this.activeParsedEnvironments,
39
+ environments: this.environments,
40
+ router: this.router,
36
41
  style: {
37
42
  position: "absolute",
38
- left: `${i.left - r.left}px`,
39
- top: `calc(${i.bottom - r.top}px + 6px)`
43
+ left: `${n.left - r.left}px`,
44
+ top: `calc(${n.bottom - r.top}px + 6px)`
40
45
  }
41
46
  })
42
47
  ])
43
- })), this.dropdown.use(f), this.dropdown.mount(s);
48
+ })), this.dropdown.use(this.router), this.dropdown.mount(i);
44
49
  }
45
- }, 0), s;
50
+ }, 0), i;
46
51
  }
47
52
  destroy() {
48
53
  this.dropdown && (this.dropdown.unmount(), this.dropdown = null);
@@ -51,54 +56,60 @@ class u extends S {
51
56
  return e instanceof u && this.queryTerm === e.queryTerm;
52
57
  }
53
58
  }
54
- const P = (d) => y.fromClass(
59
+ const C = (s) => p.fromClass(
55
60
  class {
56
61
  constructor(t) {
57
- n(this, "decorations");
58
- n(this, "widget", null);
59
- n(this, "view");
62
+ o(this, "decorations");
63
+ o(this, "widget", null);
64
+ o(this, "view");
60
65
  this.view = t, this.decorations = h.none, this.handleDropdownSelect = this.handleDropdownSelect.bind(this);
61
66
  }
62
67
  handleDropdownSelect(t) {
63
- var w;
68
+ var m;
64
69
  if (!this.widget) return;
65
- const { state: e, dispatch: s } = this.view, o = e.selection.main.head, i = Math.max(0, o - this.widget.getQueryTerm().length - 2), c = o, r = `{{${t}}}`;
66
- s({
67
- changes: { from: i, to: c, insert: r }
68
- }), (w = this.widget) == null || w.destroy(), this.widget = null, this.decorations = h.none, this.view.dispatch({
69
- effects: T.appendConfig.of([])
70
+ const { state: e, dispatch: i } = this.view, d = e.selection.main.head, n = Math.max(0, d - this.widget.getQueryTerm().length - 2), c = d, r = `{{${t}}}`;
71
+ i({
72
+ changes: { from: n, to: c, insert: r }
73
+ }), (m = this.widget) == null || m.destroy(), this.widget = null, this.decorations = h.none, this.view.dispatch({
74
+ effects: v.appendConfig.of([])
70
75
  });
71
- const l = i + r.length, a = "";
76
+ const a = n + r.length, l = "";
72
77
  this.widget = new u(
73
- a,
78
+ l,
74
79
  this.handleDropdownSelect,
75
- d.withServers
80
+ s.activeParsedEnvironments,
81
+ s.environments,
82
+ s.router,
83
+ s.withServers
76
84
  ), this.decorations = h.set([
77
85
  h.widget({
78
86
  widget: this.widget,
79
87
  side: 1
80
- }).range(l)
88
+ }).range(a)
81
89
  ]), this.view.dispatch({
82
- selection: { anchor: l }
90
+ selection: { anchor: a }
83
91
  }), this.view.focus();
84
92
  }
85
93
  update(t) {
86
- var r, l;
87
- const e = t.state.selection.main.head, s = t.state.doc.sliceString(0, e), o = [], i = s.lastIndexOf("{{"), c = s.lastIndexOf("}}");
88
- if (i > c) {
89
- const a = s.slice(i + 2);
90
- !this.widget || this.widget.getQueryTerm() !== a ? ((r = this.widget) == null || r.destroy(), this.widget = new u(
91
- a,
92
- this.handleDropdownSelect
93
- )) : this.widget.updateQueryTerm(a), o.push(
94
+ var r, a;
95
+ const e = t.state.selection.main.head, i = t.state.doc.sliceString(0, e), d = [], n = i.lastIndexOf("{{"), c = i.lastIndexOf("}}");
96
+ if (n > c) {
97
+ const l = i.slice(n + 2);
98
+ !this.widget || this.widget.getQueryTerm() !== l ? ((r = this.widget) == null || r.destroy(), this.widget = new u(
99
+ l,
100
+ this.handleDropdownSelect,
101
+ s.activeParsedEnvironments,
102
+ s.environments,
103
+ s.router
104
+ )) : this.widget.updateQueryTerm(l), d.push(
94
105
  h.widget({
95
106
  widget: this.widget,
96
107
  side: 1
97
108
  }).range(e)
98
109
  );
99
110
  } else
100
- (l = this.widget) == null || l.destroy(), this.widget = null;
101
- this.decorations = h.set(o);
111
+ (a = this.widget) == null || a.destroy(), this.widget = null;
112
+ this.decorations = h.set(d);
102
113
  }
103
114
  },
104
115
  {
@@ -106,5 +117,5 @@ const P = (d) => y.fromClass(
106
117
  }
107
118
  );
108
119
  export {
109
- P as dropdownPlugin
120
+ C as dropdownPlugin
110
121
  };
@@ -1,8 +1,17 @@
1
+ import type { WorkspaceStore } from '../../store/workspace.js';
2
+ import type { Environment } from '@scalar/oas-utils/entities/workspace/environment';
1
3
  import { Decoration, type DecorationSet, EditorView, ViewPlugin, type ViewUpdate } from '@scalar/use-codemirror';
2
- export declare const pillPlugin: ViewPlugin<{
4
+ type ActiveParsedEnvironments = WorkspaceStore['activeParsedEnvironments'];
5
+ type IsReadOnly = WorkspaceStore['isReadOnly'];
6
+ export declare const pillPlugin: (props: {
7
+ environments: Record<string, Environment>;
8
+ activeParsedEnvironments: ActiveParsedEnvironments;
9
+ isReadOnly: IsReadOnly;
10
+ }) => ViewPlugin<{
3
11
  decorations: DecorationSet;
4
12
  update(update: ViewUpdate): void;
5
13
  buildDecorations(view: EditorView): import("@codemirror/state").RangeSet<Decoration>;
6
14
  }>;
7
15
  export declare const backspaceCommand: import("@codemirror/state").Extension;
16
+ export {};
8
17
  //# sourceMappingURL=codeVariableWidget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAqH/B,eAAO,MAAM,UAAU;iBAEN,aAAa;mBAMX,UAAU;2BAMF,UAAU;EA6BpC,CAAA;AAED,eAAO,MAAM,gBAAgB,uCAmB3B,CAAA"}
1
+ {"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAA;AACnF,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAuB/B,KAAK,wBAAwB,GAAG,cAAc,CAAC,0BAA0B,CAAC,CAAA;AAC1E,KAAK,UAAU,GAAG,cAAc,CAAC,YAAY,CAAC,CAAA;AA2G9C,eAAO,MAAM,UAAU,UAAW;IAChC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACzC,wBAAwB,EAAE,wBAAwB,CAAA;IAClD,UAAU,EAAE,UAAU,CAAA;CACvB;iBAGkB,aAAa;mBAMX,UAAU;2BAMF,UAAU;EAkCpC,CAAA;AAEH,eAAO,MAAM,gBAAgB,uCAmB3B,CAAA"}