@scalar/api-client 2.0.15 → 2.0.16

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 (112) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +46 -3
  3. package/dist/App/ApiClientApp.vue.d.ts +3 -0
  4. package/dist/App/ApiClientApp.vue.d.ts.map +1 -0
  5. package/dist/App/ApiClientApp.vue.js +56 -0
  6. package/dist/App/ApiClientApp.vue3.js +5 -0
  7. package/dist/App/createApiClientApp.d.ts +16 -0
  8. package/dist/App/createApiClientApp.d.ts.map +1 -0
  9. package/dist/App/createApiClientApp.js +62 -0
  10. package/dist/App/index.d.ts +3 -0
  11. package/dist/App/index.d.ts.map +1 -0
  12. package/dist/App/index.js +6 -0
  13. package/dist/App.vue.d.ts.map +1 -1
  14. package/dist/App.vue.js +49 -33
  15. package/dist/Modal/api-client-modal.d.ts +1 -1
  16. package/dist/Modal/api-client-modal.d.ts.map +1 -1
  17. package/dist/Modal/api-client-modal.js +7 -7
  18. package/dist/Modal/index.js +4 -4
  19. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  20. package/dist/components/AddressBar/AddressBar.vue.js +1 -1
  21. package/dist/components/AddressBar/AddressBar.vue2.js +2 -2
  22. package/dist/components/CodeInput/CodeInput.vue.d.ts +31 -4
  23. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  24. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  25. package/dist/components/CodeInput/CodeInput.vue2.js +61 -37
  26. package/dist/components/CommandPalette/CommandPalette.vue.d.ts +17 -0
  27. package/dist/components/CommandPalette/CommandPalette.vue.d.ts.map +1 -0
  28. package/dist/components/CommandPalette/CommandPalette.vue.js +7 -0
  29. package/dist/components/CommandPalette/CommandPalette.vue2.js +184 -0
  30. package/dist/components/{ActionModal/ActionModalImport.vue.d.ts → CommandPalette/CommandPaletteCollection.vue.d.ts} +1 -1
  31. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -0
  32. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +66 -0
  33. package/dist/components/CommandPalette/CommandPaletteCollection.vue2.js +4 -0
  34. package/dist/components/{ActionModal/ActionModalCollection.vue.d.ts → CommandPalette/CommandPaletteExample.vue.d.ts} +1 -1
  35. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -0
  36. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +107 -0
  37. package/dist/components/CommandPalette/CommandPaletteExample.vue2.js +4 -0
  38. package/dist/components/{ActionModal/ActionModalRequest.vue.d.ts → CommandPalette/CommandPaletteFolder.vue.d.ts} +1 -1
  39. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -0
  40. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +104 -0
  41. package/dist/components/CommandPalette/CommandPaletteFolder.vue2.js +4 -0
  42. package/dist/components/{ActionModal/ActionModalVariant.vue.d.ts → CommandPalette/CommandPaletteImport.vue.d.ts} +1 -1
  43. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -0
  44. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +86 -0
  45. package/dist/components/CommandPalette/CommandPaletteImport.vue2.js +4 -0
  46. package/dist/components/{ActionModal/ActionModalFolder.vue.d.ts → CommandPalette/CommandPaletteRequest.vue.d.ts} +1 -1
  47. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -0
  48. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +119 -0
  49. package/dist/components/CommandPalette/CommandPaletteRequest.vue2.js +4 -0
  50. package/dist/components/ContextBar.vue.js +5 -5
  51. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +6 -6
  52. package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
  53. package/dist/components/DataTable/DataTableCell.vue.js +4 -4
  54. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  55. package/dist/components/SideNav/SideNavLink.vue.js +3 -3
  56. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  57. package/dist/components/TopNav/TopNav.vue.js +1 -1
  58. package/dist/components/TopNav/TopNav.vue2.js +26 -26
  59. package/dist/components/TopNav/TopNavItem.vue.js +2 -2
  60. package/dist/components/TopNav/TopNavItem.vue2.js +8 -8
  61. package/dist/hooks/index.d.ts +0 -1
  62. package/dist/hooks/index.d.ts.map +1 -1
  63. package/dist/hooks/index.js +6 -9
  64. package/dist/index.d.ts +1 -0
  65. package/dist/index.d.ts.map +1 -1
  66. package/dist/index.js +11 -6
  67. package/dist/router.d.ts +4 -1
  68. package/dist/router.d.ts.map +1 -1
  69. package/dist/style.css +1 -1
  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 +68 -74
  75. package/dist/views/Request/RequestSection/RequestSection.vue.js +7 -7
  76. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  77. package/dist/views/Request/RequestSection/RequestTable.vue.js +4 -5
  78. package/dist/views/Request/RequestSection/RequestTable.vue2.js +80 -64
  79. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  80. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  81. package/dist/views/Request/RequestSidebarItem.vue2.js +48 -48
  82. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  83. package/dist/views/Request/RequestSidebarItemMenu.vue.js +41 -68
  84. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +2 -2
  85. package/package.json +11 -6
  86. package/dist/assets/ascii/collection.ascii.js +0 -10
  87. package/dist/assets/ascii/folder.ascii.js +0 -10
  88. package/dist/assets/ascii/import.ascii.js +0 -10
  89. package/dist/assets/ascii/request.ascii.js +0 -10
  90. package/dist/assets/ascii/variant.ascii.js +0 -10
  91. package/dist/components/ActionModal/ActionModal.vue.d.ts +0 -21
  92. package/dist/components/ActionModal/ActionModal.vue.d.ts.map +0 -1
  93. package/dist/components/ActionModal/ActionModal.vue.js +0 -7
  94. package/dist/components/ActionModal/ActionModal.vue2.js +0 -117
  95. package/dist/components/ActionModal/ActionModalCollection.vue.d.ts.map +0 -1
  96. package/dist/components/ActionModal/ActionModalCollection.vue.js +0 -54
  97. package/dist/components/ActionModal/ActionModalCollection.vue2.js +0 -4
  98. package/dist/components/ActionModal/ActionModalFolder.vue.d.ts.map +0 -1
  99. package/dist/components/ActionModal/ActionModalFolder.vue.js +0 -92
  100. package/dist/components/ActionModal/ActionModalFolder.vue2.js +0 -4
  101. package/dist/components/ActionModal/ActionModalImport.vue.d.ts.map +0 -1
  102. package/dist/components/ActionModal/ActionModalImport.vue.js +0 -70
  103. package/dist/components/ActionModal/ActionModalImport.vue2.js +0 -4
  104. package/dist/components/ActionModal/ActionModalRequest.vue.d.ts.map +0 -1
  105. package/dist/components/ActionModal/ActionModalRequest.vue.js +0 -108
  106. package/dist/components/ActionModal/ActionModalRequest.vue2.js +0 -4
  107. package/dist/components/ActionModal/ActionModalVariant.vue.d.ts.map +0 -1
  108. package/dist/components/ActionModal/ActionModalVariant.vue.js +0 -93
  109. package/dist/components/ActionModal/ActionModalVariant.vue2.js +0 -4
  110. package/dist/hooks/useActionModal.d.ts +0 -16
  111. package/dist/hooks/useActionModal.d.ts.map +0 -1
  112. package/dist/hooks/useActionModal.js +0 -25
@@ -1,10 +1,16 @@
1
- import { defineComponent as B, useAttrs as _, ref as d, toRef as n, watch as b, openBlock as y, createElementBlock as C, mergeProps as F, unref as k } from "vue";
2
- import { useCodeMirror as w, colorPicker as P } from "@scalar/use-codemirror";
3
- import { nanoid as V } from "nanoid";
4
- const v = ["id"], M = {
1
+ import { defineComponent as k, useAttrs as C, ref as p, toRef as o, watch as v, openBlock as r, createElementBlock as a, Fragment as w, createElementVNode as x, mergeProps as F, unref as V, renderSlot as f, createCommentVNode as m } from "vue";
2
+ import { useCodeMirror as S, colorPicker as E } from "@scalar/use-codemirror";
3
+ import { nanoid as N } from "nanoid";
4
+ const P = ["id"], $ = {
5
+ key: 0,
6
+ class: "absolute centered-y right-7 text-orange text-xs"
7
+ }, q = {
8
+ key: 1,
9
+ 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"
10
+ }, I = {
5
11
  inheritAttrs: !1
6
- }, R = /* @__PURE__ */ B({
7
- ...M,
12
+ }, A = /* @__PURE__ */ k({
13
+ ...I,
8
14
  __name: "CodeInput",
9
15
  props: {
10
16
  colorPicker: { type: Boolean, default: !1 },
@@ -13,47 +19,65 @@ const v = ["id"], M = {
13
19
  emitOnBlur: { type: Boolean, default: !0 },
14
20
  lineNumbers: { type: Boolean },
15
21
  lint: { type: Boolean },
22
+ disableTabIndent: { type: Boolean, default: !1 },
16
23
  language: {},
17
24
  handleFieldSubmit: {},
18
- handleFieldChange: {}
25
+ handleFieldChange: {},
26
+ placeholder: {},
27
+ required: { type: Boolean },
28
+ disableEnter: { type: Boolean, default: !1 },
29
+ disableCloseBrackets: { type: Boolean, default: !1 }
19
30
  },
20
31
  emits: ["submit", "update:modelValue"],
21
- setup(c, { emit: f }) {
22
- var s;
23
- const o = c, l = f, r = _(), m = r.id || `id-${V()}`, a = d(!1);
24
- function p(e) {
25
- return o.handleFieldChange ? o.handleFieldChange(e) : l("update:modelValue", e);
32
+ setup(h, { emit: b }) {
33
+ var c;
34
+ const e = h, n = b, i = C(), g = i.id || `id-${N()}`, s = p(!1);
35
+ function y(t) {
36
+ return e.handleFieldChange ? e.handleFieldChange(t) : n("update:modelValue", t);
26
37
  }
27
- function h(e) {
28
- return o.handleFieldSubmit ? o.handleFieldSubmit(e) : l("submit", e);
38
+ function B(t) {
39
+ return e.handleFieldSubmit ? e.handleFieldSubmit(t) : n("submit", t);
29
40
  }
30
- function g(e) {
31
- a.value = !1, o.emitOnBlur && o.modelValue && h(e);
41
+ function _(t) {
42
+ s.value = !1, e.emitOnBlur && e.modelValue && B(t);
32
43
  }
33
- const i = [];
34
- o.colorPicker && i.push(P);
35
- const u = d(null), { codeMirror: t } = w({
36
- content: n(() => o.modelValue ?? ""),
37
- onChange: p,
38
- onFocus: () => a.value = !0,
39
- onBlur: (e) => g(e),
44
+ const d = [];
45
+ e.colorPicker && d.push(E);
46
+ const u = p(null), { codeMirror: l } = S({
47
+ content: o(
48
+ () => e.modelValue !== void 0 ? String(e.modelValue) : ""
49
+ ),
50
+ onChange: y,
51
+ onFocus: () => s.value = !0,
52
+ onBlur: (t) => _(t),
40
53
  codeMirrorRef: u,
41
- lineNumbers: n(() => o.lineNumbers),
42
- language: n(() => o.language),
43
- lint: n(() => o.lint),
44
- extensions: i
54
+ disableTabIndent: o(() => e.disableTabIndent),
55
+ disableEnter: o(() => e.disableEnter),
56
+ disableCloseBrackets: o(() => e.disableCloseBrackets),
57
+ lineNumbers: o(() => e.lineNumbers),
58
+ language: o(() => e.language),
59
+ lint: o(() => e.lint),
60
+ extensions: d,
61
+ placeholder: o(() => e.placeholder)
45
62
  });
46
- return (s = t.value) == null || s.focus(), b(t, () => {
47
- t.value && Object.prototype.hasOwnProperty.call(r, "autofocus") && t.value.focus();
48
- }), (e, O) => (y(), C("div", F({ id: k(m) }, e.$attrs, {
49
- ref_key: "codeMirrorRef",
50
- ref: u,
51
- class: ["font-code w-full whitespace-nowrap text-xs leading-[1.44]", {
52
- "flow-code-input--error": e.error
53
- }]
54
- }), null, 16, v));
63
+ return (c = l.value) == null || c.focus(), v(l, () => {
64
+ l.value && Object.prototype.hasOwnProperty.call(i, "autofocus") && l.value.focus();
65
+ }), (t, M) => (r(), a(w, null, [
66
+ x("div", F({ id: V(g) }, t.$attrs, {
67
+ ref_key: "codeMirrorRef",
68
+ ref: u,
69
+ class: ["peer font-code w-full whitespace-nowrap text-xs leading-[1.44] relative", {
70
+ "flow-code-input--error": t.error
71
+ }]
72
+ }), null, 16, P),
73
+ t.$slots.warning ? (r(), a("div", $, [
74
+ f(t.$slots, "warning", {}, void 0, !0)
75
+ ])) : m("", !0),
76
+ f(t.$slots, "icon", {}, void 0, !0),
77
+ t.required ? (r(), a("div", q, " Required ")) : m("", !0)
78
+ ], 64));
55
79
  }
56
80
  });
57
81
  export {
58
- R as default
82
+ A as default
59
83
  };
@@ -0,0 +1,17 @@
1
+ import { type ModalState } from '@scalar/components';
2
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
3
+ state: ModalState;
4
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
5
+ state: ModalState;
6
+ }>>>, {}, {}>;
7
+ export default _default;
8
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
+ type __VLS_TypePropsToOption<T> = {
10
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
11
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
+ } : {
13
+ type: import('vue').PropType<T[K]>;
14
+ required: true;
15
+ };
16
+ };
17
+ //# sourceMappingURL=CommandPalette.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPalette.vue"],"names":[],"mappings":"AA2TA,OAAO,EAAa,KAAK,UAAU,EAAc,MAAM,oBAAoB,CAAA;;WAclE,UAAU;;WAAV,UAAU;;AAmYnB,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"}
@@ -0,0 +1,7 @@
1
+ import o from "./CommandPalette.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-158208c8"]]);
5
+ export {
6
+ e as default
7
+ };
@@ -0,0 +1,184 @@
1
+ import { defineComponent as I, ref as f, computed as B, openBlock as r, createElementBlock as s, Fragment as m, withDirectives as p, createElementVNode as a, vShow as A, createVNode as y, unref as g, vModelText as D, renderList as $, toDisplayString as E, normalizeClass as F, createTextVNode as N, createBlock as q, resolveDynamicComponent as M } from "vue";
2
+ import { ScalarIcon as L } from "@scalar/components";
3
+ import { useMagicKeys as P, whenever as C } from "@vueuse/core";
4
+ import { useRouter as T } from "vue-router";
5
+ import U from "./CommandPaletteCollection.vue.js";
6
+ import G from "./CommandPaletteExample.vue.js";
7
+ import H from "./CommandPaletteFolder.vue.js";
8
+ import K from "./CommandPaletteImport.vue.js";
9
+ import Q from "./CommandPaletteRequest.vue.js";
10
+ const W = { class: "commandmenu" }, j = { class: "bg-b-2 flex items-center rounded mb-2 pl-2 focus-within:bg-b-1 focus-within:shadow-border" }, J = { for: "commandmenu" }, O = ["onClick"], se = /* @__PURE__ */ I({
11
+ __name: "CommandPalette",
12
+ props: {
13
+ state: {}
14
+ },
15
+ setup(V) {
16
+ const i = V, b = T(), z = {
17
+ "Import Collection": K,
18
+ "Create Request": Q,
19
+ "Add Folder": H,
20
+ "Create Collection": U,
21
+ "Add Example": G
22
+ }, h = [
23
+ {
24
+ label: "Add to Request Sidebar",
25
+ commands: [
26
+ {
27
+ name: "Create Request",
28
+ icon: "ExternalLink"
29
+ },
30
+ {
31
+ name: "Import Collection",
32
+ icon: "Import"
33
+ },
34
+ {
35
+ name: "Add Folder",
36
+ icon: "Folder"
37
+ },
38
+ {
39
+ name: "Create Collection",
40
+ icon: "Collection"
41
+ },
42
+ {
43
+ name: "Add Example",
44
+ icon: "Example"
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ label: "More Actions",
50
+ commands: [
51
+ {
52
+ name: "Add Server",
53
+ icon: "Brackets",
54
+ overloadAction: () => b.push("/servers")
55
+ },
56
+ {
57
+ name: "Add Environment",
58
+ icon: "Server",
59
+ overloadAction: () => b.push("/environment")
60
+ },
61
+ {
62
+ name: "Add Cookie",
63
+ icon: "Cookie",
64
+ overloadAction: () => b.push("/cookies")
65
+ }
66
+ ]
67
+ }
68
+ ], d = P(), c = f(""), u = f(""), t = f(0), w = f([]), k = B(
69
+ () => h.reduce((e, n) => {
70
+ const l = n.commands.filter(
71
+ (v) => v.name.toLowerCase().includes(c.value.toLowerCase())
72
+ );
73
+ return [...e, ...l];
74
+ }, [])
75
+ );
76
+ C(d.escape, () => {
77
+ i.state.open && i.state.hide();
78
+ });
79
+ function S() {
80
+ i.state.hide(), c.value = "", u.value = "";
81
+ }
82
+ return C(d.enter, () => {
83
+ var n;
84
+ if (!i.state.open || !window)
85
+ return;
86
+ const e = k.value[t.value];
87
+ ((n = e == null ? void 0 : e.overloadAction) == null ? void 0 : n.call(e)) ?? (u.value = e.name);
88
+ }), C(d.ArrowDown, () => {
89
+ var e;
90
+ i.state.open && window && (t.value < k.value.length - 1 ? t.value++ : t.value = 0, (e = w.value[t.value]) == null || e.scrollIntoView({
91
+ behavior: "smooth",
92
+ block: "center"
93
+ }));
94
+ }), C(d.ArrowUp, () => {
95
+ var e;
96
+ i.state.open && window && (t.value > 0 ? t.value-- : t.value = k.value.length - 1, (e = w.value[t.value]) == null || e.scrollIntoView({
97
+ behavior: "smooth",
98
+ block: "center"
99
+ }));
100
+ }), (e, n) => (r(), s(m, null, [
101
+ p(a("div", {
102
+ class: "commandmenu-clickout",
103
+ onClick: n[0] || (n[0] = (l) => S())
104
+ }, null, 512), [
105
+ [A, e.state.open]
106
+ ]),
107
+ p(a("div", W, [
108
+ u.value ? (r(), s(m, { key: 1 }, [
109
+ a("button", {
110
+ class: "absolute p-1 hover:bg-b-3 rounded text-c-3 active:text-c-1 m-1.5 z-10",
111
+ type: "button",
112
+ onClick: n[2] || (n[2] = (l) => u.value = "")
113
+ }, [
114
+ y(g(L), {
115
+ class: "!stroke-1.5",
116
+ icon: "ChevronLeft",
117
+ size: "sm"
118
+ })
119
+ ]),
120
+ (r(), q(M(z[u.value]), { onClose: S }, null, 32))
121
+ ], 64)) : (r(), s(m, { key: 0 }, [
122
+ a("div", j, [
123
+ a("label", J, [
124
+ y(g(L), {
125
+ class: "text-c-1 mr-2.5 !stroke-1.5",
126
+ icon: "SearchNew",
127
+ size: "sm"
128
+ })
129
+ ]),
130
+ p(a("input", {
131
+ id: "commandmenu",
132
+ "onUpdate:modelValue": n[1] || (n[1] = (l) => c.value = l),
133
+ class: "w-full rounded bg-none border-none py-1.5 text-sm focus:outline-none",
134
+ placeholder: "Search commands...",
135
+ type: "text"
136
+ }, null, 512), [
137
+ [D, c.value]
138
+ ])
139
+ ]),
140
+ (r(), s(m, null, $(h, (l, v) => (r(), s(m, {
141
+ key: l.label
142
+ }, [
143
+ p(a("div", { class: "text-c-3 font-medium text-xs mt-2" }, E(l.label), 513), [
144
+ [
145
+ A,
146
+ l.commands.filter(
147
+ (o) => o.name.toLowerCase().includes(c.value.toLowerCase())
148
+ ).length > 0
149
+ ]
150
+ ]),
151
+ (r(!0), s(m, null, $(l.commands.filter(
152
+ (o) => o.name.toLowerCase().includes(c.value.toLowerCase())
153
+ ), (o, _) => (r(), s("div", {
154
+ key: o.name,
155
+ ref_for: !0,
156
+ ref: (x) => {
157
+ x && (w.value[_] = x);
158
+ },
159
+ class: F(["commandmenu-item text-sm flex items-center py-1.5 px-2 rounded hover:bg-b-2 cursor-pointer", {
160
+ "bg-b-2": v > 0 ? t.value === _ + h[v - 1].commands.length : t.value === _
161
+ }]),
162
+ onClick: (x) => {
163
+ var R;
164
+ return ((R = o == null ? void 0 : o.overloadAction) == null ? void 0 : R.call(o)) ?? (u.value = o.name);
165
+ }
166
+ }, [
167
+ y(g(L), {
168
+ class: "text-c-1 mr-2.5 !stroke-1.5",
169
+ icon: o.icon,
170
+ size: "md"
171
+ }, null, 8, ["icon"]),
172
+ N(" " + E(o.name), 1)
173
+ ], 10, O))), 128))
174
+ ], 64))), 64))
175
+ ], 64))
176
+ ], 512), [
177
+ [A, e.state.open]
178
+ ])
179
+ ], 64));
180
+ }
181
+ });
182
+ export {
183
+ se as default
184
+ };
@@ -17,4 +17,4 @@ type __VLS_TypePropsToOption<T> = {
17
17
  required: true;
18
18
  };
19
19
  };
20
- //# sourceMappingURL=ActionModalImport.vue.d.ts.map
20
+ //# sourceMappingURL=CommandPaletteCollection.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPaletteCollection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteCollection.vue"],"names":[],"mappings":";WAuES,MAAM;;;;WAAN,MAAM;;;;AAkIf,wBAOG;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"}
@@ -0,0 +1,66 @@
1
+ import { defineComponent as m, ref as s, onMounted as p, openBlock as d, createElementBlock as f, Fragment as h, createElementVNode as e, toDisplayString as x, withModifiers as _, withDirectives as b, vModelText as v, createVNode as w, unref as g, withCtx as C, createTextVNode as N } from "vue";
2
+ import { useWorkspace as y } from "../../store/workspace.js";
3
+ import { ScalarButton as k } from "@scalar/components";
4
+ const M = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, S = /* @__PURE__ */ e("label", {
5
+ class: "absolute w-full h-full opacity-0 cursor-text",
6
+ for: "collectionanme"
7
+ }, null, -1), V = { class: "flex" }, B = /* @__PURE__ */ e("div", { class: "flex flex-1 gap-2 max-h-8" }, null, -1), F = /* @__PURE__ */ m({
8
+ __name: "CommandPaletteCollection",
9
+ props: {
10
+ title: {}
11
+ },
12
+ emits: ["close"],
13
+ setup(D, { emit: i }) {
14
+ const a = i, { collectionMutators: c } = y(), l = s(""), r = () => {
15
+ c.add({
16
+ spec: {
17
+ openapi: "3.1.0",
18
+ info: {
19
+ title: l.value,
20
+ version: "0.0.1"
21
+ }
22
+ }
23
+ }), a("close");
24
+ }, o = s(null);
25
+ return p(() => {
26
+ var t;
27
+ (t = o.value) == null || t.focus();
28
+ }), (t, n) => (d(), f(h, null, [
29
+ e("h2", null, x(t.title), 1),
30
+ e("form", {
31
+ class: "flex w-full flex-col gap-3",
32
+ onSubmit: _(r, ["prevent"])
33
+ }, [
34
+ e("div", M, [
35
+ S,
36
+ b(e("input", {
37
+ id: "collectionanme",
38
+ ref_key: "collectionInput",
39
+ ref: o,
40
+ "onUpdate:modelValue": n[0] || (n[0] = (u) => l.value = u),
41
+ class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
42
+ label: "Collection Name",
43
+ placeholder: "Collection Name"
44
+ }, null, 512), [
45
+ [v, l.value]
46
+ ])
47
+ ]),
48
+ e("div", V, [
49
+ B,
50
+ w(g(k), {
51
+ class: "max-h-8 text-xs p-0 px-3",
52
+ type: "submit"
53
+ }, {
54
+ default: C(() => [
55
+ N(" Continue ")
56
+ ]),
57
+ _: 1
58
+ })
59
+ ])
60
+ ], 32)
61
+ ], 64));
62
+ }
63
+ });
64
+ export {
65
+ F as default
66
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CommandPaletteCollection.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -17,4 +17,4 @@ type __VLS_TypePropsToOption<T> = {
17
17
  required: true;
18
18
  };
19
19
  };
20
- //# sourceMappingURL=ActionModalCollection.vue.d.ts.map
20
+ //# sourceMappingURL=CommandPaletteExample.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":";WAyGS,MAAM;;;;WAAN,MAAM;;;;AAwQf,wBAOG;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"}
@@ -0,0 +1,107 @@
1
+ import { defineComponent as k, ref as i, onMounted as y, openBlock as m, createElementBlock as h, Fragment as v, createElementVNode as e, toDisplayString as u, withModifiers as C, withDirectives as S, vModelText as N, createVNode as a, unref as s, withCtx as n, renderList as V, createBlock as D, createTextVNode as c } from "vue";
2
+ import _ from "../HttpMethod/HttpMethod.vue.js";
3
+ import { useWorkspace as B } from "../../store/workspace.js";
4
+ import { ScalarDropdown as E, ScalarDropdownItem as I, ScalarButton as w, ScalarIcon as $ } from "@scalar/components";
5
+ const M = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, j = /* @__PURE__ */ e("label", {
6
+ class: "absolute w-full h-full opacity-0 cursor-text",
7
+ for: "examplename"
8
+ }, null, -1), z = { class: "flex gap-2" }, R = { class: "flex flex-1 max-h-8" }, T = { class: "flex items-center gap-2" }, F = { class: "max-h-40 custom-scroll" }, H = /* @__PURE__ */ k({
9
+ __name: "CommandPaletteExample",
10
+ props: {
11
+ title: {}
12
+ },
13
+ emits: ["close"],
14
+ setup(L, { emit: b }) {
15
+ const g = b, { workspaceRequests: p } = B(), d = i(""), r = i(p.value[0]);
16
+ function f(l) {
17
+ r.value = l;
18
+ }
19
+ const x = i(null);
20
+ return y(() => {
21
+ var l;
22
+ (l = x.value) == null || l.focus();
23
+ }), (l, o) => (m(), h(v, null, [
24
+ e("h2", null, u(l.title), 1),
25
+ e("form", {
26
+ class: "flex w-full flex-col gap-3",
27
+ onSubmit: o[2] || (o[2] = C((t) => g("close"), ["prevent"]))
28
+ }, [
29
+ e("div", M, [
30
+ j,
31
+ S(e("input", {
32
+ id: "examplename",
33
+ ref_key: "exampleInput",
34
+ ref: x,
35
+ "onUpdate:modelValue": o[0] || (o[0] = (t) => d.value = t),
36
+ class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
37
+ label: "Variant Name",
38
+ placeholder: "Variant Name"
39
+ }, null, 512), [
40
+ [N, d.value]
41
+ ])
42
+ ]),
43
+ e("div", z, [
44
+ e("div", R, [
45
+ a(s(E), {
46
+ placement: "bottom",
47
+ resize: ""
48
+ }, {
49
+ items: n(() => [
50
+ e("div", F, [
51
+ (m(!0), h(v, null, V(s(p), (t) => (m(), D(s(I), {
52
+ key: t.uid,
53
+ class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
54
+ onClick: (P) => f(t)
55
+ }, {
56
+ default: n(() => [
57
+ c(u(t.summary) + " ", 1),
58
+ a(_, {
59
+ method: t.method
60
+ }, null, 8, ["method"])
61
+ ]),
62
+ _: 2
63
+ }, 1032, ["onClick"]))), 128))
64
+ ])
65
+ ]),
66
+ default: n(() => [
67
+ a(s(w), {
68
+ class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
69
+ variant: "outlined",
70
+ onClick: o[1] || (o[1] = (t) => f(r.value))
71
+ }, {
72
+ default: n(() => [
73
+ c(u(r.value.summary) + " ", 1),
74
+ e("div", T, [
75
+ a(_, {
76
+ method: r.value.method
77
+ }, null, 8, ["method"]),
78
+ a(s($), {
79
+ class: "text-c-3",
80
+ icon: "ChevronDown",
81
+ size: "xs"
82
+ })
83
+ ])
84
+ ]),
85
+ _: 1
86
+ })
87
+ ]),
88
+ _: 1
89
+ })
90
+ ]),
91
+ a(s(w), {
92
+ class: "max-h-8 text-xs p-0 px-3",
93
+ type: "submit"
94
+ }, {
95
+ default: n(() => [
96
+ c(" Create Example ")
97
+ ]),
98
+ _: 1
99
+ })
100
+ ])
101
+ ], 32)
102
+ ], 64));
103
+ }
104
+ });
105
+ export {
106
+ H as default
107
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CommandPaletteExample.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -17,4 +17,4 @@ type __VLS_TypePropsToOption<T> = {
17
17
  required: true;
18
18
  };
19
19
  };
20
- //# sourceMappingURL=ActionModalRequest.vue.d.ts.map
20
+ //# sourceMappingURL=CommandPaletteFolder.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPaletteFolder.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteFolder.vue"],"names":[],"mappings":";WA0GS,MAAM;;;;WAAN,MAAM;;;;AAgNf,wBAOG;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"}
@@ -0,0 +1,104 @@
1
+ import { defineComponent as g, ref as r, computed as m, onMounted as C, openBlock as S, createElementBlock as V, Fragment as y, createElementVNode as l, toDisplayString as p, withModifiers as N, withDirectives as F, vModelText as k, createVNode as n, unref as i, withCtx as d, normalizeClass as I, createTextVNode as M } from "vue";
2
+ import { useWorkspace as B } from "../../store/workspace.js";
3
+ import { ScalarListbox as D, ScalarButton as v, ScalarIcon as j } from "@scalar/components";
4
+ const z = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, E = /* @__PURE__ */ l("label", {
5
+ class: "absolute w-full h-full opacity-0 cursor-text",
6
+ for: "foldername"
7
+ }, null, -1), T = { class: "flex" }, U = { class: "flex flex-1 gap-2 max-h-8" }, q = /* @__PURE__ */ g({
8
+ __name: "CommandPaletteFolder",
9
+ props: {
10
+ title: {}
11
+ },
12
+ emits: ["close"],
13
+ setup(L, { emit: x }) {
14
+ const b = x, { collections: h, folderMutators: _ } = B(), s = r(""), u = r(""), c = m(
15
+ () => Object.values(h).map((e) => {
16
+ var t, a;
17
+ return {
18
+ id: e.uid,
19
+ label: ((a = (t = e.spec) == null ? void 0 : t.info) == null ? void 0 : a.title) ?? ""
20
+ };
21
+ })
22
+ ), o = m({
23
+ get: () => c.value.find(
24
+ ({ id: e }) => e === u.value
25
+ ),
26
+ set: (e) => {
27
+ e != null && e.id && (u.value = e.id);
28
+ }
29
+ }), w = () => {
30
+ s.value && o.value && (_.add(
31
+ {
32
+ name: s.value
33
+ },
34
+ u.value
35
+ ), b("close"));
36
+ }, f = r(null);
37
+ return C(() => {
38
+ var e;
39
+ (e = f.value) == null || e.focus();
40
+ }), (e, t) => (S(), V(y, null, [
41
+ l("h2", null, p(e.title), 1),
42
+ l("form", {
43
+ class: "flex w-full flex-col gap-3",
44
+ onSubmit: N(w, ["prevent"])
45
+ }, [
46
+ l("div", z, [
47
+ E,
48
+ F(l("input", {
49
+ id: "foldername",
50
+ ref_key: "folderInput",
51
+ ref: f,
52
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => s.value = a),
53
+ class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
54
+ label: "Folder Name",
55
+ placeholder: "Folder Name"
56
+ }, null, 512), [
57
+ [k, s.value]
58
+ ])
59
+ ]),
60
+ l("div", T, [
61
+ l("div", U, [
62
+ n(i(D), {
63
+ modelValue: o.value,
64
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => o.value = a),
65
+ options: c.value
66
+ }, {
67
+ default: d(() => [
68
+ n(i(v), {
69
+ class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
70
+ variant: "outlined"
71
+ }, {
72
+ default: d(() => [
73
+ l("span", {
74
+ class: I(o.value ? "text-c-1" : "text-c-3")
75
+ }, p(o.value ? o.value.label : "Select Collection"), 3),
76
+ n(i(j), {
77
+ class: "text-c-3",
78
+ icon: "ChevronDown",
79
+ size: "xs"
80
+ })
81
+ ]),
82
+ _: 1
83
+ })
84
+ ]),
85
+ _: 1
86
+ }, 8, ["modelValue", "options"])
87
+ ]),
88
+ n(i(v), {
89
+ class: "max-h-8 text-xs p-0 px-3",
90
+ type: "submit"
91
+ }, {
92
+ default: d(() => [
93
+ M(" Create Folder ")
94
+ ]),
95
+ _: 1
96
+ })
97
+ ])
98
+ ], 32)
99
+ ], 64));
100
+ }
101
+ });
102
+ export {
103
+ q as default
104
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CommandPaletteFolder.vue.js";
2
+ export {
3
+ f as default
4
+ };