@scalar/api-client 2.26.1 → 2.27.1

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 (158) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/dist/components/Server/ServerSelector.vue.js +6 -6
  3. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +6 -6
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +1 -1
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  7. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +48 -43
  8. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  9. package/dist/v2/blocks/operation-block/components/Header.vue2.js +10 -10
  10. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +29 -25
  12. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  13. package/dist/v2/blocks/operation-block/helpers/get-example.js +15 -15
  14. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +10 -0
  15. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +1 -0
  16. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +4 -0
  17. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -1
  18. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  19. package/dist/v2/blocks/operation-block/helpers/send-request.js +1 -1
  20. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +1 -1
  21. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  22. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  23. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +101 -100
  24. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  25. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  26. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +62 -69
  27. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +6 -6
  28. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +36 -2
  29. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  31. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +38 -3
  32. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  33. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  34. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +1 -1
  35. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  36. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  37. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +68 -69
  38. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
  39. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
  40. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -40
  41. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  42. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +35 -41
  43. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  44. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +37 -41
  45. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +3 -2
  46. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  47. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +107 -87
  48. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts +21 -0
  49. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -0
  50. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js +91 -0
  51. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue2.js +4 -0
  52. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  53. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +107 -93
  54. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  55. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +87 -65
  56. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +36 -0
  57. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -0
  58. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +35 -0
  59. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +1 -1
  60. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -1
  61. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +18 -10
  62. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts +5 -0
  63. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -0
  64. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +27 -0
  65. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +3 -1
  66. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
  67. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +1 -2
  68. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  69. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +29 -37
  70. package/dist/v2/components/layout/CollapsibleSection.vue.js +1 -1
  71. package/dist/v2/components/modals/ModalClientContainer.vue.d.ts +2 -2
  72. package/dist/v2/components/modals/ModalClientContainer.vue.d.ts.map +1 -1
  73. package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
  74. package/dist/v2/components/modals/ModalClientContainer.vue2.js +45 -42
  75. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -0
  76. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  77. package/dist/v2/components/sidebar/Sidebar.vue.js +25 -24
  78. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -0
  79. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  80. package/dist/v2/components/sidebar/SidebarMenu.vue.js +30 -30
  81. package/dist/v2/features/app/App.vue.d.ts +6 -1
  82. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  83. package/dist/v2/features/app/App.vue.js +48 -46
  84. package/dist/v2/features/app/app-events.d.ts +1 -1
  85. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  86. package/dist/v2/features/app/app-events.js +95 -56
  87. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  88. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  89. package/dist/v2/features/app/components/AppSidebar.vue2.js +111 -105
  90. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +12 -2
  91. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  92. package/dist/v2/features/app/helpers/create-api-client-app.js +12 -10
  93. package/dist/v2/features/app/helpers/routes.d.ts +3 -1
  94. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  95. package/dist/v2/features/app/hooks/use-theme.d.ts +42 -0
  96. package/dist/v2/features/app/hooks/use-theme.d.ts.map +1 -0
  97. package/dist/v2/features/app/hooks/use-theme.js +34 -0
  98. package/dist/v2/features/app/index.d.ts +0 -1
  99. package/dist/v2/features/app/index.d.ts.map +1 -1
  100. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  101. package/dist/v2/features/collection/DocumentCollection.vue.js +27 -26
  102. package/dist/v2/features/collection/WorkspaceCollection.vue.js +13 -12
  103. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  104. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  105. package/dist/v2/features/collection/components/Authentication.vue2.js +49 -40
  106. package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +1 -1
  107. package/dist/v2/features/collection/components/Cookies.vue.js +26 -13
  108. package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
  109. package/dist/v2/features/collection/components/Environment.vue.js +27 -15
  110. package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
  111. package/dist/v2/features/collection/components/Overview.vue.js +2 -2
  112. package/dist/v2/features/collection/components/Overview.vue2.js +68 -61
  113. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  114. package/dist/v2/features/collection/components/Servers.vue.js +93 -88
  115. package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
  116. package/dist/v2/features/collection/components/Settings.vue.js +19 -17
  117. package/dist/v2/features/environments/EnvironmentsList.vue.js +1 -1
  118. package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts.map +1 -1
  119. package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +2 -2
  120. package/dist/v2/features/global-cookies/components/CookiesTable.vue2.js +8 -8
  121. package/dist/v2/features/modal/Modal.vue.d.ts +1 -1
  122. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  123. package/dist/v2/features/modal/Modal.vue.js +15 -15
  124. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +1 -1
  125. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  126. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  127. package/dist/v2/features/operation/Operation.vue.js +31 -34
  128. package/dist/v2/features/settings/CollectionSettings.vue.d.ts +10 -7
  129. package/dist/v2/features/settings/CollectionSettings.vue.d.ts.map +1 -1
  130. package/dist/v2/features/settings/CollectionSettings.vue.js +183 -149
  131. package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +1 -1
  132. package/dist/v2/features/settings/DocumentSettings.vue.js +88 -79
  133. package/dist/v2/features/settings/components/Section.vue.d.ts +2 -1
  134. package/dist/v2/features/settings/components/Section.vue.d.ts.map +1 -1
  135. package/dist/v2/features/settings/components/Section.vue.js +26 -15
  136. package/dist/v2/features/settings/helpers/get-theme-colors.d.ts +4 -3
  137. package/dist/v2/features/settings/helpers/get-theme-colors.d.ts.map +1 -1
  138. package/dist/v2/features/settings/helpers/get-theme-colors.js +6 -7
  139. package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
  140. package/dist/v2/helpers/handle-hotkeys.js +2 -2
  141. package/dist/v2/helpers/index.d.ts +0 -1
  142. package/dist/v2/helpers/index.d.ts.map +1 -1
  143. package/dist/v2/hooks/use-global-hot-keys.d.ts +3 -1
  144. package/dist/v2/hooks/use-global-hot-keys.d.ts.map +1 -1
  145. package/dist/v2/hooks/use-global-hot-keys.js +8 -6
  146. package/dist/v2/workspace-events.d.ts.map +1 -1
  147. package/dist/v2/workspace-events.js +10 -0
  148. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  149. package/dist/views/Request/RequestSidebar.vue.js +2 -2
  150. package/dist/views/Request/RequestSidebar.vue2.js +139 -155
  151. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  152. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  153. package/dist/views/Request/RequestSidebarItem.vue2.js +104 -101
  154. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  155. package/package.json +20 -18
  156. package/dist/v2/helpers/plugins.d.ts +0 -65
  157. package/dist/v2/helpers/plugins.d.ts.map +0 -1
  158. package/dist/v2/helpers/plugins.js +0 -11
@@ -1,15 +1,15 @@
1
- import { defineComponent as f, computed as n, toValue as r, onMounted as k, createBlock as x, createElementBlock as g, openBlock as l, unref as i, createElementVNode as w } from "vue";
1
+ import { defineComponent as f, computed as n, toValue as o, createBlock as k, createElementBlock as g, openBlock as i, unref as l, createElementVNode as x } from "vue";
2
2
  import { getResolvedRef as m } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
- import { mapHiddenClientsConfig as C } from "../modal/helpers/map-hidden-clients-config.js";
4
- import { combineParams as B } from "./helpers/combine-params.js";
5
- import { getSelectedServer as U } from "./helpers/get-selected-server.js";
6
- import { getServers as b } from "../../helpers/get-servers.js";
7
- import N from "../../blocks/operation-block/OperationBlock.vue.js";
8
- const E = {
3
+ import { mapHiddenClientsConfig as w } from "../modal/helpers/map-hidden-clients-config.js";
4
+ import { combineParams as C } from "./helpers/combine-params.js";
5
+ import { getSelectedServer as B } from "./helpers/get-selected-server.js";
6
+ import { getServers as U } from "../../helpers/get-servers.js";
7
+ import b from "../../blocks/operation-block/OperationBlock.vue.js";
8
+ const N = {
9
9
  key: 1,
10
10
  class: "flex h-full w-full items-center justify-center"
11
- }, O = {}, K = /* @__PURE__ */ f({
12
- ...O,
11
+ }, E = {}, I = /* @__PURE__ */ f({
12
+ ...E,
13
13
  __name: "Operation",
14
14
  props: {
15
15
  documentSlug: {},
@@ -24,19 +24,20 @@ const E = {
24
24
  workspaceStore: {},
25
25
  activeWorkspace: {},
26
26
  plugins: {},
27
+ customThemes: {},
27
28
  options: {}
28
29
  },
29
30
  setup(e) {
30
- const c = n(() => e.path ? m(e.document?.paths?.[e.path]) : null), u = n(() => {
31
+ const r = n(() => e.path ? m(e.document?.paths?.[e.path]) : null), c = n(() => {
31
32
  if (!e.path || !e.method)
32
33
  return null;
33
34
  const t = m(e.document?.paths?.[e.path]?.[e.method]);
34
35
  if (!t)
35
36
  return null;
36
- if (!c.value)
37
+ if (!r.value)
37
38
  return t;
38
- const a = B(
39
- c.value.parameters,
39
+ const a = C(
40
+ r.value.parameters,
40
41
  t.parameters
41
42
  );
42
43
  return { ...t, parameters: a };
@@ -49,19 +50,15 @@ const E = {
49
50
  ...t,
50
51
  location: "document"
51
52
  }))
52
- ]), o = n(() => {
53
- const t = r(e.options)?.servers ?? u.value?.servers ?? c.value?.servers ?? e.document?.servers;
54
- return b(t, {
55
- baseServerUrl: r(e.options)?.baseServerURL,
53
+ ]), u = n(() => {
54
+ const t = o(e.options)?.servers ?? c.value?.servers ?? r.value?.servers ?? e.document?.servers;
55
+ return U(t, {
56
+ baseServerUrl: o(e.options)?.baseServerURL,
56
57
  documentUrl: e.document?.["x-scalar-original-source-url"]
57
58
  });
58
59
  }), d = n(
59
- () => U(e.document, o.value)
60
- );
61
- k(() => {
62
- typeof e.document?.["x-scalar-selected-server"] > "u" && o.value?.[0]?.url && e.eventBus.emit("server:update:selected", { url: o.value[0].url });
63
- });
64
- const v = n(() => e.document?.["x-scalar-set-operation-security"] ? {
60
+ () => B(e.document, u.value)
61
+ ), v = n(() => e.document?.["x-scalar-set-operation-security"] ? {
65
62
  type: "operation",
66
63
  path: e.path ?? "",
67
64
  method: e.method ?? "get"
@@ -75,12 +72,12 @@ const E = {
75
72
  })
76
73
  )
77
74
  )), S = n(
78
- () => C(r(e.options)?.hiddenClients)
79
- ), y = "2.26.1";
80
- return (t, a) => e.path && e.method && e.exampleName && u.value ? (l(), x(i(N), {
75
+ () => w(o(e.options)?.hiddenClients)
76
+ ), y = "2.27.1";
77
+ return (t, a) => e.path && e.method && e.exampleName && c.value ? (i(), k(l(b), {
81
78
  key: 0,
82
79
  activeEnvironment: e.workspaceStore.workspace["x-scalar-active-environment"],
83
- appVersion: i(y),
80
+ appVersion: l(y),
84
81
  authMeta: v.value,
85
82
  documentSecurity: e.document?.security ?? [],
86
83
  documentSelectedSecurity: e.workspaceStore.auth.getAuthSelectedSchemas({
@@ -93,12 +90,12 @@ const E = {
93
90
  eventBus: e.eventBus,
94
91
  exampleKey: e.exampleName,
95
92
  globalCookies: s.value,
96
- hideClientButton: r(e.options)?.hideClientButton ?? !1,
93
+ hideClientButton: o(e.options)?.hideClientButton ?? !1,
97
94
  history: e.workspaceStore.history.getHistory(e.documentSlug, e.path, e.method),
98
95
  httpClients: S.value,
99
96
  layout: e.layout,
100
97
  method: e.method,
101
- operation: u.value,
98
+ operation: c.value,
102
99
  operationSelectedSecurity: e.workspaceStore.auth.getAuthSelectedSchemas({
103
100
  type: "operation",
104
101
  documentName: e.documentSlug,
@@ -111,14 +108,14 @@ const E = {
111
108
  securitySchemes: e.securitySchemes,
112
109
  selectedClient: e.workspaceStore.workspace["x-scalar-default-client"],
113
110
  server: d.value,
114
- servers: o.value,
111
+ servers: u.value,
115
112
  setOperationSecurity: e.document?.["x-scalar-set-operation-security"] ?? !1,
116
- "onUpdate:servers": a[0] || (a[0] = (V) => e.eventBus.emit("ui:route:page", { name: "document.servers" }))
117
- }, null, 8, ["activeEnvironment", "appVersion", "authMeta", "documentSecurity", "documentSelectedSecurity", "documentUrl", "environment", "environments", "eventBus", "exampleKey", "globalCookies", "hideClientButton", "history", "httpClients", "layout", "method", "operation", "operationSelectedSecurity", "path", "plugins", "proxyUrl", "securitySchemes", "selectedClient", "server", "servers", "setOperationSecurity"])) : (l(), g("div", E, [...a[1] || (a[1] = [
118
- w("span", { class: "text-c-3" }, "Select an operation to view details", -1)
113
+ "onUpdate:servers": a[0] || (a[0] = (O) => e.eventBus.emit("ui:navigate", { page: "document", path: "servers" }))
114
+ }, null, 8, ["activeEnvironment", "appVersion", "authMeta", "documentSecurity", "documentSelectedSecurity", "documentUrl", "environment", "environments", "eventBus", "exampleKey", "globalCookies", "hideClientButton", "history", "httpClients", "layout", "method", "operation", "operationSelectedSecurity", "path", "plugins", "proxyUrl", "securitySchemes", "selectedClient", "server", "servers", "setOperationSecurity"])) : (i(), g("div", N, [...a[1] || (a[1] = [
115
+ x("span", { class: "text-c-3" }, "Select an operation to view details", -1)
119
116
  ])]));
120
117
  }
121
118
  });
122
119
  export {
123
- K as default
120
+ I as default
124
121
  };
@@ -1,20 +1,23 @@
1
- import { type ThemeId } from '@scalar/themes';
1
+ import { type Theme } from '@scalar/themes';
2
+ type ColorMode = 'system' | 'light' | 'dark';
2
3
  type __VLS_Props = {
3
4
  /** Currently active proxy URL, when set to null means no proxy */
4
5
  activeProxyUrl?: string | null;
6
+ /** Custom themes available to the team */
7
+ customThemes?: Theme[];
5
8
  /** Currently active theme ID */
6
- activeThemeId: ThemeId;
9
+ activeThemeSlug?: string;
7
10
  /** Currently active color mode */
8
- colorMode: 'system' | 'light' | 'dark';
11
+ colorMode: ColorMode;
9
12
  };
10
13
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
- "update:colorMode": (value: "dark" | "light" | "system") => any;
14
+ "update:colorMode": (value: ColorMode) => any;
12
15
  "update:proxyUrl": (value: string | null) => any;
13
- "update:themeId": (value: "default" | "alternate" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "laserwave" | "none") => any;
16
+ "update:themeSlug": (value: string | undefined) => any;
14
17
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
- "onUpdate:colorMode"?: ((value: "dark" | "light" | "system") => any) | undefined;
18
+ "onUpdate:colorMode"?: ((value: ColorMode) => any) | undefined;
16
19
  "onUpdate:proxyUrl"?: ((value: string | null) => any) | undefined;
17
- "onUpdate:themeId"?: ((value: "default" | "alternate" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "laserwave" | "none") => any) | undefined;
20
+ "onUpdate:themeSlug"?: ((value: string | undefined) => any) | undefined;
18
21
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
22
  declare const _default: typeof __VLS_export;
20
23
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionSettings.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/settings/CollectionSettings.vue"],"names":[],"mappings":"AAuQA,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAA;AAQvB,KAAK,WAAW,GAAG;IACjB,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,gCAAgC;IAChC,aAAa,EAAE,OAAO,CAAA;IACtB,kCAAkC;IAClC,SAAS,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;CACvC,CAAC;AA2iBF,QAAA,MAAM,YAAY;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"CollectionSettings.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/settings/CollectionSettings.vue"],"names":[],"mappings":"AAkTA,OAAO,EAIL,KAAK,KAAK,EAEX,MAAM,gBAAgB,CAAA;AASvB,KAAK,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;AAE5C,KAAK,WAAW,GAAG;IACjB,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,0CAA0C;IAC1C,YAAY,CAAC,EAAE,KAAK,EAAE,CAAA;IACtB,gCAAgC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,kCAAkC;IAClC,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;AAgnBF,QAAA,MAAM,YAAY;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,27 +1,41 @@
1
- import { defineComponent as M, createElementBlock as y, openBlock as c, createVNode as n, withCtx as s, createElementVNode as o, unref as r, normalizeClass as a, createTextVNode as l, createBlock as f, createCommentVNode as p, Fragment as C, renderList as w, toDisplayString as U, normalizeStyle as g } from "vue";
2
- import { cva as $, ScalarButton as m, cx as x, ScalarIcon as b } from "@scalar/components";
3
- import { themeLabels as T } from "@scalar/themes";
4
- import B from "../../../components/ImportCollection/IntegrationLogo.vue.js";
5
- import L from "./components/Appearance.vue.js";
6
- import k from "./components/Section.vue.js";
7
- import { getThemeColors as h } from "./helpers/get-theme-colors.js";
8
- const N = { class: "flex flex-col gap-4" }, R = { class: "flex flex-col gap-2" }, V = { class: "flex flex-col gap-2" }, A = { class: "grid grid-cols-2 gap-2" }, E = { class: "flex items-center gap-2" }, F = { class: "flex items-center gap-1" }, O = { class: "grid grid-cols-2 gap-2" }, D = { class: "flex items-center gap-2" }, W = { class: "flex items-center gap-1" }, q = { class: "size-7 rounded-xl" }, v = "https://proxy.scalar.com", I = /* @__PURE__ */ M({
1
+ import { defineComponent as L, computed as $, createElementBlock as h, openBlock as n, createVNode as d, createBlock as c, createCommentVNode as g, withCtx as o, createElementVNode as r, unref as s, normalizeClass as u, createTextVNode as a, Fragment as S, renderList as C, toDisplayString as w, normalizeStyle as U } from "vue";
2
+ import { cva as O, ScalarButton as y, cx as f, ScalarIcon as x } from "@scalar/components";
3
+ import { presets as F, themeLabels as V } from "@scalar/themes";
4
+ import H from "../../../components/ImportCollection/IntegrationLogo.vue.js";
5
+ import G from "./components/Appearance.vue.js";
6
+ import p from "./components/Section.vue.js";
7
+ import { getThemeColors as N } from "./helpers/get-theme-colors.js";
8
+ const W = { class: "flex flex-col gap-10" }, q = { class: "flex flex-col gap-2" }, I = { class: "grid grid-cols-2 gap-2" }, X = { class: "flex items-center gap-2" }, Y = { class: "flex items-center gap-1" }, J = { class: "grid grid-cols-2 gap-2" }, K = { class: "flex items-center gap-2" }, Q = { class: "flex items-center gap-1" }, Z = { class: "size-7 rounded-xl" }, _ = { class: "grid grid-cols-2 gap-2" }, ee = { class: "flex items-center gap-2" }, T = "https://proxy.scalar.com", ne = /* @__PURE__ */ L({
9
9
  __name: "CollectionSettings",
10
10
  props: {
11
11
  activeProxyUrl: {},
12
- activeThemeId: {},
12
+ customThemes: { default: () => [] },
13
+ activeThemeSlug: {},
13
14
  colorMode: {}
14
15
  },
15
- emits: ["update:proxyUrl", "update:themeId", "update:colorMode"],
16
- setup(i, { emit: S }) {
17
- const d = S, P = [
16
+ emits: ["update:proxyUrl", "update:themeSlug", "update:colorMode"],
17
+ setup(l, { emit: A }) {
18
+ const m = A, B = [
19
+ "none",
18
20
  "default",
19
21
  "alternate",
20
22
  "purple",
21
23
  "solarized",
22
24
  "saturn",
23
25
  "kepler"
24
- ], z = ["elysiajs", "fastify"], u = $({
26
+ ], R = ["elysiajs", "fastify"], z = B.map((i) => i === "none" ? {
27
+ slug: i,
28
+ name: "None",
29
+ description: "No theme",
30
+ theme: ""
31
+ } : F[i]), M = R.map((i) => ({
32
+ slug: i,
33
+ name: V[i],
34
+ description: V[i],
35
+ theme: ""
36
+ })), j = $(
37
+ () => new Set(l.customThemes.map((i) => i.slug))
38
+ ), v = O({
25
39
  base: "w-full shadow-none text-c-1 justify-start pl-2 gap-2 border",
26
40
  variants: {
27
41
  active: {
@@ -29,75 +43,73 @@ const N = { class: "flex flex-col gap-4" }, R = { class: "flex flex-col gap-2" }
29
43
  false: "bg-b-1 hover:bg-b-2"
30
44
  }
31
45
  }
32
- });
33
- return (G, e) => (c(), y("div", N, [
34
- n(k, null, {
35
- title: s(() => [...e[3] || (e[3] = [
36
- l(" CORS Proxy ", -1)
46
+ }), D = $(() => l.activeThemeSlug === void 0 || l.activeThemeSlug === "none" ? !0 : !(j.value.has(l.activeThemeSlug) || z.some((e) => e.slug === l.activeThemeSlug) || M.some((e) => e.slug === l.activeThemeSlug))), P = (i) => i === "none", b = (i) => l.activeThemeSlug === i || P(i) && D.value, k = (i) => f(
47
+ "flex h-5 w-5 items-center justify-center rounded-full border-[1.5px] p-1",
48
+ i && "bg-c-accent text-b-1 border-transparent"
49
+ );
50
+ return (i, e) => (n(), h("div", W, [
51
+ d(p, null, {
52
+ title: o(() => [...e[3] || (e[3] = [
53
+ a("CORS Proxy", -1)
37
54
  ])]),
38
- description: s(() => [...e[4] || (e[4] = [
39
- l(" Browsers block cross-origin requests for security. We provide a public proxy to ", -1),
40
- o("a", {
55
+ description: o(() => [...e[4] || (e[4] = [
56
+ a(" Browsers block cross-origin requests for security. We provide a public proxy to ", -1),
57
+ r("a", {
41
58
  class: "hover:text-c-1 underline-offset-2",
42
59
  href: "https://en.wikipedia.org/wiki/Cross-origin_resource_sharing",
43
60
  target: "_blank"
44
61
  }, " bypass CORS issues ", -1),
45
- l(" . Check the ", -1),
46
- o("a", {
62
+ a(" . Check the ", -1),
63
+ r("a", {
47
64
  class: "hover:text-c-1 underline-offset-2",
48
65
  href: "https://github.com/scalar/scalar/tree/main/projects/proxy-scalar-com",
49
66
  target: "_blank"
50
67
  }, " source code on GitHub ", -1),
51
- l(" . ", -1)
68
+ a(" . ", -1)
52
69
  ])]),
53
- default: s(() => [
54
- o("div", R, [
55
- n(r(m), {
56
- class: a(
57
- r(x)(
58
- r(u)({
59
- active: i.activeProxyUrl === v
70
+ default: o(() => [
71
+ r("div", q, [
72
+ d(s(y), {
73
+ class: u(
74
+ s(f)(
75
+ s(v)({
76
+ active: l.activeProxyUrl === T
60
77
  })
61
78
  )
62
79
  ),
63
- onClick: e[0] || (e[0] = (t) => d("update:proxyUrl", v))
80
+ onClick: e[0] || (e[0] = (t) => m("update:proxyUrl", T))
64
81
  }, {
65
- default: s(() => [
66
- o("div", {
67
- class: a(["flex h-5 w-5 items-center justify-center rounded-full border-[1.5px] p-1", {
68
- "bg-c-accent text-b-1 border-transparent": i.activeProxyUrl === v
69
- }])
82
+ default: o(() => [
83
+ r("div", {
84
+ class: u(k(l.activeProxyUrl === T))
70
85
  }, [
71
- i.activeProxyUrl === v ? (c(), f(r(b), {
86
+ l.activeProxyUrl === T ? (n(), c(s(x), {
72
87
  key: 0,
73
88
  icon: "Checkmark",
74
89
  size: "xs",
75
90
  thickness: "3.5"
76
- })) : p("", !0)
91
+ })) : g("", !0)
77
92
  ], 2),
78
- e[5] || (e[5] = l(" Use proxy.scalar.com (default) ", -1))
93
+ e[5] || (e[5] = a(" Use proxy.scalar.com (default) ", -1))
79
94
  ]),
80
95
  _: 1
81
96
  }, 8, ["class"]),
82
- n(r(m), {
83
- class: a(r(x)(r(u)({ active: !i.activeProxyUrl }))),
84
- onClick: e[1] || (e[1] = (t) => d("update:proxyUrl", null))
97
+ d(s(y), {
98
+ class: u(s(f)(s(v)({ active: !l.activeProxyUrl }))),
99
+ onClick: e[1] || (e[1] = (t) => m("update:proxyUrl", null))
85
100
  }, {
86
- default: s(() => [
87
- o("div", {
88
- class: a([
89
- "flex h-5 w-5 items-center justify-center rounded-full border-[1.5px] p-1",
90
- !i.activeProxyUrl && "bg-c-accent text-b-1 border-transparent"
91
- ])
101
+ default: o(() => [
102
+ r("div", {
103
+ class: u(k(!l.activeProxyUrl))
92
104
  }, [
93
- i.activeProxyUrl ? p("", !0) : (c(), f(r(b), {
105
+ l.activeProxyUrl ? g("", !0) : (n(), c(s(x), {
94
106
  key: 0,
95
107
  icon: "Checkmark",
96
108
  size: "xs",
97
109
  thickness: "3.5"
98
110
  }))
99
111
  ], 2),
100
- e[6] || (e[6] = l(" Skip the proxy ", -1))
112
+ e[6] || (e[6] = a(" Skip the proxy ", -1))
101
113
  ]),
102
114
  _: 1
103
115
  }, 8, ["class"])
@@ -105,130 +117,152 @@ const N = { class: "flex flex-col gap-4" }, R = { class: "flex flex-col gap-2" }
105
117
  ]),
106
118
  _: 1
107
119
  }),
108
- n(k, null, {
109
- title: s(() => [...e[7] || (e[7] = [
110
- l(" Themes ", -1)
120
+ d(p, null, {
121
+ title: o(() => [...e[7] || (e[7] = [
122
+ a("Themes", -1)
111
123
  ])]),
112
- description: s(() => [...e[8] || (e[8] = [
113
- l(" We've got a whole rainbow of themes for you to play with: ", -1)
124
+ description: o(() => [...e[8] || (e[8] = [
125
+ a(" We've got a whole rainbow of themes for you to play with: ", -1)
114
126
  ])]),
115
- default: s(() => [
116
- o("div", V, [
117
- o("div", A, [
118
- (c(), y(C, null, w(P, (t) => n(r(m), {
119
- key: t,
120
- class: a(
121
- r(x)(
122
- r(u)({
123
- active: i.activeThemeId === t
124
- })
125
- )
126
- ),
127
- onClick: (j) => d("update:themeId", t)
128
- }, {
129
- default: s(() => [
130
- o("div", E, [
131
- o("div", {
132
- class: a(["flex h-5 w-5 items-center justify-center rounded-full border-[1.5px] p-1", {
133
- "bg-c-accent text-b-1 border-transparent": i.activeThemeId === t
134
- }])
135
- }, [
136
- i.activeThemeId === t ? (c(), f(r(b), {
137
- key: 0,
138
- icon: "Checkmark",
139
- size: "xs",
140
- thickness: "3.5"
141
- })) : p("", !0)
142
- ], 2),
143
- l(" " + U(r(T)[t]), 1)
144
- ]),
145
- o("div", F, [
146
- o("span", {
147
- class: "border-c-3 -mr-3 inline-block h-5 w-5 rounded-full",
148
- style: g({
149
- backgroundColor: r(h)(t).light
150
- })
151
- }, null, 4),
152
- o("span", {
153
- class: "border-c-3 -mr-3 inline-block h-5 w-5 rounded-full",
154
- style: g({
155
- backgroundColor: r(h)(t).dark
156
- })
157
- }, null, 4),
158
- o("span", {
159
- class: "border-c-3 inline-block h-5 w-5 rounded-full",
160
- style: g({
161
- backgroundColor: r(h)(t).accent
162
- })
163
- }, null, 4)
164
- ])
127
+ default: o(() => [
128
+ r("div", I, [
129
+ (n(!0), h(S, null, C(s(z), (t) => (n(), c(s(y), {
130
+ key: t.slug,
131
+ class: u(s(f)(s(v)({ active: b(t.slug) }))),
132
+ onClick: (E) => m(
133
+ "update:themeSlug",
134
+ P(t.slug) ? void 0 : t.slug
135
+ )
136
+ }, {
137
+ default: o(() => [
138
+ r("div", X, [
139
+ r("div", {
140
+ class: u(k(b(t.slug)))
141
+ }, [
142
+ b(t.slug) ? (n(), c(s(x), {
143
+ key: 0,
144
+ icon: "Checkmark",
145
+ size: "xs",
146
+ thickness: "3.5"
147
+ })) : g("", !0)
148
+ ], 2),
149
+ a(" " + w(t.name), 1)
165
150
  ]),
166
- _: 2
167
- }, 1032, ["class", "onClick"])), 64))
168
- ])
151
+ r("div", Y, [
152
+ r("span", {
153
+ class: "border-c-3 -mr-3 inline-block h-5 w-5 rounded-full",
154
+ style: U({
155
+ backgroundColor: s(N)(t.slug).light
156
+ })
157
+ }, null, 4),
158
+ r("span", {
159
+ class: "border-c-3 -mr-3 inline-block h-5 w-5 rounded-full",
160
+ style: U({
161
+ backgroundColor: s(N)(t.slug).dark
162
+ })
163
+ }, null, 4),
164
+ r("span", {
165
+ class: "border-c-3 inline-block h-5 w-5 rounded-full",
166
+ style: U({
167
+ backgroundColor: s(N)(t.slug).accent
168
+ })
169
+ }, null, 4)
170
+ ])
171
+ ]),
172
+ _: 2
173
+ }, 1032, ["class", "onClick"]))), 128))
169
174
  ])
170
175
  ]),
171
176
  _: 1
172
177
  }),
173
- n(k, null, {
174
- title: s(() => [...e[9] || (e[9] = [
175
- l(" Framework Themes ", -1)
178
+ d(p, null, {
179
+ title: o(() => [...e[9] || (e[9] = [
180
+ a("Framework Themes", -1)
176
181
  ])]),
177
- description: s(() => [...e[10] || (e[10] = [
178
- l(" Are you a real fan? Show your support by using your favorite framework's theme! ", -1)
182
+ description: o(() => [...e[10] || (e[10] = [
183
+ a(" Are you a real fan? Show your support by using your favorite framework's theme! ", -1)
179
184
  ])]),
180
- default: s(() => [
181
- o("div", O, [
182
- (c(), y(C, null, w(z, (t) => n(r(m), {
183
- key: t,
184
- class: a(
185
- r(x)(
186
- r(u)({
187
- active: i.activeThemeId === t
188
- })
189
- )
190
- ),
191
- onClick: (j) => d("update:themeId", t)
185
+ default: o(() => [
186
+ r("div", J, [
187
+ (n(!0), h(S, null, C(s(M), (t) => (n(), c(s(y), {
188
+ key: t.slug,
189
+ class: u(s(f)(s(v)({ active: l.activeThemeSlug === t.slug }))),
190
+ onClick: (E) => m("update:themeSlug", t.slug)
192
191
  }, {
193
- default: s(() => [
194
- o("div", D, [
195
- o("div", {
196
- class: a(["flex h-5 w-5 items-center justify-center rounded-full border-[1.5px] p-1", {
197
- "bg-c-accent text-b-1 border-transparent": i.activeThemeId === t
198
- }])
192
+ default: o(() => [
193
+ r("div", K, [
194
+ r("div", {
195
+ class: u(k(l.activeThemeSlug === t.slug))
199
196
  }, [
200
- i.activeThemeId === t ? (c(), f(r(b), {
197
+ l.activeThemeSlug === t.slug ? (n(), c(s(x), {
201
198
  key: 0,
202
199
  icon: "Checkmark",
203
200
  size: "xs",
204
201
  thickness: "3.5"
205
- })) : p("", !0)
202
+ })) : g("", !0)
206
203
  ], 2),
207
- l(" " + U(r(T)[t]), 1)
204
+ a(" " + w(t.name), 1)
208
205
  ]),
209
- o("div", W, [
210
- o("div", q, [
211
- n(B, { integration: t }, null, 8, ["integration"])
206
+ r("div", Q, [
207
+ r("div", Z, [
208
+ d(H, {
209
+ integration: t.slug
210
+ }, null, 8, ["integration"])
212
211
  ])
213
212
  ])
214
213
  ]),
215
214
  _: 2
216
- }, 1032, ["class", "onClick"])), 64))
215
+ }, 1032, ["class", "onClick"]))), 128))
217
216
  ])
218
217
  ]),
219
218
  _: 1
220
219
  }),
221
- n(k, null, {
222
- title: s(() => [...e[11] || (e[11] = [
223
- l(" Appearance ", -1)
220
+ l.customThemes.length > 0 ? (n(), c(p, { key: 0 }, {
221
+ title: o(() => [...e[11] || (e[11] = [
222
+ a(" Custom Themes ", -1)
223
+ ])]),
224
+ description: o(() => [...e[12] || (e[12] = [
225
+ a(" Team defined themes are available to all workspaces in the team. ", -1)
226
+ ])]),
227
+ default: o(() => [
228
+ r("div", _, [
229
+ (n(!0), h(S, null, C(l.customThemes, (t) => (n(), c(s(y), {
230
+ key: t.slug,
231
+ class: u(s(f)(s(v)({ active: l.activeThemeSlug === t.slug }))),
232
+ onClick: (E) => m("update:themeSlug", t.slug)
233
+ }, {
234
+ default: o(() => [
235
+ r("div", ee, [
236
+ r("div", {
237
+ class: u(k(l.activeThemeSlug === t.slug))
238
+ }, [
239
+ l.activeThemeSlug === t.slug ? (n(), c(s(x), {
240
+ key: 0,
241
+ icon: "Checkmark",
242
+ size: "xs",
243
+ thickness: "3.5"
244
+ })) : g("", !0)
245
+ ], 2),
246
+ a(" " + w(t.name), 1)
247
+ ])
248
+ ]),
249
+ _: 2
250
+ }, 1032, ["class", "onClick"]))), 128))
251
+ ])
252
+ ]),
253
+ _: 1
254
+ })) : g("", !0),
255
+ d(p, null, {
256
+ title: o(() => [...e[13] || (e[13] = [
257
+ a("Appearance", -1)
224
258
  ])]),
225
- description: s(() => [...e[12] || (e[12] = [
226
- l(" Choose between light, dark, or system-based appearance for your workspace. ", -1)
259
+ description: o(() => [...e[14] || (e[14] = [
260
+ a(" Choose between light, dark, or system-based appearance for your workspace. ", -1)
227
261
  ])]),
228
- default: s(() => [
229
- n(L, {
230
- colorMode: i.colorMode,
231
- "onUpdate:colorMode": e[2] || (e[2] = (t) => d("update:colorMode", t))
262
+ default: o(() => [
263
+ d(G, {
264
+ colorMode: l.colorMode,
265
+ "onUpdate:colorMode": e[2] || (e[2] = (t) => m("update:colorMode", t))
232
266
  }, null, 8, ["colorMode"])
233
267
  ]),
234
268
  _: 1
@@ -237,5 +271,5 @@ const N = { class: "flex flex-col gap-4" }, R = { class: "flex flex-col gap-2" }
237
271
  }
238
272
  });
239
273
  export {
240
- I as default
274
+ ne as default
241
275
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentSettings.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/settings/DocumentSettings.vue"],"names":[],"mappings":"AA0JA,KAAK,WAAW,GAAG;IACjB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,+CAA+C;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;AAuTF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"DocumentSettings.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/settings/DocumentSettings.vue"],"names":[],"mappings":"AA4JA,KAAK,WAAW,GAAG;IACjB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,+CAA+C;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;AAyTF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}