@scalar/api-reference 1.43.16 → 1.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/browser/standalone.js +17371 -15650
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/AgentChat.vue.d.ts +9 -0
  5. package/dist/components/AgentChat.vue.d.ts.map +1 -0
  6. package/dist/components/AgentChat.vue.js +4 -0
  7. package/dist/components/AgentChat.vue2.js +26 -0
  8. package/dist/components/ApiReference.vue.d.ts +1 -0
  9. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  10. package/dist/components/ApiReference.vue.js +1 -1
  11. package/dist/components/ApiReference.vue2.js +83 -26
  12. package/dist/components/LinkList/LinkList.vue.js +1 -1
  13. package/dist/components/LinkList/LinkList.vue2.js +1 -1
  14. package/dist/components/MobileHeader.vue.d.ts.map +1 -1
  15. package/dist/components/MobileHeader.vue.js +6 -4
  16. package/dist/consts/urls.d.ts +7 -11
  17. package/dist/consts/urls.d.ts.map +1 -1
  18. package/dist/consts/urls.js +9 -3
  19. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
  20. package/dist/features/Operation/components/ContentTypeSelect.vue.js +14 -12
  21. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  22. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  23. package/dist/features/Operation/components/ParameterListItem.vue2.js +4 -4
  24. package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
  25. package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
  26. package/dist/features/example-responses/ExampleResponses.vue2.js +7 -12
  27. package/dist/features/multiple-documents/DocumentSelector.vue.d.ts.map +1 -1
  28. package/dist/features/multiple-documents/DocumentSelector.vue.js +11 -8
  29. package/dist/features/toolbar/ApiReferenceToolbar.vue.d.ts.map +1 -1
  30. package/dist/features/toolbar/ApiReferenceToolbar.vue.js +1 -1
  31. package/dist/features/toolbar/ApiReferenceToolbarPopover.vue.js +1 -1
  32. package/dist/features/toolbar/ApiReferenceToolbarTitle.vue.d.ts.map +1 -1
  33. package/dist/features/toolbar/ApiReferenceToolbarTitle.vue.js +3 -3
  34. package/dist/helpers/normalize-configurations.d.ts +2 -1
  35. package/dist/helpers/normalize-configurations.d.ts.map +1 -1
  36. package/dist/helpers/normalize-configurations.js +1 -0
  37. package/dist/style.css +407 -204
  38. package/package.json +15 -14
@@ -0,0 +1,9 @@
1
+ import { type ApiReferenceConfigurationWithSource } from '@scalar/types/api-reference';
2
+ import type { WorkspaceStore } from '@scalar/workspace-store/client';
3
+ type __VLS_Props = {
4
+ agentConfig: ApiReferenceConfigurationWithSource['agent'];
5
+ workspaceStore: WorkspaceStore;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ export default _default;
9
+ //# sourceMappingURL=AgentChat.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentChat.vue.d.ts","sourceRoot":"","sources":["../../src/components/AgentChat.vue"],"names":[],"mappings":"AA0BA,OAAO,EAAE,KAAK,mCAAmC,EAAE,MAAM,6BAA6B,CAAA;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAIpE,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,mCAAmC,CAAC,OAAO,CAAC,CAAA;IACzD,cAAc,EAAE,cAAc,CAAA;CAC/B,CAAC;;AAyDF,wBAMG"}
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./AgentChat.vue2.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,26 @@
1
+ import { defineComponent, createBlock, openBlock, unref } from "vue";
2
+ import { Chat } from "@scalar/agent-chat";
3
+ import { REGISTRY_URL, DASHBOARD_URL, API_BASE_URL } from "../consts/urls.js";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "AgentChat",
6
+ props: {
7
+ agentConfig: {},
8
+ workspaceStore: {}
9
+ },
10
+ setup(__props) {
11
+ return (_ctx, _cache) => {
12
+ return openBlock(), createBlock(unref(Chat), {
13
+ baseUrl: unref(API_BASE_URL),
14
+ dashboardUrl: unref(DASHBOARD_URL),
15
+ getActiveDocumentJson: () => __props.workspaceStore.exportActiveDocument("json"),
16
+ getAgentKey: __props.agentConfig?.key ? () => __props.agentConfig?.key : void 0,
17
+ mode: __props.agentConfig?.key ? "full" : "preview",
18
+ registryDocuments: [],
19
+ registryUrl: unref(REGISTRY_URL)
20
+ }, null, 8, ["baseUrl", "dashboardUrl", "getActiveDocumentJson", "getAgentKey", "mode", "registryUrl"]);
21
+ };
22
+ }
23
+ });
24
+ export {
25
+ _sfc_main as default
26
+ };
@@ -1,4 +1,5 @@
1
1
  import { type AnyApiReferenceConfiguration } from '@scalar/types/api-reference';
2
+ import '@scalar/agent-chat/style.css';
2
3
  type __VLS_Props = {
3
4
  /**
4
5
  * Configuration for the API reference.
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"AAuoCA,OAAO,EAEL,KAAK,4BAA4B,EAGlC,MAAM,6BAA6B,CAAA;AAqDpC,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,4BAA4B,CAAA;CAC7C,CAAC;AAGF,KAAK,WAAW,GAAG;IACjB,eAAe,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,aAAa,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,eAAe,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,aAAa,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,oBAAoB,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/C,MAAM,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;CAClC,CAAC;AA2rCF,QAAA,MAAM,eAAe;;;oPAOnB,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":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"AAqyCA,OAAO,EAEL,KAAK,4BAA4B,EAGlC,MAAM,6BAA6B,CAAA;AA0BpC,OAAO,8BAA8B,CAAA;AAiCrC,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,4BAA4B,CAAA;CAC7C,CAAC;AAGF,KAAK,WAAW,GAAG;IACjB,eAAe,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,aAAa,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,eAAe,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,aAAa,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,oBAAoB,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/C,MAAM,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;CAClC,CAAC;AAu0CF,QAAA,MAAM,eAAe;;;oPAOnB,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"}
@@ -4,7 +4,7 @@ import _sfc_main from "./ApiReference.vue2.js";
4
4
  /* empty css */
5
5
  /* empty css */
6
6
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
7
- const ApiReference = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-097f69f2"]]);
7
+ const ApiReference = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1d883a00"]]);
8
8
  export {
9
9
  ApiReference as default
10
10
  };
@@ -1,10 +1,11 @@
1
- import { defineComponent, computed, ref, watch, useId, provide, onServerPrefetch, onBeforeMount, useTemplateRef, onMounted, onBeforeUnmount, createElementBlock, openBlock, createBlock, createElementVNode, createVNode, resolveDynamicComponent, withCtx, createTextVNode, toDisplayString, normalizeClass, createCommentVNode, unref, renderSlot, normalizeProps, guardReactiveProps, createSlots } from "vue";
1
+ import { defineComponent, computed, ref, watch, useId, provide, onServerPrefetch, onBeforeMount, useTemplateRef, onMounted, onBeforeUnmount, defineAsyncComponent, createElementBlock, openBlock, createBlock, createElementVNode, createVNode, resolveDynamicComponent, withCtx, createTextVNode, toDisplayString, normalizeClass, withDirectives, createCommentVNode, unref, vShow, renderSlot, normalizeProps, guardReactiveProps, createSlots } from "vue";
2
2
  import { provideUseId } from "@headlessui/vue";
3
3
  import { OpenApiClientButton } from "@scalar/api-client/components";
4
4
  import { createApiClientModal } from "@scalar/api-client/v2/features/modal";
5
5
  import { getActiveEnvironment } from "@scalar/api-client/v2/helpers";
6
6
  import { addScalarClassesToHeadless, ScalarSidebarFooter, ScalarColorModeToggleButton, ScalarColorModeToggleIcon } from "@scalar/components";
7
7
  import { redirectToProxy } from "@scalar/helpers/url/redirect-to-proxy";
8
+ import { ScalarIconX, ScalarIconSparkle } from "@scalar/icons";
8
9
  import { createSidebarState, ScalarSidebar } from "@scalar/sidebar";
9
10
  import { hasObtrusiveScrollbars, getThemeStyles } from "@scalar/themes";
10
11
  import { apiReferenceConfigurationSchema } from "@scalar/types/api-reference";
@@ -15,6 +16,9 @@ import { ScalarToasts } from "@scalar/use-toasts";
15
16
  import { createWorkspaceStore } from "@scalar/workspace-store/client";
16
17
  import { createWorkspaceEventBus } from "@scalar/workspace-store/events";
17
18
  import diff from "microdiff";
19
+ import "@scalar/agent-chat/style.css";
20
+ import { isLocalUrl } from "@scalar/helpers/url/is-local-url";
21
+ import { useScrollLock } from "@vueuse/core";
18
22
  import ClassicHeader from "./ClassicHeader.vue.js";
19
23
  import _sfc_main$4 from "./Content/Content.vue.js";
20
24
  /* empty css */
@@ -36,13 +40,18 @@ import { PLUGIN_MANAGER_SYMBOL } from "../plugins/hooks/usePluginManager.js";
36
40
  import { createPluginManager } from "../plugins/plugin-manager.js";
37
41
  const _hoisted_1 = {
38
42
  key: 1,
39
- class: "flex flex-col p-3 pt-1.5"
43
+ class: "agent-scalar"
40
44
  };
41
- const _hoisted_2 = { key: 1 };
42
- const _hoisted_3 = ["aria-label"];
43
- const _hoisted_4 = { class: "w-64 *:!p-0 empty:hidden" };
44
- const _hoisted_5 = {
45
+ const _hoisted_2 = { class: "agent-scalar-container custom-scroll custom-scroll-self-contain-overflow" };
46
+ const _hoisted_3 = {
45
47
  key: 1,
48
+ class: "flex gap-1.5 p-3 pt-1.5"
49
+ };
50
+ const _hoisted_4 = { key: 1 };
51
+ const _hoisted_5 = ["aria-label"];
52
+ const _hoisted_6 = { class: "w-64 empty:hidden" };
53
+ const _hoisted_7 = {
54
+ key: 3,
46
55
  class: "references-footer"
47
56
  };
48
57
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -173,13 +182,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
173
182
  });
174
183
  const itemsFromWorkspace = computed(() => {
175
184
  return Object.entries(workspaceStore.workspace.documents).map(
176
- ([slug, document]) => ({
185
+ ([slug, document2]) => ({
177
186
  id: slug,
178
187
  type: "document",
179
- description: document.info.description,
180
- name: document.info.title ?? slug,
181
- title: document.info.title ?? slug,
182
- children: document?.["x-scalar-navigation"]?.children ?? []
188
+ description: document2.info.description,
189
+ name: document2.info.title ?? slug,
190
+ title: document2.info.title ?? slug,
191
+ children: document2?.["x-scalar-navigation"]?.children ?? []
183
192
  })
184
193
  );
185
194
  });
@@ -372,6 +381,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
372
381
  const documentUrl = computed(() => {
373
382
  return configList.value[activeSlug.value]?.source?.url;
374
383
  });
384
+ const showAgent = ref(false);
385
+ const agentEnabled = computed(() => {
386
+ if (isLocalUrl(window.location.href)) {
387
+ return true;
388
+ }
389
+ return Boolean(configList.value[activeSlug.value]?.agent);
390
+ });
375
391
  const modal = useTemplateRef("modal");
376
392
  const apiClient = ref(null);
377
393
  onMounted(() => {
@@ -408,12 +424,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
408
424
  downloadDocument(result, activeSlug.value ?? "openapi");
409
425
  return;
410
426
  }
411
- const document = workspaceStore.exportActiveDocument(format);
412
- if (!document) {
427
+ const document2 = workspaceStore.exportActiveDocument(format);
428
+ if (!document2) {
413
429
  console.error("No document found to download");
414
430
  return;
415
431
  }
416
- downloadDocument(document, activeSlug.value ?? "openapi", format);
432
+ downloadDocument(document2, activeSlug.value ?? "openapi", format);
417
433
  });
418
434
  const handleSelectItem = (id, caller) => {
419
435
  const item = sidebarState.getEntryById(id);
@@ -487,6 +503,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
487
503
  }
488
504
  return mode;
489
505
  });
506
+ const AgentChat = defineAsyncComponent(async () => import("./AgentChat.vue.js"));
507
+ const bodyScrollLocked = useScrollLock(document.body);
508
+ watch(showAgent, () => {
509
+ bodyScrollLocked.value = showAgent.value;
510
+ });
490
511
  return (_ctx, _cache) => {
491
512
  return openBlock(), createElementBlock("div", null, [
492
513
  (openBlock(), createBlock(resolveDynamicComponent("style"), null, {
@@ -509,12 +530,38 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
509
530
  _ctx.$attrs.class
510
531
  ]])
511
532
  }, [
512
- mergedConfig.value.layout === "modern" ? (openBlock(), createBlock(_sfc_main$1, {
533
+ agentEnabled.value ? withDirectives((openBlock(), createElementBlock("div", {
513
534
  key: 0,
535
+ class: normalizeClass(["scalar-app-exit", showAgent.value ? "scalar-app-exit-animation" : ""]),
536
+ onClick: _cache[1] || (_cache[1] = ($event) => showAgent.value = false)
537
+ }, [
538
+ createElementVNode("button", {
539
+ class: "app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2",
540
+ type: "button",
541
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(eventBus).emit("ui:close:client-modal"))
542
+ }, [
543
+ createVNode(unref(ScalarIconX), { weight: "bold" }),
544
+ _cache[8] || (_cache[8] = createElementVNode("span", { class: "sr-only" }, "Close Client", -1))
545
+ ])
546
+ ], 2)), [
547
+ [vShow, showAgent.value && agentEnabled.value]
548
+ ]) : createCommentVNode("", true),
549
+ agentEnabled.value ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
550
+ createElementVNode("div", _hoisted_2, [
551
+ createVNode(unref(AgentChat), {
552
+ agentConfig: configList.value[activeSlug.value]?.agent,
553
+ workspaceStore: unref(workspaceStore)
554
+ }, null, 8, ["agentConfig", "workspaceStore"])
555
+ ])
556
+ ], 512)), [
557
+ [vShow, showAgent.value && agentEnabled.value]
558
+ ]) : createCommentVNode("", true),
559
+ mergedConfig.value.layout === "modern" ? (openBlock(), createBlock(_sfc_main$1, {
560
+ key: 2,
514
561
  breadcrumb: breadcrumb.value,
515
562
  isSidebarOpen: isSidebarOpen.value,
516
563
  showSidebar: mergedConfig.value.showSidebar,
517
- onToggleSidebar: _cache[2] || (_cache[2] = () => isSidebarOpen.value = !isSidebarOpen.value)
564
+ onToggleSidebar: _cache[5] || (_cache[5] = () => isSidebarOpen.value = !isSidebarOpen.value)
518
565
  }, {
519
566
  search: withCtx(() => [
520
567
  !mergedConfig.value.hideSearch ? (openBlock(), createBlock(_sfc_main$3, {
@@ -538,22 +585,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
538
585
  layout: "reference",
539
586
  options: mergedConfig.value,
540
587
  role: "navigation",
541
- onSelectItem: _cache[1] || (_cache[1] = (id) => handleSelectItem(id, "sidebar"))
588
+ onSelectItem: _cache[4] || (_cache[4] = (id) => handleSelectItem(id, "sidebar"))
542
589
  }, {
543
590
  header: withCtx(() => [
544
591
  documentOptionList.value.length > 1 ? (openBlock(), createBlock(_sfc_main$2, {
545
592
  key: 0,
593
+ class: "-mb-1 p-3 pb-0",
546
594
  modelValue: activeSlug.value,
547
595
  options: documentOptionList.value,
548
596
  "onUpdate:modelValue": changeSelectedDocument
549
597
  }, null, 8, ["modelValue", "options"])) : createCommentVNode("", true),
550
- !mergedConfig.value.hideSearch ? (openBlock(), createElementBlock("div", _hoisted_1, [
598
+ !mergedConfig.value.hideSearch ? (openBlock(), createElementBlock("div", _hoisted_3, [
551
599
  createVNode(_sfc_main$3, {
552
600
  document: unref(workspaceStore).workspace.activeDocument,
553
601
  eventBus: unref(eventBus),
554
602
  hideModels: mergedConfig.value.hideModels,
555
603
  searchHotKey: mergedConfig.value.searchHotKey
556
- }, null, 8, ["document", "eventBus", "hideModels", "searchHotKey"])
604
+ }, null, 8, ["document", "eventBus", "hideModels", "searchHotKey"]),
605
+ agentEnabled.value ? (openBlock(), createElementBlock("button", {
606
+ key: 0,
607
+ class: "bg-sidebar-b-search text-sidebar-c-2 hover:text-sidebar-c-1 flex items-center gap-1.5 rounded border px-2 text-base whitespace-nowrap",
608
+ type: "button",
609
+ onClick: _cache[2] || (_cache[2] = ($event) => showAgent.value = !showAgent.value)
610
+ }, [
611
+ createVNode(unref(ScalarIconSparkle)),
612
+ _cache[9] || (_cache[9] = createTextVNode(" Ask AI ", -1))
613
+ ])) : createCommentVNode("", true)
557
614
  ])) : createCommentVNode("", true),
558
615
  renderSlot(_ctx.$slots, "sidebar-start", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
559
616
  ]),
@@ -564,8 +621,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
564
621
  !mergedConfig.value.hideDarkModeToggle && !mergedConfig.value.forceDarkModeState ? (openBlock(), createBlock(unref(ScalarColorModeToggleButton), {
565
622
  key: 0,
566
623
  modelValue: colorMode.value === "dark",
567
- "onUpdate:modelValue": _cache[0] || (_cache[0] = () => unref(toggleColorMode)())
568
- }, null, 8, ["modelValue"])) : (openBlock(), createElementBlock("span", _hoisted_2))
624
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = () => unref(toggleColorMode)())
625
+ }, null, 8, ["modelValue"])) : (openBlock(), createElementBlock("span", _hoisted_4))
569
626
  ]),
570
627
  default: withCtx(() => [
571
628
  !mergedConfig.value.hideClientButton ? (openBlock(), createBlock(unref(OpenApiClientButton), {
@@ -604,7 +661,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
604
661
  unref(workspaceStore).workspace.activeDocument && unref(mediaQueries).lg.value ? (openBlock(), createBlock(_sfc_main$5, {
605
662
  key: 0,
606
663
  overrides: configurationOverrides.value,
607
- "onUpdate:overrides": _cache[3] || (_cache[3] = ($event) => configurationOverrides.value = $event),
664
+ "onUpdate:overrides": _cache[6] || (_cache[6] = ($event) => configurationOverrides.value = $event),
608
665
  configuration: mergedConfig.value,
609
666
  workspace: unref(workspaceStore)
610
667
  }, null, 8, ["overrides", "configuration", "workspace"])) : createCommentVNode("", true),
@@ -620,11 +677,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
620
677
  mode: colorMode.value,
621
678
  style: { "transform": "scale(1.4)" },
622
679
  variant: "icon",
623
- onClick: _cache[4] || (_cache[4] = () => unref(toggleColorMode)())
680
+ onClick: _cache[7] || (_cache[7] = () => unref(toggleColorMode)())
624
681
  }, null, 8, ["mode"])) : createCommentVNode("", true)
625
682
  ]),
626
683
  default: withCtx(() => [
627
- createElementVNode("div", _hoisted_4, [
684
+ createElementVNode("div", _hoisted_6, [
628
685
  documentOptionList.value.length > 1 ? (openBlock(), createBlock(_sfc_main$2, {
629
686
  key: 0,
630
687
  modelValue: activeSlug.value,
@@ -658,8 +715,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
658
715
  key: "0"
659
716
  } : void 0
660
717
  ]), 1032, ["document", "environment", "eventBus", "expandedItems", "headingSlugGenerator", "infoSectionId", "items", "options", "xScalarDefaultClient"])
661
- ], 8, _hoisted_3),
662
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_5, [
718
+ ], 8, _hoisted_5),
719
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_7, [
663
720
  renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
664
721
  ])) : createCommentVNode("", true),
665
722
  createElementVNode("div", {
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./LinkList.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const LinkList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0939d4d9"]]);
4
+ const LinkList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b59b0acf"]]);
5
5
  export {
6
6
  LinkList as default
7
7
  };
@@ -36,7 +36,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
36
  return openBlock(), createElementBlock("div", {
37
37
  ref_key: "containerRef",
38
38
  ref: containerRef,
39
- class: normalizeClass([{ "icons-only": needsScroll.value }, "custom-scroll mb-3 flex h-auto min-h-8 max-w-full items-center gap-2 overflow-x-auto text-xs whitespace-nowrap xl:mb-1.5"])
39
+ class: normalizeClass([{ "icons-only": needsScroll.value }, "custom-scroll mb-3 flex h-auto min-h-8 max-w-full items-center gap-2 overflow-x-auto text-base whitespace-nowrap xl:mb-1.5"])
40
40
  }, [
41
41
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
42
42
  ], 2);
@@ -1 +1 @@
1
- {"version":3,"file":"MobileHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/MobileHeader.vue"],"names":[],"mappings":"AAmFA,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,OAAO,CAAA;IACtB,WAAW,EAAE,OAAO,CAAA;CACrB,CAAC;AAQF,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,IAAI,KAAK,CAAA;IACjB,OAAO,CAAC,CAAC,KAAK,EAAE;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE,GAAG,KAAK,CAAA;IAClD,MAAM,CAAC,IAAI,KAAK,CAAA;CACjB,CAAC;AAkIF,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":"MobileHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/MobileHeader.vue"],"names":[],"mappings":"AAsFA,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,OAAO,CAAA;IACtB,WAAW,EAAE,OAAO,CAAA;CACrB,CAAC;AAQF,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,IAAI,KAAK,CAAA;IACjB,OAAO,CAAC,CAAC,KAAK,EAAE;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE,GAAG,KAAK,CAAA;IAClD,MAAM,CAAC,IAAI,KAAK,CAAA;CACjB,CAAC;AAqIF,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"}
@@ -2,7 +2,7 @@ import { defineComponent, renderSlot, createElementBlock, unref, normalizeProps,
2
2
  import { cva, ScalarIconButton } from "@scalar/components";
3
3
  import { ScalarIconX, ScalarIconList } from "@scalar/icons";
4
4
  import { useBreakpoints } from "@scalar/use-hooks/useBreakpoints";
5
- const _hoisted_1 = { class: "flex h-[var(--scalar-header-height)] w-full items-center border-b bg-inherit px-2" };
5
+ const _hoisted_1 = { class: "flex h-(--scalar-header-height) w-full items-center border-b bg-inherit px-2" };
6
6
  const _hoisted_2 = {
7
7
  key: 1,
8
8
  class: "flex-1 text-sm font-medium whitespace-nowrap"
@@ -20,10 +20,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20
20
  const emit = __emit;
21
21
  const { mediaQueries } = useBreakpoints();
22
22
  const variants = cva({
23
- base: "items-center bg-b-1 sticky top-0 z-1000",
23
+ base: "items-center bg-b-1 sticky top-(--scalar-custom-header-height) z-10",
24
24
  variants: {
25
25
  open: {
26
- true: "max-h-dvh h-dvh custom-scrollbar flex flex-col"
26
+ true: "h-(--refs-sidebar-height) custom-scrollbar flex flex-col"
27
27
  },
28
28
  lg: {
29
29
  true: "hidden [grid-area:header]"
@@ -31,7 +31,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
31
  }
32
32
  });
33
33
  return (_ctx, _cache) => {
34
- return unref(mediaQueries).lg.value ? renderSlot(_ctx.$slots, "sidebar", normalizeProps(mergeProps({ key: 0 }, { sidebarClasses: "sticky top-0 h-dvh [grid-area:navigation]" }))) : (openBlock(), createElementBlock("div", {
34
+ return unref(mediaQueries).lg.value ? renderSlot(_ctx.$slots, "sidebar", normalizeProps(mergeProps({ key: 0 }, {
35
+ sidebarClasses: "sticky top-(--refs-header-height) h-(--refs-sidebar-height) [grid-area:navigation]"
36
+ }))) : (openBlock(), createElementBlock("div", {
35
37
  key: 1,
36
38
  class: normalizeClass(["t-doc__header", unref(variants)({ open: __props.isSidebarOpen, lg: unref(mediaQueries).lg.value })])
37
39
  }, [
@@ -1,17 +1,13 @@
1
+ /** Scalar registry base url */
2
+ export declare const REGISTRY_URL: "https://registry.scalar.com";
1
3
  /** Registry URL where shared documents can be accessed */
2
4
  export declare const REGISTRY_SHARE_URL: "https://registry.scalar.com/share";
3
- /**
4
- * Scalar proxy service
5
- */
5
+ /** Scalar proxy service */
6
6
  export declare const PROXY_URL: "https://proxy.scalar.com";
7
- /**
8
- * API endpoint for uploading temporary documents
9
- * TODO: Update to production URL once available
10
- */
7
+ /** Scalar API base url */
8
+ export declare const API_BASE_URL = "https://api.scalar.com";
9
+ /** API endpoint for uploading temporary documents */
11
10
  export declare const UPLOAD_TEMP_API_URL: "https://api.scalar.com/core/share/upload/apis";
12
- /**
13
- * Editor preview URL for previewing a specific document
14
- * TODO: Update to production URL once available
15
- */
11
+ export declare const DASHBOARD_URL: "https://dashboard.scalar.com";
16
12
  export declare const DASHBOARD_REGISTER_URL: "https://dashboard.scalar.com/register";
17
13
  //# sourceMappingURL=urls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../../src/consts/urls.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB,EAAG,mCAA4C,CAAA;AAE9E;;GAEG;AACH,eAAO,MAAM,SAAS,EAAG,0BAAmC,CAAA;AAE5D;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAG,+CAAwD,CAAA;AAE3F;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAG,uCAAgD,CAAA"}
1
+ {"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../../src/consts/urls.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,eAAO,MAAM,YAAY,EAAG,6BAAsC,CAAA;AAElE,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB,qCAAmC,CAAA;AAElE,2BAA2B;AAC3B,eAAO,MAAM,SAAS,EAAG,0BAAmC,CAAA;AAE5D,0BAA0B;AAC1B,eAAO,MAAM,YAAY,2BAA2B,CAAA;AAEpD,qDAAqD;AACrD,eAAO,MAAM,mBAAmB,iDAAoD,CAAA;AAEpF,eAAO,MAAM,aAAa,EAAG,8BAAuC,CAAA;AACpE,eAAO,MAAM,sBAAsB,yCAAuC,CAAA"}
@@ -1,10 +1,16 @@
1
- const REGISTRY_SHARE_URL = "https://registry.scalar.com/share";
1
+ const REGISTRY_URL = "https://registry.scalar.com";
2
+ const REGISTRY_SHARE_URL = `${REGISTRY_URL}/share`;
2
3
  const PROXY_URL = "https://proxy.scalar.com";
3
- const UPLOAD_TEMP_API_URL = "https://api.scalar.com/core/share/upload/apis";
4
- const DASHBOARD_REGISTER_URL = "https://dashboard.scalar.com/register";
4
+ const API_BASE_URL = "https://api.scalar.com";
5
+ const UPLOAD_TEMP_API_URL = `${API_BASE_URL}/core/share/upload/apis`;
6
+ const DASHBOARD_URL = "https://dashboard.scalar.com";
7
+ const DASHBOARD_REGISTER_URL = `${DASHBOARD_URL}/register`;
5
8
  export {
9
+ API_BASE_URL,
6
10
  DASHBOARD_REGISTER_URL,
11
+ DASHBOARD_URL,
7
12
  PROXY_URL,
8
13
  REGISTRY_SHARE_URL,
14
+ REGISTRY_URL,
9
15
  UPLOAD_TEMP_API_URL
10
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ContentTypeSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ContentTypeSelect.vue"],"names":[],"mappings":"AA8EA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAKnG,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,CAAA;CACrD,CAAC;AAwCF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;CAClB,CAAC;;;;;;AAkIF,wBAOG"}
1
+ {"version":3,"file":"ContentTypeSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ContentTypeSelect.vue"],"names":[],"mappings":"AAmFA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAKnG,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,CAAA;CACrD,CAAC;AA0CF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;CAClB,CAAC;;;;;;AAqIF,wBAOG"}
@@ -1,8 +1,9 @@
1
- import { defineComponent, mergeModels, useModel, computed, createBlock, createElementBlock, openBlock, unref, withModifiers, withCtx, createVNode, normalizeClass, createElementVNode, createTextVNode, toDisplayString } from "vue";
1
+ import { defineComponent, mergeModels, useModel, computed, createBlock, createElementBlock, openBlock, unref, withModifiers, withCtx, createVNode, mergeProps, createElementVNode, createTextVNode, toDisplayString, normalizeClass } from "vue";
2
2
  import { cva, ScalarListbox, ScalarButton } from "@scalar/components";
3
3
  import { ScalarIconCaretDown } from "@scalar/icons";
4
4
  import ScreenReader from "../../../components/ScreenReader.vue.js";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ ...{ inheritAttrs: false },
6
7
  __name: "ContentTypeSelect",
7
8
  props: /* @__PURE__ */ mergeModels({
8
9
  content: {}
@@ -29,7 +30,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29
30
  }));
30
31
  });
31
32
  const contentTypeSelect = cva({
32
- base: "font-normal text-c-2 bg-b-2 py-0.75 flex cursor-pointer items-center gap-1 rounded-full text-xs",
33
+ base: "font-normal text-c-2 bg-b-2 py-1 flex cursor-pointer items-center gap-1 rounded-full text-xs leading-none",
33
34
  variants: {
34
35
  dropdown: {
35
36
  true: "border hover:text-c-1 pl-2 pr-1.5",
@@ -44,16 +45,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
44
45
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedOption.value = $event),
45
46
  options: options.value,
46
47
  placement: "bottom-end",
48
+ teleport: "",
47
49
  onClick: _cache[2] || (_cache[2] = withModifiers(() => {
48
50
  }, ["stop"]))
49
51
  }, {
50
52
  default: withCtx(({ open }) => [
51
- createVNode(unref(ScalarButton), {
52
- class: normalizeClass(["h-fit", unref(contentTypeSelect)({ dropdown: true })]),
53
- variant: "ghost",
53
+ createVNode(unref(ScalarButton), mergeProps({
54
+ class: ["h-fit", unref(contentTypeSelect)({ dropdown: true })],
55
+ variant: "ghost"
56
+ }, _ctx.$attrs, {
54
57
  onClick: _cache[0] || (_cache[0] = withModifiers(() => {
55
58
  }, ["stop"]))
56
- }, {
59
+ }), {
57
60
  default: withCtx(() => [
58
61
  createVNode(ScreenReader, null, {
59
62
  default: withCtx(() => [..._cache[3] || (_cache[3] = [
@@ -68,16 +71,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
68
71
  }, null, 8, ["class"])
69
72
  ]),
70
73
  _: 2
71
- }, 1032, ["class"])
74
+ }, 1040, ["class"])
72
75
  ]),
73
76
  _: 1
74
- }, 8, ["modelValue", "options"])) : (openBlock(), createElementBlock("div", {
77
+ }, 8, ["modelValue", "options"])) : (openBlock(), createElementBlock("div", mergeProps({
75
78
  key: 1,
76
- class: normalizeClass(["selected-content-type", unref(contentTypeSelect)({ dropdown: false })]),
77
- tabindex: "0"
78
- }, [
79
+ class: ["selected-content-type", unref(contentTypeSelect)({ dropdown: false })]
80
+ }, _ctx.$attrs, { tabindex: "0" }), [
79
81
  createElementVNode("span", null, toDisplayString(selectedContentType.value), 1)
80
- ], 2));
82
+ ], 16));
81
83
  };
82
84
  }
83
85
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ParameterListItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"names":[],"mappings":"AA2SA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EAEf,MAAM,8DAA8D,CAAA;AAIrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAKxE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,eAAe,GAAG,cAAc,CAAA;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,OAAO,EAAE,IAAI,CACX,cAAc,CAAC,SAAS,CAAC,EACzB,8BAA8B,GAAG,yBAAyB,CAC3D,CAAA;CACF,CAAC;;AA8UF,wBAMG"}
1
+ {"version":3,"file":"ParameterListItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"names":[],"mappings":"AAwSA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EAEf,MAAM,8DAA8D,CAAA;AAIrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAKxE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,eAAe,GAAG,cAAc,CAAA;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,OAAO,EAAE,IAAI,CACX,cAAc,CAAC,SAAS,CAAC,EACzB,8BAA8B,GAAG,yBAAyB,CAC3D,CAAA;CACF,CAAC;;AA8VF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./ParameterListItem.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const ParameterListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2b6dfab9"]]);
4
+ const ParameterListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c5dd25f2"]]);
5
5
  export {
6
6
  ParameterListItem as default
7
7
  };
@@ -84,15 +84,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
84
84
  value: __props.parameter.description
85
85
  }, null, 8, ["value"])) : (openBlock(), createElementBlock("div", _hoisted_3)),
86
86
  createElementVNode("div", {
87
- class: normalizeClass({
88
- "w-0 overflow-hidden group-focus-within/parameter-item:w-auto group-hover/parameter-item:w-auto": !open
89
- })
87
+ class: normalizeClass(["absolute top-[calc(14px+0.5lh)] right-0 z-0 flex -translate-y-1/2 items-center", {
88
+ "opacity-0 group-focus-within/parameter-item:opacity-100 group-hover/parameter-item:opacity-100": !open
89
+ }])
90
90
  }, [
91
+ _cache[1] || (_cache[1] = createElementVNode("div", { class: "from-b-1 absolute inset-y-0 -left-6 -z-1 w-8 bg-linear-to-l from-40% to-transparent" }, null, -1)),
91
92
  shouldCollapse.value && content.value ? (openBlock(), createBlock(_sfc_main$1, {
92
93
  key: 0,
93
94
  modelValue: selectedContentType.value,
94
95
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedContentType.value = $event),
95
- class: "",
96
96
  content: content.value
97
97
  }, null, 8, ["modelValue", "content"])) : createCommentVNode("", true)
98
98
  ], 2)
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleResponses.vue.d.ts","sourceRoot":"","sources":["../../../src/features/example-responses/ExampleResponses.vue"],"names":[],"mappings":"AAkYA,OAAO,KAAK,EAGV,eAAe,EAChB,MAAM,8DAA8D,CAAA;AAUrE;;GAEG;AAEH,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,eAAe,CAAA;CAC3B,CAAC;;AA+XF,wBAMG"}
1
+ {"version":3,"file":"ExampleResponses.vue.d.ts","sourceRoot":"","sources":["../../../src/features/example-responses/ExampleResponses.vue"],"names":[],"mappings":"AAuXA,OAAO,KAAK,EAEV,eAAe,EAChB,MAAM,8DAA8D,CAAA;AAUrE;;GAEG;AAEH,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,eAAe,CAAA;CAC3B,CAAC;;AAmXF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./ExampleResponses.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const ExampleResponses = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-97958459"]]);
4
+ const ExampleResponses = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8ea26797"]]);
5
5
  export {
6
6
  ExampleResponses as default
7
7
  };
@@ -1,4 +1,5 @@
1
1
  import { defineComponent, useId, computed, ref, watch, toValue, createBlock, createCommentVNode, openBlock, unref, withCtx, createVNode, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, withDirectives, createElementVNode, vModelCheckbox } from "vue";
2
+ import { getExample } from "@scalar/api-client/v2/blocks/operation-block";
2
3
  import { getResolvedRefDeep, ExamplePicker } from "@scalar/api-client/v2/blocks/operation-code-sample";
3
4
  import { ScalarCard, ScalarIcon, ScalarCardSection, ScalarCodeBlock, ScalarCardFooter, ScalarMarkdown } from "@scalar/components";
4
5
  import { normalizeMimeTypeObject, getObjectKeys } from "@scalar/oas-utils/helpers";
@@ -65,21 +66,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
65
66
  const selectedExampleKey = ref(
66
67
  Object.keys(currentResponseContent.value?.examples ?? {})[0] ?? ""
67
68
  );
68
- const getFirstResponseExample = () => {
69
- const response = toValue(currentResponseContent);
70
- if (!response) {
69
+ const currentExample = computed(() => {
70
+ if (!currentResponseContent.value) {
71
71
  return void 0;
72
72
  }
73
- if (Array.isArray(response.examples)) {
74
- return response.examples[0];
73
+ if (hasMultipleExamples.value && selectedExampleKey.value) {
74
+ return currentResponseContent.value.examples?.[selectedExampleKey.value];
75
75
  }
76
- const firstExampleKey = Object.keys(response.examples ?? {})[0] ?? "";
77
- const firstExample = response.examples?.[firstExampleKey];
78
- return firstExample;
79
- };
80
- const currentExample = computed(
81
- () => hasMultipleExamples.value && selectedExampleKey.value ? currentResponseContent.value?.examples?.[selectedExampleKey.value] : getFirstResponseExample()
82
- );
76
+ return getExample(currentResponseContent.value, void 0, void 0);
77
+ });
83
78
  const changeTab = (index) => {
84
79
  selectedResponseIndex.value = index;
85
80
  selectedExampleKey.value = "";
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/features/multiple-documents/DocumentSelector.vue"],"names":[],"mappings":"AAiDA,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACxC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;;;;;;AAoHF,wBAOG"}
1
+ {"version":3,"file":"DocumentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/features/multiple-documents/DocumentSelector.vue"],"names":[],"mappings":"AAqDA,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACxC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;;;;;;AAuHF,wBAOG"}
@@ -1,15 +1,15 @@
1
- import { defineComponent, computed, createElementBlock, createCommentVNode, openBlock, createVNode, unref, withCtx, createElementVNode, toDisplayString } from "vue";
1
+ import { defineComponent, computed, createElementBlock, createCommentVNode, openBlock, createVNode, unref, withCtx, createElementVNode, toDisplayString, normalizeClass } from "vue";
2
2
  import { ScalarListbox } from "@scalar/components";
3
- import { ScalarIconCaretUpDown } from "@scalar/icons";
3
+ import { ScalarIconCaretDown } from "@scalar/icons";
4
4
  const _hoisted_1 = {
5
5
  key: 0,
6
- class: "document-selector -mb-1 p-3 pb-0"
6
+ class: "document-selector p-3 pb-0"
7
7
  };
8
8
  const _hoisted_2 = {
9
- class: "group/dropdown-label hover:bg-b-2 text-c-2 flex h-8 w-full cursor-pointer items-center rounded border px-2 py-1.75",
9
+ class: "group/dropdown-label text-c-2 hover:text-c-1 flex w-full cursor-pointer items-center gap-1 font-medium",
10
10
  type: "button"
11
11
  };
12
- const _hoisted_3 = { class: "text-c-1 overflow-hidden text-base text-ellipsis" };
12
+ const _hoisted_3 = { class: "overflow-hidden text-base text-ellipsis" };
13
13
  const _sfc_main = /* @__PURE__ */ defineComponent({
14
14
  __name: "DocumentSelector",
15
15
  props: {
@@ -34,10 +34,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
34
34
  resize: "",
35
35
  "onUpdate:modelValue": _cache[0] || (_cache[0] = (e) => emit("update:modelValue", e.id))
36
36
  }, {
37
- default: withCtx(() => [
37
+ default: withCtx(({ open }) => [
38
38
  createElementVNode("button", _hoisted_2, [
39
- createVNode(unref(ScalarIconCaretUpDown), { class: "mr-1 size-4 text-current" }),
40
- createElementVNode("span", _hoisted_3, toDisplayString(selected.value?.label || "Select API"), 1)
39
+ createElementVNode("span", _hoisted_3, toDisplayString(selected.value?.label || "Select API"), 1),
40
+ createVNode(unref(ScalarIconCaretDown), {
41
+ class: normalizeClass(["size-3 text-current transition-transform", { "rotate-180": open }]),
42
+ weight: "bold"
43
+ }, null, 8, ["class"])
41
44
  ])
42
45
  ]),
43
46
  _: 1