@scalar/api-client 2.18.3 → 2.18.4

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 (27) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -0
  4. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  5. package/dist/v2/components/sidebar/Sidebar.vue.js +31 -26
  6. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +11 -1
  7. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  8. package/dist/v2/components/sidebar/SidebarMenu.vue.js +31 -32
  9. package/dist/v2/features/app/App.vue.d.ts +16 -2
  10. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  11. package/dist/v2/features/app/App.vue.js +53 -48
  12. package/dist/v2/features/app/app-state.d.ts +2 -1
  13. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  14. package/dist/v2/features/app/app-state.js +10 -10
  15. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +11 -1
  16. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  17. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  18. package/dist/v2/features/app/components/AppSidebar.vue2.js +77 -74
  19. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +5 -59
  20. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  21. package/dist/v2/features/app/helpers/create-api-client-app.js +9 -8
  22. package/dist/v2/features/app/index.d.ts +5 -1
  23. package/dist/v2/features/app/index.d.ts.map +1 -1
  24. package/dist/v2/features/app/index.js +8 -2
  25. package/dist/v2/features/operation/Operation.vue.js +1 -1
  26. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  27. package/package.json +10 -10
@@ -1,18 +1,18 @@
1
- import { defineComponent as q, mergeModels as x, computed as b, capitalize as V, useModel as C, ref as G, createElementBlock as W, openBlock as m, createVNode as l, createBlock as g, createCommentVNode as f, unref as i, createSlots as R, withCtx as r, createTextVNode as y, withKeys as k, withModifiers as c, toDisplayString as j, createElementVNode as d, normalizeClass as F, nextTick as H } from "vue";
2
- import { useModal as L, ScalarSidebarItem as I, ScalarIconButton as U, ScalarButton as E, ScalarModal as J } from "@scalar/components";
3
- import { ScalarIconPlus as Y, ScalarIconDotsThree as Q, ScalarIconGlobe as X } from "@scalar/icons";
1
+ import { defineComponent as q, mergeModels as x, computed as b, capitalize as V, useModel as C, ref as G, createElementBlock as W, openBlock as m, createVNode as l, createBlock as g, createCommentVNode as f, unref as i, createSlots as R, withCtx as r, createTextVNode as y, withKeys as k, withModifiers as c, toDisplayString as j, renderSlot as F, createElementVNode as d, normalizeClass as H, nextTick as L } from "vue";
2
+ import { useModal as U, ScalarSidebarItem as I, ScalarIconButton as J, ScalarButton as $, ScalarModal as Y } from "@scalar/components";
3
+ import { ScalarIconPlus as Q, ScalarIconDotsThree as X, ScalarIconGlobe as Z } from "@scalar/icons";
4
4
  import { getParentEntry as w } from "@scalar/workspace-store/navigation";
5
- import Z from "../../../../assets/rabbit.ascii.js";
6
- import _ from "../../../../assets/rabbitjump.ascii.js";
7
- import O from "../../../../components/ScalarAsciiArt.vue.js";
8
- import ee from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
9
- import te from "./SidebarItemMenu.vue.js";
10
- import { dragHandleFactory as ae } from "../../../helpers/drag-handle-factory.js";
11
- import oe from "../../../components/sidebar/Sidebar.vue.js";
12
- const ne = { class: "flex" }, ie = {
5
+ import _ from "../../../../assets/rabbit.ascii.js";
6
+ import ee from "../../../../assets/rabbitjump.ascii.js";
7
+ import E from "../../../../components/ScalarAsciiArt.vue.js";
8
+ import te from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
9
+ import ae from "./SidebarItemMenu.vue.js";
10
+ import { dragHandleFactory as oe } from "../../../helpers/drag-handle-factory.js";
11
+ import ne from "../../../components/sidebar/Sidebar.vue.js";
12
+ const ie = { class: "flex" }, se = {
13
13
  key: 0,
14
14
  class: "empty-sidebar-item-content overflow-hidden px-2.5 py-2.5"
15
- }, se = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, re = { class: "gap-1.5 p-2" }, we = /* @__PURE__ */ q({
15
+ }, re = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, le = { class: "gap-1.5 p-2" }, Se = /* @__PURE__ */ q({
16
16
  __name: "AppSidebar",
17
17
  props: /* @__PURE__ */ x({
18
18
  layout: {},
@@ -32,64 +32,64 @@ const ne = { class: "flex" }, ie = {
32
32
  sidebarWidthModifiers: {}
33
33
  }),
34
34
  emits: /* @__PURE__ */ x(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
35
- setup(a, { emit: $ }) {
36
- const p = $, D = b(() => V(a.activeWorkspace.label)), B = C(a, "isSidebarOpen"), M = C(a, "sidebarWidth"), S = b(() => a.sidebarState.items.value.length <= 1), h = b(
37
- () => ae({
38
- store: a.store,
39
- sidebarState: a.sidebarState
35
+ setup(o, { emit: O }) {
36
+ const p = O, D = b(() => V(o.activeWorkspace.label)), B = C(o, "isSidebarOpen"), M = C(o, "sidebarWidth"), S = b(() => o.sidebarState.items.value.length <= 1), h = b(
37
+ () => oe({
38
+ store: o.store,
39
+ sidebarState: o.sidebarState
40
40
  })
41
- ), N = (o, e) => h.value.handleDragEnd(o, e), A = (o, e) => h.value.isDroppable(o, e), s = G(null), v = L(), T = b(() => {
42
- const o = s.value?.item;
43
- return o?.type === "document" ? "This cannot be undone. You're about to delete the document and all tags and operations inside it." : `Are you sure you want to delete this ${o?.type ?? "item"}? This action cannot be undone.`;
41
+ ), A = (a, e) => h.value.handleDragEnd(a, e), N = (a, e) => h.value.isDroppable(a, e), s = G(null), v = U(), T = b(() => {
42
+ const a = s.value?.item;
43
+ return a?.type === "document" ? "This cannot be undone. You're about to delete the document and all tags and operations inside it." : `Are you sure you want to delete this ${a?.type ?? "item"}? This action cannot be undone.`;
44
44
  }), z = () => {
45
- const o = s.value?.item;
46
- if (!o)
45
+ const a = s.value?.item;
46
+ if (!a)
47
47
  return;
48
- const e = a.sidebarState.getEntryById(o.id), t = w("document", e), n = w("operation", e);
48
+ const e = o.sidebarState.getEntryById(a.id), t = w("document", e), n = w("operation", e);
49
49
  if (t) {
50
- if (o.type === "document")
51
- a.eventBus.emit("document:delete:document", { name: t.name });
52
- else if (o.type === "tag")
53
- a.eventBus.emit("tag:delete:tag", {
50
+ if (a.type === "document")
51
+ o.eventBus.emit("document:delete:document", { name: t.name });
52
+ else if (a.type === "tag")
53
+ o.eventBus.emit("tag:delete:tag", {
54
54
  documentName: t.name,
55
- name: o.name
55
+ name: a.name
56
56
  });
57
- else if (o.type === "operation") {
57
+ else if (a.type === "operation") {
58
58
  if (!n)
59
59
  return;
60
- a.eventBus.emit("operation:delete:operation", {
60
+ o.eventBus.emit("operation:delete:operation", {
61
61
  meta: {
62
62
  method: n.method,
63
63
  path: n.path
64
64
  },
65
65
  documentName: t.name
66
66
  });
67
- } else if (o.type === "example") {
67
+ } else if (a.type === "example") {
68
68
  if (!n)
69
69
  return;
70
- a.eventBus.emit("operation:delete:example", {
70
+ o.eventBus.emit("operation:delete:example", {
71
71
  meta: {
72
72
  method: n.method,
73
73
  path: n.path,
74
- exampleKey: o.name
74
+ exampleKey: a.name
75
75
  },
76
76
  documentName: t.name
77
77
  });
78
78
  }
79
79
  v.hide(), s.value = null;
80
80
  }
81
- }, u = async (o, e) => {
81
+ }, u = async (a, e) => {
82
82
  if (s.value?.showMenu)
83
83
  return;
84
- const t = o.currentTarget;
85
- s.value = { item: e, el: t, showMenu: !0 }, await H();
86
- const n = o instanceof MouseEvent ? new MouseEvent(o.type, o) : new KeyboardEvent(o.type, o);
84
+ const t = a.currentTarget;
85
+ s.value = { item: e, el: t, showMenu: !0 }, await L();
86
+ const n = a instanceof MouseEvent ? new MouseEvent(a.type, a) : new KeyboardEvent(a.type, a);
87
87
  s.value?.el.dispatchEvent(n);
88
88
  }, K = () => {
89
89
  s.value && (s.value.showMenu = !1);
90
- }, P = (o) => {
91
- const e = a.sidebarState.getEntryById(o.id), t = w("document", e), n = w("tag", e);
92
- a.eventBus.emit("ui:open:command-palette", {
90
+ }, P = (a) => {
91
+ const e = o.sidebarState.getEntryById(a.id), t = w("document", e), n = w("tag", e);
92
+ o.eventBus.emit("ui:open:command-palette", {
93
93
  action: "create-request",
94
94
  payload: {
95
95
  documentId: t?.id,
@@ -97,29 +97,32 @@ const ne = { class: "flex" }, ie = {
97
97
  }
98
98
  });
99
99
  };
100
- return (o, e) => (m(), W("div", ne, [
101
- l(i(oe), {
100
+ return (a, e) => (m(), W("div", ie, [
101
+ l(i(ne), {
102
102
  isSidebarOpen: B.value,
103
103
  "onUpdate:isSidebarOpen": e[3] || (e[3] = (t) => B.value = t),
104
104
  sidebarWidth: M.value,
105
105
  "onUpdate:sidebarWidth": e[4] || (e[4] = (t) => M.value = t),
106
- activeWorkspace: a.activeWorkspace,
107
- documents: Object.values(a.store.workspace.documents),
108
- eventBus: a.eventBus,
109
- isDroppable: A,
110
- layout: a.layout,
111
- sidebarState: a.sidebarState,
112
- workspaces: a.workspaces,
106
+ activeWorkspace: o.activeWorkspace,
107
+ documents: Object.values(o.store.workspace.documents),
108
+ eventBus: o.eventBus,
109
+ isDroppable: N,
110
+ layout: o.layout,
111
+ sidebarState: o.sidebarState,
112
+ workspaces: o.workspaces,
113
113
  "onCreate:workspace": e[5] || (e[5] = (t) => p("create:workspace")),
114
- onReorder: e[6] || (e[6] = (t, n) => N(t, n)),
114
+ onReorder: e[6] || (e[6] = (t, n) => A(t, n)),
115
115
  "onSelect:workspace": e[7] || (e[7] = (t) => p("select:workspace", t)),
116
116
  onSelectItem: e[8] || (e[8] = (t) => p("selectItem", t))
117
117
  }, R({
118
+ "sidebar-menu-actions": r(() => [
119
+ F(a.$slots, "sidebarMenuActions", {}, void 0, !0)
120
+ ]),
118
121
  workspaceButton: r(() => [
119
122
  l(i(I), {
120
123
  is: "button",
121
- active: a.isWorkspaceOpen,
122
- icon: i(X),
124
+ active: o.isWorkspaceOpen,
125
+ icon: i(Z),
123
126
  onClick: e[0] || (e[0] = (t) => p("click:workspace"))
124
127
  }, {
125
128
  default: r(() => [
@@ -129,10 +132,10 @@ const ne = { class: "flex" }, ie = {
129
132
  }, 8, ["active", "icon"])
130
133
  ]),
131
134
  decorator: r(({ item: t }) => [
132
- l(i(U), {
135
+ l(i(J), {
133
136
  "aria-expanded": "false",
134
137
  "aria-haspopup": "menu",
135
- icon: i(Q),
138
+ icon: i(X),
136
139
  label: "More options",
137
140
  size: "sm",
138
141
  weight: "bold",
@@ -151,7 +154,7 @@ const ne = { class: "flex" }, ie = {
151
154
  onClick: (n) => P(t)
152
155
  }, {
153
156
  icon: r(() => [
154
- l(i(Y))
157
+ l(i(Q))
155
158
  ]),
156
159
  default: r(() => [...e[11] || (e[11] = [
157
160
  y("Add operation", -1)
@@ -161,22 +164,22 @@ const ne = { class: "flex" }, ie = {
161
164
  ]),
162
165
  _: 2
163
166
  }, [
164
- a.layout !== "modal" ? {
167
+ o.layout !== "modal" ? {
165
168
  name: "footer",
166
169
  fn: r(() => [
167
170
  d("div", {
168
- class: F({
171
+ class: H({
169
172
  "empty-sidebar-item border-t": S.value
170
173
  })
171
174
  }, [
172
- S.value ? (m(), W("div", ie, [
173
- d("div", se, [
174
- l(O, {
175
- art: i(Z),
175
+ S.value ? (m(), W("div", se, [
176
+ d("div", re, [
177
+ l(E, {
178
+ art: i(_),
176
179
  class: "rabbitsit font-bold"
177
180
  }, null, 8, ["art"]),
178
- l(O, {
179
- art: i(_),
181
+ l(E, {
182
+ art: i(ee),
180
183
  class: "rabbitjump absolute top-0 left-0 font-bold"
181
184
  }, null, 8, ["art"])
182
185
  ]),
@@ -185,12 +188,12 @@ const ne = { class: "flex" }, ie = {
185
188
  d("p", { class: "mt-2 leading-3" }, " Create request, folder, collection or import from OpenAPI/Postman ")
186
189
  ], -1))
187
190
  ])) : f("", !0),
188
- d("div", re, [
189
- S.value ? (m(), g(i(E), {
191
+ d("div", le, [
192
+ S.value ? (m(), g(i($), {
190
193
  key: 0,
191
194
  class: "w-full",
192
195
  size: "sm",
193
- onClick: e[1] || (e[1] = (t) => a.eventBus.emit("ui:open:command-palette", {
196
+ onClick: e[1] || (e[1] = (t) => o.eventBus.emit("ui:open:command-palette", {
194
197
  action: "import-from-openapi-swagger-postman-curl",
195
198
  payload: void 0
196
199
  }))
@@ -200,12 +203,12 @@ const ne = { class: "flex" }, ie = {
200
203
  ])]),
201
204
  _: 1
202
205
  })) : f("", !0),
203
- l(i(E), {
206
+ l(i($), {
204
207
  class: "w-full",
205
208
  hotkey: "K",
206
209
  size: "sm",
207
210
  variant: "outlined",
208
- onClick: e[2] || (e[2] = (t) => a.eventBus.emit("ui:open:command-palette"))
211
+ onClick: e[2] || (e[2] = (t) => o.eventBus.emit("ui:open:command-palette"))
209
212
  }, {
210
213
  default: r(() => [...e[14] || (e[14] = [
211
214
  y(" Add Item ", -1)
@@ -218,23 +221,23 @@ const ne = { class: "flex" }, ie = {
218
221
  key: "0"
219
222
  } : void 0
220
223
  ]), 1032, ["isSidebarOpen", "sidebarWidth", "activeWorkspace", "documents", "eventBus", "layout", "sidebarState", "workspaces"]),
221
- s.value?.showMenu ? (m(), g(te, {
224
+ s.value?.showMenu ? (m(), g(ae, {
222
225
  key: 0,
223
- eventBus: a.eventBus,
226
+ eventBus: o.eventBus,
224
227
  item: s.value.item,
225
- sidebarState: a.sidebarState,
228
+ sidebarState: o.sidebarState,
226
229
  target: s.value.el,
227
230
  onCloseMenu: K,
228
231
  onShowDeleteModal: e[9] || (e[9] = (t) => i(v).show())
229
232
  }, null, 8, ["eventBus", "item", "sidebarState", "target"])) : f("", !0),
230
- s.value ? (m(), g(i(J), {
233
+ s.value ? (m(), g(i(Y), {
231
234
  key: 1,
232
235
  size: "xxs",
233
236
  state: i(v),
234
237
  title: `Delete ${s.value.item.title}`
235
238
  }, {
236
239
  default: r(() => [
237
- l(ee, {
240
+ l(te, {
238
241
  variableName: s.value.item.title,
239
242
  warningMessage: T.value,
240
243
  onClose: e[10] || (e[10] = (t) => i(v).hide()),
@@ -247,5 +250,5 @@ const ne = { class: "flex" }, ie = {
247
250
  }
248
251
  });
249
252
  export {
250
- we as default
253
+ Se as default
251
254
  };
@@ -13,70 +13,16 @@ type CreateApiClientOptions = {
13
13
  */
14
14
  plugins?: ClientPlugin[];
15
15
  };
16
+ /**
17
+ * Creates the appropriate router with the appropriate routes based on the layout
18
+ */
19
+ export declare const createAppRouter: (layout: CreateApiClientOptions["layout"]) => import("vue-router").Router;
16
20
  /**
17
21
  * Create the API Client with router and passes in the workspace store as a prop
18
22
  */
19
23
  export declare const createApiClientApp: (el: HTMLElement | null, { layout, plugins }: CreateApiClientOptions) => {
20
24
  app: import("vue").App<Element>;
21
- state: {
22
- store: import("vue").ShallowRef<import("@scalar/workspace-store/client").WorkspaceStore | null>;
23
- sidebar: {
24
- state: {
25
- items: import("vue").ComputedRef<import("@scalar/workspace-store/schemas/navigation").TraversedEntry[]>;
26
- index: import("vue").ComputedRef<Map<string, import("@scalar/workspace-store/schemas/navigation").TraversedEntry & {
27
- parent?: import("@scalar/workspace-store/schemas/navigation").TraversedEntry | undefined;
28
- }>>;
29
- selectedItems: import("vue").Ref<Record<string, boolean>, Record<string, boolean>>;
30
- expandedItems: import("vue").Ref<Record<string, boolean>, Record<string, boolean>>;
31
- selectedItem: import("vue").Ref<string | null, string | null>;
32
- setSelected: (id: string | null) => void;
33
- setExpanded: (id: string, value: boolean) => void;
34
- isExpanded: (id: string) => boolean;
35
- isSelected: (id: string) => boolean;
36
- getEntryById: (id: string) => (import("@scalar/workspace-store/schemas/navigation").TraversedEntry & {
37
- parent?: import("@scalar/workspace-store/schemas/navigation").TraversedEntry | undefined;
38
- }) | undefined;
39
- reset: () => void;
40
- };
41
- width: import("vue").ComputedRef<number>;
42
- isOpen: import("vue").Ref<boolean>;
43
- handleSelectItem: (id: string) => Promise<void | import("vue-router").NavigationFailure | undefined> | undefined;
44
- handleSidebarWidthUpdate: (width: number) => void | undefined;
45
- getEntryByLocation: import("../../../../v2/features/app/app-state.js").GetEntryByLocation;
46
- };
47
- tabs: {
48
- state: import("vue").Ref<import("@scalar/workspace-store/schemas/extensions/workspace/x-scalar-tabs").Tab[]>;
49
- activeTabIndex: import("vue").Ref<number>;
50
- copyTabUrl: (index: number) => Promise<void>;
51
- };
52
- workspace: {
53
- create: ({ id, name, }: {
54
- id?: string;
55
- name: string;
56
- }) => Promise<{
57
- id: string;
58
- name: string;
59
- } | undefined>;
60
- workspaceList: import("vue").Ref<import("@scalar/components").ScalarListboxOption[]>;
61
- activeWorkspace: import("vue").ShallowRef<import("@scalar/components").ScalarListboxOption | null>;
62
- setId: (id?: string) => Promise<void>;
63
- isOpen: import("vue").ComputedRef<boolean>;
64
- };
65
- commandPalette: import("../../command-palette/hooks/use-command-palette-state.js").UseCommandPaletteStateReturn;
66
- eventBus: import("@scalar/workspace-store/events").WorkspaceEventBus;
67
- router: import("vue").ShallowRef<import("vue-router").Router | null>;
68
- currentRoute: import("vue").Ref<import("vue-router").RouteLocationNormalizedGeneric | null>;
69
- loading: import("vue").Ref<boolean>;
70
- activeEntities: {
71
- workspaceSlug: import("vue").Ref<string | undefined>;
72
- documentSlug: import("vue").Ref<string | undefined>;
73
- path: import("vue").Ref<string | undefined>;
74
- method: import("vue").Ref<import("@scalar/helpers/http/http-methods").HttpMethod | undefined>;
75
- exampleName: import("vue").Ref<string | undefined>;
76
- };
77
- environment: import("vue").ComputedRef<import("@scalar/workspace-store/schemas/extensions/document/x-scalar-environments").XScalarEnvironment>;
78
- document: import("vue").ComputedRef<import("@scalar/workspace-store/schemas").WorkspaceDocument | null>;
79
- };
25
+ state: import("../../../../v2/features/app/app-state.js").AppState;
80
26
  } | undefined;
81
27
  export {};
82
28
  //# sourceMappingURL=create-api-client-app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-api-client-app.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/create-api-client-app.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,sBAAsB,GAAG;IAC5B;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;CACzB,CAAA;AAeD;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,WAAW,GAAG,IAAI,EAAE,qBAAiC,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4By2K,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;aAD39K,CAAA"}
1
+ {"version":3,"file":"create-api-client-app.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/create-api-client-app.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,sBAAsB,GAAG;IAC5B;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;CACzB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,sBAAsB,CAAC,QAAQ,CAAC,gCAQvE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,WAAW,GAAG,IAAI,EAAE,qBAAiC,sBAAsB;;;aAyBjH,CAAA"}
@@ -1,12 +1,12 @@
1
1
  import { createApp as c } from "vue";
2
- import { createRouter as i, createWebHistory as n, createWebHashHistory as m } from "vue-router";
2
+ import { createRouter as p, createWebHistory as n, createWebHashHistory as m } from "vue-router";
3
3
  import u from "../App.vue.js";
4
4
  /* empty css */
5
5
  import { useAppState as l } from "../app-state.js";
6
- import { ROUTES as p } from "./routes.js";
7
- const f = (e) => e === "web" ? i({ history: n(), routes: p }) : i({ history: m(), routes: p }), v = (e, { layout: r = "desktop", plugins: s }) => {
8
- const t = c(u, { layout: r, plugins: s }), o = f(r), a = l();
9
- if (a.router.value = o, t.use(o), !e) {
6
+ import { ROUTES as i } from "./routes.js";
7
+ const f = (t) => t === "web" ? p({ history: n(), routes: i }) : p({ history: m(), routes: i }), g = (t, { layout: r = "desktop", plugins: s }) => {
8
+ const o = f(r), a = l(o), e = c(u, { layout: r, plugins: s, getAppState: () => a });
9
+ if (e.use(o), !t) {
10
10
  console.error(
11
11
  "[@scalar/api-client-modal] Could not create the API client.",
12
12
  "Invalid HTML element provided.",
@@ -14,11 +14,12 @@ const f = (e) => e === "web" ? i({ history: n(), routes: p }) : i({ history: m()
14
14
  );
15
15
  return;
16
16
  }
17
- return t.mount(e), {
18
- app: t,
17
+ return e.mount(t), {
18
+ app: e,
19
19
  state: a
20
20
  };
21
21
  };
22
22
  export {
23
- v as createApiClientApp
23
+ g as createApiClientApp,
24
+ f as createAppRouter
24
25
  };
@@ -1,2 +1,6 @@
1
- export { createApiClientApp } from './helpers/create-api-client-app.js';
1
+ export { type AppState, useAppState } from '../../../v2/features/app/app-state.js';
2
+ export type { ClientPlugin } from '../../../v2/helpers/plugins.js';
3
+ export type { ClientLayout } from '../../../v2/types/layout';
4
+ export { default as ClientApp } from './App.vue.js';
5
+ export { createApiClientApp, createAppRouter } from './helpers/create-api-client-app.js';
2
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACxE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA"}
@@ -1,4 +1,10 @@
1
- import { createApiClientApp as r } from "./helpers/create-api-client-app.js";
1
+ import { useAppState as r } from "./app-state.js";
2
+ import { default as a } from "./App.vue.js";
3
+ /* empty css */
4
+ import { createApiClientApp as f, createAppRouter as i } from "./helpers/create-api-client-app.js";
2
5
  export {
3
- r as createApiClientApp
6
+ a as ClientApp,
7
+ f as createApiClientApp,
8
+ i as createAppRouter,
9
+ r as useAppState
4
10
  };
@@ -68,7 +68,7 @@ const w = {
68
68
  method: e.method ?? "get"
69
69
  } : {
70
70
  type: "document"
71
- }), d = "2.18.3";
71
+ }), d = "2.18.4";
72
72
  return (t, a) => e.path && e.method && e.exampleName && o.value ? (c(), f(u(C), {
73
73
  key: 0,
74
74
  appVersion: u(d),
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
33
33
  }));
34
34
  }, f = (u) => {
35
35
  u?.createNew && g.name === "request" && p();
36
- }, v = "2.18.3";
36
+ }, v = "2.18.4";
37
37
  return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (u, e) => (l(), n("div", W, [
38
38
  s("div", {
39
39
  class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.18.3",
21
+ "version": "2.18.4",
22
22
  "engines": {
23
23
  "node": ">=20"
24
24
  },
@@ -326,26 +326,26 @@
326
326
  "whatwg-mimetype": "^4.0.0",
327
327
  "yaml": "^2.8.0",
328
328
  "zod": "^4.3.5",
329
+ "@scalar/helpers": "0.2.8",
329
330
  "@scalar/analytics-client": "1.0.1",
331
+ "@scalar/icons": "0.5.2",
330
332
  "@scalar/draggable": "0.3.0",
331
333
  "@scalar/import": "0.4.45",
332
- "@scalar/icons": "0.5.2",
333
- "@scalar/helpers": "0.2.8",
334
334
  "@scalar/json-magic": "0.9.1",
335
+ "@scalar/oas-utils": "0.6.20",
335
336
  "@scalar/object-utils": "1.2.22",
337
+ "@scalar/openapi-types": "0.5.3",
336
338
  "@scalar/openapi-parser": "0.24.1",
337
339
  "@scalar/postman-to-openapi": "0.3.60",
338
- "@scalar/oas-utils": "0.6.19",
339
- "@scalar/sidebar": "0.7.12",
340
- "@scalar/openapi-types": "0.5.3",
340
+ "@scalar/sidebar": "0.7.13",
341
+ "@scalar/themes": "0.13.26",
341
342
  "@scalar/snippetz": "0.6.5",
343
+ "@scalar/use-codemirror": "0.13.17",
342
344
  "@scalar/types": "0.5.8",
343
- "@scalar/themes": "0.13.26",
344
- "@scalar/use-codemirror": "0.13.16",
345
345
  "@scalar/use-hooks": "0.3.6",
346
- "@scalar/components": "0.16.22",
347
346
  "@scalar/use-toasts": "0.9.1",
348
- "@scalar/workspace-store": "0.24.9"
347
+ "@scalar/components": "0.16.23",
348
+ "@scalar/workspace-store": "0.24.10"
349
349
  },
350
350
  "devDependencies": {
351
351
  "@tailwindcss/vite": "^4.1.18",