@scalar/api-reference 1.35.6 → 1.35.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReferenceWorkspace.vue.d.ts","sourceRoot":"","sources":["../../src/v2/ApiReferenceWorkspace.vue"],"names":[],"mappings":"AAmUA,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAyBpE,KAAK,WAAW,GAAG;IACjB,aAAa,CAAC,EAAE,4BAA4B,CAAA;IAC5C,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AA2SF,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AAC9G,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GACrD;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GACnD;IAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GACrD;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GACnD;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AA4B/C,QAAA,MAAM,eAAe;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ApiReferenceWorkspace.vue.d.ts","sourceRoot":"","sources":["../../src/v2/ApiReferenceWorkspace.vue"],"names":[],"mappings":"AAqVA,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAyBpE,KAAK,WAAW,GAAG;IACjB,aAAa,CAAC,EAAE,4BAA4B,CAAA;IAC5C,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AA6TF,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AAC9G,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GACrD;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GACnD;IAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GACrD;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GACnD;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AA4B/C,QAAA,MAAM,eAAe;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,20 +1,20 @@
1
- import { defineComponent as $, ref as d, toRef as R, provide as N, useTemplateRef as w, onBeforeMount as I, watch as l, computed as L, createElementBlock as V, openBlock as k, createBlock as A, createCommentVNode as B, createVNode as C, unref as n, resolveDynamicComponent as P, withCtx as s, createTextVNode as U, toDisplayString as _, renderSlot as i, isRef as K } from "vue";
2
- import { safeLocalStorage as F, REFERENCE_LS_KEYS as O } from "@scalar/helpers/object/local-storage";
3
- import { makeUrlAbsolute as W } from "@scalar/helpers/url/make-url-absolute";
4
- import { redirectToProxy as Y } from "@scalar/oas-utils/helpers";
5
- import { useColorMode as z } from "@scalar/use-hooks/useColorMode";
6
- import { useSeoMeta as H } from "@unhead/vue";
7
- import { useFavicon as j } from "@vueuse/core";
8
- import q from "../components/ApiReferenceLayout.vue.js";
9
- import { NAV_STATE_SYMBOL as G } from "../hooks/useNavState.js";
1
+ import { defineComponent as R, ref as d, toRef as I, provide as N, useTemplateRef as w, onBeforeMount as L, watch as i, computed as V, createElementBlock as A, openBlock as C, createBlock as B, createCommentVNode as P, createVNode as k, unref as n, resolveDynamicComponent as U, withCtx as s, createTextVNode as _, toDisplayString as K, renderSlot as l, isRef as F } from "vue";
2
+ import { safeLocalStorage as O, REFERENCE_LS_KEYS as W } from "@scalar/helpers/object/local-storage";
3
+ import { makeUrlAbsolute as Y } from "@scalar/helpers/url/make-url-absolute";
4
+ import { redirectToProxy as z } from "@scalar/oas-utils/helpers";
5
+ import { useColorMode as H } from "@scalar/use-hooks/useColorMode";
6
+ import { useSeoMeta as j } from "@unhead/vue";
7
+ import { useFavicon as q } from "@vueuse/core";
8
+ import G from "../components/ApiReferenceLayout.vue.js";
9
+ import { NAV_STATE_SYMBOL as J } from "../hooks/useNavState.js";
10
10
  import { isClient as D } from "./blocks/scalar-request-example-block/helpers/find-client.js";
11
- import { getDocumentName as J } from "./helpers/get-document-name.js";
11
+ import { getDocumentName as Q } from "./helpers/get-document-name.js";
12
12
  import { mapConfiguration as g } from "./helpers/map-configuration.js";
13
- import { normalizeContent as Q } from "./helpers/normalize-content.js";
14
- import { useWorkspaceStoreEvents as X } from "./hooks/use-workspace-store-events.js";
15
- import { useMultipleDocuments as Z } from "../features/multiple-documents/useMultipleDocuments.js";
16
- import ee from "../features/multiple-documents/DocumentSelector.vue.js";
17
- const Ce = /* @__PURE__ */ $({
13
+ import { normalizeContent as X } from "./helpers/normalize-content.js";
14
+ import { useWorkspaceStoreEvents as Z } from "./hooks/use-workspace-store-events.js";
15
+ import { useMultipleDocuments as ee } from "../features/multiple-documents/useMultipleDocuments.js";
16
+ import te from "../features/multiple-documents/DocumentSelector.vue.js";
17
+ const De = /* @__PURE__ */ R({
18
18
  __name: "ApiReferenceWorkspace",
19
19
  props: {
20
20
  configuration: {},
@@ -28,26 +28,26 @@ const Ce = /* @__PURE__ */ $({
28
28
  selectedDocumentIndex: u,
29
29
  isIntersectionEnabled: m,
30
30
  hash: M,
31
- hashPrefix: x
32
- } = Z({
33
- configuration: R(c, "configuration"),
31
+ hashPrefix: h
32
+ } = ee({
33
+ configuration: I(c, "configuration"),
34
34
  isIntersectionEnabled: d(!1),
35
35
  hash: d(""),
36
36
  hashPrefix: d("")
37
- }), y = (e, t) => fetch(
38
- Y(o.value.proxyUrl, e.toString()),
37
+ }), x = (e, t) => fetch(
38
+ z(o.value.proxyUrl, e.toString()),
39
39
  t
40
40
  );
41
- N(G, { isIntersectionEnabled: m, hash: M, hashPrefix: x });
41
+ N(J, { isIntersectionEnabled: m, hash: M, hashPrefix: h });
42
42
  const p = w("root"), r = c.store;
43
- I(() => {
44
- const e = F().getItem(
45
- O.SELECTED_CLIENT
43
+ L(() => {
44
+ const e = O().getItem(
45
+ W.SELECTED_CLIENT
46
46
  );
47
47
  D(e) && !r.workspace["x-scalar-default-client"] && r.update("x-scalar-default-client", e);
48
48
  });
49
- const S = async (e) => {
50
- const t = Q(e.content), a = J({
49
+ const y = async (e) => {
50
+ const t = X(e.content), a = Q({
51
51
  name: e.slug || e.title,
52
52
  url: e.url,
53
53
  document: t
@@ -67,24 +67,24 @@ const Ce = /* @__PURE__ */ $({
67
67
  if (e.url)
68
68
  return await r.addDocument({
69
69
  name: e.slug ?? "default",
70
- url: W(e.url, {
70
+ url: Y(e.url, {
71
71
  basePath: o.value.pathRouting?.basePath
72
72
  }),
73
- fetch: e.fetch ?? y,
73
+ fetch: e.fetch ?? x,
74
74
  config: g(e)
75
75
  });
76
76
  };
77
- l(
77
+ i(
78
78
  [
79
79
  () => o.value.slug,
80
80
  () => o.value.url,
81
81
  () => o.value.content
82
82
  ],
83
83
  ([e, t, a]) => {
84
- (e || t || a) && S(o.value);
84
+ (e || t || a) && y(o.value);
85
85
  },
86
86
  { immediate: !0 }
87
- ), X(r, p), l(
87
+ ), Z(r, p), i(
88
88
  () => o.value.defaultHttpClient,
89
89
  (e) => {
90
90
  if (e) {
@@ -94,64 +94,70 @@ const Ce = /* @__PURE__ */ $({
94
94
  },
95
95
  { immediate: !0 }
96
96
  );
97
- const { toggleColorMode: h, isDarkMode: b } = z({
98
- initialColorMode: o.value.darkMode ? "dark" : void 0,
97
+ function S(e) {
98
+ if (e === !0)
99
+ return "dark";
100
+ if (e === !1)
101
+ return "light";
102
+ }
103
+ const { toggleColorMode: b, isDarkMode: T } = H({
104
+ initialColorMode: S(o.value.darkMode),
99
105
  overrideColorMode: o.value.forceDarkModeState
100
106
  });
101
- l(
107
+ i(
102
108
  () => o.value.darkMode,
103
109
  (e) => r.update("x-scalar-dark-mode", !!e)
104
- ), l(
105
- () => b.value,
110
+ ), i(
111
+ () => T.value,
106
112
  (e) => r.update("x-scalar-dark-mode", e),
107
113
  { immediate: !0 }
108
- ), l(
114
+ ), i(
109
115
  () => u.value,
110
116
  (e) => r.update(
111
117
  "x-scalar-active-document",
112
118
  f.value[e]?.slug
113
119
  ),
114
120
  { immediate: !0 }
115
- ), o.value.metaData && H(o.value.metaData);
116
- const T = L(() => o.value.favicon);
117
- return j(T), (e, t) => (k(), V("div", {
121
+ ), o.value.metaData && j(o.value.metaData);
122
+ const $ = V(() => o.value.favicon);
123
+ return q($), (e, t) => (C(), A("div", {
118
124
  ref_key: "root",
119
125
  ref: p
120
126
  }, [
121
- n(o)?.customCss ? (k(), A(P("style"), { key: 0 }, {
127
+ n(o)?.customCss ? (C(), B(U("style"), { key: 0 }, {
122
128
  default: s(() => [
123
- U(_(n(o).customCss), 1)
129
+ _(K(n(o).customCss), 1)
124
130
  ]),
125
131
  _: 1
126
- })) : B("", !0),
127
- C(q, {
132
+ })) : P("", !0),
133
+ k(G, {
128
134
  configuration: n(o),
129
135
  isDark: !!n(r).workspace["x-scalar-dark-mode"],
130
136
  store: n(r),
131
- onToggleDarkMode: t[1] || (t[1] = () => n(h)()),
137
+ onToggleDarkMode: t[1] || (t[1] = () => n(b)()),
132
138
  onUpdateContent: t[2] || (t[2] = (a) => e.$emit("updateContent", a))
133
139
  }, {
134
140
  "document-selector": s(() => [
135
- C(n(ee), {
141
+ k(n(te), {
136
142
  modelValue: n(u),
137
- "onUpdate:modelValue": t[0] || (t[0] = (a) => K(u) ? u.value = a : null),
143
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => F(u) ? u.value = a : null),
138
144
  options: n(f)
139
145
  }, null, 8, ["modelValue", "options"])
140
146
  ]),
141
147
  "content-start": s(() => [
142
- i(e.$slots, "content-start")
148
+ l(e.$slots, "content-start")
143
149
  ]),
144
150
  "content-end": s(() => [
145
- i(e.$slots, "content-end")
151
+ l(e.$slots, "content-end")
146
152
  ]),
147
153
  "sidebar-start": s(() => [
148
- i(e.$slots, "sidebar-start")
154
+ l(e.$slots, "sidebar-start")
149
155
  ]),
150
156
  "sidebar-end": s(() => [
151
- i(e.$slots, "sidebar-end")
157
+ l(e.$slots, "sidebar-end")
152
158
  ]),
153
159
  footer: s(() => [
154
- i(e.$slots, "footer")
160
+ l(e.$slots, "footer")
155
161
  ]),
156
162
  _: 3
157
163
  }, 8, ["configuration", "isDark", "store"])
@@ -159,5 +165,5 @@ const Ce = /* @__PURE__ */ $({
159
165
  }
160
166
  });
161
167
  export {
162
- Ce as default
168
+ De as default
163
169
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-info-block/components/DownloadLink.vue"],"names":[],"mappings":"AAwLA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB,EAAE,MAAM,MAAM,CAAA;CAClC,CAAC;;AAmJF,wBAMG"}
1
+ {"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-info-block/components/DownloadLink.vue"],"names":[],"mappings":"AAsNA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB,EAAE,MAAM,MAAM,CAAA;CAClC,CAAC;;AA2KF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./DownloadLink.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a50cf117"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0adf68b9"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,59 +1,68 @@
1
- import { defineComponent as D, computed as b, createElementBlock as t, createCommentVNode as l, unref as e, openBlock as d, normalizeClass as v, withModifiers as i, createElementVNode as m, createVNode as s, withCtx as p, createTextVNode as w } from "vue";
2
- import k from "github-slugger";
1
+ import { defineComponent as g, computed as k, createElementBlock as t, createCommentVNode as r, unref as n, openBlock as l, normalizeClass as b, withModifiers as u, createElementVNode as m, createVNode as p, withCtx as w, createTextVNode as c, Fragment as v } from "vue";
2
+ import C from "github-slugger";
3
3
  import f from "../../../../components/Badge/Badge.vue.js";
4
4
  import { useConfig as x } from "../../../../hooks/useConfig.js";
5
- import { downloadDocument as C } from "../../../../libs/download.js";
6
- const B = /* @__PURE__ */ D({
5
+ import { downloadDocument as T } from "../../../../libs/download.js";
6
+ const O = ["href"], V = /* @__PURE__ */ g({
7
7
  __name: "DownloadLink",
8
8
  props: {
9
9
  title: {},
10
10
  getOriginalDocument: { type: Function }
11
11
  },
12
- setup(r) {
13
- const n = x(), g = new k(), c = b(() => g.slug(r.title ?? "")), u = (a) => {
14
- C(r.getOriginalDocument(), c.value, a);
12
+ setup(a) {
13
+ const e = x(), y = new C(), D = k(() => y.slug(a.title ?? "")), d = (s) => {
14
+ T(a.getOriginalDocument(), D.value, s);
15
15
  };
16
- return (a, o) => e(n)?.documentDownloadType !== "none" ? (d(), t("div", {
16
+ return (s, o) => ["yaml", "json", "both"].includes(n(e)?.documentDownloadType) ? (l(), t("div", {
17
17
  key: 0,
18
- class: v(["download-container group", {
19
- "download-both": e(n)?.documentDownloadType === "both"
18
+ class: b(["download-container group", {
19
+ "download-both": n(e)?.documentDownloadType === "both"
20
20
  }])
21
21
  }, [
22
- e(n)?.documentDownloadType === "json" || e(n)?.documentDownloadType === "both" ? (d(), t("button", {
22
+ n(e)?.documentDownloadType === "json" || n(e)?.documentDownloadType === "both" ? (l(), t("button", {
23
23
  key: 0,
24
24
  class: "download-button",
25
25
  type: "button",
26
- variant: "ghost",
27
- onClick: o[0] || (o[0] = i((y) => u("json"), ["prevent"]))
26
+ onClick: o[0] || (o[0] = u((i) => d("json"), ["prevent"]))
28
27
  }, [
29
- o[3] || (o[3] = m("span", null, " Download OpenAPI Document ", -1)),
30
- s(f, { class: "extension hidden group-hover:flex" }, {
31
- default: p(() => o[2] || (o[2] = [
32
- w("json")
28
+ o[4] || (o[4] = m("span", null, " Download OpenAPI Document ", -1)),
29
+ p(f, { class: "extension hidden group-hover:flex" }, {
30
+ default: w(() => o[3] || (o[3] = [
31
+ c("json")
33
32
  ])),
34
33
  _: 1,
35
- __: [2]
34
+ __: [3]
36
35
  })
37
- ])) : l("", !0),
38
- e(n)?.documentDownloadType === "yaml" || e(n)?.documentDownloadType === "both" ? (d(), t("button", {
36
+ ])) : r("", !0),
37
+ n(e)?.documentDownloadType === "yaml" || n(e)?.documentDownloadType === "both" ? (l(), t("button", {
39
38
  key: 1,
40
39
  class: "download-button",
41
40
  type: "button",
42
- variant: "ghost",
43
- onClick: o[1] || (o[1] = i((y) => u("yaml"), ["prevent"]))
41
+ onClick: o[1] || (o[1] = u((i) => d("yaml"), ["prevent"]))
44
42
  }, [
45
- o[5] || (o[5] = m("span", null, " Download OpenAPI Document ", -1)),
46
- s(f, { class: "extension hidden group-hover:flex" }, {
47
- default: p(() => o[4] || (o[4] = [
48
- w("yaml")
43
+ o[6] || (o[6] = m("span", null, " Download OpenAPI Document ", -1)),
44
+ p(f, { class: "extension hidden group-hover:flex" }, {
45
+ default: w(() => o[5] || (o[5] = [
46
+ c("yaml")
49
47
  ])),
50
48
  _: 1,
51
- __: [4]
49
+ __: [5]
52
50
  })
53
- ])) : l("", !0)
54
- ], 2)) : l("", !0);
51
+ ])) : r("", !0)
52
+ ], 2)) : n(e)?.documentDownloadType === "direct" ? (l(), t(v, { key: 1 }, [
53
+ n(e).url ? (l(), t("a", {
54
+ key: 0,
55
+ class: "download-link",
56
+ href: n(e).url
57
+ }, " Download OpenAPI Document ", 8, O)) : (l(), t("a", {
58
+ key: 1,
59
+ class: "download-link",
60
+ href: "#",
61
+ onClick: o[2] || (o[2] = u((i) => d("json"), ["prevent"]))
62
+ }, " Download OpenAPI Document "))
63
+ ], 64)) : r("", !0);
55
64
  }
56
65
  });
57
66
  export {
58
- B as default
67
+ V as default
59
68
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/components/RequestExample.vue"],"names":[],"mappings":"AAicA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAGrF,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,kBAAkB,CAAA;AAGvE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AASrE,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gDAAgD,CAAA;AAKvD,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACzC;;OAEG;IACH,cAAc,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACzC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;IACxC;;OAEG;IACH,MAAM,EAAE,cAAc,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,EAAE,eAAe,CAAA;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAA;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;;;;GAQG;;YAkBO,MAAM,OAAO;YACb,MAAM,OAAO;;AAlBvB,wBAkiBC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"RequestExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/components/RequestExample.vue"],"names":[],"mappings":"AAqcA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAGrF,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,kBAAkB,CAAA;AAGvE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AASrE,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gDAAgD,CAAA;AAKvD,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACzC;;OAEG;IACH,cAAc,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACzC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;IACxC;;OAEG;IACH,MAAM,EAAE,cAAc,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,EAAE,eAAe,CAAA;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAA;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;;;;GAQG;;YAkBO,MAAM,OAAO;YACb,MAAM,OAAO;;AAlBvB,wBAuiBC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestExample.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3d7424c4"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8b2bccdf"]]);
5
5
  export {
6
6
  r as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as D, computed as u, ref as k, watch as H, useId as I, createBlock as g, createCommentVNode as v, openBlock as d, unref as o, withCtx as s, createVNode as n, createSlots as N, createElementVNode as h, createElementBlock as S, renderSlot as y, toDisplayString as z } from "vue";
1
+ import { defineComponent as D, computed as u, ref as k, watch as H, useId as I, createBlock as h, createCommentVNode as m, openBlock as i, unref as o, withCtx as n, createVNode as s, createSlots as N, createElementVNode as y, createElementBlock as S, renderSlot as C, toDisplayString as z } from "vue";
2
2
  import { ScalarCard as E, ScalarCardHeader as K, ScalarCombobox as M, ScalarButton as F, ScalarCardSection as q, ScalarCodeBlock as U, ScalarCardFooter as A } from "@scalar/components";
3
3
  import { freezeElement as G } from "@scalar/helpers/dom/freeze-element";
4
4
  import { ScalarIconCaretDown as J } from "@scalar/icons";
@@ -6,12 +6,12 @@ import { operationToHar as P } from "@scalar/oas-utils/helpers/operation-to-har"
6
6
  import { emitCustomEvent as T } from "@scalar/workspace-store/events";
7
7
  import { getResolvedRef as Q } from "@scalar/workspace-store/helpers/get-resolved-ref";
8
8
  import { getResolvedRefDeep as $ } from "../../../../features/example-responses/helpers/get-resolved-ref-deep.js";
9
- import { findClient as B } from "../helpers/find-client.js";
10
- import { generateCustomId as V } from "../helpers/generate-client-options.js";
9
+ import { findClient as j } from "../helpers/find-client.js";
10
+ import { generateCustomId as B } from "../helpers/generate-client-options.js";
11
11
  import { generateCodeSnippet as X } from "../helpers/generate-code-snippet.js";
12
12
  import { getSecrets as Y } from "../helpers/get-secrets.js";
13
13
  import Z from "./ExamplePicker.vue2.js";
14
- import W from "../../../../components/HttpMethod/HttpMethod.vue.js";
14
+ import V from "../../../../components/HttpMethod/HttpMethod.vue.js";
15
15
  const _ = ["innerHTML"], ee = { class: "text-base font-normal" }, te = ["id"], le = {
16
16
  key: 0,
17
17
  class: "request-card-footer-addon"
@@ -36,40 +36,40 @@ const _ = ["innerHTML"], ee = { class: "text-base font-normal" }, te = ["id"], l
36
36
  const c = u(() => {
37
37
  const e = Q(l.operation.requestBody)?.content ?? {}, t = l.selectedContentType || Object.keys(e)[0];
38
38
  return e[t]?.examples ?? {};
39
- }), m = k(
39
+ }), f = k(
40
40
  l.selectedExample ?? Object.keys(c.value)[0]
41
- ), C = u(() => [
41
+ ), b = u(() => [
42
42
  "x-custom-examples",
43
43
  "x-codeSamples",
44
44
  "x-code-samples"
45
- ].flatMap((t) => l.operation[t] ?? [])), f = u(() => C.value.length ? [
45
+ ].flatMap((t) => l.operation[t] ?? [])), p = u(() => b.value.length ? [
46
46
  {
47
47
  label: "Code Examples",
48
- options: C.value.map((t) => {
49
- const a = V(t), p = t.label || t.lang || a;
48
+ options: b.value.map((t) => {
49
+ const a = B(t), v = t.label || t.lang || a;
50
50
  return {
51
51
  id: a,
52
52
  lang: t.lang || "plaintext",
53
- title: p,
54
- label: p
53
+ title: v,
54
+ label: v
55
55
  };
56
56
  })
57
57
  },
58
58
  ...l.clientOptions
59
59
  ] : l.clientOptions), r = k(
60
- B(f.value, l.selectedClient) ?? null
60
+ j(p.value, l.selectedClient) ?? null
61
61
  );
62
62
  H(
63
63
  () => l.selectedClient,
64
64
  (e) => {
65
- const t = B(f.value, e);
65
+ const t = j(p.value, e);
66
66
  t && (r.value = t);
67
67
  }
68
68
  );
69
- const b = u(() => {
69
+ const g = u(() => {
70
70
  if (!l.isWebhook) return null;
71
71
  try {
72
- const e = c.value[m.value || ""], t = $(e), a = t?.value ?? t?.summary;
72
+ const e = c.value[f.value || ""], t = $(e), a = t?.value ?? t?.summary;
73
73
  return P({ operation: l.operation, method: l.method, path: l.path, example: a });
74
74
  } catch (e) {
75
75
  return console.error("[webhookHar]", e), null;
@@ -77,11 +77,11 @@ const _ = ["innerHTML"], ee = { class: "text-base font-normal" }, te = ["id"], l
77
77
  }), x = u(() => {
78
78
  try {
79
79
  if (r.value?.id.startsWith("custom"))
80
- return C.value.find(
81
- (p) => V(p) === r.value?.id
80
+ return b.value.find(
81
+ (v) => B(v) === r.value?.id
82
82
  )?.source ?? "Custom example not found";
83
- const e = c.value[m.value || ""], t = $(e), a = t?.value ?? t?.summary;
84
- return l.isWebhook ? b.value?.postData?.text ?? "" : X({
83
+ const e = c.value[f.value || ""], t = $(e), a = t?.value ?? t?.summary;
84
+ return l.isWebhook ? g.value?.postData?.text ?? "" : X({
85
85
  clientId: r.value?.id,
86
86
  operation: l.operation,
87
87
  method: l.method,
@@ -94,62 +94,63 @@ const _ = ["innerHTML"], ee = { class: "text-base font-normal" }, te = ["id"], l
94
94
  } catch (e) {
95
95
  return console.error("[generateSnippet]", e), "";
96
96
  }
97
- }), j = u(() => l.isWebhook ? w.value : r.value?.lang), w = u(() => {
98
- if (!b.value?.postData) return "json";
99
- const e = b.value.postData.mimeType;
97
+ }), w = u(() => l.isWebhook ? O.value : r.value?.lang), O = u(() => {
98
+ if (!g.value?.postData) return "json";
99
+ const e = g.value.postData.mimeType;
100
100
  return e?.includes("json") ? "json" : e?.includes("xml") ? "xml" : e?.includes("yaml") || e?.includes("yml") ? "yaml" : e?.includes("text/plain") ? "text" : "json";
101
- }), L = u(() => Y(l.securitySchemes)), i = k(null), O = (e) => {
102
- if (i.value) {
103
- const t = G(i.value.$el);
101
+ }), W = u(() => Y(l.securitySchemes)), d = k(null), L = (e) => {
102
+ if (d.value) {
103
+ const t = G(d.value.$el);
104
104
  setTimeout(() => {
105
105
  t();
106
106
  }, 300);
107
107
  }
108
- r.value = e, e.id.startsWith("custom") || T(i.value?.$el, "scalar-update-selected-client", e.id);
108
+ r.value = e, e.id.startsWith("custom") || T(d.value?.$el, "scalar-update-selected-client", e.id);
109
109
  }, R = I();
110
- return (e, t) => x.value ? (d(), g(o(E), {
110
+ return (e, t) => x.value ? (i(), h(o(E), {
111
111
  key: 0,
112
112
  ref_key: "elem",
113
- ref: i,
113
+ ref: d,
114
114
  class: "request-card dark-mode"
115
115
  }, {
116
- default: s(() => [
117
- n(o(K), { class: "pr-2.5" }, N({
118
- default: s(() => [
119
- t[3] || (t[3] = h("span", { class: "sr-only" }, "Request Example for", -1)),
120
- n(o(W), {
116
+ default: n(() => [
117
+ s(o(K), { class: "pr-2.5" }, N({
118
+ default: n(() => [
119
+ t[3] || (t[3] = y("span", { class: "sr-only" }, "Request Example for", -1)),
120
+ s(o(V), {
121
121
  as: "span",
122
122
  class: "request-method",
123
123
  method: e.method
124
124
  }, null, 8, ["method"]),
125
- e.generateLabel ? (d(), S("span", {
125
+ e.generateLabel ? (i(), S("span", {
126
126
  key: 0,
127
127
  innerHTML: e.generateLabel()
128
- }, null, 8, _)) : e.isWebhook ? v("", !0) : y(e.$slots, "header", { key: 1 }, void 0, !0)
128
+ }, null, 8, _)) : m("", !0),
129
+ C(e.$slots, "header", {}, void 0, !0)
129
130
  ]),
130
131
  _: 2
131
132
  }, [
132
- !e.isWebhook && f.value.length ? {
133
+ !e.isWebhook && p.value.length ? {
133
134
  name: "actions",
134
- fn: s(() => [
135
- n(o(M), {
135
+ fn: n(() => [
136
+ s(o(M), {
136
137
  class: "max-h-80",
137
138
  modelValue: r.value,
138
- options: f.value,
139
+ options: p.value,
139
140
  placement: "bottom-end",
140
141
  teleport: "",
141
- "onUpdate:modelValue": t[0] || (t[0] = (a) => O(a))
142
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => L(a))
142
143
  }, {
143
- default: s(() => [
144
- n(o(F), {
144
+ default: n(() => [
145
+ s(o(F), {
145
146
  class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5",
146
147
  "data-testid": "client-picker",
147
148
  fullWidth: "",
148
149
  variant: "ghost"
149
150
  }, {
150
- default: s(() => [
151
- h("span", ee, z(r.value.title), 1),
152
- n(o(J), {
151
+ default: n(() => [
152
+ y("span", ee, z(r.value.title), 1),
153
+ s(o(J), {
153
154
  class: "ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100",
154
155
  weight: "bold"
155
156
  })
@@ -163,66 +164,71 @@ const _ = ["innerHTML"], ee = { class: "text-base font-normal" }, te = ["id"], l
163
164
  key: "0"
164
165
  } : void 0
165
166
  ]), 1024),
166
- n(o(q), { class: "request-editor-section custom-scroll p-0" }, {
167
- default: s(() => [
168
- h("div", {
167
+ s(o(q), { class: "request-editor-section custom-scroll p-0" }, {
168
+ default: n(() => [
169
+ y("div", {
169
170
  id: `${o(R)}-example`,
170
171
  class: "code-snippet"
171
172
  }, [
172
- n(o(U), {
173
+ s(o(U), {
173
174
  class: "bg-b-2 !min-h-full -outline-offset-2",
174
175
  content: x.value,
175
- hideCredentials: L.value,
176
- lang: j.value,
176
+ hideCredentials: W.value,
177
+ lang: w.value,
177
178
  lineNumbers: ""
178
179
  }, null, 8, ["content", "hideCredentials", "lang"])
179
180
  ], 8, te)
180
181
  ]),
181
182
  _: 1
182
183
  }),
183
- Object.keys(c.value).length || e.$slots.footer ? (d(), g(o(A), {
184
+ Object.keys(c.value).length > 1 || e.$slots.footer ? (i(), h(o(A), {
184
185
  key: 0,
185
186
  class: "request-card-footer bg-b-3"
186
187
  }, {
187
- default: s(() => [
188
- Object.keys(c.value).length ? (d(), S("div", le, [
189
- n(Z, {
190
- modelValue: m.value,
188
+ default: n(() => [
189
+ Object.keys(c.value).length > 1 ? (i(), S("div", le, [
190
+ Object.keys(c.value).length ? (i(), h(Z, {
191
+ key: 0,
192
+ modelValue: f.value,
191
193
  "onUpdate:modelValue": [
192
- t[1] || (t[1] = (a) => m.value = a),
193
- t[2] || (t[2] = (a) => o(T)(i.value?.$el, "scalar-update-selected-example", a))
194
+ t[1] || (t[1] = (a) => f.value = a),
195
+ t[2] || (t[2] = (a) => o(T)(
196
+ d.value?.$el,
197
+ "scalar-update-selected-example",
198
+ a
199
+ ))
194
200
  ],
195
201
  examples: c.value
196
- }, null, 8, ["modelValue", "examples"])
197
- ])) : v("", !0),
198
- y(e.$slots, "footer", {}, void 0, !0)
202
+ }, null, 8, ["modelValue", "examples"])) : m("", !0)
203
+ ])) : m("", !0),
204
+ C(e.$slots, "footer", {}, void 0, !0)
199
205
  ]),
200
206
  _: 3
201
- })) : v("", !0)
207
+ })) : m("", !0)
202
208
  ]),
203
209
  _: 3
204
- }, 512)) : e.fallback ? (d(), g(o(E), {
210
+ }, 512)) : e.fallback ? (i(), h(o(E), {
205
211
  key: 1,
206
212
  class: "request-card dark-mode"
207
213
  }, {
208
- default: s(() => [
209
- n(o(q), { class: "request-card-simple" }, {
210
- default: s(() => [
211
- h("div", oe, [
212
- n(o(W), {
214
+ default: n(() => [
215
+ s(o(q), { class: "request-card-simple" }, {
216
+ default: n(() => [
217
+ y("div", oe, [
218
+ s(o(V), {
213
219
  as: "span",
214
220
  class: "request-method",
215
221
  method: e.method
216
222
  }, null, 8, ["method"]),
217
- y(e.$slots, "header", {}, void 0, !0)
223
+ C(e.$slots, "header", {}, void 0, !0)
218
224
  ]),
219
- y(e.$slots, "footer", {}, void 0, !0)
225
+ C(e.$slots, "footer", {}, void 0, !0)
220
226
  ]),
221
227
  _: 3
222
228
  })
223
229
  ]),
224
230
  _: 3
225
- })) : v("", !0);
231
+ })) : m("", !0);
226
232
  }
227
233
  });
228
234
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"map-configuration.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/map-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AAG9D;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,OAAO,CAAC,yBAAyB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAiDqh3C,CAAC;;;gBAAyH,CAAC;;;;;mBAAsS,CAAC;uBAAyC,CAAC;;;gBAA1N,CAAC;;;;kBAA4W,CAAC;;;CAD/r4C,CAAA"}
1
+ {"version":3,"file":"map-configuration.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/map-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AAG9D;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,OAAO,CAAC,yBAAyB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAiD0i3C,CAAC;;;gBAAyH,CAAC;;;;;mBAAsS,CAAC;uBAAyC,CAAC;;;gBAA1N,CAAC;;;;kBAA4W,CAAC;;;CADpt4C,CAAA"}