@scalar/api-client 2.1.18 → 2.1.19

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 (164) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts +5 -1
  3. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  4. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  5. package/dist/components/AddressBar/AddressBar.vue2.js +78 -75
  6. package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
  7. package/dist/components/AddressBar/AddressBarHistory.vue2.js +8 -8
  8. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  9. package/dist/components/AddressBar/AddressBarServer.vue.js +6 -6
  10. package/dist/components/CodeInput/CodeInput.vue.d.ts +6 -2
  11. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  12. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  13. package/dist/components/CodeInput/CodeInput.vue2.js +57 -49
  14. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts +1 -1
  15. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
  16. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts +1 -1
  17. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +1 -1
  18. package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts +1 -1
  19. package/dist/components/CommandPalette/CommandPaletteTag.vue.d.ts +1 -1
  20. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts +1 -1
  21. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +7 -7
  22. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  23. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  24. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +22 -22
  25. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  26. package/dist/components/ContextBar.vue.js +2 -2
  27. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts +19 -3
  28. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  29. package/dist/components/DataTable/DataTableCheckbox.vue.js +27 -14
  30. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  31. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +8 -8
  32. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  33. package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts +39 -0
  34. package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts.map +1 -0
  35. package/dist/components/ImportCurl/ImportCurlModal.vue.js +7 -0
  36. package/dist/components/ImportCurl/ImportCurlModal.vue2.js +88 -0
  37. package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -1
  38. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  39. package/dist/components/SideNav/SideNav.vue.js +1 -1
  40. package/dist/components/SideNav/SideNav.vue2.js +37 -26
  41. package/dist/components/SideNav/SideNavLink.vue.d.ts +2 -2
  42. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  43. package/dist/components/SideNav/SideNavLink.vue.js +10 -11
  44. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts +1 -1
  45. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  46. package/dist/components/Sidebar/Sidebar.vue.js +1 -1
  47. package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
  48. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  49. package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
  50. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +24 -3
  51. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  52. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  53. package/dist/components/Sidebar/SidebarListElement.vue2.js +26 -22
  54. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts +4 -0
  55. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  56. package/dist/components/Sidebar/SidebarListElementActions.vue.js +35 -32
  57. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  58. package/dist/components/TopNav/TopNav.vue.js +1 -1
  59. package/dist/components/TopNav/TopNav.vue2.js +1 -1
  60. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  61. package/dist/components/ViewLayout/ViewLayout.vue.js +7 -7
  62. package/dist/components/ViewLayout/ViewLayoutContent.vue.d.ts.map +1 -1
  63. package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -1
  64. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  65. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +11 -11
  66. package/dist/constants.d.ts +4 -0
  67. package/dist/constants.d.ts.map +1 -1
  68. package/dist/constants.js +2 -1
  69. package/dist/hooks/useDarkModeState.d.ts +4 -3
  70. package/dist/hooks/useDarkModeState.d.ts.map +1 -1
  71. package/dist/hooks/useDarkModeState.js +36 -21
  72. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  73. package/dist/layouts/App/ApiClientApp.vue.js +34 -38
  74. package/dist/layouts/App/create-api-client-app.d.ts +35 -32
  75. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  76. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  77. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  78. package/dist/layouts/Modal/ApiClientModal.vue2.js +6 -6
  79. package/dist/layouts/Modal/create-api-client-modal.d.ts +70 -64
  80. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  81. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  82. package/dist/layouts/Web/ApiClientWeb.vue.js +35 -39
  83. package/dist/layouts/Web/create-api-client-web.d.ts +35 -32
  84. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  85. package/dist/libs/create-client.d.ts +35 -32
  86. package/dist/libs/create-client.d.ts.map +1 -1
  87. package/dist/libs/event-busses/hot-keys-bus.d.ts +1 -1
  88. package/dist/libs/importers/curl.d.ts +3 -0
  89. package/dist/libs/importers/curl.d.ts.map +1 -0
  90. package/dist/libs/importers/curl.js +61 -0
  91. package/dist/libs/importers/index.d.ts +2 -0
  92. package/dist/libs/importers/index.d.ts.map +1 -0
  93. package/dist/libs/importers/index.js +4 -0
  94. package/dist/libs/index.d.ts +1 -0
  95. package/dist/libs/index.d.ts.map +1 -1
  96. package/dist/libs/index.js +23 -21
  97. package/dist/libs/parse-curl.d.ts +12 -0
  98. package/dist/libs/parse-curl.d.ts.map +1 -0
  99. package/dist/libs/parse-curl.js +70 -0
  100. package/dist/router.d.ts +2 -1
  101. package/dist/router.d.ts.map +1 -1
  102. package/dist/router.js +33 -24
  103. package/dist/store/collections.d.ts +4 -4
  104. package/dist/store/cookies.d.ts +4 -4
  105. package/dist/store/environment.d.ts +4 -4
  106. package/dist/store/request-example.d.ts +4 -4
  107. package/dist/store/requests.d.ts +4 -4
  108. package/dist/store/router-params.d.ts +1 -0
  109. package/dist/store/router-params.d.ts.map +1 -1
  110. package/dist/store/router-params.js +2 -1
  111. package/dist/store/servers.d.ts +4 -4
  112. package/dist/store/store.d.ts +70 -64
  113. package/dist/store/store.d.ts.map +1 -1
  114. package/dist/store/store.js +126 -119
  115. package/dist/store/tags.d.ts +4 -4
  116. package/dist/store/workspace.d.ts +4 -4
  117. package/dist/style.css +1 -1
  118. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  119. package/dist/views/Cookies/Cookies.vue2.js +18 -18
  120. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  121. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +9 -9
  122. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  123. package/dist/views/Request/Request.vue.js +1 -1
  124. package/dist/views/Request/Request.vue2.js +146 -96
  125. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  126. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  127. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +1 -1
  128. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  129. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +4 -4
  130. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  131. package/dist/views/Request/RequestSidebar.vue.js +3 -3
  132. package/dist/views/Request/RequestSidebar.vue2.js +2 -2
  133. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  134. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  135. package/dist/views/Request/RequestSidebarItem.vue2.js +49 -49
  136. package/dist/views/Request/RequestSubpageHeader.vue.d.ts +2 -0
  137. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  138. package/dist/views/Request/RequestSubpageHeader.vue.js +4 -4
  139. package/dist/views/Request/RequestSubpageHeader.vue2.js +17 -15
  140. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  141. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  142. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +1 -1
  143. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +1 -1
  144. package/dist/views/Settings/Settings.vue.d.ts +4 -0
  145. package/dist/views/Settings/Settings.vue.d.ts.map +1 -0
  146. package/dist/views/Settings/Settings.vue.js +4 -0
  147. package/dist/views/Settings/Settings.vue2.js +59 -0
  148. package/dist/{components/DarkModeToggle/DarkModeIconToggle.vue.d.ts → views/Settings/SettingsGeneral.vue.d.ts} +1 -1
  149. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -0
  150. package/dist/views/Settings/SettingsGeneral.vue.js +124 -0
  151. package/dist/views/Settings/SettingsGeneral.vue2.js +4 -0
  152. package/dist/views/Settings/SettingsGeneralMode.vue.d.ts +3 -0
  153. package/dist/views/Settings/SettingsGeneralMode.vue.d.ts.map +1 -0
  154. package/dist/views/Settings/SettingsGeneralMode.vue.js +78 -0
  155. package/dist/views/Settings/SettingsGeneralMode.vue2.js +4 -0
  156. package/package.json +60 -36
  157. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +0 -1
  158. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +0 -31
  159. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue2.js +0 -4
  160. package/dist/components/DarkModeToggle/index.d.ts +0 -2
  161. package/dist/components/DarkModeToggle/index.d.ts.map +0 -1
  162. package/dist/components/DarkModeToggle/index.js +0 -4
  163. package/dist/components/ScreenReader.vue.js +0 -7
  164. package/dist/components/ScreenReader.vue2.js +0 -18
@@ -1 +1 @@
1
- {"version":3,"file":"ViewLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayout.vue"],"names":[],"mappings":"AAeA,iBAAS,cAAc;qBAyBM,GAAG;EAa/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ViewLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayout.vue"],"names":[],"mappings":"AAeA,iBAAS,cAAc;qBA2BM,GAAG;EAa/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,12 +1,12 @@
1
- import { openBlock as o, createElementBlock as r, renderSlot as t } from "vue";
2
- import l from "../../_virtual/_plugin-vue_export-helper.js";
3
- const n = {}, c = { class: "flex flex-col min-h-0 flex-1 xl:overflow-hidden md:flex-row leading-3 z-0" };
4
- function f(e, s) {
5
- return o(), r("div", c, [
6
- t(e.$slots, "default")
1
+ import { openBlock as o, createElementBlock as d, renderSlot as r } from "vue";
2
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
3
+ const i = {}, l = { class: "divide-y md:divide-y-0 divide-1 flex flex-col min-h-0 flex-1 xl:overflow-hidden md:flex-row leading-3" };
4
+ function n(e, c) {
5
+ return o(), d("div", l, [
6
+ r(e.$slots, "default")
7
7
  ]);
8
8
  }
9
- const a = /* @__PURE__ */ l(n, [["render", f]]);
9
+ const a = /* @__PURE__ */ t(i, [["render", n]]);
10
10
  export {
11
11
  a as default
12
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ViewLayoutContent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutContent.vue"],"names":[],"mappings":"AAeA,iBAAS,cAAc;qBA6BM,GAAG;EAa/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ViewLayoutContent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutContent.vue"],"names":[],"mappings":"AAeA,iBAAS,cAAc;qBA4BM,GAAG;EAa/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { openBlock as o, createElementBlock as r, renderSlot as t } from "vue";
2
2
  import d from "../../_virtual/_plugin-vue_export-helper.js";
3
- const l = {}, c = { class: "border-t-1/2 md:border-t-0 divide divide-y xl:divide-y-0 xl:divide-x-1/2 flex xl:flex-row flex-col custom-scroll pr-0 rounded" };
3
+ const l = {}, c = { class: "border-t-1/2 md:border-t-0 divide divide-y xl:divide-y-0 xl:divide-x-1/2 flex xl:flex-row flex-col custom-scroll pr-0" };
4
4
  function i(e, n) {
5
5
  return o(), r("div", c, [
6
6
  t(e.$slots, "default")
@@ -1 +1 @@
1
- {"version":3,"file":"ViewLayoutSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutSection.vue"],"names":[],"mappings":"AA8BA,iBAAS,cAAc;mBA6CI,GAAG;qBACD,GAAG;EAc/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ViewLayoutSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutSection.vue"],"names":[],"mappings":"AA8BA,iBAAS,cAAc;mBA8CI,GAAG;qBACD,GAAG;EAc/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,20 +1,20 @@
1
- import { defineComponent as n, openBlock as r, createElementBlock as s, unref as o, createElementVNode as d, renderSlot as l } from "vue";
2
- import { nanoid as i } from "nanoid";
1
+ import { defineComponent as n, openBlock as r, createElementBlock as s, unref as t, createElementVNode as i, renderSlot as o } from "vue";
2
+ import { nanoid as d } from "nanoid";
3
3
  const a = ["aria-labelledby"], c = ["id"], u = /* @__PURE__ */ n({
4
4
  __name: "ViewLayoutSection",
5
5
  setup(m) {
6
- const e = i();
7
- return (t, p) => (r(), s("section", {
8
- "aria-labelledby": o(e),
9
- class: "flex xl:min-w-0 xl:flex-1 flex-col xl:custom-scroll bg-b-1"
6
+ const e = d();
7
+ return (l, p) => (r(), s("section", {
8
+ "aria-labelledby": t(e),
9
+ class: "flex h-full xl:min-w-0 xl:flex-1 flex-col xl:custom-scroll bg-b-1"
10
10
  }, [
11
- d("div", {
12
- id: o(e),
13
- class: "xl:min-h-header flex items-center border-b-1/2 p-2 md:px-4 md:py-2.5 xl:px-6 xl:pr-5 text-sm font-medium sticky top-0 bg-b-1 z-20 rounded-t xl:rounded-none"
11
+ i("div", {
12
+ id: t(e),
13
+ class: "min-h-11 xl:min-h-header flex items-center border-b-1/2 px-3.5 py-2 md:px-4 md:py-2.5 xl:px-6 xl:pr-5 text-sm font-medium sticky top-0 bg-b-1 xl:rounded-none"
14
14
  }, [
15
- l(t.$slots, "title")
15
+ o(l.$slots, "title")
16
16
  ], 8, c),
17
- l(t.$slots, "default")
17
+ o(l.$slots, "default")
18
18
  ], 8, a));
19
19
  }
20
20
  });
@@ -10,5 +10,9 @@ export declare const ROUTES: readonly [{
10
10
  readonly prettyName: "Env Vars";
11
11
  readonly name: "environment";
12
12
  readonly icon: "Brackets";
13
+ }, {
14
+ readonly prettyName: "Settings";
15
+ readonly name: "settings";
16
+ readonly icon: "Settings";
13
17
  }];
14
18
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;EAMT,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;EAOT,CAAA"}
package/dist/constants.js CHANGED
@@ -1,7 +1,8 @@
1
1
  const e = [
2
2
  { prettyName: "Request", name: "request", icon: "ExternalLink" },
3
3
  { prettyName: "Cookies", name: "cookies", icon: "Cookie" },
4
- { prettyName: "Env Vars", name: "environment", icon: "Brackets" }
4
+ { prettyName: "Env Vars", name: "environment", icon: "Brackets" },
5
+ { prettyName: "Settings", name: "settings", icon: "Settings" }
5
6
  // { prettyName: 'Servers', name: 'servers', icon: 'Server' },
6
7
  // { label: 'Git Sync', icon: 'Branch', path: '/git-sync' },
7
8
  ];
@@ -1,7 +1,8 @@
1
1
  /** This hook helps with retrieving the dark mode setting from local storage or from system settings. */
2
- export declare function useDarkModeState(isDarkInitially?: boolean): {
3
- isDark: import("vue").Ref<boolean>;
2
+ export declare function useDarkModeState(): {
3
+ colorMode: import("vue").Ref<"light" | "dark" | "system">;
4
4
  toggleDarkMode: () => void;
5
- setDarkMode: (value: boolean) => void;
5
+ setDarkMode: (value: boolean | null) => void;
6
+ getSystemModePreference: () => boolean;
6
7
  };
7
8
  //# sourceMappingURL=useDarkModeState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDarkModeState.d.ts","sourceRoot":"","sources":["../../src/hooks/useDarkModeState.ts"],"names":[],"mappings":"AAKA,wGAAwG;AACxG,wBAAgB,gBAAgB,CAAC,eAAe,CAAC,EAAE,OAAO;;;yBAoC5B,OAAO;EA8BpC"}
1
+ {"version":3,"file":"useDarkModeState.d.ts","sourceRoot":"","sources":["../../src/hooks/useDarkModeState.ts"],"names":[],"mappings":"AAIA,wGAAwG;AACxG,wBAAgB,gBAAgB;;;yBAYF,OAAO,GAAG,IAAI;;EA+E3C"}
@@ -1,31 +1,46 @@
1
- import { ref as s, watch as f } from "vue";
2
- const t = s(!1);
3
- function c(a) {
4
- var n;
5
- const r = () => {
6
- var o, i;
7
- const e = typeof window < "u" ? (o = window.localStorage) == null ? void 0 : o.getItem("isDark") : null;
8
- return typeof e == "string" ? !!JSON.parse(e) : !!(typeof window < "u" && typeof (window == null ? void 0 : window.matchMedia) == "function" && ((i = window == null ? void 0 : window.matchMedia("(prefers-color-scheme: dark)")) != null && i.matches));
9
- }, d = () => {
1
+ import { ref as r, watch as l, onMounted as s, onUnmounted as c } from "vue";
2
+ const o = r("dark");
3
+ function f() {
4
+ const a = () => {
10
5
  var e;
11
- t.value = !t.value, typeof window < "u" && ((e = window == null ? void 0 : window.localStorage) == null || e.setItem("isDark", JSON.stringify(t.value)));
6
+ o.value = o.value === "dark" ? "light" : "dark", typeof window < "u" && ((e = window == null ? void 0 : window.localStorage) == null || e.setItem("colorMode", o.value));
12
7
  };
13
- function l(e) {
14
- var o;
15
- t.value = e, typeof window < "u" && ((o = window == null ? void 0 : window.localStorage) == null || o.setItem("isDark", JSON.stringify(t.value)));
8
+ function i(e) {
9
+ var d;
10
+ o.value = e === null ? "system" : e ? "dark" : "light", typeof window < "u" && ((d = window == null ? void 0 : window.localStorage) == null || d.setItem("colorMode", o.value));
16
11
  }
17
- return t.value = (typeof window > "u" ? null : JSON.parse(((n = window.localStorage) == null ? void 0 : n.getItem("isDark")) || "null")) ?? a ?? r(), f(
18
- t,
12
+ const t = () => {
13
+ var e;
14
+ return typeof window < "u" && typeof (window == null ? void 0 : window.matchMedia) == "function" ? (e = window == null ? void 0 : window.matchMedia("(prefers-color-scheme: dark)")) == null ? void 0 : e.matches : !1;
15
+ }, n = (e) => {
16
+ typeof document < "u" && (e === null ? (document.body.classList.toggle("dark-mode", t()), document.body.classList.toggle("light-mode", !t())) : (document.body.classList.toggle("dark-mode", e === !0), document.body.classList.toggle("light-mode", e === !1)));
17
+ };
18
+ return o.value = typeof window > "u" ? "dark" : localStorage.getItem("colorMode") || "dark", n(
19
+ o.value === "dark" || o.value === "system" && t()
20
+ ), l(
21
+ o,
19
22
  (e) => {
20
- typeof document > "u" || (document.body.classList.toggle("dark-mode", e), document.body.classList.toggle("light-mode", !e));
23
+ n(
24
+ e === "dark" || e === "system" && t()
25
+ );
21
26
  },
22
27
  { immediate: !0 }
23
- ), {
24
- isDark: t,
25
- toggleDarkMode: d,
26
- setDarkMode: l
28
+ ), s(() => {
29
+ if (typeof window < "u" && typeof window.matchMedia == "function") {
30
+ const e = window.matchMedia("(prefers-color-scheme: dark)"), d = () => {
31
+ o.value === "system" && n(t());
32
+ };
33
+ e.addEventListener("change", d), c(() => {
34
+ e.removeEventListener("change", d);
35
+ });
36
+ }
37
+ }), {
38
+ colorMode: o,
39
+ toggleDarkMode: a,
40
+ setDarkMode: i,
41
+ getSystemModePreference: t
27
42
  };
28
43
  }
29
44
  export {
30
- c as useDarkModeState
45
+ f as useDarkModeState
31
46
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;cA0I8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAoMjD,wBAMG"}
1
+ {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;cAsH8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA6LjD,wBAMG"}
@@ -1,61 +1,57 @@
1
- import { defineComponent as T, ref as _, onMounted as c, watchEffect as h, onBeforeMount as k, onBeforeUnmount as y, computed as b, openBlock as t, createElementBlock as i, Fragment as N, createElementVNode as d, createVNode as e, unref as n, withCtx as S, createBlock as p, KeepAlive as g, resolveDynamicComponent as x, createCommentVNode as E } from "vue";
1
+ import { defineComponent as v, ref as w, onBeforeMount as T, onMounted as _, onBeforeUnmount as h, computed as k, openBlock as t, createElementBlock as s, Fragment as y, createElementVNode as i, createVNode as e, unref as n, withCtx as N, createBlock as c, KeepAlive as S, resolveDynamicComponent as b, createCommentVNode as x } from "vue";
2
2
  import C from "../../components/SideNav/SideNav.vue.js";
3
- import L from "../../components/TopNav/TopNav.vue.js";
4
- import { addScalarClassesToHeadless as D } from "@scalar/components";
5
- import { getThemeStyles as H } from "@scalar/themes";
6
- import { ScalarToasts as K } from "@scalar/use-toasts";
7
- import { RouterView as A } from "vue-router";
8
- import { APP_HOTKEYS as B } from "./hotkeys.js";
3
+ import E from "../../components/TopNav/TopNav.vue.js";
4
+ import { addScalarClassesToHeadless as H } from "@scalar/components";
5
+ import { getThemeStyles as K } from "@scalar/themes";
6
+ import { ScalarToasts as A } from "@scalar/use-toasts";
7
+ import { RouterView as B } from "vue-router";
8
+ import { APP_HOTKEYS as D } from "./hotkeys.js";
9
+ import { useDarkModeState as L } from "../../hooks/useDarkModeState.js";
9
10
  import M from "../../components/CommandPalette/TheCommandPalette.vue.js";
10
11
  import { DEFAULT_HOTKEYS as V, handleHotKeyDown as W } from "../../libs/event-busses/hot-keys-bus.js";
11
- import { useDarkModeState as P } from "../../hooks/useDarkModeState.js";
12
- import { useWorkspace as F } from "../../store/store.js";
13
- const O = ["innerHTML"], U = {
12
+ import { useWorkspace as g } from "../../store/store.js";
13
+ const P = ["innerHTML"], F = {
14
14
  key: 0,
15
- class: "flex min-h-0 flex-1 z-0"
16
- }, Y = { class: "flex flex-1 flex-col min-w-0 border-l-1/2 border-t-1/2" }, ne = /* @__PURE__ */ T({
15
+ class: "flex min-h-0 flex-1"
16
+ }, O = { class: "flex flex-1 flex-col min-w-0 border-l-1/2 border-t-1/2" }, oe = /* @__PURE__ */ v({
17
17
  __name: "ApiClientApp",
18
18
  emits: ["newTab"],
19
- setup(z) {
20
- const u = { ...V, ...B }, a = _(null), f = (o) => {
19
+ setup(U) {
20
+ const d = { ...V, ...D }, a = w(null), p = (o) => {
21
21
  a.value = o;
22
22
  };
23
- c(() => {
24
- h(() => {
25
- document.body.classList.toggle("dark-mode", l.value), document.body.classList.toggle("light-mode", !l.value);
26
- });
27
- });
28
- const { isDark: l } = P(), r = F();
29
- k(() => D());
30
- const s = (o) => W(o, { hotKeys: u });
31
- c(() => window.addEventListener("keydown", s)), y(() => window.removeEventListener("keydown", s));
32
- const v = b(
33
- () => r.activeWorkspace.value && `<style>${H(r.activeWorkspace.value.themeId)}</style>`
23
+ L();
24
+ const r = g();
25
+ T(() => H());
26
+ const l = (o) => W(o, { hotKeys: d });
27
+ _(() => window.addEventListener("keydown", l)), h(() => window.removeEventListener("keydown", l));
28
+ const u = k(
29
+ () => r.activeWorkspace.value && `<style>${K(r.activeWorkspace.value.themeId)}</style>`
34
30
  );
35
- return (o, I) => {
31
+ return (o, Y) => {
36
32
  var m;
37
- return t(), i(N, null, [
38
- d("div", { innerHTML: v.value }, null, 8, O),
39
- e(L, { openNewTab: a.value }, null, 8, ["openNewTab"]),
40
- (m = n(r).activeWorkspace.value) != null && m.uid ? (t(), i("main", U, [
33
+ return t(), s(y, null, [
34
+ i("div", { innerHTML: u.value }, null, 8, P),
35
+ e(E, { openNewTab: a.value }, null, 8, ["openNewTab"]),
36
+ (m = n(r).activeWorkspace.value) != null && m.uid ? (t(), s("main", F, [
41
37
  e(C),
42
38
  e(n(M)),
43
- d("div", Y, [
44
- e(n(A), { onNewTab: f }, {
45
- default: S(({ Component: w }) => [
46
- (t(), p(g, null, [
47
- (t(), p(x(w)))
39
+ i("div", O, [
40
+ e(n(B), { onNewTab: p }, {
41
+ default: N(({ Component: f }) => [
42
+ (t(), c(S, null, [
43
+ (t(), c(b(f)))
48
44
  ], 1024))
49
45
  ]),
50
46
  _: 1
51
47
  })
52
48
  ])
53
- ])) : E("", !0),
54
- e(n(K))
49
+ ])) : x("", !0),
50
+ e(n(A))
55
51
  ], 64);
56
52
  };
57
53
  }
58
54
  });
59
55
  export {
60
- ne as default
56
+ oe as default
61
57
  };