@scalar/api-client 2.0.24 → 2.0.26

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 (168) hide show
  1. package/CHANGELOG.md +39 -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 +79 -83
  5. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  6. package/dist/components/AddressBar/AddressBarHistory.vue.js +38 -38
  7. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  8. package/dist/components/CodeInput/CodeInput.vue.d.ts +10 -0
  9. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  10. package/dist/components/CodeInput/CodeInput.vue.js +2 -1
  11. package/dist/components/CodeInput/CodeInput.vue2.js +43 -38
  12. package/dist/components/CodeInput/codeDropdownWidget.d.ts +24 -0
  13. package/dist/components/CodeInput/codeDropdownWidget.d.ts.map +1 -0
  14. package/dist/components/CodeInput/codeDropdownWidget.js +110 -0
  15. package/dist/components/CodeInput/codeVariableWidget.d.ts +8 -0
  16. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -0
  17. package/dist/components/CodeInput/codeVariableWidget.js +124 -0
  18. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts +2 -15
  19. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  20. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +51 -54
  21. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +4 -2
  22. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  23. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +106 -92
  24. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts +2 -15
  25. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  26. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +68 -74
  27. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts +2 -15
  28. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  29. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +56 -62
  30. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +2 -15
  31. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  32. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +106 -99
  33. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts +7 -0
  34. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -0
  35. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +57 -0
  36. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue2.js +4 -0
  37. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +50 -0
  38. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -0
  39. package/dist/components/CommandPalette/TheCommandPalette.vue.js +9 -0
  40. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +198 -0
  41. package/dist/components/CommandPalette/index.d.ts +2 -0
  42. package/dist/components/CommandPalette/index.d.ts.map +1 -0
  43. package/dist/components/CommandPalette/index.js +4 -0
  44. package/dist/components/ContextBar.vue.js +4 -4
  45. package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
  46. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  47. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  48. package/dist/components/DataTable/DataTableInput.vue2.js +36 -49
  49. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  50. package/dist/components/SideNav/SideNav.vue.js +26 -23
  51. package/dist/components/SideNav/SideNavLink.vue.d.ts +3 -2
  52. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  53. package/dist/components/SideNav/SideNavLink.vue.js +5 -5
  54. package/dist/components/Sidebar/Sidebar.vue.d.ts +15 -2
  55. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  56. package/dist/components/Sidebar/Sidebar.vue.js +14 -12
  57. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  58. package/dist/components/Sidebar/SidebarButton.vue.js +5 -5
  59. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  60. package/dist/components/TopNav/TopNav.vue.js +2 -2
  61. package/dist/components/TopNav/TopNav.vue2.js +31 -28
  62. package/dist/components/TopNav/TopNavItem.vue.d.ts +7 -3
  63. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  64. package/dist/components/TopNav/TopNavItem.vue.js +2 -2
  65. package/dist/components/TopNav/TopNavItem.vue2.js +16 -15
  66. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  67. package/dist/components/ViewLayout/ViewLayout.vue.js +1 -1
  68. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  69. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +2 -1
  70. package/dist/constants.d.ts +13 -7
  71. package/dist/constants.d.ts.map +1 -1
  72. package/dist/constants.js +4 -4
  73. package/dist/index.d.ts +3 -4
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +14 -16
  76. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -0
  77. package/dist/layouts/App/ApiClientApp.vue.js +72 -0
  78. package/dist/{App → layouts/App}/createApiClientApp.d.ts +1 -1
  79. package/dist/layouts/App/createApiClientApp.d.ts.map +1 -0
  80. package/dist/{App → layouts/App}/createApiClientApp.js +2 -2
  81. package/dist/layouts/App/index.d.ts.map +1 -0
  82. package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.d.ts +1 -0
  83. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -0
  84. package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.js +2 -2
  85. package/dist/{Modal → layouts/Modal}/api-client-modal.d.ts +1 -1
  86. package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -0
  87. package/dist/{Modal → layouts/Modal}/api-client-modal.js +42 -42
  88. package/dist/layouts/Modal/index.d.ts.map +1 -0
  89. package/dist/libs/eventBusses/command-palette.d.ts +14 -0
  90. package/dist/libs/eventBusses/command-palette.d.ts.map +1 -0
  91. package/dist/libs/eventBusses/command-palette.js +5 -0
  92. package/dist/libs/local-storage.d.ts +1 -1
  93. package/dist/libs/local-storage.d.ts.map +1 -1
  94. package/dist/libs/local-storage.js +19 -19
  95. package/dist/router.d.ts +5 -10
  96. package/dist/router.d.ts.map +1 -1
  97. package/dist/router.js +23 -19
  98. package/dist/store/topNav.d.ts +94 -82
  99. package/dist/store/topNav.d.ts.map +1 -1
  100. package/dist/store/topNav.js +21 -20
  101. package/dist/store/workspace.d.ts +348 -94
  102. package/dist/store/workspace.d.ts.map +1 -1
  103. package/dist/store/workspace.js +314 -221
  104. package/dist/style.css +1 -1
  105. package/dist/views/Collection/Collection.vue.d.ts.map +1 -1
  106. package/dist/views/Components/Schemas/Schemas.vue.d.ts.map +1 -1
  107. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  108. package/dist/views/Cookies/Cookies.vue2.js +27 -30
  109. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  110. package/dist/views/Environment/Environment.vue2.js +22 -25
  111. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  112. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -47
  113. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  114. package/dist/views/Request/Request.vue.js +1 -1
  115. package/dist/views/Request/Request.vue2.js +130 -109
  116. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts +1 -1
  117. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  118. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  119. package/dist/views/Request/RequestSection/RequestSection.vue.js +5 -4
  120. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  121. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  122. package/dist/views/Request/RequestSection/RequestTable.vue2.js +19 -19
  123. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  124. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +6 -5
  125. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  126. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  127. package/dist/views/Request/RequestSidebarItem.vue2.js +78 -81
  128. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  129. package/dist/views/Request/RequestSidebarItemMenu.vue.js +60 -42
  130. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  131. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +6 -5
  132. package/dist/views/Request/components/OAuth2.vue.d.ts.map +1 -1
  133. package/dist/views/Request/components/OAuth2.vue.js +2 -0
  134. package/dist/{App.vue.d.ts → views/Request/components/WorkspaceDropdown.vue.d.ts} +1 -2
  135. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -0
  136. package/dist/views/Request/components/WorkspaceDropdown.vue.js +80 -0
  137. package/dist/views/Request/components/WorkspaceDropdown.vue2.js +4 -0
  138. package/dist/views/Request/components/index.d.ts +1 -0
  139. package/dist/views/Request/components/index.d.ts.map +1 -1
  140. package/dist/views/Request/components/index.js +4 -2
  141. package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
  142. package/dist/views/Servers/Servers.vue2.js +12 -15
  143. package/package.json +22 -18
  144. package/dist/App/ApiClientApp.vue.d.ts.map +0 -1
  145. package/dist/App/ApiClientApp.vue.js +0 -56
  146. package/dist/App/createApiClientApp.d.ts.map +0 -1
  147. package/dist/App/index.d.ts.map +0 -1
  148. package/dist/App.vue.d.ts.map +0 -1
  149. package/dist/App.vue.js +0 -77
  150. package/dist/App.vue3.js +0 -5
  151. package/dist/Modal/ApiClientModal.vue.d.ts.map +0 -1
  152. package/dist/Modal/api-client-modal.d.ts.map +0 -1
  153. package/dist/Modal/index.d.ts.map +0 -1
  154. package/dist/components/AddressBar/AddressBarServer.vue.js +0 -113
  155. package/dist/components/AddressBar/AddressBarServer.vue2.js +0 -4
  156. package/dist/components/CommandPalette/CommandPalette.vue.d.ts +0 -17
  157. package/dist/components/CommandPalette/CommandPalette.vue.d.ts.map +0 -1
  158. package/dist/components/CommandPalette/CommandPalette.vue.js +0 -7
  159. package/dist/components/CommandPalette/CommandPalette.vue2.js +0 -185
  160. package/dist/main.d.ts +0 -2
  161. package/dist/main.d.ts.map +0 -1
  162. /package/dist/{App → layouts/App}/ApiClientApp.vue.d.ts +0 -0
  163. /package/dist/{App → layouts/App}/ApiClientApp.vue3.js +0 -0
  164. /package/dist/{App → layouts/App}/index.d.ts +0 -0
  165. /package/dist/{App → layouts/App}/index.js +0 -0
  166. /package/dist/{Modal → layouts/Modal}/ApiClientModal.vue2.js +0 -0
  167. /package/dist/{Modal → layouts/Modal}/index.d.ts +0 -0
  168. /package/dist/{Modal → layouts/Modal}/index.js +0 -0
@@ -0,0 +1,24 @@
1
+ import { type DecorationSet, type EditorView, ViewPlugin, type ViewUpdate, WidgetType } from '@scalar/use-codemirror';
2
+ declare class DropdownWidget extends WidgetType {
3
+ private queryTerm;
4
+ private onSelect;
5
+ private dropdown;
6
+ private withServers?;
7
+ constructor(queryTerm: string, onSelect: (item: string) => void, withServers?: boolean);
8
+ updateQueryTerm(newQueryTerm: string): void;
9
+ getQueryTerm(): string;
10
+ toDOM(view: EditorView): HTMLSpanElement;
11
+ destroy(): void;
12
+ eq(other: WidgetType): boolean;
13
+ }
14
+ export declare const dropdownPlugin: (props: {
15
+ withServers?: boolean;
16
+ }) => ViewPlugin<{
17
+ decorations: DecorationSet;
18
+ widget: DropdownWidget | null;
19
+ view: EditorView;
20
+ handleDropdownSelect(item: string): void;
21
+ update(update: ViewUpdate): void;
22
+ }>;
23
+ export {};
24
+ //# sourceMappingURL=codeDropdownWidget.d.ts.map
@@ -0,0 +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,UAAU;IACrC,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,QAAQ,CAAY;IAC5B,OAAO,CAAC,WAAW,CAAC,CAAS;gBAG3B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAChC,WAAW,CAAC,EAAE,OAAO;IAQvB,eAAe,CAAC,YAAY,EAAE,MAAM;IAMpC,YAAY;IAIZ,KAAK,CAAC,IAAI,EAAE,UAAU;IAoCtB,OAAO;IAOP,EAAE,CAAC,KAAK,EAAE,UAAU;CAGrB;AAED,eAAO,MAAM,cAAc,UAAW;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE;iBAG5C,aAAa;YAClB,cAAc,GAAG,IAAI;UACvB,UAAU;+BAQW,MAAM;mBAqClB,UAAU;EAsC5B,CAAA"}
@@ -0,0 +1,110 @@
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) {
10
+ 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;
16
+ }
17
+ updateQueryTerm(e) {
18
+ this.queryTerm !== e && (this.queryTerm = e);
19
+ }
20
+ getQueryTerm() {
21
+ return this.queryTerm;
22
+ }
23
+ toDOM(e) {
24
+ const s = document.createElement("span");
25
+ return s.style.position = "fixed", setTimeout(() => {
26
+ var c;
27
+ const o = e.state.selection.main.head, i = e.coordsAtPos(o - this.queryTerm.length - 2);
28
+ if (i) {
29
+ 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, {
33
+ query: this.queryTerm,
34
+ onSelect: this.onSelect,
35
+ withServers: this.withServers,
36
+ style: {
37
+ position: "absolute",
38
+ left: `${i.left - r.left}px`,
39
+ top: `calc(${i.bottom - r.top}px + 6px)`
40
+ }
41
+ })
42
+ ])
43
+ })), this.dropdown.use(f), this.dropdown.mount(s);
44
+ }
45
+ }, 0), s;
46
+ }
47
+ destroy() {
48
+ this.dropdown && (this.dropdown.unmount(), this.dropdown = null);
49
+ }
50
+ eq(e) {
51
+ return e instanceof u && this.queryTerm === e.queryTerm;
52
+ }
53
+ }
54
+ const P = (d) => y.fromClass(
55
+ class {
56
+ constructor(t) {
57
+ n(this, "decorations");
58
+ n(this, "widget", null);
59
+ n(this, "view");
60
+ this.view = t, this.decorations = h.none, this.handleDropdownSelect = this.handleDropdownSelect.bind(this);
61
+ }
62
+ handleDropdownSelect(t) {
63
+ var w;
64
+ 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
+ });
71
+ const l = i + r.length, a = "";
72
+ this.widget = new u(
73
+ a,
74
+ this.handleDropdownSelect,
75
+ d.withServers
76
+ ), this.decorations = h.set([
77
+ h.widget({
78
+ widget: this.widget,
79
+ side: 1
80
+ }).range(l)
81
+ ]), this.view.dispatch({
82
+ selection: { anchor: l }
83
+ }), this.view.focus();
84
+ }
85
+ 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
+ h.widget({
95
+ widget: this.widget,
96
+ side: 1
97
+ }).range(e)
98
+ );
99
+ } else
100
+ (l = this.widget) == null || l.destroy(), this.widget = null;
101
+ this.decorations = h.set(o);
102
+ }
103
+ },
104
+ {
105
+ decorations: (t) => t.decorations
106
+ }
107
+ );
108
+ export {
109
+ P as dropdownPlugin
110
+ };
@@ -0,0 +1,8 @@
1
+ import { Decoration, type DecorationSet, EditorView, ViewPlugin, type ViewUpdate } from '@scalar/use-codemirror';
2
+ export declare const pillPlugin: ViewPlugin<{
3
+ decorations: DecorationSet;
4
+ update(update: ViewUpdate): void;
5
+ buildDecorations(view: EditorView): import("@codemirror/state").RangeSet<Decoration>;
6
+ }>;
7
+ export declare const backspaceCommand: import("@codemirror/state").Extension;
8
+ //# sourceMappingURL=codeVariableWidget.d.ts.map
@@ -0,0 +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;AA+F/B,eAAO,MAAM,UAAU;iBAEN,aAAa;mBAMX,UAAU;2BAMF,UAAU;EA6BpC,CAAA;AAED,eAAO,MAAM,gBAAgB,uCAmB3B,CAAA"}
@@ -0,0 +1,124 @@
1
+ var u = Object.defineProperty;
2
+ var f = (t, a, e) => a in t ? u(t, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[a] = e;
3
+ var c = (t, a, e) => f(t, typeof a != "symbol" ? a + "" : a, e);
4
+ import { useWorkspace as v } from "../../store/workspace.js";
5
+ import { ScalarButton as h, ScalarIcon as b, ScalarTooltip as g } from "@scalar/components";
6
+ import { ViewPlugin as x, RangeSetBuilder as w, Decoration as N, EditorView as y, WidgetType as C } from "@scalar/use-codemirror";
7
+ import { defineComponent as k, h as o, createApp as D } from "vue";
8
+ const { activeParsedEnvironments: S, isReadOnly: E } = v();
9
+ class l extends C {
10
+ constructor(e) {
11
+ super();
12
+ c(this, "app");
13
+ this.variableName = e;
14
+ }
15
+ toDOM() {
16
+ const e = document.createElement("span");
17
+ e.className = "cm-pill", e.textContent = `${this.variableName}`;
18
+ const n = k({
19
+ props: ["variableName"],
20
+ render() {
21
+ const s = S.value.find(
22
+ (i) => i.key === this.variableName
23
+ ), r = s ? o("div", { class: "p-2" }, s.value) : o("div", { class: "divide-y divide-1/2 grid" }, [
24
+ o("span", { class: "p-2" }, "Variable not found"),
25
+ !E.value && o("div", { class: "p-1" }, [
26
+ o(
27
+ h,
28
+ {
29
+ class: "gap-1.5 justify-start font-normal px-1 py-1.5 h-auto transition-colors rounded no-underline text-xxs w-full hover:bg-b-2",
30
+ variant: "ghost",
31
+ onClick: () => {
32
+ window.location.href = "/environment";
33
+ }
34
+ },
35
+ [
36
+ o(b, { class: "w-2", icon: "Add", size: "xs" }),
37
+ "Add variable"
38
+ ]
39
+ )
40
+ ])
41
+ ]);
42
+ return o(
43
+ g,
44
+ {
45
+ align: "start",
46
+ class: "bg-b-1 w-full",
47
+ delay: 0,
48
+ side: "bottom",
49
+ sideOffset: 6
50
+ },
51
+ {
52
+ trigger: () => o("span", `${this.variableName}`),
53
+ content: () => o(
54
+ "div",
55
+ {
56
+ class: "w-content shadow-lg rounded bg-b-1 text-xxs leading-5 text-c-1"
57
+ },
58
+ r
59
+ )
60
+ }
61
+ );
62
+ }
63
+ });
64
+ return this.app = D(n, { variableName: this.variableName }), this.app.mount(e), e;
65
+ }
66
+ destroy() {
67
+ this.app && this.app.unmount();
68
+ }
69
+ eq(e) {
70
+ return e instanceof l && e.variableName === this.variableName;
71
+ }
72
+ ignoreEvent(e) {
73
+ return !1;
74
+ }
75
+ }
76
+ const V = x.fromClass(
77
+ class {
78
+ constructor(t) {
79
+ c(this, "decorations");
80
+ this.decorations = this.buildDecorations(t);
81
+ }
82
+ update(t) {
83
+ (t.docChanged || t.viewportChanged) && (this.decorations = this.buildDecorations(t.view));
84
+ }
85
+ buildDecorations(t) {
86
+ const a = new w();
87
+ for (const { from: e, to: n } of t.visibleRanges) {
88
+ const s = t.state.doc.sliceString(e, n), r = /{{(.*?)}}/g;
89
+ let i;
90
+ for (; (i = r.exec(s)) !== null; ) {
91
+ const d = e + i.index, p = d + i[0].length, m = i[1];
92
+ a.add(
93
+ d,
94
+ p,
95
+ N.widget({
96
+ widget: new l(m),
97
+ side: 1
98
+ })
99
+ );
100
+ }
101
+ }
102
+ return a.finish();
103
+ }
104
+ },
105
+ {
106
+ decorations: (t) => t.decorations
107
+ }
108
+ ), T = y.domEventHandlers({
109
+ keydown(t, a) {
110
+ if (t.key === "Backspace") {
111
+ const { state: e } = a, { from: n, to: s } = e.selection.main;
112
+ if (n === s && n > 0 && e.doc.sliceString(n - 2, n) === "}}")
113
+ return a.dispatch({
114
+ changes: { from: n - 2, to: s },
115
+ selection: { anchor: n - 2 }
116
+ }), t.preventDefault(), !0;
117
+ }
118
+ return !1;
119
+ }
120
+ });
121
+ export {
122
+ T as backspaceCommand,
123
+ V as pillPlugin
124
+ };
@@ -1,20 +1,7 @@
1
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
- title: string;
3
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
2
  close: () => void;
5
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
6
- title: string;
7
- }>>> & {
3
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
8
4
  onClose?: (() => any) | undefined;
9
5
  }, {}, {}>;
10
6
  export default _default;
11
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
- type __VLS_TypePropsToOption<T> = {
13
- [K in keyof T]-?: {} extends Pick<T, K> ? {
14
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
- } : {
16
- type: import('vue').PropType<T[K]>;
17
- required: true;
18
- };
19
- };
20
7
  //# sourceMappingURL=CommandPaletteCollection.vue.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"CommandPaletteCollection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteCollection.vue"],"names":[],"mappings":";;;;;AAgMA,wBAMG"}
@@ -1,66 +1,63 @@
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";
1
+ import { defineComponent as d, ref as s, onMounted as p, openBlock as f, createElementBlock as x, withModifiers as h, createElementVNode as e, withDirectives as _, vModelText as v, createVNode as b, unref as w, withCtx as C, createTextVNode as N } from "vue";
2
+ import { useWorkspace as g } from "../../store/workspace.js";
3
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", {
4
+ const y = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, M = /* @__PURE__ */ e("label", {
5
5
  class: "absolute w-full h-full opacity-0 cursor-text",
6
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({
7
+ }, null, -1), V = { class: "flex" }, B = /* @__PURE__ */ e("div", { class: "flex flex-1 gap-2 max-h-8" }, null, -1), W = /* @__PURE__ */ d({
8
8
  __name: "CommandPaletteCollection",
9
- props: {
10
- title: {}
11
- },
12
9
  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"
10
+ setup(S, { emit: c }) {
11
+ const a = c, { activeWorkspace: i, collectionMutators: r } = g(), t = s(""), u = () => {
12
+ r.add(
13
+ {
14
+ spec: {
15
+ openapi: "3.1.0",
16
+ info: {
17
+ title: t.value,
18
+ version: "0.0.1"
19
+ }
21
20
  }
22
- }
23
- }), a("close");
24
- }, o = s(null);
21
+ },
22
+ i.value.uid
23
+ ), a("close");
24
+ }, l = s(null);
25
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
- })
26
+ var o;
27
+ (o = l.value) == null || o.focus();
28
+ }), (o, n) => (f(), x("form", {
29
+ class: "flex w-full flex-col gap-3",
30
+ onSubmit: h(u, ["prevent"])
31
+ }, [
32
+ e("div", y, [
33
+ M,
34
+ _(e("input", {
35
+ id: "collectionanme",
36
+ ref_key: "collectionInput",
37
+ ref: l,
38
+ "onUpdate:modelValue": n[0] || (n[0] = (m) => t.value = m),
39
+ class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
40
+ label: "Collection Name",
41
+ placeholder: "Collection Name"
42
+ }, null, 512), [
43
+ [v, t.value]
59
44
  ])
60
- ], 32)
61
- ], 64));
45
+ ]),
46
+ e("div", V, [
47
+ B,
48
+ b(w(k), {
49
+ class: "max-h-8 text-xs p-0 px-3",
50
+ type: "submit"
51
+ }, {
52
+ default: C(() => [
53
+ N(" Continue ")
54
+ ]),
55
+ _: 1
56
+ })
57
+ ])
58
+ ], 32));
62
59
  }
63
60
  });
64
61
  export {
65
- F as default
62
+ W as default
66
63
  };
@@ -1,9 +1,11 @@
1
1
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
- title: string;
2
+ /** The request uid to pre-select */
3
+ metaData?: string;
3
4
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
5
  close: () => void;
5
6
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
6
- title: string;
7
+ /** The request uid to pre-select */
8
+ metaData?: string;
7
9
  }>>> & {
8
10
  onClose?: (() => any) | undefined;
9
11
  }, {}, {}>;
@@ -1 +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"}
1
+ {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":";IAqIE,oCAAoC;eACzB,MAAM;;;;IADjB,oCAAoC;eACzB,MAAM;;;;AA2SnB,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"}