@scalar/api-client 2.25.0 → 2.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  3. package/dist/components/DataTable/DataTableCheckbox.vue.js +8 -8
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +28 -19
  7. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  8. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  9. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +1 -1
  10. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  11. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +18 -18
  12. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  13. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.d.ts.map +1 -1
  14. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +2 -2
  15. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue2.js +19 -19
  16. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  17. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +26 -26
  18. package/dist/v2/components/callout/Callout.vue.d.ts +17 -0
  19. package/dist/v2/components/callout/Callout.vue.d.ts.map +1 -0
  20. package/dist/v2/components/callout/Callout.vue.js +7 -0
  21. package/dist/v2/components/callout/Callout.vue2.js +43 -0
  22. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
  23. package/dist/v2/components/data-table/DataTableCheckbox.vue.js +8 -8
  24. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  25. package/dist/v2/components/sidebar/Sidebar.vue.js +40 -41
  26. package/dist/v2/features/app/App.vue.d.ts +2 -2
  27. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  28. package/dist/v2/features/app/App.vue.js +84 -89
  29. package/dist/v2/features/app/app-events.d.ts +1 -1
  30. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  31. package/dist/v2/features/app/app-events.js +10 -10
  32. package/dist/v2/features/app/app-state.d.ts +36 -87
  33. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  34. package/dist/v2/features/app/app-state.js +339 -330
  35. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  36. package/dist/v2/features/app/components/DesktopTabs.vue.js +1 -1
  37. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
  38. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  39. package/dist/v2/features/app/helpers/create-api-client-app.js +9 -9
  40. package/dist/v2/features/app/helpers/get-route-param.d.ts +7 -0
  41. package/dist/v2/features/app/helpers/get-route-param.d.ts.map +1 -0
  42. package/dist/v2/features/app/helpers/get-route-param.js +9 -0
  43. package/dist/v2/features/app/index.d.ts +1 -1
  44. package/dist/v2/features/app/index.d.ts.map +1 -1
  45. package/dist/v2/features/app/index.js +12 -12
  46. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  47. package/dist/v2/features/collection/DocumentCollection.vue.js +72 -65
  48. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +29 -2
  49. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
  50. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +110 -106
  51. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts +5 -1
  52. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +1 -1
  53. package/dist/v2/features/command-palette/helpers/load-document-from-source.js +41 -23
  54. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +41 -8
  55. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  56. package/dist/v2/features/command-palette/index.d.ts +1 -2
  57. package/dist/v2/features/command-palette/index.d.ts.map +1 -1
  58. package/dist/v2/features/command-palette/index.js +4 -6
  59. package/dist/v2/features/operation/Operation.vue.js +1 -1
  60. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts.map +1 -1
  61. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +2 -2
  62. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +24 -23
  63. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  64. package/package.json +9 -9
  65. package/dist/v2/features/app/components/WebTopNav.vue.d.ts +0 -41
  66. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +0 -1
  67. package/dist/v2/features/app/components/WebTopNav.vue.js +0 -27
  68. package/dist/v2/features/app/components/WebTopNav.vue2.js +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"DesktopTabs.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/DesktopTabs.vue"],"names":[],"mappings":"AA0EA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oEAAoE,CAAA;AAK7F,KAAK,WAAW,GAAG;IACjB,iBAAiB;IACjB,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,+BAA+B;IAC/B,cAAc,EAAE,MAAM,CAAA;IACtB,0DAA0D;IAC1D,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;AAkJF,wBAMG"}
1
+ {"version":3,"file":"DesktopTabs.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/DesktopTabs.vue"],"names":[],"mappings":"AA2EA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oEAAoE,CAAA;AAK7F,KAAK,WAAW,GAAG;IACjB,iBAAiB;IACjB,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,+BAA+B;IAC/B,cAAc,EAAE,MAAM,CAAA;IACtB,0DAA0D;IAC1D,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;AAmJF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as v, computed as d, createElementBlock as l, openBlock as n, createElementVNode as h, Fragment as T, renderList as p, createBlock as C, createVNode as k, unref as g } from "vue";
2
2
  import { ScalarIcon as f } from "@scalar/components";
3
3
  import B from "./DesktopTab.vue.js";
4
- const y = { class: "mac:pl-[72px] t-app__top-nav flex h-10 items-center gap-2 px-2" }, U = /* @__PURE__ */ v({
4
+ const y = { class: "mac:pl-[72px] t-app__top-nav z-1 flex h-10 items-center gap-2 px-2" }, U = /* @__PURE__ */ v({
5
5
  __name: "DesktopTabs",
6
6
  props: {
7
7
  tabs: {},
@@ -20,9 +20,9 @@ export declare const createAppRouter: (layout: CreateApiClientOptions["layout"])
20
20
  /**
21
21
  * Create the API Client with router and passes in the workspace store as a prop
22
22
  */
23
- export declare const createApiClientApp: (el: HTMLElement | null, { layout, plugins }: CreateApiClientOptions) => {
23
+ export declare const createApiClientApp: (el: HTMLElement | null, { layout, plugins }: CreateApiClientOptions) => Promise<{
24
24
  app: import("vue").App<Element>;
25
25
  state: import("../../../../v2/features/app/app-state.js").AppState;
26
- } | undefined;
26
+ } | undefined>;
27
27
  export {};
28
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;AAIrD,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;;;aA+BjH,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;AAIrD,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,GAC7B,IAAI,WAAW,GAAG,IAAI,EACtB,qBAAiC,sBAAsB;;;cAgCxD,CAAA"}
@@ -1,16 +1,16 @@
1
- import { createApp as c } from "vue";
2
- import { createRouter as p, createWebHistory as n, createWebHashHistory as u } from "vue-router";
3
- import l from "../App.vue.js";
1
+ import { createApp as n } from "vue";
2
+ import { createRouter as p, createWebHistory as s, createWebHashHistory as l } from "vue-router";
3
+ import u from "../App.vue.js";
4
4
  /* empty css */
5
- import { useAppState as d } from "../app-state.js";
6
- import { ROUTES as m } from "./routes.js";
5
+ import { createAppState as d } from "../app-state.js";
6
+ import { ROUTES as c } from "./routes.js";
7
7
  import { useCommandPaletteState as f } from "../../command-palette/hooks/use-command-palette-state.js";
8
- const A = (t) => t === "web" ? p({ history: n(), routes: m }) : p({ history: u(), routes: m }), R = (t, { layout: r = "desktop", plugins: i }) => {
9
- const o = A(r), a = d(o), s = f(), e = c(l, {
8
+ const A = (t) => t === "web" ? p({ history: s(), routes: c }) : p({ history: l(), routes: c }), P = async (t, { layout: r = "desktop", plugins: i }) => {
9
+ const o = A(r), a = await d({ router: o }), m = f(), e = n(u, {
10
10
  layout: r,
11
11
  plugins: i,
12
12
  getAppState: () => a,
13
- getCommandPaletteState: () => s
13
+ getCommandPaletteState: () => m
14
14
  });
15
15
  if (e.use(o), !t) {
16
16
  console.error(
@@ -26,6 +26,6 @@ const A = (t) => t === "web" ? p({ history: n(), routes: m }) : p({ history: u()
26
26
  };
27
27
  };
28
28
  export {
29
- R as createApiClientApp,
29
+ P as createApiClientApp,
30
30
  A as createAppRouter
31
31
  };
@@ -0,0 +1,7 @@
1
+ import type { HttpMethod } from '@scalar/helpers/http/http-methods';
2
+ import type { RouteLocationNormalizedGeneric } from 'vue-router';
3
+ import type { ScalarClientAppRouteParams } from '../../../../v2/features/app/helpers/routes.js';
4
+ /** Extracts a string parameter from the route */
5
+ export declare function getRouteParam(paramName: 'method', route: RouteLocationNormalizedGeneric | null): HttpMethod | undefined;
6
+ export declare function getRouteParam(paramName: Exclude<ScalarClientAppRouteParams, 'method'>, route: RouteLocationNormalizedGeneric | null): string | undefined;
7
+ //# sourceMappingURL=get-route-param.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-route-param.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/get-route-param.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAA;AAEhE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAA;AAElF,iDAAiD;AACjD,wBAAgB,aAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,8BAA8B,GAAG,IAAI,GAAG,UAAU,GAAG,SAAS,CAAA;AACxH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,OAAO,CAAC,0BAA0B,EAAE,QAAQ,CAAC,EACxD,KAAK,EAAE,8BAA8B,GAAG,IAAI,GAC3C,MAAM,GAAG,SAAS,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { isHttpMethod as e } from "@scalar/helpers/http/is-http-method";
2
+ function i(o, r) {
3
+ const t = r?.params[o];
4
+ if (typeof t == "string")
5
+ return o === "method" ? t && e(t) ? t : void 0 : decodeURIComponent(t);
6
+ }
7
+ export {
8
+ i as getRouteParam
9
+ };
@@ -1,4 +1,4 @@
1
- export { type AppState, useAppState } from '../../../v2/features/app/app-state.js';
1
+ export { type AppState, createAppState } from '../../../v2/features/app/app-state.js';
2
2
  export { default as CreateWorkspaceModal } from '../../../v2/features/app/components/CreateWorkspaceModal.vue.js';
3
3
  export { default as CommandActionForm } from '../../../v2/features/command-palette/components/CommandActionForm.vue.js';
4
4
  export { default as CommandActionInput } from '../../../v2/features/command-palette/components/CommandActionInput.vue.js';
@@ -1 +1 @@
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,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,uDAAuD,CAAA;AACvG,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,gEAAgE,CAAA;AAC7G,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iEAAiE,CAAA;AAC/G,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,UAAU,EACV,sBAAsB,GACvB,MAAM,oDAAoD,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,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,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,uDAAuD,CAAA;AACvG,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,gEAAgE,CAAA;AAC7G,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iEAAiE,CAAA;AAC/G,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,UAAU,EACV,sBAAsB,GACvB,MAAM,oDAAoD,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA"}
@@ -1,20 +1,20 @@
1
- import { useAppState as a } from "./app-state.js";
1
+ import { createAppState as a } from "./app-state.js";
2
2
  import { default as p } from "./components/CreateWorkspaceModal.vue.js";
3
3
  import { default as f } from "../command-palette/components/CommandActionForm.vue.js";
4
- import { default as n } from "../command-palette/components/CommandActionInput.vue.js";
5
- import { baseClientActions as u, baseRoutes as d, useCommandPaletteState as i } from "../command-palette/hooks/use-command-palette-state.js";
6
- import { default as x } from "./App.vue.js";
4
+ import { default as s } from "../command-palette/components/CommandActionInput.vue.js";
5
+ import { baseClientActions as d, baseRoutes as i, useCommandPaletteState as u } from "../command-palette/hooks/use-command-palette-state.js";
6
+ import { default as c } from "./App.vue.js";
7
7
  /* empty css */
8
- import { createApiClientApp as c, createAppRouter as b } from "./helpers/create-api-client-app.js";
8
+ import { createApiClientApp as C, createAppRouter as b } from "./helpers/create-api-client-app.js";
9
9
  export {
10
- x as ClientApp,
10
+ c as ClientApp,
11
11
  f as CommandActionForm,
12
- n as CommandActionInput,
12
+ s as CommandActionInput,
13
13
  p as CreateWorkspaceModal,
14
- u as baseClientActions,
15
- d as baseRoutes,
16
- c as createApiClientApp,
14
+ d as baseClientActions,
15
+ i as baseRoutes,
16
+ C as createApiClientApp,
17
17
  b as createAppRouter,
18
- a as useAppState,
19
- i as useCommandPaletteState
18
+ a as createAppState,
19
+ u as useCommandPaletteState
20
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/DocumentCollection.vue"],"names":[],"mappings":"AAiJA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE;;;;;;;GAOG;;AACH,wBAmVC"}
1
+ {"version":3,"file":"DocumentCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/DocumentCollection.vue"],"names":[],"mappings":"AAwJA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE;;;;;;;GAOG;;AACH,wBA6VC"}
@@ -1,21 +1,22 @@
1
- import { defineComponent as g, computed as f, createElementBlock as i, openBlock as u, createElementVNode as t, createVNode as o, createBlock as p, createCommentVNode as h, unref as l, withCtx as s, resolveDynamicComponent as y, mergeProps as k } from "vue";
2
- import { ScalarFormError as w, ScalarButton as m } from "@scalar/components";
3
- import { ScalarIconArrowLeft as b, ScalarIconFloppyDisk as S } from "@scalar/icons";
4
- import { LibraryIcon as _ } from "@scalar/icons/library";
5
- import { RouterView as C } from "vue-router";
6
- import V from "../../../components/IconSelector.vue.js";
7
- import B from "./components/LabelInput.vue.js";
8
- import D from "./components/Tabs.vue.js";
9
- const I = { class: "custom-scroll h-full" }, N = {
1
+ import { defineComponent as y, computed as p, createElementBlock as c, openBlock as u, createElementVNode as t, createVNode as o, createBlock as f, createCommentVNode as g, withCtx as l, unref as s, resolveDynamicComponent as h, mergeProps as k } from "vue";
2
+ import { ScalarButton as i } from "@scalar/components";
3
+ import { ScalarIconFloppyDisk as b } from "@scalar/icons";
4
+ import { LibraryIcon as w } from "@scalar/icons/library";
5
+ import { RouterView as _ } from "vue-router";
6
+ import C from "../../../components/IconSelector.vue.js";
7
+ import S from "../../components/callout/Callout.vue.js";
8
+ import V from "./components/LabelInput.vue.js";
9
+ import B from "./components/Tabs.vue.js";
10
+ const D = { class: "custom-scroll h-full" }, N = {
10
11
  key: 0,
11
12
  class: "w-full md:mx-auto md:max-w-[720px]"
12
- }, U = ["aria-label"], z = { class: "flex" }, E = { class: "flex flex-row items-center gap-2" }, L = { class: "group relative ml-1.25" }, $ = { class: "px-1.5 py-8" }, j = {
13
+ }, z = ["aria-label"], I = { class: "flex flex-row items-center gap-2" }, U = { class: "group relative ml-1.25" }, $ = { class: "px-1.5 py-8" }, j = {
13
14
  key: 1,
14
15
  class: "flex w-full flex-1 items-center justify-center"
15
- }, F = {
16
+ }, E = {
16
17
  name: "DocumentCollection"
17
- }, J = /* @__PURE__ */ g({
18
- ...F,
18
+ }, H = /* @__PURE__ */ y({
19
+ ...E,
19
20
  props: {
20
21
  documentSlug: {},
21
22
  document: {},
@@ -31,66 +32,72 @@ const I = { class: "custom-scroll h-full" }, N = {
31
32
  plugins: {}
32
33
  },
33
34
  setup(a) {
34
- const n = a, c = f(() => n.document?.info?.title || "Untitled Document"), d = f(
35
+ const n = a, m = p(() => n.document?.info?.title || "Untitled Document"), d = p(
35
36
  () => n.document?.["x-scalar-icon"] || "interface-content-folder"
36
- ), v = () => {
37
+ ), x = () => {
37
38
  n.workspaceStore.revertDocumentChanges(n.documentSlug);
38
- }, x = () => {
39
+ }, v = () => {
39
40
  n.workspaceStore.saveDocument(n.documentSlug);
40
41
  };
41
- return (T, e) => (u(), i("div", I, [
42
- a.document ? (u(), i("div", N, [
42
+ return (L, e) => (u(), c("div", D, [
43
+ a.document ? (u(), c("div", N, [
43
44
  t("div", {
44
- "aria-label": `title: ${c.value}`,
45
+ "aria-label": `title: ${m.value}`,
45
46
  class: "mx-auto flex h-fit w-full flex-col gap-2 pt-6 pb-3 md:mx-auto md:max-w-[720px]"
46
47
  }, [
47
- a.document["x-scalar-is-dirty"] ? (u(), p(l(w), {
48
+ a.document?.["x-scalar-is-dirty"] ? (u(), f(S, {
48
49
  key: 0,
49
- variant: "warning"
50
+ class: "mb-5",
51
+ type: "warning"
50
52
  }, {
51
- default: s(() => [
52
- e[4] || (e[4] = t("div", null, " You have unsaved changes. Save your work to keep your changes, or undo to revert them. ", -1)),
53
- e[5] || (e[5] = t("div", { class: "flex-1" }, null, -1)),
54
- t("div", z, [
55
- o(l(m), {
56
- size: "sm",
57
- variant: "ghost",
58
- onClick: v
59
- }, {
60
- default: s(() => [
61
- o(l(b)),
62
- e[2] || (e[2] = t("span", null, "Undo", -1))
63
- ]),
64
- _: 1
65
- }),
66
- o(l(m), {
67
- size: "sm",
68
- variant: "ghost",
69
- onClick: x
70
- }, {
71
- default: s(() => [
72
- o(l(S)),
73
- e[3] || (e[3] = t("span", null, "Save", -1))
74
- ]),
75
- _: 1
76
- })
77
- ])
53
+ actions: l(() => [
54
+ o(s(i), {
55
+ class: "text-c-2 hover:text-c-1 flex items-center gap-2",
56
+ size: "xs",
57
+ type: "button",
58
+ variant: "outlined",
59
+ onClick: x
60
+ }, {
61
+ default: l(() => [...e[2] || (e[2] = [
62
+ t("span", null, "Undo", -1)
63
+ ])]),
64
+ _: 1
65
+ }),
66
+ o(s(i), {
67
+ class: "text-c-btn flex items-center gap-2",
68
+ size: "xs",
69
+ type: "button",
70
+ variant: "solid",
71
+ onClick: v
72
+ }, {
73
+ default: l(() => [
74
+ o(s(b), {
75
+ size: "sm",
76
+ thickness: "1.5"
77
+ }),
78
+ e[3] || (e[3] = t("span", null, "Save", -1))
79
+ ]),
80
+ _: 1
81
+ })
82
+ ]),
83
+ default: l(() => [
84
+ e[4] || (e[4] = t("p", null, " You have unsaved changes. Save your work to keep your changes, or undo to revert them. ", -1))
78
85
  ]),
79
86
  _: 1
80
- })) : h("", !0),
81
- t("div", E, [
82
- o(V, {
87
+ })) : g("", !0),
88
+ t("div", I, [
89
+ o(C, {
83
90
  modelValue: d.value,
84
91
  placement: "bottom-start",
85
92
  "onUpdate:modelValue": e[0] || (e[0] = (r) => a.eventBus.emit("document:update:icon", r))
86
93
  }, {
87
- default: s(() => [
88
- o(l(m), {
94
+ default: l(() => [
95
+ o(s(i), {
89
96
  class: "hover:bg-b-2 aspect-square h-7 w-7 cursor-pointer rounded border border-transparent p-0 hover:border-inherit",
90
97
  variant: "ghost"
91
98
  }, {
92
- default: s(() => [
93
- o(l(_), {
99
+ default: l(() => [
100
+ o(s(w), {
94
101
  class: "text-c-2 size-5",
95
102
  src: d.value,
96
103
  "stroke-width": "2"
@@ -102,25 +109,25 @@ const I = { class: "custom-scroll h-full" }, N = {
102
109
  _: 1
103
110
  }, 8, ["modelValue"])
104
111
  ]),
105
- t("div", L, [
106
- o(B, {
112
+ t("div", U, [
113
+ o(V, {
107
114
  class: "text-xl font-bold",
108
115
  inputId: "documentName",
109
- modelValue: c.value,
116
+ modelValue: m.value,
110
117
  "onUpdate:modelValue": e[1] || (e[1] = (r) => a.eventBus.emit("document:update:info", { title: r }))
111
118
  }, null, 8, ["modelValue"])
112
119
  ])
113
- ], 8, U),
114
- o(D, { type: "document" }),
120
+ ], 8, z),
121
+ o(B, { type: "document" }),
115
122
  t("div", $, [
116
- o(l(C), null, {
117
- default: s(({ Component: r }) => [
118
- (u(), p(y(r), k(n, { collectionType: "document" }), null, 16))
123
+ o(s(_), null, {
124
+ default: l(({ Component: r }) => [
125
+ (u(), f(h(r), k(n, { collectionType: "document" }), null, 16))
119
126
  ]),
120
127
  _: 1
121
128
  })
122
129
  ])
123
- ])) : (u(), i("div", j, [...e[6] || (e[6] = [
130
+ ])) : (u(), c("div", j, [...e[5] || (e[5] = [
124
131
  t("div", { class: "flex h-full flex-col items-center justify-center" }, [
125
132
  t("h1", { class: "text-2xl font-bold" }, "Document not found"),
126
133
  t("p", { class: "text-gray-500" }, " The document you are looking for does not exist. ")
@@ -130,5 +137,5 @@ const I = { class: "custom-scroll h-full" }, N = {
130
137
  }
131
138
  });
132
139
  export {
133
- J as default
140
+ H as default
134
141
  };
@@ -1,3 +1,4 @@
1
+ import type { LoaderPlugin } from '@scalar/json-magic/bundle';
1
2
  import { type WorkspaceStore } from '@scalar/workspace-store/client';
2
3
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
4
  /**
@@ -17,12 +18,25 @@ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
17
18
  * @back="handleBack"
18
19
  * @open-command="handleOpenCommand"
19
20
  * />
21
+ *
22
+ * @example Custom file upload button
23
+ * <CommandPaletteImport
24
+ * :workspaceStore="workspaceStore"
25
+ * @close="handleClose">
26
+ * <template #fileUpload="{ import: importDocument }">
27
+ * <button @click="() => importDocument(source, 'file')">
28
+ * Custom Upload
29
+ * </button>
30
+ * </template>
31
+ * </CommandPaletteImport>
20
32
  */
21
- declare const _default: import("vue").DefineComponent<{
33
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
22
34
  /** The workspace store for adding documents */
23
35
  workspaceStore: WorkspaceStore;
24
36
  /** Event bus for emitting operation creation events */
25
37
  eventBus: WorkspaceEventBus;
38
+ /** Loader plugin for file import */
39
+ fileLoader?: LoaderPlugin;
26
40
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
27
41
  close: () => any;
28
42
  back: (keyboardEvent: KeyboardEvent) => any;
@@ -31,9 +45,22 @@ declare const _default: import("vue").DefineComponent<{
31
45
  workspaceStore: WorkspaceStore;
32
46
  /** Event bus for emitting operation creation events */
33
47
  eventBus: WorkspaceEventBus;
48
+ /** Loader plugin for file import */
49
+ fileLoader?: LoaderPlugin;
34
50
  }> & Readonly<{
35
51
  onClose?: (() => any) | undefined;
36
52
  onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
37
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
53
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
54
+ /** Slot for custom file upload component that can trigger import */
55
+ fileUpload(props: {
56
+ /** Function to trigger import with source content and type */
57
+ import: (source: string, type: "file" | "raw") => Promise<void>;
58
+ }): void;
59
+ }>;
38
60
  export default _default;
61
+ type __VLS_WithSlots<T, S> = T & {
62
+ new (): {
63
+ $slots: S;
64
+ };
65
+ };
39
66
  //# sourceMappingURL=CommandPaletteImport.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteImport.vue"],"names":[],"mappings":"AA0UA,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAiBvE;;;;;;;;;;;;;;;;;GAiBG;;IAGD,+CAA+C;oBAC/B,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;;;;;IAH3B,+CAA+C;oBAC/B,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;;;;;AAL7B,wBA2cC"}
1
+ {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteImport.vue"],"names":[],"mappings":"AAyXA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAoBvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;IAGD,+CAA+C;oBAC/B,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,oCAAoC;iBACvB,YAAY;;;;;IALzB,+CAA+C;oBAC/B,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,oCAAoC;iBACvB,YAAY;;;;;IAazB,oEAAoE;sBAClD;QAChB,8DAA8D;QAC9D,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAChE,GAAG,IAAI;;AAxBV,wBA2eC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}